@adaptive-ai/sdk 0.1.32 → 0.1.34

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.
@@ -149,56 +149,66 @@ declare const oauthProviderRecognizedScopes: {
149
149
  "read_reports",
150
150
  "read_all_orders",
151
151
  "write_discounts",
152
- "write_fulfillments"
152
+ "write_fulfillments",
153
+ "read_files",
154
+ "write_files",
155
+ "read_content",
156
+ "write_content",
157
+ "read_metaobjects",
158
+ "write_metaobjects",
159
+ "read_price_rules",
160
+ "write_price_rules"
153
161
  ];
154
162
  readonly SLACK: readonly [
155
- "users:write",
156
- "im:write",
157
- "chat:write",
158
- "reactions:write",
163
+ "canvases:read",
164
+ "channels:history",
159
165
  "channels:read",
160
- "groups:read",
166
+ "chat:write",
167
+ "dnd:read",
168
+ "emoji:read",
169
+ "files:read",
161
170
  "groups:history",
171
+ "groups:read",
162
172
  "im:history",
163
- "mpim:history",
164
173
  "im:read",
174
+ "im:write",
175
+ "mpim:history",
165
176
  "mpim:read",
166
- "canvases:read",
167
- "channels:history",
168
- "files:read",
177
+ "mpim:write",
169
178
  "reactions:read",
179
+ "reactions:write",
180
+ "search:read",
170
181
  "users:read",
171
- "dnd:read",
172
- "emoji:read",
173
- "mpim:write",
174
- "search:read"
182
+ "users:write"
175
183
  ];
176
184
  readonly SLACK_BOT: readonly [
177
- "users:write",
178
- "im:write",
179
- "chat:write",
180
- "reactions:write",
185
+ "app_mentions:read",
186
+ "assistant:write",
187
+ "canvases:read",
188
+ "channels:history",
189
+ "channels:join",
181
190
  "channels:read",
182
- "groups:read",
191
+ "chat:write",
192
+ "chat:write.customize",
193
+ "chat:write.public",
194
+ "dnd:read",
195
+ "emoji:read",
196
+ "files:read",
183
197
  "groups:history",
198
+ "groups:read",
184
199
  "im:history",
185
- "mpim:history",
186
200
  "im:read",
201
+ "im:write",
202
+ "incoming-webhook",
203
+ "links:read",
204
+ "mpim:history",
187
205
  "mpim:read",
188
- "canvases:read",
189
- "channels:history",
190
- "files:read",
206
+ "mpim:write",
207
+ "pins:read",
191
208
  "reactions:read",
192
- "users:read",
193
- "dnd:read",
194
- "emoji:read",
195
- "app_mentions:read",
196
- "chat:write.customize",
197
- "assistant:write",
198
- "commands",
199
- "channels:join",
200
- "chat:write.public",
201
- "incoming-webhook"
209
+ "reactions:write",
210
+ "team:read",
211
+ "users:read"
202
212
  ];
