@adaptive-ai/sdk 0.1.20 → 0.1.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.d.ts +151 -0
- package/dist/client/index.js +15 -8
- package/dist/server/index.d.ts +20 -631
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
package/dist/client/index.js
CHANGED
|
@@ -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
|
|
2
|
-
`)})},impl:{readAll:e}};function e(){return Promise.resolve(o.asArray(globalThis.document.styleSheets)).then(function(h){let x=[];return h.forEach(function(f){var u=Object.getPrototypeOf(f);if(Object.prototype.hasOwnProperty.call(u,"cssRules"))try{o.asArray(f.cssRules||[]).forEach(x.push.bind(x));}catch(_){console.error("domtoimage: Error while reading CSS rules from: "+f.href,_.toString());}}),x}).then(function(h){return h.filter(function(x){return x.type===CSSRule.FONT_FACE_RULE}).filter(function(x){return S.shouldProcess(x.style.getPropertyValue("src"))})}).then(function(h){return h.map(R)});function R(h){return {resolve:function(){var x=(h.parentStyleSheet||{}).href;return S.inlineAll(h.cssText,x)},src:function(){return h.style.getPropertyValue("src")}}}}let t={inlineAll:function R(h){if(!o.isElement(h))return Promise.resolve(h);return x(h).then(function(){return o.isHTMLImageElement(h)?g(h).inline():Promise.all(o.asArray(h.childNodes).map(function(f){return R(f)}))});function x(f){let u=["background","background-image"],_=u.map(function(s){let w=f.style.getPropertyValue(s),b=f.style.getPropertyPriority(s);return w?S.inlineAll(w).then(function(A){f.style.setProperty(s,A,b);}):Promise.resolve()});return Promise.all(_).then(function(){return f})}},impl:{newImage:g}};function g(R){return {inline:function(h){return o.isDataUrl(R.src)?Promise.resolve():Promise.resolve(R.src).then(h||o.getAndEncode).then(function(x){return new Promise(function(f){R.onload=f,R.onerror=f,R.src=x;})})}}}let c={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},y={toSvg:n,toPng:function(R,h){return d(R,h).then(function(x){return x.toDataURL()})},toJpeg:function(R,h){return d(R,h).then(function(x){return x.toDataURL("image/jpeg",(h?h.quality:void 0)||1)})},toBlob:function(R,h){return d(R,h).then(o.canvasToBlob)},toPixelData:function(R,h){return d(R,h).then(function(x){return x.getContext("2d").getImageData(0,0,o.width(R),o.height(R)).data})},toCanvas:d,impl:{fontFaces:l,images:t,util:o,inliner:S,urlCache:[],options:{},copyOptions:function(R){R.copyDefaultStyles===void 0?y.impl.options.copyDefaultStyles=c.copyDefaultStyles:y.impl.options.copyDefaultStyles=R.copyDefaultStyles,y.impl.options.imagePlaceholder=(R.imagePlaceholder===void 0?c:R).imagePlaceholder,y.impl.options.cacheBust=(R.cacheBust===void 0?c:R).cacheBust,y.impl.options.corsImg=(R.corsImg===void 0?c:R).corsImg,y.impl.options.useCredentials=(R.useCredentials===void 0?c:R).useCredentials,y.impl.options.useCredentialsFilters=(R.useCredentialsFilters===void 0?c:R).useCredentialsFilters,y.impl.options.httpTimeout=(R.httpTimeout===void 0?c:R).httpTimeout,y.impl.options.styleCaching=(R.styleCaching===void 0?c:R).styleCaching;}}},E=(typeof nt=="object"&&typeof rt=="object"?rt.exports=y:i.domtoimage=y,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),r=(i===void 0?void 0:i.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(i===void 0?void 0:i.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function n(R,h){y.impl.util.getWindow(R);let f=(h=h||{},y.impl.copyOptions(h),[]);return Promise.resolve(R).then(function(u){if(u.nodeType===E)return u;var _=u,s=globalThis.document.createElement("span");return _.replaceWith(s),s.append(u),f.push({child:_,wrapper:s}),s}).then(function(u){return (function _(s,w,b,A){let T=w.filter;if(s===v||o.isHTMLScriptElement(s)||o.isHTMLStyleElement(s)||o.isHTMLLinkElement(s)||b!==null&&T&&!T(s))return Promise.resolve();return Promise.resolve(s).then(m).then(p).then(function(D){return U(D,O(s))}).then(L).then(function(D){return H(D,s)});function m(D){return o.isHTMLCanvasElement(D)?o.makeImage(D.toDataURL()):D.cloneNode(false)}function p(D){return w.adjustClonedNode&&w.adjustClonedNode(s,D,false),Promise.resolve(D)}function L(D){return w.adjustClonedNode&&w.adjustClonedNode(s,D,true),Promise.resolve(D)}function O(D){return o.isElementHostForOpenShadowRoot(D)?D.shadowRoot:D}function U(D,Q){let B=K(Q),F=Promise.resolve();if(B.length!==0){let V=r($(Q));o.asArray(B).forEach(function(z){F=F.then(function(){return _(z,w,V).then(function(q){q&&D.appendChild(q);})});});}return F.then(function(){return D});function $(V){return o.isShadowRoot(V)?V.host:V}function K(V){if(o.isShadowSlotElement(V)){let z=V.assignedNodes();if(z&&0<z.length)return z}return V.childNodes}}function H(D,Q){return !o.isElement(D)||o.isShadowSlotElement(Q)?Promise.resolve(D):Promise.resolve().then(F).then($).then(K).then(V).then(B).then(function(){return D});function B(){o.isHTMLImageElement(D)&&(D.removeAttribute("loading"),Q.srcset||Q.sizes)&&(D.removeAttribute("srcset"),D.removeAttribute("sizes"),D.src=Q.currentSrc||Q.src);}function F(){function z(G,W){W.font=G.font,W.fontFamily=G.fontFamily,W.fontFeatureSettings=G.fontFeatureSettings,W.fontKerning=G.fontKerning,W.fontSize=G.fontSize,W.fontStretch=G.fontStretch,W.fontStyle=G.fontStyle,W.fontVariant=G.fontVariant,W.fontVariantCaps=G.fontVariantCaps,W.fontVariantEastAsian=G.fontVariantEastAsian,W.fontVariantLigatures=G.fontVariantLigatures,W.fontVariantNumeric=G.fontVariantNumeric,W.fontVariationSettings=G.fontVariationSettings,W.fontWeight=G.fontWeight;}function q(G,W){let ie=r(G);ie.cssText?(W.style.cssText=ie.cssText,z(ie,W.style)):(I(w,G,ie,b,W),b===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(ae=>W.style.removeProperty(ae)),["left","right","top","bottom"].forEach(ae=>{W.style.getPropertyValue(ae)&&W.style.setProperty(ae,"0px");})));}q(Q,D);}function $(){let z=o.uid();function q(G){let W=r(Q,G),ie=W.getPropertyValue("content");if(ie!==""&&ie!=="none"){let Y=function(){let J=`.${z}:`+G,ne=(W.cssText?oe:j)();return globalThis.document.createTextNode(J+`{${ne}}`);function oe(){return `${W.cssText} content: ${ie};`}function j(){return o.asArray(W).map(ee).join("; ")+";";function ee(X){let ce=W.getPropertyValue(X),ge=W.getPropertyPriority(X)?" !important":"";return X+": "+ce+ge}}};let Z=D.getAttribute("class")||"",te=(D.setAttribute("class",Z+" "+z),globalThis.document.createElement("style"));te.appendChild(Y()),D.appendChild(te);}}[":before",":after"].forEach(function(G){q(G);});}function K(){o.isHTMLTextAreaElement(Q)&&(D.innerHTML=Q.value),o.isHTMLInputElement(Q)&&D.setAttribute("value",Q.value);}function V(){o.isSVGElement(D)&&(D.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.isSVGRectElement(D))&&["width","height"].forEach(function(z){let q=D.getAttribute(z);q&&D.style.setProperty(z,q);});}}})(u,h,null)}).then(h.disableEmbedFonts?Promise.resolve(R):C).then(h.disableInlineImages?Promise.resolve(R):M).then(function(u){h.bgcolor&&(u.style.backgroundColor=h.bgcolor),h.width&&(u.style.width=h.width+"px"),h.height&&(u.style.height=h.height+"px"),h.style&&Object.keys(h.style).forEach(function(s){u.style[s]=h.style[s];});let _=null;return typeof h.onclone=="function"&&(_=h.onclone(u)),Promise.resolve(_).then(function(){return u})}).then(function(u){let _=h.width||o.width(R),s=h.height||o.height(R);return Promise.resolve(u).then(function(w){return w.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(w)}).then(o.escapeXhtml).then(function(w){var b=(o.isDimensionMissing(_)?' width="100%"':` width="${_}"`)+(o.isDimensionMissing(s)?' height="100%"':` height="${s}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(o.isDimensionMissing(_)?"":` width="${_}"`)+(o.isDimensionMissing(s)?"":` height="${s}"`)}><foreignObject${b}>${w}</foreignObject></svg>`}).then(function(w){return "data:image/svg+xml;charset=utf-8,"+w})}).then(function(u){for(;0<f.length;){var _=f.pop();_.wrapper.replaceWith(_.child);}return u}).then(function(u){return y.impl.urlCache=[],v&&(globalThis.document.body.removeChild(v),v=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,k={};},2e4),u})}function d(R,h){return n(R,h=h||{}).then(o.makeImage).then(function(x){var f=typeof h.scale!="number"?1:h.scale,u=((s,w)=>{let b=h.width||o.width(s),A=h.height||o.height(s);return o.isDimensionMissing(b)&&(b=o.isDimensionMissing(A)?300:2*A),o.isDimensionMissing(A)&&(A=b/2),(s=globalThis.document.createElement("canvas")).width=b*w,s.height=A*w,h.bgcolor&&((w=s.getContext("2d")).fillStyle=h.bgcolor,w.fillRect(0,0,s.width,s.height)),s})(R,f),_=u.getContext("2d");return _.msImageSmoothingEnabled=false,_.imageSmoothingEnabled=false,x&&(_.scale(f,f),_.drawImage(x,0,0)),u})}let v=null;function C(R){return l.resolveAll().then(function(h){var x;return h!==""&&(x=globalThis.document.createElement("style"),R.appendChild(x),x.appendChild(globalThis.document.createTextNode(h))),R})}function M(R){return t.inlineAll(R).then(function(){return R})}function I(R,h,x,f,u){let _=y.impl.options.copyDefaultStyles?((w,b)=>{var A,T=(L=>(w.styleCaching!=="relaxed"?L:L.filter((O,U,H)=>U===0||U===H.length-1)).join(">"))(b=(L=>{var O=[];do if(L.nodeType===E){var U=L.tagName;if(O.push(U),P.includes(U))break}while(L=L.parentNode);return O})(b));{if(k[T])return k[T];b=((L,O)=>{let U=L.body;do{var H=O.pop(),H=L.createElement(H);U.appendChild(H),U=H;}while(0<O.length);return U.textContent="\u200B",U})((A=(()=>{if(v)return v.contentWindow;O=globalThis.document.characterSet||"UTF-8",L=(L=globalThis.document.doctype)?(`<!DOCTYPE ${F(L.name)} ${F(L.publicId)} `+F(L.systemId)).trim()+">":"",(v=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+o.uid(),v.style.top="-9999px",v.style.visibility="hidden",v.style.position="fixed",globalThis.document.body.appendChild(v);var L,O,U=v,H="domtoimage-sandbox";try{return U.contentWindow.document.write(L+`<html><head><meta charset='${O}'><title>${H}</title></head><body></body></html>`),U.contentWindow}catch{}var D=globalThis.document.createElement("meta");D.setAttribute("charset",O);try{var Q=globalThis.document.implementation.createHTMLDocument(H),B=(Q.head.appendChild(D),L+Q.documentElement.outerHTML);return U.setAttribute("srcdoc",B),U.contentWindow}catch{}return U.contentDocument.head.appendChild(D),U.contentDocument.title=H,U.contentWindow;function F($){var K;return $?((K=globalThis.document.createElement("div")).innerText=$,K.innerHTML):""}})()).document,b),A=((L,O)=>{let U={},H=L.getComputedStyle(O);return o.asArray(H).forEach(function(D){U[D]=D==="width"||D==="height"?"auto":H.getPropertyValue(D);}),U})(A,b);var m=b;do{var p=m.parentElement;p!==null&&p.removeChild(m),m=p;}while(m&&m.tagName!=="BODY");return k[T]=A}})(R,h):{},s=u.style;o.asArray(x).forEach(function(w){var b,A,T,m;R.filterStyles&&!R.filterStyles(h,w)||(A=x.getPropertyValue(w),T=_[w],b=f?f.getPropertyValue(w):void 0,s.getPropertyValue(w))||(A!==T||f&&A!==b)&&(T=x.getPropertyPriority(w),b=s,A=A,T=T,m=0<=["background-clip"].indexOf(w=w),T?(b.setProperty(w,A,T),m&&b.setProperty("-webkit-"+w,A,T)):(b.setProperty(w,A),m&&b.setProperty("-webkit-"+w,A)));});}let N=null,k={},P=["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"];})(nt);});var kt=Ze(()=>{});var on=Ze((Ur,rn)=>{var ht=typeof Map=="function"&&Map.prototype,ot=Object.getOwnPropertyDescriptor&&ht?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ke=ht&&ot&&typeof ot.get=="function"?ot.get:null,Nt=ht&&Map.prototype.forEach,pt=typeof Set=="function"&&Set.prototype,it=Object.getOwnPropertyDescriptor&&pt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Xe=pt&&it&&typeof it.get=="function"?it.get:null,Bt=pt&&Set.prototype.forEach,Pn=typeof WeakMap=="function"&&WeakMap.prototype,ke=Pn?WeakMap.prototype.has:null,Ln=typeof WeakSet=="function"&&WeakSet.prototype,Ne=Ln?WeakSet.prototype.has:null,Dn=typeof WeakRef=="function"&&WeakRef.prototype,Ht=Dn?WeakRef.prototype.deref:null,Fn=Boolean.prototype.valueOf,kn=Object.prototype.toString,Nn=Function.prototype.toString,Bn=String.prototype.match,gt=String.prototype.slice,Ee=String.prototype.replace,Hn=String.prototype.toUpperCase,Qt=String.prototype.toLowerCase,Yt=RegExp.prototype.test,$t=Array.prototype.concat,we=Array.prototype.join,Qn=Array.prototype.slice,Wt=Math.floor,ct=typeof BigInt=="function"?BigInt.prototype.valueOf:null,at=Object.getOwnPropertySymbols,lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Be=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pe||true)?Symbol.toStringTag:null,Jt=Object.prototype.propertyIsEnumerable,zt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(i){return i.__proto__}:null);function Gt(i,o){if(i===1/0||i===-1/0||i!==i||i&&i>-1e3&&i<1e3||Yt.call(/e/,o))return o;var S=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof i=="number"){var l=i<0?-Wt(-i):Wt(i);if(l!==i){var e=String(l),t=gt.call(o,e.length+1);return Ee.call(e,S,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(o,S,"$&_")}var ut=kt(),Vt=ut.custom,qt=en(Vt)?Vt:null,Zt={__proto__:null,double:'"',single:"'"},$n={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};rn.exports=function i(o,S,l,e){var t=S||{};if(ve(t,"quoteStyle")&&!ve(Zt,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(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 g=ve(t,"customInspect")?t.customInspect:true;if(typeof g!="boolean"&&g!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ve(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(ve(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=t.numericSeparator;if(typeof o>"u")return "undefined";if(o===null)return "null";if(typeof o=="boolean")return o?"true":"false";if(typeof o=="string")return nn(o,t);if(typeof o=="number"){if(o===0)return 1/0/o>0?"0":"-0";var y=String(o);return c?Gt(o,y):y}if(typeof o=="bigint"){var E=String(o)+"n";return c?Gt(o,E):E}var r=typeof t.depth>"u"?5:t.depth;if(typeof l>"u"&&(l=0),l>=r&&r>0&&typeof o=="object")return ft(o)?"[Array]":"[Object]";var a=ar(t,l);if(typeof e>"u")e=[];else if(tn(e,o)>=0)return "[Circular]";function n(b,A,T){if(A&&(e=Qn.call(e),e.push(A)),T){var m={depth:t.depth};return ve(t,"quoteStyle")&&(m.quoteStyle=t.quoteStyle),i(b,m,l+1,e)}return i(b,t,l+1,e)}if(typeof o=="function"&&!Kt(o)){var d=Jn(o),v=qe(o,n);return "[Function"+(d?": "+d:" (anonymous)")+"]"+(v.length>0?" { "+we.call(v,", ")+" }":"")}if(en(o)){var C=Pe?Ee.call(String(o),/^(Symbol\(.*\))_[^)]*$/,"$1"):lt.call(o);return typeof o=="object"&&!Pe?Fe(C):C}if(rr(o)){for(var M="<"+Qt.call(String(o.nodeName)),I=o.attributes||[],N=0;N<I.length;N++)M+=" "+I[N].name+"="+jt(Wn(I[N].value),"double",t);return M+=">",o.childNodes&&o.childNodes.length&&(M+="..."),M+="</"+Qt.call(String(o.nodeName))+">",M}if(ft(o)){if(o.length===0)return "[]";var k=qe(o,n);return a&&!ir(k)?"["+dt(k,a)+"]":"[ "+we.call(k,", ")+" ]"}if(Gn(o)){var P=qe(o,n);return !("cause"in Error.prototype)&&"cause"in o&&!Jt.call(o,"cause")?"{ ["+String(o)+"] "+we.call($t.call("[cause]: "+n(o.cause),P),", ")+" }":P.length===0?"["+String(o)+"]":"{ ["+String(o)+"] "+we.call(P,", ")+" }"}if(typeof o=="object"&&g){if(qt&&typeof o[qt]=="function"&&ut)return ut(o,{depth:r-l});if(g!=="symbol"&&typeof o.inspect=="function")return o.inspect()}if(Zn(o)){var R=[];return Nt&&Nt.call(o,function(b,A){R.push(n(A,o,true)+" => "+n(b,o));}),Xt("Map",Ke.call(o),R,a)}if(tr(o)){var h=[];return Bt&&Bt.call(o,function(b){h.push(n(b,o));}),Xt("Set",Xe.call(o),h,a)}if(jn(o))return st("WeakMap");if(nr(o))return st("WeakSet");if(er(o))return st("WeakRef");if(qn(o))return Fe(n(Number(o)));if(Xn(o))return Fe(n(ct.call(o)));if(Kn(o))return Fe(Fn.call(o));if(Vn(o))return Fe(n(String(o)));if(typeof globalThis.window<"u"&&o===globalThis.window)return "{ [object Window] }";if(typeof globalThis<"u"&&o===globalThis||typeof global<"u"&&o===global)return "{ [object globalThis] }";if(!zn(o)&&!Kt(o)){var x=qe(o,n),f=zt?zt(o)===Object.prototype:o instanceof Object||o.constructor===Object,u=o instanceof Object?"":"null prototype",_=!f&&Be&&Object(o)===o&&Be in o?gt.call(Se(o),8,-1):u?"Object":"",s=f||typeof o.constructor!="function"?"":o.constructor.name?o.constructor.name+" ":"",w=s+(_||u?"["+we.call($t.call([],_||[],u||[]),": ")+"] ":"");return x.length===0?w+"{}":a?w+"{"+dt(x,a)+"}":w+"{ "+we.call(x,", ")+" }"}return String(o)};function jt(i,o,S){var l=S.quoteStyle||o,e=Zt[l];return e+i+e}function Wn(i){return Ee.call(String(i),/"/g,""")}function Oe(i){return !Be||!(typeof i=="object"&&(Be in i||typeof i[Be]<"u"))}function ft(i){return Se(i)==="[object Array]"&&Oe(i)}function zn(i){return Se(i)==="[object Date]"&&Oe(i)}function Kt(i){return Se(i)==="[object RegExp]"&&Oe(i)}function Gn(i){return Se(i)==="[object Error]"&&Oe(i)}function Vn(i){return Se(i)==="[object String]"&&Oe(i)}function qn(i){return Se(i)==="[object Number]"&&Oe(i)}function Kn(i){return Se(i)==="[object Boolean]"&&Oe(i)}function en(i){if(Pe)return i&&typeof i=="object"&&i instanceof Symbol;if(typeof i=="symbol")return true;if(!i||typeof i!="object"||!lt)return false;try{return lt.call(i),!0}catch{}return false}function Xn(i){if(!i||typeof i!="object"||!ct)return false;try{return ct.call(i),!0}catch{}return false}var Yn=Object.prototype.hasOwnProperty||function(i){return i in this};function ve(i,o){return Yn.call(i,o)}function Se(i){return kn.call(i)}function Jn(i){if(i.name)return i.name;var o=Bn.call(Nn.call(i),/^function\s*([\w$]+)/);return o?o[1]:null}function tn(i,o){if(i.indexOf)return i.indexOf(o);for(var S=0,l=i.length;S<l;S++)if(i[S]===o)return S;return -1}function Zn(i){if(!Ke||!i||typeof i!="object")return false;try{Ke.call(i);try{Xe.call(i);}catch{return !0}return i instanceof Map}catch{}return false}function jn(i){if(!ke||!i||typeof i!="object")return false;try{ke.call(i,ke);try{Ne.call(i,Ne);}catch{return !0}return i instanceof WeakMap}catch{}return false}function er(i){if(!Ht||!i||typeof i!="object")return false;try{return Ht.call(i),!0}catch{}return false}function tr(i){if(!Xe||!i||typeof i!="object")return false;try{Xe.call(i);try{Ke.call(i);}catch{return !0}return i instanceof Set}catch{}return false}function nr(i){if(!Ne||!i||typeof i!="object")return false;try{Ne.call(i,Ne);try{ke.call(i,ke);}catch{return !0}return i instanceof WeakSet}catch{}return false}function rr(i){return !i||typeof i!="object"?false:typeof HTMLElement<"u"&&i instanceof HTMLElement?true:typeof i.nodeName=="string"&&typeof i.getAttribute=="function"}function nn(i,o){if(i.length>o.maxStringLength){var S=i.length-o.maxStringLength,l="... "+S+" more character"+(S>1?"s":"");return nn(gt.call(i,0,o.maxStringLength),o)+l}var e=$n[o.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(i,e,"\\$1"),/[\x00-\x1f]/g,or);return jt(t,"single",o)}function or(i){var o=i.charCodeAt(0),S={8:"b",9:"t",10:"n",12:"f",13:"r"}[o];return S?"\\"+S:"\\x"+(o<16?"0":"")+Hn.call(o.toString(16))}function Fe(i){return "Object("+i+")"}function st(i){return i+" { ? }"}function Xt(i,o,S,l){var e=l?dt(S,l):we.call(S,", ");return i+" ("+o+") {"+e+"}"}function ir(i){for(var o=0;o<i.length;o++)if(tn(i[o],`
|
|
3
|
-
`)>=0)return false;return true}function
|
|
4
|
-
`+
|
|
5
|
-
`+o.prev}function qe(i,o){var S=ft(i),l=[];if(S){l.length=i.length;for(var e=0;e<i.length;e++)l[e]=ve(i,e)?o(i[e],i):"";}var t=typeof at=="function"?at(i):[],g;if(Pe){g={};for(var c=0;c<t.length;c++)g["$"+t[c]]=t[c];}for(var y in i)ve(i,y)&&(S&&String(Number(y))===y&&y<i.length||Pe&&g["$"+y]instanceof Symbol||(Yt.call(/[^\w$]/,y)?l.push(o(y,i)+": "+o(i[y],i)):l.push(y+": "+o(i[y],i))));if(typeof at=="function")for(var E=0;E<t.length;E++)Jt.call(i,t[E])&&l.push("["+o(t[E])+"]: "+o(i[t[E]],i));return l}});function Tn(i,o){return o.forEach((function(S){S&&typeof S!="string"&&!Array.isArray(S)&&Object.keys(S).forEach((function(l){if(l!=="default"&&!(l in i)){var e=Object.getOwnPropertyDescriptor(S,l);Object.defineProperty(i,l,e.get?e:{enumerable:true,get:function(){return S[l]}});}}));})),Object.freeze(i)}function Tt(i,o){return new Promise((function(S,l){let e;return In(i).then((function(t){try{return e=t,S(new Blob([o.slice(0,2),e,o.slice(2)],{type:"image/jpeg"}))}catch(g){return l(g)}}),l)}))}var In=i=>new Promise(((o,S)=>{let l=new globalThis.FileReader;l.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),g=0;if(t.getUint16(g)!==65496)return S("not a valid JPEG");for(g+=2;;){let c=t.getUint16(g);if(c===65498)break;let y=t.getUint16(g+2);if(c===65505&&t.getUint32(g+4)===1165519206){let E=g+10,r;switch(t.getUint16(E)){case 18761:r=true;break;case 19789:r=false;break;default:return S("TIFF header contains invalid endian")}if(t.getUint16(E+2,r)!==42)return S("TIFF header contains invalid version");let a=t.getUint32(E+4,r),n=E+a+2+12*t.getUint16(E+a,r);for(let d=E+a+2;d<n;d+=12)if(t.getUint16(d,r)==274){if(t.getUint16(d+2,r)!==3)return S("Orientation data type is invalid");if(t.getUint32(d+4,r)!==1)return S("Orientation data count is invalid");t.setUint16(d+8,1,r);break}return o(e.slice(g,g+2+y))}g+=2+y;}return o(new Blob)})),l.readAsArrayBuffer(i);})),$e={},Rn={get exports(){return $e},set exports(i){$e=i;}};(function(i){var o,S,l={};Rn.exports=l,l.parse=function(e,t){for(var g=l.bin.readUshort,c=l.bin.readUint,y=0,E={},r=new Uint8Array(e),a=r.length-4;c(r,a)!=101010256;)a--;y=a,y+=4;var n=g(r,y+=4);g(r,y+=2);var d=c(r,y+=2),v=c(r,y+=4);y+=4,y=v;for(var C=0;C<n;C++){c(r,y),y+=4,y+=4,y+=4,c(r,y+=4),d=c(r,y+=4);var M=c(r,y+=4),I=g(r,y+=4),N=g(r,y+2),k=g(r,y+4);y+=6;var P=c(r,y+=8);y+=4,y+=I+N+k,l._readLocal(r,P,E,d,M,t);}return E},l._readLocal=function(e,t,g,c,y,E){var r=l.bin.readUshort,a=l.bin.readUint;a(e,t),r(e,t+=4),r(e,t+=2);var n=r(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var d=r(e,t+=8),v=r(e,t+=2);t+=2;var C=l.bin.readUTF8(e,t,d);if(t+=d,t+=v,E)g[C]={size:y,csize:c};else {var M=new Uint8Array(e.buffer,t);if(n==0)g[C]=new Uint8Array(M.buffer.slice(t,t+c));else {if(n!=8)throw "unknown compression method: "+n;var I=new Uint8Array(y);l.inflateRaw(M,I),g[C]=I;}}},l.inflateRaw=function(e,t){return l.F.inflate(e,t)},l.inflate=function(e,t){return e[0],e[1],l.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},l.deflate=function(e,t){t==null&&(t={level:6});var g=0,c=new Uint8Array(50+Math.floor(1.1*e.length));c[g]=120,c[g+1]=156,g+=2,g=l.F.deflateRaw(e,c,g,t.level);var y=l.adler(e,0,e.length);return c[g+0]=y>>>24&255,c[g+1]=y>>>16&255,c[g+2]=y>>>8&255,c[g+3]=y>>>0&255,new Uint8Array(c.buffer,0,g+4)},l.deflateRaw=function(e,t){t==null&&(t={level:6});var g=new Uint8Array(50+Math.floor(1.1*e.length)),c=l.F.deflateRaw(e,g,c,t.level);return new Uint8Array(g.buffer,0,c)},l.encode=function(e,t){t==null&&(t=false);var g=0,c=l.bin.writeUint,y=l.bin.writeUshort,E={};for(var r in e){var a=!l._noNeed(r)&&!t,n=e[r],d=l.crc.crc(n,0,n.length);E[r]={cpr:a,usize:n.length,crc:d,file:a?l.deflateRaw(n):n};}for(var r in E)g+=E[r].file.length+30+46+2*l.bin.sizeUTF8(r);g+=22;var v=new Uint8Array(g),C=0,M=[];for(var r in E){var I=E[r];M.push(C),C=l._writeHeader(v,C,r,I,0);}var N=0,k=C;for(var r in E)I=E[r],M.push(C),C=l._writeHeader(v,C,r,I,1,M[N++]);var P=C-k;return c(v,C,101010256),C+=4,y(v,C+=4,N),y(v,C+=2,N),c(v,C+=2,P),c(v,C+=4,k),C+=4,C+=2,v.buffer},l._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},l._writeHeader=function(e,t,g,c,y,E){var r=l.bin.writeUint,a=l.bin.writeUshort,n=c.file;return r(e,t,y==0?67324752:33639248),t+=4,y==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,c.cpr?8:0),r(e,t+=2,0),r(e,t+=4,c.crc),r(e,t+=4,n.length),r(e,t+=4,c.usize),a(e,t+=4,l.bin.sizeUTF8(g)),a(e,t+=2,0),t+=2,y==1&&(t+=2,t+=2,r(e,t+=6,E),t+=4),t+=l.bin.writeUTF8(e,t,g),y==0&&(e.set(n,t),t+=n.length),t},l.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var g=t,c=0;c<8;c++)1&g?g=3988292384^g>>>1:g>>>=1;e[t]=g;}return e})(),update:function(e,t,g,c){for(var y=0;y<c;y++)e=l.crc.table[255&(e^t[g+y])]^e>>>8;return e},crc:function(e,t,g){return 4294967295^l.crc.update(4294967295,e,t,g)}},l.adler=function(e,t,g){for(var c=1,y=0,E=t,r=t+g;E<r;){for(var a=Math.min(E+5552,r);E<a;)y+=c+=e[E++];c%=65521,y%=65521;}return y<<16|c},l.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,g){e[t]=255&g,e[t+1]=g>>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,g){e[t]=255&g,e[t+1]=g>>8&255,e[t+2]=g>>16&255,e[t+3]=g>>24&255;},readASCII:function(e,t,g){for(var c="",y=0;y<g;y++)c+=String.fromCharCode(e[t+y]);return c},writeASCII:function(e,t,g){for(var c=0;c<g.length;c++)e[t+c]=g.charCodeAt(c);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,g){for(var c,y="",E=0;E<g;E++)y+="%"+l.bin.pad(e[t+E].toString(16));try{c=decodeURIComponent(y);}catch{return l.bin.readASCII(e,t,g)}return c},writeUTF8:function(e,t,g){for(var c=g.length,y=0,E=0;E<c;E++){var r=g.charCodeAt(E);if((4294967168&r)==0)e[t+y]=r,y++;else if((4294965248&r)==0)e[t+y]=192|r>>6,e[t+y+1]=128|r>>0&63,y+=2;else if((4294901760&r)==0)e[t+y]=224|r>>12,e[t+y+1]=128|r>>6&63,e[t+y+2]=128|r>>0&63,y+=3;else {if((4292870144&r)!=0)throw "e";e[t+y]=240|r>>18,e[t+y+1]=128|r>>12&63,e[t+y+2]=128|r>>6&63,e[t+y+3]=128|r>>0&63,y+=4;}}return y},sizeUTF8:function(e){for(var t=e.length,g=0,c=0;c<t;c++){var y=e.charCodeAt(c);if((4294967168&y)==0)g++;else if((4294965248&y)==0)g+=2;else if((4294901760&y)==0)g+=3;else {if((4292870144&y)!=0)throw "e";g+=4;}}return g}},l.F={},l.F.deflateRaw=function(e,t,g,c){var y=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][c],E=l.F.U,r=l.F._goodIndex;l.F._hash;var a=l.F._putsE,n=0,d=g<<3,v=0,C=e.length;if(c==0){for(;n<C;)a(t,d,n+(s=Math.min(65535,C-n))==C?1:0),d=l.F._copyExact(e,n,s,t,d+8),n+=s;return d>>>3}var M=E.lits,I=E.strt,N=E.prev,k=0,P=0,R=0,h=0,x=0,f=0;for(C>2&&(I[f=l.F._hash(e,0)]=0),n=0;n<C;n++){if(x=f,n+1<C-2){f=l.F._hash(e,n+1);var u=n+1&32767;N[u]=I[f],I[f]=u;}if(v<=n){(k>14e3||P>26697)&&C-n>100&&(v<n&&(M[k]=n-v,k+=2,v=n),d=l.F._writeBlock(n==C-1||v==C?1:0,M,k,h,e,R,n-R,t,d),k=P=h=0,R=n);var _=0;n<C-2&&(_=l.F._bestMatch(e,n,N,x,Math.min(y[2],C-n),y[3]));var s=_>>>16,w=65535&_;if(_!=0){w=65535&_;var b=r(s=_>>>16,E.of0);E.lhst[257+b]++;var A=r(w,E.df0);E.dhst[A]++,h+=E.exb[b]+E.dxb[A],M[k]=s<<23|n-v,M[k+1]=w<<16|b<<8|A,k+=2,v=n+s;}else E.lhst[e[n]]++;P++;}}for(R==n&&e.length!=0||(v<n&&(M[k]=n-v,k+=2,v=n),d=l.F._writeBlock(1,M,k,h,e,R,n-R,t,d),k=0,P=0,k=P=h=0,R=n);(7&d)!=0;)d++;return d>>>3},l.F._bestMatch=function(e,t,g,c,y,E){var r=32767&t,a=g[r],n=r-a+32768&32767;if(a==r||c!=l.F._hash(e,t-n))return 0;for(var d=0,v=0,C=Math.min(32767,t);n<=C&&--E!=0&&a!=r;){if(d==0||e[t+d]==e[t+d-n]){var M=l.F._howLong(e,t,n);if(M>d){if(v=n,(d=M)>=y)break;n+2<M&&(M=n+2);for(var I=0,N=0;N<M-2;N++){var k=t-n+N+32768&32767,P=k-g[k]+32768&32767;P>I&&(I=P,a=k);}}}n+=(r=a)-(a=g[r])+32768&32767;}return d<<16|v},l.F._howLong=function(e,t,g){if(e[t]!=e[t-g]||e[t+1]!=e[t+1-g]||e[t+2]!=e[t+2-g])return 0;var c=t,y=Math.min(e.length,t+258);for(t+=3;t<y&&e[t]==e[t-g];)t++;return t-c},l.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},l.saved=0,l.F._writeBlock=function(e,t,g,c,y,E,r,a,n){var d,v,C,M,I,N,k,P,R,h=l.F.U,x=l.F._putsF,f=l.F._putsE;h.lhst[256]++,v=(d=l.F.getTrees())[0],C=d[1],M=d[2],I=d[3],N=d[4],k=d[5],P=d[6],R=d[7];var u=32+((n+3&7)==0?0:8-(n+3&7))+(r<<3),_=c+l.F.contSize(h.fltree,h.lhst)+l.F.contSize(h.fdtree,h.dhst),s=c+l.F.contSize(h.ltree,h.lhst)+l.F.contSize(h.dtree,h.dhst);s+=14+3*k+l.F.contSize(h.itree,h.ihst)+(2*h.ihst[16]+3*h.ihst[17]+7*h.ihst[18]);for(var w=0;w<286;w++)h.lhst[w]=0;for(w=0;w<30;w++)h.dhst[w]=0;for(w=0;w<19;w++)h.ihst[w]=0;var b=u<_&&u<s?0:_<s?1:2;if(x(a,n,e),x(a,n+1,b),n+=3,b==0){for(;(7&n)!=0;)n++;n=l.F._copyExact(y,E,r,a,n);}else {var A,T;if(b==1&&(A=h.fltree,T=h.fdtree),b==2){l.F.makeCodes(h.ltree,v),l.F.revCodes(h.ltree,v),l.F.makeCodes(h.dtree,C),l.F.revCodes(h.dtree,C),l.F.makeCodes(h.itree,M),l.F.revCodes(h.itree,M),A=h.ltree,T=h.dtree,f(a,n,I-257),f(a,n+=5,N-1),f(a,n+=5,k-4),n+=4;for(var m=0;m<k;m++)f(a,n+3*m,h.itree[1+(h.ordr[m]<<1)]);n+=3*k,n=l.F._codeTiny(P,h.itree,a,n),n=l.F._codeTiny(R,h.itree,a,n);}for(var p=E,L=0;L<g;L+=2){for(var O=t[L],U=O>>>23,H=p+(8388607&O);p<H;)n=l.F._writeLit(y[p++],A,a,n);if(U!=0){var D=t[L+1],Q=D>>16,B=D>>8&255,F=255&D;f(a,n=l.F._writeLit(257+B,A,a,n),U-h.of0[B]),n+=h.exb[B],x(a,n=l.F._writeLit(F,T,a,n),Q-h.df0[F]),n+=h.dxb[F],p+=U;}}n=l.F._writeLit(256,A,a,n);}return n},l.F._copyExact=function(e,t,g,c,y){var E=y>>>3;return c[E]=g,c[E+1]=g>>>8,c[E+2]=255-c[E],c[E+3]=255-c[E+1],E+=4,c.set(new Uint8Array(e.buffer,t,g),E),y+(g+4<<3)},l.F.getTrees=function(){for(var e=l.F.U,t=l.F._hufTree(e.lhst,e.ltree,15),g=l.F._hufTree(e.dhst,e.dtree,15),c=[],y=l.F._lenCodes(e.ltree,c),E=[],r=l.F._lenCodes(e.dtree,E),a=0;a<c.length;a+=2)e.ihst[c[a]]++;for(a=0;a<E.length;a+=2)e.ihst[E[a]]++;for(var n=l.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[1+(e.ordr[d-1]<<1)]==0;)d--;return [t,g,n,y,r,d,c,E]},l.F.getSecond=function(e){for(var t=[],g=0;g<e.length;g+=2)t.push(e[g+1]);return t},l.F.nonZero=function(e){for(var t="",g=0;g<e.length;g+=2)e[g+1]!=0&&(t+=(g>>1)+",");return t},l.F.contSize=function(e,t){for(var g=0,c=0;c<t.length;c++)g+=t[c]*e[1+(c<<1)];return g},l.F._codeTiny=function(e,t,g,c){for(var y=0;y<e.length;y+=2){var E=e[y],r=e[y+1];c=l.F._writeLit(E,t,g,c);var a=E==16?2:E==17?3:7;E>15&&(l.F._putsE(g,c,r,a),c+=a);}return c},l.F._lenCodes=function(e,t){for(var g=e.length;g!=2&&e[g-1]==0;)g-=2;for(var c=0;c<g;c+=2){var y=e[c+1],E=c+3<g?e[c+3]:-1,r=c+5<g?e[c+5]:-1,a=c==0?-1:e[c-1];if(y==0&&E==y&&r==y){for(var n=c+5;n+2<g&&e[n+2]==y;)n+=2;(d=Math.min(n+1-c>>>1,138))<11?t.push(17,d-3):t.push(18,d-11),c+=2*d-2;}else if(y==a&&E==y&&r==y){for(n=c+5;n+2<g&&e[n+2]==y;)n+=2;var d=Math.min(n+1-c>>>1,6);t.push(16,d-3),c+=2*d-2;}else t.push(y,0);}return g>>>1},l.F._hufTree=function(e,t,g){var c=[],y=e.length,E=t.length,r=0;for(r=0;r<E;r+=2)t[r]=0,t[r+1]=0;for(r=0;r<y;r++)e[r]!=0&&c.push({lit:r,f:e[r]});var a=c.length,n=c.slice(0);if(a==0)return 0;if(a==1){var d=c[0].lit;return n=d==0?1:0,t[1+(d<<1)]=1,t[1+(n<<1)]=1,1}c.sort((function(P,R){return P.f-R.f}));var v=c[0],C=c[1],M=0,I=1,N=2;for(c[0]={lit:-1,f:v.f+C.f,l:v,r:C,d:0};I!=a-1;)v=M!=I&&(N==a||c[M].f<c[N].f)?c[M++]:c[N++],C=M!=I&&(N==a||c[M].f<c[N].f)?c[M++]:c[N++],c[I++]={lit:-1,f:v.f+C.f,l:v,r:C};var k=l.F.setDepth(c[I-1],0);for(k>g&&(l.F.restrictDepth(n,g,k),k=g),r=0;r<a;r++)t[1+(n[r].lit<<1)]=n[r].d;return k},l.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(l.F.setDepth(e.l,t+1),l.F.setDepth(e.r,t+1))},l.F.restrictDepth=function(e,t,g){var c=0,y=1<<g-t,E=0;for(e.sort((function(a,n){return n.d==a.d?a.f-n.f:n.d-a.d})),c=0;c<e.length&&e[c].d>t;c++){var r=e[c].d;e[c].d=t,E+=y-(1<<g-r);}for(E>>>=g-t;E>0;)(r=e[c].d)<t?(e[c].d++,E-=1<<t-r-1):c++;for(;c>=0;c--)e[c].d==t&&E<0&&(e[c].d--,E++);E!=0&&console.log("debt left");},l.F._goodIndex=function(e,t){var g=0;return t[16|g]<=e&&(g|=16),t[8|g]<=e&&(g|=8),t[4|g]<=e&&(g|=4),t[2|g]<=e&&(g|=2),t[1|g]<=e&&(g|=1),g},l.F._writeLit=function(e,t,g,c){return l.F._putsF(g,c,t[e<<1]),c+t[1+(e<<1)]},l.F.inflate=function(e,t){var g=Uint8Array;if(e[0]==3&&e[1]==0)return t||new g(0);var c=l.F,y=c._bitsF,E=c._bitsE,r=c._decodeTiny,a=c.makeCodes,n=c.codes2map,d=c._get17,v=c.U,C=t==null;C&&(t=new g(e.length>>>2<<3));for(var M,I,N=0,k=0,P=0,R=0,h=0,x=0,f=0,u=0,_=0;N==0;)if(N=y(e,_,1),k=y(e,_+1,2),_+=3,k!=0){if(C&&(t=l.F._check(t,u+(1<<17))),k==1&&(M=v.flmap,I=v.fdmap,x=511,f=31),k==2){P=E(e,_,5)+257,R=E(e,_+5,5)+1,h=E(e,_+10,4)+4,_+=14;for(var s=0;s<38;s+=2)v.itree[s]=0,v.itree[s+1]=0;var w=1;for(s=0;s<h;s++){var b=E(e,_+3*s,3);v.itree[1+(v.ordr[s]<<1)]=b,b>w&&(w=b);}_+=3*h,a(v.itree,w),n(v.itree,w,v.imap),M=v.lmap,I=v.dmap,_=r(v.imap,(1<<w)-1,P+R,e,_,v.ttree);var A=c._copyOut(v.ttree,0,P,v.ltree);x=(1<<A)-1;var T=c._copyOut(v.ttree,P,R,v.dtree);f=(1<<T)-1,a(v.ltree,A),n(v.ltree,A,M),a(v.dtree,T),n(v.dtree,T,I);}for(;;){var m=M[d(e,_)&x];_+=15&m;var p=m>>>4;if(!(p>>>8))t[u++]=p;else {if(p==256)break;var L=u+p-254;if(p>264){var O=v.ldef[p-257];L=u+(O>>>3)+E(e,_,7&O),_+=7&O;}var U=I[d(e,_)&f];_+=15&U;var H=U>>>4,D=v.ddef[H],Q=(D>>>4)+y(e,_,15&D);for(_+=15&D,C&&(t=l.F._check(t,u+(1<<17)));u<L;)t[u]=t[u++-Q],t[u]=t[u++-Q],t[u]=t[u++-Q],t[u]=t[u++-Q];u=L;}}}else {(7&_)!=0&&(_+=8-(7&_));var B=4+(_>>>3),F=e[B-4]|e[B-3]<<8;C&&(t=l.F._check(t,u+F)),t.set(new g(e.buffer,e.byteOffset+B,F),u),_=B+F<<3,u+=F;}return t.length==u?t:t.slice(0,u)},l.F._check=function(e,t){var g=e.length;if(t<=g)return e;var c=new Uint8Array(Math.max(g<<1,t));return c.set(e,0),c},l.F._decodeTiny=function(e,t,g,c,y,E){for(var r=l.F._bitsE,a=l.F._get17,n=0;n<g;){var d=e[a(c,y)&t];y+=15&d;var v=d>>>4;if(v<=15)E[n]=v,n++;else {var C=0,M=0;v==16?(M=3+r(c,y,2),y+=2,C=E[n-1]):v==17?(M=3+r(c,y,3),y+=3):v==18&&(M=11+r(c,y,7),y+=7);for(var I=n+M;n<I;)E[n]=C,n++;}}return y},l.F._copyOut=function(e,t,g,c){for(var y=0,E=0,r=c.length>>>1;E<g;){var a=e[E+t];c[E<<1]=0,c[1+(E<<1)]=a,a>y&&(y=a),E++;}for(;E<r;)c[E<<1]=0,c[1+(E<<1)]=0,E++;return y},l.F.makeCodes=function(e,t){for(var g,c,y,E,r=l.F.U,a=e.length,n=r.bl_count,d=0;d<=t;d++)n[d]=0;for(d=1;d<a;d+=2)n[e[d]]++;var v=r.next_code;for(g=0,n[0]=0,c=1;c<=t;c++)g=g+n[c-1]<<1,v[c]=g;for(y=0;y<a;y+=2)(E=e[y+1])!=0&&(e[y]=v[E],v[E]++);},l.F.codes2map=function(e,t,g){for(var c=e.length,y=l.F.U.rev15,E=0;E<c;E+=2)if(e[E+1]!=0)for(var r=E>>1,a=e[E+1],n=r<<4|a,d=t-a,v=e[E]<<d,C=v+(1<<d);v!=C;)g[y[v]>>>15-t]=n,v++;},l.F.revCodes=function(e,t){for(var g=l.F.U.rev15,c=15-t,y=0;y<e.length;y+=2){var E=e[y]<<t-e[y+1];e[y]=g[E]>>>c;}},l.F._putsE=function(e,t,g){g<<=7&t;var c=t>>>3;e[c]|=g,e[c+1]|=g>>>8;},l.F._putsF=function(e,t,g){g<<=7&t;var c=t>>>3;e[c]|=g,e[c+1]|=g>>>8,e[c+2]|=g>>>16;},l.F._bitsE=function(e,t,g){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<g)-1},l.F._bitsF=function(e,t,g){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<g)-1},l.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},l.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)},l.F.U=(o=Uint16Array,S=Uint32Array,{next_code:new o(16),bl_count:new o(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 o(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 S(32),flmap:new o(512),fltree:[],fdmap:new o(32),fdtree:[],lmap:new o(32768),ltree:[],ttree:[],dmap:new o(32768),dtree:[],imap:new o(512),itree:[],rev15:new o(32768),lhst:new S(286),dhst:new S(30),ihst:new S(19),lits:new S(15e3),strt:new o(65536),prev:new o(32768)}),(function(){for(var e=l.F.U,t=0;t<32768;t++){var g=t;g=(4278255360&(g=(4042322160&(g=(3435973836&(g=(2863311530&g)>>>1|(1431655765&g)<<1))>>>2|(858993459&g)<<2))>>>4|(252645135&g)<<4))>>>8|(16711935&g)<<8,e.rev15[t]=(g>>>16|g<<16)>>>17;}function c(y,E,r){for(;E--!=0;)y.push(0,r);}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];c(e.fltree,144,8),c(e.fltree,112,9),c(e.fltree,24,7),c(e.fltree,8,8),l.F.makeCodes(e.fltree,9),l.F.codes2map(e.fltree,9,e.flmap),l.F.revCodes(e.fltree,9),c(e.fdtree,32,5),l.F.makeCodes(e.fdtree,5),l.F.codes2map(e.fdtree,5,e.fdmap),l.F.revCodes(e.fdtree,5),c(e.itree,19,0),c(e.ltree,286,0),c(e.dtree,30,0),c(e.ttree,320,0);})();})();var Cn=Tn({__proto__:null,default:$e},[$e]),pe=(function(){var i={nextZero(r,a){for(;r[a]!=0;)a++;return a},readUshort:(r,a)=>r[a]<<8|r[a+1],writeUshort(r,a,n){r[a]=n>>8&255,r[a+1]=255&n;},readUint:(r,a)=>16777216*r[a]+(r[a+1]<<16|r[a+2]<<8|r[a+3]),writeUint(r,a,n){r[a]=n>>24&255,r[a+1]=n>>16&255,r[a+2]=n>>8&255,r[a+3]=255&n;},readASCII(r,a,n){let d="";for(let v=0;v<n;v++)d+=String.fromCharCode(r[a+v]);return d},writeASCII(r,a,n){for(let d=0;d<n.length;d++)r[a+d]=n.charCodeAt(d);},readBytes(r,a,n){let d=[];for(let v=0;v<n;v++)d.push(r[a+v]);return d},pad:r=>r.length<2?`0${r}`:r,readUTF8(r,a,n){let d,v="";for(let C=0;C<n;C++)v+=`%${i.pad(r[a+C].toString(16))}`;try{d=decodeURIComponent(v);}catch{return i.readASCII(r,a,n)}return d}};function o(r,a,n,d){let v=a*n,C=t(d),M=Math.ceil(a*C/8),I=new Uint8Array(4*v),N=new Uint32Array(I.buffer),{ctype:k}=d,{depth:P}=d,R=i.readUshort;if(k==6){let O=v<<2;if(P==8)for(var h=0;h<O;h+=4)I[h]=r[h],I[h+1]=r[h+1],I[h+2]=r[h+2],I[h+3]=r[h+3];if(P==16)for(h=0;h<O;h++)I[h]=r[h<<1];}else if(k==2){let O=d.tabs.tRNS;if(O==null){if(P==8)for(h=0;h<v;h++){var x=3*h;N[h]=255<<24|r[x+2]<<16|r[x+1]<<8|r[x];}if(P==16)for(h=0;h<v;h++)x=6*h,N[h]=255<<24|r[x+4]<<16|r[x+2]<<8|r[x];}else {var f=O[0];let U=O[1],H=O[2];if(P==8)for(h=0;h<v;h++){var u=h<<2;x=3*h,N[h]=255<<24|r[x+2]<<16|r[x+1]<<8|r[x],r[x]==f&&r[x+1]==U&&r[x+2]==H&&(I[u+3]=0);}if(P==16)for(h=0;h<v;h++)u=h<<2,x=6*h,N[h]=255<<24|r[x+4]<<16|r[x+2]<<8|r[x],R(r,x)==f&&R(r,x+2)==U&&R(r,x+4)==H&&(I[u+3]=0);}}else if(k==3){let O=d.tabs.PLTE,U=d.tabs.tRNS,H=U?U.length:0;if(P==1)for(var _=0;_<n;_++){var s=_*M,w=_*a;for(h=0;h<a;h++){u=w+h<<2;var b=3*(A=r[s+(h>>3)]>>7-((7&h)<<0)&1);I[u]=O[b],I[u+1]=O[b+1],I[u+2]=O[b+2],I[u+3]=A<H?U[A]:255;}}if(P==2)for(_=0;_<n;_++)for(s=_*M,w=_*a,h=0;h<a;h++)u=w+h<<2,b=3*(A=r[s+(h>>2)]>>6-((3&h)<<1)&3),I[u]=O[b],I[u+1]=O[b+1],I[u+2]=O[b+2],I[u+3]=A<H?U[A]:255;if(P==4)for(_=0;_<n;_++)for(s=_*M,w=_*a,h=0;h<a;h++)u=w+h<<2,b=3*(A=r[s+(h>>1)]>>4-((1&h)<<2)&15),I[u]=O[b],I[u+1]=O[b+1],I[u+2]=O[b+2],I[u+3]=A<H?U[A]:255;if(P==8)for(h=0;h<v;h++){var A;u=h<<2,b=3*(A=r[h]),I[u]=O[b],I[u+1]=O[b+1],I[u+2]=O[b+2],I[u+3]=A<H?U[A]:255;}}else if(k==4){if(P==8)for(h=0;h<v;h++){u=h<<2;var T=r[m=h<<1];I[u]=T,I[u+1]=T,I[u+2]=T,I[u+3]=r[m+1];}if(P==16)for(h=0;h<v;h++){var m;u=h<<2,T=r[m=h<<2],I[u]=T,I[u+1]=T,I[u+2]=T,I[u+3]=r[m+2];}}else if(k==0)for(f=d.tabs.tRNS?d.tabs.tRNS:-1,_=0;_<n;_++){let O=_*M,U=_*a;if(P==1)for(var p=0;p<a;p++){var L=(T=255*(r[O+(p>>>3)]>>>7-(7&p)&1))==255*f?0:255;N[U+p]=L<<24|T<<16|T<<8|T;}else if(P==2)for(p=0;p<a;p++)L=(T=85*(r[O+(p>>>2)]>>>6-((3&p)<<1)&3))==85*f?0:255,N[U+p]=L<<24|T<<16|T<<8|T;else if(P==4)for(p=0;p<a;p++)L=(T=17*(r[O+(p>>>1)]>>>4-((1&p)<<2)&15))==17*f?0:255,N[U+p]=L<<24|T<<16|T<<8|T;else if(P==8)for(p=0;p<a;p++)L=(T=r[O+p])==f?0:255,N[U+p]=L<<24|T<<16|T<<8|T;else if(P==16)for(p=0;p<a;p++)T=r[O+(p<<1)],L=R(r,O+(p<<1))==f?0:255,N[U+p]=L<<24|T<<16|T<<8|T;}return I}function S(r,a,n,d){let v=t(r),C=Math.ceil(n*v/8),M=new Uint8Array((C+1+r.interlace)*d);return a=r.tabs.CgBI?e(a,M):l(a,M),r.interlace==0?a=g(a,r,0,n,d):r.interlace==1&&(a=(function(N,k){let P=k.width,R=k.height,h=t(k),x=h>>3,f=Math.ceil(P*h/8),u=new Uint8Array(R*f),_=0,s=[0,0,4,0,2,0,1],w=[0,4,0,2,0,1,0],b=[8,8,8,4,4,2,2],A=[8,8,4,4,2,2,1],T=0;for(;T<7;){let p=b[T],L=A[T],O=0,U=0,H=s[T];for(;H<R;)H+=p,U++;let D=w[T];for(;D<P;)D+=L,O++;let Q=Math.ceil(O*h/8);g(N,k,_,O,U);let B=0,F=s[T];for(;F<R;){let $=w[T],K=_+B*Q<<3;for(;$<P;){var m;if(h==1&&(m=(m=N[K>>3])>>7-(7&K)&1,u[F*f+($>>3)]|=m<<7-((7&$)<<0)),h==2&&(m=(m=N[K>>3])>>6-(7&K)&3,u[F*f+($>>2)]|=m<<6-((3&$)<<1)),h==4&&(m=(m=N[K>>3])>>4-(7&K)&15,u[F*f+($>>1)]|=m<<4-((1&$)<<2)),h>=8){let V=F*f+$*x;for(let z=0;z<x;z++)u[V+z]=N[(K>>3)+z];}K+=h,$+=L;}B++,F+=p;}O*U!=0&&(_+=U*(1+Q)),T+=1;}return u})(a,r)),a}function l(r,a){return e(new Uint8Array(r.buffer,2,r.length-6),a)}var e=(function(){let r={H:{}};return r.H.N=function(a,n){let d=Uint8Array,v,C,M=0,I=0,N=0,k=0,P=0,R=0,h=0,x=0,f=0;if(a[0]==3&&a[1]==0)return n||new d(0);let u=r.H,_=u.b,s=u.e,w=u.R,b=u.n,A=u.A,T=u.Z,m=u.m,p=n==null;for(p&&(n=new d(a.length>>>2<<5));M==0;)if(M=_(a,f,1),I=_(a,f+1,2),f+=3,I!=0){if(p&&(n=r.H.W(n,x+(1<<17))),I==1&&(v=m.J,C=m.h,R=511,h=31),I==2){N=s(a,f,5)+257,k=s(a,f+5,5)+1,P=s(a,f+10,4)+4,f+=14;let O=1;for(var L=0;L<38;L+=2)m.Q[L]=0,m.Q[L+1]=0;for(L=0;L<P;L++){let D=s(a,f+3*L,3);m.Q[1+(m.X[L]<<1)]=D,D>O&&(O=D);}f+=3*P,b(m.Q,O),A(m.Q,O,m.u),v=m.w,C=m.d,f=w(m.u,(1<<O)-1,N+k,a,f,m.v);let U=u.V(m.v,0,N,m.C);R=(1<<U)-1;let H=u.V(m.v,N,k,m.D);h=(1<<H)-1,b(m.C,U),A(m.C,U,v),b(m.D,H),A(m.D,H,C);}for(;;){let O=v[T(a,f)&R];f+=15&O;let U=O>>>4;if(!(U>>>8))n[x++]=U;else {if(U==256)break;{let H=x+U-254;if(U>264){let $=m.q[U-257];H=x+($>>>3)+s(a,f,7&$),f+=7&$;}let D=C[T(a,f)&h];f+=15&D;let Q=D>>>4,B=m.c[Q],F=(B>>>4)+_(a,f,15&B);for(f+=15&B;x<H;)n[x]=n[x++-F],n[x]=n[x++-F],n[x]=n[x++-F],n[x]=n[x++-F];x=H;}}}}else {(7&f)!=0&&(f+=8-(7&f));let O=4+(f>>>3),U=a[O-4]|a[O-3]<<8;p&&(n=r.H.W(n,x+U)),n.set(new d(a.buffer,a.byteOffset+O,U),x),f=O+U<<3,x+=U;}return n.length==x?n:n.slice(0,x)},r.H.W=function(a,n){let d=a.length;if(n<=d)return a;let v=new Uint8Array(d<<1);return v.set(a,0),v},r.H.R=function(a,n,d,v,C,M){let I=r.H.e,N=r.H.Z,k=0;for(;k<d;){let P=a[N(v,C)&n];C+=15&P;let R=P>>>4;if(R<=15)M[k]=R,k++;else {let h=0,x=0;R==16?(x=3+I(v,C,2),C+=2,h=M[k-1]):R==17?(x=3+I(v,C,3),C+=3):R==18&&(x=11+I(v,C,7),C+=7);let f=k+x;for(;k<f;)M[k]=h,k++;}}return C},r.H.V=function(a,n,d,v){let C=0,M=0,I=v.length>>>1;for(;M<d;){let N=a[M+n];v[M<<1]=0,v[1+(M<<1)]=N,N>C&&(C=N),M++;}for(;M<I;)v[M<<1]=0,v[1+(M<<1)]=0,M++;return C},r.H.n=function(a,n){let d=r.H.m,v=a.length,C,M,I,N,k=d.j;for(var P=0;P<=n;P++)k[P]=0;for(P=1;P<v;P+=2)k[a[P]]++;let R=d.K;for(C=0,k[0]=0,M=1;M<=n;M++)C=C+k[M-1]<<1,R[M]=C;for(I=0;I<v;I+=2)N=a[I+1],N!=0&&(a[I]=R[N],R[N]++);},r.H.A=function(a,n,d){let v=a.length,C=r.H.m.r;for(let M=0;M<v;M+=2)if(a[M+1]!=0){let I=M>>1,N=a[M+1],k=I<<4|N,P=n-N,R=a[M]<<P,h=R+(1<<P);for(;R!=h;)d[C[R]>>>15-n]=k,R++;}},r.H.l=function(a,n){let d=r.H.m.r,v=15-n;for(let C=0;C<a.length;C+=2){let M=a[C]<<n-a[C+1];a[C]=d[M]>>>v;}},r.H.M=function(a,n,d){d<<=7&n;let v=n>>>3;a[v]|=d,a[v+1]|=d>>>8;},r.H.I=function(a,n,d){d<<=7&n;let v=n>>>3;a[v]|=d,a[v+1]|=d>>>8,a[v+2]|=d>>>16;},r.H.e=function(a,n,d){return (a[n>>>3]|a[1+(n>>>3)]<<8)>>>(7&n)&(1<<d)-1},r.H.b=function(a,n,d){return (a[n>>>3]|a[1+(n>>>3)]<<8|a[2+(n>>>3)]<<16)>>>(7&n)&(1<<d)-1},r.H.Z=function(a,n){return (a[n>>>3]|a[1+(n>>>3)]<<8|a[2+(n>>>3)]<<16)>>>(7&n)},r.H.i=function(a,n){return (a[n>>>3]|a[1+(n>>>3)]<<8|a[2+(n>>>3)]<<16|a[3+(n>>>3)]<<24)>>>(7&n)},r.H.m=(function(){let a=Uint16Array,n=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 n(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 n(286),Y:new n(30),a:new n(19),t:new n(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=r.H.m;for(var n=0;n<32768;n++){let v=n;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[n]=(v>>>16|v<<16)>>>17;}function d(v,C,M){for(;C--!=0;)v.push(0,M);}for(n=0;n<32;n++)a.q[n]=a.S[n]<<3|a.T[n],a.c[n]=a.p[n]<<4|a.z[n];d(a._,144,8),d(a._,112,9),d(a._,24,7),d(a._,8,8),r.H.n(a._,9),r.H.A(a._,9,a.J),r.H.l(a._,9),d(a.$,32,5),r.H.n(a.$,5),r.H.A(a.$,5,a.h),r.H.l(a.$,5),d(a.Q,19,0),d(a.C,286,0),d(a.D,30,0),d(a.v,320,0);})(),r.H.N})();function t(r){return [1,null,3,1,2,null,4][r.ctype]*r.depth}function g(r,a,n,d,v){let C=t(a),M=Math.ceil(d*C/8),I,N;C=Math.ceil(C/8);let k=r[n],P=0;if(k>1&&(r[n]=[0,0,1][k-2]),k==3)for(P=C;P<M;P++)r[P+1]=r[P+1]+(r[P+1-C]>>>1)&255;for(let R=0;R<v;R++)if(I=n+R*M,N=I+R+1,k=r[N-1],P=0,k==0)for(;P<M;P++)r[I+P]=r[N+P];else if(k==1){for(;P<C;P++)r[I+P]=r[N+P];for(;P<M;P++)r[I+P]=r[N+P]+r[I+P-C];}else if(k==2)for(;P<M;P++)r[I+P]=r[N+P]+r[I+P-M];else if(k==3){for(;P<C;P++)r[I+P]=r[N+P]+(r[I+P-M]>>>1);for(;P<M;P++)r[I+P]=r[N+P]+(r[I+P-M]+r[I+P-C]>>>1);}else {for(;P<C;P++)r[I+P]=r[N+P]+c(0,r[I+P-M],0);for(;P<M;P++)r[I+P]=r[N+P]+c(r[I+P-C],r[I+P-M],r[I+P-C-M]);}return r}function c(r,a,n){let d=r+a-n,v=d-r,C=d-a,M=d-n;return v*v<=C*C&&v*v<=M*M?r:C*C<=M*M?a:n}function y(r,a,n){n.width=i.readUint(r,a),a+=4,n.height=i.readUint(r,a),a+=4,n.depth=r[a],a++,n.ctype=r[a],a++,n.compress=r[a],a++,n.filter=r[a],a++,n.interlace=r[a],a++;}function E(r,a,n,d,v,C,M,I,N){let k=Math.min(a,v),P=Math.min(n,C),R=0,h=0;for(let T=0;T<P;T++)for(let m=0;m<k;m++)if(M>=0&&I>=0?(R=T*a+m<<2,h=(I+T)*v+M+m<<2):(R=(-I+T)*a-M+m<<2,h=T*v+m<<2),N==0)d[h]=r[R],d[h+1]=r[R+1],d[h+2]=r[R+2],d[h+3]=r[R+3];else if(N==1){var x=r[R+3]*.00392156862745098,f=r[R]*x,u=r[R+1]*x,_=r[R+2]*x,s=d[h+3]*(1/255),w=d[h]*s,b=d[h+1]*s,A=d[h+2]*s;let p=1-x,L=x+s*p,O=L==0?0:1/L;d[h+3]=255*L,d[h+0]=(f+w*p)*O,d[h+1]=(u+b*p)*O,d[h+2]=(_+A*p)*O;}else if(N==2)x=r[R+3],f=r[R],u=r[R+1],_=r[R+2],s=d[h+3],w=d[h],b=d[h+1],A=d[h+2],x==s&&f==w&&u==b&&_==A?(d[h]=0,d[h+1]=0,d[h+2]=0,d[h+3]=0):(d[h]=f,d[h+1]=u,d[h+2]=_,d[h+3]=x);else if(N==3){if(x=r[R+3],f=r[R],u=r[R+1],_=r[R+2],s=d[h+3],w=d[h],b=d[h+1],A=d[h+2],x==s&&f==w&&u==b&&_==A)continue;if(x<220&&s>20)return false}return true}return {decode:function(a){let n=new Uint8Array(a),d=8,v=i,C=v.readUshort,M=v.readUint,I={tabs:{},frames:[]},N=new Uint8Array(n.length),k,P=0,R=0,h=[137,80,78,71,13,10,26,10];for(var x=0;x<8;x++)if(n[x]!=h[x])throw "The input is not a PNG file!";for(;d<n.length;){let T=v.readUint(n,d);d+=4;let m=v.readASCII(n,d,4);if(d+=4,m=="IHDR")y(n,d,I);else if(m=="iCCP"){for(var f=d;n[f]!=0;)f++;v.readASCII(n,d,f-d),n[f+1];let p=n.slice(f+2,d+T),L=null;try{L=l(p);}catch{L=e(p);}I.tabs[m]=L;}else if(m=="CgBI")I.tabs[m]=n.slice(d,d+4);else if(m=="IDAT"){for(x=0;x<T;x++)N[P+x]=n[d+x];P+=T;}else if(m=="acTL")I.tabs[m]={num_frames:M(n,d),num_plays:M(n,d+4)},k=new Uint8Array(n.length);else if(m=="fcTL"){R!=0&&((A=I.frames[I.frames.length-1]).data=S(I,k.slice(0,R),A.rect.width,A.rect.height),R=0);let p={x:M(n,d+12),y:M(n,d+16),width:M(n,d+4),height:M(n,d+8)},L=C(n,d+22);L=C(n,d+20)/(L==0?100:L);let O={rect:p,delay:Math.round(1e3*L),dispose:n[d+24],blend:n[d+25]};I.frames.push(O);}else if(m=="fdAT"){for(x=0;x<T-4;x++)k[R+x]=n[d+x+4];R+=T-4;}else if(m=="pHYs")I.tabs[m]=[v.readUint(n,d),v.readUint(n,d+4),n[d+8]];else if(m=="cHRM")for(I.tabs[m]=[],x=0;x<8;x++)I.tabs[m].push(v.readUint(n,d+4*x));else if(m=="tEXt"||m=="zTXt"){I.tabs[m]==null&&(I.tabs[m]={});var u=v.nextZero(n,d),_=v.readASCII(n,d,u-d),s=d+T-u-1;if(m=="tEXt")b=v.readASCII(n,u+1,s);else {var w=l(n.slice(u+2,u+2+s));b=v.readUTF8(w,0,w.length);}I.tabs[m][_]=b;}else if(m=="iTXt"){I.tabs[m]==null&&(I.tabs[m]={}),u=0,f=d,u=v.nextZero(n,f),_=v.readASCII(n,f,u-f);let p=n[f=u+1];var b;n[f+1],f+=2,u=v.nextZero(n,f),v.readASCII(n,f,u-f),f=u+1,u=v.nextZero(n,f),v.readUTF8(n,f,u-f),s=T-((f=u+1)-d),p==0?b=v.readUTF8(n,f,s):(w=l(n.slice(f,f+s)),b=v.readUTF8(w,0,w.length)),I.tabs[m][_]=b;}else if(m=="PLTE")I.tabs[m]=v.readBytes(n,d,T);else if(m=="hIST"){let p=I.tabs.PLTE.length/3;for(I.tabs[m]=[],x=0;x<p;x++)I.tabs[m].push(C(n,d+2*x));}else if(m=="tRNS")I.ctype==3?I.tabs[m]=v.readBytes(n,d,T):I.ctype==0?I.tabs[m]=C(n,d):I.ctype==2&&(I.tabs[m]=[C(n,d),C(n,d+2),C(n,d+4)]);else if(m=="gAMA")I.tabs[m]=v.readUint(n,d)/1e5;else if(m=="sRGB")I.tabs[m]=n[d];else if(m=="bKGD")I.ctype==0||I.ctype==4?I.tabs[m]=[C(n,d)]:I.ctype==2||I.ctype==6?I.tabs[m]=[C(n,d),C(n,d+2),C(n,d+4)]:I.ctype==3&&(I.tabs[m]=n[d]);else if(m=="IEND")break;d+=T,v.readUint(n,d),d+=4;}var A;return R!=0&&((A=I.frames[I.frames.length-1]).data=S(I,k.slice(0,R),A.rect.width,A.rect.height)),I.data=S(I,N,I.width,I.height),delete I.compress,delete I.interlace,delete I.filter,I},toRGBA8:function(a){let n=a.width,d=a.height;if(a.tabs.acTL==null)return [o(a.data,n,d,a).buffer];let v=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let C=n*d*4,M=new Uint8Array(C),I=new Uint8Array(C),N=new Uint8Array(C);for(let P=0;P<a.frames.length;P++){let R=a.frames[P],h=R.rect.x,x=R.rect.y,f=R.rect.width,u=R.rect.height,_=o(R.data,f,u,a);if(P!=0)for(var k=0;k<C;k++)N[k]=M[k];if(R.blend==0?E(_,f,u,M,n,d,h,x,0):R.blend==1&&E(_,f,u,M,n,d,h,x,1),v.push(M.buffer.slice(0)),R.dispose!=0){if(R.dispose==1)E(I,f,u,M,n,d,h,x,0);else if(R.dispose==2)for(k=0;k<C;k++)M[k]=N[k];}}return v},_paeth:c,_copyTile:E,_bin:i}})();(function(){let{_copyTile:i}=pe,{_bin:o}=pe,S=pe._paeth;var l={table:(function(){let f=new Uint32Array(256);for(let u=0;u<256;u++){let _=u;for(let s=0;s<8;s++)1&_?_=3988292384^_>>>1:_>>>=1;f[u]=_;}return f})(),update(f,u,_,s){for(let w=0;w<s;w++)f=l.table[255&(f^u[_+w])]^f>>>8;return f},crc:(f,u,_)=>4294967295^l.update(4294967295,f,u,_)};function e(f,u,_,s){u[_]+=f[0]*s>>4,u[_+1]+=f[1]*s>>4,u[_+2]+=f[2]*s>>4,u[_+3]+=f[3]*s>>4;}function t(f){return Math.max(0,Math.min(255,f))}function g(f,u){let _=f[0]-u[0],s=f[1]-u[1],w=f[2]-u[2],b=f[3]-u[3];return _*_+s*s+w*w+b*b}function c(f,u,_,s,w,b,A){A==null&&(A=1);let T=s.length,m=[];for(var p=0;p<T;p++){let F=s[p];m.push([F>>>0&255,F>>>8&255,F>>>16&255,F>>>24&255]);}for(p=0;p<T;p++){let F=4294967295;for(var L=0,O=0;O<T;O++){var U=g(m[p],m[O]);O!=p&&U<F&&(F=U,L=O);}}let H=new Uint32Array(w.buffer),D=new Int16Array(u*_*4),Q=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(p=0;p<Q.length;p++)Q[p]=255*((Q[p]+.5)/16-.5);for(let F=0;F<_;F++)for(let $=0;$<u;$++){var B;p=4*(F*u+$),A!=2?B=[t(f[p]+D[p]),t(f[p+1]+D[p+1]),t(f[p+2]+D[p+2]),t(f[p+3]+D[p+3])]:(U=Q[4*(3&F)+(3&$)],B=[t(f[p]+U),t(f[p+1]+U),t(f[p+2]+U),t(f[p+3]+U)]),L=0;let K=16777215;for(O=0;O<T;O++){let q=g(B,m[O]);q<K&&(K=q,L=O);}let V=m[L],z=[B[0]-V[0],B[1]-V[1],B[2]-V[2],B[3]-V[3]];A==1&&($!=u-1&&e(z,D,p+4,7),F!=_-1&&($!=0&&e(z,D,p+4*u-4,3),e(z,D,p+4*u,5),$!=u-1&&e(z,D,p+4*u+4,1))),b[p>>2]=L,H[p>>2]=s[L];}}function y(f,u,_,s,w){w==null&&(w={});let{crc:b}=l,A=o.writeUint,T=o.writeUshort,m=o.writeASCII,p=8,L=f.frames.length>1,O,U=false,H=33+(L?20:0);if(w.sRGB!=null&&(H+=13),w.pHYs!=null&&(H+=21),w.iCCP!=null&&(O=pako.deflate(w.iCCP),H+=21+O.length+4),f.ctype==3){for(var D=f.plte.length,Q=0;Q<D;Q++)f.plte[Q]>>>24!=255&&(U=true);H+=8+3*D+4+(U?8+1*D+4:0);}for(var B=0;B<f.frames.length;B++)L&&(H+=38),H+=(V=f.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let F=new Uint8Array(H),$=[137,80,78,71,13,10,26,10];for(Q=0;Q<8;Q++)F[Q]=$[Q];if(A(F,p,13),p+=4,m(F,p,"IHDR"),p+=4,A(F,p,u),p+=4,A(F,p,_),p+=4,F[p]=f.depth,p++,F[p]=f.ctype,p++,F[p]=0,p++,F[p]=0,p++,F[p]=0,p++,A(F,p,b(F,p-17,17)),p+=4,w.sRGB!=null&&(A(F,p,1),p+=4,m(F,p,"sRGB"),p+=4,F[p]=w.sRGB,p++,A(F,p,b(F,p-5,5)),p+=4),w.iCCP!=null){let z=13+O.length;A(F,p,z),p+=4,m(F,p,"iCCP"),p+=4,m(F,p,"ICC profile"),p+=11,p+=2,F.set(O,p),p+=O.length,A(F,p,b(F,p-(z+4),z+4)),p+=4;}if(w.pHYs!=null&&(A(F,p,9),p+=4,m(F,p,"pHYs"),p+=4,A(F,p,w.pHYs[0]),p+=4,A(F,p,w.pHYs[1]),p+=4,F[p]=w.pHYs[2],p++,A(F,p,b(F,p-13,13)),p+=4),L&&(A(F,p,8),p+=4,m(F,p,"acTL"),p+=4,A(F,p,f.frames.length),p+=4,A(F,p,w.loop!=null?w.loop:0),p+=4,A(F,p,b(F,p-12,12)),p+=4),f.ctype==3){for(A(F,p,3*(D=f.plte.length)),p+=4,m(F,p,"PLTE"),p+=4,Q=0;Q<D;Q++){let z=3*Q,q=f.plte[Q],G=255&q,W=q>>>8&255,ie=q>>>16&255;F[p+z+0]=G,F[p+z+1]=W,F[p+z+2]=ie;}if(p+=3*D,A(F,p,b(F,p-3*D-4,3*D+4)),p+=4,U){for(A(F,p,D),p+=4,m(F,p,"tRNS"),p+=4,Q=0;Q<D;Q++)F[p+Q]=f.plte[Q]>>>24&255;p+=D,A(F,p,b(F,p-D-4,D+4)),p+=4;}}let K=0;for(B=0;B<f.frames.length;B++){var V=f.frames[B];L&&(A(F,p,26),p+=4,m(F,p,"fcTL"),p+=4,A(F,p,K++),p+=4,A(F,p,V.rect.width),p+=4,A(F,p,V.rect.height),p+=4,A(F,p,V.rect.x),p+=4,A(F,p,V.rect.y),p+=4,T(F,p,s[B]),p+=2,T(F,p,1e3),p+=2,F[p]=V.dispose,p++,F[p]=V.blend,p++,A(F,p,b(F,p-30,30)),p+=4);let z=V.cimg;A(F,p,(D=z.length)+(B==0?0:4)),p+=4;let q=p;m(F,p,B==0?"IDAT":"fdAT"),p+=4,B!=0&&(A(F,p,K++),p+=4),F.set(z,p),p+=D,A(F,p,b(F,q,p-q)),p+=4;}return A(F,p,0),p+=4,m(F,p,"IEND"),p+=4,A(F,p,b(F,p-4,4)),p+=4,F.buffer}function E(f,u,_){for(let s=0;s<f.frames.length;s++){let w=f.frames[s];w.rect.width;let b=w.rect.height,A=new Uint8Array(b*w.bpl+b);w.cimg=d(w.img,b,w.bpp,w.bpl,A,u,_);}}function r(f,u,_,s,w){let b=w[0],A=w[1],T=w[2],m=w[3],p=w[4],L=w[5],O=6,U=8,H=255;for(var D=0;D<f.length;D++){let te=new Uint8Array(f[D]);for(var Q=te.length,B=0;B<Q;B+=4)H&=te[B+3];}let F=H!=255,$=(function(Y,J,ne,oe,j,ue){let ee=[];for(var X=0;X<Y.length;X++){let le=new Uint8Array(Y[X]),he=new Uint32Array(le.buffer);var ce;let de=0,Ae=0,me=J,Ie=ne,Ye=oe?1:0;if(X!=0){let yn=ue||oe||X==1||ee[X-2].dispose!=0?1:2,Je=0,vt=1e9;for(let Le=0;Le<yn;Le++){var ge=new Uint8Array(Y[X-1-Le]);let wn=new Uint32Array(Y[X-1-Le]),_e=J,be=ne,Ue=-1,De=-1;for(let Re=0;Re<ne;Re++)for(let Ce=0;Ce<J;Ce++)he[se=Re*J+Ce]!=wn[se]&&(Ce<_e&&(_e=Ce),Ce>Ue&&(Ue=Ce),Re<be&&(be=Re),Re>De&&(De=Re));Ue==-1&&(_e=be=Ue=De=0),j&&((1&_e)==1&&_e--,(1&be)==1&&be--);let _t=(Ue-_e+1)*(De-be+1);_t<vt&&(vt=_t,Je=Le,de=_e,Ae=be,me=Ue-_e+1,Ie=De-be+1);}ge=new Uint8Array(Y[X-1-Je]),Je==1&&(ee[X-1].dispose=2),ce=new Uint8Array(me*Ie*4),i(ge,J,ne,ce,me,Ie,-de,-Ae,0),Ye=i(le,J,ne,ce,me,Ie,-de,-Ae,3)?1:0,Ye==1?n(le,J,ne,ce,{x:de,y:Ae,width:me,height:Ie}):i(le,J,ne,ce,me,Ie,-de,-Ae,0);}else ce=le.slice(0);ee.push({rect:{x:de,y:Ae,width:me,height:Ie},img:ce,blend:Ye,dispose:0});}if(oe)for(X=0;X<ee.length;X++){if((Te=ee[X]).blend==1)continue;let le=Te.rect,he=ee[X-1].rect,de=Math.min(le.x,he.x),Ae=Math.min(le.y,he.y),me={x:de,y:Ae,width:Math.max(le.x+le.width,he.x+he.width)-de,height:Math.max(le.y+le.height,he.y+he.height)-Ae};ee[X-1].dispose=1,X-1!=0&&a(Y,J,ne,ee,X-1,me,j),a(Y,J,ne,ee,X,me,j);}let He=0;if(Y.length!=1)for(var se=0;se<ee.length;se++){var Te;He+=(Te=ee[se]).rect.width*Te.rect.height;}return ee})(f,u,_,b,A,T),K={},V=[],z=[];if(s!=0){let te=[];for(B=0;B<$.length;B++)te.push($[B].img.buffer);let Y=(function(j){let ue=0;for(var ee=0;ee<j.length;ee++)ue+=j[ee].byteLength;let X=new Uint8Array(ue),ce=0;for(ee=0;ee<j.length;ee++){let ge=new Uint8Array(j[ee]),He=ge.length;for(let se=0;se<He;se+=4){let Te=ge[se],le=ge[se+1],he=ge[se+2],de=ge[se+3];de==0&&(Te=le=he=0),X[ce+se]=Te,X[ce+se+1]=le,X[ce+se+2]=he,X[ce+se+3]=de;}ce+=He;}return X.buffer})(te),J=C(Y,s);for(B=0;B<J.plte.length;B++)V.push(J.plte[B].est.rgba);let ne=0;for(B=0;B<$.length;B++){let oe=(G=$[B]).img.length;var q=new Uint8Array(J.inds.buffer,ne>>2,oe>>2);z.push(q);let j=new Uint8Array(J.abuf,ne,oe);L&&c(G.img,G.rect.width,G.rect.height,V,j,q),G.img.set(j),ne+=oe;}}else for(D=0;D<$.length;D++){var G=$[D];let te=new Uint32Array(G.img.buffer);var W=G.rect.width;for(Q=te.length,q=new Uint8Array(Q),z.push(q),B=0;B<Q;B++){let Y=te[B];if(B!=0&&Y==te[B-1])q[B]=q[B-1];else if(B>W&&Y==te[B-W])q[B]=q[B-W];else {let J=K[Y];if(J==null&&(K[Y]=J=V.length,V.push(Y),V.length>=300))break;q[B]=J;}}}let ie=V.length;for(ie<=256&&p==0&&(U=ie<=2?1:ie<=4?2:ie<=16?4:8,U=Math.max(U,m)),D=0;D<$.length;D++){(G=$[D]).rect.x,G.rect.y,W=G.rect.width;let te=G.rect.height,Y=G.img;new Uint32Array(Y.buffer);let J=4*W,ne=4;if(ie<=256&&p==0){J=Math.ceil(U*W/8);var ae=new Uint8Array(J*te);let oe=z[D];for(let j=0;j<te;j++){B=j*J;let ue=j*W;if(U==8)for(var Z=0;Z<W;Z++)ae[B+Z]=oe[ue+Z];else if(U==4)for(Z=0;Z<W;Z++)ae[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(U==2)for(Z=0;Z<W;Z++)ae[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(U==1)for(Z=0;Z<W;Z++)ae[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}Y=ae,O=3,ne=1;}else if(F==0&&$.length==1){ae=new Uint8Array(W*te*3);let oe=W*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;ae[j]=Y[ue],ae[j+1]=Y[ue+1],ae[j+2]=Y[ue+2];}Y=ae,O=2,ne=3,J=3*W;}G.img=Y,G.bpl=J,G.bpp=ne;}return {ctype:O,depth:U,plte:V,frames:$}}function a(f,u,_,s,w,b,A){let T=Uint8Array,m=Uint32Array,p=new T(f[w-1]),L=new m(f[w-1]),O=w+1<f.length?new T(f[w+1]):null,U=new T(f[w]),H=new m(U.buffer),D=u,Q=_,B=-1,F=-1;for(let K=0;K<b.height;K++)for(let V=0;V<b.width;V++){let z=b.x+V,q=b.y+K,G=q*u+z,W=H[G];W==0||s[w-1].dispose==0&&L[G]==W&&(O==null||O[4*G+3]!=0)||(z<D&&(D=z),z>B&&(B=z),q<Q&&(Q=q),q>F&&(F=q));}B==-1&&(D=Q=B=F=0),A&&((1&D)==1&&D--,(1&Q)==1&&Q--),b={x:D,y:Q,width:B-D+1,height:F-Q+1};let $=s[w];$.rect=b,$.blend=1,$.img=new Uint8Array(b.width*b.height*4),s[w-1].dispose==0?(i(p,u,_,$.img,b.width,b.height,-b.x,-b.y,0),n(U,u,_,$.img,b)):i(U,u,_,$.img,b.width,b.height,-b.x,-b.y,0);}function n(f,u,_,s,w){i(f,u,_,s,w.width,w.height,-w.x,-w.y,2);}function d(f,u,_,s,w,b,A){let T=[],m,p=[0,1,2,3,4];b!=-1?p=[b]:(u*s>5e5||_==1)&&(p=[0]),A&&(m={level:0});let L=Cn;for(var O=0;O<p.length;O++){for(let D=0;D<u;D++)v(w,f,D,s,_,p[O]);T.push(L.deflate(w,m));}let U,H=1e9;for(O=0;O<T.length;O++)T[O].length<H&&(U=O,H=T[O].length);return T[U]}function v(f,u,_,s,w,b){let A=_*s,T=A+_;if(f[T]=b,T++,b==0)if(s<500)for(var m=0;m<s;m++)f[T+m]=u[A+m];else f.set(new Uint8Array(u.buffer,A,s),T);else if(b==1){for(m=0;m<w;m++)f[T+m]=u[A+m];for(m=w;m<s;m++)f[T+m]=u[A+m]-u[A+m-w]+256&255;}else if(_==0){for(m=0;m<w;m++)f[T+m]=u[A+m];if(b==2)for(m=w;m<s;m++)f[T+m]=u[A+m];if(b==3)for(m=w;m<s;m++)f[T+m]=u[A+m]-(u[A+m-w]>>1)+256&255;if(b==4)for(m=w;m<s;m++)f[T+m]=u[A+m]-S(u[A+m-w],0,0)+256&255;}else {if(b==2)for(m=0;m<s;m++)f[T+m]=u[A+m]+256-u[A+m-s]&255;if(b==3){for(m=0;m<w;m++)f[T+m]=u[A+m]+256-(u[A+m-s]>>1)&255;for(m=w;m<s;m++)f[T+m]=u[A+m]+256-(u[A+m-s]+u[A+m-w]>>1)&255;}if(b==4){for(m=0;m<w;m++)f[T+m]=u[A+m]+256-S(0,u[A+m-s],0)&255;for(m=w;m<s;m++)f[T+m]=u[A+m]+256-S(u[A+m-w],u[A+m-s],u[A+m-w-s])&255;}}}function C(f,u){let _=new Uint8Array(f),s=_.slice(0),w=new Uint32Array(s.buffer),b=M(s,u),A=b[0],T=b[1],m=_.length,p=new Uint8Array(m>>2),L;if(_.length<2e7)for(var O=0;O<m;O+=4)L=I(A,U=_[O]*(1/255),H=_[O+1]*(1/255),D=_[O+2]*(1/255),Q=_[O+3]*(1/255)),p[O>>2]=L.ind,w[O>>2]=L.est.rgba;else for(O=0;O<m;O+=4){var U=_[O]*.00392156862745098,H=_[O+1]*(1/255),D=_[O+2]*(1/255),Q=_[O+3]*(1/255);for(L=A;L.left;)L=N(L.est,U,H,D,Q)<=0?L.left:L.right;p[O>>2]=L.ind,w[O>>2]=L.est.rgba;}return {abuf:s.buffer,inds:p,plte:T}}function M(f,u,_){_==null&&(_=1e-4);let s=new Uint32Array(f.buffer),w={i0:0,i1:f.length,bst:null,est:null,tdst:0,left:null,right:null};w.bst=R(f,w.i0,w.i1),w.est=h(w.bst);let b=[w];for(;b.length<u;){let T=0,m=0;for(var A=0;A<b.length;A++)b[A].est.L>T&&(T=b[A].est.L,m=A);if(T<_)break;let p=b[m],L=k(f,s,p.i0,p.i1,p.est.e,p.est.eMq255);if(p.i0>=L||p.i1<=L){p.est.L=0;continue}let O={i0:p.i0,i1:L,bst:null,est:null,tdst:0,left:null,right:null};O.bst=R(f,O.i0,O.i1),O.est=h(O.bst);let U={i0:L,i1:p.i1,bst:null,est:null,tdst:0,left:null,right:null};for(U.bst={R:[],m:[],N:p.bst.N-O.bst.N},A=0;A<16;A++)U.bst.R[A]=p.bst.R[A]-O.bst.R[A];for(A=0;A<4;A++)U.bst.m[A]=p.bst.m[A]-O.bst.m[A];U.est=h(U.bst),p.left=O,p.right=U,b[m]=O,b.push(U);}for(b.sort(((T,m)=>m.bst.N-T.bst.N)),A=0;A<b.length;A++)b[A].ind=A;return [w,b]}function I(f,u,_,s,w){if(f.left==null)return f.tdst=(function(O,U,H,D,Q){let B=U-O[0],F=H-O[1],$=D-O[2],K=Q-O[3];return B*B+F*F+$*$+K*K})(f.est.q,u,_,s,w),f;let b=N(f.est,u,_,s,w),A=f.left,T=f.right;b>0&&(A=f.right,T=f.left);let m=I(A,u,_,s,w);if(m.tdst<=b*b)return m;let p=I(T,u,_,s,w);return p.tdst<m.tdst?p:m}function N(f,u,_,s,w){let{e:b}=f;return b[0]*u+b[1]*_+b[2]*s+b[3]*w-f.eMq}function k(f,u,_,s,w,b){for(s-=4;_<s;){for(;P(f,_,w)<=b;)_+=4;for(;P(f,s,w)>b;)s-=4;if(_>=s)break;let A=u[_>>2];u[_>>2]=u[s>>2],u[s>>2]=A,_+=4,s-=4;}for(;P(f,_,w)>b;)_-=4;return _+4}function P(f,u,_){return f[u]*_[0]+f[u+1]*_[1]+f[u+2]*_[2]+f[u+3]*_[3]}function R(f,u,_){let s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=[0,0,0,0],b=_-u>>2;for(let A=u;A<_;A+=4){let T=f[A]*.00392156862745098,m=f[A+1]*(1/255),p=f[A+2]*(1/255),L=f[A+3]*(1/255);w[0]+=T,w[1]+=m,w[2]+=p,w[3]+=L,s[0]+=T*T,s[1]+=T*m,s[2]+=T*p,s[3]+=T*L,s[5]+=m*m,s[6]+=m*p,s[7]+=m*L,s[10]+=p*p,s[11]+=p*L,s[15]+=L*L;}return s[4]=s[1],s[8]=s[2],s[9]=s[6],s[12]=s[3],s[13]=s[7],s[14]=s[11],{R:s,m:w,N:b}}function h(f){let{R:u}=f,{m:_}=f,{N:s}=f,w=_[0],b=_[1],A=_[2],T=_[3],m=s==0?0:1/s,p=[u[0]-w*w*m,u[1]-w*b*m,u[2]-w*A*m,u[3]-w*T*m,u[4]-b*w*m,u[5]-b*b*m,u[6]-b*A*m,u[7]-b*T*m,u[8]-A*w*m,u[9]-A*b*m,u[10]-A*A*m,u[11]-A*T*m,u[12]-T*w*m,u[13]-T*b*m,u[14]-T*A*m,u[15]-T*T*m],L=p,O=x,U=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,D=0;if(s!=0)for(let B=0;B<16&&(U=O.multVec(L,U),D=Math.sqrt(O.dot(U,U)),U=O.sml(1/D,U),!(B!=0&&Math.abs(D-H)<1e-9));B++)H=D;let Q=[w*m,b*m,A*m,T*m];return {Cov:p,q:Q,e:U,L:H,eMq255:O.dot(O.sml(255,Q),U),eMq:O.dot(U,Q),rgba:(Math.round(255*Q[3])<<24|Math.round(255*Q[2])<<16|Math.round(255*Q[1])<<8|Math.round(255*Q[0])<<0)>>>0}}var x={multVec:(f,u)=>[f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3],f[4]*u[0]+f[5]*u[1]+f[6]*u[2]+f[7]*u[3],f[8]*u[0]+f[9]*u[1]+f[10]*u[2]+f[11]*u[3],f[12]*u[0]+f[13]*u[1]+f[14]*u[2]+f[15]*u[3]],dot:(f,u)=>f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3],sml:(f,u)=>[f*u[0],f*u[1],f*u[2],f*u[3]]};pe.encode=function(u,_,s,w,b,A,T){w==null&&(w=0),T==null&&(T=false);let m=r(u,_,s,w,[false,false,false,0,T,false]);return E(m,-1),y(m,_,s,b,A)},pe.encodeLL=function(u,_,s,w,b,A,T,m){let p={ctype:0+(w==1?0:2)+(b==0?0:4),depth:A,frames:[]},L=(w+b)*A,O=L*_;for(let U=0;U<u.length;U++)p.frames.push({rect:{x:0,y:0,width:_,height:s},img:new Uint8Array(u[U]),blend:0,dispose:1,bpp:Math.ceil(L/8),bpl:Math.ceil(O/8)});return E(p,0,true),y(p,_,s,T,m)},pe.encode.compress=r,pe.encode.dither=c,pe.quantize=C,pe.quantize.getKDtree=M,pe.quantize.getNearest=I;})();var It={toArrayBuffer(i,o){let S=i.width,l=i.height,e=S<<2,t=i.getContext("2d").getImageData(0,0,S,l),g=new Uint32Array(t.data.buffer),c=(32*S+31)/32<<2,y=c*l,E=122+y,r=new ArrayBuffer(E),a=new DataView(r),n=1<<20,d,v,C,M,I=n,N=0,k=0,P=0;function R(f){a.setUint16(k,f,true),k+=2;}function h(f){a.setUint32(k,f,true),k+=4;}function x(f){k+=f;}R(19778),h(E),x(4),h(122),h(108),h(S),h(-l>>>0),R(1),R(32),h(3),h(y),h(2835),h(2835),x(8),h(16711680),h(65280),h(255),h(4278190080),h(1466527264),(function f(){for(;N<l&&I>0;){for(M=122+N*c,d=0;d<e;)I--,v=g[P++],C=v>>>24,a.setUint32(M+d,v<<8|C),d+=4;N++;}P<g.length?(I=n,setTimeout(f,It._dly)):o(r);})();},toBlob(i,o){this.toArrayBuffer(i,(S=>{o(new Blob([S],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},xn={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},et=typeof globalThis.window<"u",Rt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,We=et&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),On=(et||Rt)&&(We&&We.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Ct=(et||Rt)&&(We&&We.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function tt(i,o,S=Date.now()){return new Promise((l=>{let e=i.split(","),t=e[0].match(/:(.*?);/)[1],g=globalThis.atob(e[1]),c=g.length,y=new Uint8Array(c);for(;c--;)y[c]=g.charCodeAt(c);let E=new Blob([y],{type:t});E.name=o,E.lastModified=S,l(E);}))}function xt(i){return new Promise(((o,S)=>{let l=new Ct;l.onload=()=>o(l.result),l.onerror=e=>S(e),l.readAsDataURL(i);}))}function Ot(i){return new Promise(((o,S)=>{let l=new globalThis.Image;l.onload=()=>o(l),l.onerror=e=>S(e),l.src=i;}))}function xe(){if(xe.cachedResult!==void 0)return xe.cachedResult;let i=fe.ETC,{userAgent:o}=navigator;return /Chrom(e|ium)/i.test(o)?i=fe.CHROME:/iP(ad|od|hone)/i.test(o)&&/WebKit/i.test(o)?i=fe.IOS:/Safari/i.test(o)?i=fe.DESKTOP_SAFARI:/Firefox/i.test(o)?i=fe.FIREFOX:(/MSIE/i.test(o)||globalThis.document.documentMode)&&(i=fe.IE),xe.cachedResult=i,xe.cachedResult}function Ut(i,o){let S=xe(),l=xn[S],e=i,t=o,g=e*t,c=e>t?t/e:e/t;for(;g>l*l;){let y=(l+e)/2,E=(l+t)/2;y<E?(t=E,e=E*c):(t=y*c,e=y),g=e*t;}return {width:e,height:t}}function Ve(i,o){let S,l;try{if(S=new OffscreenCanvas(i,o),l=S.getContext("2d"),l===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{S=globalThis.document.createElement("canvas"),l=S.getContext("2d");}return S.width=i,S.height=o,[S,l]}function Mt(i,o){let{width:S,height:l}=Ut(i.width,i.height),[e,t]=Ve(S,l);return o&&/jpe?g/.test(o)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(i,0,0,e.width,e.height),e}function Qe(){return Qe.cachedResult!==void 0||(Qe.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof globalThis.document<"u"&&"ontouchend"in globalThis.document),Qe.cachedResult}function ze(i,o={}){return new Promise((function(S,l){let e,t;var g=function(){try{return t=Mt(e,o.fileType||i.type),S([e,t])}catch(y){return l(y)}},c=function(y){try{var E=function(r){try{throw r}catch(a){return l(a)}};try{let r;return xt(i).then((function(a){try{return r=a,Ot(r).then((function(n){try{return e=n,(function(){try{return g()}catch(d){return l(d)}})()}catch(d){return E(d)}}),E)}catch(n){return E(n)}}),E)}catch(r){E(r);}}catch(r){return l(r)}};try{if(Qe()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(xe()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(i).then((function(y){try{return e=y,g()}catch{return c()}}),c)}catch{c();}}))}function Ge(i,o,S,l,e=1){return new Promise((function(t,g){let c;if(o==="image/png"){let a,n,d;return a=i.getContext("2d"),{data:n}=a.getImageData(0,0,i.width,i.height),d=pe.encode([n.buffer],i.width,i.height,4096*e),c=new Blob([d],{type:o}),c.name=S,c.lastModified=l,y.call(this)}{let a=function(){return y.call(this)};if(o==="image/bmp")return new Promise((n=>It.toBlob(i,n))).then(function(n){try{return c=n,c.name=S,c.lastModified=l,a.call(this)}catch(d){return g(d)}}.bind(this),g);{let n=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&i instanceof OffscreenCanvas)return i.convertToBlob({type:o,quality:e}).then(function(d){try{return c=d,c.name=S,c.lastModified=l,n.call(this)}catch(v){return g(v)}}.bind(this),g);{let d;return d=i.toDataURL(o,e),tt(d,S,l).then(function(v){try{return c=v,n.call(this)}catch(C){return g(C)}}.bind(this),g)}}}function y(){return t(c)}}))}function ye(i){i.width=0,i.height=0;}function Me(){return new Promise((function(i,o){let l,e,t,g;return Me.cachedResult!==void 0?i(Me.cachedResult):(tt("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(c){try{return l=c,ze(l).then((function(y){try{return e=y[1],Ge(e,l.type,l.name,l.lastModified).then((function(E){try{return t=E,ye(e),ze(t).then((function(r){try{return g=r[0],Me.cachedResult=g.width===1&&g.height===2,i(Me.cachedResult)}catch(a){return o(a)}}),o)}catch(r){return o(r)}}),o)}catch(E){return o(E)}}),o)}catch(y){return o(y)}}),o))}))}function Pt(i){return new Promise(((o,S)=>{let l=new Ct;l.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return o(-2);let g=t.byteLength,c=2;for(;c<g;){if(t.getUint16(c+2,false)<=8)return o(-1);let y=t.getUint16(c,false);if(c+=2,y==65505){if(t.getUint32(c+=2,false)!=1165519206)return o(-1);let E=t.getUint16(c+=6,false)==18761;c+=t.getUint32(c+4,E);let r=t.getUint16(c,E);c+=2;for(let a=0;a<r;a++)if(t.getUint16(c+12*a,E)==274)return o(t.getUint16(c+12*a+8,E))}else {if((65280&y)!=65280)break;c+=t.getUint16(c,false);}}return o(-1)},l.onerror=e=>S(e),l.readAsArrayBuffer(i);}))}function Lt(i,o){let{width:S}=i,{height:l}=i,{maxWidthOrHeight:e}=o,t,g=i;return isFinite(e)&&(S>e||l>e)&&([g,t]=Ve(S,l),S>l?(g.width=e,g.height=l/S*e):(g.width=S/l*e,g.height=e),t.drawImage(i,0,0,g.width,g.height),ye(i)),g}function Dt(i,o){let{width:S}=i,{height:l}=i,[e,t]=Ve(S,l);switch(o>4&&o<9?(e.width=l,e.height=S):(e.width=S,e.height=l),o){case 2:t.transform(-1,0,0,1,S,0);break;case 3:t.transform(-1,0,0,-1,S,l);break;case 4:t.transform(1,0,0,-1,0,l);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,l,0);break;case 7:t.transform(0,-1,-1,0,l,S);break;case 8:t.transform(0,-1,1,0,0,S);}return t.drawImage(i,0,0,S,l),ye(i),e}function St(i,o,S=0){return new Promise((function(l,e){let t,g,c,y,E,r,a,n,d,v,C,M,I,N,k,P,R,h,x,f;function u(s=5){if(o.signal&&o.signal.aborted)throw o.signal.reason;t+=s,o.onProgress(Math.min(t,100));}function _(s){if(o.signal&&o.signal.aborted)throw o.signal.reason;t=Math.min(Math.max(s,t),100),o.onProgress(t);}return t=S,g=o.maxIteration||10,c=1024*o.maxSizeMB*1024,u(),ze(i,o).then(function(s){try{return [,y]=s,u(),E=Lt(y,o),u(),new Promise((function(w,b){var A;if(!(A=o.exifOrientation))return Pt(i).then(function(m){try{return A=m,T.call(this)}catch(p){return b(p)}}.bind(this),b);function T(){return w(A)}return T.call(this)})).then(function(w){try{return r=w,u(),Me().then(function(b){try{return a=b?E:Dt(E,r),u(),n=o.initialQuality||1,d=o.fileType||i.type,Ge(a,d,i.name,i.lastModified,n).then(function(A){try{{let L=function(){if(g--&&(k>c||k>I)){let U,H;return U=f?.95*x.width:x.width,H=f?.95*x.height:x.height,[R,h]=Ve(U,H),h.drawImage(x,0,0,U,H),n*=d==="image/png"?.85:.95,Ge(R,d,i.name,i.lastModified,n).then((function(D){try{return P=D,ye(x),x=R,k=P.size,_(Math.min(99,Math.floor((N-k)/(N-c)*100))),L}catch(Q){return e(Q)}}),e)}return [1]},O=function(){return ye(x),ye(R),ye(E),ye(a),ye(y),_(100),l(P)};var m=L,p=O;if(v=A,u(),C=v.size>c,M=v.size>i.size,!C&&!M)return _(100),l(v);var T;return I=i.size,N=v.size,k=N,x=a,f=!o.alwaysKeepResolution&&C,(T=function(U){for(;U;){if(U.then)return void U.then(T,e);try{if(U.pop){if(U.length)return U.pop()?O.call(this):U;U=L;}else U=U.call(this);}catch(H){return e(H)}}}.bind(this))(L)}}catch(L){return e(L)}}.bind(this),e)}catch(A){return e(A)}}.bind(this),e)}catch(b){return e(b)}}.bind(this),e)}catch(w){return e(w)}}.bind(this),e)}))}var Un=`
|
|
1
|
+
import {useState,useEffect,useRef,useCallback}from'react';import {useMutation}from'@tanstack/react-query';import {identity}from'lodash';import {nanoid}from'nanoid';import Et from'superjson';import {rpcClient,RpcError}from'typed-rpc';var Rn=Object.create;var Rt=Object.defineProperty;var On=Object.getOwnPropertyDescriptor;var Pn=Object.getOwnPropertyNames;var xn=Object.getPrototypeOf,Un=Object.prototype.hasOwnProperty;var nt=(i,n)=>()=>(n||i((n={exports:{}}).exports,n),n.exports);var Mn=(i,n,b,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let e of Pn(n))!Un.call(i,e)&&e!==b&&Rt(i,e,{get:()=>n[e],enumerable:!(s=On(n,e))||s.enumerable});return i};var Ot=(i,n,b)=>(b=i!=null?Rn(xn(i)):{},Mn(Rt(b,"default",{value:i,enumerable:true}),i));var Qt=nt((at,st)=>{(i=>{let n=(()=>{let C=0;return {escape:function(l){return l.replace(/([.*+?^${}()|[\]/\\])/g,"\\$1")},isDataUrl:function(l){return l.search(/^(data:)/)!==-1},canvasToBlob:function(l){return l.toBlob?new Promise(function(w){l.toBlob(w);}):(w=>new Promise(function(E){var v=a(w.toDataURL().split(",")[1]),T=v.length,m=new Uint8Array(T);for(let g=0;g<T;g++)m[g]=v.charCodeAt(g);E(new Blob([m],{type:"image/png"}));}))(l)},resolveUrl:function(l,w){var E=globalThis.document.implementation.createHTMLDocument(),v=E.createElement("base"),T=(E.head.appendChild(v),E.createElement("a"));return E.body.appendChild(T),v.href=w,T.href=l,T.href},getAndEncode:function(l){let w=y.impl.urlCache.find(function(E){return E.url===l});return w||(w={url:l,promise:null},y.impl.urlCache.push(w)),w.promise===null&&(y.impl.options.cacheBust&&(l+=(/\?/.test(l)?"&":"?")+new Date().getTime()),w.promise=new Promise(function(E){let v=new XMLHttpRequest;function T(D){console.error(D),E("");}function m(){var D=y.impl.options.imagePlaceholder;D?E(D):T("Status:"+v.status+" while fetching resource: "+l);}if(v.timeout=y.impl.options.httpTimeout,v.onerror=m,v.ontimeout=m,v.onloadend=function(){if(v.readyState===XMLHttpRequest.DONE){var D=v.status;if(D===0&&l.toLowerCase().startsWith("file://")||200<=D&&D<=300&&v.response!==null){D=v.response,D instanceof Blob||T("Expected response to be a Blob, but got: "+typeof D);let P=new globalThis.FileReader;P.onloadend=function(){var x=P.result;E(x);};try{P.readAsDataURL(D);}catch(x){T("Failed to read the response as Data URL: "+x.toString());}}else m();}},0<y.impl.options.useCredentialsFilters.length&&(y.impl.options.useCredentials=0<y.impl.options.useCredentialsFilters.filter(D=>0<=l.search(D)).length),y.impl.options.useCredentials&&(v.withCredentials=true),y.impl.options.corsImg&&l.indexOf("http")===0&&l.indexOf(globalThis.window.location.origin)===-1){var g=(y.impl.options.corsImg.method||"GET").toUpperCase()==="POST"?"POST":"GET";v.open(g,(y.impl.options.corsImg.url||"").replace("#{cors}",l),true);let D=false,P=y.impl.options.corsImg.headers||{},x=(Object.keys(P).forEach(function(H){P[H].indexOf("application/json")!==-1&&(D=true),v.setRequestHeader(H,P[H]);}),(H=>{try{return JSON.parse(JSON.stringify(H))}catch(L){T("corsImg.data is missing or invalid:"+L.toString());}})(y.impl.options.corsImg.data||""));Object.keys(x).forEach(function(H){typeof x[H]=="string"&&(x[H]=x[H].replace("#{cors}",l));}),v.responseType="blob",v.send(D?JSON.stringify(x):x);}else v.open("GET",l,true),v.responseType="blob",v.send();})),w.promise},uid:function(){return "u"+("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)+C++},asArray:function(l){var w=[],E=l.length;for(let v=0;v<E;v++)w.push(l[v]);return w},escapeXhtml:function(l){return l.replace(/%/g,"%25").replace(/#/g,"%23").replace(/\n/g,"%0A")},makeImage:function(l){return l!=="data:,"?new Promise(function(w,E){let v=globalThis.document.createElementNS("http://www.w3.org/2000/svg","svg"),T=new globalThis.Image;y.impl.options.useCredentials&&(T.crossOrigin="use-credentials"),T.onload=function(){globalThis.document.body.removeChild(v),globalThis.window&&globalThis.window.requestAnimationFrame?globalThis.window.requestAnimationFrame(function(){w(T);}):w(T);},T.onerror=m=>{globalThis.document.body.removeChild(v),E(m);},v.appendChild(T),T.src=l,globalThis.document.body.appendChild(v);}):Promise.resolve()},width:function(l){var w=_(l,"width");if(!isNaN(w))return w;var w=_(l,"border-left-width"),E=_(l,"border-right-width");return l.scrollWidth+w+E},height:function(l){var w=_(l,"height");if(!isNaN(w))return w;var w=_(l,"border-top-width"),E=_(l,"border-bottom-width");return l.scrollHeight+w+E},getWindow:h,isElement:u,isElementHostForOpenShadowRoot:function(l){return u(l)&&l.shadowRoot!==null},isShadowRoot:O,isInShadowRoot:f,isHTMLElement:function(l){return l instanceof h(l).HTMLElement},isHTMLCanvasElement:function(l){return l instanceof h(l).HTMLCanvasElement},isHTMLInputElement:function(l){return l instanceof h(l).HTMLInputElement},isHTMLImageElement:function(l){return l instanceof h(l).HTMLImageElement},isHTMLLinkElement:function(l){return l instanceof h(l).HTMLLinkElement},isHTMLScriptElement:function(l){return l instanceof h(l).HTMLScriptElement},isHTMLStyleElement:function(l){return l instanceof h(l).HTMLStyleElement},isHTMLTextAreaElement:function(l){return l instanceof h(l).HTMLTextAreaElement},isShadowSlotElement:function(l){return f(l)&&l instanceof h(l).HTMLSlotElement},isSVGElement:function(l){return l instanceof h(l).SVGElement},isSVGRectElement:function(l){return l instanceof h(l).SVGRectElement},isDimensionMissing:function(l){return isNaN(l)||l<=0}};function h(l){return l=l?l.ownerDocument:void 0,(l?l.defaultView:void 0)||globalThis.window||i}function O(l){return l instanceof h(l).ShadowRoot}function f(l){return l!=null&&l.getRootNode!==void 0&&O(l.getRootNode())}function u(l){return l instanceof h(l).Element}function _(l,w){if(l.nodeType===S){let E=r(l).getPropertyValue(w);if(E.slice(-2)==="px")return E=E.slice(0,-2),parseFloat(E)}return NaN}})(),b=(()=>{let C=/url\(\s*(["']?)((?:\\.|[^\\)])+)\1\s*\)/gm;return {inlineAll:function(_,l,w){return h(_)?Promise.resolve(_).then(O).then(function(E){let v=Promise.resolve(_);return E.forEach(function(T){v=v.then(function(m){return u(m,T,l,w)});}),v}):Promise.resolve(_)},shouldProcess:h,impl:{readUrls:O,inline:u,urlAsRegex:f}};function h(_){return _.search(C)!==-1}function O(_){for(var l,w=[];(l=C.exec(_))!==null;)w.push(l[2]);return w.filter(function(E){return !n.isDataUrl(E)})}function f(_){return new RegExp(`url\\((["']?)(${n.escape(_)})\\1\\)`,"gm")}function u(_,l,w,E){return Promise.resolve(l).then(function(v){return w?n.resolveUrl(v,w):v}).then(E||n.getAndEncode).then(function(v){var T=f(l);return _.replace(T,`url($1${v}$1)`)})}})(),s={resolveAll:function(){return e().then(function(C){return Promise.all(C.map(function(h){return h.resolve()}))}).then(function(C){return C.join(`
|
|
2
|
+
`)})},impl:{readAll:e}};function e(){return Promise.resolve(n.asArray(globalThis.document.styleSheets)).then(function(h){let O=[];return h.forEach(function(f){var u=Object.getPrototypeOf(f);if(Object.prototype.hasOwnProperty.call(u,"cssRules"))try{n.asArray(f.cssRules||[]).forEach(O.push.bind(O));}catch(_){console.error("domtoimage: Error while reading CSS rules from: "+f.href,_.toString());}}),O}).then(function(h){return h.filter(function(O){return O.type===CSSRule.FONT_FACE_RULE}).filter(function(O){return b.shouldProcess(O.style.getPropertyValue("src"))})}).then(function(h){return h.map(C)});function C(h){return {resolve:function(){var O=(h.parentStyleSheet||{}).href;return b.inlineAll(h.cssText,O)},src:function(){return h.style.getPropertyValue("src")}}}}let t={inlineAll:function C(h){if(!n.isElement(h))return Promise.resolve(h);return O(h).then(function(){return n.isHTMLImageElement(h)?d(h).inline():Promise.all(n.asArray(h.childNodes).map(function(f){return C(f)}))});function O(f){let u=["background","background-image"],_=u.map(function(l){let w=f.style.getPropertyValue(l),E=f.style.getPropertyPriority(l);return w?b.inlineAll(w).then(function(v){f.style.setProperty(l,v,E);}):Promise.resolve()});return Promise.all(_).then(function(){return f})}},impl:{newImage:d}};function d(C){return {inline:function(h){return n.isDataUrl(C.src)?Promise.resolve():Promise.resolve(C.src).then(h||n.getAndEncode).then(function(O){return new Promise(function(f){C.onload=f,C.onerror=f,C.src=O;})})}}}let c={copyDefaultStyles:true,imagePlaceholder:void 0,cacheBust:false,useCredentials:false,useCredentialsFilters:[],httpTimeout:3e4,styleCaching:"strict",corsImg:void 0},y={toSvg:o,toPng:function(C,h){return p(C,h).then(function(O){return O.toDataURL()})},toJpeg:function(C,h){return p(C,h).then(function(O){return O.toDataURL("image/jpeg",(h?h.quality:void 0)||1)})},toBlob:function(C,h){return p(C,h).then(n.canvasToBlob)},toPixelData:function(C,h){return p(C,h).then(function(O){return O.getContext("2d").getImageData(0,0,n.width(C),n.height(C)).data})},toCanvas:p,impl:{fontFaces:s,images:t,util:n,inliner:b,urlCache:[],options:{},copyOptions:function(C){C.copyDefaultStyles===void 0?y.impl.options.copyDefaultStyles=c.copyDefaultStyles:y.impl.options.copyDefaultStyles=C.copyDefaultStyles,y.impl.options.imagePlaceholder=(C.imagePlaceholder===void 0?c:C).imagePlaceholder,y.impl.options.cacheBust=(C.cacheBust===void 0?c:C).cacheBust,y.impl.options.corsImg=(C.corsImg===void 0?c:C).corsImg,y.impl.options.useCredentials=(C.useCredentials===void 0?c:C).useCredentials,y.impl.options.useCredentialsFilters=(C.useCredentialsFilters===void 0?c:C).useCredentialsFilters,y.impl.options.httpTimeout=(C.httpTimeout===void 0?c:C).httpTimeout,y.impl.options.styleCaching=(C.styleCaching===void 0?c:C).styleCaching;}}},S=(typeof at=="object"&&typeof st=="object"?st.exports=y:i.domtoimage=y,(globalThis.Node===void 0?void 0:globalThis.Node.ELEMENT_NODE)||1),r=(i===void 0?void 0:i.getComputedStyle)||(globalThis.window===void 0?void 0:globalThis.window.getComputedStyle)||globalThis.getComputedStyle,a=(i===void 0?void 0:i.atob)||(globalThis.window===void 0?void 0:globalThis.window.atob)||globalThis.atob;function o(C,h){y.impl.util.getWindow(C);let f=(h=h||{},y.impl.copyOptions(h),[]);return Promise.resolve(C).then(function(u){if(u.nodeType===S)return u;var _=u,l=globalThis.document.createElement("span");return _.replaceWith(l),l.append(u),f.push({child:_,wrapper:l}),l}).then(function(u){return (function _(l,w,E,v){let T=w.filter;if(l===A||n.isHTMLScriptElement(l)||n.isHTMLStyleElement(l)||n.isHTMLLinkElement(l)||E!==null&&T&&!T(l))return Promise.resolve();return Promise.resolve(l).then(m).then(g).then(function(L){return x(L,P(l))}).then(D).then(function(L){return H(L,l)});function m(L){return n.isHTMLCanvasElement(L)?n.makeImage(L.toDataURL()):L.cloneNode(false)}function g(L){return w.adjustClonedNode&&w.adjustClonedNode(l,L,false),Promise.resolve(L)}function D(L){return w.adjustClonedNode&&w.adjustClonedNode(l,L,true),Promise.resolve(L)}function P(L){return n.isElementHostForOpenShadowRoot(L)?L.shadowRoot:L}function x(L,$){let B=K($),k=Promise.resolve();if(B.length!==0){let G=r(Q($));n.asArray(B).forEach(function(V){k=k.then(function(){return _(V,w,G).then(function(q){q&&L.appendChild(q);})});});}return k.then(function(){return L});function Q(G){return n.isShadowRoot(G)?G.host:G}function K(G){if(n.isShadowSlotElement(G)){let V=G.assignedNodes();if(V&&0<V.length)return V}return G.childNodes}}function H(L,$){return !n.isElement(L)||n.isShadowSlotElement($)?Promise.resolve(L):Promise.resolve().then(k).then(Q).then(K).then(G).then(B).then(function(){return L});function B(){n.isHTMLImageElement(L)&&(L.removeAttribute("loading"),$.srcset||$.sizes)&&(L.removeAttribute("srcset"),L.removeAttribute("sizes"),L.src=$.currentSrc||$.src);}function k(){function V(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=r(z);ie.cssText?(W.style.cssText=ie.cssText,V(ie,W.style)):(I(w,z,ie,E,W),E===null&&(["inset-block","inset-block-start","inset-block-end"].forEach(ae=>W.style.removeProperty(ae)),["left","right","top","bottom"].forEach(ae=>{W.style.getPropertyValue(ae)&&W.style.setProperty(ae,"0px");})));}q($,L);}function Q(){let V=n.uid();function q(z){let W=r($,z),ie=W.getPropertyValue("content");if(ie!==""&&ie!=="none"){let X=function(){let J=`.${V}:`+z,ne=(W.cssText?oe:j)();return globalThis.document.createTextNode(J+`{${ne}}`);function oe(){return `${W.cssText} content: ${ie};`}function j(){return n.asArray(W).map(ee).join("; ")+";";function ee(Y){let le=W.getPropertyValue(Y),ge=W.getPropertyPriority(Y)?" !important":"";return Y+": "+le+ge}}};let Z=L.getAttribute("class")||"",te=(L.setAttribute("class",Z+" "+V),globalThis.document.createElement("style"));te.appendChild(X()),L.appendChild(te);}}[":before",":after"].forEach(function(z){q(z);});}function K(){n.isHTMLTextAreaElement($)&&(L.innerHTML=$.value),n.isHTMLInputElement($)&&L.setAttribute("value",$.value);}function G(){n.isSVGElement(L)&&(L.setAttribute("xmlns","http://www.w3.org/2000/svg"),n.isSVGRectElement(L))&&["width","height"].forEach(function(V){let q=L.getAttribute(V);q&&L.style.setProperty(V,q);});}}})(u,h,null)}).then(h.disableEmbedFonts?Promise.resolve(C):R).then(h.disableInlineImages?Promise.resolve(C):U).then(function(u){h.bgcolor&&(u.style.backgroundColor=h.bgcolor),h.width&&(u.style.width=h.width+"px"),h.height&&(u.style.height=h.height+"px"),h.style&&Object.keys(h.style).forEach(function(l){u.style[l]=h.style[l];});let _=null;return typeof h.onclone=="function"&&(_=h.onclone(u)),Promise.resolve(_).then(function(){return u})}).then(function(u){let _=h.width||n.width(C),l=h.height||n.height(C);return Promise.resolve(u).then(function(w){return w.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(w)}).then(n.escapeXhtml).then(function(w){var E=(n.isDimensionMissing(_)?' width="100%"':` width="${_}"`)+(n.isDimensionMissing(l)?' height="100%"':` height="${l}"`);return `<svg xmlns="http://www.w3.org/2000/svg"${(n.isDimensionMissing(_)?"":` width="${_}"`)+(n.isDimensionMissing(l)?"":` height="${l}"`)}><foreignObject${E}>${w}</foreignObject></svg>`}).then(function(w){return "data:image/svg+xml;charset=utf-8,"+w})}).then(function(u){for(;0<f.length;){var _=f.pop();_.wrapper.replaceWith(_.child);}return u}).then(function(u){return y.impl.urlCache=[],A&&(globalThis.document.body.removeChild(A),A=null),N&&clearTimeout(N),N=setTimeout(()=>{N=null,F={};},2e4),u})}function p(C,h){return o(C,h=h||{}).then(n.makeImage).then(function(O){var f=typeof h.scale!="number"?1:h.scale,u=((l,w)=>{let E=h.width||n.width(l),v=h.height||n.height(l);return n.isDimensionMissing(E)&&(E=n.isDimensionMissing(v)?300:2*v),n.isDimensionMissing(v)&&(v=E/2),(l=globalThis.document.createElement("canvas")).width=E*w,l.height=v*w,h.bgcolor&&((w=l.getContext("2d")).fillStyle=h.bgcolor,w.fillRect(0,0,l.width,l.height)),l})(C,f),_=u.getContext("2d");return _.msImageSmoothingEnabled=false,_.imageSmoothingEnabled=false,O&&(_.scale(f,f),_.drawImage(O,0,0)),u})}let A=null;function R(C){return s.resolveAll().then(function(h){var O;return h!==""&&(O=globalThis.document.createElement("style"),C.appendChild(O),O.appendChild(globalThis.document.createTextNode(h))),C})}function U(C){return t.inlineAll(C).then(function(){return C})}function I(C,h,O,f,u){let _=y.impl.options.copyDefaultStyles?((w,E)=>{var v,T=(D=>(w.styleCaching!=="relaxed"?D:D.filter((P,x,H)=>x===0||x===H.length-1)).join(">"))(E=(D=>{var P=[];do if(D.nodeType===S){var x=D.tagName;if(P.push(x),M.includes(x))break}while(D=D.parentNode);return P})(E));{if(F[T])return F[T];E=((D,P)=>{let x=D.body;do{var H=P.pop(),H=D.createElement(H);x.appendChild(H),x=H;}while(0<P.length);return x.textContent="\u200B",x})((v=(()=>{if(A)return A.contentWindow;P=globalThis.document.characterSet||"UTF-8",D=(D=globalThis.document.doctype)?(`<!DOCTYPE ${k(D.name)} ${k(D.publicId)} `+k(D.systemId)).trim()+">":"",(A=globalThis.document.createElement("iframe")).id="domtoimage-sandbox-"+n.uid(),A.style.top="-9999px",A.style.visibility="hidden",A.style.position="fixed",globalThis.document.body.appendChild(A);var D,P,x=A,H="domtoimage-sandbox";try{return x.contentWindow.document.write(D+`<html><head><meta charset='${P}'><title>${H}</title></head><body></body></html>`),x.contentWindow}catch{}var L=globalThis.document.createElement("meta");L.setAttribute("charset",P);try{var $=globalThis.document.implementation.createHTMLDocument(H),B=($.head.appendChild(L),D+$.documentElement.outerHTML);return x.setAttribute("srcdoc",B),x.contentWindow}catch{}return x.contentDocument.head.appendChild(L),x.contentDocument.title=H,x.contentWindow;function k(Q){var K;return Q?((K=globalThis.document.createElement("div")).innerText=Q,K.innerHTML):""}})()).document,E),v=((D,P)=>{let x={},H=D.getComputedStyle(P);return n.asArray(H).forEach(function(L){x[L]=L==="width"||L==="height"?"auto":H.getPropertyValue(L);}),x})(v,E);var m=E;do{var g=m.parentElement;g!==null&&g.removeChild(m),m=g;}while(m&&m.tagName!=="BODY");return F[T]=v}})(C,h):{},l=u.style;n.asArray(O).forEach(function(w){var E,v,T,m;C.filterStyles&&!C.filterStyles(h,w)||(v=O.getPropertyValue(w),T=_[w],E=f?f.getPropertyValue(w):void 0,l.getPropertyValue(w))||(v!==T||f&&v!==E)&&(T=O.getPropertyPriority(w),E=l,v=v,T=T,m=0<=["background-clip"].indexOf(w=w),T?(E.setProperty(w,v,T),m&&E.setProperty("-webkit-"+w,v,T)):(E.setProperty(w,v),m&&E.setProperty("-webkit-"+w,v)));});}let N=null,F={},M=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","DETAILS","DIALOG","DD","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","LI","MAIN","NAV","OL","P","PRE","SECTION","SVG","TABLE","UL","math","svg","BODY","HEAD","HTML"];})(at);});var Wt=nt(()=>{});var fn=nt((Kr,un)=>{var yt=typeof Map=="function"&&Map.prototype,lt=Object.getOwnPropertyDescriptor&&yt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Xe=yt&<&&typeof lt.get=="function"?lt.get:null,Vt=yt&&Map.prototype.forEach,wt=typeof Set=="function"&&Set.prototype,ct=Object.getOwnPropertyDescriptor&&wt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Je=wt&&ct&&typeof ct.get=="function"?ct.get:null,zt=wt&&Set.prototype.forEach,Qn=typeof WeakMap=="function"&&WeakMap.prototype,Ne=Qn?WeakMap.prototype.has:null,Wn=typeof WeakSet=="function"&&WeakSet.prototype,Be=Wn?WeakSet.prototype.has:null,Vn=typeof WeakRef=="function"&&WeakRef.prototype,Gt=Vn?WeakRef.prototype.deref:null,zn=Boolean.prototype.valueOf,Gn=Object.prototype.toString,qn=Function.prototype.toString,Kn=String.prototype.match,vt=String.prototype.slice,Ee=String.prototype.replace,Yn=String.prototype.toUpperCase,qt=String.prototype.toLowerCase,nn=RegExp.prototype.test,Kt=Array.prototype.concat,we=Array.prototype.join,Xn=Array.prototype.slice,Yt=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,De=typeof Symbol=="function"&&typeof Symbol.iterator=="object",He=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===De||true)?Symbol.toStringTag:null,rn=Object.prototype.propertyIsEnumerable,Xt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(i){return i.__proto__}:null);function Jt(i,n){if(i===1/0||i===-1/0||i!==i||i&&i>-1e3&&i<1e3||nn.call(/e/,n))return n;var b=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof i=="number"){var s=i<0?-Yt(-i):Yt(i);if(s!==i){var e=String(s),t=vt.call(n,e.length+1);return Ee.call(e,b,"$&_")+"."+Ee.call(Ee.call(t,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ee.call(n,b,"$&_")}var ht=Wt(),Zt=ht.custom,jt=sn(Zt)?Zt:null,on={__proto__:null,double:'"',single:"'"},Jn={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};un.exports=function i(n,b,s,e){var t=b||{};if(Ae(t,"quoteStyle")&&!Ae(on,t.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ae(t,"maxStringLength")&&(typeof t.maxStringLength=="number"?t.maxStringLength<0&&t.maxStringLength!==1/0:t.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var d=Ae(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(Ae(t,"indent")&&t.indent!==null&&t.indent!==" "&&!(parseInt(t.indent,10)===t.indent&&t.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ae(t,"numericSeparator")&&typeof t.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var c=t.numericSeparator;if(typeof n>"u")return "undefined";if(n===null)return "null";if(typeof n=="boolean")return n?"true":"false";if(typeof n=="string")return cn(n,t);if(typeof n=="number"){if(n===0)return 1/0/n>0?"0":"-0";var y=String(n);return c?Jt(n,y):y}if(typeof n=="bigint"){var S=String(n)+"n";return c?Jt(n,S):S}var r=typeof t.depth>"u"?5:t.depth;if(typeof s>"u"&&(s=0),s>=r&&r>0&&typeof n=="object")return gt(n)?"[Array]":"[Object]";var a=gr(t,s);if(typeof e>"u")e=[];else if(ln(e,n)>=0)return "[Circular]";function o(E,v,T){if(v&&(e=Xn.call(e),e.push(v)),T){var m={depth:t.depth};return Ae(t,"quoteStyle")&&(m.quoteStyle=t.quoteStyle),i(E,m,s+1,e)}return i(E,t,s+1,e)}if(typeof n=="function"&&!en(n)){var p=ar(n),A=Ye(n,o);return "[Function"+(p?": "+p:" (anonymous)")+"]"+(A.length>0?" { "+we.call(A,", ")+" }":"")}if(sn(n)){var R=De?Ee.call(String(n),/^(Symbol\(.*\))_[^)]*$/,"$1"):pt.call(n);return typeof n=="object"&&!De?Fe(R):R}if(dr(n)){for(var U="<"+qt.call(String(n.nodeName)),I=n.attributes||[],N=0;N<I.length;N++)U+=" "+I[N].name+"="+an(Zn(I[N].value),"double",t);return U+=">",n.childNodes&&n.childNodes.length&&(U+="..."),U+="</"+qt.call(String(n.nodeName))+">",U}if(gt(n)){if(n.length===0)return "[]";var F=Ye(n,o);return a&&!hr(F)?"["+mt(F,a)+"]":"[ "+we.call(F,", ")+" ]"}if(er(n)){var M=Ye(n,o);return !("cause"in Error.prototype)&&"cause"in n&&!rn.call(n,"cause")?"{ ["+String(n)+"] "+we.call(Kt.call("[cause]: "+o(n.cause),M),", ")+" }":M.length===0?"["+String(n)+"]":"{ ["+String(n)+"] "+we.call(M,", ")+" }"}if(typeof n=="object"&&d){if(jt&&typeof n[jt]=="function"&&ht)return ht(n,{depth:r-s});if(d!=="symbol"&&typeof n.inspect=="function")return n.inspect()}if(sr(n)){var C=[];return Vt&&Vt.call(n,function(E,v){C.push(o(v,n,true)+" => "+o(E,n));}),tn("Map",Xe.call(n),C,a)}if(ur(n)){var h=[];return zt&&zt.call(n,function(E){h.push(o(E,n));}),tn("Set",Je.call(n),h,a)}if(lr(n))return ft("WeakMap");if(fr(n))return ft("WeakSet");if(cr(n))return ft("WeakRef");if(nr(n))return Fe(o(Number(n)));if(or(n))return Fe(o(dt.call(n)));if(rr(n))return Fe(zn.call(n));if(tr(n))return Fe(o(String(n)));if(typeof globalThis.window<"u"&&n===globalThis.window)return "{ [object Window] }";if(typeof globalThis<"u"&&n===globalThis||typeof global<"u"&&n===global)return "{ [object globalThis] }";if(!jn(n)&&!en(n)){var O=Ye(n,o),f=Xt?Xt(n)===Object.prototype:n instanceof Object||n.constructor===Object,u=n instanceof Object?"":"null prototype",_=!f&&He&&Object(n)===n&&He in n?vt.call(Se(n),8,-1):u?"Object":"",l=f||typeof n.constructor!="function"?"":n.constructor.name?n.constructor.name+" ":"",w=l+(_||u?"["+we.call(Kt.call([],_||[],u||[]),": ")+"] ":"");return O.length===0?w+"{}":a?w+"{"+mt(O,a)+"}":w+"{ "+we.call(O,", ")+" }"}return String(n)};function an(i,n,b){var s=b.quoteStyle||n,e=on[s];return e+i+e}function Zn(i){return Ee.call(String(i),/"/g,""")}function Pe(i){return !He||!(typeof i=="object"&&(He in i||typeof i[He]<"u"))}function gt(i){return Se(i)==="[object Array]"&&Pe(i)}function jn(i){return Se(i)==="[object Date]"&&Pe(i)}function en(i){return Se(i)==="[object RegExp]"&&Pe(i)}function er(i){return Se(i)==="[object Error]"&&Pe(i)}function tr(i){return Se(i)==="[object String]"&&Pe(i)}function nr(i){return Se(i)==="[object Number]"&&Pe(i)}function rr(i){return Se(i)==="[object Boolean]"&&Pe(i)}function sn(i){if(De)return i&&typeof i=="object"&&i instanceof Symbol;if(typeof i=="symbol")return true;if(!i||typeof i!="object"||!pt)return false;try{return pt.call(i),!0}catch{}return false}function or(i){if(!i||typeof i!="object"||!dt)return false;try{return dt.call(i),!0}catch{}return false}var ir=Object.prototype.hasOwnProperty||function(i){return i in this};function Ae(i,n){return ir.call(i,n)}function Se(i){return Gn.call(i)}function ar(i){if(i.name)return i.name;var n=Kn.call(qn.call(i),/^function\s*([\w$]+)/);return n?n[1]:null}function ln(i,n){if(i.indexOf)return i.indexOf(n);for(var b=0,s=i.length;b<s;b++)if(i[b]===n)return b;return -1}function sr(i){if(!Xe||!i||typeof i!="object")return false;try{Xe.call(i);try{Je.call(i);}catch{return !0}return i instanceof Map}catch{}return false}function lr(i){if(!Ne||!i||typeof i!="object")return false;try{Ne.call(i,Ne);try{Be.call(i,Be);}catch{return !0}return i instanceof WeakMap}catch{}return false}function cr(i){if(!Gt||!i||typeof i!="object")return false;try{return Gt.call(i),!0}catch{}return false}function ur(i){if(!Je||!i||typeof i!="object")return false;try{Je.call(i);try{Xe.call(i);}catch{return !0}return i instanceof Set}catch{}return false}function fr(i){if(!Be||!i||typeof i!="object")return false;try{Be.call(i,Be);try{Ne.call(i,Ne);}catch{return !0}return i instanceof WeakSet}catch{}return false}function dr(i){return !i||typeof i!="object"?false:typeof HTMLElement<"u"&&i instanceof HTMLElement?true:typeof i.nodeName=="string"&&typeof i.getAttribute=="function"}function cn(i,n){if(i.length>n.maxStringLength){var b=i.length-n.maxStringLength,s="... "+b+" more character"+(b>1?"s":"");return cn(vt.call(i,0,n.maxStringLength),n)+s}var e=Jn[n.quoteStyle||"single"];e.lastIndex=0;var t=Ee.call(Ee.call(i,e,"\\$1"),/[\x00-\x1f]/g,pr);return an(t,"single",n)}function pr(i){var n=i.charCodeAt(0),b={8:"b",9:"t",10:"n",12:"f",13:"r"}[n];return b?"\\"+b:"\\x"+(n<16?"0":"")+Yn.call(n.toString(16))}function Fe(i){return "Object("+i+")"}function ft(i){return i+" { ? }"}function tn(i,n,b,s){var e=s?mt(b,s):we.call(b,", ");return i+" ("+n+") {"+e+"}"}function hr(i){for(var n=0;n<i.length;n++)if(ln(i[n],`
|
|
3
|
+
`)>=0)return false;return true}function gr(i,n){var b;if(i.indent===" ")b=" ";else if(typeof i.indent=="number"&&i.indent>0)b=we.call(Array(i.indent+1)," ");else return null;return {base:b,prev:we.call(Array(n+1),b)}}function mt(i,n){if(i.length===0)return "";var b=`
|
|
4
|
+
`+n.prev+n.base;return b+we.call(i,","+b)+`
|
|
5
|
+
`+n.prev}function Ye(i,n){var b=gt(i),s=[];if(b){s.length=i.length;for(var e=0;e<i.length;e++)s[e]=Ae(i,e)?n(i[e],i):"";}var t=typeof ut=="function"?ut(i):[],d;if(De){d={};for(var c=0;c<t.length;c++)d["$"+t[c]]=t[c];}for(var y in i)Ae(i,y)&&(b&&String(Number(y))===y&&y<i.length||De&&d["$"+y]instanceof Symbol||(nn.call(/[^\w$]/,y)?s.push(n(y,i)+": "+n(i[y],i)):s.push(y+": "+n(i[y],i))));if(typeof ut=="function")for(var S=0;S<t.length;S++)rn.call(i,t[S])&&s.push("["+n(t[S])+"]: "+n(i[t[S]],i));return s}});function Dn(i,n){return n.forEach((function(b){b&&typeof b!="string"&&!Array.isArray(b)&&Object.keys(b).forEach((function(s){if(s!=="default"&&!(s in i)){var e=Object.getOwnPropertyDescriptor(b,s);Object.defineProperty(i,s,e.get?e:{enumerable:true,get:function(){return b[s]}});}}));})),Object.freeze(i)}function xt(i,n){return new Promise((function(b,s){let e;return Ln(i).then((function(t){try{return e=t,b(new Blob([n.slice(0,2),e,n.slice(2)],{type:"image/jpeg"}))}catch(d){return s(d)}}),s)}))}var Ln=i=>new Promise(((n,b)=>{let s=new globalThis.FileReader;s.addEventListener("load",(({target:{result:e}})=>{let t=new DataView(e),d=0;if(t.getUint16(d)!==65496)return b("not a valid JPEG");for(d+=2;;){let c=t.getUint16(d);if(c===65498)break;let y=t.getUint16(d+2);if(c===65505&&t.getUint32(d+4)===1165519206){let S=d+10,r;switch(t.getUint16(S)){case 18761:r=true;break;case 19789:r=false;break;default:return b("TIFF header contains invalid endian")}if(t.getUint16(S+2,r)!==42)return b("TIFF header contains invalid version");let a=t.getUint32(S+4,r),o=S+a+2+12*t.getUint16(S+a,r);for(let p=S+a+2;p<o;p+=12)if(t.getUint16(p,r)==274){if(t.getUint16(p+2,r)!==3)return b("Orientation data type is invalid");if(t.getUint32(p+4,r)!==1)return b("Orientation data count is invalid");t.setUint16(p+8,1,r);break}return n(e.slice(d,d+2+y))}d+=2+y;}return n(new Blob)})),s.readAsArrayBuffer(i);})),Ve={},kn={get exports(){return Ve},set exports(i){Ve=i;}};(function(i){var n,b,s={};kn.exports=s,s.parse=function(e,t){for(var d=s.bin.readUshort,c=s.bin.readUint,y=0,S={},r=new Uint8Array(e),a=r.length-4;c(r,a)!=101010256;)a--;y=a,y+=4;var o=d(r,y+=4);d(r,y+=2);var p=c(r,y+=2),A=c(r,y+=4);y+=4,y=A;for(var R=0;R<o;R++){c(r,y),y+=4,y+=4,y+=4,c(r,y+=4),p=c(r,y+=4);var U=c(r,y+=4),I=d(r,y+=4),N=d(r,y+2),F=d(r,y+4);y+=6;var M=c(r,y+=8);y+=4,y+=I+N+F,s._readLocal(r,M,S,p,U,t);}return S},s._readLocal=function(e,t,d,c,y,S){var r=s.bin.readUshort,a=s.bin.readUint;a(e,t),r(e,t+=4),r(e,t+=2);var o=r(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var p=r(e,t+=8),A=r(e,t+=2);t+=2;var R=s.bin.readUTF8(e,t,p);if(t+=p,t+=A,S)d[R]={size:y,csize:c};else {var U=new Uint8Array(e.buffer,t);if(o==0)d[R]=new Uint8Array(U.buffer.slice(t,t+c));else {if(o!=8)throw "unknown compression method: "+o;var I=new Uint8Array(y);s.inflateRaw(U,I),d[R]=I;}}},s.inflateRaw=function(e,t){return s.F.inflate(e,t)},s.inflate=function(e,t){return e[0],e[1],s.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},s.deflate=function(e,t){t==null&&(t={level:6});var d=0,c=new Uint8Array(50+Math.floor(1.1*e.length));c[d]=120,c[d+1]=156,d+=2,d=s.F.deflateRaw(e,c,d,t.level);var y=s.adler(e,0,e.length);return c[d+0]=y>>>24&255,c[d+1]=y>>>16&255,c[d+2]=y>>>8&255,c[d+3]=y>>>0&255,new Uint8Array(c.buffer,0,d+4)},s.deflateRaw=function(e,t){t==null&&(t={level:6});var d=new Uint8Array(50+Math.floor(1.1*e.length)),c=s.F.deflateRaw(e,d,c,t.level);return new Uint8Array(d.buffer,0,c)},s.encode=function(e,t){t==null&&(t=false);var d=0,c=s.bin.writeUint,y=s.bin.writeUshort,S={};for(var r in e){var a=!s._noNeed(r)&&!t,o=e[r],p=s.crc.crc(o,0,o.length);S[r]={cpr:a,usize:o.length,crc:p,file:a?s.deflateRaw(o):o};}for(var r in S)d+=S[r].file.length+30+46+2*s.bin.sizeUTF8(r);d+=22;var A=new Uint8Array(d),R=0,U=[];for(var r in S){var I=S[r];U.push(R),R=s._writeHeader(A,R,r,I,0);}var N=0,F=R;for(var r in S)I=S[r],U.push(R),R=s._writeHeader(A,R,r,I,1,U[N++]);var M=R-F;return c(A,R,101010256),R+=4,y(A,R+=4,N),y(A,R+=2,N),c(A,R+=2,M),c(A,R+=4,F),R+=4,R+=2,A.buffer},s._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return "png,jpg,jpeg,zip".indexOf(t)!=-1},s._writeHeader=function(e,t,d,c,y,S){var r=s.bin.writeUint,a=s.bin.writeUshort,o=c.file;return r(e,t,y==0?67324752:33639248),t+=4,y==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,c.cpr?8:0),r(e,t+=2,0),r(e,t+=4,c.crc),r(e,t+=4,o.length),r(e,t+=4,c.usize),a(e,t+=4,s.bin.sizeUTF8(d)),a(e,t+=2,0),t+=2,y==1&&(t+=2,t+=2,r(e,t+=6,S),t+=4),t+=s.bin.writeUTF8(e,t,d),y==0&&(e.set(o,t),t+=o.length),t},s.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var d=t,c=0;c<8;c++)1&d?d=3988292384^d>>>1:d>>>=1;e[t]=d;}return e})(),update:function(e,t,d,c){for(var y=0;y<c;y++)e=s.crc.table[255&(e^t[d+y])]^e>>>8;return e},crc:function(e,t,d){return 4294967295^s.crc.update(4294967295,e,t,d)}},s.adler=function(e,t,d){for(var c=1,y=0,S=t,r=t+d;S<r;){for(var a=Math.min(S+5552,r);S<a;)y+=c+=e[S++];c%=65521,y%=65521;}return y<<16|c},s.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,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 c="",y=0;y<d;y++)c+=String.fromCharCode(e[t+y]);return c},writeASCII:function(e,t,d){for(var c=0;c<d.length;c++)e[t+c]=d.charCodeAt(c);},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,d){for(var c,y="",S=0;S<d;S++)y+="%"+s.bin.pad(e[t+S].toString(16));try{c=decodeURIComponent(y);}catch{return s.bin.readASCII(e,t,d)}return c},writeUTF8:function(e,t,d){for(var c=d.length,y=0,S=0;S<c;S++){var r=d.charCodeAt(S);if((4294967168&r)==0)e[t+y]=r,y++;else if((4294965248&r)==0)e[t+y]=192|r>>6,e[t+y+1]=128|r>>0&63,y+=2;else if((4294901760&r)==0)e[t+y]=224|r>>12,e[t+y+1]=128|r>>6&63,e[t+y+2]=128|r>>0&63,y+=3;else {if((4292870144&r)!=0)throw "e";e[t+y]=240|r>>18,e[t+y+1]=128|r>>12&63,e[t+y+2]=128|r>>6&63,e[t+y+3]=128|r>>0&63,y+=4;}}return y},sizeUTF8:function(e){for(var t=e.length,d=0,c=0;c<t;c++){var y=e.charCodeAt(c);if((4294967168&y)==0)d++;else if((4294965248&y)==0)d+=2;else if((4294901760&y)==0)d+=3;else {if((4292870144&y)!=0)throw "e";d+=4;}}return d}},s.F={},s.F.deflateRaw=function(e,t,d,c){var y=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][c],S=s.F.U,r=s.F._goodIndex;s.F._hash;var a=s.F._putsE,o=0,p=d<<3,A=0,R=e.length;if(c==0){for(;o<R;)a(t,p,o+(l=Math.min(65535,R-o))==R?1:0),p=s.F._copyExact(e,o,l,t,p+8),o+=l;return p>>>3}var U=S.lits,I=S.strt,N=S.prev,F=0,M=0,C=0,h=0,O=0,f=0;for(R>2&&(I[f=s.F._hash(e,0)]=0),o=0;o<R;o++){if(O=f,o+1<R-2){f=s.F._hash(e,o+1);var u=o+1&32767;N[u]=I[f],I[f]=u;}if(A<=o){(F>14e3||M>26697)&&R-o>100&&(A<o&&(U[F]=o-A,F+=2,A=o),p=s.F._writeBlock(o==R-1||A==R?1:0,U,F,h,e,C,o-C,t,p),F=M=h=0,C=o);var _=0;o<R-2&&(_=s.F._bestMatch(e,o,N,O,Math.min(y[2],R-o),y[3]));var l=_>>>16,w=65535&_;if(_!=0){w=65535&_;var E=r(l=_>>>16,S.of0);S.lhst[257+E]++;var v=r(w,S.df0);S.dhst[v]++,h+=S.exb[E]+S.dxb[v],U[F]=l<<23|o-A,U[F+1]=w<<16|E<<8|v,F+=2,A=o+l;}else S.lhst[e[o]]++;M++;}}for(C==o&&e.length!=0||(A<o&&(U[F]=o-A,F+=2,A=o),p=s.F._writeBlock(1,U,F,h,e,C,o-C,t,p),F=0,M=0,F=M=h=0,C=o);(7&p)!=0;)p++;return p>>>3},s.F._bestMatch=function(e,t,d,c,y,S){var r=32767&t,a=d[r],o=r-a+32768&32767;if(a==r||c!=s.F._hash(e,t-o))return 0;for(var p=0,A=0,R=Math.min(32767,t);o<=R&&--S!=0&&a!=r;){if(p==0||e[t+p]==e[t+p-o]){var U=s.F._howLong(e,t,o);if(U>p){if(A=o,(p=U)>=y)break;o+2<U&&(U=o+2);for(var I=0,N=0;N<U-2;N++){var F=t-o+N+32768&32767,M=F-d[F]+32768&32767;M>I&&(I=M,a=F);}}}o+=(r=a)-(a=d[r])+32768&32767;}return p<<16|A},s.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 c=t,y=Math.min(e.length,t+258);for(t+=3;t<y&&e[t]==e[t-d];)t++;return t-c},s.F._hash=function(e,t){return (e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},s.saved=0,s.F._writeBlock=function(e,t,d,c,y,S,r,a,o){var p,A,R,U,I,N,F,M,C,h=s.F.U,O=s.F._putsF,f=s.F._putsE;h.lhst[256]++,A=(p=s.F.getTrees())[0],R=p[1],U=p[2],I=p[3],N=p[4],F=p[5],M=p[6],C=p[7];var u=32+((o+3&7)==0?0:8-(o+3&7))+(r<<3),_=c+s.F.contSize(h.fltree,h.lhst)+s.F.contSize(h.fdtree,h.dhst),l=c+s.F.contSize(h.ltree,h.lhst)+s.F.contSize(h.dtree,h.dhst);l+=14+3*F+s.F.contSize(h.itree,h.ihst)+(2*h.ihst[16]+3*h.ihst[17]+7*h.ihst[18]);for(var w=0;w<286;w++)h.lhst[w]=0;for(w=0;w<30;w++)h.dhst[w]=0;for(w=0;w<19;w++)h.ihst[w]=0;var E=u<_&&u<l?0:_<l?1:2;if(O(a,o,e),O(a,o+1,E),o+=3,E==0){for(;(7&o)!=0;)o++;o=s.F._copyExact(y,S,r,a,o);}else {var v,T;if(E==1&&(v=h.fltree,T=h.fdtree),E==2){s.F.makeCodes(h.ltree,A),s.F.revCodes(h.ltree,A),s.F.makeCodes(h.dtree,R),s.F.revCodes(h.dtree,R),s.F.makeCodes(h.itree,U),s.F.revCodes(h.itree,U),v=h.ltree,T=h.dtree,f(a,o,I-257),f(a,o+=5,N-1),f(a,o+=5,F-4),o+=4;for(var m=0;m<F;m++)f(a,o+3*m,h.itree[1+(h.ordr[m]<<1)]);o+=3*F,o=s.F._codeTiny(M,h.itree,a,o),o=s.F._codeTiny(C,h.itree,a,o);}for(var g=S,D=0;D<d;D+=2){for(var P=t[D],x=P>>>23,H=g+(8388607&P);g<H;)o=s.F._writeLit(y[g++],v,a,o);if(x!=0){var L=t[D+1],$=L>>16,B=L>>8&255,k=255&L;f(a,o=s.F._writeLit(257+B,v,a,o),x-h.of0[B]),o+=h.exb[B],O(a,o=s.F._writeLit(k,T,a,o),$-h.df0[k]),o+=h.dxb[k],g+=x;}}o=s.F._writeLit(256,v,a,o);}return o},s.F._copyExact=function(e,t,d,c,y){var S=y>>>3;return c[S]=d,c[S+1]=d>>>8,c[S+2]=255-c[S],c[S+3]=255-c[S+1],S+=4,c.set(new Uint8Array(e.buffer,t,d),S),y+(d+4<<3)},s.F.getTrees=function(){for(var e=s.F.U,t=s.F._hufTree(e.lhst,e.ltree,15),d=s.F._hufTree(e.dhst,e.dtree,15),c=[],y=s.F._lenCodes(e.ltree,c),S=[],r=s.F._lenCodes(e.dtree,S),a=0;a<c.length;a+=2)e.ihst[c[a]]++;for(a=0;a<S.length;a+=2)e.ihst[S[a]]++;for(var o=s.F._hufTree(e.ihst,e.itree,7),p=19;p>4&&e.itree[1+(e.ordr[p-1]<<1)]==0;)p--;return [t,d,o,y,r,p,c,S]},s.F.getSecond=function(e){for(var t=[],d=0;d<e.length;d+=2)t.push(e[d+1]);return t},s.F.nonZero=function(e){for(var t="",d=0;d<e.length;d+=2)e[d+1]!=0&&(t+=(d>>1)+",");return t},s.F.contSize=function(e,t){for(var d=0,c=0;c<t.length;c++)d+=t[c]*e[1+(c<<1)];return d},s.F._codeTiny=function(e,t,d,c){for(var y=0;y<e.length;y+=2){var S=e[y],r=e[y+1];c=s.F._writeLit(S,t,d,c);var a=S==16?2:S==17?3:7;S>15&&(s.F._putsE(d,c,r,a),c+=a);}return c},s.F._lenCodes=function(e,t){for(var d=e.length;d!=2&&e[d-1]==0;)d-=2;for(var c=0;c<d;c+=2){var y=e[c+1],S=c+3<d?e[c+3]:-1,r=c+5<d?e[c+5]:-1,a=c==0?-1:e[c-1];if(y==0&&S==y&&r==y){for(var o=c+5;o+2<d&&e[o+2]==y;)o+=2;(p=Math.min(o+1-c>>>1,138))<11?t.push(17,p-3):t.push(18,p-11),c+=2*p-2;}else if(y==a&&S==y&&r==y){for(o=c+5;o+2<d&&e[o+2]==y;)o+=2;var p=Math.min(o+1-c>>>1,6);t.push(16,p-3),c+=2*p-2;}else t.push(y,0);}return d>>>1},s.F._hufTree=function(e,t,d){var c=[],y=e.length,S=t.length,r=0;for(r=0;r<S;r+=2)t[r]=0,t[r+1]=0;for(r=0;r<y;r++)e[r]!=0&&c.push({lit:r,f:e[r]});var a=c.length,o=c.slice(0);if(a==0)return 0;if(a==1){var p=c[0].lit;return o=p==0?1:0,t[1+(p<<1)]=1,t[1+(o<<1)]=1,1}c.sort((function(M,C){return M.f-C.f}));var A=c[0],R=c[1],U=0,I=1,N=2;for(c[0]={lit:-1,f:A.f+R.f,l:A,r:R,d:0};I!=a-1;)A=U!=I&&(N==a||c[U].f<c[N].f)?c[U++]:c[N++],R=U!=I&&(N==a||c[U].f<c[N].f)?c[U++]:c[N++],c[I++]={lit:-1,f:A.f+R.f,l:A,r:R};var F=s.F.setDepth(c[I-1],0);for(F>d&&(s.F.restrictDepth(o,d,F),F=d),r=0;r<a;r++)t[1+(o[r].lit<<1)]=o[r].d;return F},s.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(s.F.setDepth(e.l,t+1),s.F.setDepth(e.r,t+1))},s.F.restrictDepth=function(e,t,d){var c=0,y=1<<d-t,S=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),c=0;c<e.length&&e[c].d>t;c++){var r=e[c].d;e[c].d=t,S+=y-(1<<d-r);}for(S>>>=d-t;S>0;)(r=e[c].d)<t?(e[c].d++,S-=1<<t-r-1):c++;for(;c>=0;c--)e[c].d==t&&S<0&&(e[c].d--,S++);S!=0&&console.log("debt left");},s.F._goodIndex=function(e,t){var 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},s.F._writeLit=function(e,t,d,c){return s.F._putsF(d,c,t[e<<1]),c+t[1+(e<<1)]},s.F.inflate=function(e,t){var d=Uint8Array;if(e[0]==3&&e[1]==0)return t||new d(0);var c=s.F,y=c._bitsF,S=c._bitsE,r=c._decodeTiny,a=c.makeCodes,o=c.codes2map,p=c._get17,A=c.U,R=t==null;R&&(t=new d(e.length>>>2<<3));for(var U,I,N=0,F=0,M=0,C=0,h=0,O=0,f=0,u=0,_=0;N==0;)if(N=y(e,_,1),F=y(e,_+1,2),_+=3,F!=0){if(R&&(t=s.F._check(t,u+(1<<17))),F==1&&(U=A.flmap,I=A.fdmap,O=511,f=31),F==2){M=S(e,_,5)+257,C=S(e,_+5,5)+1,h=S(e,_+10,4)+4,_+=14;for(var l=0;l<38;l+=2)A.itree[l]=0,A.itree[l+1]=0;var w=1;for(l=0;l<h;l++){var E=S(e,_+3*l,3);A.itree[1+(A.ordr[l]<<1)]=E,E>w&&(w=E);}_+=3*h,a(A.itree,w),o(A.itree,w,A.imap),U=A.lmap,I=A.dmap,_=r(A.imap,(1<<w)-1,M+C,e,_,A.ttree);var v=c._copyOut(A.ttree,0,M,A.ltree);O=(1<<v)-1;var T=c._copyOut(A.ttree,M,C,A.dtree);f=(1<<T)-1,a(A.ltree,v),o(A.ltree,v,U),a(A.dtree,T),o(A.dtree,T,I);}for(;;){var m=U[p(e,_)&O];_+=15&m;var g=m>>>4;if(!(g>>>8))t[u++]=g;else {if(g==256)break;var D=u+g-254;if(g>264){var P=A.ldef[g-257];D=u+(P>>>3)+S(e,_,7&P),_+=7&P;}var x=I[p(e,_)&f];_+=15&x;var H=x>>>4,L=A.ddef[H],$=(L>>>4)+y(e,_,15&L);for(_+=15&L,R&&(t=s.F._check(t,u+(1<<17)));u<D;)t[u]=t[u++-$],t[u]=t[u++-$],t[u]=t[u++-$],t[u]=t[u++-$];u=D;}}}else {(7&_)!=0&&(_+=8-(7&_));var B=4+(_>>>3),k=e[B-4]|e[B-3]<<8;R&&(t=s.F._check(t,u+k)),t.set(new d(e.buffer,e.byteOffset+B,k),u),_=B+k<<3,u+=k;}return t.length==u?t:t.slice(0,u)},s.F._check=function(e,t){var d=e.length;if(t<=d)return e;var c=new Uint8Array(Math.max(d<<1,t));return c.set(e,0),c},s.F._decodeTiny=function(e,t,d,c,y,S){for(var r=s.F._bitsE,a=s.F._get17,o=0;o<d;){var p=e[a(c,y)&t];y+=15&p;var A=p>>>4;if(A<=15)S[o]=A,o++;else {var R=0,U=0;A==16?(U=3+r(c,y,2),y+=2,R=S[o-1]):A==17?(U=3+r(c,y,3),y+=3):A==18&&(U=11+r(c,y,7),y+=7);for(var I=o+U;o<I;)S[o]=R,o++;}}return y},s.F._copyOut=function(e,t,d,c){for(var y=0,S=0,r=c.length>>>1;S<d;){var a=e[S+t];c[S<<1]=0,c[1+(S<<1)]=a,a>y&&(y=a),S++;}for(;S<r;)c[S<<1]=0,c[1+(S<<1)]=0,S++;return y},s.F.makeCodes=function(e,t){for(var d,c,y,S,r=s.F.U,a=e.length,o=r.bl_count,p=0;p<=t;p++)o[p]=0;for(p=1;p<a;p+=2)o[e[p]]++;var A=r.next_code;for(d=0,o[0]=0,c=1;c<=t;c++)d=d+o[c-1]<<1,A[c]=d;for(y=0;y<a;y+=2)(S=e[y+1])!=0&&(e[y]=A[S],A[S]++);},s.F.codes2map=function(e,t,d){for(var c=e.length,y=s.F.U.rev15,S=0;S<c;S+=2)if(e[S+1]!=0)for(var r=S>>1,a=e[S+1],o=r<<4|a,p=t-a,A=e[S]<<p,R=A+(1<<p);A!=R;)d[y[A]>>>15-t]=o,A++;},s.F.revCodes=function(e,t){for(var d=s.F.U.rev15,c=15-t,y=0;y<e.length;y+=2){var S=e[y]<<t-e[y+1];e[y]=d[S]>>>c;}},s.F._putsE=function(e,t,d){d<<=7&t;var c=t>>>3;e[c]|=d,e[c+1]|=d>>>8;},s.F._putsF=function(e,t,d){d<<=7&t;var c=t>>>3;e[c]|=d,e[c+1]|=d>>>8,e[c+2]|=d>>>16;},s.F._bitsE=function(e,t,d){return (e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<d)-1},s.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},s.F._get17=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},s.F._get25=function(e,t){return (e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},s.F.U=(n=Uint16Array,b=Uint32Array,{next_code:new n(16),bl_count:new n(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new n(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new b(32),flmap:new n(512),fltree:[],fdmap:new n(32),fdtree:[],lmap:new n(32768),ltree:[],ttree:[],dmap:new n(32768),dtree:[],imap:new n(512),itree:[],rev15:new n(32768),lhst:new b(286),dhst:new b(30),ihst:new b(19),lits:new b(15e3),strt:new n(65536),prev:new n(32768)}),(function(){for(var e=s.F.U,t=0;t<32768;t++){var 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 c(y,S,r){for(;S--!=0;)y.push(0,r);}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];c(e.fltree,144,8),c(e.fltree,112,9),c(e.fltree,24,7),c(e.fltree,8,8),s.F.makeCodes(e.fltree,9),s.F.codes2map(e.fltree,9,e.flmap),s.F.revCodes(e.fltree,9),c(e.fdtree,32,5),s.F.makeCodes(e.fdtree,5),s.F.codes2map(e.fdtree,5,e.fdmap),s.F.revCodes(e.fdtree,5),c(e.itree,19,0),c(e.ltree,286,0),c(e.dtree,30,0),c(e.ttree,320,0);})();})();var Fn=Dn({__proto__:null,default:Ve},[Ve]),he=(function(){var i={nextZero(r,a){for(;r[a]!=0;)a++;return a},readUshort:(r,a)=>r[a]<<8|r[a+1],writeUshort(r,a,o){r[a]=o>>8&255,r[a+1]=255&o;},readUint:(r,a)=>16777216*r[a]+(r[a+1]<<16|r[a+2]<<8|r[a+3]),writeUint(r,a,o){r[a]=o>>24&255,r[a+1]=o>>16&255,r[a+2]=o>>8&255,r[a+3]=255&o;},readASCII(r,a,o){let p="";for(let A=0;A<o;A++)p+=String.fromCharCode(r[a+A]);return p},writeASCII(r,a,o){for(let p=0;p<o.length;p++)r[a+p]=o.charCodeAt(p);},readBytes(r,a,o){let p=[];for(let A=0;A<o;A++)p.push(r[a+A]);return p},pad:r=>r.length<2?`0${r}`:r,readUTF8(r,a,o){let p,A="";for(let R=0;R<o;R++)A+=`%${i.pad(r[a+R].toString(16))}`;try{p=decodeURIComponent(A);}catch{return i.readASCII(r,a,o)}return p}};function n(r,a,o,p){let A=a*o,R=t(p),U=Math.ceil(a*R/8),I=new Uint8Array(4*A),N=new Uint32Array(I.buffer),{ctype:F}=p,{depth:M}=p,C=i.readUshort;if(F==6){let P=A<<2;if(M==8)for(var h=0;h<P;h+=4)I[h]=r[h],I[h+1]=r[h+1],I[h+2]=r[h+2],I[h+3]=r[h+3];if(M==16)for(h=0;h<P;h++)I[h]=r[h<<1];}else if(F==2){let P=p.tabs.tRNS;if(P==null){if(M==8)for(h=0;h<A;h++){var O=3*h;N[h]=255<<24|r[O+2]<<16|r[O+1]<<8|r[O];}if(M==16)for(h=0;h<A;h++)O=6*h,N[h]=255<<24|r[O+4]<<16|r[O+2]<<8|r[O];}else {var f=P[0];let x=P[1],H=P[2];if(M==8)for(h=0;h<A;h++){var u=h<<2;O=3*h,N[h]=255<<24|r[O+2]<<16|r[O+1]<<8|r[O],r[O]==f&&r[O+1]==x&&r[O+2]==H&&(I[u+3]=0);}if(M==16)for(h=0;h<A;h++)u=h<<2,O=6*h,N[h]=255<<24|r[O+4]<<16|r[O+2]<<8|r[O],C(r,O)==f&&C(r,O+2)==x&&C(r,O+4)==H&&(I[u+3]=0);}}else if(F==3){let P=p.tabs.PLTE,x=p.tabs.tRNS,H=x?x.length:0;if(M==1)for(var _=0;_<o;_++){var l=_*U,w=_*a;for(h=0;h<a;h++){u=w+h<<2;var E=3*(v=r[l+(h>>3)]>>7-((7&h)<<0)&1);I[u]=P[E],I[u+1]=P[E+1],I[u+2]=P[E+2],I[u+3]=v<H?x[v]:255;}}if(M==2)for(_=0;_<o;_++)for(l=_*U,w=_*a,h=0;h<a;h++)u=w+h<<2,E=3*(v=r[l+(h>>2)]>>6-((3&h)<<1)&3),I[u]=P[E],I[u+1]=P[E+1],I[u+2]=P[E+2],I[u+3]=v<H?x[v]:255;if(M==4)for(_=0;_<o;_++)for(l=_*U,w=_*a,h=0;h<a;h++)u=w+h<<2,E=3*(v=r[l+(h>>1)]>>4-((1&h)<<2)&15),I[u]=P[E],I[u+1]=P[E+1],I[u+2]=P[E+2],I[u+3]=v<H?x[v]:255;if(M==8)for(h=0;h<A;h++){var v;u=h<<2,E=3*(v=r[h]),I[u]=P[E],I[u+1]=P[E+1],I[u+2]=P[E+2],I[u+3]=v<H?x[v]:255;}}else if(F==4){if(M==8)for(h=0;h<A;h++){u=h<<2;var T=r[m=h<<1];I[u]=T,I[u+1]=T,I[u+2]=T,I[u+3]=r[m+1];}if(M==16)for(h=0;h<A;h++){var m;u=h<<2,T=r[m=h<<2],I[u]=T,I[u+1]=T,I[u+2]=T,I[u+3]=r[m+2];}}else if(F==0)for(f=p.tabs.tRNS?p.tabs.tRNS:-1,_=0;_<o;_++){let P=_*U,x=_*a;if(M==1)for(var g=0;g<a;g++){var D=(T=255*(r[P+(g>>>3)]>>>7-(7&g)&1))==255*f?0:255;N[x+g]=D<<24|T<<16|T<<8|T;}else if(M==2)for(g=0;g<a;g++)D=(T=85*(r[P+(g>>>2)]>>>6-((3&g)<<1)&3))==85*f?0:255,N[x+g]=D<<24|T<<16|T<<8|T;else if(M==4)for(g=0;g<a;g++)D=(T=17*(r[P+(g>>>1)]>>>4-((1&g)<<2)&15))==17*f?0:255,N[x+g]=D<<24|T<<16|T<<8|T;else if(M==8)for(g=0;g<a;g++)D=(T=r[P+g])==f?0:255,N[x+g]=D<<24|T<<16|T<<8|T;else if(M==16)for(g=0;g<a;g++)T=r[P+(g<<1)],D=C(r,P+(g<<1))==f?0:255,N[x+g]=D<<24|T<<16|T<<8|T;}return I}function b(r,a,o,p){let A=t(r),R=Math.ceil(o*A/8),U=new Uint8Array((R+1+r.interlace)*p);return a=r.tabs.CgBI?e(a,U):s(a,U),r.interlace==0?a=d(a,r,0,o,p):r.interlace==1&&(a=(function(N,F){let M=F.width,C=F.height,h=t(F),O=h>>3,f=Math.ceil(M*h/8),u=new Uint8Array(C*f),_=0,l=[0,0,4,0,2,0,1],w=[0,4,0,2,0,1,0],E=[8,8,8,4,4,2,2],v=[8,8,4,4,2,2,1],T=0;for(;T<7;){let g=E[T],D=v[T],P=0,x=0,H=l[T];for(;H<C;)H+=g,x++;let L=w[T];for(;L<M;)L+=D,P++;let $=Math.ceil(P*h/8);d(N,F,_,P,x);let B=0,k=l[T];for(;k<C;){let Q=w[T],K=_+B*$<<3;for(;Q<M;){var m;if(h==1&&(m=(m=N[K>>3])>>7-(7&K)&1,u[k*f+(Q>>3)]|=m<<7-((7&Q)<<0)),h==2&&(m=(m=N[K>>3])>>6-(7&K)&3,u[k*f+(Q>>2)]|=m<<6-((3&Q)<<1)),h==4&&(m=(m=N[K>>3])>>4-(7&K)&15,u[k*f+(Q>>1)]|=m<<4-((1&Q)<<2)),h>=8){let G=k*f+Q*O;for(let V=0;V<O;V++)u[G+V]=N[(K>>3)+V];}K+=h,Q+=D;}B++,k+=g;}P*x!=0&&(_+=x*(1+$)),T+=1;}return u})(a,r)),a}function s(r,a){return e(new Uint8Array(r.buffer,2,r.length-6),a)}var e=(function(){let r={H:{}};return r.H.N=function(a,o){let p=Uint8Array,A,R,U=0,I=0,N=0,F=0,M=0,C=0,h=0,O=0,f=0;if(a[0]==3&&a[1]==0)return o||new p(0);let u=r.H,_=u.b,l=u.e,w=u.R,E=u.n,v=u.A,T=u.Z,m=u.m,g=o==null;for(g&&(o=new p(a.length>>>2<<5));U==0;)if(U=_(a,f,1),I=_(a,f+1,2),f+=3,I!=0){if(g&&(o=r.H.W(o,O+(1<<17))),I==1&&(A=m.J,R=m.h,C=511,h=31),I==2){N=l(a,f,5)+257,F=l(a,f+5,5)+1,M=l(a,f+10,4)+4,f+=14;let P=1;for(var D=0;D<38;D+=2)m.Q[D]=0,m.Q[D+1]=0;for(D=0;D<M;D++){let L=l(a,f+3*D,3);m.Q[1+(m.X[D]<<1)]=L,L>P&&(P=L);}f+=3*M,E(m.Q,P),v(m.Q,P,m.u),A=m.w,R=m.d,f=w(m.u,(1<<P)-1,N+F,a,f,m.v);let x=u.V(m.v,0,N,m.C);C=(1<<x)-1;let H=u.V(m.v,N,F,m.D);h=(1<<H)-1,E(m.C,x),v(m.C,x,A),E(m.D,H),v(m.D,H,R);}for(;;){let P=A[T(a,f)&C];f+=15&P;let x=P>>>4;if(!(x>>>8))o[O++]=x;else {if(x==256)break;{let H=O+x-254;if(x>264){let Q=m.q[x-257];H=O+(Q>>>3)+l(a,f,7&Q),f+=7&Q;}let L=R[T(a,f)&h];f+=15&L;let $=L>>>4,B=m.c[$],k=(B>>>4)+_(a,f,15&B);for(f+=15&B;O<H;)o[O]=o[O++-k],o[O]=o[O++-k],o[O]=o[O++-k],o[O]=o[O++-k];O=H;}}}}else {(7&f)!=0&&(f+=8-(7&f));let P=4+(f>>>3),x=a[P-4]|a[P-3]<<8;g&&(o=r.H.W(o,O+x)),o.set(new p(a.buffer,a.byteOffset+P,x),O),f=P+x<<3,O+=x;}return o.length==O?o:o.slice(0,O)},r.H.W=function(a,o){let p=a.length;if(o<=p)return a;let A=new Uint8Array(p<<1);return A.set(a,0),A},r.H.R=function(a,o,p,A,R,U){let I=r.H.e,N=r.H.Z,F=0;for(;F<p;){let M=a[N(A,R)&o];R+=15&M;let C=M>>>4;if(C<=15)U[F]=C,F++;else {let h=0,O=0;C==16?(O=3+I(A,R,2),R+=2,h=U[F-1]):C==17?(O=3+I(A,R,3),R+=3):C==18&&(O=11+I(A,R,7),R+=7);let f=F+O;for(;F<f;)U[F]=h,F++;}}return R},r.H.V=function(a,o,p,A){let R=0,U=0,I=A.length>>>1;for(;U<p;){let N=a[U+o];A[U<<1]=0,A[1+(U<<1)]=N,N>R&&(R=N),U++;}for(;U<I;)A[U<<1]=0,A[1+(U<<1)]=0,U++;return R},r.H.n=function(a,o){let p=r.H.m,A=a.length,R,U,I,N,F=p.j;for(var M=0;M<=o;M++)F[M]=0;for(M=1;M<A;M+=2)F[a[M]]++;let C=p.K;for(R=0,F[0]=0,U=1;U<=o;U++)R=R+F[U-1]<<1,C[U]=R;for(I=0;I<A;I+=2)N=a[I+1],N!=0&&(a[I]=C[N],C[N]++);},r.H.A=function(a,o,p){let A=a.length,R=r.H.m.r;for(let U=0;U<A;U+=2)if(a[U+1]!=0){let I=U>>1,N=a[U+1],F=I<<4|N,M=o-N,C=a[U]<<M,h=C+(1<<M);for(;C!=h;)p[R[C]>>>15-o]=F,C++;}},r.H.l=function(a,o){let p=r.H.m.r,A=15-o;for(let R=0;R<a.length;R+=2){let U=a[R]<<o-a[R+1];a[R]=p[U]>>>A;}},r.H.M=function(a,o,p){p<<=7&o;let A=o>>>3;a[A]|=p,a[A+1]|=p>>>8;},r.H.I=function(a,o,p){p<<=7&o;let A=o>>>3;a[A]|=p,a[A+1]|=p>>>8,a[A+2]|=p>>>16;},r.H.e=function(a,o,p){return (a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<p)-1},r.H.b=function(a,o,p){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<p)-1},r.H.Z=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},r.H.i=function(a,o){return (a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},r.H.m=(function(){let a=Uint16Array,o=Uint32Array;return {K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new a(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){let a=r.H.m;for(var o=0;o<32768;o++){let A=o;A=(2863311530&A)>>>1|(1431655765&A)<<1,A=(3435973836&A)>>>2|(858993459&A)<<2,A=(4042322160&A)>>>4|(252645135&A)<<4,A=(4278255360&A)>>>8|(16711935&A)<<8,a.r[o]=(A>>>16|A<<16)>>>17;}function p(A,R,U){for(;R--!=0;)A.push(0,U);}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];p(a._,144,8),p(a._,112,9),p(a._,24,7),p(a._,8,8),r.H.n(a._,9),r.H.A(a._,9,a.J),r.H.l(a._,9),p(a.$,32,5),r.H.n(a.$,5),r.H.A(a.$,5,a.h),r.H.l(a.$,5),p(a.Q,19,0),p(a.C,286,0),p(a.D,30,0),p(a.v,320,0);})(),r.H.N})();function t(r){return [1,null,3,1,2,null,4][r.ctype]*r.depth}function d(r,a,o,p,A){let R=t(a),U=Math.ceil(p*R/8),I,N;R=Math.ceil(R/8);let F=r[o],M=0;if(F>1&&(r[o]=[0,0,1][F-2]),F==3)for(M=R;M<U;M++)r[M+1]=r[M+1]+(r[M+1-R]>>>1)&255;for(let C=0;C<A;C++)if(I=o+C*U,N=I+C+1,F=r[N-1],M=0,F==0)for(;M<U;M++)r[I+M]=r[N+M];else if(F==1){for(;M<R;M++)r[I+M]=r[N+M];for(;M<U;M++)r[I+M]=r[N+M]+r[I+M-R];}else if(F==2)for(;M<U;M++)r[I+M]=r[N+M]+r[I+M-U];else if(F==3){for(;M<R;M++)r[I+M]=r[N+M]+(r[I+M-U]>>>1);for(;M<U;M++)r[I+M]=r[N+M]+(r[I+M-U]+r[I+M-R]>>>1);}else {for(;M<R;M++)r[I+M]=r[N+M]+c(0,r[I+M-U],0);for(;M<U;M++)r[I+M]=r[N+M]+c(r[I+M-R],r[I+M-U],r[I+M-R-U]);}return r}function c(r,a,o){let p=r+a-o,A=p-r,R=p-a,U=p-o;return A*A<=R*R&&A*A<=U*U?r:R*R<=U*U?a:o}function y(r,a,o){o.width=i.readUint(r,a),a+=4,o.height=i.readUint(r,a),a+=4,o.depth=r[a],a++,o.ctype=r[a],a++,o.compress=r[a],a++,o.filter=r[a],a++,o.interlace=r[a],a++;}function S(r,a,o,p,A,R,U,I,N){let F=Math.min(a,A),M=Math.min(o,R),C=0,h=0;for(let T=0;T<M;T++)for(let m=0;m<F;m++)if(U>=0&&I>=0?(C=T*a+m<<2,h=(I+T)*A+U+m<<2):(C=(-I+T)*a-U+m<<2,h=T*A+m<<2),N==0)p[h]=r[C],p[h+1]=r[C+1],p[h+2]=r[C+2],p[h+3]=r[C+3];else if(N==1){var O=r[C+3]*.00392156862745098,f=r[C]*O,u=r[C+1]*O,_=r[C+2]*O,l=p[h+3]*(1/255),w=p[h]*l,E=p[h+1]*l,v=p[h+2]*l;let g=1-O,D=O+l*g,P=D==0?0:1/D;p[h+3]=255*D,p[h+0]=(f+w*g)*P,p[h+1]=(u+E*g)*P,p[h+2]=(_+v*g)*P;}else if(N==2)O=r[C+3],f=r[C],u=r[C+1],_=r[C+2],l=p[h+3],w=p[h],E=p[h+1],v=p[h+2],O==l&&f==w&&u==E&&_==v?(p[h]=0,p[h+1]=0,p[h+2]=0,p[h+3]=0):(p[h]=f,p[h+1]=u,p[h+2]=_,p[h+3]=O);else if(N==3){if(O=r[C+3],f=r[C],u=r[C+1],_=r[C+2],l=p[h+3],w=p[h],E=p[h+1],v=p[h+2],O==l&&f==w&&u==E&&_==v)continue;if(O<220&&l>20)return false}return true}return {decode:function(a){let o=new Uint8Array(a),p=8,A=i,R=A.readUshort,U=A.readUint,I={tabs:{},frames:[]},N=new Uint8Array(o.length),F,M=0,C=0,h=[137,80,78,71,13,10,26,10];for(var O=0;O<8;O++)if(o[O]!=h[O])throw "The input is not a PNG file!";for(;p<o.length;){let T=A.readUint(o,p);p+=4;let m=A.readASCII(o,p,4);if(p+=4,m=="IHDR")y(o,p,I);else if(m=="iCCP"){for(var f=p;o[f]!=0;)f++;A.readASCII(o,p,f-p),o[f+1];let g=o.slice(f+2,p+T),D=null;try{D=s(g);}catch{D=e(g);}I.tabs[m]=D;}else if(m=="CgBI")I.tabs[m]=o.slice(p,p+4);else if(m=="IDAT"){for(O=0;O<T;O++)N[M+O]=o[p+O];M+=T;}else if(m=="acTL")I.tabs[m]={num_frames:U(o,p),num_plays:U(o,p+4)},F=new Uint8Array(o.length);else if(m=="fcTL"){C!=0&&((v=I.frames[I.frames.length-1]).data=b(I,F.slice(0,C),v.rect.width,v.rect.height),C=0);let g={x:U(o,p+12),y:U(o,p+16),width:U(o,p+4),height:U(o,p+8)},D=R(o,p+22);D=R(o,p+20)/(D==0?100:D);let P={rect:g,delay:Math.round(1e3*D),dispose:o[p+24],blend:o[p+25]};I.frames.push(P);}else if(m=="fdAT"){for(O=0;O<T-4;O++)F[C+O]=o[p+O+4];C+=T-4;}else if(m=="pHYs")I.tabs[m]=[A.readUint(o,p),A.readUint(o,p+4),o[p+8]];else if(m=="cHRM")for(I.tabs[m]=[],O=0;O<8;O++)I.tabs[m].push(A.readUint(o,p+4*O));else if(m=="tEXt"||m=="zTXt"){I.tabs[m]==null&&(I.tabs[m]={});var u=A.nextZero(o,p),_=A.readASCII(o,p,u-p),l=p+T-u-1;if(m=="tEXt")E=A.readASCII(o,u+1,l);else {var w=s(o.slice(u+2,u+2+l));E=A.readUTF8(w,0,w.length);}I.tabs[m][_]=E;}else if(m=="iTXt"){I.tabs[m]==null&&(I.tabs[m]={}),u=0,f=p,u=A.nextZero(o,f),_=A.readASCII(o,f,u-f);let g=o[f=u+1];var E;o[f+1],f+=2,u=A.nextZero(o,f),A.readASCII(o,f,u-f),f=u+1,u=A.nextZero(o,f),A.readUTF8(o,f,u-f),l=T-((f=u+1)-p),g==0?E=A.readUTF8(o,f,l):(w=s(o.slice(f,f+l)),E=A.readUTF8(w,0,w.length)),I.tabs[m][_]=E;}else if(m=="PLTE")I.tabs[m]=A.readBytes(o,p,T);else if(m=="hIST"){let g=I.tabs.PLTE.length/3;for(I.tabs[m]=[],O=0;O<g;O++)I.tabs[m].push(R(o,p+2*O));}else if(m=="tRNS")I.ctype==3?I.tabs[m]=A.readBytes(o,p,T):I.ctype==0?I.tabs[m]=R(o,p):I.ctype==2&&(I.tabs[m]=[R(o,p),R(o,p+2),R(o,p+4)]);else if(m=="gAMA")I.tabs[m]=A.readUint(o,p)/1e5;else if(m=="sRGB")I.tabs[m]=o[p];else if(m=="bKGD")I.ctype==0||I.ctype==4?I.tabs[m]=[R(o,p)]:I.ctype==2||I.ctype==6?I.tabs[m]=[R(o,p),R(o,p+2),R(o,p+4)]:I.ctype==3&&(I.tabs[m]=o[p]);else if(m=="IEND")break;p+=T,A.readUint(o,p),p+=4;}var v;return C!=0&&((v=I.frames[I.frames.length-1]).data=b(I,F.slice(0,C),v.rect.width,v.rect.height)),I.data=b(I,N,I.width,I.height),delete I.compress,delete I.interlace,delete I.filter,I},toRGBA8:function(a){let o=a.width,p=a.height;if(a.tabs.acTL==null)return [n(a.data,o,p,a).buffer];let A=[];a.frames[0].data==null&&(a.frames[0].data=a.data);let R=o*p*4,U=new Uint8Array(R),I=new Uint8Array(R),N=new Uint8Array(R);for(let M=0;M<a.frames.length;M++){let C=a.frames[M],h=C.rect.x,O=C.rect.y,f=C.rect.width,u=C.rect.height,_=n(C.data,f,u,a);if(M!=0)for(var F=0;F<R;F++)N[F]=U[F];if(C.blend==0?S(_,f,u,U,o,p,h,O,0):C.blend==1&&S(_,f,u,U,o,p,h,O,1),A.push(U.buffer.slice(0)),C.dispose!=0){if(C.dispose==1)S(I,f,u,U,o,p,h,O,0);else if(C.dispose==2)for(F=0;F<R;F++)U[F]=N[F];}}return A},_paeth:c,_copyTile:S,_bin:i}})();(function(){let{_copyTile:i}=he,{_bin:n}=he,b=he._paeth;var s={table:(function(){let f=new Uint32Array(256);for(let u=0;u<256;u++){let _=u;for(let l=0;l<8;l++)1&_?_=3988292384^_>>>1:_>>>=1;f[u]=_;}return f})(),update(f,u,_,l){for(let w=0;w<l;w++)f=s.table[255&(f^u[_+w])]^f>>>8;return f},crc:(f,u,_)=>4294967295^s.update(4294967295,f,u,_)};function e(f,u,_,l){u[_]+=f[0]*l>>4,u[_+1]+=f[1]*l>>4,u[_+2]+=f[2]*l>>4,u[_+3]+=f[3]*l>>4;}function t(f){return Math.max(0,Math.min(255,f))}function d(f,u){let _=f[0]-u[0],l=f[1]-u[1],w=f[2]-u[2],E=f[3]-u[3];return _*_+l*l+w*w+E*E}function c(f,u,_,l,w,E,v){v==null&&(v=1);let T=l.length,m=[];for(var g=0;g<T;g++){let k=l[g];m.push([k>>>0&255,k>>>8&255,k>>>16&255,k>>>24&255]);}for(g=0;g<T;g++){let k=4294967295;for(var D=0,P=0;P<T;P++){var x=d(m[g],m[P]);P!=g&&x<k&&(k=x,D=P);}}let H=new Uint32Array(w.buffer),L=new Int16Array(u*_*4),$=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(g=0;g<$.length;g++)$[g]=255*(($[g]+.5)/16-.5);for(let k=0;k<_;k++)for(let Q=0;Q<u;Q++){var B;g=4*(k*u+Q),v!=2?B=[t(f[g]+L[g]),t(f[g+1]+L[g+1]),t(f[g+2]+L[g+2]),t(f[g+3]+L[g+3])]:(x=$[4*(3&k)+(3&Q)],B=[t(f[g]+x),t(f[g+1]+x),t(f[g+2]+x),t(f[g+3]+x)]),D=0;let K=16777215;for(P=0;P<T;P++){let q=d(B,m[P]);q<K&&(K=q,D=P);}let G=m[D],V=[B[0]-G[0],B[1]-G[1],B[2]-G[2],B[3]-G[3]];v==1&&(Q!=u-1&&e(V,L,g+4,7),k!=_-1&&(Q!=0&&e(V,L,g+4*u-4,3),e(V,L,g+4*u,5),Q!=u-1&&e(V,L,g+4*u+4,1))),E[g>>2]=D,H[g>>2]=l[D];}}function y(f,u,_,l,w){w==null&&(w={});let{crc:E}=s,v=n.writeUint,T=n.writeUshort,m=n.writeASCII,g=8,D=f.frames.length>1,P,x=false,H=33+(D?20:0);if(w.sRGB!=null&&(H+=13),w.pHYs!=null&&(H+=21),w.iCCP!=null&&(P=pako.deflate(w.iCCP),H+=21+P.length+4),f.ctype==3){for(var L=f.plte.length,$=0;$<L;$++)f.plte[$]>>>24!=255&&(x=true);H+=8+3*L+4+(x?8+1*L+4:0);}for(var B=0;B<f.frames.length;B++)D&&(H+=38),H+=(G=f.frames[B]).cimg.length+12,B!=0&&(H+=4);H+=12;let k=new Uint8Array(H),Q=[137,80,78,71,13,10,26,10];for($=0;$<8;$++)k[$]=Q[$];if(v(k,g,13),g+=4,m(k,g,"IHDR"),g+=4,v(k,g,u),g+=4,v(k,g,_),g+=4,k[g]=f.depth,g++,k[g]=f.ctype,g++,k[g]=0,g++,k[g]=0,g++,k[g]=0,g++,v(k,g,E(k,g-17,17)),g+=4,w.sRGB!=null&&(v(k,g,1),g+=4,m(k,g,"sRGB"),g+=4,k[g]=w.sRGB,g++,v(k,g,E(k,g-5,5)),g+=4),w.iCCP!=null){let V=13+P.length;v(k,g,V),g+=4,m(k,g,"iCCP"),g+=4,m(k,g,"ICC profile"),g+=11,g+=2,k.set(P,g),g+=P.length,v(k,g,E(k,g-(V+4),V+4)),g+=4;}if(w.pHYs!=null&&(v(k,g,9),g+=4,m(k,g,"pHYs"),g+=4,v(k,g,w.pHYs[0]),g+=4,v(k,g,w.pHYs[1]),g+=4,k[g]=w.pHYs[2],g++,v(k,g,E(k,g-13,13)),g+=4),D&&(v(k,g,8),g+=4,m(k,g,"acTL"),g+=4,v(k,g,f.frames.length),g+=4,v(k,g,w.loop!=null?w.loop:0),g+=4,v(k,g,E(k,g-12,12)),g+=4),f.ctype==3){for(v(k,g,3*(L=f.plte.length)),g+=4,m(k,g,"PLTE"),g+=4,$=0;$<L;$++){let V=3*$,q=f.plte[$],z=255&q,W=q>>>8&255,ie=q>>>16&255;k[g+V+0]=z,k[g+V+1]=W,k[g+V+2]=ie;}if(g+=3*L,v(k,g,E(k,g-3*L-4,3*L+4)),g+=4,x){for(v(k,g,L),g+=4,m(k,g,"tRNS"),g+=4,$=0;$<L;$++)k[g+$]=f.plte[$]>>>24&255;g+=L,v(k,g,E(k,g-L-4,L+4)),g+=4;}}let K=0;for(B=0;B<f.frames.length;B++){var G=f.frames[B];D&&(v(k,g,26),g+=4,m(k,g,"fcTL"),g+=4,v(k,g,K++),g+=4,v(k,g,G.rect.width),g+=4,v(k,g,G.rect.height),g+=4,v(k,g,G.rect.x),g+=4,v(k,g,G.rect.y),g+=4,T(k,g,l[B]),g+=2,T(k,g,1e3),g+=2,k[g]=G.dispose,g++,k[g]=G.blend,g++,v(k,g,E(k,g-30,30)),g+=4);let V=G.cimg;v(k,g,(L=V.length)+(B==0?0:4)),g+=4;let q=g;m(k,g,B==0?"IDAT":"fdAT"),g+=4,B!=0&&(v(k,g,K++),g+=4),k.set(V,g),g+=L,v(k,g,E(k,q,g-q)),g+=4;}return v(k,g,0),g+=4,m(k,g,"IEND"),g+=4,v(k,g,E(k,g-4,4)),g+=4,k.buffer}function S(f,u,_){for(let l=0;l<f.frames.length;l++){let w=f.frames[l];w.rect.width;let E=w.rect.height,v=new Uint8Array(E*w.bpl+E);w.cimg=p(w.img,E,w.bpp,w.bpl,v,u,_);}}function r(f,u,_,l,w){let E=w[0],v=w[1],T=w[2],m=w[3],g=w[4],D=w[5],P=6,x=8,H=255;for(var L=0;L<f.length;L++){let te=new Uint8Array(f[L]);for(var $=te.length,B=0;B<$;B+=4)H&=te[B+3];}let k=H!=255,Q=(function(X,J,ne,oe,j,ue){let ee=[];for(var Y=0;Y<X.length;Y++){let ce=new Uint8Array(X[Y]),pe=new Uint32Array(ce.buffer);var le;let de=0,ve=0,me=J,Ie=ne,et=oe?1:0;if(Y!=0){let In=ue||oe||Y==1||ee[Y-2].dispose!=0?1:2,tt=0,It=1e9;for(let Le=0;Le<In;Le++){var ge=new Uint8Array(X[Y-1-Le]);let Cn=new Uint32Array(X[Y-1-Le]),_e=J,be=ne,Ue=-1,ke=-1;for(let Ce=0;Ce<ne;Ce++)for(let Re=0;Re<J;Re++)pe[se=Ce*J+Re]!=Cn[se]&&(Re<_e&&(_e=Re),Re>Ue&&(Ue=Re),Ce<be&&(be=Ce),Ce>ke&&(ke=Ce));Ue==-1&&(_e=be=Ue=ke=0),j&&((1&_e)==1&&_e--,(1&be)==1&&be--);let Ct=(Ue-_e+1)*(ke-be+1);Ct<It&&(It=Ct,tt=Le,de=_e,ve=be,me=Ue-_e+1,Ie=ke-be+1);}ge=new Uint8Array(X[Y-1-tt]),tt==1&&(ee[Y-1].dispose=2),le=new Uint8Array(me*Ie*4),i(ge,J,ne,le,me,Ie,-de,-ve,0),et=i(ce,J,ne,le,me,Ie,-de,-ve,3)?1:0,et==1?o(ce,J,ne,le,{x:de,y:ve,width:me,height:Ie}):i(ce,J,ne,le,me,Ie,-de,-ve,0);}else le=ce.slice(0);ee.push({rect:{x:de,y:ve,width:me,height:Ie},img:le,blend:et,dispose:0});}if(oe)for(Y=0;Y<ee.length;Y++){if((Te=ee[Y]).blend==1)continue;let ce=Te.rect,pe=ee[Y-1].rect,de=Math.min(ce.x,pe.x),ve=Math.min(ce.y,pe.y),me={x:de,y:ve,width:Math.max(ce.x+ce.width,pe.x+pe.width)-de,height:Math.max(ce.y+ce.height,pe.y+pe.height)-ve};ee[Y-1].dispose=1,Y-1!=0&&a(X,J,ne,ee,Y-1,me,j),a(X,J,ne,ee,Y,me,j);}let Qe=0;if(X.length!=1)for(var se=0;se<ee.length;se++){var Te;Qe+=(Te=ee[se]).rect.width*Te.rect.height;}return ee})(f,u,_,E,v,T),K={},G=[],V=[];if(l!=0){let te=[];for(B=0;B<Q.length;B++)te.push(Q[B].img.buffer);let X=(function(j){let ue=0;for(var ee=0;ee<j.length;ee++)ue+=j[ee].byteLength;let Y=new Uint8Array(ue),le=0;for(ee=0;ee<j.length;ee++){let ge=new Uint8Array(j[ee]),Qe=ge.length;for(let se=0;se<Qe;se+=4){let Te=ge[se],ce=ge[se+1],pe=ge[se+2],de=ge[se+3];de==0&&(Te=ce=pe=0),Y[le+se]=Te,Y[le+se+1]=ce,Y[le+se+2]=pe,Y[le+se+3]=de;}le+=Qe;}return Y.buffer})(te),J=R(X,l);for(B=0;B<J.plte.length;B++)G.push(J.plte[B].est.rgba);let ne=0;for(B=0;B<Q.length;B++){let oe=(z=Q[B]).img.length;var q=new Uint8Array(J.inds.buffer,ne>>2,oe>>2);V.push(q);let j=new Uint8Array(J.abuf,ne,oe);D&&c(z.img,z.rect.width,z.rect.height,G,j,q),z.img.set(j),ne+=oe;}}else for(L=0;L<Q.length;L++){var z=Q[L];let te=new Uint32Array(z.img.buffer);var W=z.rect.width;for($=te.length,q=new Uint8Array($),V.push(q),B=0;B<$;B++){let X=te[B];if(B!=0&&X==te[B-1])q[B]=q[B-1];else if(B>W&&X==te[B-W])q[B]=q[B-W];else {let J=K[X];if(J==null&&(K[X]=J=G.length,G.push(X),G.length>=300))break;q[B]=J;}}}let ie=G.length;for(ie<=256&&g==0&&(x=ie<=2?1:ie<=4?2:ie<=16?4:8,x=Math.max(x,m)),L=0;L<Q.length;L++){(z=Q[L]).rect.x,z.rect.y,W=z.rect.width;let te=z.rect.height,X=z.img;new Uint32Array(X.buffer);let J=4*W,ne=4;if(ie<=256&&g==0){J=Math.ceil(x*W/8);var ae=new Uint8Array(J*te);let oe=V[L];for(let j=0;j<te;j++){B=j*J;let ue=j*W;if(x==8)for(var Z=0;Z<W;Z++)ae[B+Z]=oe[ue+Z];else if(x==4)for(Z=0;Z<W;Z++)ae[B+(Z>>1)]|=oe[ue+Z]<<4-4*(1&Z);else if(x==2)for(Z=0;Z<W;Z++)ae[B+(Z>>2)]|=oe[ue+Z]<<6-2*(3&Z);else if(x==1)for(Z=0;Z<W;Z++)ae[B+(Z>>3)]|=oe[ue+Z]<<7-1*(7&Z);}X=ae,P=3,ne=1;}else if(k==0&&Q.length==1){ae=new Uint8Array(W*te*3);let oe=W*te;for(B=0;B<oe;B++){let j=3*B,ue=4*B;ae[j]=X[ue],ae[j+1]=X[ue+1],ae[j+2]=X[ue+2];}X=ae,P=2,ne=3,J=3*W;}z.img=X,z.bpl=J,z.bpp=ne;}return {ctype:P,depth:x,plte:G,frames:Q}}function a(f,u,_,l,w,E,v){let T=Uint8Array,m=Uint32Array,g=new T(f[w-1]),D=new m(f[w-1]),P=w+1<f.length?new T(f[w+1]):null,x=new T(f[w]),H=new m(x.buffer),L=u,$=_,B=-1,k=-1;for(let K=0;K<E.height;K++)for(let G=0;G<E.width;G++){let V=E.x+G,q=E.y+K,z=q*u+V,W=H[z];W==0||l[w-1].dispose==0&&D[z]==W&&(P==null||P[4*z+3]!=0)||(V<L&&(L=V),V>B&&(B=V),q<$&&($=q),q>k&&(k=q));}B==-1&&(L=$=B=k=0),v&&((1&L)==1&&L--,(1&$)==1&&$--),E={x:L,y:$,width:B-L+1,height:k-$+1};let Q=l[w];Q.rect=E,Q.blend=1,Q.img=new Uint8Array(E.width*E.height*4),l[w-1].dispose==0?(i(g,u,_,Q.img,E.width,E.height,-E.x,-E.y,0),o(x,u,_,Q.img,E)):i(x,u,_,Q.img,E.width,E.height,-E.x,-E.y,0);}function o(f,u,_,l,w){i(f,u,_,l,w.width,w.height,-w.x,-w.y,2);}function p(f,u,_,l,w,E,v){let T=[],m,g=[0,1,2,3,4];E!=-1?g=[E]:(u*l>5e5||_==1)&&(g=[0]),v&&(m={level:0});let D=Fn;for(var P=0;P<g.length;P++){for(let L=0;L<u;L++)A(w,f,L,l,_,g[P]);T.push(D.deflate(w,m));}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 A(f,u,_,l,w,E){let v=_*l,T=v+_;if(f[T]=E,T++,E==0)if(l<500)for(var m=0;m<l;m++)f[T+m]=u[v+m];else f.set(new Uint8Array(u.buffer,v,l),T);else if(E==1){for(m=0;m<w;m++)f[T+m]=u[v+m];for(m=w;m<l;m++)f[T+m]=u[v+m]-u[v+m-w]+256&255;}else if(_==0){for(m=0;m<w;m++)f[T+m]=u[v+m];if(E==2)for(m=w;m<l;m++)f[T+m]=u[v+m];if(E==3)for(m=w;m<l;m++)f[T+m]=u[v+m]-(u[v+m-w]>>1)+256&255;if(E==4)for(m=w;m<l;m++)f[T+m]=u[v+m]-b(u[v+m-w],0,0)+256&255;}else {if(E==2)for(m=0;m<l;m++)f[T+m]=u[v+m]+256-u[v+m-l]&255;if(E==3){for(m=0;m<w;m++)f[T+m]=u[v+m]+256-(u[v+m-l]>>1)&255;for(m=w;m<l;m++)f[T+m]=u[v+m]+256-(u[v+m-l]+u[v+m-w]>>1)&255;}if(E==4){for(m=0;m<w;m++)f[T+m]=u[v+m]+256-b(0,u[v+m-l],0)&255;for(m=w;m<l;m++)f[T+m]=u[v+m]+256-b(u[v+m-w],u[v+m-l],u[v+m-w-l])&255;}}}function R(f,u){let _=new Uint8Array(f),l=_.slice(0),w=new Uint32Array(l.buffer),E=U(l,u),v=E[0],T=E[1],m=_.length,g=new Uint8Array(m>>2),D;if(_.length<2e7)for(var P=0;P<m;P+=4)D=I(v,x=_[P]*(1/255),H=_[P+1]*(1/255),L=_[P+2]*(1/255),$=_[P+3]*(1/255)),g[P>>2]=D.ind,w[P>>2]=D.est.rgba;else for(P=0;P<m;P+=4){var x=_[P]*.00392156862745098,H=_[P+1]*(1/255),L=_[P+2]*(1/255),$=_[P+3]*(1/255);for(D=v;D.left;)D=N(D.est,x,H,L,$)<=0?D.left:D.right;g[P>>2]=D.ind,w[P>>2]=D.est.rgba;}return {abuf:l.buffer,inds:g,plte:T}}function U(f,u,_){_==null&&(_=1e-4);let l=new Uint32Array(f.buffer),w={i0:0,i1:f.length,bst:null,est:null,tdst:0,left:null,right:null};w.bst=C(f,w.i0,w.i1),w.est=h(w.bst);let E=[w];for(;E.length<u;){let T=0,m=0;for(var v=0;v<E.length;v++)E[v].est.L>T&&(T=E[v].est.L,m=v);if(T<_)break;let g=E[m],D=F(f,l,g.i0,g.i1,g.est.e,g.est.eMq255);if(g.i0>=D||g.i1<=D){g.est.L=0;continue}let P={i0:g.i0,i1:D,bst:null,est:null,tdst:0,left:null,right:null};P.bst=C(f,P.i0,P.i1),P.est=h(P.bst);let x={i0:D,i1:g.i1,bst:null,est:null,tdst:0,left:null,right:null};for(x.bst={R:[],m:[],N:g.bst.N-P.bst.N},v=0;v<16;v++)x.bst.R[v]=g.bst.R[v]-P.bst.R[v];for(v=0;v<4;v++)x.bst.m[v]=g.bst.m[v]-P.bst.m[v];x.est=h(x.bst),g.left=P,g.right=x,E[m]=P,E.push(x);}for(E.sort(((T,m)=>m.bst.N-T.bst.N)),v=0;v<E.length;v++)E[v].ind=v;return [w,E]}function I(f,u,_,l,w){if(f.left==null)return f.tdst=(function(P,x,H,L,$){let B=x-P[0],k=H-P[1],Q=L-P[2],K=$-P[3];return B*B+k*k+Q*Q+K*K})(f.est.q,u,_,l,w),f;let E=N(f.est,u,_,l,w),v=f.left,T=f.right;E>0&&(v=f.right,T=f.left);let m=I(v,u,_,l,w);if(m.tdst<=E*E)return m;let g=I(T,u,_,l,w);return g.tdst<m.tdst?g:m}function N(f,u,_,l,w){let{e:E}=f;return E[0]*u+E[1]*_+E[2]*l+E[3]*w-f.eMq}function F(f,u,_,l,w,E){for(l-=4;_<l;){for(;M(f,_,w)<=E;)_+=4;for(;M(f,l,w)>E;)l-=4;if(_>=l)break;let v=u[_>>2];u[_>>2]=u[l>>2],u[l>>2]=v,_+=4,l-=4;}for(;M(f,_,w)>E;)_-=4;return _+4}function M(f,u,_){return f[u]*_[0]+f[u+1]*_[1]+f[u+2]*_[2]+f[u+3]*_[3]}function C(f,u,_){let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],w=[0,0,0,0],E=_-u>>2;for(let v=u;v<_;v+=4){let T=f[v]*.00392156862745098,m=f[v+1]*(1/255),g=f[v+2]*(1/255),D=f[v+3]*(1/255);w[0]+=T,w[1]+=m,w[2]+=g,w[3]+=D,l[0]+=T*T,l[1]+=T*m,l[2]+=T*g,l[3]+=T*D,l[5]+=m*m,l[6]+=m*g,l[7]+=m*D,l[10]+=g*g,l[11]+=g*D,l[15]+=D*D;}return l[4]=l[1],l[8]=l[2],l[9]=l[6],l[12]=l[3],l[13]=l[7],l[14]=l[11],{R:l,m:w,N:E}}function h(f){let{R:u}=f,{m:_}=f,{N:l}=f,w=_[0],E=_[1],v=_[2],T=_[3],m=l==0?0:1/l,g=[u[0]-w*w*m,u[1]-w*E*m,u[2]-w*v*m,u[3]-w*T*m,u[4]-E*w*m,u[5]-E*E*m,u[6]-E*v*m,u[7]-E*T*m,u[8]-v*w*m,u[9]-v*E*m,u[10]-v*v*m,u[11]-v*T*m,u[12]-T*w*m,u[13]-T*E*m,u[14]-T*v*m,u[15]-T*T*m],D=g,P=O,x=[Math.random(),Math.random(),Math.random(),Math.random()],H=0,L=0;if(l!=0)for(let B=0;B<16&&(x=P.multVec(D,x),L=Math.sqrt(P.dot(x,x)),x=P.sml(1/L,x),!(B!=0&&Math.abs(L-H)<1e-9));B++)H=L;let $=[w*m,E*m,v*m,T*m];return {Cov:g,q:$,e:x,L:H,eMq255:P.dot(P.sml(255,$),x),eMq:P.dot(x,$),rgba:(Math.round(255*$[3])<<24|Math.round(255*$[2])<<16|Math.round(255*$[1])<<8|Math.round(255*$[0])<<0)>>>0}}var O={multVec:(f,u)=>[f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3],f[4]*u[0]+f[5]*u[1]+f[6]*u[2]+f[7]*u[3],f[8]*u[0]+f[9]*u[1]+f[10]*u[2]+f[11]*u[3],f[12]*u[0]+f[13]*u[1]+f[14]*u[2]+f[15]*u[3]],dot:(f,u)=>f[0]*u[0]+f[1]*u[1]+f[2]*u[2]+f[3]*u[3],sml:(f,u)=>[f*u[0],f*u[1],f*u[2],f*u[3]]};he.encode=function(u,_,l,w,E,v,T){w==null&&(w=0),T==null&&(T=false);let m=r(u,_,l,w,[false,false,false,0,T,false]);return S(m,-1),y(m,_,l,E,v)},he.encodeLL=function(u,_,l,w,E,v,T,m){let g={ctype:0+(w==1?0:2)+(E==0?0:4),depth:v,frames:[]},D=(w+E)*v,P=D*_;for(let x=0;x<u.length;x++)g.frames.push({rect:{x:0,y:0,width:_,height:l},img:new Uint8Array(u[x]),blend:0,dispose:1,bpp:Math.ceil(D/8),bpl:Math.ceil(P/8)});return S(g,0,true),y(g,_,l,T,m)},he.encode.compress=r,he.encode.dither=c,he.quantize=R,he.quantize.getKDtree=U,he.quantize.getNearest=I;})();var Ut={toArrayBuffer(i,n){let b=i.width,s=i.height,e=b<<2,t=i.getContext("2d").getImageData(0,0,b,s),d=new Uint32Array(t.data.buffer),c=(32*b+31)/32<<2,y=c*s,S=122+y,r=new ArrayBuffer(S),a=new DataView(r),o=1<<20,p,A,R,U,I=o,N=0,F=0,M=0;function C(f){a.setUint16(F,f,true),F+=2;}function h(f){a.setUint32(F,f,true),F+=4;}function O(f){F+=f;}C(19778),h(S),O(4),h(122),h(108),h(b),h(-s>>>0),C(1),C(32),h(3),h(y),h(2835),h(2835),O(8),h(16711680),h(65280),h(255),h(4278190080),h(1466527264),(function f(){for(;N<s&&I>0;){for(U=122+N*c,p=0;p<e;)I--,A=d[M++],R=A>>>24,a.setUint32(U+p,A<<8|R),p+=4;N++;}M<d.length?(I=o,setTimeout(f,Ut._dly)):n(r);})();},toBlob(i,n){this.toArrayBuffer(i,(b=>{n(new Blob([b],{type:"image/bmp"}));}));},_dly:9},fe={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Nn={[fe.CHROME]:16384,[fe.FIREFOX]:11180,[fe.DESKTOP_SAFARI]:16384,[fe.IE]:8192,[fe.IOS]:4096,[fe.ETC]:8192},ot=typeof globalThis.window<"u",Mt=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,ze=ot&&globalThis.window.cordova&&globalThis.window.cordova.require&&globalThis.window.cordova.require("cordova/modulemapper"),Bn=(ot||Mt)&&(ze&&ze.getOriginalSymbol(globalThis.window,"File")||typeof File<"u"&&File),Dt=(ot||Mt)&&(ze&&ze.getOriginalSymbol(globalThis.window,"FileReader")||typeof globalThis.FileReader<"u"&&globalThis.FileReader);function it(i,n,b=Date.now()){return new Promise((s=>{let e=i.split(","),t=e[0].match(/:(.*?);/)[1],d=globalThis.atob(e[1]),c=d.length,y=new Uint8Array(c);for(;c--;)y[c]=d.charCodeAt(c);let S=new Blob([y],{type:t});S.name=n,S.lastModified=b,s(S);}))}function Lt(i){return new Promise(((n,b)=>{let s=new Dt;s.onload=()=>n(s.result),s.onerror=e=>b(e),s.readAsDataURL(i);}))}function kt(i){return new Promise(((n,b)=>{let s=new globalThis.Image;s.onload=()=>n(s),s.onerror=e=>b(e),s.src=i;}))}function Oe(){if(Oe.cachedResult!==void 0)return Oe.cachedResult;let i=fe.ETC,{userAgent:n}=navigator;return /Chrom(e|ium)/i.test(n)?i=fe.CHROME:/iP(ad|od|hone)/i.test(n)&&/WebKit/i.test(n)?i=fe.IOS:/Safari/i.test(n)?i=fe.DESKTOP_SAFARI:/Firefox/i.test(n)?i=fe.FIREFOX:(/MSIE/i.test(n)||globalThis.document.documentMode)&&(i=fe.IE),Oe.cachedResult=i,Oe.cachedResult}function Ft(i,n){let b=Oe(),s=Nn[b],e=i,t=n,d=e*t,c=e>t?t/e:e/t;for(;d>s*s;){let y=(s+e)/2,S=(s+t)/2;y<S?(t=S,e=S*c):(t=y*c,e=y),d=e*t;}return {width:e,height:t}}function Ke(i,n){let b,s;try{if(b=new OffscreenCanvas(i,n),s=b.getContext("2d"),s===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{b=globalThis.document.createElement("canvas"),s=b.getContext("2d");}return b.width=i,b.height=n,[b,s]}function Nt(i,n){let{width:b,height:s}=Ft(i.width,i.height),[e,t]=Ke(b,s);return n&&/jpe?g/.test(n)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(i,0,0,e.width,e.height),e}function We(){return We.cachedResult!==void 0||(We.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),We.cachedResult}function Ge(i,n={}){return new Promise((function(b,s){let e,t;var d=function(){try{return t=Nt(e,n.fileType||i.type),b([e,t])}catch(y){return s(y)}},c=function(y){try{var S=function(r){try{throw r}catch(a){return s(a)}};try{let r;return Lt(i).then((function(a){try{return r=a,kt(r).then((function(o){try{return e=o,(function(){try{return d()}catch(p){return s(p)}})()}catch(p){return S(p)}}),S)}catch(o){return S(o)}}),S)}catch(r){S(r);}}catch(r){return s(r)}};try{if(We()||[fe.DESKTOP_SAFARI,fe.MOBILE_SAFARI].includes(Oe()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(i).then((function(y){try{return e=y,d()}catch{return c()}}),c)}catch{c();}}))}function qe(i,n,b,s,e=1){return new Promise((function(t,d){let c;if(n==="image/png"){let a,o,p;return a=i.getContext("2d"),{data:o}=a.getImageData(0,0,i.width,i.height),p=he.encode([o.buffer],i.width,i.height,4096*e),c=new Blob([p],{type:n}),c.name=b,c.lastModified=s,y.call(this)}{let a=function(){return y.call(this)};if(n==="image/bmp")return new Promise((o=>Ut.toBlob(i,o))).then(function(o){try{return c=o,c.name=b,c.lastModified=s,a.call(this)}catch(p){return d(p)}}.bind(this),d);{let o=function(){return a.call(this)};if(typeof OffscreenCanvas=="function"&&i instanceof OffscreenCanvas)return i.convertToBlob({type:n,quality:e}).then(function(p){try{return c=p,c.name=b,c.lastModified=s,o.call(this)}catch(A){return d(A)}}.bind(this),d);{let p;return p=i.toDataURL(n,e),it(p,b,s).then(function(A){try{return c=A,o.call(this)}catch(R){return d(R)}}.bind(this),d)}}}function y(){return t(c)}}))}function ye(i){i.width=0,i.height=0;}function Me(){return new Promise((function(i,n){let s,e,t,d;return Me.cachedResult!==void 0?i(Me.cachedResult):(it("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(c){try{return s=c,Ge(s).then((function(y){try{return e=y[1],qe(e,s.type,s.name,s.lastModified).then((function(S){try{return t=S,ye(e),Ge(t).then((function(r){try{return d=r[0],Me.cachedResult=d.width===1&&d.height===2,i(Me.cachedResult)}catch(a){return n(a)}}),n)}catch(r){return n(r)}}),n)}catch(S){return n(S)}}),n)}catch(y){return n(y)}}),n))}))}function Bt(i){return new Promise(((n,b)=>{let s=new Dt;s.onload=e=>{let t=new DataView(e.target.result);if(t.getUint16(0,false)!=65496)return n(-2);let d=t.byteLength,c=2;for(;c<d;){if(t.getUint16(c+2,false)<=8)return n(-1);let y=t.getUint16(c,false);if(c+=2,y==65505){if(t.getUint32(c+=2,false)!=1165519206)return n(-1);let S=t.getUint16(c+=6,false)==18761;c+=t.getUint32(c+4,S);let r=t.getUint16(c,S);c+=2;for(let a=0;a<r;a++)if(t.getUint16(c+12*a,S)==274)return n(t.getUint16(c+12*a+8,S))}else {if((65280&y)!=65280)break;c+=t.getUint16(c,false);}}return n(-1)},s.onerror=e=>b(e),s.readAsArrayBuffer(i);}))}function Ht(i,n){let{width:b}=i,{height:s}=i,{maxWidthOrHeight:e}=n,t,d=i;return isFinite(e)&&(b>e||s>e)&&([d,t]=Ke(b,s),b>s?(d.width=e,d.height=s/b*e):(d.width=b/s*e,d.height=e),t.drawImage(i,0,0,d.width,d.height),ye(i)),d}function $t(i,n){let{width:b}=i,{height:s}=i,[e,t]=Ke(b,s);switch(n>4&&n<9?(e.width=s,e.height=b):(e.width=b,e.height=s),n){case 2:t.transform(-1,0,0,1,b,0);break;case 3:t.transform(-1,0,0,-1,b,s);break;case 4:t.transform(1,0,0,-1,0,s);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,s,0);break;case 7:t.transform(0,-1,-1,0,s,b);break;case 8:t.transform(0,-1,1,0,0,b);}return t.drawImage(i,0,0,b,s),ye(i),e}function Pt(i,n,b=0){return new Promise((function(s,e){let t,d,c,y,S,r,a,o,p,A,R,U,I,N,F,M,C,h,O,f;function u(l=5){if(n.signal&&n.signal.aborted)throw n.signal.reason;t+=l,n.onProgress(Math.min(t,100));}function _(l){if(n.signal&&n.signal.aborted)throw n.signal.reason;t=Math.min(Math.max(l,t),100),n.onProgress(t);}return t=b,d=n.maxIteration||10,c=1024*n.maxSizeMB*1024,u(),Ge(i,n).then(function(l){try{return [,y]=l,u(),S=Ht(y,n),u(),new Promise((function(w,E){var v;if(!(v=n.exifOrientation))return Bt(i).then(function(m){try{return v=m,T.call(this)}catch(g){return E(g)}}.bind(this),E);function T(){return w(v)}return T.call(this)})).then(function(w){try{return r=w,u(),Me().then(function(E){try{return a=E?S:$t(S,r),u(),o=n.initialQuality||1,p=n.fileType||i.type,qe(a,p,i.name,i.lastModified,o).then(function(v){try{{let D=function(){if(d--&&(F>c||F>I)){let x,H;return x=f?.95*O.width:O.width,H=f?.95*O.height:O.height,[C,h]=Ke(x,H),h.drawImage(O,0,0,x,H),o*=p==="image/png"?.85:.95,qe(C,p,i.name,i.lastModified,o).then((function(L){try{return M=L,ye(O),O=C,F=M.size,_(Math.min(99,Math.floor((N-F)/(N-c)*100))),D}catch($){return e($)}}),e)}return [1]},P=function(){return ye(O),ye(C),ye(S),ye(a),ye(y),_(100),s(M)};var m=D,g=P;if(A=v,u(),R=A.size>c,U=A.size>i.size,!R&&!U)return _(100),s(A);var T;return I=i.size,N=A.size,F=N,O=a,f=!n.alwaysKeepResolution&&R,(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=D;}else x=x.call(this);}catch(H){return e(H)}}}.bind(this))(D)}}catch(D){return e(D)}}.bind(this),e)}catch(v){return e(v)}}.bind(this),e)}catch(E){return e(E)}}.bind(this),e)}catch(w){return e(w)}}.bind(this),e)}))}var Hn=`
|
|
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
|
-
`,
|
|
24
|
+
`,rt;function $n(i,n){return new Promise(((b,s)=>{rt||(rt=(function(d){let c=[];return c.push(d),URL.createObjectURL(new Blob(c))})(Hn));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 s(new Error(d.data.error)),void e.terminate();b(d.data.file),e.terminate();}else n.onProgress(d.data.progress);})),e.addEventListener("error",s),n.signal&&n.signal.addEventListener("abort",(()=>{s(n.signal.reason),e.terminate();})),e.postMessage({file:i,imageCompressionLibUrl:n.libURL,options:{...n,onProgress:void 0,signal:void 0}});}))}function re(i,n){return new Promise((function(b,s){let e,t,d,c,y,S;if(e={...n},d=0,{onProgress:c}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,y=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=p=>{d=p,typeof c=="function"&&c(d);},!(i instanceof Blob||i instanceof Bn))return s(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(i.type))return s(new Error("The file given is not an image"));if(S=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!y||typeof Worker!="function"||S)return Pt(i,e).then(function(p){try{return t=p,o.call(this)}catch(A){return s(A)}}.bind(this),s);var r=function(){try{return o.call(this)}catch(p){return s(p)}}.bind(this),a=function(p){try{return Pt(i,e).then((function(A){try{return t=A,r()}catch(R){return s(R)}}),s)}catch(A){return s(A)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",$n(i,e).then((function(p){try{return t=p,r()}catch{return a()}}),a)}catch{a();}function o(){try{t.name=i.name,t.lastModified=i.lastModified;}catch{}try{e.preserveExif&&i.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===i.type)&&(t=xt(i,t));}catch{}return b(t)}}))}re.getDataUrlFromFile=Lt,re.getFilefromDataUrl=it,re.loadImage=kt,re.drawImageInCanvas=Nt,re.drawFileInCanvas=Ge,re.canvasToFile=qe,re.getExifOrientation=Bt,re.handleMaxWidthOrHeight=Ht,re.followExifOrientation=$t,re.cleanupCanvasMemory=ye,re.isAutoOrientationInBrowser=Me,re.approximateBelowMaximumCanvasSizeOfBrowser=Ft,re.copyExifWithoutOrientation=xt,re.getBrowserName=Oe,re.version="2.0.2";var En=Ot(Qt()),Sn=Ot(fn());function wr(i){let n=globalThis.document.getElementById("__AUTH_DRAWER"),b=globalThis.document.querySelector(".__drawer_container"),s=globalThis.document.querySelector(".__auth_close_button");n&&s&&b?.classList.contains("__hidden")&&(b.classList.remove("__hidden"),n.src=i,n.onload=()=>{s.classList.remove("__hidden"),n.classList.remove("__hidden"),n.contentWindow?.focus();});}function dn(){if(globalThis.document.getElementById("__AUTH_DRAWER"))return;let i=globalThis.document.createElement("style");i.innerHTML=`
|
|
25
25
|
.__button_container * {
|
|
26
26
|
font-family: -apple-system,
|
|
27
27
|
BlinkMacSystemFont,
|
|
@@ -226,8 +226,15 @@ self.addEventListener('message', async (e) => {
|
|
|
226
226
|
max-width: 100%;
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
`,globalThis.document.head.appendChild(i);let o=globalThis.document.createElement("div");o.className="__drawer_container __hidden";let S=globalThis.document.createElement("iframe");S.className="__drawer_frame __hidden",S.id="__AUTH_DRAWER",S.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"),S.loading="eager",S.referrerPolicy="unsafe-url",S.title="Login";let l=globalThis.document.createElement("div");l.setAttribute("alt","Close"),l.className="__auth_close_button",o.appendChild(S),o.appendChild(l),globalThis.document.body.appendChild(o);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function g(){o.classList.add("__hidden"),S.classList.add("__hidden"),t.forEach(({popup:E,cleanup:r})=>{r();try{E?.close();}catch{}});}let c=globalThis.document.createElement("iframe");c.style.display="none",c.id="__CONNECT_LISTENER",c.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(c);let y=new Promise(E=>{globalThis.window.addEventListener("message",r=>{r.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),E());});});globalThis.window.__REQUEST_CONNECTION__=async E=>{let{connectId:r,provider:a,scope:n,mode:d,appId:v}=E;if(d!=="request_only"){await y;let h=await new Promise(x=>{let f=setTimeout(()=>{globalThis.window.removeEventListener("message",u),x({connections:[]});},3e3),u=_=>{let s=_.data;s?.type!=="connect:check:result"||s?.connectId!==r||(clearTimeout(f),globalThis.window.removeEventListener("message",u),x({connections:s.connections??[]}));};globalThis.window.addEventListener("message",u),c.contentWindow?.postMessage({type:"connect:check",connectId:r,provider:a,scope:n,appId:v},"*");});if(h.connections.length>0)return {status:"connected",connectId:r,connections:h.connections};if(d==="check_only")return {status:"error",connectId:r,error:"no_connections",errorDescription:"No existing connections found."}}let C=new URL("/connect",globalThis.window.__ROOT_URL__);C.searchParams.set("connectId",r),C.searchParams.set("provider",a),n&&C.searchParams.set("scope",n),d&&C.searchParams.set("mode",d),v&&C.searchParams.set("appId",v);let M=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),I=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-M)/2),k=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-I)/2),P=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${M},height=${I},left=${N},top=${k}`,R=d!=="check_only"?globalThis.window.open(C.toString(),`ac1_connect_${r}`,P):null;return new Promise(h=>{let x=()=>{globalThis.window.removeEventListener("message",f),globalThis.window.clearInterval(u),t.delete(r);},f=_=>{let s=_.data||{};if(s.type==="connect:result"&&s.connectId===r){x();try{R?.close();}catch{}s.status==="error"?h({status:"error",connectId:r,error:s.error,errorDescription:s.errorDescription}):h({status:"connected",connectId:r,connections:s.connections??[]});}},u=globalThis.window.setInterval(()=>{R?.closed&&(x(),h({status:"error",connectId:r,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(r,{popup:R,cleanup:x}),globalThis.window.addEventListener("message",f);})},globalThis.window.addEventListener("message",E=>{!E.data||typeof E.data!="object"||E.data.type==="closeAuthDrawer"&&g();}),e?.addEventListener("click",g),o.addEventListener("click",E=>{E.target===o&&g();});}var mt=i=>{let{email:o,phoneNumber:S}=i??{},l=o??S,e=new URLSearchParams;i&&"redirectUri"in i&&i.redirectUri?e.set("returnTo",i.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),l&&e.set("identity",l),e.set("stripped","true");let t=globalThis.window.__APP_ID__;lr(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function ur(i={}){let[o,S]=useState({userId:void 0,status:"loading",signIn:mt,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()??{};S({userId:t.userId??null,status:"authenticated",signIn:mt,providers:t?.providers??[]});}catch{if(i.required){let t=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),g=globalThis.window.__APP_ID__;globalThis.window.top?globalThis.window.top.location.href=`${globalThis.window.__ROOT_URL__}/setup/${g}?returnTo=${t}`:globalThis.window.location.href=`${globalThis.window.__ROOT_URL__}/setup/${g}?returnTo=${t}`;}else S({userId:null,status:"unauthenticated",signIn:mt,providers:[]});}})();},[i.required]),o}async function fr(i){let o=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:o,provider:i.provider,scope:i.scope?.join(","),mode:i.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}async function cn({channelId:i,initialData:o,broadcastOnly:S,onUpdate:l}){let e=o,t=0,g=globalThis.window.__REALTIME_DOMAIN__;if(S)return {getData(){return e},setData(y){e=y,fetch(`https://${g}/${i}`,{method:"POST",body:yt.stringify(e)}).catch(console.error),l?.(y);},destroy(){}};let c=new WebSocket(`wss://${g}/${i}`);return new Promise((y,E)=>{function r(v){try{let C=JSON.parse(v.data.toString());C?.id&&C.id>t?(e=yt.parse(C.payload),l?.(e),t=C.id):console.error("Invalid message:",v.data);}catch{console.error("Error parsing message:",v.data);}}function a(v){d(),E(v);}function n(){y({getData(){return e},setData(v){e=v,l?.(v),c.send(yt.stringify(v));},destroy:d});}function d(){c.removeEventListener("message",r),c.removeEventListener("error",a),c.removeEventListener("open",n),c.close();}c.addEventListener("message",r),c.addEventListener("error",a),c.addEventListener("open",n);})}function ln(i,o){let S=useRef(null),[l,e]=useState(0);return useEffect(()=>((async()=>i&&(S.current=await cn({channelId:i,initialData:o,onUpdate:()=>{e(t=>t+1);}})))(),S.current?.destroy),[i,e]),[S.current?.getData(),S.current?.setData??identity]}function wr(i){let[o,S]=useState(null),[l]=ln(o,void 0),e=i.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async c=>{let y=nanoid(32);return S(y),await e({...c,__channelId:y})},[i?.mutationFn]);return {...useMutation({...i,mutationFn:t}),data:l}}function un(i){return i?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function hn(i){return i[0]}function _r(i){let S=i?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",l=JSON.parse(atob(S.split(" ")?.[0])),e=l?.provider,t=l?.scope;return {provider:e,scope:t,isPopup:i?.message?.endsWith("--popup"),accountId:l?.accountId}}var br=60,Er=30*1e3,wt=0,pn=Date.now(),At=false;function Sr(){return rpcClient({transport:async(i,o)=>{let S=Date.now();if(S-pn>=Er)pn=S,wt=0,At=false;else if(wt>=br)throw At||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),At=true),new RpcError("Rate limit exceeded",-32e3,{status:429});wt++;let l="/api/"+i.method,e=i.params&&hn(i.params)?.__channelId;e&&delete hn(i.params)?.__channelId;let t=await fetch(l,{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:yt.stringify(i),signal:o});if(!t.ok){let c=t.statusText,y=-32e3;try{let{message:E,code:r}=await t.json();E&&(c=E),r&&(y=r);}catch{}throw c.trim()===""&&(c=`Request failed with status: ${t.status}`),new RpcError(c,y,{status:t.status})}let g=yt.deserialize(await t.json());if(un(g.error)){let c=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),y=_r(g.error),E=[`returnTo=${c}`,y.provider?`&provider=${y.provider}`:"",y.scope?`&scope=${y.scope.join(",")}`:"",y.accountId?`&accountId=${y.accountId}`:""].filter(Boolean).join("&");if(y.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${E}&stripped=true`);return}let r=globalThis.window.top??globalThis.window;return r.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${E}`,null}return g}})}function Xr(i){return new Promise(o=>{let S=new globalThis.FileReader;S.onload=()=>{o(S.result);},S.readAsDataURL(i);})}function Tr(){let i={...globalThis.window.console};function o(S,l){let e=(0, mn.default)(l,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${S.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...S)=>{o("LOG",S),i.log(...S);},globalThis.window.console.error=(...S)=>{o("ERROR",S),i.error(...S);},globalThis.window.console.info=(...S)=>{o("INFO",S),i.info(...S);},globalThis.window.console.warn=(...S)=>{o("WARN",S),i.warn(...S);};}function Ir(){function i(o,S=globalThis.window.parent,l="*"){S?.postMessage({...o,source:"iframe"},{targetOrigin:l});}globalThis.window.addEventListener("message",async o=>{let{origin:S,source:l,data:e}=o,{type:t}=e;if(t==="screenshot"){let g=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,c=await gn.default.toPng(globalThis.document.body,{bgcolor:g,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),y=await fetch(c).then(n=>n.blob()),E=await re(y,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),a={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(E)}};i(a,l,S);}});}function Yr({appId:i,rootUrl:o,baseUrl:S,isTesting:l,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=i,globalThis.window.__ROOT_URL__=o,globalThis.window.__BASE_URL__=S,globalThis.window.__IS_TESTING__=l,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,Ir(),Tr(),an(),globalThis.window.onerror=function(g){console.error("Global JS error:",g);},globalThis.window.onunhandledrejection=function(g){console.error("Unhandled promise rejection:",g.reason);});}function Jr(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
|
|
229
|
+
`,globalThis.document.head.appendChild(i);let n=globalThis.document.createElement("div");n.className="__drawer_container __hidden";let b=globalThis.document.createElement("iframe");b.className="__drawer_frame __hidden",b.id="__AUTH_DRAWER",b.setAttribute("allow","fullscreen; camera; microphone; gyroscope; accelerometer; clipboard-write; clipboard-read; autoplay; geolocation; display-capture; picture-in-picture; payment; midi; bluetooth; web-share; screen-wake-lock; xr-spatial-tracking; encrypted-media; idle-detection; hid; serial; window-management"),b.loading="eager",b.referrerPolicy="unsafe-url",b.title="Login";let s=globalThis.document.createElement("div");s.setAttribute("alt","Close"),s.className="__auth_close_button",n.appendChild(b),n.appendChild(s),globalThis.document.body.appendChild(n);let e=globalThis.document.querySelector(".__auth_close_button"),t=new Map;function d(){n.classList.add("__hidden"),b.classList.add("__hidden"),t.forEach(({popup:S,cleanup:r})=>{r();try{S?.close();}catch{}});}let c=globalThis.document.createElement("iframe");c.style.display="none",c.id="__CONNECT_LISTENER",c.src=`${globalThis.window.__ROOT_URL__}/connect-listener`,globalThis.document.body.appendChild(c);let y=new Promise(S=>{globalThis.window.addEventListener("message",r=>{r.data?.type==="connect-listener:ready"&&(console.log("connect listener ready"),S());});});globalThis.window.__REQUEST_CONNECTION__=async S=>{let{connectId:r,provider:a,scope:o,mode:p,appId:A}=S;if(p!=="request_only"){await y;let h=await new Promise(O=>{let f=setTimeout(()=>{globalThis.window.removeEventListener("message",u),O({connections:[]});},3e3),u=_=>{let l=_.data;l?.type!=="connect:check:result"||l?.connectId!==r||(clearTimeout(f),globalThis.window.removeEventListener("message",u),O({connections:l.connections??[]}));};globalThis.window.addEventListener("message",u),c.contentWindow?.postMessage({type:"connect:check",connectId:r,provider:a,scope:o,appId:A},"*");});if(h.connections.length>0)return {status:"connected",connectId:r,connections:h.connections};if(p==="check_only")return {status:"error",connectId:r,error:"no_connections",errorDescription:"No existing connections found."}}let R=new URL("/connect",globalThis.window.__ROOT_URL__);R.searchParams.set("connectId",r),R.searchParams.set("provider",a),o&&R.searchParams.set("scope",o),p&&R.searchParams.set("mode",p),A&&R.searchParams.set("appId",A);let U=Math.min(720,Math.floor(globalThis.window.screen.availWidth*.9)),I=Math.min(800,Math.floor(globalThis.window.screen.availHeight*.9)),N=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-U)/2),F=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-I)/2),M=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${U},height=${I},left=${N},top=${F}`,C=p!=="check_only"?globalThis.window.open(R.toString(),`ac1_connect_${r}`,M):null;return new Promise(h=>{let O=()=>{globalThis.window.removeEventListener("message",f),globalThis.window.clearInterval(u),t.delete(r);},f=_=>{let l=_.data||{};if(l.type==="connect:result"&&l.connectId===r){O();try{C?.close();}catch{}l.status==="error"?h({status:"error",connectId:r,error:l.error,errorDescription:l.errorDescription}):h({status:"connected",connectId:r,connections:l.connections??[]});}},u=globalThis.window.setInterval(()=>{C?.closed&&(O(),h({status:"error",connectId:r,error:"popup_closed",errorDescription:"The connect window was closed before finishing."}));},250);t.set(r,{popup:C,cleanup:O}),globalThis.window.addEventListener("message",f);})},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 At=i=>{let{email:n,phoneNumber:b}=i??{},s=n??b,e=new URLSearchParams;i&&"redirectUri"in i&&i.redirectUri?e.set("returnTo",i.redirectUri):e.set("returnTo",globalThis.window.location.pathname+globalThis.window.location.search),s&&e.set("identity",s),e.set("stripped","true");let t=globalThis.window.__APP_ID__;wr(`${globalThis.window.__ROOT_URL__}/setup/${t}?${e.toString()}`);};function vr(i={}){let[n,b]=useState({userId:void 0,status:"loading",signIn:At,providers:[]});return useEffect(()=>{(async()=>{try{let t=await(await fetch("/api/session",{method:"POST",headers:{"Content-Type":"application/json","x-guest-api-internal":"session",...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{}}})).json()??{};b({userId:t.userId??null,status:"authenticated",signIn:At,providers:t?.providers??[]});}catch{if(i.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 b({userId:null,status:"unauthenticated",signIn:At,providers:[]});}})();},[i.required]),n}async function Ar(i){let n=`c_${Math.random().toString(36).slice(2)}_${Date.now()}`;return await globalThis.window.__REQUEST_CONNECTION__({connectId:n,provider:i.provider,scope:i.scope?.join(","),mode:i.mode??"get_or_request",appId:globalThis.window.__APP_ID__})}var pn=false,xe=new Map,$e=new Map;function _r(){pn||(pn=true,globalThis.window.addEventListener("message",i=>{let n=new URL(globalThis.window.__ROOT_URL__).origin;if(i.origin!==n)return;let b=i.data;if(!b?.type?.startsWith("drive-picker:"))return;let{pickerId:s}=b,e=xe.get(s),t=$e.get(s);if(b.type==="drive-picker:result"){xe.delete(s),$e.delete(s);try{t?.close();}catch{}e?.({action:b.action,docs:b.docs});}else if(b.type==="drive-picker:error"){xe.delete(s),$e.delete(s);try{t?.close();}catch{}console.error("Drive Picker error:",b.error),e?.({action:"cancel"});}}));}function br(i,n,b){let s=Math.min(1024,Math.floor(globalThis.window.screen.availWidth*.9)),e=Math.min(680,Math.floor(globalThis.window.screen.availHeight*.9)),t=Math.floor(globalThis.window.screenX+(globalThis.window.outerWidth-s)/2),d=Math.floor(globalThis.window.screenY+(globalThis.window.outerHeight-e)/2),c=`popup=yes,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=${s},height=${e},left=${t},top=${d}`,y=new URLSearchParams({pickerId:i,connectionId:n,builderCalls:JSON.stringify(b),origin:globalThis.window.location.origin}),S=`${globalThis.window.__ROOT_URL__}/drive-picker?${y.toString()}`;return globalThis.window.open(S,`drive_picker_${i}`,c)}var hn={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"},Er={MINE_ONLY:"MINE_ONLY",MULTISELECT_ENABLED:"MULTISELECT_ENABLED",NAV_HIDDEN:"NAV_HIDDEN",SIMPLE_UPLOAD_ENABLED:"SIMPLE_UPLOAD_ENABLED",SUPPORT_DRIVES:"SUPPORT_DRIVES"},Sr={PICKED:"picked",CANCEL:"cancel"},Ze=class{viewType;viewCalls=[];constructor(n){this.viewType=n??hn.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}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}}},_t=class{constructor(n,b,s){this.connectionToken=n;this.builderCalls=b;this.callback=s;}setVisible(n){if(n){_r();let b=Math.random().toString(36).substring(2,15);this.callback&&xe.set(b,this.callback);let s=br(b,this.connectionToken,this.builderCalls);if(!s){xe.delete(b),console.error("Failed to open picker popup - popup may be blocked"),this.callback?.({action:"cancel"});return}$e.set(b,s);let e=globalThis.window.setInterval(()=>{s.closed&&(globalThis.window.clearInterval(e),xe.has(b)&&(xe.delete(b),$e.delete(b),this.callback?.({action:"cancel"})));},500);}}},bt=class{connectionToken;calls=[];pickerCallback;constructor(n){return this.connectionToken=n,new Proxy(this,{get(b,s,e){return s==="setCallback"?t=>(b.pickerCallback=t,e):s==="build"?()=>b._build():s in b&&typeof b[s]!="function"?b[s]:(...t)=>{if(s==="addView"){let d=t[0];d instanceof Ze||d instanceof je?b.calls.push([s,[d._toConfig()]]):b.calls.push([s,t]);}else b.calls.push([s,t]);return e}}})}_build(){return new _t(this.connectionToken,this.calls,this.pickerCallback)}setTitle(n){return this}setLocale(n){return this}enableFeature(n){return this}disableFeature(n){return this}addView(n){return this}hideTitleBar(){return this}setSize(n,b){return this}setMaxItems(n){return this}setSelectableMimeTypes(n){return this}setCallback(n){return this}build(){return this._build()}};function Tr(i){return new Ze(i)}function Ir(){return new je}async function mn({channelId:i,initialData:n,broadcastOnly:b,onUpdate:s}){let e=n,t=0,d=globalThis.window.__REALTIME_DOMAIN__;if(b)return {getData(){return e},setData(y){e=y,fetch(`https://${d}/${i}`,{method:"POST",body:Et.stringify(e)}).catch(console.error),s?.(y);},destroy(){}};let c=new WebSocket(`wss://${d}/${i}`);return new Promise((y,S)=>{function r(A){try{let R=JSON.parse(A.data.toString());R?.id&&R.id>t?(e=Et.parse(R.payload),s?.(e),t=R.id):console.error("Invalid message:",A.data);}catch{console.error("Error parsing message:",A.data);}}function a(A){p(),S(A);}function o(){y({getData(){return e},setData(A){e=A,s?.(A),c.send(Et.stringify(A));},destroy:p});}function p(){c.removeEventListener("message",r),c.removeEventListener("error",a),c.removeEventListener("open",o),c.close();}c.addEventListener("message",r),c.addEventListener("error",a),c.addEventListener("open",o);})}function yn(i,n){let b=useRef(null),[s,e]=useState(0);return useEffect(()=>((async()=>i&&(b.current=await mn({channelId:i,initialData:n,onUpdate:()=>{e(t=>t+1);}})))(),b.current?.destroy),[i,e]),[b.current?.getData(),b.current?.setData??identity]}function Mr(i){let[n,b]=useState(null),[s]=yn(n,void 0),e=i.mutationFn;if(!e)throw new Error("useRealtimeMutation requires a mutationFn option.");let t=useCallback(async c=>{let y=nanoid(32);return b(y),await e({...c,__channelId:y})},[i?.mutationFn]);return {...useMutation({...i,mutationFn:t}),data:s}}function wn(i){return i?.message?.startsWith("__MISSING AUTH FOR SCOPE")}function _n(i){return i[0]}function kr(i){let b=i?.message?.slice("__MISSING AUTH FOR SCOPE:".length+1).trim()??"",s=JSON.parse(atob(b.split(" ")?.[0])),e=s?.provider,t=s?.scope;return {provider:e,scope:t,isPopup:i?.message?.endsWith("--popup"),accountId:s?.accountId}}var Fr=60,Nr=30*1e3,St=0,bn=Date.now(),Tt=false;function Br(){return rpcClient({transport:async(i,n)=>{let b=Date.now();if(b-bn>=Nr)bn=b,St=0,Tt=false;else if(St>=Fr)throw Tt||(globalThis.window.dispatchEvent(new Event("rate-limit-exceeded")),Tt=true),new RpcError("Rate limit exceeded",-32e3,{status:429});St++;let s="/api/"+i.method,e=i.params&&_n(i.params)?.__channelId;e&&delete _n(i.params)?.__channelId;let t=await fetch(s,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json",...e?{"x-channel-id":e}:{},...globalThis.window.__IS_TESTING__?{"x-is-testing":"true"}:{},"x-boxman-box-id":globalThis.window.__BOX_ID__},body:Et.stringify(i),signal:n});if(!t.ok){let c=t.statusText,y=-32e3;try{let{message:S,code:r}=await t.json();S&&(c=S),r&&(y=r);}catch{}throw c.trim()===""&&(c=`Request failed with status: ${t.status}`),new RpcError(c,y,{status:t.status})}let d=Et.deserialize(await t.json());if(wn(d.error)){let c=encodeURIComponent(globalThis.window.location.pathname+globalThis.window.location.search),y=kr(d.error),S=[`returnTo=${c}`,y.provider?`&provider=${y.provider}`:"",y.scope?`&scope=${y.scope.join(",")}`:"",y.accountId?`&accountId=${y.accountId}`:""].filter(Boolean).join("&");if(y.isPopup){globalThis.window.__OPEN_AUTH_DRAWER__(`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}&stripped=true`);return}let r=globalThis.window.top??globalThis.window;return r.location.href=`${globalThis.window.__ROOT_URL__}/setup/${globalThis.window.__APP_ID__}?${S}`,null}return d}})}function ho(i){return new Promise(n=>{let b=new globalThis.FileReader;b.onload=()=>{n(b.result);},b.readAsDataURL(i);})}function Hr(){let i={...globalThis.window.console};function n(b,s){let e=(0, Sn.default)(s,{depth:5,maxStringLength:512,indent:2});fetch("/_logger",{method:"POST",body:`[console.${b.toLowerCase()}] ${e}`}).catch(()=>{});}globalThis.window.console.log=(...b)=>{n("LOG",b),i.log(...b);},globalThis.window.console.error=(...b)=>{n("ERROR",b),i.error(...b);},globalThis.window.console.info=(...b)=>{n("INFO",b),i.info(...b);},globalThis.window.console.warn=(...b)=>{n("WARN",b),i.warn(...b);};}function Tn(i,n=globalThis.window.parent,b="*"){n?.postMessage({...i,source:"iframe"},{targetOrigin:b});}function $r(){globalThis.window.addEventListener("message",async i=>{let{origin:n,source:b,data:s}=i,{type:e}=s;if(e==="screenshot"){let t=globalThis.window.getComputedStyle(globalThis.document.body).backgroundColor,d=await En.default.toPng(globalThis.document.body,{bgcolor:t,style:{transform:"translateY("+-globalThis.window.scrollY+"px)"},width:globalThis.window.innerWidth,height:globalThis.window.innerHeight,copyDefaultStyles:false}),c=await fetch(d).then(a=>a.blob()),y=await re(c,{maxSizeMB:4,maxWidthOrHeight:1920,useWebWorker:false}),r={type:"screenshot",payload:{screenshot:await re.getDataUrlFromFile(y)}};Tn(r,b,n);}});}function Qr(){let i=null,n=null,b=null;function s(S){return !S||S==="transparent"||S==="rgba(0, 0, 0, 0)"||S==="rgba(0,0,0,0)"}function e(S){let r=getComputedStyle(S).backgroundColor;s(r)||r!==i&&(i=r,Tn({type:"surfaceColor",payload:{color:r}}));}function t(S){n!==S&&(b?.disconnect(),n=S,e(S),b=new MutationObserver(()=>{e(S);}),b.observe(S,{attributes:true,attributeFilter:["class","style"]}));}let d=globalThis.document.getElementById("root");if(!d)return;let c=()=>{let S=d.firstElementChild;if(!S){b?.disconnect(),n=null;return}t(S);};new MutationObserver(c).observe(d,{childList:true}),c();}function Wr(){let i="--ac1-top-inset",n="__ac1-top-inset-style",b=()=>{if(globalThis.document.getElementById(n))return;let e=globalThis.document.createElement("style");e.id=n,e.textContent=`
|
|
230
|
+
#root::before {
|
|
231
|
+
content: '';
|
|
232
|
+
display: block;
|
|
233
|
+
height: var(${i}, 0px);
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
}
|
|
236
|
+
`,globalThis.document.head.appendChild(e);},s=e=>{let t=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;Number.isFinite(t)&&(b(),globalThis.document.documentElement.style.setProperty(i,`${Math.max(0,t)}px`));};globalThis.window.addEventListener("message",e=>{let{data:t}=e;t?.type==="viewportInset"&&s(t?.payload?.top);});}function go({appId:i,rootUrl:n,baseUrl:b,isTesting:s,realtimeDomain:e,boxId:t}){typeof globalThis.window>"u"||globalThis.window.__APP_ID__||(globalThis.window.__APP_ID__=i,globalThis.window.__ROOT_URL__=n,globalThis.window.__BASE_URL__=b,globalThis.window.__IS_TESTING__=s,globalThis.window.__REALTIME_DOMAIN__=e,globalThis.window.__BOX_ID__=t,$r(),Hr(),dn(),Qr(),Wr(),globalThis.window.onerror=function(d){console.error("Global JS error:",d);},globalThis.window.onunhandledrejection=function(d){console.error("Unhandled promise rejection:",d.reason);});}function mo(){return globalThis.window.__BASE_URL__}/*! Bundled license information:
|
|
230
237
|
|
|
231
238
|
dom-to-image-more/dist/dom-to-image-more.min.js:
|
|
232
239
|
(*! dom-to-image-more 23-10-2025 *)
|
|
233
|
-
*/export{Sr as apiClient,
|
|
240
|
+
*/export{Sr as Action,Ir as DocsUploadView,Tr as DocsView,Er as Feature,bt as PickerBuilder,hn as ViewId,Br as apiClient,Ar as connect,mn as connectToRealtimeStore,ho as encodeFileAsBase64DataURL,mo as getBaseUrl,go as initializeClientEnvironment,vr as useAuth,Mr as useRealtimeMutation,yn as useRealtimeStore};
|