203
213
  readonly DISCORD: readonly [
204
214
  "identify",
@@ -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 Ln=Object.create;var Pt=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames;var Nn=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty;var nt=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports);var Hn=(o,n,E,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Fn(n))!Bn.call(o,e)&&e!==E&&Pt(o,e,{get:()=>n[e],enumerable:!(c=Dn(n,e))||c.enumerable});return o};var Ot=(o,n,E)=>(E=o!=null?Ln(Nn(o)):{},Hn(Pt(E,"default",{value:o,enumerable:true}),o));var Qt=nt((st,at)=>{(o=>{let n=(()=>{let R=0;return {escape:function(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(r){return r.search(/^(data:)/)!==-1},canvasToBlob:function(r){return r.toBlob?new Promise(function(m){r.toBlob(m);}):(m=>new Promise(function(A){var y=a(m.toDataURL().split(",")[1]),T=y.length,w=new Uint8Array(T);for(let h=0;h<T;h++)w[h]=y.charCodeAt(h);A(new Blob([w],{type:"image/png"}));}))(r)},resolveUrl:function(r,m){var A=globalThis.document.implementation.createHTMLDocument(),y=A.createElement("base"),T=(A.head.appendChild(y),A.createElement("a"));return A.body.appendChild(T),y.href=m,T.href=r,T.href},getAndEncode:function(r){let m=_.impl.urlCache.find(function(A){return A.url===r});return m||(m={url:r,promise:null},_.impl.urlCache.push(m)),m.promise===null&&(_.impl.options.cacheBust&&(r+=(/\?/.test(r)?"&":"?")+new Date().getTime()),m.promise=new Promise(function(A){let y=new XMLHttpRequest;function T(U){console.error(U),A("");}function w(){var U=_.impl.options.imagePlaceholder;U?A(U):T("Status:"+y.status+" while fetching resource: "+r);}if(y.timeout=_.impl.options.httpTimeout,y.onerror=w,y.ontimeout=w,y.onloadend=function(){if(y.readyState===XMLHttpRequest.DONE){var U=y.status;if(U===0&&r.toLowerCase().startsWith("file://")||200<=U&&U<=300&&y.response!==null){U=y.response,U instanceof Blob||T("Expected response to be a Blob, but got: "+typeof U);let P=new globalThis.FileReader;P.onloadend=function(){var x=P.result;A(x);};try{P.readAsDataURL(U);}catch(x){T("Failed to read the response as Data URL: "+x.toString());}}else w();}},0<_.impl.options.useCredentialsFilters.length&&(_.impl.options.useCredentials=0<_.impl.options.useCredentialsFilters.filter(U=>0<=r.search(U)).length),_.impl.options.useCredentials&&(y.withCredentials=true),_.impl.options.corsImg&&r.indexOf("http")===0&&r.indexOf(globalThis.window.location.origin)===-1){var h=(_.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";y.open(h,(_.impl.options.corsImg.url||"").replace("#{cors}",r),true);let U=false,P=_.impl.options.corsImg.headers||{},x=(Object.keys(P).forEach(function(H){P[H].indexOf("application/json")!==-1&&(U=true),y.setRequestHeader(H,P[H]);}),(H=>{try{return JSON.parse(JSON.stringify(H))}catch(L){T("corsImg.data is missing or invalid:"+L.toString());}})(_.impl.options.corsImg.data||""));Object.keys(x).forEach(function(H){typeof x[H]=="string"&&(x[H]=x[H].replace("#{cors}",r));}),y.responseType="blob",y.send(U?JSON.stringify(x):x);}else y.open("GET",r,true),y.responseType="blob",y.send();})),m.promise},uid:function(){return "u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+R++},asArray:function(r){var m=[],A=r.length;for(let y=0;y<A;y++)m.push(r[y]);return m},escapeXhtml:function(r){return r.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(r){return r!=="data:,"?new Promise(function(m,A){let y=globalThis.document.createElementNS("http://www.w3.org/2000/svg","svg"),T=new globalThis.Image;_.impl.options.useCredentials&&(T.crossOrigin="use-credentials"),T.onload=function(){globalThis.document.body.removeChild(y),globalThis.window&&globalThis.window.requestAnimationFrame?globalThis.window.requestAnimationFrame(function(){m(T);}):m(T);},T.onerror=w=>{globalThis.document.body.removeChild(y),A(w);},y.appendChild(T),T.src=r,globalThis.document.body.appendChild(y);}):Promise.resolve()},width:function(r){var m=b(r,"width");if(!isNaN(m))return m;var m=b(r,"border-left-width"),A=b(r,"border-right-width");return r.scrollWidth+m+A},height:function(r){var m=b(r,"height");if(!isNaN(m))return m;var m=b(r,"border-top-width"),A=b(r,"border-bottom-width");return r.scrollHeight+m+A},getWindow:g,isElement:f,isElementHostForOpenShadowRoot:function(r){return f(r)&&r.shadowRoot!==null},isShadowRoot:M,isInShadowRoot:p,isHTMLElement:function(r){return r instanceof g(r).HTMLElement},isHTMLCanvasElement:function(r){return r instanceof g(r).HTMLCanvasElement},isHTMLInputElement:function(r){return r instanceof g(r).HTMLInputElement},isHTMLImageElement:function(r){return r instanceof g(r).HTMLImageElement},isHTMLLinkElement:function(r){return r instanceof g(r).HTMLLinkElement},isHTMLScriptElement:function(r){return r instanceof g(r).HTMLScriptElement},isHTMLStyleElement:function(r){return r instanceof g(r).HTMLStyleElement},isHTMLTextAreaElement:function(r){return r instanceof g(r).HTMLTextAreaElement},isShadowSlotElement:function(r){return p(r)&&r instanceof g(r).HTMLSlotElement},isSVGElement:function(r){return r instanceof g(r).SVGElement},isSVGRectElement:function(r){return r instanceof g(r).SVGRectElement},isDimensionMissing:function(r){return isNaN(r)||r<=0}};function g(r){return r=r?r.ownerDocument:void 0,(r?r.defaultView:void 0)||globalThis.window||o}function M(r){return r instanceof g(r).ShadowRoot}function p(r){return r!=null&&r.getRootNode!==void 0&&M(r.getRootNode())}function f(r){return r instanceof g(r).Element}function b(r,m){if(r.nodeType===S){let A=s(r).getPropertyValue(m);if(A.slice(-2)==="px")return A=A.slice(0,-2),parseFloat(A)}return NaN}})(),E=(()=>{let R=/url\(\s*(["']?)((?:\\.|[^\\)])+)\1\s*\)/gm;return {inlineAll:function(b,r,m){return g(b)?Promise.resolve(b).then(M).then(function(A){let y=Promise.resolve(b);return A.forEach(function(T){y=y.then(function(w){return f(w,T,r,m)});}),y}):Promise.resolve(b)},shouldProcess:g,impl:{readUrls:M,inline:f,urlAsRegex:p}};function g(b){return b.search(R)!==-1}function M(b){for(var r,m=[];(r=R.exec(b))!==null;)m.push(r[2]);return m.filter(function(A){return !n.isDataUrl(A)})}function p(b){return new RegExp(`url\\((["']?)(${n.escape(b)})\\1\\)`,"gm")}function f(b,r,m,A){return Promise.resolve(r).then(function(y){return m?n.resolveUrl(y,m):y}).then(A||n.getAndEncode).then(function(y){var T=p(r);return b.replace(T,`url($1${y}$1)`)})}})(),c={resolveAll:function(){return e().then(function(R){return Promise.all(R.map(function(g){return g.resolve()}))}).then(function(R){return R.join(`
2
- `)})},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(globalThis.document.styleSheets)).then(function(g){let M=[];return g.forEach(function(p){var f=Object.getPrototypeOf(p);if(Object.prototype.hasOwnProperty.call(f,"cssRules"))try{n.asArray(p.cssRules||[]).forEach(M.push.bind(M));}catch(b){console.error("domtoimage: Error while reading CSS rules from: "+p.href,b.toString());}}),M}).then(function(g){return g.filter(function(M){return M.type===CSSRule.FONT_FACE_RULE}).filter(function(M){return E.shouldProcess(M.style.getPropertyValue("src"))})}).then(function(g){return g.map(R)});function R(g){return {resolve:function(){var M=(g.parentStyleSheet||{}).href;return E.inlineAll(g.cssText,M)},src:function(){return g.style.getPropertyValue("src")}}}}let t={inlineAll:function R(g){if(!n.isElement(g))return Promise.resolve(g);return M(g).then(function(){return n.isHTMLImageElement(g)?d(g).inline():Promise.all(n.asArray(g.childNodes).map(function(p){return R(p)}))});function M(p){let f=["background","background-image"],b=f.map(function(r){let m=p.style.getPropertyValue(r),A=p.style.getPropertyPriority(r);return m?E.inlineAll(m).then(function(y){p.style.setProperty(r,y,A);}):Promise.resolve()});return Promise.all(b).then(function(){return p})}},impl:{newImage:d}};function d(R){return {inline:function(g){return n.isDataUrl(R.src)?Promise.resolve():Promise.resolve(R.src).then(g||n.getAndEncode).then(function(M){return new Promise(function(p){R.onload=p,R.onerror=p,R.src=M;})})}}}let l={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},_={toSvg:i,toPng:function(R,g){return u(R,g).then(function(M){return M.toDataURL()})},toJpeg:function(R,g){return u(R,g).then(function(M){return M.toDataURL("image/jpeg",(g?g.quality:void 0)||1)})},toBlob:function(R,g){return u(R,g).then(n.canvasToBlob)},toPixelData:function(R,g){return u(R,g).then(function(M){return M.getContext("2d").getImageData(0,0,n.width(R),n.height(R)).data})},toCanvas:u,impl:{fontFaces:c,images:t,util:n,inliner:E,urlCache:[],options:{},copyOptions:function(R){R.copyDefaultStyles===void 0?_.impl.options.copyDefaultStyles=l.copyDefaultStyles:_.impl.options.copyDefaultStyles=R.copyDefaultStyles,_.impl.options.imagePlaceholder=(R.imagePlaceholder===void 0?l:R).imagePlaceholder,_.impl.options.cacheBust=(R.cacheBust===void 0?l:R).cacheBust,_.impl.options.corsImg=(R.corsImg===void 0?l:R).corsImg,_.impl.options.useCredentials=(R.useCredentials===void 0?l:R).useCredentials,_.impl.options.useCredentialsFilters=(R.useCredentialsFilters===void 0?l:R).useCredentialsFilters,_.impl.options.httpTimeout=(R.httpTimeout===void 0?l:R).httpTimeout,_.impl.options.styleCaching=(R.styleCaching===void 0?l:R).styleCaching;}}},S=(typeof st=="object"&&typeof at=="object"?at.exports=_:o.domtoimage=_,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),s=(o===void 0?void 0:o.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(o===void 0?void 0:o.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function i(R,g){_.impl.util.getWindow(R);let p=(g=g||{},_.impl.copyOptions(g),[]);return Promise.resolve(R).then(function(f){if(f.nodeType===S)return f;var b=f,r=globalThis.document.createElement("span");return b.replaceWith(r),r.append(f),p.push({child:b,wrapper:r}),r}).then(function(f){return (function b(r,m,A,y){let T=m.filter;if(r===v||n.isHTMLScriptElement(r)||n.isHTMLStyleElement(r)||n.isHTMLLinkElement(r)||A!==null&&T&&!T(r))return Promise.resolve();return Promise.resolve(r).then(w).then(h).then(function(L){return x(L,P(r))}).then(U).then(function(L){return H(L,r)});function w(L){return n.isHTMLCanvasElement(L)?n.makeImage(L.toDataURL()):L.cloneNode(false)}function h(L){return m.adjustClonedNode&&m.adjustClonedNode(r,L,false),Promise.resolve(L)}function U(L){return m.adjustClonedNode&&m.adjustClonedNode(r,L,true),Promise.resolve(L)}function P(L){return n.isElementHostForOpenShadowRoot(L)?L.shadowRoot:L}function x(L,V){let B=K(V),D=Promise.resolve();if(B.length!==0){let G=s($(V));n.asArray(B).forEach(function(Q){D=D.then(function(){return b(Q,m,G).then(function(q){q&&L.appendChild(q);})});});}return D.then(function(){return L});function $(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(D).then($).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 D(){function Q(z,W){W.font=z.font,W.fontFamily=z.fontFamily,W.fontFeatureSettings=z.fontFeatureSettings,W.fontKerning=z.fontKerning,W.fontSize=z.fontSize,W.fontStretch=z.fontStretch,W.fontStyle=z.fontStyle,W.fontVariant=z.fontVariant,W.fontVariantCaps=z.fontVariantCaps,W.fontVariantEastAsian=z.fontVariantEastAsian,W.fontVariantLigatures=z.fontVariantLigatures,W.fontVariantNumeric=z.fontVariantNumeric,W.fontVariationSettings=z.fontVariationSettings,W.fontWeight=z.fontWeight;}function q(z,W){let ie=s(z);ie.cssText?(W.style.cssText=ie.cssText,Q(ie,W.style)):(C(m,z,ie,A,W),A===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(se=>W.style.removeProperty(se)),["left","right","top","bottom"].forEach(se=>{W.style.getPropertyValue(se)&&W.style.setProperty(se,"0px");})));}q(V,L);}function $(){let Q=n.uid();function q(z){let W=s(V,z),ie=W.getPropertyValue("content");if(ie!==""&&ie!=="none"){let J=function(){let X=`.${Q}:`+z,ne=(W.cssText?oe:j)();return globalThis.document.createTextNode(X+`{${ne}}`);function oe(){return `${W.cssText} content: ${ie};`}function j(){return n.asArray(W).map(ee).join("; ")+";";function ee(Y){let ce=W.getPropertyValue(Y),ge=W.getPropertyPriority(Y)?" !important":"";return Y+": "+ce+ge}}};let Z=L.getAttribute("class")||"",te=(L.setAttribute("class",Z+" "+Q),globalThis.document.createElement("style"));te.appendChild(J()),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,g,null)}).then(g.disableEmbedFonts?Promise.resolve(R):I).then(g.disableInlineImages?Promise.resolve(R):O).then(function(f){g.bgcolor&&(f.style.backgroundColor=g.bgcolor),g.width&&(f.style.width=g.width+"px"),g.height&&(f.style.height=g.height+"px"),g.style&&Object.keys(g.style).forEach(function(r){f.style[r]=g.style[r];});let b=null;return typeof g.onclone=="function"&&(b=g.onclone(f)),Promise.resolve(b).then(function(){return f})}).then(function(f){let b=g.width||n.width(R),r=g.height||n.height(R);return Promise.resolve(f).then(function(m){return m.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(m)}).then(n.escapeXhtml).then(function(m){var A=(n.isDimensionMissing(b)?' width="100%"':` width="${b}"`)+(n.isDimensionMissing(r)?' height="100%"':` height="${r}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(b)?"":` width="${b}"`)+(n.isDimensionMissing(r)?"":` height="${r}"`)}><foreignObject${A}>${m}</foreignObject></svg>`}).then(function(m){return "data:image/svg+xml;charset=utf-8,"+m})}).then(function(f){for(;0<p.length;){var b=p.pop();b.wrapper.replaceWith(b.child);}return f}).then(function(f){return _.impl.urlCache=[],v&&(globalThis.document.body.removeChild(v),v=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,F={};},2e4),f})}function u(R,g){return i(R,g=g||{}).then(n.makeImage).then(function(M){var p=typeof g.scale!="number"?1:g.scale,f=((r,m)=>{let A=g.width||n.width(r),y=g.height||n.height(r);return n.isDimensionMissing(A)&&(A=n.isDimensionMissing(y)?300:2*y),n.isDimensionMissing(y)&&(y=A/2),(r=globalThis.document.createElement("canvas")).width=A*m,r.height=y*m,g.bgcolor&&((m=r.getContext("2d")).fillStyle=g.bgcolor,m.fillRect(0,0,r.width,r.height)),r})(R,p),b=f.getContext("2d");return b.msImageSmoothingEnabled=false,b.imageSmoothingEnabled=false,M&&(b.scale(p,p),b.drawImage(M,0,0)),f})}let v=null;function I(R){return c.resolveAll().then(function(g){var M;return g!==""&&(M=globalThis.document.createElement("style"),R.appendChild(M),M.appendChild(globalThis.document.createTextNode(g))),R})}function O(R){return t.inlineAll(R).then(function(){return R})}function C(R,g,M,p,f){let b=_.impl.options.copyDefaultStyles?((m,A)=>{var y,T=(U=>(m.styleCaching!=="relaxed"?U:U.filter((P,x,H)=>x===0||x===H.length-1)).join(">"))(A=(U=>{var P=[];do if(U.nodeType===S){var x=U.tagName;if(P.push(x),k.includes(x))break}while(U=U.parentNode);return P})(A));{if(F[T])return F[T];A=((U,P)=>{let x=U.body;do{var H=P.pop(),H=U.createElement(H);x.appendChild(H),x=H;}while(0<P.length);return x.textContent="\u200B",x})((y=(()=>{if(v)return v.contentWindow;P=globalThis.document.characterSet||"UTF-8",U=(U=globalThis.document.doctype)?(`<!DOCTYPE ${D(U.name)} ${D(U.publicId)} `+D(U.systemId)).trim()+">":"",(v=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),v.style.top="-9999px",v.style.visibility="hidden",v.style.position="fixed",globalThis.document.body.appendChild(v);var U,P,x=v,H="domtoimage-sandbox";try{return x.contentWindow.document.write(U+`<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),U+V.documentElement.outerHTML);return x.setAttribute("srcdoc",B),x.contentWindow}catch{}return x.contentDocument.head.appendChild(L),x.contentDocument.title=H,x.contentWindow;function D($){var K;return $?((K=globalThis.document.createElement("div")).innerText=$,K.innerHTML):""}})()).document,A),y=((U,P)=>{let x={},H=U.getComputedStyle(P);return n.asArray(H).forEach(function(L){x[L]=L==="width"||L==="height"?"auto":H.getPropertyValue(L);}),x})(y,A);var w=A;do{var h=w.parentElement;h!==null&&h.removeChild(w),w=h;}while(w&&w.tagName!=="BODY");return F[T]=y}})(R,g):{},r=f.style;n.asArray(M).forEach(function(m){var A,y,T,w;R.filterStyles&&!R.filterStyles(g,m)||(y=M.getPropertyValue(m),T=b[m],A=p?p.getPropertyValue(m):void 0,r.getPropertyValue(m))||(y!==T||p&&y!==A)&&(T=M.getPropertyPriority(m),A=r,y=y,T=T,w=0<=["background-clip"].indexOf(m=m),T?(A.setProperty(m,y,T),w&&A.setProperty("-webkit-"+m,y,T)):(A.setProperty(m,y),w&&A.setProperty("-webkit-"+m,y)));});}let N=null,F={},k=["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"];})(st);});var zt=nt(()=>{});var pn=nt((oo,dn)=>{var wt=typeof Map=="function"&&Map.prototype,ct=Object.getOwnPropertyDescriptor&&wt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ye=wt&&ct&&typeof ct.get=="function"?ct.get:null,Gt=wt&&Map.prototype.forEach,yt=typeof Set=="function"&&Set.prototype,lt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Je=yt&&lt&&typeof lt.get=="function"?lt.get:null,qt=yt&&Set.prototype.forEach,Yn=typeof WeakMap=="function"&&WeakMap.prototype,Ne=Yn?WeakMap.prototype.has:null,Jn=typeof WeakSet=="function"&&WeakSet.prototype,Be=Jn?WeakSet.prototype.has:null,Xn=typeof WeakRef=="function"&&WeakRef.prototype,Kt=Xn?WeakRef.prototype.deref:null,Zn=Boolean.prototype.valueOf,jn=Object.prototype.toString,er=Function.prototype.toString,tr=String.prototype.match,vt=String.prototype.slice,Ee=String.prototype.replace,nr=String.prototype.toUpperCase,Yt=String.prototype.toLowerCase,on=RegExp.prototype.test,Jt=Array.prototype.concat,ye=Array.prototype.join,rr=Array.prototype.slice,Xt=Math.floor,dt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ut=Object.getOwnPropertySymbols,pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",He=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ke||true)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,Zt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function jt(o,n){if(o===1/0||o===-1/0||o!==o||o&&o>-1e3&&o<1e3||on.call(/e/,n))return n;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof o=="number"){var c=o<0?-Xt(-o):Xt(o);if(c!==o){var e=String(c),t=vt.call(n,e.length+1);return Ee.call(e,E,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(n,E,"$&_")}var ht=zt(),en=ht.custom,tn=ln(en)?en:null,an={__proto__:null,double:'"',single:"'"},or={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};dn.exports=function o(n,E,c,e){var t=E||{};if(_e(t,"quoteStyle")&&!_e(an,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_e(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 d=_e(t,"customInspect")?t.customInspect:true;if(typeof d!="boolean"&&d!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_e(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(_e(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=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 fn(n,t);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var _=String(n);return l?jt(n,_):_}if(typeof n=="bigint"){var S=String(n)+"n";return l?jt(n,S):S}var s=typeof t.depth>"u"?5:t.depth;if(typeof c>"u"&&(c=0),c>=s&&s>0&&typeof n=="object")return gt(n)?"[Array]":"[Object]";var a=br(t,c);if(typeof e>"u")e=[];else if(un(e,n)>=0)return "[Circular]";function i(A,y,T){if(y&&(e=rr.call(e),e.push(y)),T){var w={depth:t.depth};return _e(t,"quoteStyle")&&(w.quoteStyle=t.quoteStyle),o(A,w,c+1,e)}return o(A,t,c+1,e)}if(typeof n=="function"&&!nn(n)){var u=pr(n),v=Ke(n,i);return "[Function"+(u?": "+u:" (anonymous)")+"]"+(v.length>0?" { "+ye.call(v,", ")+" }":"")}if(ln(n)){var I=ke?Ee.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(n);return typeof n=="object"&&!ke?Fe(I):I}if(vr(n)){for(var O="<"+Yt.call(String(n.nodeName)),C=n.attributes||[],N=0;N<C.length;N++)O+=" "+C[N].name+"="+cn(ir(C[N].value),"double",t);return O+=">",n.childNodes&&n.childNodes.length&&(O+="..."),O+="</"+Yt.call(String(n.nodeName))+">",O}if(gt(n)){if(n.length===0)return "[]";var F=Ke(n,i);return a&&!Ar(F)?"["+mt(F,a)+"]":"[ "+ye.call(F,", ")+" ]"}if(ar(n)){var k=Ke(n,i);return !("cause"in Error.prototype)&&"cause"in n&&!sn.call(n,"cause")?"{ ["+String(n)+"] "+ye.call(Jt.call("[cause]: "+i(n.cause),k),", ")+" }":k.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+ye.call(k,", ")+" }"}if(typeof n=="object"&&d){if(tn&&typeof n[tn]=="function"&&ht)return ht(n,{depth:s-c});if(d!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(hr(n)){var R=[];return Gt&&Gt.call(n,function(A,y){R.push(i(y,n,true)+" => "+i(A,n));}),rn("Map",Ye.call(n),R,a)}if(wr(n)){var g=[];return qt&&qt.call(n,function(A){g.push(i(A,n));}),rn("Set",Je.call(n),g,a)}if(gr(n))return ft("WeakMap");if(yr(n))return ft("WeakSet");if(mr(n))return ft("WeakRef");if(lr(n))return Fe(i(Number(n)));if(fr(n))return Fe(i(dt.call(n)));if(ur(n))return Fe(Zn.call(n));if(cr(n))return Fe(i(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(!sr(n)&&!nn(n)){var M=Ke(n,i),p=Zt?Zt(n)===Object.prototype:n instanceof Object||n.constructor===Object,f=n instanceof Object?"":"null prototype",b=!p&&He&&Object(n)===n&&He in n?vt.call(Se(n),8,-1):f?"Object":"",r=p||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",m=r+(b||f?"["+ye.call(Jt.call([],b||[],f||[]),": ")+"] ":"");return M.length===0?m+"{}":a?m+"{"+mt(M,a)+"}":m+"{ "+ye.call(M,", ")+" }"}return String(n)};function cn(o,n,E){var c=E.quoteStyle||n,e=an[c];return e+o+e}function ir(o){return Ee.call(String(o),/"/g,"&quot;")}function Pe(o){return !He||!(typeof o=="object"&&(He in o||typeof o[He]<"u"))}function gt(o){return Se(o)==="[object Array]"&&Pe(o)}function sr(o){return Se(o)==="[object Date]"&&Pe(o)}function nn(o){return Se(o)==="[object RegExp]"&&Pe(o)}function ar(o){return Se(o)==="[object Error]"&&Pe(o)}function cr(o){return Se(o)==="[object String]"&&Pe(o)}function lr(o){return Se(o)==="[object Number]"&&Pe(o)}function ur(o){return Se(o)==="[object Boolean]"&&Pe(o)}function ln(o){if(ke)return o&&typeof o=="object"&&o instanceof Symbol;if(typeof o=="symbol")return true;if(!o||typeof o!="object"||!pt)return false;try{return pt.call(o),!0}catch{}return false}function fr(o){if(!o||typeof o!="object"||!dt)return false;try{return dt.call(o),!0}catch{}return false}var dr=Object.prototype.hasOwnProperty||function(o){return o in this};function _e(o,n){return dr.call(o,n)}function Se(o){return jn.call(o)}function pr(o){if(o.name)return o.name;var n=tr.call(er.call(o),/^function\s*([\w$]+)/);return n?n[1]:null}function un(o,n){if(o.indexOf)return o.indexOf(n);for(var E=0,c=o.length;E<c;E++)if(o[E]===n)return E;return -1}function hr(o){if(!Ye||!o||typeof o!="object")return false;try{Ye.call(o);try{Je.call(o);}catch{return !0}return o instanceof Map}catch{}return false}function gr(o){if(!Ne||!o||typeof o!="object")return false;try{Ne.call(o,Ne);try{Be.call(o,Be);}catch{return !0}return o instanceof WeakMap}catch{}return false}function mr(o){if(!Kt||!o||typeof o!="object")return false;try{return Kt.call(o),!0}catch{}return false}function wr(o){if(!Je||!o||typeof o!="object")return false;try{Je.call(o);try{Ye.call(o);}catch{return !0}return o instanceof Set}catch{}return false}function yr(o){if(!Be||!o||typeof o!="object")return false;try{Be.call(o,Be);try{Ne.call(o,Ne);}catch{return !0}return o instanceof WeakSet}catch{}return false}function vr(o){return !o||typeof o!="object"?false:typeof HTMLElement<"u"&&o instanceof HTMLElement?true:typeof o.nodeName=="string"&&typeof o.getAttribute=="function"}function fn(o,n){if(o.length>n.maxStringLength){var E=o.length-n.maxStringLength,c="... "+E+" more character"+(E>1?"s":"");return fn(vt.call(o,0,n.maxStringLength),n)+c}var e=or[n.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(o,e,"\\$1"),/[\x00-\x1f]/g,_r);return cn(t,"single",n)}function _r(o){var n=o.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return E?"\\"+E:"\\x"+(n<16?"0":"")+nr.call(n.toString(16))}function Fe(o){return "Object("+o+")"}function ft(o){return o+" { ? }"}function rn(o,n,E,c){var e=c?mt(E,c):ye.call(E,", ");return o+" ("+n+") {"+e+"}"}function Ar(o){for(var n=0;n<o.length;n++)if(un(o[n],`
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 Ln=Object.create;var Pt=Object.defineProperty;var Dn=Object.getOwnPropertyDescriptor;var Fn=Object.getOwnPropertyNames;var Nn=Object.getPrototypeOf,Bn=Object.prototype.hasOwnProperty;var nt=(o,n)=>()=>(n||o((n={exports:{}}).exports,n),n.exports);var Hn=(o,n,E,c)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Fn(n))!Bn.call(o,e)&&e!==E&&Pt(o,e,{get:()=>n[e],enumerable:!(c=Dn(n,e))||c.enumerable});return o};var Ot=(o,n,E)=>(E=o!=null?Ln(Nn(o)):{},Hn(Pt(E,"default",{value:o,enumerable:true}),o));var Qt=nt((st,at)=>{(o=>{let n=(()=>{let R=0;return {escape:function(r){return r.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(r){return r.search(/^(data:)/)!==-1},canvasToBlob:function(r){return r.toBlob?new Promise(function(m){r.toBlob(m);}):(m=>new Promise(function(A){var y=a(m.toDataURL().split(",")[1]),T=y.length,w=new Uint8Array(T);for(let h=0;h<T;h++)w[h]=y.charCodeAt(h);A(new Blob([w],{type:"image/png"}));}))(r)},resolveUrl:function(r,m){var A=globalThis.document.implementation.createHTMLDocument(),y=A.createElement("base"),T=(A.head.appendChild(y),A.createElement("a"));return A.body.appendChild(T),y.href=m,T.href=r,T.href},getAndEncode:function(r){let m=v.impl.urlCache.find(function(A){return A.url===r});return m||(m={url:r,promise:null},v.impl.urlCache.push(m)),m.promise===null&&(v.impl.options.cacheBust&&(r+=(/\?/.test(r)?"&":"?")+new Date().getTime()),m.promise=new Promise(function(A){let y=new XMLHttpRequest;function T(U){console.error(U),A("");}function w(){var U=v.impl.options.imagePlaceholder;U?A(U):T("Status:"+y.status+" while fetching resource: "+r);}if(y.timeout=v.impl.options.httpTimeout,y.onerror=w,y.ontimeout=w,y.onloadend=function(){if(y.readyState===XMLHttpRequest.DONE){var U=y.status;if(U===0&&r.toLowerCase().startsWith("file://")||200<=U&&U<=300&&y.response!==null){U=y.response,U instanceof Blob||T("Expected response to be a Blob, but got: "+typeof U);let P=new globalThis.FileReader;P.onloadend=function(){var x=P.result;A(x);};try{P.readAsDataURL(U);}catch(x){T("Failed to read the response as Data URL: "+x.toString());}}else w();}},0<v.impl.options.useCredentialsFilters.length&&(v.impl.options.useCredentials=0<v.impl.options.useCredentialsFilters.filter(U=>0<=r.search(U)).length),v.impl.options.useCredentials&&(y.withCredentials=true),v.impl.options.corsImg&&r.indexOf("http")===0&&r.indexOf(globalThis.window.location.origin)===-1){var h=(v.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";y.open(h,(v.impl.options.corsImg.url||"").replace("#{cors}",r),true);let U=false,P=v.impl.options.corsImg.headers||{},x=(Object.keys(P).forEach(function(H){P[H].indexOf("application/json")!==-1&&(U=true),y.setRequestHeader(H,P[H]);}),(H=>{try{return JSON.parse(JSON.stringify(H))}catch(L){T("corsImg.data is missing or invalid:"+L.toString());}})(v.impl.options.corsImg.data||""));Object.keys(x).forEach(function(H){typeof x[H]=="string"&&(x[H]=x[H].replace("#{cors}",r));}),y.responseType="blob",y.send(U?JSON.stringify(x):x);}else y.open("GET",r,true),y.responseType="blob",y.send();})),m.promise},uid:function(){return "u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+R++},asArray:function(r){var m=[],A=r.length;for(let y=0;y<A;y++)m.push(r[y]);return m},escapeXhtml:function(r){return r.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(r){return r!=="data:,"?new Promise(function(m,A){let y=globalThis.document.createElementNS("http://www.w3.org/2000/svg","svg"),T=new globalThis.Image;v.impl.options.useCredentials&&(T.crossOrigin="use-credentials"),T.onload=function(){globalThis.document.body.removeChild(y),globalThis.window&&globalThis.window.requestAnimationFrame?globalThis.window.requestAnimationFrame(function(){m(T);}):m(T);},T.onerror=w=>{globalThis.document.body.removeChild(y),A(w);},y.appendChild(T),T.src=r,globalThis.document.body.appendChild(y);}):Promise.resolve()},width:function(r){var m=b(r,"width");if(!isNaN(m))return m;var m=b(r,"border-left-width"),A=b(r,"border-right-width");return r.scrollWidth+m+A},height:function(r){var m=b(r,"height");if(!isNaN(m))return m;var m=b(r,"border-top-width"),A=b(r,"border-bottom-width");return r.scrollHeight+m+A},getWindow:g,isElement:f,isElementHostForOpenShadowRoot:function(r){return f(r)&&r.shadowRoot!==null},isShadowRoot:M,isInShadowRoot:p,isHTMLElement:function(r){return r instanceof g(r).HTMLElement},isHTMLCanvasElement:function(r){return r instanceof g(r).HTMLCanvasElement},isHTMLInputElement:function(r){return r instanceof g(r).HTMLInputElement},isHTMLImageElement:function(r){return r instanceof g(r).HTMLImageElement},isHTMLLinkElement:function(r){return r instanceof g(r).HTMLLinkElement},isHTMLScriptElement:function(r){return r instanceof g(r).HTMLScriptElement},isHTMLStyleElement:function(r){return r instanceof g(r).HTMLStyleElement},isHTMLTextAreaElement:function(r){return r instanceof g(r).HTMLTextAreaElement},isShadowSlotElement:function(r){return p(r)&&r instanceof g(r).HTMLSlotElement},isSVGElement:function(r){return r instanceof g(r).SVGElement},isSVGRectElement:function(r){return r instanceof g(r).SVGRectElement},isDimensionMissing:function(r){return isNaN(r)||r<=0}};function g(r){return r=r?r.ownerDocument:void 0,(r?r.defaultView:void 0)||globalThis.window||o}function M(r){return r instanceof g(r).ShadowRoot}function p(r){return r!=null&&r.getRootNode!==void 0&&M(r.getRootNode())}function f(r){return r instanceof g(r).Element}function b(r,m){if(r.nodeType===S){let A=s(r).getPropertyValue(m);if(A.slice(-2)==="px")return A=A.slice(0,-2),parseFloat(A)}return NaN}})(),E=(()=>{let R=/url\(\s*(["']?)((?:\\.|[^\\)])+)\1\s*\)/gm;return {inlineAll:function(b,r,m){return g(b)?Promise.resolve(b).then(M).then(function(A){let y=Promise.resolve(b);return A.forEach(function(T){y=y.then(function(w){return f(w,T,r,m)});}),y}):Promise.resolve(b)},shouldProcess:g,impl:{readUrls:M,inline:f,urlAsRegex:p}};function g(b){return b.search(R)!==-1}function M(b){for(var r,m=[];(r=R.exec(b))!==null;)m.push(r[2]);return m.filter(function(A){return !n.isDataUrl(A)})}function p(b){return new RegExp(`url\\((["']?)(${n.escape(b)})\\1\\)`,"gm")}function f(b,r,m,A){return Promise.resolve(r).then(function(y){return m?n.resolveUrl(y,m):y}).then(A||n.getAndEncode).then(function(y){var T=p(r);return b.replace(T,`url($1${y}$1)`)})}})(),c={resolveAll:function(){return e().then(function(R){return Promise.all(R.map(function(g){return g.resolve()}))}).then(function(R){return R.join(`
2
+ `)})},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(globalThis.document.styleSheets)).then(function(g){let M=[];return g.forEach(function(p){var f=Object.getPrototypeOf(p);if(Object.prototype.hasOwnProperty.call(f,"cssRules"))try{n.asArray(p.cssRules||[]).forEach(M.push.bind(M));}catch(b){console.error("domtoimage: Error while reading CSS rules from: "+p.href,b.toString());}}),M}).then(function(g){return g.filter(function(M){return M.type===CSSRule.FONT_FACE_RULE}).filter(function(M){return E.shouldProcess(M.style.getPropertyValue("src"))})}).then(function(g){return g.map(R)});function R(g){return {resolve:function(){var M=(g.parentStyleSheet||{}).href;return E.inlineAll(g.cssText,M)},src:function(){return g.style.getPropertyValue("src")}}}}let t={inlineAll:function R(g){if(!n.isElement(g))return Promise.resolve(g);return M(g).then(function(){return n.isHTMLImageElement(g)?d(g).inline():Promise.all(n.asArray(g.childNodes).map(function(p){return R(p)}))});function M(p){let f=["background","background-image"],b=f.map(function(r){let m=p.style.getPropertyValue(r),A=p.style.getPropertyPriority(r);return m?E.inlineAll(m).then(function(y){p.style.setProperty(r,y,A);}):Promise.resolve()});return Promise.all(b).then(function(){return p})}},impl:{newImage:d}};function d(R){return {inline:function(g){return n.isDataUrl(R.src)?Promise.resolve():Promise.resolve(R.src).then(g||n.getAndEncode).then(function(M){return new Promise(function(p){R.onload=p,R.onerror=p,R.src=M;})})}}}let l={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},v={toSvg:i,toPng:function(R,g){return u(R,g).then(function(M){return M.toDataURL()})},toJpeg:function(R,g){return u(R,g).then(function(M){return M.toDataURL("image/jpeg",(g?g.quality:void 0)||1)})},toBlob:function(R,g){return u(R,g).then(n.canvasToBlob)},toPixelData:function(R,g){return u(R,g).then(function(M){return M.getContext("2d").getImageData(0,0,n.width(R),n.height(R)).data})},toCanvas:u,impl:{fontFaces:c,images:t,util:n,inliner:E,urlCache:[],options:{},copyOptions:function(R){R.copyDefaultStyles===void 0?v.impl.options.copyDefaultStyles=l.copyDefaultStyles:v.impl.options.copyDefaultStyles=R.copyDefaultStyles,v.impl.options.imagePlaceholder=(R.imagePlaceholder===void 0?l:R).imagePlaceholder,v.impl.options.cacheBust=(R.cacheBust===void 0?l:R).cacheBust,v.impl.options.corsImg=(R.corsImg===void 0?l:R).corsImg,v.impl.options.useCredentials=(R.useCredentials===void 0?l:R).useCredentials,v.impl.options.useCredentialsFilters=(R.useCredentialsFilters===void 0?l:R).useCredentialsFilters,v.impl.options.httpTimeout=(R.httpTimeout===void 0?l:R).httpTimeout,v.impl.options.styleCaching=(R.styleCaching===void 0?l:R).styleCaching;}}},S=(typeof st=="object"&&typeof at=="object"?at.exports=v:o.domtoimage=v,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),s=(o===void 0?void 0:o.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(o===void 0?void 0:o.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function i(R,g){v.impl.util.getWindow(R);let p=(g=g||{},v.impl.copyOptions(g),[]);return Promise.resolve(R).then(function(f){if(f.nodeType===S)return f;var b=f,r=globalThis.document.createElement("span");return b.replaceWith(r),r.append(f),p.push({child:b,wrapper:r}),r}).then(function(f){return (function b(r,m,A,y){let T=m.filter;if(r===_||n.isHTMLScriptElement(r)||n.isHTMLStyleElement(r)||n.isHTMLLinkElement(r)||A!==null&&T&&!T(r))return Promise.resolve();return Promise.resolve(r).then(w).then(h).then(function(L){return x(L,P(r))}).then(U).then(function(L){return H(L,r)});function w(L){return n.isHTMLCanvasElement(L)?n.makeImage(L.toDataURL()):L.cloneNode(false)}function h(L){return m.adjustClonedNode&&m.adjustClonedNode(r,L,false),Promise.resolve(L)}function U(L){return m.adjustClonedNode&&m.adjustClonedNode(r,L,true),Promise.resolve(L)}function P(L){return n.isElementHostForOpenShadowRoot(L)?L.shadowRoot:L}function x(L,V){let B=K(V),D=Promise.resolve();if(B.length!==0){let G=s($(V));n.asArray(B).forEach(function(Q){D=D.then(function(){return b(Q,m,G).then(function(q){q&&L.appendChild(q);})});});}return D.then(function(){return L});function $(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(D).then($).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 D(){function Q(z,W){W.font=z.font,W.fontFamily=z.fontFamily,W.fontFeatureSettings=z.fontFeatureSettings,W.fontKerning=z.fontKerning,W.fontSize=z.fontSize,W.fontStretch=z.fontStretch,W.fontStyle=z.fontStyle,W.fontVariant=z.fontVariant,W.fontVariantCaps=z.fontVariantCaps,W.fontVariantEastAsian=z.fontVariantEastAsian,W.fontVariantLigatures=z.fontVariantLigatures,W.fontVariantNumeric=z.fontVariantNumeric,W.fontVariationSettings=z.fontVariationSettings,W.fontWeight=z.fontWeight;}function q(z,W){let ie=s(z);ie.cssText?(W.style.cssText=ie.cssText,Q(ie,W.style)):(C(m,z,ie,A,W),A===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(se=>W.style.removeProperty(se)),["left","right","top","bottom"].forEach(se=>{W.style.getPropertyValue(se)&&W.style.setProperty(se,"0px");})));}q(V,L);}function $(){let Q=n.uid();function q(z){let W=s(V,z),ie=W.getPropertyValue("content");if(ie!==""&&ie!=="none"){let J=function(){let X=`.${Q}:`+z,ne=(W.cssText?oe:j)();return globalThis.document.createTextNode(X+`{${ne}}`);function oe(){return `${W.cssText} content: ${ie};`}function j(){return n.asArray(W).map(ee).join("; ")+";";function ee(Y){let ce=W.getPropertyValue(Y),ge=W.getPropertyPriority(Y)?" !important":"";return Y+": "+ce+ge}}};let Z=L.getAttribute("class")||"",te=(L.setAttribute("class",Z+" "+Q),globalThis.document.createElement("style"));te.appendChild(J()),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,g,null)}).then(g.disableEmbedFonts?Promise.resolve(R):I).then(g.disableInlineImages?Promise.resolve(R):O).then(function(f){g.bgcolor&&(f.style.backgroundColor=g.bgcolor),g.width&&(f.style.width=g.width+"px"),g.height&&(f.style.height=g.height+"px"),g.style&&Object.keys(g.style).forEach(function(r){f.style[r]=g.style[r];});let b=null;return typeof g.onclone=="function"&&(b=g.onclone(f)),Promise.resolve(b).then(function(){return f})}).then(function(f){let b=g.width||n.width(R),r=g.height||n.height(R);return Promise.resolve(f).then(function(m){return m.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(m)}).then(n.escapeXhtml).then(function(m){var A=(n.isDimensionMissing(b)?' width="100%"':` width="${b}"`)+(n.isDimensionMissing(r)?' height="100%"':` height="${r}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(b)?"":` width="${b}"`)+(n.isDimensionMissing(r)?"":` height="${r}"`)}><foreignObject${A}>${m}</foreignObject></svg>`}).then(function(m){return "data:image/svg+xml;charset=utf-8,"+m})}).then(function(f){for(;0<p.length;){var b=p.pop();b.wrapper.replaceWith(b.child);}return f}).then(function(f){return v.impl.urlCache=[],_&&(globalThis.document.body.removeChild(_),_=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,F={};},2e4),f})}function u(R,g){return i(R,g=g||{}).then(n.makeImage).then(function(M){var p=typeof g.scale!="number"?1:g.scale,f=((r,m)=>{let A=g.width||n.width(r),y=g.height||n.height(r);return n.isDimensionMissing(A)&&(A=n.isDimensionMissing(y)?300:2*y),n.isDimensionMissing(y)&&(y=A/2),(r=globalThis.document.createElement("canvas")).width=A*m,r.height=y*m,g.bgcolor&&((m=r.getContext("2d")).fillStyle=g.bgcolor,m.fillRect(0,0,r.width,r.height)),r})(R,p),b=f.getContext("2d");return b.msImageSmoothingEnabled=false,b.imageSmoothingEnabled=false,M&&(b.scale(p,p),b.drawImage(M,0,0)),f})}let _=null;function I(R){return c.resolveAll().then(function(g){var M;return g!==""&&(M=globalThis.document.createElement("style"),R.appendChild(M),M.appendChild(globalThis.document.createTextNode(g))),R})}function O(R){return t.inlineAll(R).then(function(){return R})}function C(R,g,M,p,f){let b=v.impl.options.copyDefaultStyles?((m,A)=>{var y,T=(U=>(m.styleCaching!=="relaxed"?U:U.filter((P,x,H)=>x===0||x===H.length-1)).join(">"))(A=(U=>{var P=[];do if(U.nodeType===S){var x=U.tagName;if(P.push(x),k.includes(x))break}while(U=U.parentNode);return P})(A));{if(F[T])return F[T];A=((U,P)=>{let x=U.body;do{var H=P.pop(),H=U.createElement(H);x.appendChild(H),x=H;}while(0<P.length);return x.textContent="\u200B",x})((y=(()=>{if(_)return _.contentWindow;P=globalThis.document.characterSet||"UTF-8",U=(U=globalThis.document.doctype)?(`<!DOCTYPE ${D(U.name)} ${D(U.publicId)} `+D(U.systemId)).trim()+">":"",(_=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),_.style.top="-9999px",_.style.visibility="hidden",_.style.position="fixed",globalThis.document.body.appendChild(_);var U,P,x=_,H="domtoimage-sandbox";try{return x.contentWindow.document.write(U+`<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),U+V.documentElement.outerHTML);return x.setAttribute("srcdoc",B),x.contentWindow}catch{}return x.contentDocument.head.appendChild(L),x.contentDocument.title=H,x.contentWindow;function D($){var K;return $?((K=globalThis.document.createElement("div")).innerText=$,K.innerHTML):""}})()).document,A),y=((U,P)=>{let x={},H=U.getComputedStyle(P);return n.asArray(H).forEach(function(L){x[L]=L==="width"||L==="height"?"auto":H.getPropertyValue(L);}),x})(y,A);var w=A;do{var h=w.parentElement;h!==null&&h.removeChild(w),w=h;}while(w&&w.tagName!=="BODY");return F[T]=y}})(R,g):{},r=f.style;n.asArray(M).forEach(function(m){var A,y,T,w;R.filterStyles&&!R.filterStyles(g,m)||(y=M.getPropertyValue(m),T=b[m],A=p?p.getPropertyValue(m):void 0,r.getPropertyValue(m))||(y!==T||p&&y!==A)&&(T=M.getPropertyPriority(m),A=r,y=y,T=T,w=0<=["background-clip"].indexOf(m=m),T?(A.setProperty(m,y,T),w&&A.setProperty("-webkit-"+m,y,T)):(A.setProperty(m,y),w&&A.setProperty("-webkit-"+m,y)));});}let N=null,F={},k=["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"];})(st);});var zt=nt(()=>{});var pn=nt((oo,dn)=>{var wt=typeof Map=="function"&&Map.prototype,ct=Object.getOwnPropertyDescriptor&&wt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ye=wt&&ct&&typeof ct.get=="function"?ct.get:null,Gt=wt&&Map.prototype.forEach,yt=typeof Set=="function"&&Set.prototype,lt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Je=yt&&lt&&typeof lt.get=="function"?lt.get:null,qt=yt&&Set.prototype.forEach,Yn=typeof WeakMap=="function"&&WeakMap.prototype,Ne=Yn?WeakMap.prototype.has:null,Jn=typeof WeakSet=="function"&&WeakSet.prototype,Be=Jn?WeakSet.prototype.has:null,Xn=typeof WeakRef=="function"&&WeakRef.prototype,Kt=Xn?WeakRef.prototype.deref:null,Zn=Boolean.prototype.valueOf,jn=Object.prototype.toString,er=Function.prototype.toString,tr=String.prototype.match,vt=String.prototype.slice,Ee=String.prototype.replace,nr=String.prototype.toUpperCase,Yt=String.prototype.toLowerCase,on=RegExp.prototype.test,Jt=Array.prototype.concat,ye=Array.prototype.join,rr=Array.prototype.slice,Xt=Math.floor,dt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ut=Object.getOwnPropertySymbols,pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ke=typeof Symbol=="function"&&typeof Symbol.iterator=="object",He=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ke||true)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,Zt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(o){return o.__proto__}:null);function jt(o,n){if(o===1/0||o===-1/0||o!==o||o&&o>-1e3&&o<1e3||on.call(/e/,n))return n;var E=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof o=="number"){var c=o<0?-Xt(-o):Xt(o);if(c!==o){var e=String(c),t=vt.call(n,e.length+1);return Ee.call(e,E,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(n,E,"$&_")}var ht=zt(),en=ht.custom,tn=ln(en)?en:null,an={__proto__:null,double:'"',single:"'"},or={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};dn.exports=function o(n,E,c,e){var t=E||{};if(_e(t,"quoteStyle")&&!_e(an,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_e(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 d=_e(t,"customInspect")?t.customInspect:true;if(typeof d!="boolean"&&d!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_e(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(_e(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=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 fn(n,t);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var v=String(n);return l?jt(n,v):v}if(typeof n=="bigint"){var S=String(n)+"n";return l?jt(n,S):S}var s=typeof t.depth>"u"?5:t.depth;if(typeof c>"u"&&(c=0),c>=s&&s>0&&typeof n=="object")return gt(n)?"[Array]":"[Object]";var a=br(t,c);if(typeof e>"u")e=[];else if(un(e,n)>=0)return "[Circular]";function i(A,y,T){if(y&&(e=rr.call(e),e.push(y)),T){var w={depth:t.depth};return _e(t,"quoteStyle")&&(w.quoteStyle=t.quoteStyle),o(A,w,c+1,e)}return o(A,t,c+1,e)}if(typeof n=="function"&&!nn(n)){var u=pr(n),_=Ke(n,i);return "[Function"+(u?": "+u:" (anonymous)")+"]"+(_.length>0?" { "+ye.call(_,", ")+" }":"")}if(ln(n)){var I=ke?Ee.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(n);return typeof n=="object"&&!ke?Fe(I):I}if(vr(n)){for(var O="<"+Yt.call(String(n.nodeName)),C=n.attributes||[],N=0;N<C.length;N++)O+=" "+C[N].name+"="+cn(ir(C[N].value),"double",t);return O+=">",n.childNodes&&n.childNodes.length&&(O+="..."),O+="</"+Yt.call(String(n.nodeName))+">",O}if(gt(n)){if(n.length===0)return "[]";var F=Ke(n,i);return a&&!Ar(F)?"["+mt(F,a)+"]":"[ "+ye.call(F,", ")+" ]"}if(ar(n)){var k=Ke(n,i);return !("cause"in Error.prototype)&&"cause"in n&&!sn.call(n,"cause")?"{ ["+String(n)+"] "+ye.call(Jt.call("[cause]: "+i(n.cause),k),", ")+" }":k.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+ye.call(k,", ")+" }"}if(typeof n=="object"&&d){if(tn&&typeof n[tn]=="function"&&ht)return ht(n,{depth:s-c});if(d!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(hr(n)){var R=[];return Gt&&Gt.call(n,function(A,y){R.push(i(y,n,true)+" => "+i(A,n));}),rn("Map",Ye.call(n),R,a)}if(wr(n)){var g=[];return qt&&qt.call(n,function(A){g.push(i(A,n));}),rn("Set",Je.call(n),g,a)}if(gr(n))return ft("WeakMap");if(yr(n))return ft("WeakSet");if(mr(n))return ft("WeakRef");if(lr(n))return Fe(i(Number(n)));if(fr(n))return Fe(i(dt.call(n)));if(ur(n))return Fe(Zn.call(n));if(cr(n))return Fe(i(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(!sr(n)&&!nn(n)){var M=Ke(n,i),p=Zt?Zt(n)===Object.prototype:n instanceof Object||n.constructor===Object,f=n instanceof Object?"":"null prototype",b=!p&&He&&Object(n)===n&&He in n?vt.call(Se(n),8,-1):f?"Object":"",r=p||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",m=r+(b||f?"["+ye.call(Jt.call([],b||[],f||[]),": ")+"] ":"");return M.length===0?m+"{}":a?m+"{"+mt(M,a)+"}":m+"{ "+ye.call(M,", ")+" }"}return String(n)};function cn(o,n,E){var c=E.quoteStyle||n,e=an[c];return e+o+e}function ir(o){return Ee.call(String(o),/"/g,"&quot;")}function Pe(o){return !He||!(typeof o=="object"&&(He in o||typeof o[He]<"u"))}function gt(o){return Se(o)==="[object Array]"&&Pe(o)}function sr(o){return Se(o)==="[object Date]"&&Pe(o)}function nn(o){return Se(o)==="[object RegExp]"&&Pe(o)}function ar(o){return Se(o)==="[object Error]"&&Pe(o)}function cr(o){return Se(o)==="[object String]"&&Pe(o)}function lr(o){return Se(o)==="[object Number]"&&Pe(o)}function ur(o){return Se(o)==="[object Boolean]"&&Pe(o)}function ln(o){if(ke)return o&&typeof o=="object"&&o instanceof Symbol;if(typeof o=="symbol")return true;if(!o||typeof o!="object"||!pt)return false;try{return pt.call(o),!0}catch{}return false}function fr(o){if(!o||typeof o!="object"||!dt)return false;try{return dt.call(o),!0}catch{}return false}var dr=Object.prototype.hasOwnProperty||function(o){return o in this};function _e(o,n){return dr.call(o,n)}function Se(o){return jn.call(o)}function pr(o){if(o.name)return o.name;var n=tr.call(er.call(o),/^function\s*([\w$]+)/);return n?n[1]:null}function un(o,n){if(o.indexOf)return o.indexOf(n);for(var E=0,c=o.length;E<c;E++)if(o[E]===n)return E;return -1}function hr(o){if(!Ye||!o||typeof o!="object")return false;try{Ye.call(o);try{Je.call(o);}catch{return !0}return o instanceof Map}catch{}return false}function gr(o){if(!Ne||!o||typeof o!="object")return false;try{Ne.call(o,Ne);try{Be.call(o,Be);}catch{return !0}return o instanceof WeakMap}catch{}return false}function mr(o){if(!Kt||!o||typeof o!="object")return false;try{return Kt.call(o),!0}catch{}return false}function wr(o){if(!Je||!o||typeof o!="object")return false;try{Je.call(o);try{Ye.call(o);}catch{return !0}return o instanceof Set}catch{}return false}function yr(o){if(!Be||!o||typeof o!="object")return false;try{Be.call(o,Be);try{Ne.call(o,Ne);}catch{return !0}return o instanceof WeakSet}catch{}return false}function vr(o){return !o||typeof o!="object"?false:typeof HTMLElement<"u"&&o instanceof HTMLElement?true:typeof o.nodeName=="string"&&typeof o.getAttribute=="function"}function fn(o,n){if(o.length>n.maxStringLength){var E=o.length-n.maxStringLength,c="... "+E+" more character"+(E>1?"s":"");return fn(vt.call(o,0,n.maxStringLength),n)+c}var e=or[n.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(o,e,"\\$1"),/[\x00-\x1f]/g,_r);return cn(t,"single",n)}function _r(o){var n=o.charCodeAt(0),E={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return E?"\\"+E:"\\x"+(n<16?"0":"")+nr.call(n.toString(16))}function Fe(o){return "Object("+o+")"}function ft(o){return o+" { ? }"}function rn(o,n,E,c){var e=c?mt(E,c):ye.call(E,", ");return o+" ("+n+") {"+e+"}"}function Ar(o){for(var n=0;n<o.length;n++)if(un(o[n],`
3
3
  `)>=0)return false;return true}function br(o,n){var E;if(o.indent===" ")E=" ";else if(typeof o.indent=="number"&&o.indent>0)E=ye.call(Array(o.indent+1)," ");else return null;return {base:E,prev:ye.call(Array(n+1),E)}}function mt(o,n){if(o.length===0)return "";var E=`
4
4
  `+n.prev+n.base;return E+ye.call(o,","+E)+`
5
- `+n.prev}function Ke(o,n){var E=gt(o),c=[];if(E){c.length=o.length;for(var e=0;e<o.length;e++)c[e]=_e(o,e)?n(o[e],o):"";}var t=typeof ut=="function"?ut(o):[],d;if(ke){d={};for(var l=0;l<t.length;l++)d["$"+t[l]]=t[l];}for(var _ in o)_e(o,_)&&(E&&String(Number(_))===_&&_<o.length||ke&&d["$"+_]instanceof Symbol||(on.call(/[^\w$]/,_)?c.push(n(_,o)+": "+n(o[_],o)):c.push(_+": "+n(o[_],o))));if(typeof ut=="function")for(var S=0;S<t.length;S++)sn.call(o,t[S])&&c.push("["+n(t[S])+"]: "+n(o[t[S]],o));return c}});function Vn(o,n){return n.forEach((function(E){E&&typeof E!="string"&&!Array.isArray(E)&&Object.keys(E).forEach((function(c){if(c!=="default"&&!(c in o)){var e=Object.getOwnPropertyDescriptor(E,c);Object.defineProperty(o,c,e.get?e:{enumerable:true,get:function(){return E[c]}});}}));})),Object.freeze(o)}function kt(o,n){return new Promise((function(E,c){let e;return $n(o).then((function(t){try{return e=t,E(new Blob([n.slice(0,2),e,n.slice(2)],{type:"image/jpeg"}))}catch(d){return c(d)}}),c)}))}var $n=o=>new Promise(((n,E)=>{let c=new globalThis.FileReader;c.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),d=0;if(t.getUint16(d)!==65496)return E("not a valid JPEG");for(d+=2;;){let l=t.getUint16(d);if(l===65498)break;let _=t.getUint16(d+2);if(l===65505&&t.getUint32(d+4)===1165519206){let S=d+10,s;switch(t.getUint16(S)){case 18761:s=true;break;case 19789:s=false;break;default:return E("TIFF header contains invalid endian")}if(t.getUint16(S+2,s)!==42)return E("TIFF header contains invalid version");let a=t.getUint32(S+4,s),i=S+a+2+12*t.getUint16(S+a,s);for(let u=S+a+2;u<i;u+=12)if(t.getUint16(u,s)==274){if(t.getUint16(u+2,s)!==3)return E("Orientation data type is invalid");if(t.getUint32(u+4,s)!==1)return E("Orientation data count is invalid");t.setUint16(u+8,1,s);break}return n(e.slice(d,d+2+_))}d+=2+_;}return n(new Blob)})),c.readAsArrayBuffer(o);})),We={},Wn={get exports(){return We},set exports(o){We=o;}};(function(o){var n,E,c={};Wn.exports=c,c.parse=function(e,t){for(var d=c.bin.readUshort,l=c.bin.readUint,_=0,S={},s=new Uint8Array(e),a=s.length-4;l(s,a)!=101010256;)a--;_=a,_+=4;var i=d(s,_+=4);d(s,_+=2);var u=l(s,_+=2),v=l(s,_+=4);_+=4,_=v;for(var I=0;I<i;I++){l(s,_),_+=4,_+=4,_+=4,l(s,_+=4),u=l(s,_+=4);var O=l(s,_+=4),C=d(s,_+=4),N=d(s,_+2),F=d(s,_+4);_+=6;var k=l(s,_+=8);_+=4,_+=C+N+F,c._readLocal(s,k,S,u,O,t);}return S},c._readLocal=function(e,t,d,l,_,S){var s=c.bin.readUshort,a=c.bin.readUint;a(e,t),s(e,t+=4),s(e,t+=2);var i=s(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var u=s(e,t+=8),v=s(e,t+=2);t+=2;var I=c.bin.readUTF8(e,t,u);if(t+=u,t+=v,S)d[I]={size:_,csize:l};else {var O=new Uint8Array(e.buffer,t);if(i==0)d[I]=new Uint8Array(O.buffer.slice(t,t+l));else {if(i!=8)throw "unknown compression method: "+i;var C=new Uint8Array(_);c.inflateRaw(O,C),d[I]=C;}}},c.inflateRaw=function(e,t){return c.F.inflate(e,t)},c.inflate=function(e,t){return e[0],e[1],c.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},c.deflate=function(e,t){t==null&&(t={level:6});var d=0,l=new Uint8Array(50+Math.floor(1.1*e.length));l[d]=120,l[d+1]=156,d+=2,d=c.F.deflateRaw(e,l,d,t.level);var _=c.adler(e,0,e.length);return l[d+0]=_>>>24&255,l[d+1]=_>>>16&255,l[d+2]=_>>>8&255,l[d+3]=_>>>0&255,new Uint8Array(l.buffer,0,d+4)},c.deflateRaw=function(e,t){t==null&&(t={level:6});var d=new Uint8Array(50+Math.floor(1.1*e.length)),l=c.F.deflateRaw(e,d,l,t.level);return new Uint8Array(d.buffer,0,l)},c.encode=function(e,t){t==null&&(t=false);var d=0,l=c.bin.writeUint,_=c.bin.writeUshort,S={};for(var s in e){var a=!c._noNeed(s)&&!t,i=e[s],u=c.crc.crc(i,0,i.length);S[s]={cpr:a,usize:i.length,crc:u,file:a?c.deflateRaw(i):i};}for(var s in S)d+=S[s].file.length+30+46+2*c.bin.sizeUTF8(s);d+=22;var v=new Uint8Array(d),I=0,O=[];for(var s in S){var C=S[s];O.push(I),I=c._writeHeader(v,I,s,C,0);}var N=0,F=I;for(var s in S)C=S[s],O.push(I),I=c._writeHeader(v,I,s,C,1,O[N++]);var k=I-F;return l(v,I,101010256),I+=4,_(v,I+=4,N),_(v,I+=2,N),l(v,I+=2,k),l(v,I+=4,F),I+=4,I+=2,v.buffer},c._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},c._writeHeader=function(e,t,d,l,_,S){var s=c.bin.writeUint,a=c.bin.writeUshort,i=l.file;return s(e,t,_==0?67324752:33639248),t+=4,_==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,l.cpr?8:0),s(e,t+=2,0),s(e,t+=4,l.crc),s(e,t+=4,i.length),s(e,t+=4,l.usize),a(e,t+=4,c.bin.sizeUTF8(d)),a(e,t+=2,0),t+=2,_==1&&(t+=2,t+=2,s(e,t+=6,S),t+=4),t+=c.bin.writeUTF8(e,t,d),_==0&&(e.set(i,t),t+=i.length),t},c.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var d=t,l=0;l<8;l++)1&d?d=3988292384^d>>>1:d>>>=1;e[t]=d;}return e})(),update:function(e,t,d,l){for(var _=0;_<l;_++)e=c.crc.table[255&(e^t[d+_])]^e>>>8;return e},crc:function(e,t,d){return 4294967295^c.crc.update(4294967295,e,t,d)}},c.adler=function(e,t,d){for(var l=1,_=0,S=t,s=t+d;S<s;){for(var a=Math.min(S+5552,s);S<a;)_+=l+=e[S++];l%=65521,_%=65521;}return _<<16|l},c.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,d){e[t]=255&d,e[t+1]=d>>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,d){e[t]=255&d,e[t+1]=d>>8&255,e[t+2]=d>>16&255,e[t+3]=d>>24&255;},readASCII:function(e,t,d){for(var l="",_=0;_<d;_++)l+=String.fromCharCode(e[t+_]);return l},writeASCII:function(e,t,d){for(var l=0;l<d.length;l++)e[t+l]=d.charCodeAt(l);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,d){for(var l,_="",S=0;S<d;S++)_+="%"+c.bin.pad(e[t+S].toString(16));try{l=decodeURIComponent(_);}catch{return c.bin.readASCII(e,t,d)}return l},writeUTF8:function(e,t,d){for(var l=d.length,_=0,S=0;S<l;S++){var s=d.charCodeAt(S);if((4294967168&s)==0)e[t+_]=s,_++;else if((4294965248&s)==0)e[t+_]=192|s>>6,e[t+_+1]=128|s>>0&63,_+=2;else if((4294901760&s)==0)e[t+_]=224|s>>12,e[t+_+1]=128|s>>6&63,e[t+_+2]=128|s>>0&63,_+=3;else {if((4292870144&s)!=0)throw "e";e[t+_]=240|s>>18,e[t+_+1]=128|s>>12&63,e[t+_+2]=128|s>>6&63,e[t+_+3]=128|s>>0&63,_+=4;}}return _},sizeUTF8:function(e){for(var t=e.length,d=0,l=0;l<t;l++){var _=e.charCodeAt(l);if((4294967168&_)==0)d++;else if((4294965248&_)==0)d+=2;else if((4294901760&_)==0)d+=3;else {if((4292870144&_)!=0)throw "e";d+=4;}}return d}},c.F={},c.F.deflateRaw=function(e,t,d,l){var _=[[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]][l],S=c.F.U,s=c.F._goodIndex;c.F._hash;var a=c.F._putsE,i=0,u=d<<3,v=0,I=e.length;if(l==0){for(;i<I;)a(t,u,i+(r=Math.min(65535,I-i))==I?1:0),u=c.F._copyExact(e,i,r,t,u+8),i+=r;return u>>>3}var O=S.lits,C=S.strt,N=S.prev,F=0,k=0,R=0,g=0,M=0,p=0;for(I>2&&(C[p=c.F._hash(e,0)]=0),i=0;i<I;i++){if(M=p,i+1<I-2){p=c.F._hash(e,i+1);var f=i+1&32767;N[f]=C[p],C[p]=f;}if(v<=i){(F>14e3||k>26697)&&I-i>100&&(v<i&&(O[F]=i-v,F+=2,v=i),u=c.F._writeBlock(i==I-1||v==I?1:0,O,F,g,e,R,i-R,t,u),F=k=g=0,R=i);var b=0;i<I-2&&(b=c.F._bestMatch(e,i,N,M,Math.min(_[2],I-i),_[3]));var r=b>>>16,m=65535&b;if(b!=0){m=65535&b;var A=s(r=b>>>16,S.of0);S.lhst[257+A]++;var y=s(m,S.df0);S.dhst[y]++,g+=S.exb[A]+S.dxb[y],O[F]=r<<23|i-v,O[F+1]=m<<16|A<<8|y,F+=2,v=i+r;}else S.lhst[e[i]]++;k++;}}for(R==i&&e.length!=0||(v<i&&(O[F]=i-v,F+=2,v=i),u=c.F._writeBlock(1,O,F,g,e,R,i-R,t,u),F=0,k=0,F=k=g=0,R=i);(7&u)!=0;)u++;return u>>>3},c.F._bestMatch=function(e,t,d,l,_,S){var s=32767&t,a=d[s],i=s-a+32768&32767;if(a==s||l!=c.F._hash(e,t-i))return 0;for(var u=0,v=0,I=Math.min(32767,t);i<=I&&--S!=0&&a!=s;){if(u==0||e[t+u]==e[t+u-i]){var O=c.F._howLong(e,t,i);if(O>u){if(v=i,(u=O)>=_)break;i+2<O&&(O=i+2);for(var C=0,N=0;N<O-2;N++){var F=t-i+N+32768&32767,k=F-d[F]+32768&32767;k>C&&(C=k,a=F);}}}i+=(s=a)-(a=d[s])+32768&32767;}return u<<16|v},c.F._howLong=function(e,t,d){if(e[t]!=e[t-d]||e[t+1]!=e[t+1-d]||e[t+2]!=e[t+2-d])return 0;var l=t,_=Math.min(e.length,t+258);for(t+=3;t<_&&e[t]==e[t-d];)t++;return t-l},c.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},c.saved=0,c.F._writeBlock=function(e,t,d,l,_,S,s,a,i){var u,v,I,O,C,N,F,k,R,g=c.F.U,M=c.F._putsF,p=c.F._putsE;g.lhst[256]++,v=(u=c.F.getTrees())[0],I=u[1],O=u[2],C=u[3],N=u[4],F=u[5],k=u[6],R=u[7];var f=32+((i+3&7)==0?0:8-(i+3&7))+(s<<3),b=l+c.F.contSize(g.fltree,g.lhst)+c.F.contSize(g.fdtree,g.dhst),r=l+c.F.contSize(g.ltree,g.lhst)+c.F.contSize(g.dtree,g.dhst);r+=14+3*F+c.F.contSize(g.itree,g.ihst)+(2*g.ihst[16]+3*g.ihst[17]+7*g.ihst[18]);for(var m=0;m<286;m++)g.lhst[m]=0;for(m=0;m<30;m++)g.dhst[m]=0;for(m=0;m<19;m++)g.ihst[m]=0;var A=f<b&&f<r?0:b<r?1:2;if(M(a,i,e),M(a,i+1,A),i+=3,A==0){for(;(7&i)!=0;)i++;i=c.F._copyExact(_,S,s,a,i);}else {var y,T;if(A==1&&(y=g.fltree,T=g.fdtree),A==2){c.F.makeCodes(g.ltree,v),c.F.revCodes(g.ltree,v),c.F.makeCodes(g.dtree,I),c.F.revCodes(g.dtree,I),c.F.makeCodes(g.itree,O),c.F.revCodes(g.itree,O),y=g.ltree,T=g.dtree,p(a,i,C-257),p(a,i+=5,N-1),p(a,i+=5,F-4),i+=4;for(var w=0;w<F;w++)p(a,i+3*w,g.itree[1+(g.ordr[w]<<1)]);i+=3*F,i=c.F._codeTiny(k,g.itree,a,i),i=c.F._codeTiny(R,g.itree,a,i);}for(var h=S,U=0;U<d;U+=2){for(var P=t[U],x=P>>>23,H=h+(8388607&P);h<H;)i=c.F._writeLit(_[h++],y,a,i);if(x!=0){var L=t[U+1],V=L>>16,B=L>>8&255,D=255&L;p(a,i=c.F._writeLit(257+B,y,a,i),x-g.of0[B]),i+=g.exb[B],M(a,i=c.F._writeLit(D,T,a,i),V-g.df0[D]),i+=g.dxb[D],h+=x;}}i=c.F._writeLit(256,y,a,i);}return i},c.F._copyExact=function(e,t,d,l,_){var S=_>>>3;return l[S]=d,l[S+1]=d>>>8,l[S+2]=255-l[S],l[S+3]=255-l[S+1],S+=4,l.set(new Uint8Array(e.buffer,t,d),S),_+(d+4<<3)},c.F.getTrees=function(){for(var e=c.F.U,t=c.F._hufTree(e.lhst,e.ltree,15),d=c.F._hufTree(e.dhst,e.dtree,15),l=[],_=c.F._lenCodes(e.ltree,l),S=[],s=c.F._lenCodes(e.dtree,S),a=0;a<l.length;a+=2)e.ihst[l[a]]++;for(a=0;a<S.length;a+=2)e.ihst[S[a]]++;for(var i=c.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&e.itree[1+(e.ordr[u-1]<<1)]==0;)u--;return [t,d,i,_,s,u,l,S]},c.F.getSecond=function(e){for(var t=[],d=0;d<e.length;d+=2)t.push(e[d+1]);return t},c.F.nonZero=function(e){for(var t="",d=0;d<e.length;d+=2)e[d+1]!=0&&(t+=(d>>1)+",");return t},c.F.contSize=function(e,t){for(var d=0,l=0;l<t.length;l++)d+=t[l]*e[1+(l<<1)];return d},c.F._codeTiny=function(e,t,d,l){for(var _=0;_<e.length;_+=2){var S=e[_],s=e[_+1];l=c.F._writeLit(S,t,d,l);var a=S==16?2:S==17?3:7;S>15&&(c.F._putsE(d,l,s,a),l+=a);}return l},c.F._lenCodes=function(e,t){for(var d=e.length;d!=2&&e[d-1]==0;)d-=2;for(var l=0;l<d;l+=2){var _=e[l+1],S=l+3<d?e[l+3]:-1,s=l+5<d?e[l+5]:-1,a=l==0?-1:e[l-1];if(_==0&&S==_&&s==_){for(var i=l+5;i+2<d&&e[i+2]==_;)i+=2;(u=Math.min(i+1-l>>>1,138))<11?t.push(17,u-3):t.push(18,u-11),l+=2*u-2;}else if(_==a&&S==_&&s==_){for(i=l+5;i+2<d&&e[i+2]==_;)i+=2;var u=Math.min(i+1-l>>>1,6);t.push(16,u-3),l+=2*u-2;}else t.push(_,0);}return d>>>1},c.F._hufTree=function(e,t,d){var l=[],_=e.length,S=t.length,s=0;for(s=0;s<S;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<_;s++)e[s]!=0&&l.push({lit:s,f:e[s]});var a=l.length,i=l.slice(0);if(a==0)return 0;if(a==1){var u=l[0].lit;return i=u==0?1:0,t[1+(u<<1)]=1,t[1+(i<<1)]=1,1}l.sort((function(k,R){return k.f-R.f}));var v=l[0],I=l[1],O=0,C=1,N=2;for(l[0]={lit:-1,f:v.f+I.f,l:v,r:I,d:0};C!=a-1;)v=O!=C&&(N==a||l[O].f<l[N].f)?l[O++]:l[N++],I=O!=C&&(N==a||l[O].f<l[N].f)?l[O++]:l[N++],l[C++]={lit:-1,f:v.f+I.f,l:v,r:I};var F=c.F.setDepth(l[C-1],0);for(F>d&&(c.F.restrictDepth(i,d,F),F=d),s=0;s<a;s++)t[1+(i[s].lit<<1)]=i[s].d;return F},c.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(c.F.setDepth(e.l,t+1),c.F.setDepth(e.r,t+1))},c.F.restrictDepth=function(e,t,d){var l=0,_=1<<d-t,S=0;for(e.sort((function(a,i){return i.d==a.d?a.f-i.f:i.d-a.d})),l=0;l<e.length&&e[l].d>t;l++){var s=e[l].d;e[l].d=t,S+=_-(1<<d-s);}for(S>>>=d-t;S>0;)(s=e[l].d)<t?(e[l].d++,S-=1<<t-s-1):l++;for(;l>=0;l--)e[l].d==t&&S<0&&(e[l].d--,S++);S!=0&&console.log("debt left");},c.F._goodIndex=function(e,t){var d=0;return t[16|d]<=e&&(d|=16),t[8|d]<=e&&(d|=8),t[4|d]<=e&&(d|=4),t[2|d]<=e&&(d|=2),t[1|d]<=e&&(d|=1),d},c.F._writeLit=function(e,t,d,l){return c.F._putsF(d,l,t[e<<1]),l+t[1+(e<<1)]},c.F.inflate=function(e,t){var d=Uint8Array;if(e[0]==3&&e[1]==0)return t||new d(0);var l=c.F,_=l._bitsF,S=l._bitsE,s=l._decodeTiny,a=l.makeCodes,i=l.codes2map,u=l._get17,v=l.U,I=t==null;I&&(t=new d(e.length>>>2<<3));for(var O,C,N=0,F=0,k=0,R=0,g=0,M=0,p=0,f=0,b=0;N==0;)if(N=_(e,b,1),F=_(e,b+1,2),b+=3,F!=0){if(I&&(t=c.F._check(t,f+(1<<17))),F==1&&(O=v.flmap,C=v.fdmap,M=511,p=31),F==2){k=S(e,b,5)+257,R=S(e,b+5,5)+1,g=S(e,b+10,4)+4,b+=14;for(var r=0;r<38;r+=2)v.itree[r]=0,v.itree[r+1]=0;var m=1;for(r=0;r<g;r++){var A=S(e,b+3*r,3);v.itree[1+(v.ordr[r]<<1)]=A,A>m&&(m=A);}b+=3*g,a(v.itree,m),i(v.itree,m,v.imap),O=v.lmap,C=v.dmap,b=s(v.imap,(1<<m)-1,k+R,e,b,v.ttree);var y=l._copyOut(v.ttree,0,k,v.ltree);M=(1<<y)-1;var T=l._copyOut(v.ttree,k,R,v.dtree);p=(1<<T)-1,a(v.ltree,y),i(v.ltree,y,O),a(v.dtree,T),i(v.dtree,T,C);}for(;;){var w=O[u(e,b)&M];b+=15&w;var h=w>>>4;if(!(h>>>8))t[f++]=h;else {if(h==256)break;var U=f+h-254;if(h>264){var P=v.ldef[h-257];U=f+(P>>>3)+S(e,b,7&P),b+=7&P;}var x=C[u(e,b)&p];b+=15&x;var H=x>>>4,L=v.ddef[H],V=(L>>>4)+_(e,b,15&L);for(b+=15&L,I&&(t=c.F._check(t,f+(1<<17)));f<U;)t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V];f=U;}}}else {(7&b)!=0&&(b+=8-(7&b));var B=4+(b>>>3),D=e[B-4]|e[B-3]<<8;I&&(t=c.F._check(t,f+D)),t.set(new d(e.buffer,e.byteOffset+B,D),f),b=B+D<<3,f+=D;}return t.length==f?t:t.slice(0,f)},c.F._check=function(e,t){var d=e.length;if(t<=d)return e;var l=new Uint8Array(Math.max(d<<1,t));return l.set(e,0),l},c.F._decodeTiny=function(e,t,d,l,_,S){for(var s=c.F._bitsE,a=c.F._get17,i=0;i<d;){var u=e[a(l,_)&t];_+=15&u;var v=u>>>4;if(v<=15)S[i]=v,i++;else {var I=0,O=0;v==16?(O=3+s(l,_,2),_+=2,I=S[i-1]):v==17?(O=3+s(l,_,3),_+=3):v==18&&(O=11+s(l,_,7),_+=7);for(var C=i+O;i<C;)S[i]=I,i++;}}return _},c.F._copyOut=function(e,t,d,l){for(var _=0,S=0,s=l.length>>>1;S<d;){var a=e[S+t];l[S<<1]=0,l[1+(S<<1)]=a,a>_&&(_=a),S++;}for(;S<s;)l[S<<1]=0,l[1+(S<<1)]=0,S++;return _},c.F.makeCodes=function(e,t){for(var d,l,_,S,s=c.F.U,a=e.length,i=s.bl_count,u=0;u<=t;u++)i[u]=0;for(u=1;u<a;u+=2)i[e[u]]++;var v=s.next_code;for(d=0,i[0]=0,l=1;l<=t;l++)d=d+i[l-1]<<1,v[l]=d;for(_=0;_<a;_+=2)(S=e[_+1])!=0&&(e[_]=v[S],v[S]++);},c.F.codes2map=function(e,t,d){for(var l=e.length,_=c.F.U.rev15,S=0;S<l;S+=2)if(e[S+1]!=0)for(var s=S>>1,a=e[S+1],i=s<<4|a,u=t-a,v=e[S]<<u,I=v+(1<<u);v!=I;)d[_[v]>>>15-t]=i,v++;},c.F.revCodes=function(e,t){for(var d=c.F.U.rev15,l=15-t,_=0;_<e.length;_+=2){var S=e[_]<<t-e[_+1];e[_]=d[S]>>>l;}},c.F._putsE=function(e,t,d){d<<=7&t;var l=t>>>3;e[l]|=d,e[l+1]|=d>>>8;},c.F._putsF=function(e,t,d){d<<=7&t;var l=t>>>3;e[l]|=d,e[l+1]|=d>>>8,e[l+2]|=d>>>16;},c.F._bitsE=function(e,t,d){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<d)-1},c.F._bitsF=function(e,t,d){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<d)-1},c.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},c.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)},c.F.U=(n=Uint16Array,E=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 E(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 E(286),dhst:new E(30),ihst:new E(19),lits:new E(15e3),strt:new n(65536),prev:new n(32768)}),(function(){for(var e=c.F.U,t=0;t<32768;t++){var d=t;d=(4278255360&(d=(4042322160&(d=(3435973836&(d=(2863311530&d)>>>1|(1431655765&d)<<1))>>>2|(858993459&d)<<2))>>>4|(252645135&d)<<4))>>>8|(16711935&d)<<8,e.rev15[t]=(d>>>16|d<<16)>>>17;}function l(_,S,s){for(;S--!=0;)_.push(0,s);}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];l(e.fltree,144,8),l(e.fltree,112,9),l(e.fltree,24,7),l(e.fltree,8,8),c.F.makeCodes(e.fltree,9),c.F.codes2map(e.fltree,9,e.flmap),c.F.revCodes(e.fltree,9),l(e.fdtree,32,5),c.F.makeCodes(e.fdtree,5),c.F.codes2map(e.fdtree,5,e.fdmap),c.F.revCodes(e.fdtree,5),l(e.itree,19,0),l(e.ltree,286,0),l(e.dtree,30,0),l(e.ttree,320,0);})();})();var Qn=Vn({__proto__:null,default:We},[We]),he=(function(){var o={nextZero(s,a){for(;s[a]!=0;)a++;return a},readUshort:(s,a)=>s[a]<<8|s[a+1],writeUshort(s,a,i){s[a]=i>>8&255,s[a+1]=255&i;},readUint:(s,a)=>16777216*s[a]+(s[a+1]<<16|s[a+2]<<8|s[a+3]),writeUint(s,a,i){s[a]=i>>24&255,s[a+1]=i>>16&255,s[a+2]=i>>8&255,s[a+3]=255&i;},readASCII(s,a,i){let u="";for(let v=0;v<i;v++)u+=String.fromCharCode(s[a+v]);return u},writeASCII(s,a,i){for(let u=0;u<i.length;u++)s[a+u]=i.charCodeAt(u);},readBytes(s,a,i){let u=[];for(let v=0;v<i;v++)u.push(s[a+v]);return u},pad:s=>s.length<2?`0${s}`:s,readUTF8(s,a,i){let u,v="";for(let I=0;I<i;I++)v+=`%${o.pad(s[a+I].toString(16))}`;try{u=decodeURIComponent(v);}catch{return o.readASCII(s,a,i)}return u}};function n(s,a,i,u){let v=a*i,I=t(u),O=Math.ceil(a*I/8),C=new Uint8Array(4*v),N=new Uint32Array(C.buffer),{ctype:F}=u,{depth:k}=u,R=o.readUshort;if(F==6){let P=v<<2;if(k==8)for(var g=0;g<P;g+=4)C[g]=s[g],C[g+1]=s[g+1],C[g+2]=s[g+2],C[g+3]=s[g+3];if(k==16)for(g=0;g<P;g++)C[g]=s[g<<1];}else if(F==2){let P=u.tabs.tRNS;if(P==null){if(k==8)for(g=0;g<v;g++){var M=3*g;N[g]=255<<24|s[M+2]<<16|s[M+1]<<8|s[M];}if(k==16)for(g=0;g<v;g++)M=6*g,N[g]=255<<24|s[M+4]<<16|s[M+2]<<8|s[M];}else {var p=P[0];let x=P[1],H=P[2];if(k==8)for(g=0;g<v;g++){var f=g<<2;M=3*g,N[g]=255<<24|s[M+2]<<16|s[M+1]<<8|s[M],s[M]==p&&s[M+1]==x&&s[M+2]==H&&(C[f+3]=0);}if(k==16)for(g=0;g<v;g++)f=g<<2,M=6*g,N[g]=255<<24|s[M+4]<<16|s[M+2]<<8|s[M],R(s,M)==p&&R(s,M+2)==x&&R(s,M+4)==H&&(C[f+3]=0);}}else if(F==3){let P=u.tabs.PLTE,x=u.tabs.tRNS,H=x?x.length:0;if(k==1)for(var b=0;b<i;b++){var r=b*O,m=b*a;for(g=0;g<a;g++){f=m+g<<2;var A=3*(y=s[r+(g>>3)]>>7-((7&g)<<0)&1);C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;}}if(k==2)for(b=0;b<i;b++)for(r=b*O,m=b*a,g=0;g<a;g++)f=m+g<<2,A=3*(y=s[r+(g>>2)]>>6-((3&g)<<1)&3),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;if(k==4)for(b=0;b<i;b++)for(r=b*O,m=b*a,g=0;g<a;g++)f=m+g<<2,A=3*(y=s[r+(g>>1)]>>4-((1&g)<<2)&15),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;if(k==8)for(g=0;g<v;g++){var y;f=g<<2,A=3*(y=s[g]),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;}}else if(F==4){if(k==8)for(g=0;g<v;g++){f=g<<2;var T=s[w=g<<1];C[f]=T,C[f+1]=T,C[f+2]=T,C[f+3]=s[w+1];}if(k==16)for(g=0;g<v;g++){var w;f=g<<2,T=s[w=g<<2],C[f]=T,C[f+1]=T,C[f+2]=T,C[f+3]=s[w+2];}}else if(F==0)for(p=u.tabs.tRNS?u.tabs.tRNS:-1,b=0;b<i;b++){let P=b*O,x=b*a;if(k==1)for(var h=0;h<a;h++){var U=(T=255*(s[P+(h>>>3)]>>>7-(7&h)&1))==255*p?0:255;N[x+h]=U<<24|T<<16|T<<8|T;}else if(k==2)for(h=0;h<a;h++)U=(T=85*(s[P+(h>>>2)]>>>6-((3&h)<<1)&3))==85*p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==4)for(h=0;h<a;h++)U=(T=17*(s[P+(h>>>1)]>>>4-((1&h)<<2)&15))==17*p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==8)for(h=0;h<a;h++)U=(T=s[P+h])==p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==16)for(h=0;h<a;h++)T=s[P+(h<<1)],U=R(s,P+(h<<1))==p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;}return C}function E(s,a,i,u){let v=t(s),I=Math.ceil(i*v/8),O=new Uint8Array((I+1+s.interlace)*u);return a=s.tabs.CgBI?e(a,O):c(a,O),s.interlace==0?a=d(a,s,0,i,u):s.interlace==1&&(a=(function(N,F){let k=F.width,R=F.height,g=t(F),M=g>>3,p=Math.ceil(k*g/8),f=new Uint8Array(R*p),b=0,r=[0,0,4,0,2,0,1],m=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],y=[8,8,4,4,2,2,1],T=0;for(;T<7;){let h=A[T],U=y[T],P=0,x=0,H=r[T];for(;H<R;)H+=h,x++;let L=m[T];for(;L<k;)L+=U,P++;let V=Math.ceil(P*g/8);d(N,F,b,P,x);let B=0,D=r[T];for(;D<R;){let $=m[T],K=b+B*V<<3;for(;$<k;){var w;if(g==1&&(w=(w=N[K>>3])>>7-(7&K)&1,f[D*p+($>>3)]|=w<<7-((7&$)<<0)),g==2&&(w=(w=N[K>>3])>>6-(7&K)&3,f[D*p+($>>2)]|=w<<6-((3&$)<<1)),g==4&&(w=(w=N[K>>3])>>4-(7&K)&15,f[D*p+($>>1)]|=w<<4-((1&$)<<2)),g>=8){let G=D*p+$*M;for(let Q=0;Q<M;Q++)f[G+Q]=N[(K>>3)+Q];}K+=g,$+=U;}B++,D+=h;}P*x!=0&&(b+=x*(1+V)),T+=1;}return f})(a,s)),a}function c(s,a){return e(new Uint8Array(s.buffer,2,s.length-6),a)}var e=(function(){let s={H:{}};return s.H.N=function(a,i){let u=Uint8Array,v,I,O=0,C=0,N=0,F=0,k=0,R=0,g=0,M=0,p=0;if(a[0]==3&&a[1]==0)return i||new u(0);let f=s.H,b=f.b,r=f.e,m=f.R,A=f.n,y=f.A,T=f.Z,w=f.m,h=i==null;for(h&&(i=new u(a.length>>>2<<5));O==0;)if(O=b(a,p,1),C=b(a,p+1,2),p+=3,C!=0){if(h&&(i=s.H.W(i,M+(1<<17))),C==1&&(v=w.J,I=w.h,R=511,g=31),C==2){N=r(a,p,5)+257,F=r(a,p+5,5)+1,k=r(a,p+10,4)+4,p+=14;let P=1;for(var U=0;U<38;U+=2)w.Q[U]=0,w.Q[U+1]=0;for(U=0;U<k;U++){let L=r(a,p+3*U,3);w.Q[1+(w.X[U]<<1)]=L,L>P&&(P=L);}p+=3*k,A(w.Q,P),y(w.Q,P,w.u),v=w.w,I=w.d,p=m(w.u,(1<<P)-1,N+F,a,p,w.v);let x=f.V(w.v,0,N,w.C);R=(1<<x)-1;let H=f.V(w.v,N,F,w.D);g=(1<<H)-1,A(w.C,x),y(w.C,x,v),A(w.D,H),y(w.D,H,I);}for(;;){let P=v[T(a,p)&R];p+=15&P;let x=P>>>4;if(!(x>>>8))i[M++]=x;else {if(x==256)break;{let H=M+x-254;if(x>264){let $=w.q[x-257];H=M+($>>>3)+r(a,p,7&$),p+=7&$;}let L=I[T(a,p)&g];p+=15&L;let V=L>>>4,B=w.c[V],D=(B>>>4)+b(a,p,15&B);for(p+=15&B;M<H;)i[M]=i[M++-D],i[M]=i[M++-D],i[M]=i[M++-D],i[M]=i[M++-D];M=H;}}}}else {(7&p)!=0&&(p+=8-(7&p));let P=4+(p>>>3),x=a[P-4]|a[P-3]<<8;h&&(i=s.H.W(i,M+x)),i.set(new u(a.buffer,a.byteOffset+P,x),M),p=P+x<<3,M+=x;}return i.length==M?i:i.slice(0,M)},s.H.W=function(a,i){let u=a.length;if(i<=u)return a;let v=new Uint8Array(u<<1);return v.set(a,0),v},s.H.R=function(a,i,u,v,I,O){let C=s.H.e,N=s.H.Z,F=0;for(;F<u;){let k=a[N(v,I)&i];I+=15&k;let R=k>>>4;if(R<=15)O[F]=R,F++;else {let g=0,M=0;R==16?(M=3+C(v,I,2),I+=2,g=O[F-1]):R==17?(M=3+C(v,I,3),I+=3):R==18&&(M=11+C(v,I,7),I+=7);let p=F+M;for(;F<p;)O[F]=g,F++;}}return I},s.H.V=function(a,i,u,v){let I=0,O=0,C=v.length>>>1;for(;O<u;){let N=a[O+i];v[O<<1]=0,v[1+(O<<1)]=N,N>I&&(I=N),O++;}for(;O<C;)v[O<<1]=0,v[1+(O<<1)]=0,O++;return I},s.H.n=function(a,i){let u=s.H.m,v=a.length,I,O,C,N,F=u.j;for(var k=0;k<=i;k++)F[k]=0;for(k=1;k<v;k+=2)F[a[k]]++;let R=u.K;for(I=0,F[0]=0,O=1;O<=i;O++)I=I+F[O-1]<<1,R[O]=I;for(C=0;C<v;C+=2)N=a[C+1],N!=0&&(a[C]=R[N],R[N]++);},s.H.A=function(a,i,u){let v=a.length,I=s.H.m.r;for(let O=0;O<v;O+=2)if(a[O+1]!=0){let C=O>>1,N=a[O+1],F=C<<4|N,k=i-N,R=a[O]<<k,g=R+(1<<k);for(;R!=g;)u[I[R]>>>15-i]=F,R++;}},s.H.l=function(a,i){let u=s.H.m.r,v=15-i;for(let I=0;I<a.length;I+=2){let O=a[I]<<i-a[I+1];a[I]=u[O]>>>v;}},s.H.M=function(a,i,u){u<<=7&i;let v=i>>>3;a[v]|=u,a[v+1]|=u>>>8;},s.H.I=function(a,i,u){u<<=7&i;let v=i>>>3;a[v]|=u,a[v+1]|=u>>>8,a[v+2]|=u>>>16;},s.H.e=function(a,i,u){return (a[i>>>3]|a[1+(i>>>3)]<<8)>>>(7&i)&(1<<u)-1},s.H.b=function(a,i,u){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16)>>>(7&i)&(1<<u)-1},s.H.Z=function(a,i){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16)>>>(7&i)},s.H.i=function(a,i){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16|a[3+(i>>>3)]<<24)>>>(7&i)},s.H.m=(function(){let a=Uint16Array,i=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 i(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 i(286),Y:new i(30),a:new i(19),t:new i(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=s.H.m;for(var i=0;i<32768;i++){let v=i;v=(2863311530&v)>>>1|(1431655765&v)<<1,v=(3435973836&v)>>>2|(858993459&v)<<2,v=(4042322160&v)>>>4|(252645135&v)<<4,v=(4278255360&v)>>>8|(16711935&v)<<8,a.r[i]=(v>>>16|v<<16)>>>17;}function u(v,I,O){for(;I--!=0;)v.push(0,O);}for(i=0;i<32;i++)a.q[i]=a.S[i]<<3|a.T[i],a.c[i]=a.p[i]<<4|a.z[i];u(a._,144,8),u(a._,112,9),u(a._,24,7),u(a._,8,8),s.H.n(a._,9),s.H.A(a._,9,a.J),s.H.l(a._,9),u(a.$,32,5),s.H.n(a.$,5),s.H.A(a.$,5,a.h),s.H.l(a.$,5),u(a.Q,19,0),u(a.C,286,0),u(a.D,30,0),u(a.v,320,0);})(),s.H.N})();function t(s){return [1,null,3,1,2,null,4][s.ctype]*s.depth}function d(s,a,i,u,v){let I=t(a),O=Math.ceil(u*I/8),C,N;I=Math.ceil(I/8);let F=s[i],k=0;if(F>1&&(s[i]=[0,0,1][F-2]),F==3)for(k=I;k<O;k++)s[k+1]=s[k+1]+(s[k+1-I]>>>1)&255;for(let R=0;R<v;R++)if(C=i+R*O,N=C+R+1,F=s[N-1],k=0,F==0)for(;k<O;k++)s[C+k]=s[N+k];else if(F==1){for(;k<I;k++)s[C+k]=s[N+k];for(;k<O;k++)s[C+k]=s[N+k]+s[C+k-I];}else if(F==2)for(;k<O;k++)s[C+k]=s[N+k]+s[C+k-O];else if(F==3){for(;k<I;k++)s[C+k]=s[N+k]+(s[C+k-O]>>>1);for(;k<O;k++)s[C+k]=s[N+k]+(s[C+k-O]+s[C+k-I]>>>1);}else {for(;k<I;k++)s[C+k]=s[N+k]+l(0,s[C+k-O],0);for(;k<O;k++)s[C+k]=s[N+k]+l(s[C+k-I],s[C+k-O],s[C+k-I-O]);}return s}function l(s,a,i){let u=s+a-i,v=u-s,I=u-a,O=u-i;return v*v<=I*I&&v*v<=O*O?s:I*I<=O*O?a:i}function _(s,a,i){i.width=o.readUint(s,a),a+=4,i.height=o.readUint(s,a),a+=4,i.depth=s[a],a++,i.ctype=s[a],a++,i.compress=s[a],a++,i.filter=s[a],a++,i.interlace=s[a],a++;}function S(s,a,i,u,v,I,O,C,N){let F=Math.min(a,v),k=Math.min(i,I),R=0,g=0;for(let T=0;T<k;T++)for(let w=0;w<F;w++)if(O>=0&&C>=0?(R=T*a+w<<2,g=(C+T)*v+O+w<<2):(R=(-C+T)*a-O+w<<2,g=T*v+w<<2),N==0)u[g]=s[R],u[g+1]=s[R+1],u[g+2]=s[R+2],u[g+3]=s[R+3];else if(N==1){var M=s[R+3]*.00392156862745098,p=s[R]*M,f=s[R+1]*M,b=s[R+2]*M,r=u[g+3]*(1/255),m=u[g]*r,A=u[g+1]*r,y=u[g+2]*r;let h=1-M,U=M+r*h,P=U==0?0:1/U;u[g+3]=255*U,u[g+0]=(p+m*h)*P,u[g+1]=(f+A*h)*P,u[g+2]=(b+y*h)*P;}else if(N==2)M=s[R+3],p=s[R],f=s[R+1],b=s[R+2],r=u[g+3],m=u[g],A=u[g+1],y=u[g+2],M==r&&p==m&&f==A&&b==y?(u[g]=0,u[g+1]=0,u[g+2]=0,u[g+3]=0):(u[g]=p,u[g+1]=f,u[g+2]=b,u[g+3]=M);else if(N==3){if(M=s[R+3],p=s[R],f=s[R+1],b=s[R+2],r=u[g+3],m=u[g],A=u[g+1],y=u[g+2],M==r&&p==m&&f==A&&b==y)continue;if(M<220&&r>20)return false}return true}return {decode:function(a){let i=new Uint8Array(a),u=8,v=o,I=v.readUshort,O=v.readUint,C={tabs:{},frames:[]},N=new Uint8Array(i.length),F,k=0,R=0,g=[137,80,78,71,13,10,26,10];for(var M=0;M<8;M++)if(i[M]!=g[M])throw "The input is not a PNG file!";for(;u<i.length;){let T=v.readUint(i,u);u+=4;let w=v.readASCII(i,u,4);if(u+=4,w=="IHDR")_(i,u,C);else if(w=="iCCP"){for(var p=u;i[p]!=0;)p++;v.readASCII(i,u,p-u),i[p+1];let h=i.slice(p+2,u+T),U=null;try{U=c(h);}catch{U=e(h);}C.tabs[w]=U;}else if(w=="CgBI")C.tabs[w]=i.slice(u,u+4);else if(w=="IDAT"){for(M=0;M<T;M++)N[k+M]=i[u+M];k+=T;}else if(w=="acTL")C.tabs[w]={num_frames:O(i,u),num_plays:O(i,u+4)},F=new Uint8Array(i.length);else if(w=="fcTL"){R!=0&&((y=C.frames[C.frames.length-1]).data=E(C,F.slice(0,R),y.rect.width,y.rect.height),R=0);let h={x:O(i,u+12),y:O(i,u+16),width:O(i,u+4),height:O(i,u+8)},U=I(i,u+22);U=I(i,u+20)/(U==0?100:U);let P={rect:h,delay:Math.round(1e3*U),dispose:i[u+24],blend:i[u+25]};C.frames.push(P);}else if(w=="fdAT"){for(M=0;M<T-4;M++)F[R+M]=i[u+M+4];R+=T-4;}else if(w=="pHYs")C.tabs[w]=[v.readUint(i,u),v.readUint(i,u+4),i[u+8]];else if(w=="cHRM")for(C.tabs[w]=[],M=0;M<8;M++)C.tabs[w].push(v.readUint(i,u+4*M));else if(w=="tEXt"||w=="zTXt"){C.tabs[w]==null&&(C.tabs[w]={});var f=v.nextZero(i,u),b=v.readASCII(i,u,f-u),r=u+T-f-1;if(w=="tEXt")A=v.readASCII(i,f+1,r);else {var m=c(i.slice(f+2,f+2+r));A=v.readUTF8(m,0,m.length);}C.tabs[w][b]=A;}else if(w=="iTXt"){C.tabs[w]==null&&(C.tabs[w]={}),f=0,p=u,f=v.nextZero(i,p),b=v.readASCII(i,p,f-p);let h=i[p=f+1];var A;i[p+1],p+=2,f=v.nextZero(i,p),v.readASCII(i,p,f-p),p=f+1,f=v.nextZero(i,p),v.readUTF8(i,p,f-p),r=T-((p=f+1)-u),h==0?A=v.readUTF8(i,p,r):(m=c(i.slice(p,p+r)),A=v.readUTF8(m,0,m.length)),C.tabs[w][b]=A;}else if(w=="PLTE")C.tabs[w]=v.readBytes(i,u,T);else if(w=="hIST"){let h=C.tabs.PLTE.length/3;for(C.tabs[w]=[],M=0;M<h;M++)C.tabs[w].push(I(i,u+2*M));}else if(w=="tRNS")C.ctype==3?C.tabs[w]=v.readBytes(i,u,T):C.ctype==0?C.tabs[w]=I(i,u):C.ctype==2&&(C.tabs[w]=[I(i,u),I(i,u+2),I(i,u+4)]);else if(w=="gAMA")C.tabs[w]=v.readUint(i,u)/1e5;else if(w=="sRGB")C.tabs[w]=i[u];else if(w=="bKGD")C.ctype==0||C.ctype==4?C.tabs[w]=[I(i,u)]:C.ctype==2||C.ctype==6?C.tabs[w]=[I(i,u),I(i,u+2),I(i,u+4)]:C.ctype==3&&(C.tabs[w]=i[u]);else if(w=="IEND")break;u+=T,v.readUint(i,u),u+=4;}var y;return R!=0&&((y=C.frames[C.frames.length-1]).data=E(C,F.slice(0,R),y.rect.width,y.rect.height)),C.data=E(C,N,C.width,C.height),delete C.compress,delete C.interlace,delete C.filter,C},toRGBA8:function(a){let i=a.width,u=a.height;if(a.tabs.acTL==null)return [n(a.data,i,u,a).buffer];let v=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let I=i*u*4,O=new Uint8Array(I),C=new Uint8Array(I),N=new Uint8Array(I);for(let k=0;k<a.frames.length;k++){let R=a.frames[k],g=R.rect.x,M=R.rect.y,p=R.rect.width,f=R.rect.height,b=n(R.data,p,f,a);if(k!=0)for(var F=0;F<I;F++)N[F]=O[F];if(R.blend==0?S(b,p,f,O,i,u,g,M,0):R.blend==1&&S(b,p,f,O,i,u,g,M,1),v.push(O.buffer.slice(0)),R.dispose!=0){if(R.dispose==1)S(C,p,f,O,i,u,g,M,0);else if(R.dispose==2)for(F=0;F<I;F++)O[F]=N[F];}}return v},_paeth:l,_copyTile:S,_bin:o}})();(function(){let{_copyTile:o}=he,{_bin:n}=he,E=he._paeth;var c={table:(function(){let p=new Uint32Array(256);for(let f=0;f<256;f++){let b=f;for(let r=0;r<8;r++)1&b?b=3988292384^b>>>1:b>>>=1;p[f]=b;}return p})(),update(p,f,b,r){for(let m=0;m<r;m++)p=c.table[255&(p^f[b+m])]^p>>>8;return p},crc:(p,f,b)=>4294967295^c.update(4294967295,p,f,b)};function e(p,f,b,r){f[b]+=p[0]*r>>4,f[b+1]+=p[1]*r>>4,f[b+2]+=p[2]*r>>4,f[b+3]+=p[3]*r>>4;}function t(p){return Math.max(0,Math.min(255,p))}function d(p,f){let b=p[0]-f[0],r=p[1]-f[1],m=p[2]-f[2],A=p[3]-f[3];return b*b+r*r+m*m+A*A}function l(p,f,b,r,m,A,y){y==null&&(y=1);let T=r.length,w=[];for(var h=0;h<T;h++){let D=r[h];w.push([D>>>0&255,D>>>8&255,D>>>16&255,D>>>24&255]);}for(h=0;h<T;h++){let D=4294967295;for(var U=0,P=0;P<T;P++){var x=d(w[h],w[P]);P!=h&&x<D&&(D=x,U=P);}}let H=new Uint32Array(m.buffer),L=new Int16Array(f*b*4),V=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<V.length;h++)V[h]=255*((V[h]+.5)/16-.5);for(let D=0;D<b;D++)for(let $=0;$<f;$++){var B;h=4*(D*f+$),y!=2?B=[t(p[h]+L[h]),t(p[h+1]+L[h+1]),t(p[h+2]+L[h+2]),t(p[h+3]+L[h+3])]:(x=V[4*(3&D)+(3&$)],B=[t(p[h]+x),t(p[h+1]+x),t(p[h+2]+x),t(p[h+3]+x)]),U=0;let K=16777215;for(P=0;P<T;P++){let q=d(B,w[P]);q<K&&(K=q,U=P);}let G=w[U],Q=[B[0]-G[0],B[1]-G[1],B[2]-G[2],B[3]-G[3]];y==1&&($!=f-1&&e(Q,L,h+4,7),D!=b-1&&($!=0&&e(Q,L,h+4*f-4,3),e(Q,L,h+4*f,5),$!=f-1&&e(Q,L,h+4*f+4,1))),A[h>>2]=U,H[h>>2]=r[U];}}function _(p,f,b,r,m){m==null&&(m={});let{crc:A}=c,y=n.writeUint,T=n.writeUshort,w=n.writeASCII,h=8,U=p.frames.length>1,P,x=false,H=33+(U?20:0);if(m.sRGB!=null&&(H+=13),m.pHYs!=null&&(H+=21),m.iCCP!=null&&(P=pako.deflate(m.iCCP),H+=21+P.length+4),p.ctype==3){for(var L=p.plte.length,V=0;V<L;V++)p.plte[V]>>>24!=255&&(x=true);H+=8+3*L+4+(x?8+1*L+4:0);}for(var B=0;B<p.frames.length;B++)U&&(H+=38),H+=(G=p.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let D=new Uint8Array(H),$=[137,80,78,71,13,10,26,10];for(V=0;V<8;V++)D[V]=$[V];if(y(D,h,13),h+=4,w(D,h,"IHDR"),h+=4,y(D,h,f),h+=4,y(D,h,b),h+=4,D[h]=p.depth,h++,D[h]=p.ctype,h++,D[h]=0,h++,D[h]=0,h++,D[h]=0,h++,y(D,h,A(D,h-17,17)),h+=4,m.sRGB!=null&&(y(D,h,1),h+=4,w(D,h,"sRGB"),h+=4,D[h]=m.sRGB,h++,y(D,h,A(D,h-5,5)),h+=4),m.iCCP!=null){let Q=13+P.length;y(D,h,Q),h+=4,w(D,h,"iCCP"),h+=4,w(D,h,"ICC profile"),h+=11,h+=2,D.set(P,h),h+=P.length,y(D,h,A(D,h-(Q+4),Q+4)),h+=4;}if(m.pHYs!=null&&(y(D,h,9),h+=4,w(D,h,"pHYs"),h+=4,y(D,h,m.pHYs[0]),h+=4,y(D,h,m.pHYs[1]),h+=4,D[h]=m.pHYs[2],h++,y(D,h,A(D,h-13,13)),h+=4),U&&(y(D,h,8),h+=4,w(D,h,"acTL"),h+=4,y(D,h,p.frames.length),h+=4,y(D,h,m.loop!=null?m.loop:0),h+=4,y(D,h,A(D,h-12,12)),h+=4),p.ctype==3){for(y(D,h,3*(L=p.plte.length)),h+=4,w(D,h,"PLTE"),h+=4,V=0;V<L;V++){let Q=3*V,q=p.plte[V],z=255&q,W=q>>>8&255,ie=q>>>16&255;D[h+Q+0]=z,D[h+Q+1]=W,D[h+Q+2]=ie;}if(h+=3*L,y(D,h,A(D,h-3*L-4,3*L+4)),h+=4,x){for(y(D,h,L),h+=4,w(D,h,"tRNS"),h+=4,V=0;V<L;V++)D[h+V]=p.plte[V]>>>24&255;h+=L,y(D,h,A(D,h-L-4,L+4)),h+=4;}}let K=0;for(B=0;B<p.frames.length;B++){var G=p.frames[B];U&&(y(D,h,26),h+=4,w(D,h,"fcTL"),h+=4,y(D,h,K++),h+=4,y(D,h,G.rect.width),h+=4,y(D,h,G.rect.height),h+=4,y(D,h,G.rect.x),h+=4,y(D,h,G.rect.y),h+=4,T(D,h,r[B]),h+=2,T(D,h,1e3),h+=2,D[h]=G.dispose,h++,D[h]=G.blend,h++,y(D,h,A(D,h-30,30)),h+=4);let Q=G.cimg;y(D,h,(L=Q.length)+(B==0?0:4)),h+=4;let q=h;w(D,h,B==0?"IDAT":"fdAT"),h+=4,B!=0&&(y(D,h,K++),h+=4),D.set(Q,h),h+=L,y(D,h,A(D,q,h-q)),h+=4;}return y(D,h,0),h+=4,w(D,h,"IEND"),h+=4,y(D,h,A(D,h-4,4)),h+=4,D.buffer}function S(p,f,b){for(let r=0;r<p.frames.length;r++){let m=p.frames[r];m.rect.width;let A=m.rect.height,y=new Uint8Array(A*m.bpl+A);m.cimg=u(m.img,A,m.bpp,m.bpl,y,f,b);}}function s(p,f,b,r,m){let A=m[0],y=m[1],T=m[2],w=m[3],h=m[4],U=m[5],P=6,x=8,H=255;for(var L=0;L<p.length;L++){let te=new Uint8Array(p[L]);for(var V=te.length,B=0;B<V;B+=4)H&=te[B+3];}let D=H!=255,$=(function(J,X,ne,oe,j,ue){let ee=[];for(var Y=0;Y<J.length;Y++){let le=new Uint8Array(J[Y]),pe=new Uint32Array(le.buffer);var ce;let de=0,ve=0,me=X,Ce=ne,et=oe?1:0;if(Y!=0){let kn=ue||oe||Y==1||ee[Y-2].dispose!=0?1:2,tt=0,Rt=1e9;for(let Le=0;Le<kn;Le++){var ge=new Uint8Array(J[Y-1-Le]);let Un=new Uint32Array(J[Y-1-Le]),Ae=X,be=ne,Oe=-1,De=-1;for(let Ie=0;Ie<ne;Ie++)for(let Re=0;Re<X;Re++)pe[ae=Ie*X+Re]!=Un[ae]&&(Re<Ae&&(Ae=Re),Re>Oe&&(Oe=Re),Ie<be&&(be=Ie),Ie>De&&(De=Ie));Oe==-1&&(Ae=be=Oe=De=0),j&&((1&Ae)==1&&Ae--,(1&be)==1&&be--);let Mt=(Oe-Ae+1)*(De-be+1);Mt<Rt&&(Rt=Mt,tt=Le,de=Ae,ve=be,me=Oe-Ae+1,Ce=De-be+1);}ge=new Uint8Array(J[Y-1-tt]),tt==1&&(ee[Y-1].dispose=2),ce=new Uint8Array(me*Ce*4),o(ge,X,ne,ce,me,Ce,-de,-ve,0),et=o(le,X,ne,ce,me,Ce,-de,-ve,3)?1:0,et==1?i(le,X,ne,ce,{x:de,y:ve,width:me,height:Ce}):o(le,X,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:et,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(J,X,ne,ee,Y-1,me,j),a(J,X,ne,ee,Y,me,j);}let Ve=0;if(J.length!=1)for(var ae=0;ae<ee.length;ae++){var Te;Ve+=(Te=ee[ae]).rect.width*Te.rect.height;}return ee})(p,f,b,A,y,T),K={},G=[],Q=[];if(r!=0){let te=[];for(B=0;B<$.length;B++)te.push($[B].img.buffer);let J=(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]),Ve=ge.length;for(let ae=0;ae<Ve;ae+=4){let Te=ge[ae],le=ge[ae+1],pe=ge[ae+2],de=ge[ae+3];de==0&&(Te=le=pe=0),Y[ce+ae]=Te,Y[ce+ae+1]=le,Y[ce+ae+2]=pe,Y[ce+ae+3]=de;}ce+=Ve;}return Y.buffer})(te),X=I(J,r);for(B=0;B<X.plte.length;B++)G.push(X.plte[B].est.rgba);let ne=0;for(B=0;B<$.length;B++){let oe=(z=$[B]).img.length;var q=new Uint8Array(X.inds.buffer,ne>>2,oe>>2);Q.push(q);let j=new Uint8Array(X.abuf,ne,oe);U&&l(z.img,z.rect.width,z.rect.height,G,j,q),z.img.set(j),ne+=oe;}}else for(L=0;L<$.length;L++){var z=$[L];let te=new Uint32Array(z.img.buffer);var W=z.rect.width;for(V=te.length,q=new Uint8Array(V),Q.push(q),B=0;B<V;B++){let J=te[B];if(B!=0&&J==te[B-1])q[B]=q[B-1];else if(B>W&&J==te[B-W])q[B]=q[B-W];else {let X=K[J];if(X==null&&(K[J]=X=G.length,G.push(J),G.length>=300))break;q[B]=X;}}}let ie=G.length;for(ie<=256&&h==0&&(x=ie<=2?1:ie<=4?2:ie<=16?4:8,x=Math.max(x,w)),L=0;L<$.length;L++){(z=$[L]).rect.x,z.rect.y,W=z.rect.width;let te=z.rect.height,J=z.img;new Uint32Array(J.buffer);let X=4*W,ne=4;if(ie<=256&&h==0){X=Math.ceil(x*W/8);var se=new Uint8Array(X*te);let oe=Q[L];for(let j=0;j<te;j++){B=j*X;let ue=j*W;if(x==8)for(var Z=0;Z<W;Z++)se[B+Z]=oe[ue+Z];else if(x==4)for(Z=0;Z<W;Z++)se[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(x==2)for(Z=0;Z<W;Z++)se[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(x==1)for(Z=0;Z<W;Z++)se[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}J=se,P=3,ne=1;}else if(D==0&&$.length==1){se=new Uint8Array(W*te*3);let oe=W*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;se[j]=J[ue],se[j+1]=J[ue+1],se[j+2]=J[ue+2];}J=se,P=2,ne=3,X=3*W;}z.img=J,z.bpl=X,z.bpp=ne;}return {ctype:P,depth:x,plte:G,frames:$}}function a(p,f,b,r,m,A,y){let T=Uint8Array,w=Uint32Array,h=new T(p[m-1]),U=new w(p[m-1]),P=m+1<p.length?new T(p[m+1]):null,x=new T(p[m]),H=new w(x.buffer),L=f,V=b,B=-1,D=-1;for(let K=0;K<A.height;K++)for(let G=0;G<A.width;G++){let Q=A.x+G,q=A.y+K,z=q*f+Q,W=H[z];W==0||r[m-1].dispose==0&&U[z]==W&&(P==null||P[4*z+3]!=0)||(Q<L&&(L=Q),Q>B&&(B=Q),q<V&&(V=q),q>D&&(D=q));}B==-1&&(L=V=B=D=0),y&&((1&L)==1&&L--,(1&V)==1&&V--),A={x:L,y:V,width:B-L+1,height:D-V+1};let $=r[m];$.rect=A,$.blend=1,$.img=new Uint8Array(A.width*A.height*4),r[m-1].dispose==0?(o(h,f,b,$.img,A.width,A.height,-A.x,-A.y,0),i(x,f,b,$.img,A)):o(x,f,b,$.img,A.width,A.height,-A.x,-A.y,0);}function i(p,f,b,r,m){o(p,f,b,r,m.width,m.height,-m.x,-m.y,2);}function u(p,f,b,r,m,A,y){let T=[],w,h=[0,1,2,3,4];A!=-1?h=[A]:(f*r>5e5||b==1)&&(h=[0]),y&&(w={level:0});let U=Qn;for(var P=0;P<h.length;P++){for(let L=0;L<f;L++)v(m,p,L,r,b,h[P]);T.push(U.deflate(m,w));}let x,H=1e9;for(P=0;P<T.length;P++)T[P].length<H&&(x=P,H=T[P].length);return T[x]}function v(p,f,b,r,m,A){let y=b*r,T=y+b;if(p[T]=A,T++,A==0)if(r<500)for(var w=0;w<r;w++)p[T+w]=f[y+w];else p.set(new Uint8Array(f.buffer,y,r),T);else if(A==1){for(w=0;w<m;w++)p[T+w]=f[y+w];for(w=m;w<r;w++)p[T+w]=f[y+w]-f[y+w-m]+256&255;}else if(b==0){for(w=0;w<m;w++)p[T+w]=f[y+w];if(A==2)for(w=m;w<r;w++)p[T+w]=f[y+w];if(A==3)for(w=m;w<r;w++)p[T+w]=f[y+w]-(f[y+w-m]>>1)+256&255;if(A==4)for(w=m;w<r;w++)p[T+w]=f[y+w]-E(f[y+w-m],0,0)+256&255;}else {if(A==2)for(w=0;w<r;w++)p[T+w]=f[y+w]+256-f[y+w-r]&255;if(A==3){for(w=0;w<m;w++)p[T+w]=f[y+w]+256-(f[y+w-r]>>1)&255;for(w=m;w<r;w++)p[T+w]=f[y+w]+256-(f[y+w-r]+f[y+w-m]>>1)&255;}if(A==4){for(w=0;w<m;w++)p[T+w]=f[y+w]+256-E(0,f[y+w-r],0)&255;for(w=m;w<r;w++)p[T+w]=f[y+w]+256-E(f[y+w-m],f[y+w-r],f[y+w-m-r])&255;}}}function I(p,f){let b=new Uint8Array(p),r=b.slice(0),m=new Uint32Array(r.buffer),A=O(r,f),y=A[0],T=A[1],w=b.length,h=new Uint8Array(w>>2),U;if(b.length<2e7)for(var P=0;P<w;P+=4)U=C(y,x=b[P]*(1/255),H=b[P+1]*(1/255),L=b[P+2]*(1/255),V=b[P+3]*(1/255)),h[P>>2]=U.ind,m[P>>2]=U.est.rgba;else for(P=0;P<w;P+=4){var x=b[P]*.00392156862745098,H=b[P+1]*(1/255),L=b[P+2]*(1/255),V=b[P+3]*(1/255);for(U=y;U.left;)U=N(U.est,x,H,L,V)<=0?U.left:U.right;h[P>>2]=U.ind,m[P>>2]=U.est.rgba;}return {abuf:r.buffer,inds:h,plte:T}}function O(p,f,b){b==null&&(b=1e-4);let r=new Uint32Array(p.buffer),m={i0:0,i1:p.length,bst:null,est:null,tdst:0,left:null,right:null};m.bst=R(p,m.i0,m.i1),m.est=g(m.bst);let A=[m];for(;A.length<f;){let T=0,w=0;for(var y=0;y<A.length;y++)A[y].est.L>T&&(T=A[y].est.L,w=y);if(T<b)break;let h=A[w],U=F(p,r,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=U||h.i1<=U){h.est.L=0;continue}let P={i0:h.i0,i1:U,bst:null,est:null,tdst:0,left:null,right:null};P.bst=R(p,P.i0,P.i1),P.est=g(P.bst);let x={i0:U,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:h.bst.N-P.bst.N},y=0;y<16;y++)x.bst.R[y]=h.bst.R[y]-P.bst.R[y];for(y=0;y<4;y++)x.bst.m[y]=h.bst.m[y]-P.bst.m[y];x.est=g(x.bst),h.left=P,h.right=x,A[w]=P,A.push(x);}for(A.sort(((T,w)=>w.bst.N-T.bst.N)),y=0;y<A.length;y++)A[y].ind=y;return [m,A]}function C(p,f,b,r,m){if(p.left==null)return p.tdst=(function(P,x,H,L,V){let B=x-P[0],D=H-P[1],$=L-P[2],K=V-P[3];return B*B+D*D+$*$+K*K})(p.est.q,f,b,r,m),p;let A=N(p.est,f,b,r,m),y=p.left,T=p.right;A>0&&(y=p.right,T=p.left);let w=C(y,f,b,r,m);if(w.tdst<=A*A)return w;let h=C(T,f,b,r,m);return h.tdst<w.tdst?h:w}function N(p,f,b,r,m){let{e:A}=p;return A[0]*f+A[1]*b+A[2]*r+A[3]*m-p.eMq}function F(p,f,b,r,m,A){for(r-=4;b<r;){for(;k(p,b,m)<=A;)b+=4;for(;k(p,r,m)>A;)r-=4;if(b>=r)break;let y=f[b>>2];f[b>>2]=f[r>>2],f[r>>2]=y,b+=4,r-=4;}for(;k(p,b,m)>A;)b-=4;return b+4}function k(p,f,b){return p[f]*b[0]+p[f+1]*b[1]+p[f+2]*b[2]+p[f+3]*b[3]}function R(p,f,b){let r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=[0,0,0,0],A=b-f>>2;for(let y=f;y<b;y+=4){let T=p[y]*.00392156862745098,w=p[y+1]*(1/255),h=p[y+2]*(1/255),U=p[y+3]*(1/255);m[0]+=T,m[1]+=w,m[2]+=h,m[3]+=U,r[0]+=T*T,r[1]+=T*w,r[2]+=T*h,r[3]+=T*U,r[5]+=w*w,r[6]+=w*h,r[7]+=w*U,r[10]+=h*h,r[11]+=h*U,r[15]+=U*U;}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m,N:A}}function g(p){let{R:f}=p,{m:b}=p,{N:r}=p,m=b[0],A=b[1],y=b[2],T=b[3],w=r==0?0:1/r,h=[f[0]-m*m*w,f[1]-m*A*w,f[2]-m*y*w,f[3]-m*T*w,f[4]-A*m*w,f[5]-A*A*w,f[6]-A*y*w,f[7]-A*T*w,f[8]-y*m*w,f[9]-y*A*w,f[10]-y*y*w,f[11]-y*T*w,f[12]-T*m*w,f[13]-T*A*w,f[14]-T*y*w,f[15]-T*T*w],U=h,P=M,x=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,L=0;if(r!=0)for(let B=0;B<16&&(x=P.multVec(U,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=[m*w,A*w,y*w,T*w];return {Cov:h,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 M={multVec:(p,f)=>[p[0]*f[0]+p[1]*f[1]+p[2]*f[2]+p[3]*f[3],p[4]*f[0]+p[5]*f[1]+p[6]*f[2]+p[7]*f[3],p[8]*f[0]+p[9]*f[1]+p[10]*f[2]+p[11]*f[3],p[12]*f[0]+p[13]*f[1]+p[14]*f[2]+p[15]*f[3]],dot:(p,f)=>p[0]*f[0]+p[1]*f[1]+p[2]*f[2]+p[3]*f[3],sml:(p,f)=>[p*f[0],p*f[1],p*f[2],p*f[3]]};he.encode=function(f,b,r,m,A,y,T){m==null&&(m=0),T==null&&(T=false);let w=s(f,b,r,m,[false,false,false,0,T,false]);return S(w,-1),_(w,b,r,A,y)},he.encodeLL=function(f,b,r,m,A,y,T,w){let h={ctype:0+(m==1?0:2)+(A==0?0:4),depth:y,frames:[]},U=(m+A)*y,P=U*b;for(let x=0;x<f.length;x++)h.frames.push({rect:{x:0,y:0,width:b,height:r},img:new Uint8Array(f[x]),blend:0,dispose:1,bpp:Math.ceil(U/8),bpl:Math.ceil(P/8)});return S(h,0,true),_(h,b,r,T,w)},he.encode.compress=s,he.encode.dither=l,he.quantize=I,he.quantize.getKDtree=O,he.quantize.getNearest=C;})();var Ut={toArrayBuffer(o,n){let E=o.width,c=o.height,e=E<<2,t=o.getContext("2d").getImageData(0,0,E,c),d=new Uint32Array(t.data.buffer),l=(32*E+31)/32<<2,_=l*c,S=122+_,s=new ArrayBuffer(S),a=new DataView(s),i=1<<20,u,v,I,O,C=i,N=0,F=0,k=0;function R(p){a.setUint16(F,p,true),F+=2;}function g(p){a.setUint32(F,p,true),F+=4;}function M(p){F+=p;}R(19778),g(S),M(4),g(122),g(108),g(E),g(-c>>>0),R(1),R(32),g(3),g(_),g(2835),g(2835),M(8),g(16711680),g(65280),g(255),g(4278190080),g(1466527264),(function p(){for(;N<c&&C>0;){for(O=122+N*l,u=0;u<e;)C--,v=d[k++],I=v>>>24,a.setUint32(O+u,v<<8|I),u+=4;N++;}k<d.length?(C=i,setTimeout(p,Ut._dly)):n(s);})();},toBlob(o,n){this.toArrayBuffer(o,(E=>{n(new Blob([E],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},zn={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},ot=typeof globalThis.window<"u",Lt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Qe=ot&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),Gn=(ot||Lt)&&(Qe&&Qe.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Dt=(ot||Lt)&&(Qe&&Qe.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function it(o,n,E=Date.now()){return new Promise((c=>{let e=o.split(","),t=e[0].match(/:(.*?);/)[1],d=globalThis.atob(e[1]),l=d.length,_=new Uint8Array(l);for(;l--;)_[l]=d.charCodeAt(l);let S=new Blob([_],{type:t});S.name=n,S.lastModified=E,c(S);}))}function Ft(o){return new Promise(((n,E)=>{let c=new Dt;c.onload=()=>n(c.result),c.onerror=e=>E(e),c.readAsDataURL(o);}))}function Nt(o){return new Promise(((n,E)=>{let c=new globalThis.Image;c.onload=()=>n(c),c.onerror=e=>E(e),c.src=o;}))}function Me(){if(Me.cachedResult!==void 0)return Me.cachedResult;let o=fe.ETC,{userAgent:n}=navigator;return /Chrom(e|ium)/i.test(n)?o=fe.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?o=fe.IOS:/Safari/i.test(n)?o=fe.DESKTOP_SAFARI:/Firefox/i.test(n)?o=fe.FIREFOX:(/MSIE/i.test(n)||globalThis.document.documentMode)&&(o=fe.IE),Me.cachedResult=o,Me.cachedResult}function Bt(o,n){let E=Me(),c=zn[E],e=o,t=n,d=e*t,l=e>t?t/e:e/t;for(;d>c*c;){let _=(c+e)/2,S=(c+t)/2;_<S?(t=S,e=S*l):(t=_*l,e=_),d=e*t;}return {width:e,height:t}}function qe(o,n){let E,c;try{if(E=new OffscreenCanvas(o,n),c=E.getContext("2d"),c===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{E=globalThis.document.createElement("canvas"),c=E.getContext("2d");}return E.width=o,E.height=n,[E,c]}function Ht(o,n){let{width:E,height:c}=Bt(o.width,o.height),[e,t]=qe(E,c);return n&&/jpe?g/.test(n)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(o,0,0,e.width,e.height),e}function $e(){return $e.cachedResult!==void 0||($e.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),$e.cachedResult}function ze(o,n={}){return new Promise((function(E,c){let e,t;var d=function(){try{return t=Ht(e,n.fileType||o.type),E([e,t])}catch(_){return c(_)}},l=function(_){try{var S=function(s){try{throw s}catch(a){return c(a)}};try{let s;return Ft(o).then((function(a){try{return s=a,Nt(s).then((function(i){try{return e=i,(function(){try{return d()}catch(u){return c(u)}})()}catch(u){return S(u)}}),S)}catch(i){return S(i)}}),S)}catch(s){S(s);}}catch(s){return c(s)}};try{if($e()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(Me()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(o).then((function(_){try{return e=_,d()}catch{return l()}}),l)}catch{l();}}))}function Ge(o,n,E,c,e=1){return new Promise((function(t,d){let l;if(n==="image/png"){let a,i,u;return a=o.getContext("2d"),{data:i}=a.getImageData(0,0,o.width,o.height),u=he.encode([i.buffer],o.width,o.height,4096*e),l=new Blob([u],{type:n}),l.name=E,l.lastModified=c,_.call(this)}{let a=function(){return _.call(this)};if(n==="image/bmp")return new Promise((i=>Ut.toBlob(o,i))).then(function(i){try{return l=i,l.name=E,l.lastModified=c,a.call(this)}catch(u){return d(u)}}.bind(this),d);{let i=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&o instanceof OffscreenCanvas)return o.convertToBlob({type:n,quality:e}).then(function(u){try{return l=u,l.name=E,l.lastModified=c,i.call(this)}catch(v){return d(v)}}.bind(this),d);{let u;return u=o.toDataURL(n,e),it(u,E,c).then(function(v){try{return l=v,i.call(this)}catch(I){return d(I)}}.bind(this),d)}}}function _(){return t(l)}}))}function we(o){o.width=0,o.height=0;}function xe(){return new Promise((function(o,n){let c,e,t,d;return xe.cachedResult!==void 0?o(xe.cachedResult):(it("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(l){try{return c=l,ze(c).then((function(_){try{return e=_[1],Ge(e,c.type,c.name,c.lastModified).then((function(S){try{return t=S,we(e),ze(t).then((function(s){try{return d=s[0],xe.cachedResult=d.width===1&&d.height===2,o(xe.cachedResult)}catch(a){return n(a)}}),n)}catch(s){return n(s)}}),n)}catch(S){return n(S)}}),n)}catch(_){return n(_)}}),n))}))}function Vt(o){return new Promise(((n,E)=>{let c=new Dt;c.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return n(-2);let d=t.byteLength,l=2;for(;l<d;){if(t.getUint16(l+2,false)<=8)return n(-1);let _=t.getUint16(l,false);if(l+=2,_==65505){if(t.getUint32(l+=2,false)!=1165519206)return n(-1);let S=t.getUint16(l+=6,false)==18761;l+=t.getUint32(l+4,S);let s=t.getUint16(l,S);l+=2;for(let a=0;a<s;a++)if(t.getUint16(l+12*a,S)==274)return n(t.getUint16(l+12*a+8,S))}else {if((65280&_)!=65280)break;l+=t.getUint16(l,false);}}return n(-1)},c.onerror=e=>E(e),c.readAsArrayBuffer(o);}))}function $t(o,n){let{width:E}=o,{height:c}=o,{maxWidthOrHeight:e}=n,t,d=o;return isFinite(e)&&(E>e||c>e)&&([d,t]=qe(E,c),E>c?(d.width=e,d.height=c/E*e):(d.width=E/c*e,d.height=e),t.drawImage(o,0,0,d.width,d.height),we(o)),d}function Wt(o,n){let{width:E}=o,{height:c}=o,[e,t]=qe(E,c);switch(n>4&&n<9?(e.width=c,e.height=E):(e.width=E,e.height=c),n){case 2:t.transform(-1,0,0,1,E,0);break;case 3:t.transform(-1,0,0,-1,E,c);break;case 4:t.transform(1,0,0,-1,0,c);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,c,0);break;case 7:t.transform(0,-1,-1,0,c,E);break;case 8:t.transform(0,-1,1,0,0,E);}return t.drawImage(o,0,0,E,c),we(o),e}function xt(o,n,E=0){return new Promise((function(c,e){let t,d,l,_,S,s,a,i,u,v,I,O,C,N,F,k,R,g,M,p;function f(r=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;t+=r,n.onProgress(Math.min(t,100));}function b(r){if(n.signal&&n.signal.aborted)throw n.signal.reason;t=Math.min(Math.max(r,t),100),n.onProgress(t);}return t=E,d=n.maxIteration||10,l=1024*n.maxSizeMB*1024,f(),ze(o,n).then(function(r){try{return [,_]=r,f(),S=$t(_,n),f(),new Promise((function(m,A){var y;if(!(y=n.exifOrientation))return Vt(o).then(function(w){try{return y=w,T.call(this)}catch(h){return A(h)}}.bind(this),A);function T(){return m(y)}return T.call(this)})).then(function(m){try{return s=m,f(),xe().then(function(A){try{return a=A?S:Wt(S,s),f(),i=n.initialQuality||1,u=n.fileType||o.type,Ge(a,u,o.name,o.lastModified,i).then(function(y){try{{let U=function(){if(d--&&(F>l||F>C)){let x,H;return x=p?.95*M.width:M.width,H=p?.95*M.height:M.height,[R,g]=qe(x,H),g.drawImage(M,0,0,x,H),i*=u==="image/png"?.85:.95,Ge(R,u,o.name,o.lastModified,i).then((function(L){try{return k=L,we(M),M=R,F=k.size,b(Math.min(99,Math.floor((N-F)/(N-l)*100))),U}catch(V){return e(V)}}),e)}return [1]},P=function(){return we(M),we(R),we(S),we(a),we(_),b(100),c(k)};var w=U,h=P;if(v=y,f(),I=v.size>l,O=v.size>o.size,!I&&!O)return b(100),c(v);var T;return C=o.size,N=v.size,F=N,M=a,p=!n.alwaysKeepResolution&&I,(T=function(x){for(;x;){if(x.then)return void x.then(T,e);try{if(x.pop){if(x.length)return x.pop()?P.call(this):x;x=U;}else x=x.call(this);}catch(H){return e(H)}}}.bind(this))(U)}}catch(U){return e(U)}}.bind(this),e)}catch(y){return e(y)}}.bind(this),e)}catch(A){return e(A)}}.bind(this),e)}catch(m){return e(m)}}.bind(this),e)}))}var qn=`
5
+ `+n.prev}function Ke(o,n){var E=gt(o),c=[];if(E){c.length=o.length;for(var e=0;e<o.length;e++)c[e]=_e(o,e)?n(o[e],o):"";}var t=typeof ut=="function"?ut(o):[],d;if(ke){d={};for(var l=0;l<t.length;l++)d["$"+t[l]]=t[l];}for(var v in o)_e(o,v)&&(E&&String(Number(v))===v&&v<o.length||ke&&d["$"+v]instanceof Symbol||(on.call(/[^\w$]/,v)?c.push(n(v,o)+": "+n(o[v],o)):c.push(v+": "+n(o[v],o))));if(typeof ut=="function")for(var S=0;S<t.length;S++)sn.call(o,t[S])&&c.push("["+n(t[S])+"]: "+n(o[t[S]],o));return c}});function Vn(o,n){return n.forEach((function(E){E&&typeof E!="string"&&!Array.isArray(E)&&Object.keys(E).forEach((function(c){if(c!=="default"&&!(c in o)){var e=Object.getOwnPropertyDescriptor(E,c);Object.defineProperty(o,c,e.get?e:{enumerable:true,get:function(){return E[c]}});}}));})),Object.freeze(o)}function kt(o,n){return new Promise((function(E,c){let e;return $n(o).then((function(t){try{return e=t,E(new Blob([n.slice(0,2),e,n.slice(2)],{type:"image/jpeg"}))}catch(d){return c(d)}}),c)}))}var $n=o=>new Promise(((n,E)=>{let c=new globalThis.FileReader;c.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),d=0;if(t.getUint16(d)!==65496)return E("not a valid JPEG");for(d+=2;;){let l=t.getUint16(d);if(l===65498)break;let v=t.getUint16(d+2);if(l===65505&&t.getUint32(d+4)===1165519206){let S=d+10,s;switch(t.getUint16(S)){case 18761:s=true;break;case 19789:s=false;break;default:return E("TIFF header contains invalid endian")}if(t.getUint16(S+2,s)!==42)return E("TIFF header contains invalid version");let a=t.getUint32(S+4,s),i=S+a+2+12*t.getUint16(S+a,s);for(let u=S+a+2;u<i;u+=12)if(t.getUint16(u,s)==274){if(t.getUint16(u+2,s)!==3)return E("Orientation data type is invalid");if(t.getUint32(u+4,s)!==1)return E("Orientation data count is invalid");t.setUint16(u+8,1,s);break}return n(e.slice(d,d+2+v))}d+=2+v;}return n(new Blob)})),c.readAsArrayBuffer(o);})),We={},Wn={get exports(){return We},set exports(o){We=o;}};(function(o){var n,E,c={};Wn.exports=c,c.parse=function(e,t){for(var d=c.bin.readUshort,l=c.bin.readUint,v=0,S={},s=new Uint8Array(e),a=s.length-4;l(s,a)!=101010256;)a--;v=a,v+=4;var i=d(s,v+=4);d(s,v+=2);var u=l(s,v+=2),_=l(s,v+=4);v+=4,v=_;for(var I=0;I<i;I++){l(s,v),v+=4,v+=4,v+=4,l(s,v+=4),u=l(s,v+=4);var O=l(s,v+=4),C=d(s,v+=4),N=d(s,v+2),F=d(s,v+4);v+=6;var k=l(s,v+=8);v+=4,v+=C+N+F,c._readLocal(s,k,S,u,O,t);}return S},c._readLocal=function(e,t,d,l,v,S){var s=c.bin.readUshort,a=c.bin.readUint;a(e,t),s(e,t+=4),s(e,t+=2);var i=s(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var u=s(e,t+=8),_=s(e,t+=2);t+=2;var I=c.bin.readUTF8(e,t,u);if(t+=u,t+=_,S)d[I]={size:v,csize:l};else {var O=new Uint8Array(e.buffer,t);if(i==0)d[I]=new Uint8Array(O.buffer.slice(t,t+l));else {if(i!=8)throw "unknown compression method: "+i;var C=new Uint8Array(v);c.inflateRaw(O,C),d[I]=C;}}},c.inflateRaw=function(e,t){return c.F.inflate(e,t)},c.inflate=function(e,t){return e[0],e[1],c.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},c.deflate=function(e,t){t==null&&(t={level:6});var d=0,l=new Uint8Array(50+Math.floor(1.1*e.length));l[d]=120,l[d+1]=156,d+=2,d=c.F.deflateRaw(e,l,d,t.level);var v=c.adler(e,0,e.length);return l[d+0]=v>>>24&255,l[d+1]=v>>>16&255,l[d+2]=v>>>8&255,l[d+3]=v>>>0&255,new Uint8Array(l.buffer,0,d+4)},c.deflateRaw=function(e,t){t==null&&(t={level:6});var d=new Uint8Array(50+Math.floor(1.1*e.length)),l=c.F.deflateRaw(e,d,l,t.level);return new Uint8Array(d.buffer,0,l)},c.encode=function(e,t){t==null&&(t=false);var d=0,l=c.bin.writeUint,v=c.bin.writeUshort,S={};for(var s in e){var a=!c._noNeed(s)&&!t,i=e[s],u=c.crc.crc(i,0,i.length);S[s]={cpr:a,usize:i.length,crc:u,file:a?c.deflateRaw(i):i};}for(var s in S)d+=S[s].file.length+30+46+2*c.bin.sizeUTF8(s);d+=22;var _=new Uint8Array(d),I=0,O=[];for(var s in S){var C=S[s];O.push(I),I=c._writeHeader(_,I,s,C,0);}var N=0,F=I;for(var s in S)C=S[s],O.push(I),I=c._writeHeader(_,I,s,C,1,O[N++]);var k=I-F;return l(_,I,101010256),I+=4,v(_,I+=4,N),v(_,I+=2,N),l(_,I+=2,k),l(_,I+=4,F),I+=4,I+=2,_.buffer},c._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},c._writeHeader=function(e,t,d,l,v,S){var s=c.bin.writeUint,a=c.bin.writeUshort,i=l.file;return s(e,t,v==0?67324752:33639248),t+=4,v==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,l.cpr?8:0),s(e,t+=2,0),s(e,t+=4,l.crc),s(e,t+=4,i.length),s(e,t+=4,l.usize),a(e,t+=4,c.bin.sizeUTF8(d)),a(e,t+=2,0),t+=2,v==1&&(t+=2,t+=2,s(e,t+=6,S),t+=4),t+=c.bin.writeUTF8(e,t,d),v==0&&(e.set(i,t),t+=i.length),t},c.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var d=t,l=0;l<8;l++)1&d?d=3988292384^d>>>1:d>>>=1;e[t]=d;}return e})(),update:function(e,t,d,l){for(var v=0;v<l;v++)e=c.crc.table[255&(e^t[d+v])]^e>>>8;return e},crc:function(e,t,d){return 4294967295^c.crc.update(4294967295,e,t,d)}},c.adler=function(e,t,d){for(var l=1,v=0,S=t,s=t+d;S<s;){for(var a=Math.min(S+5552,s);S<a;)v+=l+=e[S++];l%=65521,v%=65521;}return v<<16|l},c.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,d){e[t]=255&d,e[t+1]=d>>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,d){e[t]=255&d,e[t+1]=d>>8&255,e[t+2]=d>>16&255,e[t+3]=d>>24&255;},readASCII:function(e,t,d){for(var l="",v=0;v<d;v++)l+=String.fromCharCode(e[t+v]);return l},writeASCII:function(e,t,d){for(var l=0;l<d.length;l++)e[t+l]=d.charCodeAt(l);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,d){for(var l,v="",S=0;S<d;S++)v+="%"+c.bin.pad(e[t+S].toString(16));try{l=decodeURIComponent(v);}catch{return c.bin.readASCII(e,t,d)}return l},writeUTF8:function(e,t,d){for(var l=d.length,v=0,S=0;S<l;S++){var s=d.charCodeAt(S);if((4294967168&s)==0)e[t+v]=s,v++;else if((4294965248&s)==0)e[t+v]=192|s>>6,e[t+v+1]=128|s>>0&63,v+=2;else if((4294901760&s)==0)e[t+v]=224|s>>12,e[t+v+1]=128|s>>6&63,e[t+v+2]=128|s>>0&63,v+=3;else {if((4292870144&s)!=0)throw "e";e[t+v]=240|s>>18,e[t+v+1]=128|s>>12&63,e[t+v+2]=128|s>>6&63,e[t+v+3]=128|s>>0&63,v+=4;}}return v},sizeUTF8:function(e){for(var t=e.length,d=0,l=0;l<t;l++){var v=e.charCodeAt(l);if((4294967168&v)==0)d++;else if((4294965248&v)==0)d+=2;else if((4294901760&v)==0)d+=3;else {if((4292870144&v)!=0)throw "e";d+=4;}}return d}},c.F={},c.F.deflateRaw=function(e,t,d,l){var v=[[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]][l],S=c.F.U,s=c.F._goodIndex;c.F._hash;var a=c.F._putsE,i=0,u=d<<3,_=0,I=e.length;if(l==0){for(;i<I;)a(t,u,i+(r=Math.min(65535,I-i))==I?1:0),u=c.F._copyExact(e,i,r,t,u+8),i+=r;return u>>>3}var O=S.lits,C=S.strt,N=S.prev,F=0,k=0,R=0,g=0,M=0,p=0;for(I>2&&(C[p=c.F._hash(e,0)]=0),i=0;i<I;i++){if(M=p,i+1<I-2){p=c.F._hash(e,i+1);var f=i+1&32767;N[f]=C[p],C[p]=f;}if(_<=i){(F>14e3||k>26697)&&I-i>100&&(_<i&&(O[F]=i-_,F+=2,_=i),u=c.F._writeBlock(i==I-1||_==I?1:0,O,F,g,e,R,i-R,t,u),F=k=g=0,R=i);var b=0;i<I-2&&(b=c.F._bestMatch(e,i,N,M,Math.min(v[2],I-i),v[3]));var r=b>>>16,m=65535&b;if(b!=0){m=65535&b;var A=s(r=b>>>16,S.of0);S.lhst[257+A]++;var y=s(m,S.df0);S.dhst[y]++,g+=S.exb[A]+S.dxb[y],O[F]=r<<23|i-_,O[F+1]=m<<16|A<<8|y,F+=2,_=i+r;}else S.lhst[e[i]]++;k++;}}for(R==i&&e.length!=0||(_<i&&(O[F]=i-_,F+=2,_=i),u=c.F._writeBlock(1,O,F,g,e,R,i-R,t,u),F=0,k=0,F=k=g=0,R=i);(7&u)!=0;)u++;return u>>>3},c.F._bestMatch=function(e,t,d,l,v,S){var s=32767&t,a=d[s],i=s-a+32768&32767;if(a==s||l!=c.F._hash(e,t-i))return 0;for(var u=0,_=0,I=Math.min(32767,t);i<=I&&--S!=0&&a!=s;){if(u==0||e[t+u]==e[t+u-i]){var O=c.F._howLong(e,t,i);if(O>u){if(_=i,(u=O)>=v)break;i+2<O&&(O=i+2);for(var C=0,N=0;N<O-2;N++){var F=t-i+N+32768&32767,k=F-d[F]+32768&32767;k>C&&(C=k,a=F);}}}i+=(s=a)-(a=d[s])+32768&32767;}return u<<16|_},c.F._howLong=function(e,t,d){if(e[t]!=e[t-d]||e[t+1]!=e[t+1-d]||e[t+2]!=e[t+2-d])return 0;var l=t,v=Math.min(e.length,t+258);for(t+=3;t<v&&e[t]==e[t-d];)t++;return t-l},c.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},c.saved=0,c.F._writeBlock=function(e,t,d,l,v,S,s,a,i){var u,_,I,O,C,N,F,k,R,g=c.F.U,M=c.F._putsF,p=c.F._putsE;g.lhst[256]++,_=(u=c.F.getTrees())[0],I=u[1],O=u[2],C=u[3],N=u[4],F=u[5],k=u[6],R=u[7];var f=32+((i+3&7)==0?0:8-(i+3&7))+(s<<3),b=l+c.F.contSize(g.fltree,g.lhst)+c.F.contSize(g.fdtree,g.dhst),r=l+c.F.contSize(g.ltree,g.lhst)+c.F.contSize(g.dtree,g.dhst);r+=14+3*F+c.F.contSize(g.itree,g.ihst)+(2*g.ihst[16]+3*g.ihst[17]+7*g.ihst[18]);for(var m=0;m<286;m++)g.lhst[m]=0;for(m=0;m<30;m++)g.dhst[m]=0;for(m=0;m<19;m++)g.ihst[m]=0;var A=f<b&&f<r?0:b<r?1:2;if(M(a,i,e),M(a,i+1,A),i+=3,A==0){for(;(7&i)!=0;)i++;i=c.F._copyExact(v,S,s,a,i);}else {var y,T;if(A==1&&(y=g.fltree,T=g.fdtree),A==2){c.F.makeCodes(g.ltree,_),c.F.revCodes(g.ltree,_),c.F.makeCodes(g.dtree,I),c.F.revCodes(g.dtree,I),c.F.makeCodes(g.itree,O),c.F.revCodes(g.itree,O),y=g.ltree,T=g.dtree,p(a,i,C-257),p(a,i+=5,N-1),p(a,i+=5,F-4),i+=4;for(var w=0;w<F;w++)p(a,i+3*w,g.itree[1+(g.ordr[w]<<1)]);i+=3*F,i=c.F._codeTiny(k,g.itree,a,i),i=c.F._codeTiny(R,g.itree,a,i);}for(var h=S,U=0;U<d;U+=2){for(var P=t[U],x=P>>>23,H=h+(8388607&P);h<H;)i=c.F._writeLit(v[h++],y,a,i);if(x!=0){var L=t[U+1],V=L>>16,B=L>>8&255,D=255&L;p(a,i=c.F._writeLit(257+B,y,a,i),x-g.of0[B]),i+=g.exb[B],M(a,i=c.F._writeLit(D,T,a,i),V-g.df0[D]),i+=g.dxb[D],h+=x;}}i=c.F._writeLit(256,y,a,i);}return i},c.F._copyExact=function(e,t,d,l,v){var S=v>>>3;return l[S]=d,l[S+1]=d>>>8,l[S+2]=255-l[S],l[S+3]=255-l[S+1],S+=4,l.set(new Uint8Array(e.buffer,t,d),S),v+(d+4<<3)},c.F.getTrees=function(){for(var e=c.F.U,t=c.F._hufTree(e.lhst,e.ltree,15),d=c.F._hufTree(e.dhst,e.dtree,15),l=[],v=c.F._lenCodes(e.ltree,l),S=[],s=c.F._lenCodes(e.dtree,S),a=0;a<l.length;a+=2)e.ihst[l[a]]++;for(a=0;a<S.length;a+=2)e.ihst[S[a]]++;for(var i=c.F._hufTree(e.ihst,e.itree,7),u=19;u>4&&e.itree[1+(e.ordr[u-1]<<1)]==0;)u--;return [t,d,i,v,s,u,l,S]},c.F.getSecond=function(e){for(var t=[],d=0;d<e.length;d+=2)t.push(e[d+1]);return t},c.F.nonZero=function(e){for(var t="",d=0;d<e.length;d+=2)e[d+1]!=0&&(t+=(d>>1)+",");return t},c.F.contSize=function(e,t){for(var d=0,l=0;l<t.length;l++)d+=t[l]*e[1+(l<<1)];return d},c.F._codeTiny=function(e,t,d,l){for(var v=0;v<e.length;v+=2){var S=e[v],s=e[v+1];l=c.F._writeLit(S,t,d,l);var a=S==16?2:S==17?3:7;S>15&&(c.F._putsE(d,l,s,a),l+=a);}return l},c.F._lenCodes=function(e,t){for(var d=e.length;d!=2&&e[d-1]==0;)d-=2;for(var l=0;l<d;l+=2){var v=e[l+1],S=l+3<d?e[l+3]:-1,s=l+5<d?e[l+5]:-1,a=l==0?-1:e[l-1];if(v==0&&S==v&&s==v){for(var i=l+5;i+2<d&&e[i+2]==v;)i+=2;(u=Math.min(i+1-l>>>1,138))<11?t.push(17,u-3):t.push(18,u-11),l+=2*u-2;}else if(v==a&&S==v&&s==v){for(i=l+5;i+2<d&&e[i+2]==v;)i+=2;var u=Math.min(i+1-l>>>1,6);t.push(16,u-3),l+=2*u-2;}else t.push(v,0);}return d>>>1},c.F._hufTree=function(e,t,d){var l=[],v=e.length,S=t.length,s=0;for(s=0;s<S;s+=2)t[s]=0,t[s+1]=0;for(s=0;s<v;s++)e[s]!=0&&l.push({lit:s,f:e[s]});var a=l.length,i=l.slice(0);if(a==0)return 0;if(a==1){var u=l[0].lit;return i=u==0?1:0,t[1+(u<<1)]=1,t[1+(i<<1)]=1,1}l.sort((function(k,R){return k.f-R.f}));var _=l[0],I=l[1],O=0,C=1,N=2;for(l[0]={lit:-1,f:_.f+I.f,l:_,r:I,d:0};C!=a-1;)_=O!=C&&(N==a||l[O].f<l[N].f)?l[O++]:l[N++],I=O!=C&&(N==a||l[O].f<l[N].f)?l[O++]:l[N++],l[C++]={lit:-1,f:_.f+I.f,l:_,r:I};var F=c.F.setDepth(l[C-1],0);for(F>d&&(c.F.restrictDepth(i,d,F),F=d),s=0;s<a;s++)t[1+(i[s].lit<<1)]=i[s].d;return F},c.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(c.F.setDepth(e.l,t+1),c.F.setDepth(e.r,t+1))},c.F.restrictDepth=function(e,t,d){var l=0,v=1<<d-t,S=0;for(e.sort((function(a,i){return i.d==a.d?a.f-i.f:i.d-a.d})),l=0;l<e.length&&e[l].d>t;l++){var s=e[l].d;e[l].d=t,S+=v-(1<<d-s);}for(S>>>=d-t;S>0;)(s=e[l].d)<t?(e[l].d++,S-=1<<t-s-1):l++;for(;l>=0;l--)e[l].d==t&&S<0&&(e[l].d--,S++);S!=0&&console.log("debt left");},c.F._goodIndex=function(e,t){var d=0;return t[16|d]<=e&&(d|=16),t[8|d]<=e&&(d|=8),t[4|d]<=e&&(d|=4),t[2|d]<=e&&(d|=2),t[1|d]<=e&&(d|=1),d},c.F._writeLit=function(e,t,d,l){return c.F._putsF(d,l,t[e<<1]),l+t[1+(e<<1)]},c.F.inflate=function(e,t){var d=Uint8Array;if(e[0]==3&&e[1]==0)return t||new d(0);var l=c.F,v=l._bitsF,S=l._bitsE,s=l._decodeTiny,a=l.makeCodes,i=l.codes2map,u=l._get17,_=l.U,I=t==null;I&&(t=new d(e.length>>>2<<3));for(var O,C,N=0,F=0,k=0,R=0,g=0,M=0,p=0,f=0,b=0;N==0;)if(N=v(e,b,1),F=v(e,b+1,2),b+=3,F!=0){if(I&&(t=c.F._check(t,f+(1<<17))),F==1&&(O=_.flmap,C=_.fdmap,M=511,p=31),F==2){k=S(e,b,5)+257,R=S(e,b+5,5)+1,g=S(e,b+10,4)+4,b+=14;for(var r=0;r<38;r+=2)_.itree[r]=0,_.itree[r+1]=0;var m=1;for(r=0;r<g;r++){var A=S(e,b+3*r,3);_.itree[1+(_.ordr[r]<<1)]=A,A>m&&(m=A);}b+=3*g,a(_.itree,m),i(_.itree,m,_.imap),O=_.lmap,C=_.dmap,b=s(_.imap,(1<<m)-1,k+R,e,b,_.ttree);var y=l._copyOut(_.ttree,0,k,_.ltree);M=(1<<y)-1;var T=l._copyOut(_.ttree,k,R,_.dtree);p=(1<<T)-1,a(_.ltree,y),i(_.ltree,y,O),a(_.dtree,T),i(_.dtree,T,C);}for(;;){var w=O[u(e,b)&M];b+=15&w;var h=w>>>4;if(!(h>>>8))t[f++]=h;else {if(h==256)break;var U=f+h-254;if(h>264){var P=_.ldef[h-257];U=f+(P>>>3)+S(e,b,7&P),b+=7&P;}var x=C[u(e,b)&p];b+=15&x;var H=x>>>4,L=_.ddef[H],V=(L>>>4)+v(e,b,15&L);for(b+=15&L,I&&(t=c.F._check(t,f+(1<<17)));f<U;)t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V],t[f]=t[f++-V];f=U;}}}else {(7&b)!=0&&(b+=8-(7&b));var B=4+(b>>>3),D=e[B-4]|e[B-3]<<8;I&&(t=c.F._check(t,f+D)),t.set(new d(e.buffer,e.byteOffset+B,D),f),b=B+D<<3,f+=D;}return t.length==f?t:t.slice(0,f)},c.F._check=function(e,t){var d=e.length;if(t<=d)return e;var l=new Uint8Array(Math.max(d<<1,t));return l.set(e,0),l},c.F._decodeTiny=function(e,t,d,l,v,S){for(var s=c.F._bitsE,a=c.F._get17,i=0;i<d;){var u=e[a(l,v)&t];v+=15&u;var _=u>>>4;if(_<=15)S[i]=_,i++;else {var I=0,O=0;_==16?(O=3+s(l,v,2),v+=2,I=S[i-1]):_==17?(O=3+s(l,v,3),v+=3):_==18&&(O=11+s(l,v,7),v+=7);for(var C=i+O;i<C;)S[i]=I,i++;}}return v},c.F._copyOut=function(e,t,d,l){for(var v=0,S=0,s=l.length>>>1;S<d;){var a=e[S+t];l[S<<1]=0,l[1+(S<<1)]=a,a>v&&(v=a),S++;}for(;S<s;)l[S<<1]=0,l[1+(S<<1)]=0,S++;return v},c.F.makeCodes=function(e,t){for(var d,l,v,S,s=c.F.U,a=e.length,i=s.bl_count,u=0;u<=t;u++)i[u]=0;for(u=1;u<a;u+=2)i[e[u]]++;var _=s.next_code;for(d=0,i[0]=0,l=1;l<=t;l++)d=d+i[l-1]<<1,_[l]=d;for(v=0;v<a;v+=2)(S=e[v+1])!=0&&(e[v]=_[S],_[S]++);},c.F.codes2map=function(e,t,d){for(var l=e.length,v=c.F.U.rev15,S=0;S<l;S+=2)if(e[S+1]!=0)for(var s=S>>1,a=e[S+1],i=s<<4|a,u=t-a,_=e[S]<<u,I=_+(1<<u);_!=I;)d[v[_]>>>15-t]=i,_++;},c.F.revCodes=function(e,t){for(var d=c.F.U.rev15,l=15-t,v=0;v<e.length;v+=2){var S=e[v]<<t-e[v+1];e[v]=d[S]>>>l;}},c.F._putsE=function(e,t,d){d<<=7&t;var l=t>>>3;e[l]|=d,e[l+1]|=d>>>8;},c.F._putsF=function(e,t,d){d<<=7&t;var l=t>>>3;e[l]|=d,e[l+1]|=d>>>8,e[l+2]|=d>>>16;},c.F._bitsE=function(e,t,d){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<d)-1},c.F._bitsF=function(e,t,d){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<d)-1},c.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},c.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)},c.F.U=(n=Uint16Array,E=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 E(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 E(286),dhst:new E(30),ihst:new E(19),lits:new E(15e3),strt:new n(65536),prev:new n(32768)}),(function(){for(var e=c.F.U,t=0;t<32768;t++){var d=t;d=(4278255360&(d=(4042322160&(d=(3435973836&(d=(2863311530&d)>>>1|(1431655765&d)<<1))>>>2|(858993459&d)<<2))>>>4|(252645135&d)<<4))>>>8|(16711935&d)<<8,e.rev15[t]=(d>>>16|d<<16)>>>17;}function l(v,S,s){for(;S--!=0;)v.push(0,s);}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];l(e.fltree,144,8),l(e.fltree,112,9),l(e.fltree,24,7),l(e.fltree,8,8),c.F.makeCodes(e.fltree,9),c.F.codes2map(e.fltree,9,e.flmap),c.F.revCodes(e.fltree,9),l(e.fdtree,32,5),c.F.makeCodes(e.fdtree,5),c.F.codes2map(e.fdtree,5,e.fdmap),c.F.revCodes(e.fdtree,5),l(e.itree,19,0),l(e.ltree,286,0),l(e.dtree,30,0),l(e.ttree,320,0);})();})();var Qn=Vn({__proto__:null,default:We},[We]),he=(function(){var o={nextZero(s,a){for(;s[a]!=0;)a++;return a},readUshort:(s,a)=>s[a]<<8|s[a+1],writeUshort(s,a,i){s[a]=i>>8&255,s[a+1]=255&i;},readUint:(s,a)=>16777216*s[a]+(s[a+1]<<16|s[a+2]<<8|s[a+3]),writeUint(s,a,i){s[a]=i>>24&255,s[a+1]=i>>16&255,s[a+2]=i>>8&255,s[a+3]=255&i;},readASCII(s,a,i){let u="";for(let _=0;_<i;_++)u+=String.fromCharCode(s[a+_]);return u},writeASCII(s,a,i){for(let u=0;u<i.length;u++)s[a+u]=i.charCodeAt(u);},readBytes(s,a,i){let u=[];for(let _=0;_<i;_++)u.push(s[a+_]);return u},pad:s=>s.length<2?`0${s}`:s,readUTF8(s,a,i){let u,_="";for(let I=0;I<i;I++)_+=`%${o.pad(s[a+I].toString(16))}`;try{u=decodeURIComponent(_);}catch{return o.readASCII(s,a,i)}return u}};function n(s,a,i,u){let _=a*i,I=t(u),O=Math.ceil(a*I/8),C=new Uint8Array(4*_),N=new Uint32Array(C.buffer),{ctype:F}=u,{depth:k}=u,R=o.readUshort;if(F==6){let P=_<<2;if(k==8)for(var g=0;g<P;g+=4)C[g]=s[g],C[g+1]=s[g+1],C[g+2]=s[g+2],C[g+3]=s[g+3];if(k==16)for(g=0;g<P;g++)C[g]=s[g<<1];}else if(F==2){let P=u.tabs.tRNS;if(P==null){if(k==8)for(g=0;g<_;g++){var M=3*g;N[g]=255<<24|s[M+2]<<16|s[M+1]<<8|s[M];}if(k==16)for(g=0;g<_;g++)M=6*g,N[g]=255<<24|s[M+4]<<16|s[M+2]<<8|s[M];}else {var p=P[0];let x=P[1],H=P[2];if(k==8)for(g=0;g<_;g++){var f=g<<2;M=3*g,N[g]=255<<24|s[M+2]<<16|s[M+1]<<8|s[M],s[M]==p&&s[M+1]==x&&s[M+2]==H&&(C[f+3]=0);}if(k==16)for(g=0;g<_;g++)f=g<<2,M=6*g,N[g]=255<<24|s[M+4]<<16|s[M+2]<<8|s[M],R(s,M)==p&&R(s,M+2)==x&&R(s,M+4)==H&&(C[f+3]=0);}}else if(F==3){let P=u.tabs.PLTE,x=u.tabs.tRNS,H=x?x.length:0;if(k==1)for(var b=0;b<i;b++){var r=b*O,m=b*a;for(g=0;g<a;g++){f=m+g<<2;var A=3*(y=s[r+(g>>3)]>>7-((7&g)<<0)&1);C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;}}if(k==2)for(b=0;b<i;b++)for(r=b*O,m=b*a,g=0;g<a;g++)f=m+g<<2,A=3*(y=s[r+(g>>2)]>>6-((3&g)<<1)&3),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;if(k==4)for(b=0;b<i;b++)for(r=b*O,m=b*a,g=0;g<a;g++)f=m+g<<2,A=3*(y=s[r+(g>>1)]>>4-((1&g)<<2)&15),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;if(k==8)for(g=0;g<_;g++){var y;f=g<<2,A=3*(y=s[g]),C[f]=P[A],C[f+1]=P[A+1],C[f+2]=P[A+2],C[f+3]=y<H?x[y]:255;}}else if(F==4){if(k==8)for(g=0;g<_;g++){f=g<<2;var T=s[w=g<<1];C[f]=T,C[f+1]=T,C[f+2]=T,C[f+3]=s[w+1];}if(k==16)for(g=0;g<_;g++){var w;f=g<<2,T=s[w=g<<2],C[f]=T,C[f+1]=T,C[f+2]=T,C[f+3]=s[w+2];}}else if(F==0)for(p=u.tabs.tRNS?u.tabs.tRNS:-1,b=0;b<i;b++){let P=b*O,x=b*a;if(k==1)for(var h=0;h<a;h++){var U=(T=255*(s[P+(h>>>3)]>>>7-(7&h)&1))==255*p?0:255;N[x+h]=U<<24|T<<16|T<<8|T;}else if(k==2)for(h=0;h<a;h++)U=(T=85*(s[P+(h>>>2)]>>>6-((3&h)<<1)&3))==85*p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==4)for(h=0;h<a;h++)U=(T=17*(s[P+(h>>>1)]>>>4-((1&h)<<2)&15))==17*p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==8)for(h=0;h<a;h++)U=(T=s[P+h])==p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;else if(k==16)for(h=0;h<a;h++)T=s[P+(h<<1)],U=R(s,P+(h<<1))==p?0:255,N[x+h]=U<<24|T<<16|T<<8|T;}return C}function E(s,a,i,u){let _=t(s),I=Math.ceil(i*_/8),O=new Uint8Array((I+1+s.interlace)*u);return a=s.tabs.CgBI?e(a,O):c(a,O),s.interlace==0?a=d(a,s,0,i,u):s.interlace==1&&(a=(function(N,F){let k=F.width,R=F.height,g=t(F),M=g>>3,p=Math.ceil(k*g/8),f=new Uint8Array(R*p),b=0,r=[0,0,4,0,2,0,1],m=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],y=[8,8,4,4,2,2,1],T=0;for(;T<7;){let h=A[T],U=y[T],P=0,x=0,H=r[T];for(;H<R;)H+=h,x++;let L=m[T];for(;L<k;)L+=U,P++;let V=Math.ceil(P*g/8);d(N,F,b,P,x);let B=0,D=r[T];for(;D<R;){let $=m[T],K=b+B*V<<3;for(;$<k;){var w;if(g==1&&(w=(w=N[K>>3])>>7-(7&K)&1,f[D*p+($>>3)]|=w<<7-((7&$)<<0)),g==2&&(w=(w=N[K>>3])>>6-(7&K)&3,f[D*p+($>>2)]|=w<<6-((3&$)<<1)),g==4&&(w=(w=N[K>>3])>>4-(7&K)&15,f[D*p+($>>1)]|=w<<4-((1&$)<<2)),g>=8){let G=D*p+$*M;for(let Q=0;Q<M;Q++)f[G+Q]=N[(K>>3)+Q];}K+=g,$+=U;}B++,D+=h;}P*x!=0&&(b+=x*(1+V)),T+=1;}return f})(a,s)),a}function c(s,a){return e(new Uint8Array(s.buffer,2,s.length-6),a)}var e=(function(){let s={H:{}};return s.H.N=function(a,i){let u=Uint8Array,_,I,O=0,C=0,N=0,F=0,k=0,R=0,g=0,M=0,p=0;if(a[0]==3&&a[1]==0)return i||new u(0);let f=s.H,b=f.b,r=f.e,m=f.R,A=f.n,y=f.A,T=f.Z,w=f.m,h=i==null;for(h&&(i=new u(a.length>>>2<<5));O==0;)if(O=b(a,p,1),C=b(a,p+1,2),p+=3,C!=0){if(h&&(i=s.H.W(i,M+(1<<17))),C==1&&(_=w.J,I=w.h,R=511,g=31),C==2){N=r(a,p,5)+257,F=r(a,p+5,5)+1,k=r(a,p+10,4)+4,p+=14;let P=1;for(var U=0;U<38;U+=2)w.Q[U]=0,w.Q[U+1]=0;for(U=0;U<k;U++){let L=r(a,p+3*U,3);w.Q[1+(w.X[U]<<1)]=L,L>P&&(P=L);}p+=3*k,A(w.Q,P),y(w.Q,P,w.u),_=w.w,I=w.d,p=m(w.u,(1<<P)-1,N+F,a,p,w.v);let x=f.V(w.v,0,N,w.C);R=(1<<x)-1;let H=f.V(w.v,N,F,w.D);g=(1<<H)-1,A(w.C,x),y(w.C,x,_),A(w.D,H),y(w.D,H,I);}for(;;){let P=_[T(a,p)&R];p+=15&P;let x=P>>>4;if(!(x>>>8))i[M++]=x;else {if(x==256)break;{let H=M+x-254;if(x>264){let $=w.q[x-257];H=M+($>>>3)+r(a,p,7&$),p+=7&$;}let L=I[T(a,p)&g];p+=15&L;let V=L>>>4,B=w.c[V],D=(B>>>4)+b(a,p,15&B);for(p+=15&B;M<H;)i[M]=i[M++-D],i[M]=i[M++-D],i[M]=i[M++-D],i[M]=i[M++-D];M=H;}}}}else {(7&p)!=0&&(p+=8-(7&p));let P=4+(p>>>3),x=a[P-4]|a[P-3]<<8;h&&(i=s.H.W(i,M+x)),i.set(new u(a.buffer,a.byteOffset+P,x),M),p=P+x<<3,M+=x;}return i.length==M?i:i.slice(0,M)},s.H.W=function(a,i){let u=a.length;if(i<=u)return a;let _=new Uint8Array(u<<1);return _.set(a,0),_},s.H.R=function(a,i,u,_,I,O){let C=s.H.e,N=s.H.Z,F=0;for(;F<u;){let k=a[N(_,I)&i];I+=15&k;let R=k>>>4;if(R<=15)O[F]=R,F++;else {let g=0,M=0;R==16?(M=3+C(_,I,2),I+=2,g=O[F-1]):R==17?(M=3+C(_,I,3),I+=3):R==18&&(M=11+C(_,I,7),I+=7);let p=F+M;for(;F<p;)O[F]=g,F++;}}return I},s.H.V=function(a,i,u,_){let I=0,O=0,C=_.length>>>1;for(;O<u;){let N=a[O+i];_[O<<1]=0,_[1+(O<<1)]=N,N>I&&(I=N),O++;}for(;O<C;)_[O<<1]=0,_[1+(O<<1)]=0,O++;return I},s.H.n=function(a,i){let u=s.H.m,_=a.length,I,O,C,N,F=u.j;for(var k=0;k<=i;k++)F[k]=0;for(k=1;k<_;k+=2)F[a[k]]++;let R=u.K;for(I=0,F[0]=0,O=1;O<=i;O++)I=I+F[O-1]<<1,R[O]=I;for(C=0;C<_;C+=2)N=a[C+1],N!=0&&(a[C]=R[N],R[N]++);},s.H.A=function(a,i,u){let _=a.length,I=s.H.m.r;for(let O=0;O<_;O+=2)if(a[O+1]!=0){let C=O>>1,N=a[O+1],F=C<<4|N,k=i-N,R=a[O]<<k,g=R+(1<<k);for(;R!=g;)u[I[R]>>>15-i]=F,R++;}},s.H.l=function(a,i){let u=s.H.m.r,_=15-i;for(let I=0;I<a.length;I+=2){let O=a[I]<<i-a[I+1];a[I]=u[O]>>>_;}},s.H.M=function(a,i,u){u<<=7&i;let _=i>>>3;a[_]|=u,a[_+1]|=u>>>8;},s.H.I=function(a,i,u){u<<=7&i;let _=i>>>3;a[_]|=u,a[_+1]|=u>>>8,a[_+2]|=u>>>16;},s.H.e=function(a,i,u){return (a[i>>>3]|a[1+(i>>>3)]<<8)>>>(7&i)&(1<<u)-1},s.H.b=function(a,i,u){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16)>>>(7&i)&(1<<u)-1},s.H.Z=function(a,i){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16)>>>(7&i)},s.H.i=function(a,i){return (a[i>>>3]|a[1+(i>>>3)]<<8|a[2+(i>>>3)]<<16|a[3+(i>>>3)]<<24)>>>(7&i)},s.H.m=(function(){let a=Uint16Array,i=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 i(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 i(286),Y:new i(30),a:new i(19),t:new i(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=s.H.m;for(var i=0;i<32768;i++){let _=i;_=(2863311530&_)>>>1|(1431655765&_)<<1,_=(3435973836&_)>>>2|(858993459&_)<<2,_=(4042322160&_)>>>4|(252645135&_)<<4,_=(4278255360&_)>>>8|(16711935&_)<<8,a.r[i]=(_>>>16|_<<16)>>>17;}function u(_,I,O){for(;I--!=0;)_.push(0,O);}for(i=0;i<32;i++)a.q[i]=a.S[i]<<3|a.T[i],a.c[i]=a.p[i]<<4|a.z[i];u(a._,144,8),u(a._,112,9),u(a._,24,7),u(a._,8,8),s.H.n(a._,9),s.H.A(a._,9,a.J),s.H.l(a._,9),u(a.$,32,5),s.H.n(a.$,5),s.H.A(a.$,5,a.h),s.H.l(a.$,5),u(a.Q,19,0),u(a.C,286,0),u(a.D,30,0),u(a.v,320,0);})(),s.H.N})();function t(s){return [1,null,3,1,2,null,4][s.ctype]*s.depth}function d(s,a,i,u,_){let I=t(a),O=Math.ceil(u*I/8),C,N;I=Math.ceil(I/8);let F=s[i],k=0;if(F>1&&(s[i]=[0,0,1][F-2]),F==3)for(k=I;k<O;k++)s[k+1]=s[k+1]+(s[k+1-I]>>>1)&255;for(let R=0;R<_;R++)if(C=i+R*O,N=C+R+1,F=s[N-1],k=0,F==0)for(;k<O;k++)s[C+k]=s[N+k];else if(F==1){for(;k<I;k++)s[C+k]=s[N+k];for(;k<O;k++)s[C+k]=s[N+k]+s[C+k-I];}else if(F==2)for(;k<O;k++)s[C+k]=s[N+k]+s[C+k-O];else if(F==3){for(;k<I;k++)s[C+k]=s[N+k]+(s[C+k-O]>>>1);for(;k<O;k++)s[C+k]=s[N+k]+(s[C+k-O]+s[C+k-I]>>>1);}else {for(;k<I;k++)s[C+k]=s[N+k]+l(0,s[C+k-O],0);for(;k<O;k++)s[C+k]=s[N+k]+l(s[C+k-I],s[C+k-O],s[C+k-I-O]);}return s}function l(s,a,i){let u=s+a-i,_=u-s,I=u-a,O=u-i;return _*_<=I*I&&_*_<=O*O?s:I*I<=O*O?a:i}function v(s,a,i){i.width=o.readUint(s,a),a+=4,i.height=o.readUint(s,a),a+=4,i.depth=s[a],a++,i.ctype=s[a],a++,i.compress=s[a],a++,i.filter=s[a],a++,i.interlace=s[a],a++;}function S(s,a,i,u,_,I,O,C,N){let F=Math.min(a,_),k=Math.min(i,I),R=0,g=0;for(let T=0;T<k;T++)for(let w=0;w<F;w++)if(O>=0&&C>=0?(R=T*a+w<<2,g=(C+T)*_+O+w<<2):(R=(-C+T)*a-O+w<<2,g=T*_+w<<2),N==0)u[g]=s[R],u[g+1]=s[R+1],u[g+2]=s[R+2],u[g+3]=s[R+3];else if(N==1){var M=s[R+3]*.00392156862745098,p=s[R]*M,f=s[R+1]*M,b=s[R+2]*M,r=u[g+3]*(1/255),m=u[g]*r,A=u[g+1]*r,y=u[g+2]*r;let h=1-M,U=M+r*h,P=U==0?0:1/U;u[g+3]=255*U,u[g+0]=(p+m*h)*P,u[g+1]=(f+A*h)*P,u[g+2]=(b+y*h)*P;}else if(N==2)M=s[R+3],p=s[R],f=s[R+1],b=s[R+2],r=u[g+3],m=u[g],A=u[g+1],y=u[g+2],M==r&&p==m&&f==A&&b==y?(u[g]=0,u[g+1]=0,u[g+2]=0,u[g+3]=0):(u[g]=p,u[g+1]=f,u[g+2]=b,u[g+3]=M);else if(N==3){if(M=s[R+3],p=s[R],f=s[R+1],b=s[R+2],r=u[g+3],m=u[g],A=u[g+1],y=u[g+2],M==r&&p==m&&f==A&&b==y)continue;if(M<220&&r>20)return false}return true}return {decode:function(a){let i=new Uint8Array(a),u=8,_=o,I=_.readUshort,O=_.readUint,C={tabs:{},frames:[]},N=new Uint8Array(i.length),F,k=0,R=0,g=[137,80,78,71,13,10,26,10];for(var M=0;M<8;M++)if(i[M]!=g[M])throw "The input is not a PNG file!";for(;u<i.length;){let T=_.readUint(i,u);u+=4;let w=_.readASCII(i,u,4);if(u+=4,w=="IHDR")v(i,u,C);else if(w=="iCCP"){for(var p=u;i[p]!=0;)p++;_.readASCII(i,u,p-u),i[p+1];let h=i.slice(p+2,u+T),U=null;try{U=c(h);}catch{U=e(h);}C.tabs[w]=U;}else if(w=="CgBI")C.tabs[w]=i.slice(u,u+4);else if(w=="IDAT"){for(M=0;M<T;M++)N[k+M]=i[u+M];k+=T;}else if(w=="acTL")C.tabs[w]={num_frames:O(i,u),num_plays:O(i,u+4)},F=new Uint8Array(i.length);else if(w=="fcTL"){R!=0&&((y=C.frames[C.frames.length-1]).data=E(C,F.slice(0,R),y.rect.width,y.rect.height),R=0);let h={x:O(i,u+12),y:O(i,u+16),width:O(i,u+4),height:O(i,u+8)},U=I(i,u+22);U=I(i,u+20)/(U==0?100:U);let P={rect:h,delay:Math.round(1e3*U),dispose:i[u+24],blend:i[u+25]};C.frames.push(P);}else if(w=="fdAT"){for(M=0;M<T-4;M++)F[R+M]=i[u+M+4];R+=T-4;}else if(w=="pHYs")C.tabs[w]=[_.readUint(i,u),_.readUint(i,u+4),i[u+8]];else if(w=="cHRM")for(C.tabs[w]=[],M=0;M<8;M++)C.tabs[w].push(_.readUint(i,u+4*M));else if(w=="tEXt"||w=="zTXt"){C.tabs[w]==null&&(C.tabs[w]={});var f=_.nextZero(i,u),b=_.readASCII(i,u,f-u),r=u+T-f-1;if(w=="tEXt")A=_.readASCII(i,f+1,r);else {var m=c(i.slice(f+2,f+2+r));A=_.readUTF8(m,0,m.length);}C.tabs[w][b]=A;}else if(w=="iTXt"){C.tabs[w]==null&&(C.tabs[w]={}),f=0,p=u,f=_.nextZero(i,p),b=_.readASCII(i,p,f-p);let h=i[p=f+1];var A;i[p+1],p+=2,f=_.nextZero(i,p),_.readASCII(i,p,f-p),p=f+1,f=_.nextZero(i,p),_.readUTF8(i,p,f-p),r=T-((p=f+1)-u),h==0?A=_.readUTF8(i,p,r):(m=c(i.slice(p,p+r)),A=_.readUTF8(m,0,m.length)),C.tabs[w][b]=A;}else if(w=="PLTE")C.tabs[w]=_.readBytes(i,u,T);else if(w=="hIST"){let h=C.tabs.PLTE.length/3;for(C.tabs[w]=[],M=0;M<h;M++)C.tabs[w].push(I(i,u+2*M));}else if(w=="tRNS")C.ctype==3?C.tabs[w]=_.readBytes(i,u,T):C.ctype==0?C.tabs[w]=I(i,u):C.ctype==2&&(C.tabs[w]=[I(i,u),I(i,u+2),I(i,u+4)]);else if(w=="gAMA")C.tabs[w]=_.readUint(i,u)/1e5;else if(w=="sRGB")C.tabs[w]=i[u];else if(w=="bKGD")C.ctype==0||C.ctype==4?C.tabs[w]=[I(i,u)]:C.ctype==2||C.ctype==6?C.tabs[w]=[I(i,u),I(i,u+2),I(i,u+4)]:C.ctype==3&&(C.tabs[w]=i[u]);else if(w=="IEND")break;u+=T,_.readUint(i,u),u+=4;}var y;return R!=0&&((y=C.frames[C.frames.length-1]).data=E(C,F.slice(0,R),y.rect.width,y.rect.height)),C.data=E(C,N,C.width,C.height),delete C.compress,delete C.interlace,delete C.filter,C},toRGBA8:function(a){let i=a.width,u=a.height;if(a.tabs.acTL==null)return [n(a.data,i,u,a).buffer];let _=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let I=i*u*4,O=new Uint8Array(I),C=new Uint8Array(I),N=new Uint8Array(I);for(let k=0;k<a.frames.length;k++){let R=a.frames[k],g=R.rect.x,M=R.rect.y,p=R.rect.width,f=R.rect.height,b=n(R.data,p,f,a);if(k!=0)for(var F=0;F<I;F++)N[F]=O[F];if(R.blend==0?S(b,p,f,O,i,u,g,M,0):R.blend==1&&S(b,p,f,O,i,u,g,M,1),_.push(O.buffer.slice(0)),R.dispose!=0){if(R.dispose==1)S(C,p,f,O,i,u,g,M,0);else if(R.dispose==2)for(F=0;F<I;F++)O[F]=N[F];}}return _},_paeth:l,_copyTile:S,_bin:o}})();(function(){let{_copyTile:o}=he,{_bin:n}=he,E=he._paeth;var c={table:(function(){let p=new Uint32Array(256);for(let f=0;f<256;f++){let b=f;for(let r=0;r<8;r++)1&b?b=3988292384^b>>>1:b>>>=1;p[f]=b;}return p})(),update(p,f,b,r){for(let m=0;m<r;m++)p=c.table[255&(p^f[b+m])]^p>>>8;return p},crc:(p,f,b)=>4294967295^c.update(4294967295,p,f,b)};function e(p,f,b,r){f[b]+=p[0]*r>>4,f[b+1]+=p[1]*r>>4,f[b+2]+=p[2]*r>>4,f[b+3]+=p[3]*r>>4;}function t(p){return Math.max(0,Math.min(255,p))}function d(p,f){let b=p[0]-f[0],r=p[1]-f[1],m=p[2]-f[2],A=p[3]-f[3];return b*b+r*r+m*m+A*A}function l(p,f,b,r,m,A,y){y==null&&(y=1);let T=r.length,w=[];for(var h=0;h<T;h++){let D=r[h];w.push([D>>>0&255,D>>>8&255,D>>>16&255,D>>>24&255]);}for(h=0;h<T;h++){let D=4294967295;for(var U=0,P=0;P<T;P++){var x=d(w[h],w[P]);P!=h&&x<D&&(D=x,U=P);}}let H=new Uint32Array(m.buffer),L=new Int16Array(f*b*4),V=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<V.length;h++)V[h]=255*((V[h]+.5)/16-.5);for(let D=0;D<b;D++)for(let $=0;$<f;$++){var B;h=4*(D*f+$),y!=2?B=[t(p[h]+L[h]),t(p[h+1]+L[h+1]),t(p[h+2]+L[h+2]),t(p[h+3]+L[h+3])]:(x=V[4*(3&D)+(3&$)],B=[t(p[h]+x),t(p[h+1]+x),t(p[h+2]+x),t(p[h+3]+x)]),U=0;let K=16777215;for(P=0;P<T;P++){let q=d(B,w[P]);q<K&&(K=q,U=P);}let G=w[U],Q=[B[0]-G[0],B[1]-G[1],B[2]-G[2],B[3]-G[3]];y==1&&($!=f-1&&e(Q,L,h+4,7),D!=b-1&&($!=0&&e(Q,L,h+4*f-4,3),e(Q,L,h+4*f,5),$!=f-1&&e(Q,L,h+4*f+4,1))),A[h>>2]=U,H[h>>2]=r[U];}}function v(p,f,b,r,m){m==null&&(m={});let{crc:A}=c,y=n.writeUint,T=n.writeUshort,w=n.writeASCII,h=8,U=p.frames.length>1,P,x=false,H=33+(U?20:0);if(m.sRGB!=null&&(H+=13),m.pHYs!=null&&(H+=21),m.iCCP!=null&&(P=pako.deflate(m.iCCP),H+=21+P.length+4),p.ctype==3){for(var L=p.plte.length,V=0;V<L;V++)p.plte[V]>>>24!=255&&(x=true);H+=8+3*L+4+(x?8+1*L+4:0);}for(var B=0;B<p.frames.length;B++)U&&(H+=38),H+=(G=p.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let D=new Uint8Array(H),$=[137,80,78,71,13,10,26,10];for(V=0;V<8;V++)D[V]=$[V];if(y(D,h,13),h+=4,w(D,h,"IHDR"),h+=4,y(D,h,f),h+=4,y(D,h,b),h+=4,D[h]=p.depth,h++,D[h]=p.ctype,h++,D[h]=0,h++,D[h]=0,h++,D[h]=0,h++,y(D,h,A(D,h-17,17)),h+=4,m.sRGB!=null&&(y(D,h,1),h+=4,w(D,h,"sRGB"),h+=4,D[h]=m.sRGB,h++,y(D,h,A(D,h-5,5)),h+=4),m.iCCP!=null){let Q=13+P.length;y(D,h,Q),h+=4,w(D,h,"iCCP"),h+=4,w(D,h,"ICC profile"),h+=11,h+=2,D.set(P,h),h+=P.length,y(D,h,A(D,h-(Q+4),Q+4)),h+=4;}if(m.pHYs!=null&&(y(D,h,9),h+=4,w(D,h,"pHYs"),h+=4,y(D,h,m.pHYs[0]),h+=4,y(D,h,m.pHYs[1]),h+=4,D[h]=m.pHYs[2],h++,y(D,h,A(D,h-13,13)),h+=4),U&&(y(D,h,8),h+=4,w(D,h,"acTL"),h+=4,y(D,h,p.frames.length),h+=4,y(D,h,m.loop!=null?m.loop:0),h+=4,y(D,h,A(D,h-12,12)),h+=4),p.ctype==3){for(y(D,h,3*(L=p.plte.length)),h+=4,w(D,h,"PLTE"),h+=4,V=0;V<L;V++){let Q=3*V,q=p.plte[V],z=255&q,W=q>>>8&255,ie=q>>>16&255;D[h+Q+0]=z,D[h+Q+1]=W,D[h+Q+2]=ie;}if(h+=3*L,y(D,h,A(D,h-3*L-4,3*L+4)),h+=4,x){for(y(D,h,L),h+=4,w(D,h,"tRNS"),h+=4,V=0;V<L;V++)D[h+V]=p.plte[V]>>>24&255;h+=L,y(D,h,A(D,h-L-4,L+4)),h+=4;}}let K=0;for(B=0;B<p.frames.length;B++){var G=p.frames[B];U&&(y(D,h,26),h+=4,w(D,h,"fcTL"),h+=4,y(D,h,K++),h+=4,y(D,h,G.rect.width),h+=4,y(D,h,G.rect.height),h+=4,y(D,h,G.rect.x),h+=4,y(D,h,G.rect.y),h+=4,T(D,h,r[B]),h+=2,T(D,h,1e3),h+=2,D[h]=G.dispose,h++,D[h]=G.blend,h++,y(D,h,A(D,h-30,30)),h+=4);let Q=G.cimg;y(D,h,(L=Q.length)+(B==0?0:4)),h+=4;let q=h;w(D,h,B==0?"IDAT":"fdAT"),h+=4,B!=0&&(y(D,h,K++),h+=4),D.set(Q,h),h+=L,y(D,h,A(D,q,h-q)),h+=4;}return y(D,h,0),h+=4,w(D,h,"IEND"),h+=4,y(D,h,A(D,h-4,4)),h+=4,D.buffer}function S(p,f,b){for(let r=0;r<p.frames.length;r++){let m=p.frames[r];m.rect.width;let A=m.rect.height,y=new Uint8Array(A*m.bpl+A);m.cimg=u(m.img,A,m.bpp,m.bpl,y,f,b);}}function s(p,f,b,r,m){let A=m[0],y=m[1],T=m[2],w=m[3],h=m[4],U=m[5],P=6,x=8,H=255;for(var L=0;L<p.length;L++){let te=new Uint8Array(p[L]);for(var V=te.length,B=0;B<V;B+=4)H&=te[B+3];}let D=H!=255,$=(function(J,X,ne,oe,j,ue){let ee=[];for(var Y=0;Y<J.length;Y++){let le=new Uint8Array(J[Y]),pe=new Uint32Array(le.buffer);var ce;let de=0,ve=0,me=X,Ce=ne,et=oe?1:0;if(Y!=0){let kn=ue||oe||Y==1||ee[Y-2].dispose!=0?1:2,tt=0,Rt=1e9;for(let Le=0;Le<kn;Le++){var ge=new Uint8Array(J[Y-1-Le]);let Un=new Uint32Array(J[Y-1-Le]),Ae=X,be=ne,Oe=-1,De=-1;for(let Ie=0;Ie<ne;Ie++)for(let Re=0;Re<X;Re++)pe[ae=Ie*X+Re]!=Un[ae]&&(Re<Ae&&(Ae=Re),Re>Oe&&(Oe=Re),Ie<be&&(be=Ie),Ie>De&&(De=Ie));Oe==-1&&(Ae=be=Oe=De=0),j&&((1&Ae)==1&&Ae--,(1&be)==1&&be--);let Mt=(Oe-Ae+1)*(De-be+1);Mt<Rt&&(Rt=Mt,tt=Le,de=Ae,ve=be,me=Oe-Ae+1,Ce=De-be+1);}ge=new Uint8Array(J[Y-1-tt]),tt==1&&(ee[Y-1].dispose=2),ce=new Uint8Array(me*Ce*4),o(ge,X,ne,ce,me,Ce,-de,-ve,0),et=o(le,X,ne,ce,me,Ce,-de,-ve,3)?1:0,et==1?i(le,X,ne,ce,{x:de,y:ve,width:me,height:Ce}):o(le,X,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:et,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(J,X,ne,ee,Y-1,me,j),a(J,X,ne,ee,Y,me,j);}let Ve=0;if(J.length!=1)for(var ae=0;ae<ee.length;ae++){var Te;Ve+=(Te=ee[ae]).rect.width*Te.rect.height;}return ee})(p,f,b,A,y,T),K={},G=[],Q=[];if(r!=0){let te=[];for(B=0;B<$.length;B++)te.push($[B].img.buffer);let J=(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]),Ve=ge.length;for(let ae=0;ae<Ve;ae+=4){let Te=ge[ae],le=ge[ae+1],pe=ge[ae+2],de=ge[ae+3];de==0&&(Te=le=pe=0),Y[ce+ae]=Te,Y[ce+ae+1]=le,Y[ce+ae+2]=pe,Y[ce+ae+3]=de;}ce+=Ve;}return Y.buffer})(te),X=I(J,r);for(B=0;B<X.plte.length;B++)G.push(X.plte[B].est.rgba);let ne=0;for(B=0;B<$.length;B++){let oe=(z=$[B]).img.length;var q=new Uint8Array(X.inds.buffer,ne>>2,oe>>2);Q.push(q);let j=new Uint8Array(X.abuf,ne,oe);U&&l(z.img,z.rect.width,z.rect.height,G,j,q),z.img.set(j),ne+=oe;}}else for(L=0;L<$.length;L++){var z=$[L];let te=new Uint32Array(z.img.buffer);var W=z.rect.width;for(V=te.length,q=new Uint8Array(V),Q.push(q),B=0;B<V;B++){let J=te[B];if(B!=0&&J==te[B-1])q[B]=q[B-1];else if(B>W&&J==te[B-W])q[B]=q[B-W];else {let X=K[J];if(X==null&&(K[J]=X=G.length,G.push(J),G.length>=300))break;q[B]=X;}}}let ie=G.length;for(ie<=256&&h==0&&(x=ie<=2?1:ie<=4?2:ie<=16?4:8,x=Math.max(x,w)),L=0;L<$.length;L++){(z=$[L]).rect.x,z.rect.y,W=z.rect.width;let te=z.rect.height,J=z.img;new Uint32Array(J.buffer);let X=4*W,ne=4;if(ie<=256&&h==0){X=Math.ceil(x*W/8);var se=new Uint8Array(X*te);let oe=Q[L];for(let j=0;j<te;j++){B=j*X;let ue=j*W;if(x==8)for(var Z=0;Z<W;Z++)se[B+Z]=oe[ue+Z];else if(x==4)for(Z=0;Z<W;Z++)se[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(x==2)for(Z=0;Z<W;Z++)se[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(x==1)for(Z=0;Z<W;Z++)se[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}J=se,P=3,ne=1;}else if(D==0&&$.length==1){se=new Uint8Array(W*te*3);let oe=W*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;se[j]=J[ue],se[j+1]=J[ue+1],se[j+2]=J[ue+2];}J=se,P=2,ne=3,X=3*W;}z.img=J,z.bpl=X,z.bpp=ne;}return {ctype:P,depth:x,plte:G,frames:$}}function a(p,f,b,r,m,A,y){let T=Uint8Array,w=Uint32Array,h=new T(p[m-1]),U=new w(p[m-1]),P=m+1<p.length?new T(p[m+1]):null,x=new T(p[m]),H=new w(x.buffer),L=f,V=b,B=-1,D=-1;for(let K=0;K<A.height;K++)for(let G=0;G<A.width;G++){let Q=A.x+G,q=A.y+K,z=q*f+Q,W=H[z];W==0||r[m-1].dispose==0&&U[z]==W&&(P==null||P[4*z+3]!=0)||(Q<L&&(L=Q),Q>B&&(B=Q),q<V&&(V=q),q>D&&(D=q));}B==-1&&(L=V=B=D=0),y&&((1&L)==1&&L--,(1&V)==1&&V--),A={x:L,y:V,width:B-L+1,height:D-V+1};let $=r[m];$.rect=A,$.blend=1,$.img=new Uint8Array(A.width*A.height*4),r[m-1].dispose==0?(o(h,f,b,$.img,A.width,A.height,-A.x,-A.y,0),i(x,f,b,$.img,A)):o(x,f,b,$.img,A.width,A.height,-A.x,-A.y,0);}function i(p,f,b,r,m){o(p,f,b,r,m.width,m.height,-m.x,-m.y,2);}function u(p,f,b,r,m,A,y){let T=[],w,h=[0,1,2,3,4];A!=-1?h=[A]:(f*r>5e5||b==1)&&(h=[0]),y&&(w={level:0});let U=Qn;for(var P=0;P<h.length;P++){for(let L=0;L<f;L++)_(m,p,L,r,b,h[P]);T.push(U.deflate(m,w));}let x,H=1e9;for(P=0;P<T.length;P++)T[P].length<H&&(x=P,H=T[P].length);return T[x]}function _(p,f,b,r,m,A){let y=b*r,T=y+b;if(p[T]=A,T++,A==0)if(r<500)for(var w=0;w<r;w++)p[T+w]=f[y+w];else p.set(new Uint8Array(f.buffer,y,r),T);else if(A==1){for(w=0;w<m;w++)p[T+w]=f[y+w];for(w=m;w<r;w++)p[T+w]=f[y+w]-f[y+w-m]+256&255;}else if(b==0){for(w=0;w<m;w++)p[T+w]=f[y+w];if(A==2)for(w=m;w<r;w++)p[T+w]=f[y+w];if(A==3)for(w=m;w<r;w++)p[T+w]=f[y+w]-(f[y+w-m]>>1)+256&255;if(A==4)for(w=m;w<r;w++)p[T+w]=f[y+w]-E(f[y+w-m],0,0)+256&255;}else {if(A==2)for(w=0;w<r;w++)p[T+w]=f[y+w]+256-f[y+w-r]&255;if(A==3){for(w=0;w<m;w++)p[T+w]=f[y+w]+256-(f[y+w-r]>>1)&255;for(w=m;w<r;w++)p[T+w]=f[y+w]+256-(f[y+w-r]+f[y+w-m]>>1)&255;}if(A==4){for(w=0;w<m;w++)p[T+w]=f[y+w]+256-E(0,f[y+w-r],0)&255;for(w=m;w<r;w++)p[T+w]=f[y+w]+256-E(f[y+w-m],f[y+w-r],f[y+w-m-r])&255;}}}function I(p,f){let b=new Uint8Array(p),r=b.slice(0),m=new Uint32Array(r.buffer),A=O(r,f),y=A[0],T=A[1],w=b.length,h=new Uint8Array(w>>2),U;if(b.length<2e7)for(var P=0;P<w;P+=4)U=C(y,x=b[P]*(1/255),H=b[P+1]*(1/255),L=b[P+2]*(1/255),V=b[P+3]*(1/255)),h[P>>2]=U.ind,m[P>>2]=U.est.rgba;else for(P=0;P<w;P+=4){var x=b[P]*.00392156862745098,H=b[P+1]*(1/255),L=b[P+2]*(1/255),V=b[P+3]*(1/255);for(U=y;U.left;)U=N(U.est,x,H,L,V)<=0?U.left:U.right;h[P>>2]=U.ind,m[P>>2]=U.est.rgba;}return {abuf:r.buffer,inds:h,plte:T}}function O(p,f,b){b==null&&(b=1e-4);let r=new Uint32Array(p.buffer),m={i0:0,i1:p.length,bst:null,est:null,tdst:0,left:null,right:null};m.bst=R(p,m.i0,m.i1),m.est=g(m.bst);let A=[m];for(;A.length<f;){let T=0,w=0;for(var y=0;y<A.length;y++)A[y].est.L>T&&(T=A[y].est.L,w=y);if(T<b)break;let h=A[w],U=F(p,r,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=U||h.i1<=U){h.est.L=0;continue}let P={i0:h.i0,i1:U,bst:null,est:null,tdst:0,left:null,right:null};P.bst=R(p,P.i0,P.i1),P.est=g(P.bst);let x={i0:U,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:h.bst.N-P.bst.N},y=0;y<16;y++)x.bst.R[y]=h.bst.R[y]-P.bst.R[y];for(y=0;y<4;y++)x.bst.m[y]=h.bst.m[y]-P.bst.m[y];x.est=g(x.bst),h.left=P,h.right=x,A[w]=P,A.push(x);}for(A.sort(((T,w)=>w.bst.N-T.bst.N)),y=0;y<A.length;y++)A[y].ind=y;return [m,A]}function C(p,f,b,r,m){if(p.left==null)return p.tdst=(function(P,x,H,L,V){let B=x-P[0],D=H-P[1],$=L-P[2],K=V-P[3];return B*B+D*D+$*$+K*K})(p.est.q,f,b,r,m),p;let A=N(p.est,f,b,r,m),y=p.left,T=p.right;A>0&&(y=p.right,T=p.left);let w=C(y,f,b,r,m);if(w.tdst<=A*A)return w;let h=C(T,f,b,r,m);return h.tdst<w.tdst?h:w}function N(p,f,b,r,m){let{e:A}=p;return A[0]*f+A[1]*b+A[2]*r+A[3]*m-p.eMq}function F(p,f,b,r,m,A){for(r-=4;b<r;){for(;k(p,b,m)<=A;)b+=4;for(;k(p,r,m)>A;)r-=4;if(b>=r)break;let y=f[b>>2];f[b>>2]=f[r>>2],f[r>>2]=y,b+=4,r-=4;}for(;k(p,b,m)>A;)b-=4;return b+4}function k(p,f,b){return p[f]*b[0]+p[f+1]*b[1]+p[f+2]*b[2]+p[f+3]*b[3]}function R(p,f,b){let r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m=[0,0,0,0],A=b-f>>2;for(let y=f;y<b;y+=4){let T=p[y]*.00392156862745098,w=p[y+1]*(1/255),h=p[y+2]*(1/255),U=p[y+3]*(1/255);m[0]+=T,m[1]+=w,m[2]+=h,m[3]+=U,r[0]+=T*T,r[1]+=T*w,r[2]+=T*h,r[3]+=T*U,r[5]+=w*w,r[6]+=w*h,r[7]+=w*U,r[10]+=h*h,r[11]+=h*U,r[15]+=U*U;}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m,N:A}}function g(p){let{R:f}=p,{m:b}=p,{N:r}=p,m=b[0],A=b[1],y=b[2],T=b[3],w=r==0?0:1/r,h=[f[0]-m*m*w,f[1]-m*A*w,f[2]-m*y*w,f[3]-m*T*w,f[4]-A*m*w,f[5]-A*A*w,f[6]-A*y*w,f[7]-A*T*w,f[8]-y*m*w,f[9]-y*A*w,f[10]-y*y*w,f[11]-y*T*w,f[12]-T*m*w,f[13]-T*A*w,f[14]-T*y*w,f[15]-T*T*w],U=h,P=M,x=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,L=0;if(r!=0)for(let B=0;B<16&&(x=P.multVec(U,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=[m*w,A*w,y*w,T*w];return {Cov:h,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 M={multVec:(p,f)=>[p[0]*f[0]+p[1]*f[1]+p[2]*f[2]+p[3]*f[3],p[4]*f[0]+p[5]*f[1]+p[6]*f[2]+p[7]*f[3],p[8]*f[0]+p[9]*f[1]+p[10]*f[2]+p[11]*f[3],p[12]*f[0]+p[13]*f[1]+p[14]*f[2]+p[15]*f[3]],dot:(p,f)=>p[0]*f[0]+p[1]*f[1]+p[2]*f[2]+p[3]*f[3],sml:(p,f)=>[p*f[0],p*f[1],p*f[2],p*f[3]]};he.encode=function(f,b,r,m,A,y,T){m==null&&(m=0),T==null&&(T=false);let w=s(f,b,r,m,[false,false,false,0,T,false]);return S(w,-1),v(w,b,r,A,y)},he.encodeLL=function(f,b,r,m,A,y,T,w){let h={ctype:0+(m==1?0:2)+(A==0?0:4),depth:y,frames:[]},U=(m+A)*y,P=U*b;for(let x=0;x<f.length;x++)h.frames.push({rect:{x:0,y:0,width:b,height:r},img:new Uint8Array(f[x]),blend:0,dispose:1,bpp:Math.ceil(U/8),bpl:Math.ceil(P/8)});return S(h,0,true),v(h,b,r,T,w)},he.encode.compress=s,he.encode.dither=l,he.quantize=I,he.quantize.getKDtree=O,he.quantize.getNearest=C;})();var Ut={toArrayBuffer(o,n){let E=o.width,c=o.height,e=E<<2,t=o.getContext("2d").getImageData(0,0,E,c),d=new Uint32Array(t.data.buffer),l=(32*E+31)/32<<2,v=l*c,S=122+v,s=new ArrayBuffer(S),a=new DataView(s),i=1<<20,u,_,I,O,C=i,N=0,F=0,k=0;function R(p){a.setUint16(F,p,true),F+=2;}function g(p){a.setUint32(F,p,true),F+=4;}function M(p){F+=p;}R(19778),g(S),M(4),g(122),g(108),g(E),g(-c>>>0),R(1),R(32),g(3),g(v),g(2835),g(2835),M(8),g(16711680),g(65280),g(255),g(4278190080),g(1466527264),(function p(){for(;N<c&&C>0;){for(O=122+N*l,u=0;u<e;)C--,_=d[k++],I=_>>>24,a.setUint32(O+u,_<<8|I),u+=4;N++;}k<d.length?(C=i,setTimeout(p,Ut._dly)):n(s);})();},toBlob(o,n){this.toArrayBuffer(o,(E=>{n(new Blob([E],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},zn={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},ot=typeof globalThis.window<"u",Lt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Qe=ot&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),Gn=(ot||Lt)&&(Qe&&Qe.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Dt=(ot||Lt)&&(Qe&&Qe.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function it(o,n,E=Date.now()){return new Promise((c=>{let e=o.split(","),t=e[0].match(/:(.*?);/)[1],d=globalThis.atob(e[1]),l=d.length,v=new Uint8Array(l);for(;l--;)v[l]=d.charCodeAt(l);let S=new Blob([v],{type:t});S.name=n,S.lastModified=E,c(S);}))}function Ft(o){return new Promise(((n,E)=>{let c=new Dt;c.onload=()=>n(c.result),c.onerror=e=>E(e),c.readAsDataURL(o);}))}function Nt(o){return new Promise(((n,E)=>{let c=new globalThis.Image;c.onload=()=>n(c),c.onerror=e=>E(e),c.src=o;}))}function Me(){if(Me.cachedResult!==void 0)return Me.cachedResult;let o=fe.ETC,{userAgent:n}=navigator;return /Chrom(e|ium)/i.test(n)?o=fe.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?o=fe.IOS:/Safari/i.test(n)?o=fe.DESKTOP_SAFARI:/Firefox/i.test(n)?o=fe.FIREFOX:(/MSIE/i.test(n)||globalThis.document.documentMode)&&(o=fe.IE),Me.cachedResult=o,Me.cachedResult}function Bt(o,n){let E=Me(),c=zn[E],e=o,t=n,d=e*t,l=e>t?t/e:e/t;for(;d>c*c;){let v=(c+e)/2,S=(c+t)/2;v<S?(t=S,e=S*l):(t=v*l,e=v),d=e*t;}return {width:e,height:t}}function qe(o,n){let E,c;try{if(E=new OffscreenCanvas(o,n),c=E.getContext("2d"),c===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{E=globalThis.document.createElement("canvas"),c=E.getContext("2d");}return E.width=o,E.height=n,[E,c]}function Ht(o,n){let{width:E,height:c}=Bt(o.width,o.height),[e,t]=qe(E,c);return n&&/jpe?g/.test(n)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(o,0,0,e.width,e.height),e}function $e(){return $e.cachedResult!==void 0||($e.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),$e.cachedResult}function ze(o,n={}){return new Promise((function(E,c){let e,t;var d=function(){try{return t=Ht(e,n.fileType||o.type),E([e,t])}catch(v){return c(v)}},l=function(v){try{var S=function(s){try{throw s}catch(a){return c(a)}};try{let s;return Ft(o).then((function(a){try{return s=a,Nt(s).then((function(i){try{return e=i,(function(){try{return d()}catch(u){return c(u)}})()}catch(u){return S(u)}}),S)}catch(i){return S(i)}}),S)}catch(s){S(s);}}catch(s){return c(s)}};try{if($e()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(Me()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(o).then((function(v){try{return e=v,d()}catch{return l()}}),l)}catch{l();}}))}function Ge(o,n,E,c,e=1){return new Promise((function(t,d){let l;if(n==="image/png"){let a,i,u;return a=o.getContext("2d"),{data:i}=a.getImageData(0,0,o.width,o.height),u=he.encode([i.buffer],o.width,o.height,4096*e),l=new Blob([u],{type:n}),l.name=E,l.lastModified=c,v.call(this)}{let a=function(){return v.call(this)};if(n==="image/bmp")return new Promise((i=>Ut.toBlob(o,i))).then(function(i){try{return l=i,l.name=E,l.lastModified=c,a.call(this)}catch(u){return d(u)}}.bind(this),d);{let i=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&o instanceof OffscreenCanvas)return o.convertToBlob({type:n,quality:e}).then(function(u){try{return l=u,l.name=E,l.lastModified=c,i.call(this)}catch(_){return d(_)}}.bind(this),d);{let u;return u=o.toDataURL(n,e),it(u,E,c).then(function(_){try{return l=_,i.call(this)}catch(I){return d(I)}}.bind(this),d)}}}function v(){return t(l)}}))}function we(o){o.width=0,o.height=0;}function xe(){return new Promise((function(o,n){let c,e,t,d;return xe.cachedResult!==void 0?o(xe.cachedResult):(it("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(l){try{return c=l,ze(c).then((function(v){try{return e=v[1],Ge(e,c.type,c.name,c.lastModified).then((function(S){try{return t=S,we(e),ze(t).then((function(s){try{return d=s[0],xe.cachedResult=d.width===1&&d.height===2,o(xe.cachedResult)}catch(a){return n(a)}}),n)}catch(s){return n(s)}}),n)}catch(S){return n(S)}}),n)}catch(v){return n(v)}}),n))}))}function Vt(o){return new Promise(((n,E)=>{let c=new Dt;c.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return n(-2);let d=t.byteLength,l=2;for(;l<d;){if(t.getUint16(l+2,false)<=8)return n(-1);let v=t.getUint16(l,false);if(l+=2,v==65505){if(t.getUint32(l+=2,false)!=1165519206)return n(-1);let S=t.getUint16(l+=6,false)==18761;l+=t.getUint32(l+4,S);let s=t.getUint16(l,S);l+=2;for(let a=0;a<s;a++)if(t.getUint16(l+12*a,S)==274)return n(t.getUint16(l+12*a+8,S))}else {if((65280&v)!=65280)break;l+=t.getUint16(l,false);}}return n(-1)},c.onerror=e=>E(e),c.readAsArrayBuffer(o);}))}function $t(o,n){let{width:E}=o,{height:c}=o,{maxWidthOrHeight:e}=n,t,d=o;return isFinite(e)&&(E>e||c>e)&&([d,t]=qe(E,c),E>c?(d.width=e,d.height=c/E*e):(d.width=E/c*e,d.height=e),t.drawImage(o,0,0,d.width,d.height),we(o)),d}function Wt(o,n){let{width:E}=o,{height:c}=o,[e,t]=qe(E,c);switch(n>4&&n<9?(e.width=c,e.height=E):(e.width=E,e.height=c),n){case 2:t.transform(-1,0,0,1,E,0);break;case 3:t.transform(-1,0,0,-1,E,c);break;case 4:t.transform(1,0,0,-1,0,c);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,c,0);break;case 7:t.transform(0,-1,-1,0,c,E);break;case 8:t.transform(0,-1,1,0,0,E);}return t.drawImage(o,0,0,E,c),we(o),e}function xt(o,n,E=0){return new Promise((function(c,e){let t,d,l,v,S,s,a,i,u,_,I,O,C,N,F,k,R,g,M,p;function f(r=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;t+=r,n.onProgress(Math.min(t,100));}function b(r){if(n.signal&&n.signal.aborted)throw n.signal.reason;t=Math.min(Math.max(r,t),100),n.onProgress(t);}return t=E,d=n.maxIteration||10,l=1024*n.maxSizeMB*1024,f(),ze(o,n).then(function(r){try{return [,v]=r,f(),S=$t(v,n),f(),new Promise((function(m,A){var y;if(!(y=n.exifOrientation))return Vt(o).then(function(w){try{return y=w,T.call(this)}catch(h){return A(h)}}.bind(this),A);function T(){return m(y)}return T.call(this)})).then(function(m){try{return s=m,f(),xe().then(function(A){try{return a=A?S:Wt(S,s),f(),i=n.initialQuality||1,u=n.fileType||o.type,Ge(a,u,o.name,o.lastModified,i).then(function(y){try{{let U=function(){if(d--&&(F>l||F>C)){let x,H;return x=p?.95*M.width:M.width,H=p?.95*M.height:M.height,[R,g]=qe(x,H),g.drawImage(M,0,0,x,H),i*=u==="image/png"?.85:.95,Ge(R,u,o.name,o.lastModified,i).then((function(L){try{return k=L,we(M),M=R,F=k.size,b(Math.min(99,Math.floor((N-F)/(N-l)*100))),U}catch(V){return e(V)}}),e)}return [1]},P=function(){return we(M),we(R),we(S),we(a),we(v),b(100),c(k)};var w=U,h=P;if(_=y,f(),I=_.size>l,O=_.size>o.size,!I&&!O)return b(100),c(_);var T;return C=o.size,N=_.size,F=N,M=a,p=!n.alwaysKeepResolution&&I,(T=function(x){for(;x;){if(x.then)return void x.then(T,e);try{if(x.pop){if(x.length)return x.pop()?P.call(this):x;x=U;}else x=x.call(this);}catch(H){return e(H)}}}.bind(this))(U)}}catch(U){return e(U)}}.bind(this),e)}catch(y){return e(y)}}.bind(this),e)}catch(A){return e(A)}}.bind(this),e)}catch(m){return e(m)}}.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
- `,rt;function Kn(o,n){return new Promise(((E,c)=>{rt||(rt=(function(d){let l=[];return l.push(d),URL.createObjectURL(new Blob(l))})(qn));let e=new Worker(rt);e.addEventListener("message",(function(d){if(n.signal&&n.signal.aborted)e.terminate();else if(d.data.progress===void 0){if(d.data.error)return c(new Error(d.data.error)),void e.terminate();E(d.data.file),e.terminate();}else n.onProgress(d.data.progress);})),e.addEventListener("error",c),n.signal&&n.signal.addEventListener("abort",(()=>{c(n.signal.reason),e.terminate();})),e.postMessage({file:o,imageCompressionLibUrl:n.libURL,options:{...n,onProgress:void 0,signal:void 0}});}))}function re(o,n){return new Promise((function(E,c){let e,t,d,l,_,S;if(e={...n},d=0,{onProgress:l}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,_=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=u=>{d=u,typeof l=="function"&&l(d);},!(o instanceof Blob||o instanceof Gn))return c(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(o.type))return c(new Error("The file given is not an image"));if(S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!_||typeof Worker!="function"||S)return xt(o,e).then(function(u){try{return t=u,i.call(this)}catch(v){return c(v)}}.bind(this),c);var s=function(){try{return i.call(this)}catch(u){return c(u)}}.bind(this),a=function(u){try{return xt(o,e).then((function(v){try{return t=v,s()}catch(I){return c(I)}}),c)}catch(v){return c(v)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Kn(o,e).then((function(u){try{return t=u,s()}catch{return a()}}),a)}catch{a();}function i(){try{t.name=o.name,t.lastModified=o.lastModified;}catch{}try{e.preserveExif&&o.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===o.type)&&(t=kt(o,t));}catch{}return E(t)}}))}re.getDataUrlFromFile=Ft,re.getFilefromDataUrl=it,re.loadImage=Nt,re.drawImageInCanvas=Ht,re.drawFileInCanvas=ze,re.canvasToFile=Ge,re.getExifOrientation=Vt,re.handleMaxWidthOrHeight=$t,re.followExifOrientation=Wt,re.cleanupCanvasMemory=we,re.isAutoOrientationInBrowser=xe,re.approximateBelowMaximumCanvasSizeOfBrowser=Bt,re.copyExifWithoutOrientation=kt,re.getBrowserName=Me,re.version="2.0.2";var Pn=Ot(Qt()),On=Ot(pn());function Tr(o){let n=globalThis.document.getElementById("__AUTH_DRAWER"),E=globalThis.document.querySelector(".__drawer_container"),c=globalThis.document.querySelector(".__auth_close_button");n&&c&&E?.classList.contains("__hidden")&&(E.classList.remove("__hidden"),n.src=o,n.onload=()=>{c.classList.remove("__hidden"),n.classList.remove("__hidden"),n.contentWindow?.focus();});}function hn(){if(globalThis.document.getElementById("__AUTH_DRAWER"))return;let o=globalThis.document.createElement("style");o.innerHTML=`
24
+ `,rt;function Kn(o,n){return new Promise(((E,c)=>{rt||(rt=(function(d){let l=[];return l.push(d),URL.createObjectURL(new Blob(l))})(qn));let e=new Worker(rt);e.addEventListener("message",(function(d){if(n.signal&&n.signal.aborted)e.terminate();else if(d.data.progress===void 0){if(d.data.error)return c(new Error(d.data.error)),void e.terminate();E(d.data.file),e.terminate();}else n.onProgress(d.data.progress);})),e.addEventListener("error",c),n.signal&&n.signal.addEventListener("abort",(()=>{c(n.signal.reason),e.terminate();})),e.postMessage({file:o,imageCompressionLibUrl:n.libURL,options:{...n,onProgress:void 0,signal:void 0}});}))}function re(o,n){return new Promise((function(E,c){let e,t,d,l,v,S;if(e={...n},d=0,{onProgress:l}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,v=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=u=>{d=u,typeof l=="function"&&l(d);},!(o instanceof Blob||o instanceof Gn))return c(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(o.type))return c(new Error("The file given is not an image"));if(S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!v||typeof Worker!="function"||S)return xt(o,e).then(function(u){try{return t=u,i.call(this)}catch(_){return c(_)}}.bind(this),c);var s=function(){try{return i.call(this)}catch(u){return c(u)}}.bind(this),a=function(u){try{return xt(o,e).then((function(_){try{return t=_,s()}catch(I){return c(I)}}),c)}catch(_){return c(_)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Kn(o,e).then((function(u){try{return t=u,s()}catch{return a()}}),a)}catch{a();}function i(){try{t.name=o.name,t.lastModified=o.lastModified;}catch{}try{e.preserveExif&&o.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===o.type)&&(t=kt(o,t));}catch{}return E(t)}}))}re.getDataUrlFromFile=Ft,re.getFilefromDataUrl=it,re.loadImage=Nt,re.drawImageInCanvas=Ht,re.drawFileInCanvas=ze,re.canvasToFile=Ge,re.getExifOrientation=Vt,re.handleMaxWidthOrHeight=$t,re.followExifOrientation=Wt,re.cleanupCanvasMemory=we,re.isAutoOrientationInBrowser=xe,re.approximateBelowMaximumCanvasSizeOfBrowser=Bt,re.copyExifWithoutOrientation=kt,re.getBrowserName=Me,re.version="2.0.2";var Pn=Ot(Qt()),On=Ot(pn());function Tr(o){let n=globalThis.document.getElementById("__AUTH_DRAWER"),E=globalThis.document.querySelector(".__drawer_container"),c=globalThis.document.querySelector(".__auth_close_button");n&&c&&E?.classList.contains("__hidden")&&(E.classList.remove("__hidden"),n.src=o,n.onload=()=>{c.classList.remove("__hidden"),n.classList.remove("__hidden"),n.contentWindow?.focus();});}function hn(){if(globalThis.document.getElementById("__AUTH_DRAWER"))return;let o=globalThis.document.createElement("style");o.innerHTML=`
25
25
  .__button_container * {
26
26
  font-family: -apple-system,
27
27
  BlinkMacSystemFont,
@@ -226,12 +226,12 @@ self.addEventListener('message', async (e) => {
226
226
  max-width: 100%;
227
227
  }
228
228
  }
229
- `,globalThis.document.head.appendChild(o);let n=globalThis.document.createElement("div");n.className="__drawer_container __hidden";let E=globalThis.document.createElement("iframe");E.className="__drawer_frame __hidden",E.id="__AUTH_DRAWER",E.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"),E.loading="eager",E.referrerPolicy="unsafe-url",E.title="Login";let c=globalThis.document.createElement("div");c.setAttribute("alt","Close"),c.className="__auth_close_button",n.appendChild(E),n.appendChild(c),globalThis.document.body.appendChild(n);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function d(){n.classList.add("__hidden"),E.classList.add("__hidden"),t.forEach(({popup:S,cleanup:s})=>{s();try{S?.close();}catch{}});}let l=globalThis.document.createElement("iframe");l.style.display="none",l.id="__CONNECT_LISTENER",l.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(l);let _=new Promise(S=>{globalThis.window.addEventListener("message",s=>{s.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),S());});});globalThis.window.__REQUEST_CONNECTION__=async S=>{let{connectId:s,provider:a,scope:i,mode:u,appId:v}=S;if(u!=="request_only"){await _;let g=await new Promise(M=>{let p=setTimeout(()=>{globalThis.window.removeEventListener("message",f),M({connections:[]});},3e3),f=b=>{let r=b.data;r?.type!=="connect:check:result"||r?.connectId!==s||(clearTimeout(p),globalThis.window.removeEventListener("message",f),M({connections:r.connections??[]}));};globalThis.window.addEventListener("message",f),l.contentWindow?.postMessage({type:"connect:check",connectId:s,provider:a,scope:i,appId:v},"*");});if(g.connections.length>0)return {status:"connected",connectId:s,connections:g.connections};if(u==="check_only")return {status:"error",connectId:s,error:"no_connections",errorDescription:"No existing connections found."}}let I=new URL("/connect",globalThis.window.__ROOT_URL__);I.searchParams.set("connectId",s),I.searchParams.set("provider",a),i&&I.searchParams.set("scope",i),u&&I.searchParams.set("mode",u),v&&I.searchParams.set("appId",v);let O=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),C=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-O)/2),F=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-C)/2),k=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${O},height=${C},left=${N},top=${F}`,R=u!=="check_only"?globalThis.window.open(I.toString(),`ac1_connect_${s}`,k):null;return new Promise(g=>{let M=()=>{globalThis.window.removeEventListener("message",p),globalThis.window.clearInterval(f),t.delete(s);},p=b=>{let r=b.data||{};if(r.type==="connect:result"&&r.connectId===s){M();try{R?.close();}catch{}r.status==="error"?g({status:"error",connectId:s,error:r.error,errorDescription:r.errorDescription}):g({status:"connected",connectId:s,connections:r.connections??[]});}},f=globalThis.window.setInterval(()=>{R?.closed&&(M(),g({status:"error",connectId:s,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(s,{popup:R,cleanup:M}),globalThis.window.addEventListener("message",p);})},globalThis.window.addEventListener("message",S=>{!S.data||typeof S.data!="object"||S.data.type==="closeAuthDrawer"&&d();}),e?.addEventListener("click",d),n.addEventListener("click",S=>{S.target===n&&d();});}var _t=o=>{let{email:n,phoneNumber:E}=o??{},c=n??E,e=new URLSearchParams;o&&"redirectUri"in o&&o.redirectUri?e.set("returnTo",o.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),c&&e.set("identity",c),e.set("stripped","true");let t=globalThis.window.__APP_ID__;Tr(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function Cr(o={}){let[n,E]=useState({userId:void 0,status:"loading",signIn:_t,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()??{};E({userId:t.userId??null,status:"authenticated",signIn:_t,providers:t?.providers??[]});}catch{if(o.required){let t=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),d=globalThis.window.__APP_ID__;globalThis.window.top?globalThis.window.top.location.href=`${globalThis.window.__ROOT_URL__}/setup/${d}?returnTo=${t}`:globalThis.window.location.href=`${globalThis.window.__ROOT_URL__}/setup/${d}?returnTo=${t}`;}else E({userId:null,status:"unauthenticated",signIn:_t,providers:[]});}})();},[o.required]),n}async function Ir(o){let n=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:n,provider:o.provider,scope:o.scope?.join(","),mode:o.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}function gn(o){return `drive-picker:${o}`}function mn(o,n){let{origin:E,localStorage:c}=n,e=n.allowedOrigins??[E];return {postMessage:t=>{o.postMessage(t,E);},subscribe:t=>{let d=l=>{t(l.data,l.origin);};return globalThis.window.addEventListener("message",d),()=>globalThis.window.removeEventListener("message",d)},isOriginAllowed:t=>e.includes("*")||!!t&&e.includes(t),localStorage:c}}function At(){return Math.random().toString(36).substring(2,15)}function wn(o,n,E,c={}){let{timeout:e=3e4}=c,t=n.localStorage??(typeof globalThis.window<"u"&&typeof localStorage<"u"),d=new Map,l=[],_=false,S=null,s=null,a=false,i=null,u,v,I=new Promise((r,m)=>{u=r,v=m;});function O(){_=true,S&&(S(),S=null),s&&(globalThis.window.removeEventListener("storage",s),s=null);for(let[r,{reject:m}]of d)m(new Error("Connection closed")),d.delete(r);for(let r of l)r.reject?.(new Error("Connection closed"));l.length=0;}function C(r){if(t)try{localStorage.setItem(`__comms__:${o}:${"id"in r?r.id:At()}`,JSON.stringify(r));}catch{}}function N(r,m,A){if(_)return;let y={__comms__:o,id:r,type:"response",result:m,error:A};n.postMessage(y),C(y);}async function F(r,m,A){if(!(r in E)){N(A,void 0,`Method '${r}' not defined`);return}try{let y=await E[r](...m);N(A,y);}catch(y){let T=y instanceof Error?y.message:String(y);N(A,void 0,T);}}async function k(r,m){if(!(r in E)){console.warn(`[WindowComms] Signal to unknown method '${r}' ignored`);return}try{await E[r](...m);}catch(A){console.error(`[WindowComms] Error in signal handler '${r}':`,A);}}function R(r,m,A){let y=d.get(r);if(y){if(d.delete(r),t)try{localStorage.removeItem(`__comms__:${o}:${r}`);}catch{}A?y.reject(new Error(A)):y.resolve(m);}}function g(r){switch(r.type){case "call":F(r.method,r.args,r.id);break;case "signal":k(r.method,r.args);break;case "response":R(r.id,r.result,r.error);break;default:console.warn(`[WindowComms] Unknown message type: ${r.type}`);break}}function M(){for(let r of l)b(r.message,r.resolve,r.reject);l.splice(0,l.length);}function p(r,m){if(typeof r=="string")try{r=JSON.parse(r);}catch{return}if(!(typeof r!="object"||r===null)&&!(n.isOriginAllowed&&!n.isOriginAllowed(m))){if("__comms_ping__"in r){r.__comms_ping__===o&&(a=true,f&&(clearTimeout(f),f=null,n.postMessage({__comms_ping__:o})),u(),M());return}!("__comms__"in r)||r.__comms__!==o||"type"in r&&g(r);}}let f=null;e>0&&(f=setTimeout(()=>{!a&&!_&&(i=new Error(`Handshake timed out after ${e}ms`),O(),v(i));},e)),S=n.subscribe(p),t&&(s=r=>{if(!(!r.key||!r.newValue)&&r.key.startsWith(`__comms__:${o}:`))try{let m=JSON.parse(r.newValue);if(!m||typeof m!="object"||m.__comms__!==o)return;localStorage.removeItem(r.key),"type"in m&&g(m);}catch{}},globalThis.window.addEventListener("storage",s)),n.postMessage({__comms_ping__:o});function b(r,m,A){r.type==="call"&&m&&A&&(d.set(r.id,{resolve:m,reject:A}),e>0&&setTimeout(()=>{d.has(r.id)&&(d.delete(r.id),A(new Error(`Call to '${r.method}' timed out after ${e}ms`)));},e)),n.postMessage(r),C(r);}return {call:(r,...m)=>{if(_)return Promise.reject(i??new Error("Connection closed"));let A=At(),y={__comms__:o,id:A,type:"call",method:r,args:m};return new Promise((T,w)=>{a?b(y,h=>T(h),w):l.push({id:A,message:y,resolve:h=>T(h),reject:w});})},signal:(r,...m)=>{if(_)return;let A={__comms__:o,id:At(),type:"signal",method:r,args:m};a?b(A):l.push({id:A.id,message:A});},close:O,ready:I}}var yn=false,Ue=new Map,bt=new Map;function Xe(o,n,E,c){let e=Ue.get(o),t=bt.get(o);Ue.delete(o),bt.delete(o),t?.close(),c&&console.error("Drive Picker error:",c),e?.({action:n,docs:E});}function Rr(){yn||(yn=true,globalThis.window.addEventListener("message",o=>{let n=o.data;if(typeof n=="string")try{n=JSON.parse(n);}catch{return}if(n?.type==="FILE_PICKER_RESULT"){if(!vn())return;let{pickerId:E}=n;Ue.get(E)&&Xe(E,n.action,n.docs,n.error);}}));}function vn(){return typeof globalThis.window.ReactNativeWebView<"u"}function Mr(o,n,E){globalThis.window.ReactNativeWebView.postMessage(JSON.stringify({type:"requestFilePicker",pickerId:o,connectionId:n,builderCalls:E}));}function Pr(o,n,E,c){if(vn()){Rr(),c&&Ue.set(o,c),Mr(o,n,E);return}let e=Math.min(1024,Math.floor(globalThis.window.screen.availWidth*.9)),t=Math.min(680,Math.floor(globalThis.window.screen.availHeight*.9)),d=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-e)/2),l=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-t)/2),_=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${e},height=${t},left=${d},top=${l}`,S=new URLSearchParams({pickerId:o,connectionId:n,origin:globalThis.window.location.origin}),s=`${globalThis.window.__ROOT_URL__}/drive-picker?${S.toString()}`,a=globalThis.window.open(s,`drive_picker_${o}`,_);if(!a){console.error("Failed to open picker popup - popup may be blocked"),c?.({action:"cancel"});return}c&&Ue.set(o,c);let i={onResult:O=>{Xe(o,O.action,O.docs,O.error);try{a.close();}catch{}}},u=mn(a,{origin:"*",localStorage:true}),v=wn(gn(o),u,i);bt.set(o,v),v.signal("init",{connectionToken:n,builderCalls:E}),v.ready.catch(O=>{console.error("Picker handshake failed:",O),Xe(o,"cancel",void 0,O.message);});let I=globalThis.window.setInterval(()=>{a.closed&&(globalThis.window.clearInterval(I),Ue.has(o)&&Xe(o,"cancel"));},500);}var _n={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"},xr={PICKED:"picked",CANCEL:"cancel"},Ze=class{viewType;viewCalls=[];constructor(n){this.viewType=n??_n.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 E=Array.isArray(n)?n.join(","):n;return this.viewCalls.push(["setFileIds",[E]]),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}}},je=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,E,c){this.connectionToken=n;this.builderCalls=E;this.callback=c;}setVisible(n){if(n){let E=Math.random().toString(36).substring(2,15);Pr(E,this.connectionToken,this.builderCalls,this.callback);}}},St=class{connectionToken;calls=[];pickerCallback;constructor(n){return this.connectionToken=n,new Proxy(this,{get(E,c,e){return c==="setCallback"?t=>(E.pickerCallback=t,e):c==="build"?()=>E._build():c in E&&typeof E[c]!="function"?E[c]:(...t)=>{if(c==="addView"){let d=t[0];d instanceof Ze||d instanceof je?E.calls.push([c,[d._toConfig()]]):E.calls.push([c,t]);}else E.calls.push([c,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,E){return this}setMaxItems(n){return this}setSelectableMimeTypes(n){return this}setCallback(n){return this}build(){return this._build()}};function kr(o){return new Ze(o)}function Ur(){return new je}async function bn({channelId:o,initialData:n,broadcastOnly:E,onUpdate:c}){let e=n,t=0,d=globalThis.window.__REALTIME_DOMAIN__;if(E)return {getData(){return e},setData(_){e=_,fetch(`https://${d}/${o}`,{method:"POST",body:Tt.stringify(e)}).catch(console.error),c?.(_);},destroy(){}};let l=new WebSocket(`wss://${d}/${o}`);return new Promise((_,S)=>{function s(v){try{let I=JSON.parse(v.data.toString());I?.id&&I.id>t?(e=Tt.parse(I.payload),c?.(e),t=I.id):console.error("Invalid message:",v.data);}catch{console.error("Error parsing message:",v.data);}}function a(v){u(),S(v);}function i(){_({getData(){return e},setData(v){e=v,c?.(v),l.send(Tt.stringify(v));},destroy:u});}function u(){l.removeEventListener("message",s),l.removeEventListener("error",a),l.removeEventListener("open",i),l.close();}l.addEventListener("message",s),l.addEventListener("error",a),l.addEventListener("open",i);})}function En(o,n){let E=useRef(null),[c,e]=useState(0);return useEffect(()=>((async()=>o&&(E.current=await bn({channelId:o,initialData:n,onUpdate:()=>{e(t=>t+1);}})))(),E.current?.destroy),[o,e]),[E.current?.getData(),E.current?.setData??identity]}function Vr(o){let[n,E]=useState(null),[c]=En(n,void 0),e=o.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async l=>{let _=nanoid(32);return E(_),await e({...l,__channelId:_})},[o?.mutationFn]);return {...useMutation({...o,mutationFn:t}),data:c}}function Sn(o){return o?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function In(o){return o[0]}function Qr(o){let E=o?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",c=JSON.parse(atob(E.split(" ")?.[0])),e=c?.provider,t=c?.scope;return {provider:e,scope:t,isPopup:o?.message?.endsWith("--popup"),accountId:c?.accountId}}var zr=60,Gr=30*1e3,Ct=0,Rn=Date.now(),It=false;function qr(){return rpcClient({transport:async(o,n)=>{let E=Date.now();if(E-Rn>=Gr)Rn=E,Ct=0,It=false;else if(Ct>=zr)throw It||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),It=true),new RpcError("Rate limit exceeded",-32e3,{status:429});Ct++;let c="/api/"+o.method,e=o.params&&In(o.params)?.__channelId;e&&delete In(o.params)?.__channelId;let t=await fetch(c,{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(o),signal:n});if(!t.ok){let l=t.statusText,_=-32e3;try{let{message:S,code:s}=await t.json();S&&(l=S),s&&(_=s);}catch{}throw l.trim()===""&&(l=`Request failed with status: ${t.status}`),new RpcError(l,_,{status:t.status})}let d=Tt.deserialize(await t.json());if(Sn(d.error)){let l=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),_=Qr(d.error),S=[`returnTo=${l}`,_.provider?`&provider=${_.provider}`:"",_.scope?`&scope=${_.scope.join(",")}`:"",_.accountId?`&accountId=${_.accountId}`:""].filter(Boolean).join("&");if(_.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}&stripped=true`);return}let s=globalThis.window.top??globalThis.window;return s.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}`,null}return d}})}function Ro(o){return new Promise(n=>{let E=new globalThis.FileReader;E.onload=()=>{n(E.result);},E.readAsDataURL(o);})}function Kr(){let o={...globalThis.window.console};function n(E,c){let e=(0, On.default)(c,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${E.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...E)=>{n("LOG",E),o.log(...E);},globalThis.window.console.error=(...E)=>{n("ERROR",E),o.error(...E);},globalThis.window.console.info=(...E)=>{n("INFO",E),o.info(...E);},globalThis.window.console.warn=(...E)=>{n("WARN",E),o.warn(...E);};}var Mn=false;function Yr(o,n=globalThis.window.parent,E="*"){n?.postMessage({...o,source:"iframe"},{targetOrigin:E});}function Jr(o){let n=o.toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="local.acflare.com"||n.endsWith(".local")||n.endsWith(".local.acflare.com")}function Xr(){let o=new Set;o.add(globalThis.window.location.hostname);for(let n of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(n)try{o.add(new URL(n).hostname);}catch{}for(let n of o)if(Jr(n))return true;return false}function xn(o){if(o.source!==globalThis.window.parent)return false;if(globalThis.window.__IS_TESTING__)return true;let n=new Set;for(let E of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(E)try{n.add(new URL(E).origin);}catch{}return n.size===0?Xr()?(Mn||(Mn=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(o.origin)}function Zr(){globalThis.window.addEventListener("message",async o=>{if(!xn(o))return;let{origin:n,source:E,data:c}=o,{type:e}=c;if(e==="screenshot"){let t=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,d=await Pn.default.toPng(globalThis.document.body,{bgcolor:t,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),l=await fetch(d).then(a=>a.blob()),_=await re(l,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),s={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(_)}};Yr(s,E,n);}});}function jr(){let o="--guest-top-inset",n="--guest-bottom-inset",E="__guest-inset-style",c="data-sdk-inset-host",e="__NATIVE_VIEWPORT_INSET__",t=null,d=()=>{if(globalThis.document.getElementById(E))return;let u=globalThis.document.createElement("style");u.id=E,u.textContent=`
229
+ `,globalThis.document.head.appendChild(o);let n=globalThis.document.createElement("div");n.className="__drawer_container __hidden";let E=globalThis.document.createElement("iframe");E.className="__drawer_frame __hidden",E.id="__AUTH_DRAWER",E.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"),E.loading="eager",E.referrerPolicy="unsafe-url",E.title="Login";let c=globalThis.document.createElement("div");c.setAttribute("alt","Close"),c.className="__auth_close_button",n.appendChild(E),n.appendChild(c),globalThis.document.body.appendChild(n);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function d(){n.classList.add("__hidden"),E.classList.add("__hidden"),t.forEach(({popup:S,cleanup:s})=>{s();try{S?.close();}catch{}});}let l=globalThis.document.createElement("iframe");l.style.display="none",l.id="__CONNECT_LISTENER",l.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(l);let v=new Promise(S=>{globalThis.window.addEventListener("message",s=>{s.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),S());});});globalThis.window.__REQUEST_CONNECTION__=async S=>{let{connectId:s,provider:a,scope:i,mode:u,appId:_}=S;if(u!=="request_only"){await v;let g=await new Promise(M=>{let p=setTimeout(()=>{globalThis.window.removeEventListener("message",f),M({connections:[]});},3e3),f=b=>{let r=b.data;r?.type!=="connect:check:result"||r?.connectId!==s||(clearTimeout(p),globalThis.window.removeEventListener("message",f),M({connections:r.connections??[]}));};globalThis.window.addEventListener("message",f),l.contentWindow?.postMessage({type:"connect:check",connectId:s,provider:a,scope:i,appId:_},"*");});if(g.connections.length>0)return {status:"connected",connectId:s,connections:g.connections};if(u==="check_only")return {status:"error",connectId:s,error:"no_connections",errorDescription:"No existing connections found."}}let I=new URL("/connect",globalThis.window.__ROOT_URL__);I.searchParams.set("connectId",s),I.searchParams.set("provider",a),i&&I.searchParams.set("scope",i),u&&I.searchParams.set("mode",u),_&&I.searchParams.set("appId",_);let O=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),C=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-O)/2),F=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-C)/2),k=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${O},height=${C},left=${N},top=${F}`,R=u!=="check_only"?globalThis.window.open(I.toString(),`ac1_connect_${s}`,k):null;return new Promise(g=>{let M=()=>{globalThis.window.removeEventListener("message",p),globalThis.window.clearInterval(f),t.delete(s);},p=b=>{let r=b.data||{};if(r.type==="connect:result"&&r.connectId===s){M();try{R?.close();}catch{}r.status==="error"?g({status:"error",connectId:s,error:r.error,errorDescription:r.errorDescription}):g({status:"connected",connectId:s,connections:r.connections??[]});}},f=globalThis.window.setInterval(()=>{R?.closed&&(M(),g({status:"error",connectId:s,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(s,{popup:R,cleanup:M}),globalThis.window.addEventListener("message",p);})},globalThis.window.addEventListener("message",S=>{!S.data||typeof S.data!="object"||S.data.type==="closeAuthDrawer"&&d();}),e?.addEventListener("click",d),n.addEventListener("click",S=>{S.target===n&&d();});}var _t=o=>{let{email:n,phoneNumber:E}=o??{},c=n??E,e=new URLSearchParams;o&&"redirectUri"in o&&o.redirectUri?e.set("returnTo",o.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),c&&e.set("identity",c),e.set("stripped","true");let t=globalThis.window.__APP_ID__;Tr(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function Cr(o={}){let[n,E]=useState({userId:void 0,status:"loading",signIn:_t,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()??{};E({userId:t.userId??null,status:"authenticated",signIn:_t,providers:t?.providers??[]});}catch{if(o.required){let t=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),d=globalThis.window.__APP_ID__;globalThis.window.top?globalThis.window.top.location.href=`${globalThis.window.__ROOT_URL__}/setup/${d}?returnTo=${t}`:globalThis.window.location.href=`${globalThis.window.__ROOT_URL__}/setup/${d}?returnTo=${t}`;}else E({userId:null,status:"unauthenticated",signIn:_t,providers:[]});}})();},[o.required]),n}async function Ir(o){let n=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:n,provider:o.provider,scope:o.scope?.join(","),mode:o.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}function gn(o){return `drive-picker:${o}`}function mn(o,n){let{origin:E,localStorage:c}=n,e=n.allowedOrigins??[E];return {postMessage:t=>{o.postMessage(t,E);},subscribe:t=>{let d=l=>{t(l.data,l.origin);};return globalThis.window.addEventListener("message",d),()=>globalThis.window.removeEventListener("message",d)},isOriginAllowed:t=>e.includes("*")||!!t&&e.includes(t),localStorage:c}}function At(){return Math.random().toString(36).substring(2,15)}function wn(o,n,E,c={}){let{timeout:e=3e4}=c,t=n.localStorage??(typeof globalThis.window<"u"&&typeof localStorage<"u"),d=new Map,l=[],v=false,S=null,s=null,a=false,i=null,u,_,I=new Promise((r,m)=>{u=r,_=m;});function O(){v=true,S&&(S(),S=null),s&&(globalThis.window.removeEventListener("storage",s),s=null);for(let[r,{reject:m}]of d)m(new Error("Connection closed")),d.delete(r);for(let r of l)r.reject?.(new Error("Connection closed"));l.length=0;}function C(r){if(t)try{localStorage.setItem(`__comms__:${o}:${"id"in r?r.id:At()}`,JSON.stringify(r));}catch{}}function N(r,m,A){if(v)return;let y={__comms__:o,id:r,type:"response",result:m,error:A};n.postMessage(y),C(y);}async function F(r,m,A){if(!(r in E)){N(A,void 0,`Method '${r}' not defined`);return}try{let y=await E[r](...m);N(A,y);}catch(y){let T=y instanceof Error?y.message:String(y);N(A,void 0,T);}}async function k(r,m){if(!(r in E)){console.warn(`[WindowComms] Signal to unknown method '${r}' ignored`);return}try{await E[r](...m);}catch(A){console.error(`[WindowComms] Error in signal handler '${r}':`,A);}}function R(r,m,A){let y=d.get(r);if(y){if(d.delete(r),t)try{localStorage.removeItem(`__comms__:${o}:${r}`);}catch{}A?y.reject(new Error(A)):y.resolve(m);}}function g(r){switch(r.type){case "call":F(r.method,r.args,r.id);break;case "signal":k(r.method,r.args);break;case "response":R(r.id,r.result,r.error);break;default:console.warn(`[WindowComms] Unknown message type: ${r.type}`);break}}function M(){for(let r of l)b(r.message,r.resolve,r.reject);l.splice(0,l.length);}function p(r,m){if(typeof r=="string")try{r=JSON.parse(r);}catch{return}if(!(typeof r!="object"||r===null)&&!(n.isOriginAllowed&&!n.isOriginAllowed(m))){if("__comms_ping__"in r){r.__comms_ping__===o&&(a=true,f&&(clearTimeout(f),f=null,n.postMessage({__comms_ping__:o})),u(),M());return}!("__comms__"in r)||r.__comms__!==o||"type"in r&&g(r);}}let f=null;e>0&&(f=setTimeout(()=>{!a&&!v&&(i=new Error(`Handshake timed out after ${e}ms`),O(),_(i));},e)),S=n.subscribe(p),t&&(s=r=>{if(!(!r.key||!r.newValue)&&r.key.startsWith(`__comms__:${o}:`))try{let m=JSON.parse(r.newValue);if(!m||typeof m!="object"||m.__comms__!==o)return;localStorage.removeItem(r.key),"type"in m&&g(m);}catch{}},globalThis.window.addEventListener("storage",s)),n.postMessage({__comms_ping__:o});function b(r,m,A){r.type==="call"&&m&&A&&(d.set(r.id,{resolve:m,reject:A}),e>0&&setTimeout(()=>{d.has(r.id)&&(d.delete(r.id),A(new Error(`Call to '${r.method}' timed out after ${e}ms`)));},e)),n.postMessage(r),C(r);}return {call:(r,...m)=>{if(v)return Promise.reject(i??new Error("Connection closed"));let A=At(),y={__comms__:o,id:A,type:"call",method:r,args:m};return new Promise((T,w)=>{a?b(y,h=>T(h),w):l.push({id:A,message:y,resolve:h=>T(h),reject:w});})},signal:(r,...m)=>{if(v)return;let A={__comms__:o,id:At(),type:"signal",method:r,args:m};a?b(A):l.push({id:A.id,message:A});},close:O,ready:I}}var yn=false,Ue=new Map,bt=new Map;function Xe(o,n,E,c){let e=Ue.get(o),t=bt.get(o);Ue.delete(o),bt.delete(o),t?.close(),c&&console.error("Drive Picker error:",c),e?.({action:n,docs:E});}function Rr(){yn||(yn=true,globalThis.window.addEventListener("message",o=>{let n=o.data;if(typeof n=="string")try{n=JSON.parse(n);}catch{return}if(n?.type==="FILE_PICKER_RESULT"){if(!vn())return;let{pickerId:E}=n;Ue.get(E)&&Xe(E,n.action,n.docs,n.error);}}));}function vn(){return typeof globalThis.window.ReactNativeWebView<"u"}function Mr(o,n,E){globalThis.window.ReactNativeWebView.postMessage(JSON.stringify({type:"requestFilePicker",pickerId:o,connectionId:n,builderCalls:E}));}function Pr(o,n,E,c){if(vn()){Rr(),c&&Ue.set(o,c),Mr(o,n,E);return}let e=Math.min(1024,Math.floor(globalThis.window.screen.availWidth*.9)),t=Math.min(680,Math.floor(globalThis.window.screen.availHeight*.9)),d=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-e)/2),l=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-t)/2),v=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${e},height=${t},left=${d},top=${l}`,S=new URLSearchParams({pickerId:o,connectionId:n,origin:globalThis.window.location.origin}),s=`${globalThis.window.__ROOT_URL__}/drive-picker?${S.toString()}`,a=globalThis.window.open(s,`drive_picker_${o}`,v);if(!a){console.error("Failed to open picker popup - popup may be blocked"),c?.({action:"cancel"});return}c&&Ue.set(o,c);let i={onResult:O=>{Xe(o,O.action,O.docs,O.error);try{a.close();}catch{}}},u=mn(a,{origin:"*",localStorage:true}),_=wn(gn(o),u,i);bt.set(o,_),_.signal("init",{connectionToken:n,builderCalls:E}),_.ready.catch(O=>{console.error("Picker handshake failed:",O),Xe(o,"cancel",void 0,O.message);});let I=globalThis.window.setInterval(()=>{a.closed&&(globalThis.window.clearInterval(I),Ue.has(o)&&Xe(o,"cancel"));},500);}var _n={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"},xr={PICKED:"picked",CANCEL:"cancel"},Ze=class{viewType;viewCalls=[];constructor(n){this.viewType=n??_n.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 E=Array.isArray(n)?n.join(","):n;return this.viewCalls.push(["setFileIds",[E]]),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}}},je=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,E,c){this.connectionToken=n;this.builderCalls=E;this.callback=c;}setVisible(n){if(n){let E=Math.random().toString(36).substring(2,15);Pr(E,this.connectionToken,this.builderCalls,this.callback);}}},St=class{connectionToken;calls=[];pickerCallback;constructor(n){return this.connectionToken=n,new Proxy(this,{get(E,c,e){return c==="setCallback"?t=>(E.pickerCallback=t,e):c==="build"?()=>E._build():c in E&&typeof E[c]!="function"?E[c]:(...t)=>{if(c==="addView"){let d=t[0];d instanceof Ze||d instanceof je?E.calls.push([c,[d._toConfig()]]):E.calls.push([c,t]);}else E.calls.push([c,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,E){return this}setMaxItems(n){return this}setSelectableMimeTypes(n){return this}setCallback(n){return this}build(){return this._build()}};function kr(o){return new Ze(o)}function Ur(){return new je}async function bn({channelId:o,initialData:n,broadcastOnly:E,onUpdate:c}){let e=n,t=0,d=globalThis.window.__REALTIME_DOMAIN__;if(E)return {getData(){return e},setData(v){e=v,fetch(`https://${d}/${o}`,{method:"POST",body:Tt.stringify(e)}).catch(console.error),c?.(v);},destroy(){}};let l=new WebSocket(`wss://${d}/${o}`);return new Promise((v,S)=>{function s(_){try{let I=JSON.parse(_.data.toString());I?.id&&I.id>t?(e=Tt.parse(I.payload),c?.(e),t=I.id):console.error("Invalid message:",_.data);}catch{console.error("Error parsing message:",_.data);}}function a(_){u(),S(_);}function i(){v({getData(){return e},setData(_){e=_,c?.(_),l.send(Tt.stringify(_));},destroy:u});}function u(){l.removeEventListener("message",s),l.removeEventListener("error",a),l.removeEventListener("open",i),l.close();}l.addEventListener("message",s),l.addEventListener("error",a),l.addEventListener("open",i);})}function En(o,n){let E=useRef(null),[c,e]=useState(0);return useEffect(()=>((async()=>o&&(E.current=await bn({channelId:o,initialData:n,onUpdate:()=>{e(t=>t+1);}})))(),E.current?.destroy),[o,e]),[E.current?.getData(),E.current?.setData??identity]}function Vr(o){let[n,E]=useState(null),[c]=En(n,void 0),e=o.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async l=>{let v=nanoid(32);return E(v),await e({...l,__channelId:v})},[o?.mutationFn]);return {...useMutation({...o,mutationFn:t}),data:c}}function Sn(o){return o?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function In(o){return o[0]}function Qr(o){let E=o?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",c=JSON.parse(atob(E.split(" ")?.[0])),e=c?.provider,t=c?.scope;return {provider:e,scope:t,isPopup:o?.message?.endsWith("--popup"),accountId:c?.accountId}}var zr=60,Gr=30*1e3,Ct=0,Rn=Date.now(),It=false;function qr(){return rpcClient({transport:async(o,n)=>{let E=Date.now();if(E-Rn>=Gr)Rn=E,Ct=0,It=false;else if(Ct>=zr)throw It||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),It=true),new RpcError("Rate limit exceeded",-32e3,{status:429});Ct++;let c="/api/"+o.method,e=o.params&&In(o.params)?.__channelId;e&&delete In(o.params)?.__channelId;let t=await fetch(c,{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(o),signal:n});if(!t.ok){let l=t.statusText,v=-32e3;try{let{message:S,code:s}=await t.json();S&&(l=S),s&&(v=s);}catch{}throw l.trim()===""&&(l=`Request failed with status: ${t.status}`),new RpcError(l,v,{status:t.status})}let d=Tt.deserialize(await t.json());if(Sn(d.error)){let l=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),v=Qr(d.error),S=[`returnTo=${l}`,v.provider?`&provider=${v.provider}`:"",v.scope?`&scope=${v.scope.join(",")}`:"",v.accountId?`&accountId=${v.accountId}`:""].filter(Boolean).join("&");if(v.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}&stripped=true`);return}let s=globalThis.window.top??globalThis.window;return s.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}`,null}return d}})}function Ro(o){return new Promise(n=>{let E=new globalThis.FileReader;E.onload=()=>{n(E.result);},E.readAsDataURL(o);})}function Kr(){let o={...globalThis.window.console};function n(E,c){let e=(0, On.default)(c,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${E.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...E)=>{n("LOG",E),o.log(...E);},globalThis.window.console.error=(...E)=>{n("ERROR",E),o.error(...E);},globalThis.window.console.info=(...E)=>{n("INFO",E),o.info(...E);},globalThis.window.console.warn=(...E)=>{n("WARN",E),o.warn(...E);};}var Mn=false;function Yr(o,n=globalThis.window.parent,E="*"){n?.postMessage({...o,source:"iframe"},{targetOrigin:E});}function Jr(o){let n=o.toLowerCase();return n==="localhost"||n==="127.0.0.1"||n==="::1"||n==="local.acflare.com"||n.endsWith(".local")||n.endsWith(".local.acflare.com")}function Xr(){let o=new Set;o.add(globalThis.window.location.hostname);for(let n of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(n)try{o.add(new URL(n).hostname);}catch{}for(let n of o)if(Jr(n))return true;return false}function xn(o){if(o.source!==globalThis.window.parent)return false;if(globalThis.window.__IS_TESTING__)return true;let n=new Set;for(let E of [globalThis.window.__BASE_URL__,globalThis.window.__ROOT_URL__])if(E)try{n.add(new URL(E).origin);}catch{}return n.size===0?Xr()?(Mn||(Mn=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(o.origin)}function Zr(){globalThis.window.addEventListener("message",async o=>{if(!xn(o))return;let{origin:n,source:E,data:c}=o,{type:e}=c;if(e==="screenshot"){let t=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,d=await Pn.default.toPng(globalThis.document.body,{bgcolor:t,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),l=await fetch(d).then(a=>a.blob()),v=await re(l,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),s={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(v)}};Yr(s,E,n);}});}function jr(){let o="--guest-top-inset",n="--guest-bottom-inset",E="__guest-inset-style",c="data-sdk-inset-host",e="__NATIVE_VIEWPORT_INSET__",t=null,d=()=>{if(globalThis.document.getElementById(E))return;let u=globalThis.document.createElement("style");u.id=E,u.textContent=`
230
230
  #root > [${c}="true"] {
231
231
  padding-top: var(${o}, 0px);
232
232
  padding-bottom: var(${n}, 0px);
233
233
  }
234
- `,globalThis.document.head.appendChild(u);},l=()=>{let v=globalThis.document.getElementById("root")?.firstElementChild??null;if(t&&t!==v&&t.removeAttribute(c),v){v.setAttribute(c,"true"),t=v;return}t=null;},_=globalThis.document.getElementById("root");_&&(l(),new MutationObserver(()=>{l();}).observe(_,{childList:true}));let S=u=>{let v=typeof u=="number"?u:typeof u=="string"?Number.parseFloat(u):Number.NaN;return Number.isFinite(v)?v:null},s=u=>{d();let v=S(u.top)??0;globalThis.document.documentElement.style.setProperty(o,`${Math.max(0,v)}px`);let I=S(u.bottom)??0;globalThis.document.documentElement.style.setProperty(n,`${Math.max(0,I)}px`);},a=u=>{if(!u)return null;if(typeof u=="string")try{let v=JSON.parse(u);return v&&typeof v=="object"?v:null}catch{return null}return typeof u=="object"?u:null};globalThis.window.addEventListener("message",u=>{let v=a(u.data);v?.type!=="viewportInset"||!(typeof globalThis.window.ReactNativeWebView<"u"&&v?.source==="native")&&!xn(u)||s(v?.payload??{});});let i=globalThis.window[e]??null;i&&s(i);}function Mo({appId:o,rootUrl:n,baseUrl:E,isTesting:c,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=o,globalThis.window.__ROOT_URL__=n,globalThis.window.__BASE_URL__=E,globalThis.window.__IS_TESTING__=c,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,Zr(),Kr(),hn(),jr(),globalThis.window.onerror=function(d){console.error("Global JS error:",d);},globalThis.window.onunhandledrejection=function(d){console.error("Unhandled promise rejection:",d.reason);});}function Po(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
234
+ `,globalThis.document.head.appendChild(u);},l=()=>{let u=globalThis.document.getElementById("root"),I=u?Array.from(u.children).find(O=>getComputedStyle(O).display!=="none"&&getComputedStyle(O).visibility!=="hidden")??null:null;if(t&&t!==I&&t.removeAttribute(c),I){I.setAttribute(c,"true"),t=I;return}t=null;},v=globalThis.document.getElementById("root");v&&(l(),new MutationObserver(()=>{l();}).observe(v,{childList:true}));let S=u=>{let _=typeof u=="number"?u:typeof u=="string"?Number.parseFloat(u):Number.NaN;return Number.isFinite(_)?_:null},s=u=>{d();let _=S(u.top)??0;globalThis.document.documentElement.style.setProperty(o,`${Math.max(0,_)}px`);let I=S(u.bottom)??0;globalThis.document.documentElement.style.setProperty(n,`${Math.max(0,I)}px`);},a=u=>{if(!u)return null;if(typeof u=="string")try{let _=JSON.parse(u);return _&&typeof _=="object"?_:null}catch{return null}return typeof u=="object"?u:null};globalThis.window.addEventListener("message",u=>{let _=a(u.data);_?.type!=="viewportInset"||!(typeof globalThis.window.ReactNativeWebView<"u"&&_?.source==="native")&&!xn(u)||s(_?.payload??{});});let i=globalThis.window[e]??null;i&&s(i);}function Mo({appId:o,rootUrl:n,baseUrl:E,isTesting:c,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=o,globalThis.window.__ROOT_URL__=n,globalThis.window.__BASE_URL__=E,globalThis.window.__IS_TESTING__=c,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,Zr(),Kr(),hn(),jr(),globalThis.window.onerror=function(d){console.error("Global JS error:",d);},globalThis.window.onunhandledrejection=function(d){console.error("Unhandled promise rejection:",d.reason);});}function Po(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
235
235
 
236
236
  dom-to-image-more/dist/dom-to-image-more.min.js:
237
237
  (*! dom-to-image-more 23-10-2025 *)
@@ -2309,15 +2309,15 @@ declare let client: {
2309
2309
  subject: string;
2310
2310
  markdown: string;
2311
2311
  unauthenticatedLinks?: boolean | undefined;
2312
- aclLevel?: "EDITOR" | "VIEWER" | undefined;
2312
+ aclLevel?: "VIEWER" | undefined;
2313
2313
  };
2314
2314
  _input_out: {
2315
2315
  appId: string;
2316
2316
  email: string;
2317
2317
  subject: string;
2318
2318
  markdown: string;
2319
+ aclLevel: "VIEWER";
2319
2320
  unauthenticatedLinks?: boolean | undefined;
2320
- aclLevel?: "EDITOR" | "VIEWER" | undefined;
2321
2321
  };
2322
2322
  _output_in: typeof _trpc_server.unsetMarker;
2323
2323
  _output_out: typeof _trpc_server.unsetMarker;
@@ -3062,13 +3062,13 @@ declare let client: {
3062
3062
  pushToken: string | null | undefined;
3063
3063
  };
3064
3064
  _input_in: {
3065
- kind: "image" | "dialogue" | "video" | "sound_effect" | "music" | "speech";
3065
+ kind: "image" | "video" | "sound_effect" | "music" | "speech" | "dialogue";
3066
3066
  text: string;
3067
3067
  quality?: "standard" | "high" | undefined;
3068
3068
  inputFilePath?: string | undefined;
3069
3069
  };
3070
3070
  _input_out: {
3071
- kind: "image" | "dialogue" | "video" | "sound_effect" | "music" | "speech";
3071
+ kind: "image" | "video" | "sound_effect" | "music" | "speech" | "dialogue";
3072
3072
  text: string;
3073
3073
  quality: "standard" | "high";
3074
3074
  inputFilePath?: string | undefined;
@@ -3163,6 +3163,13 @@ declare let client: {
3163
3163
  method: string;
3164
3164
  body?: any;
3165
3165
  headers?: Record<string, string> | undefined;
3166
+ formData?: {
3167
+ name: string;
3168
+ value?: string | undefined;
3169
+ filename?: string | undefined;
3170
+ mimeType?: string | undefined;
3171
+ base64?: string | undefined;
3172
+ }[] | undefined;
3166
3173
  };
3167
3174
  _input_out: {
3168
3175
  url: string;
@@ -3170,6 +3177,13 @@ declare let client: {
3170
3177
  method: string;
3171
3178
  body?: any;
3172
3179
  headers?: Record<string, string> | undefined;
3180
+ formData?: {
3181
+ name: string;
3182
+ value?: string | undefined;
3183
+ filename?: string | undefined;
3184
+ mimeType?: string | undefined;
3185
+ base64?: string | undefined;
3186
+ }[] | undefined;
3173
3187
  };
3174
3188
  _output_in: typeof _trpc_server.unsetMarker;
3175
3189
  _output_out: typeof _trpc_server.unsetMarker;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptive-ai/sdk",
3
- "version": "0.1.32",
3
+ "version": "0.1.34",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {