diff --git a/404.html b/404.html index 3c268d3..05aaf6c 100644 --- a/404.html +++ b/404.html @@ -38,7 +38,7 @@ - + diff --git a/assets/index.142cec87.js b/assets/index.429f2611.js similarity index 99% rename from assets/index.142cec87.js rename to assets/index.429f2611.js index 2638153..aaeb843 100644 --- a/assets/index.142cec87.js +++ b/assets/index.429f2611.js @@ -1,4 +1,4 @@ -import{g as HI}from"./index.ab1a215a.js";function sI(S,t){for(var L=0;Ln[f]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var FB={},uA={};Object.defineProperty(uA,"__esModule",{value:!0});uA.normalize=void 0;const tA=47,GB=46,KI=(S,t)=>{let L="",n=0,f=-1,G=0,u;for(let T=0;T<=S.length;++T){if(T2){const v=L.lastIndexOf("/");if(v!==L.length-1){v===-1?(L="",n=0):(L=L.slice(0,v),n=L.length-1-L.lastIndexOf("/")),f=T,G=0;continue}}else if(L.length===2||L.length===1){L="",n=0,f=T,G=0;continue}}t&&(L.length>0?L+="/..":L="..",n=2)}else L.length>0?L+="/"+S.slice(f+1,T):L=S.slice(f+1,T),n=T-f-1;f=T,G=0}else u===GB&&G!==-1?++G:G=-1}return L},LI=S=>{let t=S;if(t.length===0)return".";const L=t.charCodeAt(0)===tA,n=t.charCodeAt(t.length-1)===tA;return t=KI(t,!L),t.length===0&&!L&&(t="."),t.length>0&&n&&(t+="/"),L?"/"+t:t};uA.normalize=LI;var PA={};Object.defineProperty(PA,"__esModule",{value:!0});PA.base64Decode=void 0;function VI(S){return S>64&&S<91?S-65:S>96&&S<123?S-71:S>47&&S<58?S+4:S===43?62:S===47?63:0}function ZI(S){const t=S.replace(/[^A-Za-z0-9+/]/g,""),L=t.length,n=L*3+1>>2,f=new Uint8Array(n);let G,u,T=0,v=0;for(let _=0;_>>(16>>>G&24)&255,G++,v++;T=0}return f}PA.base64Decode=ZI;var _A={},$B={exports:{}};(function(S,t){var L=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f){f=f||{};var G=typeof f<"u"?f:{},u,T;G.ready=new Promise(function(A,B){u=A,T=B});var v=Object.assign({},G),_="./this.program",WA=(A,B)=>{throw B},z=!0,b="";function $(A){return G.locateFile?G.locateFile(A,b):b+A}var r,RA,NA;typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),n&&(b=n),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",r=A=>{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.send(null),B.responseText},RA=(A,B,g)=>{var Q=new XMLHttpRequest;Q.open("GET",A,!0),Q.responseType="arraybuffer",Q.onload=()=>{if(Q.status==200||Q.status==0&&Q.response){B(Q.response);return}g()},Q.onerror=g,Q.send(null)};var wA=G.print||console.log.bind(console),p=G.printErr||console.warn.bind(console);Object.assign(G,v),v=null,G.arguments&&G.arguments,G.thisProgram&&(_=G.thisProgram),G.quit&&(WA=G.quit);var AA;G.wasmBinary&&(AA=G.wasmBinary);var dA=G.noExitRuntime||!0;typeof WebAssembly!="object"&&oA("no native wasm support detected");var HA,sA=!1;function $A(A,B){A||oA(B)}var mA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function CA(A,B,g){for(var Q=B+g,C=B;A[C]&&!(C>=Q);)++C;if(C-B>16&&A.buffer&&mA)return mA.decode(A.subarray(B,C));for(var E="";B>10,56320|o&1023)}}return E}function GA(A,B){return A?CA(gA,A,B):""}function aA(A,B,g,Q){if(!(Q>0))return 0;for(var C=g,E=g+Q-1,D=0;D=55296&&N<=57343){var F=A.charCodeAt(++D);N=65536+((N&1023)<<10)|F&1023}if(N<=127){if(g>=E)break;B[g++]=N}else if(N<=2047){if(g+1>=E)break;B[g++]=192|N>>6,B[g++]=128|N&63}else if(N<=65535){if(g+2>=E)break;B[g++]=224|N>>12,B[g++]=128|N>>6&63,B[g++]=128|N&63}else{if(g+3>=E)break;B[g++]=240|N>>18,B[g++]=128|N>>12&63,B[g++]=128|N>>6&63,B[g++]=128|N&63}}return B[g]=0,g-C}function KA(A,B,g){return aA(A,gA,B,g)}function e(A){for(var B=0,g=0;g=55296&&Q<=57343?(B+=4,++g):B+=3}return B}var FA,W,gA,hA,R,d,MA,kA;function Ag(A){FA=A,G.HEAP8=W=new Int8Array(A),G.HEAP16=hA=new Int16Array(A),G.HEAP32=R=new Int32Array(A),G.HEAPU8=gA=new Uint8Array(A),G.HEAPU16=new Uint16Array(A),G.HEAPU32=d=new Uint32Array(A),G.HEAPF32=MA=new Float32Array(A),G.HEAPF64=kA=new Float64Array(A)}G.INITIAL_MEMORY;var LA,oB=[],UB=[],YB=[];function Bg(){return dA}function gg(){if(G.preRun)for(typeof G.preRun=="function"&&(G.preRun=[G.preRun]);G.preRun.length;)Cg(G.preRun.shift());AB(oB)}function Qg(){!G.noFSInit&&!I.init.initialized&&I.init(),I.ignorePermissions=!1,AB(UB)}function Ig(){if(G.postRun)for(typeof G.postRun=="function"&&(G.postRun=[G.postRun]);G.postRun.length;)Dg(G.postRun.shift());AB(YB)}function Cg(A){oB.unshift(A)}function Eg(A){UB.unshift(A)}function Dg(A){YB.unshift(A)}var SA=0,jA=null;function mI(A){return A}function TA(A){SA++,G.monitorRunDependencies&&G.monitorRunDependencies(SA)}function lA(A){if(SA--,G.monitorRunDependencies&&G.monitorRunDependencies(SA),SA==0&&jA){var B=jA;jA=null,B()}}function oA(A){G.onAbort&&G.onAbort(A),A="Aborted("+A+")",p(A),sA=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw T(B),B}var Ng="data:application/octet-stream;base64,";function iB(A){return A.startsWith(Ng)}var QA;QA="funcfiftlib.wasm",iB(QA)||(QA=$(QA));function RB(A){try{if(A==QA&&AA)return new Uint8Array(AA);throw"both async and sync fetching of the wasm failed"}catch(B){oA(B)}}function Gg(){return!AA&&z&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+QA+"'";return A.arrayBuffer()}).catch(function(){return RB(QA)}):Promise.resolve().then(function(){return RB(QA)})}function Fg(){var A={a:bQ};function B(D,N){var F=D.exports;G.asm=F,HA=G.asm.Ea,Ag(HA.buffer),LA=G.asm.Ia,Eg(G.asm.Fa),lA()}TA();function g(D){B(D.instance)}function Q(D){return Gg().then(function(N){return WebAssembly.instantiate(N,A)}).then(function(N){return N}).then(D,function(N){p("failed to asynchronously prepare wasm: "+N),oA(N)})}function C(){return!AA&&typeof WebAssembly.instantiateStreaming=="function"&&!iB(QA)&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(D){var N=WebAssembly.instantiateStreaming(D,A);return N.then(g,function(F){return p("wasm streaming compile failed: "+F),p("falling back to ArrayBuffer instantiation"),Q(g)})}):Q(g)}if(G.instantiateWasm)try{var E=G.instantiateWasm(A,B);return E}catch(D){return p("Module.instantiateWasm callback failed with error: "+D),!1}return C().catch(T),{}}var M,X,og={567360:A=>{throw GA(A)}};function Ug(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function AB(A){for(;A.length>0;)A.shift()(G)}function Yg(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function ig(A,B,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":W[A>>0]=B;break;case"i8":W[A>>0]=B;break;case"i16":hA[A>>1]=B;break;case"i32":R[A>>2]=B;break;case"i64":X=[B>>>0,(M=B,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[A>>2]=X[0],R[A+4>>2]=X[1];break;case"float":MA[A>>2]=B;break;case"double":kA[A>>3]=B;break;case"*":d[A>>2]=B;break;default:oA("invalid type for setValue: "+g)}}function wB(A,B){W.set(A,B)}function Rg(A){return EB(A+24)+24}var pA=[];function wg(A){A.add_ref()}var nA=0;function hg(A){var B=new JA(A);return B.get_caught()||(B.set_caught(!0),nA--),B.set_rethrown(!1),pA.push(B),wg(B),B.get_exception_ptr()}var UA=0;function JA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){d[this.ptr+4>>2]=B},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(B){d[this.ptr+8>>2]=B},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(B){R[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,W[this.ptr+12>>0]=B},this.get_caught=function(){return W[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,W[this.ptr+13>>0]=B},this.get_rethrown=function(){return W[this.ptr+13>>0]!=0},this.init=function(B,g){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(g),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=R[this.ptr>>2];R[this.ptr>>2]=B+1},this.release_ref=function(){var B=R[this.ptr>>2];return R[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){d[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=xB(this.get_type());if(B)return d[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}function hB(A){try{return jB(new JA(A).ptr)}catch{}}function l(A){return LA.get(A)}function kg(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&l(B)(A.excPtr),hB(A.excPtr)}}function yg(){H(0);var A=pA.pop();kg(A),UA=0}function ag(A){throw UA||(UA=A),A}function Mg(){var A=UA;if(!A)return O(0),0;var B=new JA(A);B.set_adjusted_ptr(A);var g=B.get_type();if(!g)return O(0),A;for(var Q=Array.prototype.slice.call(arguments),C=0;C>2]=A,A}var m={isAbs:A=>A.charAt(0)==="/",splitPath:A=>{var B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return B.exec(A).slice(1)},normalizeArray:(A,B)=>{for(var g=0,Q=A.length-1;Q>=0;Q--){var C=A[Q];C==="."?A.splice(Q,1):C===".."?(A.splice(Q,1),g++):g&&(A.splice(Q,1),g--)}if(B)for(;g;g--)A.unshift("..");return A},normalize:A=>{var B=m.isAbs(A),g=A.substr(-1)==="/";return A=m.normalizeArray(A.split("/").filter(Q=>!!Q),!B).join("/"),!A&&!B&&(A="."),A&&g&&(A+="/"),(B?"/":"")+A},dirname:A=>{var B=m.splitPath(A),g=B[0],Q=B[1];return!g&&!Q?".":(Q&&(Q=Q.substr(0,Q.length-1)),g+Q)},basename:A=>{if(A==="/")return"/";A=m.normalize(A),A=A.replace(/\/$/,"");var B=A.lastIndexOf("/");return B===-1?A:A.substr(B+1)},join:function(){var A=Array.prototype.slice.call(arguments,0);return m.normalize(A.join("/"))},join2:(A,B)=>m.normalize(A+"/"+B)};function Vg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var A=new Uint8Array(1);return()=>(crypto.getRandomValues(A),A[0])}else return()=>oA("randomDevice")}var YA={resolve:function(){for(var A="",B=!1,g=arguments.length-1;g>=-1&&!B;g--){var Q=g>=0?arguments[g]:I.cwd();if(typeof Q!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!Q)return"";A=Q+"/"+A,B=m.isAbs(Q)}return A=m.normalizeArray(A.split("/").filter(C=>!!C),!B).join("/"),(B?"/":"")+A||"."},relative:(A,B)=>{A=YA.resolve(A).substr(1),B=YA.resolve(B).substr(1);function g(o){for(var h=0;h=0&&o[y]==="";y--);return h>y?[]:o.slice(h,y-h+1)}for(var Q=g(A.split("/")),C=g(B.split("/")),E=Math.min(Q.length,C.length),D=E,N=0;N0?g:e(A)+1,C=new Array(Q),E=aA(A,C,0,C.length);return B&&(C.length=E),C}var cA={ttys:[],init:function(){},shutdown:function(){},register:function(A,B){cA.ttys[A]={input:[],output:[],ops:B},I.registerDevice(A,cA.stream_ops)},stream_ops:{open:function(A){var B=cA.ttys[A.node.rdev];if(!B)throw new I.ErrnoError(43);A.tty=B,A.seekable=!1},close:function(A){A.tty.ops.fsync(A.tty)},fsync:function(A){A.tty.ops.fsync(A.tty)},read:function(A,B,g,Q,C){if(!A.tty||!A.tty.ops.get_char)throw new I.ErrnoError(60);for(var E=0,D=0;Dn[f]})}}}return Object.freeze(Object.defineProperty(S,Symbol.toStringTag,{value:"Module"}))}var FB={},uA={};Object.defineProperty(uA,"__esModule",{value:!0});uA.normalize=void 0;const tA=47,GB=46,KI=(S,t)=>{let L="",n=0,f=-1,G=0,u;for(let T=0;T<=S.length;++T){if(T2){const v=L.lastIndexOf("/");if(v!==L.length-1){v===-1?(L="",n=0):(L=L.slice(0,v),n=L.length-1-L.lastIndexOf("/")),f=T,G=0;continue}}else if(L.length===2||L.length===1){L="",n=0,f=T,G=0;continue}}t&&(L.length>0?L+="/..":L="..",n=2)}else L.length>0?L+="/"+S.slice(f+1,T):L=S.slice(f+1,T),n=T-f-1;f=T,G=0}else u===GB&&G!==-1?++G:G=-1}return L},LI=S=>{let t=S;if(t.length===0)return".";const L=t.charCodeAt(0)===tA,n=t.charCodeAt(t.length-1)===tA;return t=KI(t,!L),t.length===0&&!L&&(t="."),t.length>0&&n&&(t+="/"),L?"/"+t:t};uA.normalize=LI;var PA={};Object.defineProperty(PA,"__esModule",{value:!0});PA.base64Decode=void 0;function VI(S){return S>64&&S<91?S-65:S>96&&S<123?S-71:S>47&&S<58?S+4:S===43?62:S===47?63:0}function ZI(S){const t=S.replace(/[^A-Za-z0-9+/]/g,""),L=t.length,n=L*3+1>>2,f=new Uint8Array(n);let G,u,T=0,v=0;for(let _=0;_>>(16>>>G&24)&255,G++,v++;T=0}return f}PA.base64Decode=ZI;var _A={},$B={exports:{}};(function(S,t){var L=(()=>{var n=typeof document<"u"&&document.currentScript?document.currentScript.src:void 0;return function(f){f=f||{};var G=typeof f<"u"?f:{},u,T;G.ready=new Promise(function(A,B){u=A,T=B});var v=Object.assign({},G),_="./this.program",WA=(A,B)=>{throw B},z=!0,b="";function $(A){return G.locateFile?G.locateFile(A,b):b+A}var r,RA,NA;typeof document<"u"&&document.currentScript&&(b=document.currentScript.src),n&&(b=n),b.indexOf("blob:")!==0?b=b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):b="",r=A=>{var B=new XMLHttpRequest;return B.open("GET",A,!1),B.send(null),B.responseText},RA=(A,B,g)=>{var Q=new XMLHttpRequest;Q.open("GET",A,!0),Q.responseType="arraybuffer",Q.onload=()=>{if(Q.status==200||Q.status==0&&Q.response){B(Q.response);return}g()},Q.onerror=g,Q.send(null)};var wA=G.print||console.log.bind(console),p=G.printErr||console.warn.bind(console);Object.assign(G,v),v=null,G.arguments&&G.arguments,G.thisProgram&&(_=G.thisProgram),G.quit&&(WA=G.quit);var AA;G.wasmBinary&&(AA=G.wasmBinary);var dA=G.noExitRuntime||!0;typeof WebAssembly!="object"&&oA("no native wasm support detected");var HA,sA=!1;function $A(A,B){A||oA(B)}var mA=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function CA(A,B,g){for(var Q=B+g,C=B;A[C]&&!(C>=Q);)++C;if(C-B>16&&A.buffer&&mA)return mA.decode(A.subarray(B,C));for(var E="";B>10,56320|o&1023)}}return E}function GA(A,B){return A?CA(gA,A,B):""}function aA(A,B,g,Q){if(!(Q>0))return 0;for(var C=g,E=g+Q-1,D=0;D=55296&&N<=57343){var F=A.charCodeAt(++D);N=65536+((N&1023)<<10)|F&1023}if(N<=127){if(g>=E)break;B[g++]=N}else if(N<=2047){if(g+1>=E)break;B[g++]=192|N>>6,B[g++]=128|N&63}else if(N<=65535){if(g+2>=E)break;B[g++]=224|N>>12,B[g++]=128|N>>6&63,B[g++]=128|N&63}else{if(g+3>=E)break;B[g++]=240|N>>18,B[g++]=128|N>>12&63,B[g++]=128|N>>6&63,B[g++]=128|N&63}}return B[g]=0,g-C}function KA(A,B,g){return aA(A,gA,B,g)}function e(A){for(var B=0,g=0;g=55296&&Q<=57343?(B+=4,++g):B+=3}return B}var FA,W,gA,hA,R,d,MA,kA;function Ag(A){FA=A,G.HEAP8=W=new Int8Array(A),G.HEAP16=hA=new Int16Array(A),G.HEAP32=R=new Int32Array(A),G.HEAPU8=gA=new Uint8Array(A),G.HEAPU16=new Uint16Array(A),G.HEAPU32=d=new Uint32Array(A),G.HEAPF32=MA=new Float32Array(A),G.HEAPF64=kA=new Float64Array(A)}G.INITIAL_MEMORY;var LA,oB=[],UB=[],YB=[];function Bg(){return dA}function gg(){if(G.preRun)for(typeof G.preRun=="function"&&(G.preRun=[G.preRun]);G.preRun.length;)Cg(G.preRun.shift());AB(oB)}function Qg(){!G.noFSInit&&!I.init.initialized&&I.init(),I.ignorePermissions=!1,AB(UB)}function Ig(){if(G.postRun)for(typeof G.postRun=="function"&&(G.postRun=[G.postRun]);G.postRun.length;)Dg(G.postRun.shift());AB(YB)}function Cg(A){oB.unshift(A)}function Eg(A){UB.unshift(A)}function Dg(A){YB.unshift(A)}var SA=0,jA=null;function mI(A){return A}function TA(A){SA++,G.monitorRunDependencies&&G.monitorRunDependencies(SA)}function lA(A){if(SA--,G.monitorRunDependencies&&G.monitorRunDependencies(SA),SA==0&&jA){var B=jA;jA=null,B()}}function oA(A){G.onAbort&&G.onAbort(A),A="Aborted("+A+")",p(A),sA=!0,A+=". Build with -sASSERTIONS for more info.";var B=new WebAssembly.RuntimeError(A);throw T(B),B}var Ng="data:application/octet-stream;base64,";function iB(A){return A.startsWith(Ng)}var QA;QA="funcfiftlib.wasm",iB(QA)||(QA=$(QA));function RB(A){try{if(A==QA&&AA)return new Uint8Array(AA);throw"both async and sync fetching of the wasm failed"}catch(B){oA(B)}}function Gg(){return!AA&&z&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(A){if(!A.ok)throw"failed to load wasm binary file at '"+QA+"'";return A.arrayBuffer()}).catch(function(){return RB(QA)}):Promise.resolve().then(function(){return RB(QA)})}function Fg(){var A={a:bQ};function B(D,N){var F=D.exports;G.asm=F,HA=G.asm.Ea,Ag(HA.buffer),LA=G.asm.Ia,Eg(G.asm.Fa),lA()}TA();function g(D){B(D.instance)}function Q(D){return Gg().then(function(N){return WebAssembly.instantiate(N,A)}).then(function(N){return N}).then(D,function(N){p("failed to asynchronously prepare wasm: "+N),oA(N)})}function C(){return!AA&&typeof WebAssembly.instantiateStreaming=="function"&&!iB(QA)&&typeof fetch=="function"?fetch(QA,{credentials:"same-origin"}).then(function(D){var N=WebAssembly.instantiateStreaming(D,A);return N.then(g,function(F){return p("wasm streaming compile failed: "+F),p("falling back to ArrayBuffer instantiation"),Q(g)})}):Q(g)}if(G.instantiateWasm)try{var E=G.instantiateWasm(A,B);return E}catch(D){return p("Module.instantiateWasm callback failed with error: "+D),!1}return C().catch(T),{}}var M,X,og={567360:A=>{throw GA(A)}};function Ug(A){this.name="ExitStatus",this.message="Program terminated with exit("+A+")",this.status=A}function AB(A){for(;A.length>0;)A.shift()(G)}function Yg(){var A=new Error;if(!A.stack){try{throw new Error}catch(B){A=B}if(!A.stack)return"(no stack trace available)"}return A.stack.toString()}function ig(A,B,g="i8"){switch(g.endsWith("*")&&(g="*"),g){case"i1":W[A>>0]=B;break;case"i8":W[A>>0]=B;break;case"i16":hA[A>>1]=B;break;case"i32":R[A>>2]=B;break;case"i64":X=[B>>>0,(M=B,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[A>>2]=X[0],R[A+4>>2]=X[1];break;case"float":MA[A>>2]=B;break;case"double":kA[A>>3]=B;break;case"*":d[A>>2]=B;break;default:oA("invalid type for setValue: "+g)}}function wB(A,B){W.set(A,B)}function Rg(A){return EB(A+24)+24}var pA=[];function wg(A){A.add_ref()}var nA=0;function hg(A){var B=new JA(A);return B.get_caught()||(B.set_caught(!0),nA--),B.set_rethrown(!1),pA.push(B),wg(B),B.get_exception_ptr()}var UA=0;function JA(A){this.excPtr=A,this.ptr=A-24,this.set_type=function(B){d[this.ptr+4>>2]=B},this.get_type=function(){return d[this.ptr+4>>2]},this.set_destructor=function(B){d[this.ptr+8>>2]=B},this.get_destructor=function(){return d[this.ptr+8>>2]},this.set_refcount=function(B){R[this.ptr>>2]=B},this.set_caught=function(B){B=B?1:0,W[this.ptr+12>>0]=B},this.get_caught=function(){return W[this.ptr+12>>0]!=0},this.set_rethrown=function(B){B=B?1:0,W[this.ptr+13>>0]=B},this.get_rethrown=function(){return W[this.ptr+13>>0]!=0},this.init=function(B,g){this.set_adjusted_ptr(0),this.set_type(B),this.set_destructor(g),this.set_refcount(0),this.set_caught(!1),this.set_rethrown(!1)},this.add_ref=function(){var B=R[this.ptr>>2];R[this.ptr>>2]=B+1},this.release_ref=function(){var B=R[this.ptr>>2];return R[this.ptr>>2]=B-1,B===1},this.set_adjusted_ptr=function(B){d[this.ptr+16>>2]=B},this.get_adjusted_ptr=function(){return d[this.ptr+16>>2]},this.get_exception_ptr=function(){var B=xB(this.get_type());if(B)return d[this.excPtr>>2];var g=this.get_adjusted_ptr();return g!==0?g:this.excPtr}}function hB(A){try{return jB(new JA(A).ptr)}catch{}}function l(A){return LA.get(A)}function kg(A){if(A.release_ref()&&!A.get_rethrown()){var B=A.get_destructor();B&&l(B)(A.excPtr),hB(A.excPtr)}}function yg(){H(0);var A=pA.pop();kg(A),UA=0}function ag(A){throw UA||(UA=A),A}function Mg(){var A=UA;if(!A)return O(0),0;var B=new JA(A);B.set_adjusted_ptr(A);var g=B.get_type();if(!g)return O(0),A;for(var Q=Array.prototype.slice.call(arguments),C=0;C>2]=A,A}var m={isAbs:A=>A.charAt(0)==="/",splitPath:A=>{var B=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return B.exec(A).slice(1)},normalizeArray:(A,B)=>{for(var g=0,Q=A.length-1;Q>=0;Q--){var C=A[Q];C==="."?A.splice(Q,1):C===".."?(A.splice(Q,1),g++):g&&(A.splice(Q,1),g--)}if(B)for(;g;g--)A.unshift("..");return A},normalize:A=>{var B=m.isAbs(A),g=A.substr(-1)==="/";return A=m.normalizeArray(A.split("/").filter(Q=>!!Q),!B).join("/"),!A&&!B&&(A="."),A&&g&&(A+="/"),(B?"/":"")+A},dirname:A=>{var B=m.splitPath(A),g=B[0],Q=B[1];return!g&&!Q?".":(Q&&(Q=Q.substr(0,Q.length-1)),g+Q)},basename:A=>{if(A==="/")return"/";A=m.normalize(A),A=A.replace(/\/$/,"");var B=A.lastIndexOf("/");return B===-1?A:A.substr(B+1)},join:function(){var A=Array.prototype.slice.call(arguments,0);return m.normalize(A.join("/"))},join2:(A,B)=>m.normalize(A+"/"+B)};function Vg(){if(typeof crypto=="object"&&typeof crypto.getRandomValues=="function"){var A=new Uint8Array(1);return()=>(crypto.getRandomValues(A),A[0])}else return()=>oA("randomDevice")}var YA={resolve:function(){for(var A="",B=!1,g=arguments.length-1;g>=-1&&!B;g--){var Q=g>=0?arguments[g]:I.cwd();if(typeof Q!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!Q)return"";A=Q+"/"+A,B=m.isAbs(Q)}return A=m.normalizeArray(A.split("/").filter(C=>!!C),!B).join("/"),(B?"/":"")+A||"."},relative:(A,B)=>{A=YA.resolve(A).substr(1),B=YA.resolve(B).substr(1);function g(o){for(var h=0;h=0&&o[y]==="";y--);return h>y?[]:o.slice(h,y-h+1)}for(var Q=g(A.split("/")),C=g(B.split("/")),E=Math.min(Q.length,C.length),D=E,N=0;N0?g:e(A)+1,C=new Array(Q),E=aA(A,C,0,C.length);return B&&(C.length=E),C}var cA={ttys:[],init:function(){},shutdown:function(){},register:function(A,B){cA.ttys[A]={input:[],output:[],ops:B},I.registerDevice(A,cA.stream_ops)},stream_ops:{open:function(A){var B=cA.ttys[A.node.rdev];if(!B)throw new I.ErrnoError(43);A.tty=B,A.seekable=!1},close:function(A){A.tty.ops.fsync(A.tty)},fsync:function(A){A.tty.ops.fsync(A.tty)},read:function(A,B,g,Q,C){if(!A.tty||!A.tty.ops.get_char)throw new I.ErrnoError(60);for(var E=0,D=0;D0&&(wA(CA(A.output,0)),A.output=[])}},default_tty1_ops:{put_char:function(A,B){B===null||B===10?(p(CA(A.output,0)),A.output=[]):B!=0&&A.output.push(B)},fsync:function(A){A.output&&A.output.length>0&&(p(CA(A.output,0)),A.output=[])}}};function Zg(A,B){gA.fill(0,A,A+B)}function Wg(A,B){return Math.ceil(A/B)*B}function kB(A){A=Wg(A,65536);var B=qB(65536,A);return B?(Zg(B,A),B):0}var J={ops_table:null,mount:function(A){return J.createNode(null,"/",16895,0)},createNode:function(A,B,g,Q){if(I.isBlkdev(g)||I.isFIFO(g))throw new I.ErrnoError(63);J.ops_table||(J.ops_table={dir:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr,lookup:J.node_ops.lookup,mknod:J.node_ops.mknod,rename:J.node_ops.rename,unlink:J.node_ops.unlink,rmdir:J.node_ops.rmdir,readdir:J.node_ops.readdir,symlink:J.node_ops.symlink},stream:{llseek:J.stream_ops.llseek}},file:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr},stream:{llseek:J.stream_ops.llseek,read:J.stream_ops.read,write:J.stream_ops.write,allocate:J.stream_ops.allocate,mmap:J.stream_ops.mmap,msync:J.stream_ops.msync}},link:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr,readlink:J.node_ops.readlink},stream:{}},chrdev:{node:{getattr:J.node_ops.getattr,setattr:J.node_ops.setattr},stream:I.chrdev_stream_ops}});var C=I.createNode(A,B,g,Q);return I.isDir(C.mode)?(C.node_ops=J.ops_table.dir.node,C.stream_ops=J.ops_table.dir.stream,C.contents={}):I.isFile(C.mode)?(C.node_ops=J.ops_table.file.node,C.stream_ops=J.ops_table.file.stream,C.usedBytes=0,C.contents=null):I.isLink(C.mode)?(C.node_ops=J.ops_table.link.node,C.stream_ops=J.ops_table.link.stream):I.isChrdev(C.mode)&&(C.node_ops=J.ops_table.chrdev.node,C.stream_ops=J.ops_table.chrdev.stream),C.timestamp=Date.now(),A&&(A.contents[B]=C,A.timestamp=C.timestamp),C},getFileDataAsTypedArray:function(A){return A.contents?A.contents.subarray?A.contents.subarray(0,A.usedBytes):new Uint8Array(A.contents):new Uint8Array(0)},expandFileStorage:function(A,B){var g=A.contents?A.contents.length:0;if(!(g>=B)){var Q=1024*1024;B=Math.max(B,g*(g>>0),g!=0&&(B=Math.max(B,256));var C=A.contents;A.contents=new Uint8Array(B),A.usedBytes>0&&A.contents.set(C.subarray(0,A.usedBytes),0)}},resizeFileStorage:function(A,B){if(A.usedBytes!=B)if(B==0)A.contents=null,A.usedBytes=0;else{var g=A.contents;A.contents=new Uint8Array(B),g&&A.contents.set(g.subarray(0,Math.min(B,A.usedBytes))),A.usedBytes=B}},node_ops:{getattr:function(A){var B={};return B.dev=I.isChrdev(A.mode)?A.id:1,B.ino=A.id,B.mode=A.mode,B.nlink=1,B.uid=0,B.gid=0,B.rdev=A.rdev,I.isDir(A.mode)?B.size=4096:I.isFile(A.mode)?B.size=A.usedBytes:I.isLink(A.mode)?B.size=A.link.length:B.size=0,B.atime=new Date(A.timestamp),B.mtime=new Date(A.timestamp),B.ctime=new Date(A.timestamp),B.blksize=4096,B.blocks=Math.ceil(B.size/B.blksize),B},setattr:function(A,B){B.mode!==void 0&&(A.mode=B.mode),B.timestamp!==void 0&&(A.timestamp=B.timestamp),B.size!==void 0&&J.resizeFileStorage(A,B.size)},lookup:function(A,B){throw I.genericErrors[44]},mknod:function(A,B,g,Q){return J.createNode(A,B,g,Q)},rename:function(A,B,g){if(I.isDir(A.mode)){var Q;try{Q=I.lookupNode(B,g)}catch{}if(Q)for(var C in Q.contents)throw new I.ErrnoError(55)}delete A.parent.contents[A.name],A.parent.timestamp=Date.now(),A.name=g,B.contents[g]=A,B.timestamp=A.parent.timestamp,A.parent=B},unlink:function(A,B){delete A.contents[B],A.timestamp=Date.now()},rmdir:function(A,B){var g=I.lookupNode(A,B);for(var Q in g.contents)throw new I.ErrnoError(55);delete A.contents[B],A.timestamp=Date.now()},readdir:function(A){var B=[".",".."];for(var g in A.contents)!A.contents.hasOwnProperty(g)||B.push(g);return B},symlink:function(A,B,g){var Q=J.createNode(A,B,41471,0);return Q.link=g,Q},readlink:function(A){if(!I.isLink(A.mode))throw new I.ErrnoError(28);return A.link}},stream_ops:{read:function(A,B,g,Q,C){var E=A.node.contents;if(C>=A.node.usedBytes)return 0;var D=Math.min(A.node.usedBytes-C,Q);if(D>8&&E.subarray)B.set(E.subarray(C,C+D),g);else for(var N=0;N0||g+B{$A(E,'Loading data file "'+A+'" failed (no arrayBuffer).'),B(new Uint8Array(E)),C&&lA()},E=>{if(g)g();else throw'Loading data file "'+A+'" failed.'}),C&&TA()}var I={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,lookupPath:(A,B={})=>{if(A=YA.resolve(I.cwd(),A),!A)return{path:"",node:null};var g={follow_mount:!0,recurse_count:0};if(B=Object.assign(g,B),B.recurse_count>8)throw new I.ErrnoError(32);for(var Q=m.normalizeArray(A.split("/").filter(y=>!!y),!1),C=I.root,E="/",D=0;D40)throw new I.ErrnoError(32)}}return{path:E,node:C}},getPath:A=>{for(var B;;){if(I.isRoot(A)){var g=A.mount.mountpoint;return B?g[g.length-1]!=="/"?g+"/"+B:g+B:g}B=B?A.name+"/"+B:A.name,A=A.parent}},hashName:(A,B)=>{for(var g=0,Q=0;Q>>0)%I.nameTable.length},hashAddNode:A=>{var B=I.hashName(A.parent.id,A.name);A.name_next=I.nameTable[B],I.nameTable[B]=A},hashRemoveNode:A=>{var B=I.hashName(A.parent.id,A.name);if(I.nameTable[B]===A)I.nameTable[B]=A.name_next;else for(var g=I.nameTable[B];g;){if(g.name_next===A){g.name_next=A.name_next;break}g=g.name_next}},lookupNode:(A,B)=>{var g=I.mayLookup(A);if(g)throw new I.ErrnoError(g,A);for(var Q=I.hashName(A.id,B),C=I.nameTable[Q];C;C=C.name_next){var E=C.name;if(C.parent.id===A.id&&E===B)return C}return I.lookup(A,B)},createNode:(A,B,g,Q)=>{var C=new I.FSNode(A,B,g,Q);return I.hashAddNode(C),C},destroyNode:A=>{I.hashRemoveNode(A)},isRoot:A=>A===A.parent,isMountpoint:A=>!!A.mounted,isFile:A=>(A&61440)===32768,isDir:A=>(A&61440)===16384,isLink:A=>(A&61440)===40960,isChrdev:A=>(A&61440)===8192,isBlkdev:A=>(A&61440)===24576,isFIFO:A=>(A&61440)===4096,isSocket:A=>(A&49152)===49152,flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:A=>{var B=I.flagModes[A];if(typeof B>"u")throw new Error("Unknown file open mode: "+A);return B},flagsToPermissionString:A=>{var B=["r","w","rw"][A&3];return A&512&&(B+="w"),B},nodePermissions:(A,B)=>I.ignorePermissions?0:B.includes("r")&&!(A.mode&292)||B.includes("w")&&!(A.mode&146)||B.includes("x")&&!(A.mode&73)?2:0,mayLookup:A=>{var B=I.nodePermissions(A,"x");return B||(A.node_ops.lookup?0:2)},mayCreate:(A,B)=>{try{var g=I.lookupNode(A,B);return 20}catch{}return I.nodePermissions(A,"wx")},mayDelete:(A,B,g)=>{var Q;try{Q=I.lookupNode(A,B)}catch(E){return E.errno}var C=I.nodePermissions(A,"wx");if(C)return C;if(g){if(!I.isDir(Q.mode))return 54;if(I.isRoot(Q)||I.getPath(Q)===I.cwd())return 10}else if(I.isDir(Q.mode))return 31;return 0},mayOpen:(A,B)=>A?I.isLink(A.mode)?32:I.isDir(A.mode)&&(I.flagsToPermissionString(B)!=="r"||B&512)?31:I.nodePermissions(A,I.flagsToPermissionString(B)):44,MAX_OPEN_FDS:4096,nextfd:(A=0,B=I.MAX_OPEN_FDS)=>{for(var g=A;g<=B;g++)if(!I.streams[g])return g;throw new I.ErrnoError(33)},getStream:A=>I.streams[A],createStream:(A,B,g)=>{I.FSStream||(I.FSStream=function(){this.shared={}},I.FSStream.prototype={},Object.defineProperties(I.FSStream.prototype,{object:{get:function(){return this.node},set:function(C){this.node=C}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}},flags:{get:function(){return this.shared.flags},set:function(C){this.shared.flags=C}},position:{get:function(){return this.shared.position},set:function(C){this.shared.position=C}}})),A=Object.assign(new I.FSStream,A);var Q=I.nextfd(B,g);return A.fd=Q,I.streams[Q]=A,A},closeStream:A=>{I.streams[A]=null},chrdev_stream_ops:{open:A=>{var B=I.getDevice(A.node.rdev);A.stream_ops=B.stream_ops,A.stream_ops.open&&A.stream_ops.open(A)},llseek:()=>{throw new I.ErrnoError(70)}},major:A=>A>>8,minor:A=>A&255,makedev:(A,B)=>A<<8|B,registerDevice:(A,B)=>{I.devices[A]={stream_ops:B}},getDevice:A=>I.devices[A],getMounts:A=>{for(var B=[],g=[A];g.length;){var Q=g.pop();B.push(Q),g.push.apply(g,Q.mounts)}return B},syncfs:(A,B)=>{typeof A=="function"&&(B=A,A=!1),I.syncFSRequests++,I.syncFSRequests>1&&p("warning: "+I.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var g=I.getMounts(I.root.mount),Q=0;function C(D){return I.syncFSRequests--,B(D)}function E(D){if(D)return E.errored?void 0:(E.errored=!0,C(D));++Q>=g.length&&C(null)}g.forEach(D=>{if(!D.type.syncfs)return E(null);D.type.syncfs(D,A,E)})},mount:(A,B,g)=>{var Q=g==="/",C=!g,E;if(Q&&I.root)throw new I.ErrnoError(10);if(!Q&&!C){var D=I.lookupPath(g,{follow_mount:!1});if(g=D.path,E=D.node,I.isMountpoint(E))throw new I.ErrnoError(10);if(!I.isDir(E.mode))throw new I.ErrnoError(54)}var N={type:A,opts:B,mountpoint:g,mounts:[]},F=A.mount(N);return F.mount=N,N.root=F,Q?I.root=F:E&&(E.mounted=N,E.mount&&E.mount.mounts.push(N)),F},unmount:A=>{var B=I.lookupPath(A,{follow_mount:!1});if(!I.isMountpoint(B.node))throw new I.ErrnoError(28);var g=B.node,Q=g.mounted,C=I.getMounts(Q);Object.keys(I.nameTable).forEach(D=>{for(var N=I.nameTable[D];N;){var F=N.name_next;C.includes(N.mount)&&I.destroyNode(N),N=F}}),g.mounted=null;var E=g.mount.mounts.indexOf(Q);g.mount.mounts.splice(E,1)},lookup:(A,B)=>A.node_ops.lookup(A,B),mknod:(A,B,g)=>{var Q=I.lookupPath(A,{parent:!0}),C=Q.node,E=m.basename(A);if(!E||E==="."||E==="..")throw new I.ErrnoError(28);var D=I.mayCreate(C,E);if(D)throw new I.ErrnoError(D);if(!C.node_ops.mknod)throw new I.ErrnoError(63);return C.node_ops.mknod(C,E,B,g)},create:(A,B)=>(B=B!==void 0?B:438,B&=4095,B|=32768,I.mknod(A,B,0)),mkdir:(A,B)=>(B=B!==void 0?B:511,B&=1023,B|=16384,I.mknod(A,B,0)),mkdirTree:(A,B)=>{for(var g=A.split("/"),Q="",C=0;C(typeof g>"u"&&(g=B,B=438),B|=8192,I.mknod(A,B,g)),symlink:(A,B)=>{if(!YA.resolve(A))throw new I.ErrnoError(44);var g=I.lookupPath(B,{parent:!0}),Q=g.node;if(!Q)throw new I.ErrnoError(44);var C=m.basename(B),E=I.mayCreate(Q,C);if(E)throw new I.ErrnoError(E);if(!Q.node_ops.symlink)throw new I.ErrnoError(63);return Q.node_ops.symlink(Q,C,A)},rename:(A,B)=>{var g=m.dirname(A),Q=m.dirname(B),C=m.basename(A),E=m.basename(B),D,N,F;if(D=I.lookupPath(A,{parent:!0}),N=D.node,D=I.lookupPath(B,{parent:!0}),F=D.node,!N||!F)throw new I.ErrnoError(44);if(N.mount!==F.mount)throw new I.ErrnoError(75);var o=I.lookupNode(N,C),h=YA.relative(A,Q);if(h.charAt(0)!==".")throw new I.ErrnoError(28);if(h=YA.relative(B,g),h.charAt(0)!==".")throw new I.ErrnoError(55);var y;try{y=I.lookupNode(F,E)}catch{}if(o!==y){var Y=I.isDir(o.mode),i=I.mayDelete(N,C,Y);if(i)throw new I.ErrnoError(i);if(i=y?I.mayDelete(F,E,Y):I.mayCreate(F,E),i)throw new I.ErrnoError(i);if(!N.node_ops.rename)throw new I.ErrnoError(63);if(I.isMountpoint(o)||y&&I.isMountpoint(y))throw new I.ErrnoError(10);if(F!==N&&(i=I.nodePermissions(N,"w"),i))throw new I.ErrnoError(i);I.hashRemoveNode(o);try{N.node_ops.rename(o,F,E)}catch(k){throw k}finally{I.hashAddNode(o)}}},rmdir:A=>{var B=I.lookupPath(A,{parent:!0}),g=B.node,Q=m.basename(A),C=I.lookupNode(g,Q),E=I.mayDelete(g,Q,!0);if(E)throw new I.ErrnoError(E);if(!g.node_ops.rmdir)throw new I.ErrnoError(63);if(I.isMountpoint(C))throw new I.ErrnoError(10);g.node_ops.rmdir(g,Q),I.destroyNode(C)},readdir:A=>{var B=I.lookupPath(A,{follow:!0}),g=B.node;if(!g.node_ops.readdir)throw new I.ErrnoError(54);return g.node_ops.readdir(g)},unlink:A=>{var B=I.lookupPath(A,{parent:!0}),g=B.node;if(!g)throw new I.ErrnoError(44);var Q=m.basename(A),C=I.lookupNode(g,Q),E=I.mayDelete(g,Q,!1);if(E)throw new I.ErrnoError(E);if(!g.node_ops.unlink)throw new I.ErrnoError(63);if(I.isMountpoint(C))throw new I.ErrnoError(10);g.node_ops.unlink(g,Q),I.destroyNode(C)},readlink:A=>{var B=I.lookupPath(A),g=B.node;if(!g)throw new I.ErrnoError(44);if(!g.node_ops.readlink)throw new I.ErrnoError(28);return YA.resolve(I.getPath(g.parent),g.node_ops.readlink(g))},stat:(A,B)=>{var g=I.lookupPath(A,{follow:!B}),Q=g.node;if(!Q)throw new I.ErrnoError(44);if(!Q.node_ops.getattr)throw new I.ErrnoError(63);return Q.node_ops.getattr(Q)},lstat:A=>I.stat(A,!0),chmod:(A,B,g)=>{var Q;if(typeof A=="string"){var C=I.lookupPath(A,{follow:!g});Q=C.node}else Q=A;if(!Q.node_ops.setattr)throw new I.ErrnoError(63);Q.node_ops.setattr(Q,{mode:B&4095|Q.mode&-4096,timestamp:Date.now()})},lchmod:(A,B)=>{I.chmod(A,B,!0)},fchmod:(A,B)=>{var g=I.getStream(A);if(!g)throw new I.ErrnoError(8);I.chmod(g.node,B)},chown:(A,B,g,Q)=>{var C;if(typeof A=="string"){var E=I.lookupPath(A,{follow:!Q});C=E.node}else C=A;if(!C.node_ops.setattr)throw new I.ErrnoError(63);C.node_ops.setattr(C,{timestamp:Date.now()})},lchown:(A,B,g)=>{I.chown(A,B,g,!0)},fchown:(A,B,g)=>{var Q=I.getStream(A);if(!Q)throw new I.ErrnoError(8);I.chown(Q.node,B,g)},truncate:(A,B)=>{if(B<0)throw new I.ErrnoError(28);var g;if(typeof A=="string"){var Q=I.lookupPath(A,{follow:!0});g=Q.node}else g=A;if(!g.node_ops.setattr)throw new I.ErrnoError(63);if(I.isDir(g.mode))throw new I.ErrnoError(31);if(!I.isFile(g.mode))throw new I.ErrnoError(28);var C=I.nodePermissions(g,"w");if(C)throw new I.ErrnoError(C);g.node_ops.setattr(g,{size:B,timestamp:Date.now()})},ftruncate:(A,B)=>{var g=I.getStream(A);if(!g)throw new I.ErrnoError(8);if((g.flags&2097155)===0)throw new I.ErrnoError(28);I.truncate(g.node,B)},utime:(A,B,g)=>{var Q=I.lookupPath(A,{follow:!0}),C=Q.node;C.node_ops.setattr(C,{timestamp:Math.max(B,g)})},open:(A,B,g)=>{if(A==="")throw new I.ErrnoError(44);B=typeof B=="string"?I.modeStringToFlags(B):B,g=typeof g>"u"?438:g,B&64?g=g&4095|32768:g=0;var Q;if(typeof A=="object")Q=A;else{A=m.normalize(A);try{var C=I.lookupPath(A,{follow:!(B&131072)});Q=C.node}catch{}}var E=!1;if(B&64)if(Q){if(B&128)throw new I.ErrnoError(20)}else Q=I.mknod(A,g,0),E=!0;if(!Q)throw new I.ErrnoError(44);if(I.isChrdev(Q.mode)&&(B&=-513),B&65536&&!I.isDir(Q.mode))throw new I.ErrnoError(54);if(!E){var D=I.mayOpen(Q,B);if(D)throw new I.ErrnoError(D)}B&512&&!E&&I.truncate(Q,0),B&=-131713;var N=I.createStream({node:Q,path:I.getPath(Q),flags:B,seekable:!0,position:0,stream_ops:Q.stream_ops,ungotten:[],error:!1});return N.stream_ops.open&&N.stream_ops.open(N),G.logReadFiles&&!(B&1)&&(I.readFiles||(I.readFiles={}),A in I.readFiles||(I.readFiles[A]=1)),N},close:A=>{if(I.isClosed(A))throw new I.ErrnoError(8);A.getdents&&(A.getdents=null);try{A.stream_ops.close&&A.stream_ops.close(A)}catch(B){throw B}finally{I.closeStream(A.fd)}A.fd=null},isClosed:A=>A.fd===null,llseek:(A,B,g)=>{if(I.isClosed(A))throw new I.ErrnoError(8);if(!A.seekable||!A.stream_ops.llseek)throw new I.ErrnoError(70);if(g!=0&&g!=1&&g!=2)throw new I.ErrnoError(28);return A.position=A.stream_ops.llseek(A,B,g),A.ungotten=[],A.position},read:(A,B,g,Q,C)=>{if(Q<0||C<0)throw new I.ErrnoError(28);if(I.isClosed(A))throw new I.ErrnoError(8);if((A.flags&2097155)===1)throw new I.ErrnoError(8);if(I.isDir(A.node.mode))throw new I.ErrnoError(31);if(!A.stream_ops.read)throw new I.ErrnoError(28);var E=typeof C<"u";if(!E)C=A.position;else if(!A.seekable)throw new I.ErrnoError(70);var D=A.stream_ops.read(A,B,g,Q,C);return E||(A.position+=D),D},write:(A,B,g,Q,C,E)=>{if(Q<0||C<0)throw new I.ErrnoError(28);if(I.isClosed(A))throw new I.ErrnoError(8);if((A.flags&2097155)===0)throw new I.ErrnoError(8);if(I.isDir(A.node.mode))throw new I.ErrnoError(31);if(!A.stream_ops.write)throw new I.ErrnoError(28);A.seekable&&A.flags&1024&&I.llseek(A,0,2);var D=typeof C<"u";if(!D)C=A.position;else if(!A.seekable)throw new I.ErrnoError(70);var N=A.stream_ops.write(A,B,g,Q,C,E);return D||(A.position+=N),N},allocate:(A,B,g)=>{if(I.isClosed(A))throw new I.ErrnoError(8);if(B<0||g<=0)throw new I.ErrnoError(28);if((A.flags&2097155)===0)throw new I.ErrnoError(8);if(!I.isFile(A.node.mode)&&!I.isDir(A.node.mode))throw new I.ErrnoError(43);if(!A.stream_ops.allocate)throw new I.ErrnoError(138);A.stream_ops.allocate(A,B,g)},mmap:(A,B,g,Q,C)=>{if((Q&2)!==0&&(C&2)===0&&(A.flags&2097155)!==2)throw new I.ErrnoError(2);if((A.flags&2097155)===1)throw new I.ErrnoError(2);if(!A.stream_ops.mmap)throw new I.ErrnoError(43);return A.stream_ops.mmap(A,B,g,Q,C)},msync:(A,B,g,Q,C)=>!A||!A.stream_ops.msync?0:A.stream_ops.msync(A,B,g,Q,C),munmap:A=>0,ioctl:(A,B,g)=>{if(!A.stream_ops.ioctl)throw new I.ErrnoError(59);return A.stream_ops.ioctl(A,B,g)},readFile:(A,B={})=>{if(B.flags=B.flags||0,B.encoding=B.encoding||"binary",B.encoding!=="utf8"&&B.encoding!=="binary")throw new Error('Invalid encoding type "'+B.encoding+'"');var g,Q=I.open(A,B.flags),C=I.stat(A),E=C.size,D=new Uint8Array(E);return I.read(Q,D,0,E,0),B.encoding==="utf8"?g=CA(D,0):B.encoding==="binary"&&(g=D),I.close(Q),g},writeFile:(A,B,g={})=>{g.flags=g.flags||577;var Q=I.open(A,g.flags,g.mode);if(typeof B=="string"){var C=new Uint8Array(e(B)+1),E=aA(B,C,0,C.length);I.write(Q,C,0,E,void 0,g.canOwn)}else if(ArrayBuffer.isView(B))I.write(Q,B,0,B.byteLength,void 0,g.canOwn);else throw new Error("Unsupported data type");I.close(Q)},cwd:()=>I.currentPath,chdir:A=>{var B=I.lookupPath(A,{follow:!0});if(B.node===null)throw new I.ErrnoError(44);if(!I.isDir(B.node.mode))throw new I.ErrnoError(54);var g=I.nodePermissions(B.node,"x");if(g)throw new I.ErrnoError(g);I.currentPath=B.path},createDefaultDirectories:()=>{I.mkdir("/tmp"),I.mkdir("/home"),I.mkdir("/home/web_user")},createDefaultDevices:()=>{I.mkdir("/dev"),I.registerDevice(I.makedev(1,3),{read:()=>0,write:(B,g,Q,C,E)=>C}),I.mkdev("/dev/null",I.makedev(1,3)),cA.register(I.makedev(5,0),cA.default_tty_ops),cA.register(I.makedev(6,0),cA.default_tty1_ops),I.mkdev("/dev/tty",I.makedev(5,0)),I.mkdev("/dev/tty1",I.makedev(6,0));var A=Vg();I.createDevice("/dev","random",A),I.createDevice("/dev","urandom",A),I.mkdir("/dev/shm"),I.mkdir("/dev/shm/tmp")},createSpecialDirectories:()=>{I.mkdir("/proc");var A=I.mkdir("/proc/self");I.mkdir("/proc/self/fd"),I.mount({mount:()=>{var B=I.createNode(A,"fd",16895,73);return B.node_ops={lookup:(g,Q)=>{var C=+Q,E=I.getStream(C);if(!E)throw new I.ErrnoError(8);var D={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>E.path}};return D.parent=D,D}},B}},{},"/proc/self/fd")},createStandardStreams:()=>{G.stdin?I.createDevice("/dev","stdin",G.stdin):I.symlink("/dev/tty","/dev/stdin"),G.stdout?I.createDevice("/dev","stdout",null,G.stdout):I.symlink("/dev/tty","/dev/stdout"),G.stderr?I.createDevice("/dev","stderr",null,G.stderr):I.symlink("/dev/tty1","/dev/stderr"),I.open("/dev/stdin",0),I.open("/dev/stdout",1),I.open("/dev/stderr",1)},ensureErrnoError:()=>{I.ErrnoError||(I.ErrnoError=function(B,g){this.node=g,this.setErrno=function(Q){this.errno=Q},this.setErrno(B),this.message="FS error"},I.ErrnoError.prototype=new Error,I.ErrnoError.prototype.constructor=I.ErrnoError,[44].forEach(A=>{I.genericErrors[A]=new I.ErrnoError(A),I.genericErrors[A].stack=""}))},staticInit:()=>{I.ensureErrnoError(),I.nameTable=new Array(4096),I.mount(J,{},"/"),I.createDefaultDirectories(),I.createDefaultDevices(),I.createSpecialDirectories(),I.filesystems={MEMFS:J}},init:(A,B,g)=>{I.init.initialized=!0,I.ensureErrnoError(),G.stdin=A||G.stdin,G.stdout=B||G.stdout,G.stderr=g||G.stderr,I.createStandardStreams()},quit:()=>{I.init.initialized=!1;for(var A=0;A{var g=0;return A&&(g|=365),B&&(g|=146),g},findObject:(A,B)=>{var g=I.analyzePath(A,B);return g.exists?g.object:null},analyzePath:(A,B)=>{try{var g=I.lookupPath(A,{follow:!B});A=g.path}catch{}var Q={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var g=I.lookupPath(A,{parent:!0});Q.parentExists=!0,Q.parentPath=g.path,Q.parentObject=g.node,Q.name=m.basename(A),g=I.lookupPath(A,{follow:!B}),Q.exists=!0,Q.path=g.path,Q.object=g.node,Q.name=g.node.name,Q.isRoot=g.path==="/"}catch(C){Q.error=C.errno}return Q},createPath:(A,B,g,Q)=>{A=typeof A=="string"?A:I.getPath(A);for(var C=B.split("/").reverse();C.length;){var E=C.pop();if(!!E){var D=m.join2(A,E);try{I.mkdir(D)}catch{}A=D}}return D},createFile:(A,B,g,Q,C)=>{var E=m.join2(typeof A=="string"?A:I.getPath(A),B),D=I.getMode(Q,C);return I.create(E,D)},createDataFile:(A,B,g,Q,C,E)=>{var D=B;A&&(A=typeof A=="string"?A:I.getPath(A),D=B?m.join2(A,B):A);var N=I.getMode(Q,C),F=I.create(D,N);if(g){if(typeof g=="string"){for(var o=new Array(g.length),h=0,y=g.length;h{var C=m.join2(typeof A=="string"?A:I.getPath(A),B),E=I.getMode(!!g,!!Q);I.createDevice.major||(I.createDevice.major=64);var D=I.makedev(I.createDevice.major++,0);return I.registerDevice(D,{open:N=>{N.seekable=!1},close:N=>{Q&&Q.buffer&&Q.buffer.length&&Q(10)},read:(N,F,o,h,y)=>{for(var Y=0,i=0;i{for(var Y=0;Y{if(A.isDevice||A.isFolder||A.link||A.contents)return!0;if(typeof XMLHttpRequest<"u")throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(r)try{A.contents=qA(r(A.url),!0),A.usedBytes=A.contents.length}catch{throw new I.ErrnoError(29)}else throw new Error("Cannot load without read() or XMLHttpRequest.")},createLazyFile:(A,B,g,Q,C)=>{function E(){this.lengthKnown=!1,this.chunks=[]}if(E.prototype.get=function(i){if(!(i>this.length-1||i<0)){var k=i%this.chunkSize,Z=i/this.chunkSize|0;return this.getter(Z)[k]}},E.prototype.setDataGetter=function(i){this.getter=i},E.prototype.cacheLength=function(){var i=new XMLHttpRequest;if(i.open("HEAD",g,!1),i.send(null),!(i.status>=200&&i.status<300||i.status===304))throw new Error("Couldn't load "+g+". Status: "+i.status);var k=Number(i.getResponseHeader("Content-length")),Z,c=(Z=i.getResponseHeader("Accept-Ranges"))&&Z==="bytes",q=(Z=i.getResponseHeader("Content-Encoding"))&&Z==="gzip",U=1024*1024;c||(U=k);var a=(x,BA)=>{if(x>BA)throw new Error("invalid range ("+x+", "+BA+") or no bytes requested!");if(BA>k-1)throw new Error("only "+k+" bytes available! programmer error!");var w=new XMLHttpRequest;if(w.open("GET",g,!1),k!==U&&w.setRequestHeader("Range","bytes="+x+"-"+BA),w.responseType="arraybuffer",w.overrideMimeType&&w.overrideMimeType("text/plain; charset=x-user-defined"),w.send(null),!(w.status>=200&&w.status<300||w.status===304))throw new Error("Couldn't load "+g+". Status: "+w.status);return w.response!==void 0?new Uint8Array(w.response||[]):qA(w.responseText||"",!0)},V=this;V.setDataGetter(x=>{var BA=x*U,w=(x+1)*U-1;if(w=Math.min(w,k-1),typeof V.chunks[x]>"u"&&(V.chunks[x]=a(BA,w)),typeof V.chunks[x]>"u")throw new Error("doXHR failed!");return V.chunks[x]}),(q||!k)&&(U=k=1,k=this.getter(0).length,U=k,wA("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=k,this._chunkSize=U,this.lengthKnown=!0},typeof XMLHttpRequest<"u"){throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var D,N}else var N={isDevice:!1,url:g};var F=I.createFile(A,B,N,Q,C);N.contents?F.contents=N.contents:N.url&&(F.contents=null,F.url=N.url),Object.defineProperties(F,{usedBytes:{get:function(){return this.contents.length}}});var o={},h=Object.keys(F.stream_ops);h.forEach(Y=>{var i=F.stream_ops[Y];o[Y]=function(){return I.forceLoadFile(F),i.apply(null,arguments)}});function y(Y,i,k,Z,c){var q=Y.node.contents;if(c>=q.length)return 0;var U=Math.min(q.length-c,Z);if(q.slice)for(var a=0;a(I.forceLoadFile(F),y(Y,i,k,Z,c)),o.mmap=(Y,i,k,Z,c)=>{I.forceLoadFile(F);var q=kB(i);if(!q)throw new I.ErrnoError(48);return y(Y,W,q,i,k),{ptr:q,allocated:!0}},F.stream_ops=o,F},createPreloadedFile:(A,B,g,Q,C,E,D,N,F,o)=>{var h=B?YA.resolve(m.join2(A,B)):A;function y(Y){function i(k){o&&o(),N||I.createDataFile(A,B,k,Q,C,F),E&&E(),lA()}Browser.handledByPreloadPlugin(Y,h,i,()=>{D&&D(),lA()})||i(Y)}TA(),typeof g=="string"?dg(g,Y=>y(Y),D):y(g)},indexedDB:()=>window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,DB_NAME:()=>"EM_FS_"+window.location.pathname,DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:(A,B,g)=>{B=B||(()=>{}),g=g||(()=>{});var Q=I.indexedDB();try{var C=Q.open(I.DB_NAME(),I.DB_VERSION)}catch(E){return g(E)}C.onupgradeneeded=()=>{wA("creating db");var E=C.result;E.createObjectStore(I.DB_STORE_NAME)},C.onsuccess=()=>{var E=C.result,D=E.transaction([I.DB_STORE_NAME],"readwrite"),N=D.objectStore(I.DB_STORE_NAME),F=0,o=0,h=A.length;function y(){o==0?B():g()}A.forEach(Y=>{var i=N.put(I.analyzePath(Y).object.contents,Y);i.onsuccess=()=>{F++,F+o==h&&y()},i.onerror=()=>{o++,F+o==h&&y()}}),D.onerror=g},C.onerror=g},loadFilesFromDB:(A,B,g)=>{B=B||(()=>{}),g=g||(()=>{});var Q=I.indexedDB();try{var C=Q.open(I.DB_NAME(),I.DB_VERSION)}catch(E){return g(E)}C.onupgradeneeded=g,C.onsuccess=()=>{var E=C.result;try{var D=E.transaction([I.DB_STORE_NAME],"readonly")}catch(Y){g(Y);return}var N=D.objectStore(I.DB_STORE_NAME),F=0,o=0,h=A.length;function y(){o==0?B():g()}A.forEach(Y=>{var i=N.get(Y);i.onsuccess=()=>{I.analyzePath(Y).exists&&I.unlink(Y),I.createDataFile(m.dirname(Y),m.basename(Y),i.result,!0,!0,!0),F++,F+o==h&&y()},i.onerror=()=>{o++,F+o==h&&y()}}),D.onerror=g},C.onerror=g}},j={DEFAULT_POLLMASK:5,calculateAt:function(A,B,g){if(m.isAbs(B))return B;var Q;if(A===-100)Q=I.cwd();else{var C=I.getStream(A);if(!C)throw new I.ErrnoError(8);Q=C.path}if(B.length==0){if(!g)throw new I.ErrnoError(44);return Q}return m.join2(Q,B)},doStat:function(A,B,g){try{var Q=A(B)}catch(C){if(C&&C.node&&m.normalize(B)!==m.normalize(I.getPath(C.node)))return-54;throw C}return R[g>>2]=Q.dev,R[g+8>>2]=Q.ino,R[g+12>>2]=Q.mode,R[g+16>>2]=Q.nlink,R[g+20>>2]=Q.uid,R[g+24>>2]=Q.gid,R[g+28>>2]=Q.rdev,X=[Q.size>>>0,(M=Q.size,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+40>>2]=X[0],R[g+44>>2]=X[1],R[g+48>>2]=4096,R[g+52>>2]=Q.blocks,X=[Math.floor(Q.atime.getTime()/1e3)>>>0,(M=Math.floor(Q.atime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+56>>2]=X[0],R[g+60>>2]=X[1],R[g+64>>2]=0,X=[Math.floor(Q.mtime.getTime()/1e3)>>>0,(M=Math.floor(Q.mtime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+72>>2]=X[0],R[g+76>>2]=X[1],R[g+80>>2]=0,X=[Math.floor(Q.ctime.getTime()/1e3)>>>0,(M=Math.floor(Q.ctime.getTime()/1e3),+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+88>>2]=X[0],R[g+92>>2]=X[1],R[g+96>>2]=0,X=[Q.ino>>>0,(M=Q.ino,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[g+104>>2]=X[0],R[g+108>>2]=X[1],0},doMsync:function(A,B,g,Q,C){var E=gA.slice(A,A+g);I.msync(B,E,C,g,Q)},varargs:void 0,get:function(){j.varargs+=4;var A=R[j.varargs-4>>2];return A},getStr:function(A){var B=GA(A);return B},getStreamFromFD:function(A){var B=I.getStream(A);if(!B)throw new I.ErrnoError(8);return B}};function mg(A,B,g){j.varargs=g;try{var Q=j.getStreamFromFD(A);switch(B){case 0:{var C=j.get();if(C<0)return-28;var E;return E=I.createStream(Q,C),E.fd}case 1:case 2:return 0;case 3:return Q.flags;case 4:{var C=j.get();return Q.flags|=C,0}case 5:{var C=j.get(),D=0;return hA[C+D>>1]=2,0}case 6:case 7:return 0;case 16:case 8:return-28;case 9:return Lg(28),-1;default:return-28}}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function jg(A,B){try{var g=j.getStreamFromFD(A);return j.doStat(I.stat,g.path,B)}catch(Q){if(typeof I>"u"||!(Q instanceof I.ErrnoError))throw Q;return-Q.errno}}function lg(A,B){try{if(B===0)return-28;var g=I.cwd(),Q=e(g)+1;return B"u"||!(C instanceof I.ErrnoError))throw C;return-C.errno}}function qg(A,B,g){try{var Q=j.getStreamFromFD(A);Q.getdents||(Q.getdents=I.readdir(Q.path));for(var C=280,E=0,D=I.llseek(Q,0,1),N=Math.floor(D/C);N>>0,(M=F,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[B+E>>2]=X[0],R[B+E+4>>2]=X[1],X=[(N+1)*C>>>0,(M=(N+1)*C,+Math.abs(M)>=1?M>0?(Math.min(+Math.floor(M/4294967296),4294967295)|0)>>>0:~~+Math.ceil((M-+(~~M>>>0))/4294967296)>>>0:0)],R[B+E+8>>2]=X[0],R[B+E+12>>2]=X[1],hA[B+E+16>>1]=280,W[B+E+18>>0]=o,KA(h,B+E+19,256),E+=C,N+=1}return I.llseek(Q,N*C,0),E}catch(i){if(typeof I>"u"||!(i instanceof I.ErrnoError))throw i;return-i.errno}}function xg(A,B,g){j.varargs=g;try{var Q=j.getStreamFromFD(A);switch(B){case 21509:case 21505:return Q.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return Q.tty?0:-59;case 21519:{if(!Q.tty)return-59;var C=j.get();return R[C>>2]=0,0}case 21520:return Q.tty?-28:-59;case 21531:{var C=j.get();return I.ioctl(Q,B,C)}case 21523:return Q.tty?0:-59;case 21524:return Q.tty?0:-59;default:return-28}}catch(E){if(typeof I>"u"||!(E instanceof I.ErrnoError))throw E;return-E.errno}}function bg(A,B){try{return A=j.getStr(A),j.doStat(I.lstat,A,B)}catch(g){if(typeof I>"u"||!(g instanceof I.ErrnoError))throw g;return-g.errno}}function Xg(A,B,g,Q){try{B=j.getStr(B);var C=Q&256,E=Q&4096;return Q=Q&-4353,B=j.calculateAt(A,B,E),j.doStat(C?I.lstat:I.stat,B,g)}catch(D){if(typeof I>"u"||!(D instanceof I.ErrnoError))throw D;return-D.errno}}function fg(A,B,g,Q){j.varargs=Q;try{B=j.getStr(B),B=j.calculateAt(A,B);var C=Q?j.get():0;return I.open(B,g,C).fd}catch(E){if(typeof I>"u"||!(E instanceof I.ErrnoError))throw E;return-E.errno}}function tg(A,B,g,Q){try{if(B=j.getStr(B),B=j.calculateAt(A,B),Q<=0)return-28;var C=I.readlink(B),E=Math.min(Q,e(C)),D=W[g+E];return KA(C,g,Q+1),W[g+E]=D,E}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function Tg(A,B){try{return A=j.getStr(A),j.doStat(I.stat,A,B)}catch(g){if(typeof I>"u"||!(g instanceof I.ErrnoError))throw g;return-g.errno}}function pg(){return Date.now()}function ng(A){do{var B=d[A>>2];A+=4;var g=d[A>>2];A+=4;var Q=d[A>>2];A+=4;var C=GA(B);I.createPath("/",m.dirname(C),!0,!0),I.createDataFile(C,null,W.subarray(Q,Q+g),!0,!0,!0)}while(d[A>>2])}var zg=!0;function rg(){return zg}function yB(A){return d[A>>2]+R[A+4>>2]*4294967296}function eg(A,B){var g=new Date(yB(A)*1e3);R[B>>2]=g.getUTCSeconds(),R[B+4>>2]=g.getUTCMinutes(),R[B+8>>2]=g.getUTCHours(),R[B+12>>2]=g.getUTCDate(),R[B+16>>2]=g.getUTCMonth(),R[B+20>>2]=g.getUTCFullYear()-1900,R[B+24>>2]=g.getUTCDay();var Q=Date.UTC(g.getUTCFullYear(),0,1,0,0,0,0),C=(g.getTime()-Q)/(1e3*60*60*24)|0;R[B+28>>2]=C}function Og(A,B){var g=new Date(yB(A)*1e3);R[B>>2]=g.getSeconds(),R[B+4>>2]=g.getMinutes(),R[B+8>>2]=g.getHours(),R[B+12>>2]=g.getDate(),R[B+16>>2]=g.getMonth(),R[B+20>>2]=g.getFullYear()-1900,R[B+24>>2]=g.getDay();var Q=new Date(g.getFullYear(),0,1),C=(g.getTime()-Q.getTime())/(1e3*60*60*24)|0;R[B+28>>2]=C,R[B+36>>2]=-(g.getTimezoneOffset()*60);var E=new Date(g.getFullYear(),6,1).getTimezoneOffset(),D=Q.getTimezoneOffset(),N=(E!=D&&g.getTimezoneOffset()==Math.min(D,E))|0;R[B+32>>2]=N}function vg(A,B,g,Q,C,E){try{var D=I.getStream(C);D&&(g&2&&j.doMsync(A,D,B,Q,E),I.munmap(D))}catch(N){if(typeof I>"u"||!(N instanceof I.ErrnoError))throw N;return-N.errno}}function aB(A){var B=e(A)+1,g=EB(B);return g&&aA(A,W,g,B),g}function ug(A,B,g){var Q=new Date().getFullYear(),C=new Date(Q,0,1),E=new Date(Q,6,1),D=C.getTimezoneOffset(),N=E.getTimezoneOffset(),F=Math.max(D,N);R[A>>2]=F*60,R[B>>2]=Number(D!=N);function o(k){var Z=k.toTimeString().match(/\(([A-Za-z ]+)\)$/);return Z?Z[1]:"GMT"}var h=o(C),y=o(E),Y=aB(h),i=aB(y);N>2]=Y,d[g+4>>2]=i):(d[g>>2]=i,d[g+4>>2]=Y)}function BB(A,B,g){BB.called||(BB.called=!0,ug(A,B,g))}function Pg(){oA("")}var gB=[];function _g(A,B){gB.length=0;var g;for(B>>=2;g=gA[A++];)B+=g!=105&B,gB.push(g==105?R[B]:kA[B++>>1]),++B;return gB}function $g(A,B,g){var Q=_g(B,g);return og[A].apply(null,Q)}var MB;MB=()=>performance.now();function AQ(A){return A<0||A===0&&1/A===-1/0}function BQ(A,B){return(A>>>0)+B*4294967296}function gQ(A,B){return(A>>>0)+(B>>>0)*4294967296}function SB(A,B){if(A<=0)return A;var g=B<=32?Math.abs(1<=g&&(B<=32||A>g)&&(A=-2*g+A),A}function JB(A,B){return A>=0?A:B<=32?2*Math.abs(1<>3],Q+=8):DA=="i64"?(iA=[R[Q>>2],R[Q+4>>2]],Q+=8):(DA="i32",iA=R[Q>>2],Q+=4),iA}for(var D=[],N,F,o;;){var h=g;if(N=W[g>>0],N===0)break;if(F=W[g+1>>0],N==37){var y=!1,Y=!1,i=!1,k=!1,Z=!1;A:for(;;){switch(F){case 43:y=!0;break;case 45:Y=!0;break;case 35:i=!0;break;case 48:if(k)break A;k=!0;break;case 32:Z=!0;break;default:break A}g++,F=W[g+1>>0]}var c=0;if(F==42)c=E("i32"),g++,F=W[g+1>>0];else for(;F>=48&&F<=57;)c=c*10+(F-48),g++,F=W[g+1>>0];var q=!1,U=-1;if(F==46){if(U=0,q=!0,g++,F=W[g+1>>0],F==42)U=E("i32"),g++;else for(;;){var a=W[g+1>>0];if(a<48||a>57)break;U=U*10+(a-48),g++}F=W[g+1>>0]}U<0&&(U=6,q=!1);var V;switch(String.fromCharCode(F)){case"h":var x=W[g+2>>0];x==104?(g++,V=1):V=2;break;case"l":var x=W[g+2>>0];x==108?(g++,V=8):V=4;break;case"L":case"q":case"j":V=8;break;case"z":case"t":case"I":V=4;break;default:V=null}switch(V&&g++,F=W[g+1>>0],String.fromCharCode(F)){case"d":case"i":case"u":case"o":case"x":case"X":case"p":{var BA=F==100||F==105;V=V||4,o=E("i"+V*8);var w;if(V==8&&(o=F==117?gQ(o[0],o[1]):BQ(o[0],o[1])),V<=4){var JI=Math.pow(256,V)-1;o=(BA?SB:JB)(o&JI,V*8)}var XA=Math.abs(o),P="";if(F==100||F==105)w=SB(o,8*V).toString(10);else if(F==117)w=JB(o,8*V).toString(10),o=Math.abs(o);else if(F==111)w=(i?"0":"")+XA.toString(8);else if(F==120||F==88){if(P=i&&o!=0?"0x":"",o<0){o=-o,w=(XA-1).toString(16);for(var PB=[],EA=0;EA=0&&(y?P="+"+P:Z&&(P=" "+P)),w.charAt(0)=="-"&&(P="-"+P,w=w.substr(1));P.length+w.lengthNB&&NB>=-4?(F=(F==103?"f":"F").charCodeAt(0),U-=NB+1):(F=(F==103?"e":"E").charCodeAt(0),U--),fA=Math.min(U,20)}F==101||F==69?(w=o.toExponential(fA),/[eE][-+]\d$/.test(w)&&(w=w.slice(0,-1)+"0"+w.slice(-1))):(F==102||F==70)&&(w=o.toFixed(fA),o===0&&AQ(o)&&(w="-"+w));var IA=w.split("e");if(_B&&!i)for(;IA[0].length>1&&IA[0].includes(".")&&(IA[0].slice(-1)=="0"||IA[0].slice(-1)==".");)IA[0]=IA[0].slice(0,-1);else for(i&&w.indexOf(".")==-1&&(IA[0]+=".");U>fA++;)IA[0]+="0";w=IA[0]+(IA.length>1?"e"+IA[1]:""),F==69&&(w=w.toUpperCase()),o>=0&&(y?w="+"+w:Z&&(w=" "+w))}for(;w.length>0]);else D=D.concat(qA("(null)".substr(0,ZA),!0));if(Y)for(;ZA0;)D.push(32);Y||D.push(E("i8"));break}case"n":{var cI=E("i32*");R[cI>>2]=D.length;break}case"%":{D.push(N);break}default:for(var EA=h;EA>0])}g+=2}else D.push(N),g+=1}return D}function QB(A){if(!A||!A.callee||!A.callee.name)return[null,"",""];A.callee.toString();var B=A.callee.name,g="(",Q=!0;for(var C in A){var E=A[C];Q||(g+=", "),Q=!1,typeof E=="number"||typeof E=="string"?g+=E:g+="("+typeof E+")"}g+=")";var D=A.callee.caller;return A=D?D.arguments:[],Q&&(g=""),[A,B,g]}function VA(A){VA.shown||(VA.shown={}),VA.shown[A]||(VA.shown[A]=1,p(A))}function CQ(A){var B=Yg(),g=B.lastIndexOf("_emscripten_log"),Q=B.lastIndexOf("_emscripten_get_callstack"),C=B.indexOf(` `,Math.max(g,Q))+1;B=B.slice(C),A&32&&VA("EM_LOG_DEMANGLE is deprecated; ignoring"),A&8&&typeof emscripten_source_map>"u"&&(VA('Source map information is not available, emscripten_log with EM_LOG_C_STACK will be ignored. Build with "--pre-js $EMSCRIPTEN/src/emscripten-source-map.min.js" linker flag to add source map loading to code.'),A^=8,A|=16);var E=null;if(A&128)for(E=QB(arguments);E[1].includes("_emscripten_");)E=QB(E[0]);var D=B.split(` diff --git a/assets/index.ab1a215a.js b/assets/index.d2d7d94d.js similarity index 99% rename from assets/index.ab1a215a.js rename to assets/index.d2d7d94d.js index 7a15e02..961174c 100644 --- a/assets/index.ab1a215a.js +++ b/assets/index.d2d7d94d.js @@ -1075,7 +1075,7 @@ Values: `+String(Pe)));O(qe);for(var Qe=0;Qe0&&Object.prototype.hasOwnProperty.call(Ce,Ce.length-1))}h.exports=y}),H8=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=function(y,S){return function(){for(var f=new Array(arguments.length),g=0;g{b(),m(),_(),xt(),ce();var y=H8(),S=Object.prototype.toString;function f(Be){return Array.isArray(Be)}function g(Be){return typeof Be>"u"}function x(Be){return Be!==null&&!g(Be)&&Be.constructor!==null&&!g(Be.constructor)&&typeof Be.constructor.isBuffer=="function"&&Be.constructor.isBuffer(Be)}function P(Be){return S.call(Be)==="[object ArrayBuffer]"}function O(Be){return S.call(Be)==="[object FormData]"}function B(Be){var Se;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?Se=ArrayBuffer.isView(Be):Se=Be&&Be.buffer&&P(Be.buffer),Se}function N(Be){return typeof Be=="string"}function R(Be){return typeof Be=="number"}function re(Be){return Be!==null&&typeof Be=="object"}function _e(Be){if(S.call(Be)!=="[object Object]")return!1;var Se=Object.getPrototypeOf(Be);return Se===null||Se===Object.prototype}function Ce(Be){return S.call(Be)==="[object Date]"}function qe(Be){return S.call(Be)==="[object File]"}function Ve(Be){return S.call(Be)==="[object Blob]"}function Pe(Be){return S.call(Be)==="[object Function]"}function Qe(Be){return re(Be)&&Pe(Be.pipe)}function et(Be){return S.call(Be)==="[object URLSearchParams]"}function _t(Be){return Be.trim?Be.trim():Be.replace(/^\s+|\s+$/g,"")}function Ue(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function We(Be,Se){if(!(Be===null||typeof Be>"u"))if(typeof Be!="object"&&(Be=[Be]),f(Be))for(var Fe=0,mt=Be.length;Fe{b(),m(),_(),xt(),ce();var y=vs();function S(f){return encodeURIComponent(f).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}h.exports=function(f,g,x){if(!g)return f;var P;if(x)P=x(g);else if(y.isURLSearchParams(g))P=g.toString();else{var O=[];y.forEach(g,function(N,R){N===null||typeof N>"u"||(y.isArray(N)?R=R+"[]":N=[N],y.forEach(N,function(re){y.isDate(re)?re=re.toISOString():y.isObject(re)&&(re=JSON.stringify(re)),O.push(S(R)+"="+S(re))}))}),P=O.join("&")}if(P){var B=f.indexOf("#");B!==-1&&(f=f.slice(0,B)),f+=(f.indexOf("?")===-1?"?":"&")+P}return f}}),Rz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();function S(){this.handlers=[]}S.prototype.use=function(f,g,x){return this.handlers.push({fulfilled:f,rejected:g,synchronous:x?x.synchronous:!1,runWhen:x?x.runWhen:null}),this.handlers.length-1},S.prototype.eject=function(f){this.handlers[f]&&(this.handlers[f]=null)},S.prototype.forEach=function(f){y.forEach(this.handlers,function(g){g!==null&&f(g)})},h.exports=S}),Pz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();h.exports=function(S,f){y.forEach(S,function(g,x){x!==f&&x.toUpperCase()===f.toUpperCase()&&(S[f]=g,delete S[x])})}}),V8=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=function(y,S,f,g,x){return y.config=S,f&&(y.code=f),y.request=g,y.response=x,y.isAxiosError=!0,y.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},y}}),q8=u((i,h)=>{b(),m(),_(),xt(),ce();var y=V8();h.exports=function(S,f,g,x,P){var O=new Error(S);return y(O,f,g,x,P)}}),Mz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=q8();h.exports=function(S,f,g){var x=g.config.validateStatus;!g.status||!x||x(g.status)?S(g):f(y("Request failed with status code "+g.status,g.config,null,g.request,g))}}),Bz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();h.exports=y.isStandardBrowserEnv()?function(){return{write:function(S,f,g,x,P,O){var B=[];B.push(S+"="+encodeURIComponent(f)),y.isNumber(g)&&B.push("expires="+new Date(g).toGMTString()),y.isString(x)&&B.push("path="+x),y.isString(P)&&B.push("domain="+P),O===!0&&B.push("secure"),document.cookie=B.join("; ")},read:function(S){var f=document.cookie.match(new RegExp("(^|;\\s*)("+S+")=([^;]*)"));return f?decodeURIComponent(f[3]):null},remove:function(S){this.write(S,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),Oz=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=function(y){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(y)}}),Uz=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=function(y,S){return S?y.replace(/\/+$/,"")+"/"+S.replace(/^\/+/,""):y}}),Lz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=Oz(),S=Uz();h.exports=function(f,g){return f&&!y(g)?S(f,g):g}}),Dz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];h.exports=function(f){var g={},x,P,O;return f&&y.forEach(f.split(` `),function(B){if(O=B.indexOf(":"),x=y.trim(B.substr(0,O)).toLowerCase(),P=y.trim(B.substr(O+1)),x){if(g[x]&&S.indexOf(x)>=0)return;x==="set-cookie"?g[x]=(g[x]?g[x]:[]).concat([P]):g[x]=g[x]?g[x]+", "+P:P}}),g}}),Nz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();h.exports=y.isStandardBrowserEnv()?function(){var S=/(msie|trident)/i.test(navigator.userAgent),f=document.createElement("a"),g;function x(P){var O=P;return S&&(f.setAttribute("href",O),O=f.href),f.setAttribute("href",O),{href:f.href,protocol:f.protocol?f.protocol.replace(/:$/,""):"",host:f.host,search:f.search?f.search.replace(/^\?/,""):"",hash:f.hash?f.hash.replace(/^#/,""):"",hostname:f.hostname,port:f.port,pathname:f.pathname.charAt(0)==="/"?f.pathname:"/"+f.pathname}}return g=x(window.location.href),function(P){var O=y.isString(P)?x(P):P;return O.protocol===g.protocol&&O.host===g.host}}():function(){return function(){return!0}}()}),av=u((i,h)=>{b(),m(),_(),xt(),ce();function y(S){this.message=S}y.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},y.prototype.__CANCEL__=!0,h.exports=y}),K8=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=Mz(),f=Bz(),g=W8(),x=Lz(),P=Dz(),O=Nz(),B=q8(),N=sv(),R=av();h.exports=function(re){return new Promise(function(_e,Ce){var qe=re.data,Ve=re.headers,Pe=re.responseType,Qe;function et(){re.cancelToken&&re.cancelToken.unsubscribe(Qe),re.signal&&re.signal.removeEventListener("abort",Qe)}y.isFormData(qe)&&delete Ve["Content-Type"];var _t=new XMLHttpRequest;if(re.auth){var Ue=re.auth.username||"",We=re.auth.password?unescape(encodeURIComponent(re.auth.password)):"";Ve.Authorization="Basic "+btoa(Ue+":"+We)}var ht=x(re.baseURL,re.url);_t.open(re.method.toUpperCase(),g(ht,re.params,re.paramsSerializer),!0),_t.timeout=re.timeout;function gt(){if(_t){var Be="getAllResponseHeaders"in _t?P(_t.getAllResponseHeaders()):null,Se=!Pe||Pe==="text"||Pe==="json"?_t.responseText:_t.response,Fe={data:Se,status:_t.status,statusText:_t.statusText,headers:Be,config:re,request:_t};S(function(mt){_e(mt),et()},function(mt){Ce(mt),et()},Fe),_t=null}}if("onloadend"in _t?_t.onloadend=gt:_t.onreadystatechange=function(){!_t||_t.readyState!==4||_t.status===0&&!(_t.responseURL&&_t.responseURL.indexOf("file:")===0)||setTimeout(gt)},_t.onabort=function(){_t&&(Ce(B("Request aborted",re,"ECONNABORTED",_t)),_t=null)},_t.onerror=function(){Ce(B("Network Error",re,null,_t)),_t=null},_t.ontimeout=function(){var Be=re.timeout?"timeout of "+re.timeout+"ms exceeded":"timeout exceeded",Se=re.transitional||N.transitional;re.timeoutErrorMessage&&(Be=re.timeoutErrorMessage),Ce(B(Be,re,Se.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",_t)),_t=null},y.isStandardBrowserEnv()){var Je=(re.withCredentials||O(ht))&&re.xsrfCookieName?f.read(re.xsrfCookieName):void 0;Je&&(Ve[re.xsrfHeaderName]=Je)}"setRequestHeader"in _t&&y.forEach(Ve,function(Be,Se){typeof qe>"u"&&Se.toLowerCase()==="content-type"?delete Ve[Se]:_t.setRequestHeader(Se,Be)}),y.isUndefined(re.withCredentials)||(_t.withCredentials=!!re.withCredentials),Pe&&Pe!=="json"&&(_t.responseType=re.responseType),typeof re.onDownloadProgress=="function"&&_t.addEventListener("progress",re.onDownloadProgress),typeof re.onUploadProgress=="function"&&_t.upload&&_t.upload.addEventListener("progress",re.onUploadProgress),(re.cancelToken||re.signal)&&(Qe=function(Be){_t&&(Ce(!Be||Be&&Be.type?new R("canceled"):Be),_t.abort(),_t=null)},re.cancelToken&&re.cancelToken.subscribe(Qe),re.signal&&(re.signal.aborted?Qe():re.signal.addEventListener("abort",Qe))),qe||(qe=null),_t.send(qe)})}}),sv=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=Pz(),f=V8(),g={"Content-Type":"application/x-www-form-urlencoded"};function x(N,R){!y.isUndefined(N)&&y.isUndefined(N["Content-Type"])&&(N["Content-Type"]=R)}function P(){var N;return(typeof XMLHttpRequest<"u"||typeof k<"u"&&Object.prototype.toString.call(k)==="[object process]")&&(N=K8()),N}function O(N,R,re){if(y.isString(N))try{return(R||JSON.parse)(N),y.trim(N)}catch(_e){if(_e.name!=="SyntaxError")throw _e}return(re||JSON.stringify)(N)}var B={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:P(),transformRequest:[function(N,R){return S(R,"Accept"),S(R,"Content-Type"),y.isFormData(N)||y.isArrayBuffer(N)||y.isBuffer(N)||y.isStream(N)||y.isFile(N)||y.isBlob(N)?N:y.isArrayBufferView(N)?N.buffer:y.isURLSearchParams(N)?(x(R,"application/x-www-form-urlencoded;charset=utf-8"),N.toString()):y.isObject(N)||R&&R["Content-Type"]==="application/json"?(x(R,"application/json"),O(N)):N}],transformResponse:[function(N){var R=this.transitional||B.transitional,re=R&&R.silentJSONParsing,_e=R&&R.forcedJSONParsing,Ce=!re&&this.responseType==="json";if(Ce||_e&&y.isString(N)&&N.length)try{return JSON.parse(N)}catch(qe){if(Ce)throw qe.name==="SyntaxError"?f(qe,this,"E_JSON_PARSE"):qe}return N}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(N){return N>=200&&N<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};y.forEach(["delete","get","head"],function(N){B.headers[N]={}}),y.forEach(["post","put","patch"],function(N){B.headers[N]=y.merge(g)}),h.exports=B}),jz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=sv();h.exports=function(f,g,x){var P=this||S;return y.forEach(x,function(O){f=O.call(P,f,g)}),f}}),G8=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=function(y){return!!(y&&y.__CANCEL__)}}),Fz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=jz(),f=G8(),g=sv(),x=av();function P(O){if(O.cancelToken&&O.cancelToken.throwIfRequested(),O.signal&&O.signal.aborted)throw new x("canceled")}h.exports=function(O){P(O),O.headers=O.headers||{},O.data=S.call(O,O.data,O.headers,O.transformRequest),O.headers=y.merge(O.headers.common||{},O.headers[O.method]||{},O.headers),y.forEach(["delete","get","head","post","put","patch","common"],function(N){delete O.headers[N]});var B=O.adapter||g.adapter;return B(O).then(function(N){return P(O),N.data=S.call(O,N.data,N.headers,O.transformResponse),N},function(N){return f(N)||(P(O),N&&N.response&&(N.response.data=S.call(O,N.response.data,N.response.headers,O.transformResponse))),Promise.reject(N)})}}),Y8=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();h.exports=function(S,f){f=f||{};var g={};function x(re,_e){return y.isPlainObject(re)&&y.isPlainObject(_e)?y.merge(re,_e):y.isPlainObject(_e)?y.merge({},_e):y.isArray(_e)?_e.slice():_e}function P(re){if(y.isUndefined(f[re])){if(!y.isUndefined(S[re]))return x(void 0,S[re])}else return x(S[re],f[re])}function O(re){if(!y.isUndefined(f[re]))return x(void 0,f[re])}function B(re){if(y.isUndefined(f[re])){if(!y.isUndefined(S[re]))return x(void 0,S[re])}else return x(void 0,f[re])}function N(re){if(re in f)return x(S[re],f[re]);if(re in S)return x(void 0,S[re])}var R={url:O,method:O,data:O,baseURL:B,transformRequest:B,transformResponse:B,paramsSerializer:B,timeout:B,timeoutMessage:B,withCredentials:B,adapter:B,responseType:B,xsrfCookieName:B,xsrfHeaderName:B,onUploadProgress:B,onDownloadProgress:B,decompress:B,maxContentLength:B,maxBodyLength:B,transport:B,httpAgent:B,httpsAgent:B,cancelToken:B,socketPath:B,responseEncoding:B,validateStatus:N};return y.forEach(Object.keys(S).concat(Object.keys(f)),function(re){var _e=R[re]||P,Ce=_e(re);y.isUndefined(Ce)&&_e!==N||(g[re]=Ce)}),g}}),Q8=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports={version:"0.25.0"}}),$z=u((i,h)=>{b(),m(),_(),xt(),ce();var y=Q8().version,S={};["object","boolean","number","function","string","symbol"].forEach(function(x,P){S[x]=function(O){return typeof O===x||"a"+(P<1?"n ":" ")+x}});var f={};S.transitional=function(x,P,O){function B(N,R){return"[Axios v"+y+"] Transitional option '"+N+"'"+R+(O?". "+O:"")}return function(N,R,re){if(x===!1)throw new Error(B(R," has been removed"+(P?" in "+P:"")));return P&&!f[R]&&(f[R]=!0,console.warn(B(R," has been deprecated since v"+P+" and will be removed in the near future"))),x?x(N,R,re):!0}};function g(x,P,O){if(typeof x!="object")throw new TypeError("options must be an object");for(var B=Object.keys(x),N=B.length;N-- >0;){var R=B[N],re=P[R];if(re){var _e=x[R],Ce=_e===void 0||re(_e,R,x);if(Ce!==!0)throw new TypeError("option "+R+" must be "+Ce);continue}if(O!==!0)throw Error("Unknown option "+R)}}h.exports={assertOptions:g,validators:S}}),zz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=W8(),f=Rz(),g=Fz(),x=Y8(),P=$z(),O=P.validators;function B(N){this.defaults=N,this.interceptors={request:new f,response:new f}}B.prototype.request=function(N,R){if(typeof N=="string"?(R=R||{},R.url=N):R=N||{},!R.url)throw new Error("Provided config url is not valid");R=x(this.defaults,R),R.method?R.method=R.method.toLowerCase():this.defaults.method?R.method=this.defaults.method.toLowerCase():R.method="get";var re=R.transitional;re!==void 0&&P.assertOptions(re,{silentJSONParsing:O.transitional(O.boolean),forcedJSONParsing:O.transitional(O.boolean),clarifyTimeoutError:O.transitional(O.boolean)},!1);var _e=[],Ce=!0;this.interceptors.request.forEach(function(Ue){typeof Ue.runWhen=="function"&&Ue.runWhen(R)===!1||(Ce=Ce&&Ue.synchronous,_e.unshift(Ue.fulfilled,Ue.rejected))});var qe=[];this.interceptors.response.forEach(function(Ue){qe.push(Ue.fulfilled,Ue.rejected)});var Ve;if(!Ce){var Pe=[g,void 0];for(Array.prototype.unshift.apply(Pe,_e),Pe=Pe.concat(qe),Ve=Promise.resolve(R);Pe.length;)Ve=Ve.then(Pe.shift(),Pe.shift());return Ve}for(var Qe=R;_e.length;){var et=_e.shift(),_t=_e.shift();try{Qe=et(Qe)}catch(Ue){_t(Ue);break}}try{Ve=g(Qe)}catch(Ue){return Promise.reject(Ue)}for(;qe.length;)Ve=Ve.then(qe.shift(),qe.shift());return Ve},B.prototype.getUri=function(N){if(!N.url)throw new Error("Provided config url is not valid");return N=x(this.defaults,N),S(N.url,N.params,N.paramsSerializer).replace(/^\?/,"")},y.forEach(["delete","get","head","options"],function(N){B.prototype[N]=function(R,re){return this.request(x(re||{},{method:N,url:R,data:(re||{}).data}))}}),y.forEach(["post","put","patch"],function(N){B.prototype[N]=function(R,re,_e){return this.request(x(_e||{},{method:N,url:R,data:re}))}}),h.exports=B}),Hz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=av();function S(f){if(typeof f!="function")throw new TypeError("executor must be a function.");var g;this.promise=new Promise(function(P){g=P});var x=this;this.promise.then(function(P){if(x._listeners){var O,B=x._listeners.length;for(O=0;O{b(),m(),_(),xt(),ce(),h.exports=function(y){return function(S){return y.apply(null,S)}}}),Vz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs();h.exports=function(S){return y.isObject(S)&&S.isAxiosError===!0}}),qz=u((i,h)=>{b(),m(),_(),xt(),ce();var y=vs(),S=H8(),f=zz(),g=Y8(),x=sv();function P(B){var N=new f(B),R=S(f.prototype.request,N);return y.extend(R,f.prototype,N),y.extend(R,N),R.create=function(re){return P(g(B,re))},R}var O=P(x);O.Axios=f,O.Cancel=av(),O.CancelToken=Hz(),O.isCancel=G8(),O.VERSION=Q8().version,O.all=function(B){return Promise.all(B)},O.spread=Wz(),O.isAxiosError=Vz(),h.exports=O,h.exports.default=O}),Z8=u((i,h)=>{b(),m(),_(),xt(),ce(),h.exports=qz()}),Kz=u((i,h)=>{h.exports={name:"ton",version:"13.4.1",repository:"https://github.com/ton-core/ton.git",author:"Whales Corp. ",license:"MIT",main:"dist/index.js",files:["dist"],scripts:{docs:"rm -fr docs && typedoc src/index.ts",build:"rm -fr dist && tsc --declaration",test:"jest --verbose --runInBand",release:"yarn build && yarn release-it --npm.yarn1"},devDependencies:{"@release-it/keep-a-changelog":"^3.1.0","@types/jest":"^27.0.1","@types/node":"^16.7.10",buffer:"^6.0.3",expect:"^27.1.0",jest:"^27.1.0","jest-mock":"^27.1.0",karma:"^6.3.4","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1","karma-typescript":"^5.5.2","karma-webpack":"^5.0.0",prando:"^6.0.1","release-it":"^15.5.1","ton-core":"^0.48.0","ton-crypto":"3.2.0","ton-emulator":"^2.1.1","ts-jest":"^27.0.5","ts-loader":"^9.2.5","ts-node":"^10.7.0",typedoc:"^0.23.24",typescript:"^4.4.2",webpack:"^5.51.2"},dependencies:{axios:"^0.25.0",dataloader:"^2.0.0","fp-ts":"^2.11.1","io-ts":"^2.2.16","io-ts-reporters":"^2.0.0","symbol.inspect":"1.0.1",teslabot:"^1.3.0"},peerDependencies:{"ton-core":">=0.48.0","ton-crypto":">=3.2.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},"release-it":{github:{release:!0},plugins:{"@release-it/keep-a-changelog":{filename:"CHANGELOG.md"}}},packageManager:"yarn@3.4.1"}}),X8=u(i=>{b(),m(),_(),xt(),ce();var h=i&&i.__createBinding||(Object.create?function(Fe,mt,$t,hr){hr===void 0&&(hr=$t),Object.defineProperty(Fe,hr,{enumerable:!0,get:function(){return mt[$t]}})}:function(Fe,mt,$t,hr){hr===void 0&&(hr=$t),Fe[hr]=mt[$t]}),y=i&&i.__setModuleDefault||(Object.create?function(Fe,mt){Object.defineProperty(Fe,"default",{enumerable:!0,value:mt})}:function(Fe,mt){Fe.default=mt}),S=i&&i.__importStar||function(Fe){if(Fe&&Fe.__esModule)return Fe;var mt={};if(Fe!=null)for(var $t in Fe)$t!=="default"&&Object.prototype.hasOwnProperty.call(Fe,$t)&&h(mt,Fe,$t);return y(mt,Fe),mt},f=i&&i.__importDefault||function(Fe){return Fe&&Fe.__esModule?Fe:{default:Fe}};Object.defineProperty(i,"__esModule",{value:!0}),i.HttpApi=void 0;var g=S(y_()),x=m_(),P=f(Az()),O=Tz(),B=f(Iz()),N=f(Z8()),R=Kz().version,re=g.type({"@type":g.literal("ton.blockIdExt"),workchain:g.number,shard:g.string,seqno:g.number,root_hash:g.string,file_hash:g.string}),_e=g.type({balance:g.union([g.number,g.string]),state:g.union([g.literal("active"),g.literal("uninitialized"),g.literal("frozen")]),data:g.string,code:g.string,last_transaction_id:g.type({"@type":g.literal("internal.transactionId"),lt:g.string,hash:g.string}),block_id:re,sync_utime:g.number}),Ce=g.type({"@type":g.literal("ok")}),qe=g.type({"@type":g.literal("query.fees"),source_fees:g.type({"@type":g.literal("fees"),in_fwd_fee:g.number,storage_fee:g.number,gas_fee:g.number,fwd_fee:g.number})}),Ve=g.type({gas_used:g.number,exit_code:g.number,stack:g.array(g.unknown)}),Pe=g.union([g.type({"@type":g.literal("msg.dataRaw"),body:g.string}),g.type({"@type":g.literal("msg.dataText"),text:g.string}),g.type({"@type":g.literal("msg.dataDecryptedText"),text:g.string}),g.type({"@type":g.literal("msg.dataEncryptedText"),text:g.string})]),Qe=g.type({source:g.string,destination:g.string,value:g.string,fwd_fee:g.string,ihr_fee:g.string,created_lt:g.string,body_hash:g.string,msg_data:Pe}),et=g.type({data:g.string,utime:g.number,transaction_id:g.type({lt:g.string,hash:g.string}),fee:g.string,storage_fee:g.string,other_fee:g.string,in_msg:g.union([g.undefined,Qe]),out_msgs:g.array(Qe)}),_t=g.array(et),Ue=g.type({state_root_hash:g.string,last:re,init:re}),We=g.type({shards:g.array(re)}),ht=g.type({"@type":g.literal("blocks.shortTxId"),mode:g.number,account:g.string,lt:g.string,hash:g.string}),gt=g.type({id:re,req_count:g.number,incomplete:g.boolean,transactions:g.array(ht)}),Je=class{constructor(Fe,mt,$t,hr){this.namespace=Fe,this.cache=mt,this.codec=$t,this.keyEncoder=hr}async get(Fe){let mt=await this.cache.get(this.namespace,this.keyEncoder(Fe));if(mt){let $t=this.codec.decode(JSON.parse(mt));if((0,x.isRight)($t))return $t.right}return null}async set(Fe,mt){mt!==null?await this.cache.set(this.namespace,this.keyEncoder(Fe),JSON.stringify(mt)):await this.cache.set(this.namespace,this.keyEncoder(Fe),null)}},Be=class{constructor(Fe,mt){this.endpoint=Fe,this.cache=new O.InMemoryCache,this.parameters={timeout:mt?.timeout||3e4,apiKey:mt?.apiKey},this.shardCache=new Je("ton-shard",this.cache,g.array(re),$t=>$t+""),this.shardLoader=new B.default(async $t=>await Promise.all($t.map(async hr=>{let kr=await this.shardCache.get(hr);if(kr)return kr;let qr=(await this.doCall("shards",{seqno:hr},We)).shards;return await this.shardCache.set(hr,qr),qr}))),this.shardTransactionsCache=new Je("ton-shard-tx",this.cache,gt,$t=>$t.workchain+":"+$t.shard+":"+$t.seqno),this.shardTransactionsLoader=new B.default(async $t=>await Promise.all($t.map(async hr=>{let kr=await this.shardTransactionsCache.get(hr);if(kr)return kr;let qr=await this.doCall("getBlockTransactions",{workchain:hr.workchain,seqno:hr.seqno,shard:hr.shard},gt);return await this.shardTransactionsCache.set(hr,qr),qr})),{cacheKeyFn:$t=>$t.workchain+":"+$t.shard+":"+$t.seqno})}getAddressInformation(Fe){return this.doCall("getAddressInformation",{address:Fe.toString()},_e)}async getTransactions(Fe,mt){let $t=mt.inclusive;delete mt.inclusive;let hr;mt.hash&&(hr=yt.from(mt.hash,"base64").toString("hex"));let kr=mt.limit;mt.hash&&mt.lt&&$t!==!0&&kr++;let qr=await this.doCall("getTransactions",{address:Fe.toString(),...mt,limit:kr,hash:hr},_t);return qr.length>kr&&(qr=qr.slice(0,kr)),mt.hash&&mt.lt&&$t!==!0&&qr.shift(),qr}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},Ue)}async getShards(Fe){return await this.shardLoader.load(Fe)}async getBlockTransactions(Fe,mt,$t){return await this.shardTransactionsLoader.load({workchain:Fe,seqno:mt,shard:$t})}async getTransaction(Fe,mt,$t){let hr=yt.from($t,"base64").toString("hex");return(await this.doCall("getTransactions",{address:Fe.toString(),lt:mt,hash:hr,limit:1},_t)).find(qr=>qr.transaction_id.lt===mt&&qr.transaction_id.hash===$t)||null}async callGetMethod(Fe,mt,$t){return await this.doCall("runGetMethod",{address:Fe.toString(),method:mt,stack:Se($t)},Ve)}async sendBoc(Fe){await this.doCall("sendBoc",{boc:Fe.toString("base64")},Ce)}async estimateFee(Fe,mt){return await this.doCall("estimateFee",{address:Fe.toString(),body:mt.body.toBoc().toString("base64"),init_data:mt.initData?mt.initData.toBoc().toString("base64"):"",init_code:mt.initCode?mt.initCode.toBoc().toString("base64"):"",ignore_chksig:mt.ignoreSignature},qe)}async doCall(Fe,mt,$t){let hr={"Content-Type":"application/json","X-Ton-Client-Version":R};this.parameters.apiKey&&(hr["X-API-Key"]=this.parameters.apiKey);let kr=await N.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:Fe,params:mt}),{headers:hr,timeout:this.parameters.timeout});if(kr.status!==200||!kr.data.ok)throw Error("Received error: "+JSON.stringify(kr.data));let qr=$t.decode(kr.data.result);if((0,x.isRight)(qr))return qr.right;throw Error("Malformed response: "+P.default.report(qr).join(", "))}};i.HttpApi=Be;function Se(Fe){let mt=[];for(let $t of Fe)if($t.type==="int")mt.push(["num",$t.value.toString()]);else if($t.type==="cell")mt.push(["tvm.Cell",$t.cell.toBoc().toString("base64")]);else if($t.type==="slice")mt.push(["tvm.Slice",$t.cell.toBoc().toString("base64")]);else if($t.type==="builder")mt.push(["tvm.Builder",$t.cell.toBoc().toString("base64")]);else throw Error("Unsupported stack item type: "+$t.type);return mt}}),Gz=u(i=>{b(),m(),_(),xt(),ce();var h=i&&i.__classPrivateFieldSet||function(B,N,R,re,_e){if(re==="m")throw new TypeError("Private method is not writable");if(re==="a"&&!_e)throw new TypeError("Private accessor was defined without a setter");if(typeof N=="function"?B!==N||!_e:!N.has(B))throw new TypeError("Cannot write private member to an object whose class did not declare it");return re==="a"?_e.call(B,R):_e?_e.value=R:N.set(B,R),R},y=i&&i.__classPrivateFieldGet||function(B,N,R,re){if(R==="a"&&!re)throw new TypeError("Private accessor was defined without a getter");if(typeof N=="function"?B!==N||!re:!N.has(B))throw new TypeError("Cannot read private member from an object whose class did not declare it");return R==="m"?re:R==="a"?re.call(B):re?re.value:N.get(B)},S;Object.defineProperty(i,"__esModule",{value:!0}),i.TonClient=void 0;var f=X8(),g=Ya(),x=class{constructor(B){S.set(this,void 0),this.parameters={endpoint:B.endpoint},h(this,S,new f.HttpApi(this.parameters.endpoint,{timeout:B.timeout,apiKey:B.apiKey,adapter:B.httpAdapter}),"f")}async getBalance(B){return(await this.getContractState(B)).balance}async runMethod(B,N,R=[]){let re=await y(this,S,"f").callGetMethod(B,N,R);if(re.exit_code!==0)throw Error("Unable to execute get method. Got exit_code: "+re.exit_code);return{gas_used:re.gas_used,stack:P(re.stack)}}async callGetMethod(B,N,R=[]){return this.runMethod(B,N,R)}async runMethodWithError(B,N,R=[]){let re=await y(this,S,"f").callGetMethod(B,N,R);return{gas_used:re.gas_used,stack:P(re.stack),exit_code:re.exit_code}}async callGetMethodWithError(B,N,R=[]){return this.runMethodWithError(B,N,R)}async getTransactions(B,N){let R=await y(this,S,"f").getTransactions(B,N),re=[];for(let _e of R)re.push((0,g.loadTransaction)(g.Cell.fromBoc(yt.from(_e.data,"base64"))[0].beginParse()));return re}async getTransaction(B,N,R){let re=await y(this,S,"f").getTransaction(B,N,R);return re?(0,g.loadTransaction)(g.Cell.fromBoc(yt.from(re.data,"base64"))[0].beginParse()):null}async getMasterchainInfo(){let B=await y(this,S,"f").getMasterchainInfo();return{workchain:B.init.workchain,shard:B.last.shard,initSeqno:B.init.seqno,latestSeqno:B.last.seqno}}async getWorkchainShards(B){return(await y(this,S,"f").getShards(B)).map(N=>({workchain:N.workchain,shard:N.shard,seqno:N.seqno}))}async getShardTransactions(B,N,R){let re=await y(this,S,"f").getBlockTransactions(B,N,R);if(re.incomplete)throw Error("Unsupported");return re.transactions.map(_e=>({account:g.Address.parseRaw(_e.account),lt:_e.lt,hash:_e.hash}))}async sendMessage(B){let N=(0,g.beginCell)().store((0,g.storeMessage)(B)).endCell().toBoc();await y(this,S,"f").sendBoc(N)}async sendFile(B){await y(this,S,"f").sendBoc(B)}async estimateExternalMessageFee(B,N){return await y(this,S,"f").estimateFee(B,{body:N.body,initCode:N.initCode,initData:N.initData,ignoreSignature:N.ignoreSignature})}async sendExternalMessage(B,N){if(await this.isContractDeployed(B.address)||!B.init){let R=(0,g.external)({to:B.address,body:N});await this.sendMessage(R)}else{let R=(0,g.external)({to:B.address,init:{code:B.init.code,data:B.init.data},body:N});await this.sendMessage(R)}}async isContractDeployed(B){return(await this.getContractState(B)).state==="active"}async getContractState(B){let N=await y(this,S,"f").getAddressInformation(B),R=BigInt(N.balance),re=N.state;return{balance:R,state:re,code:N.code!==""?yt.from(N.code,"base64"):null,data:N.data!==""?yt.from(N.data,"base64"):null,lastTransaction:N.last_transaction_id.lt!=="0"?{lt:N.last_transaction_id.lt,hash:N.last_transaction_id.hash}:null,blockId:{workchain:N.block_id.workchain,shard:N.block_id.shard,seqno:N.block_id.seqno},timestampt:N.sync_utime}}open(B){return(0,g.openContract)(B,N=>O(this,N.address,N.init))}provider(B,N){return O(this,B,N)}};i.TonClient=x,S=new WeakMap;function P(B){let N=[];for(let R of B)if(R[0]==="num"){let re=R[1];re.startsWith("-")?N.push({type:"int",value:-BigInt(re.slice(1))}):N.push({type:"int",value:BigInt(re)})}else if(R[0]==="null")N.push({type:"null"});else if(R[0]==="cell")N.push({type:"cell",cell:g.Cell.fromBoc(yt.from(R[1].bytes,"base64"))[0]});else if(R[0]==="slice")N.push({type:"slice",cell:g.Cell.fromBoc(yt.from(R[1].bytes,"base64"))[0]});else if(R[0]==="builder")N.push({type:"builder",cell:g.Cell.fromBoc(yt.from(R[1].bytes,"base64"))[0]});else throw Error("Unsupported stack item type: "+R[0]);return new g.TupleReader(N)}function O(B,N,R){return{async getState(){let re=await B.getContractState(N),_e=re.balance,Ce=re.lastTransaction?{lt:BigInt(re.lastTransaction.lt),hash:yt.from(re.lastTransaction.hash,"base64")}:null,qe;if(re.state==="active")qe={type:"active",code:re.code?re.code:null,data:re.data?re.data:null};else if(re.state==="uninitialized")qe={type:"uninit"};else if(re.state==="frozen")qe={type:"frozen",stateHash:yt.alloc(0)};else throw Error("Unsupported state");return{balance:_e,last:Ce,state:qe}},async get(re,_e){return{stack:(await B.callGetMethod(N,re,_e)).stack}},async external(re){let _e=null;R&&!await B.isContractDeployed(N)&&(_e=R);let Ce=(0,g.external)({to:N,init:_e?{code:_e.code,data:_e.data}:null,body:re}),qe=(0,g.beginCell)().store((0,g.storeMessage)(Ce)).endCell().toBoc();await B.sendFile(qe)},async internal(re,_e){let Ce=null;R&&!await B.isContractDeployed(N)&&(Ce=R);let qe=!0;_e.bounce!==null&&_e.bounce!==void 0&&(qe=_e.bounce);let Ve;typeof _e.value=="string"?Ve=(0,g.toNano)(_e.value):Ve=_e.value;let Pe=null;typeof _e.body=="string"?Pe=(0,g.comment)(_e.body):_e.body&&(Pe=_e.body),await re.send({to:N,value:Ve,bounce:qe,sendMode:_e.sendMode,init:Ce,body:Pe})}}}}),Yz=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.toUrlSafe=void 0;function h(y){for(;y.indexOf("/")>=0;)y=y.replace("/","_");for(;y.indexOf("+")>=0;)y=y.replace("+","-");for(;y.indexOf("=")>=0;)y=y.replace("=","");return y}i.toUrlSafe=h}),Qz=u(i=>{b(),m(),_(),xt(),ce();var h=i&&i.__createBinding||(Object.create?function(Se,Fe,mt,$t){$t===void 0&&($t=mt),Object.defineProperty(Se,$t,{enumerable:!0,get:function(){return Fe[mt]}})}:function(Se,Fe,mt,$t){$t===void 0&&($t=mt),Se[$t]=Fe[mt]}),y=i&&i.__setModuleDefault||(Object.create?function(Se,Fe){Object.defineProperty(Se,"default",{enumerable:!0,value:Fe})}:function(Se,Fe){Se.default=Fe}),S=i&&i.__importStar||function(Se){if(Se&&Se.__esModule)return Se;var Fe={};if(Se!=null)for(var mt in Se)mt!=="default"&&Object.prototype.hasOwnProperty.call(Se,mt)&&h(Fe,Se,mt);return y(Fe,Se),Fe},f=i&&i.__classPrivateFieldSet||function(Se,Fe,mt,$t,hr){if($t==="m")throw new TypeError("Private method is not writable");if($t==="a"&&!hr)throw new TypeError("Private accessor was defined without a setter");if(typeof Fe=="function"?Se!==Fe||!hr:!Fe.has(Se))throw new TypeError("Cannot write private member to an object whose class did not declare it");return $t==="a"?hr.call(Se,mt):hr?hr.value=mt:Fe.set(Se,mt),mt},g=i&&i.__classPrivateFieldGet||function(Se,Fe,mt,$t){if(mt==="a"&&!$t)throw new TypeError("Private accessor was defined without a getter");if(typeof Fe=="function"?Se!==Fe||!$t:!Fe.has(Se))throw new TypeError("Cannot read private member from an object whose class did not declare it");return mt==="m"?$t:mt==="a"?$t.call(Se):$t?$t.value:Fe.get(Se)},x=i&&i.__importDefault||function(Se){return Se&&Se.__esModule?Se:{default:Se}},P,O,B;Object.defineProperty(i,"__esModule",{value:!0}),i.TonClient4=void 0;var N=x(Z8()),R=S(y_()),re=Ya(),_e=Yz(),Ce=class{constructor(Se){P.set(this,void 0),O.set(this,void 0),B.set(this,void 0),f(this,P,Se.endpoint,"f"),f(this,O,Se.timeout||5e3,"f"),f(this,B,Se.httpAdapter,"f")}async getLastBlock(){let Se=await N.default.get(g(this,P,"f")+"/block/latest",{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Ve.is(Se.data))throw Error("Mailformed response");return Se.data}async getBlock(Se){let Fe=await N.default.get(g(this,P,"f")+"/block/"+Se,{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Pe.is(Fe.data))throw Error("Mailformed response");if(!Fe.data.exist)throw Error("Block is out of scope");return Fe.data.block}async getBlockByUtime(Se){let Fe=await N.default.get(g(this,P,"f")+"/block/utime/"+Se,{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Pe.is(Fe.data))throw Error("Mailformed response");if(!Fe.data.exist)throw Error("Block is out of scope");return Fe.data.block}async getAccount(Se,Fe){let mt=await N.default.get(g(this,P,"f")+"/block/"+Se+"/"+Fe.toString({urlSafe:!0}),{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!et.is(mt.data))throw Error("Mailformed response");return mt.data}async getAccountLite(Se,Fe){let mt=await N.default.get(g(this,P,"f")+"/block/"+Se+"/"+Fe.toString({urlSafe:!0})+"/lite",{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!_t.is(mt.data))throw Error("Mailformed response");return mt.data}async isContractDeployed(Se,Fe){return(await this.getAccountLite(Se,Fe)).account.state.type==="active"}async isAccountChanged(Se,Fe,mt){let $t=await N.default.get(g(this,P,"f")+"/block/"+Se+"/"+Fe.toString({urlSafe:!0})+"/changed/"+mt.toString(10),{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Ue.is($t.data))throw Error("Mailformed response");return $t.data}async getTransaction(Se,Fe,mt){let $t=Fe.toString({urlSafe:!0}),hr=`/block/${Se}/${$t}/tx/${mt.toString(10)}`,kr=await N.default.get(new URL(hr,g(this,P,"f")).href,{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Be.is(kr.data))throw Error("Mailformed response");let qr=re.Cell.fromBoc(yt.from(kr.data.boc,"base64"))[0];return{tx:(0,re.loadTransaction)(qr.beginParse()),...kr.data}}async getAccountTransactions(Se,Fe,mt){let $t=await N.default.get(g(this,P,"f")+"/account/"+Se.toString({urlSafe:!0})+"/tx/"+Fe.toString(10)+"/"+(0,_e.toUrlSafe)(mt.toString("base64")),{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!Je.is($t.data))throw Error("Mailformed response");let hr=$t.data,kr=[],qr=re.Cell.fromBoc(yt.from(hr.boc,"base64"));for(let jn=0;jn0&&(mt="/"+[...Fe].sort().join(","));let $t=await N.default.get(g(this,P,"f")+"/block/"+Se+"/config"+mt,{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!ht.is($t.data))throw Error("Mailformed response");return $t.data}async runMethod(Se,Fe,mt,$t){let hr=$t&&$t.length>0?"/"+(0,_e.toUrlSafe)((0,re.serializeTuple)($t).toBoc({idx:!1,crc32:!1}).toString("base64")):"",kr=g(this,P,"f")+"/block/"+Se+"/"+Fe.toString({urlSafe:!0})+"/run/"+mt+hr,qr=await N.default.get(kr,{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!We.is(qr.data))throw Error("Mailformed response");let jn=qr.data.resultRaw?(0,re.parseTuple)(re.Cell.fromBoc(yt.from(qr.data.resultRaw,"base64"))[0]):[];return{exitCode:qr.data.exitCode,result:jn,resultRaw:qr.data.resultRaw,block:qr.data.block,shardBlock:qr.data.shardBlock,reader:new re.TupleReader(jn)}}async sendMessage(Se){let Fe=await N.default.post(g(this,P,"f")+"/send",{boc:Se.toString("base64")},{adapter:g(this,B,"f"),timeout:g(this,O,"f")});if(!gt.is(Fe.data))throw Error("Mailformed response");return{status:Fe.data.status}}open(Se){return(0,re.openContract)(Se,Fe=>qe(this,null,Fe.address,Fe.init))}openAt(Se,Fe){return(0,re.openContract)(Fe,mt=>qe(this,Se,mt.address,mt.init))}provider(Se,Fe){return qe(this,null,Se,Fe||null)}providerAt(Se,Fe,mt){return qe(this,Se,Fe,mt||null)}};i.TonClient4=Ce,P=new WeakMap,O=new WeakMap,B=new WeakMap;function qe(Se,Fe,mt,$t){return{async getState(){let hr=Fe;hr===null&&(hr=(await Se.getLastBlock()).last.seqno);let kr=await Se.getAccount(hr,mt),qr=kr.account.last?{lt:BigInt(kr.account.last.lt),hash:yt.from(kr.account.last.hash,"base64")}:null,jn;if(kr.account.state.type==="active")jn={type:"active",code:kr.account.state.code?yt.from(kr.account.state.code,"base64"):null,data:kr.account.state.data?yt.from(kr.account.state.data,"base64"):null};else if(kr.account.state.type==="uninit")jn={type:"uninit"};else if(kr.account.state.type==="frozen")jn={type:"frozen",stateHash:yt.from(kr.account.state.stateHash,"base64")};else throw Error("Unsupported state");return{balance:BigInt(kr.account.balance.coins),last:qr,state:jn}},async get(hr,kr){let qr=Fe;qr===null&&(qr=(await Se.getLastBlock()).last.seqno);let jn=await Se.runMethod(qr,mt,hr,kr);if(jn.exitCode!==0&&jn.exitCode!==1)throw Error("Exit code: "+jn.exitCode);return{stack:new re.TupleReader(jn.result)}},async external(hr){let kr=await Se.getLastBlock(),qr=null;$t&&(await Se.getAccountLite(kr.last.seqno,mt)).account.state.type!=="active"&&(qr=$t);let jn=(0,re.external)({to:mt,init:qr?{code:qr.code,data:qr.data}:null,body:hr}),Qt=(0,re.beginCell)().store((0,re.storeMessage)(jn)).endCell().toBoc();await Se.sendMessage(Qt)},async internal(hr,kr){let qr=await Se.getLastBlock(),jn=null;$t&&(await Se.getAccountLite(qr.last.seqno,mt)).account.state.type!=="active"&&(jn=$t);let Qt=!0;kr.bounce!==null&&kr.bounce!==void 0&&(Qt=kr.bounce);let ti;typeof kr.value=="string"?ti=(0,re.toNano)(kr.value):ti=kr.value;let ii=null;typeof kr.body=="string"?ii=(0,re.comment)(kr.body):kr.body&&(ii=kr.body),await hr.send({to:mt,value:ti,bounce:Qt,sendMode:kr.sendMode,init:jn,body:ii})}}}var Ve=R.type({last:R.type({seqno:R.number,shard:R.string,workchain:R.number,fileHash:R.string,rootHash:R.string}),init:R.type({fileHash:R.string,rootHash:R.string}),stateRootHash:R.string,now:R.number}),Pe=R.union([R.type({exist:R.literal(!1)}),R.type({exist:R.literal(!0),block:R.type({shards:R.array(R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string,transactions:R.array(R.type({account:R.string,hash:R.string,lt:R.string}))}))})})]),Qe=R.type({lastPaid:R.number,duePayment:R.union([R.null,R.string]),used:R.type({bits:R.number,cells:R.number,publicCells:R.number})}),et=R.type({account:R.type({state:R.union([R.type({type:R.literal("uninit")}),R.type({type:R.literal("active"),code:R.union([R.string,R.null]),data:R.union([R.string,R.null])}),R.type({type:R.literal("frozen"),stateHash:R.string})]),balance:R.type({coins:R.string}),last:R.union([R.null,R.type({lt:R.string,hash:R.string})]),storageStat:R.union([R.null,Qe])}),block:R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string})}),_t=R.type({account:R.type({state:R.union([R.type({type:R.literal("uninit")}),R.type({type:R.literal("active"),codeHash:R.string,dataHash:R.string}),R.type({type:R.literal("frozen"),stateHash:R.string})]),balance:R.type({coins:R.string}),last:R.union([R.null,R.type({lt:R.string,hash:R.string})]),storageStat:R.union([R.null,Qe])})}),Ue=R.type({changed:R.boolean,block:R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string})}),We=R.type({exitCode:R.number,resultRaw:R.union([R.string,R.null]),block:R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string}),shardBlock:R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string})}),ht=R.type({config:R.type({cell:R.string,address:R.string,globalBalance:R.type({coins:R.string})})}),gt=R.type({status:R.number}),Je=R.type({blocks:R.array(R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string,fileHash:R.string})),boc:R.string}),Be=R.type({block:R.type({workchain:R.number,seqno:R.number,shard:R.string,rootHash:R.string}),boc:R.string,proof:R.string})}),zc=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.createWalletTransferV4=i.createWalletTransferV3=i.createWalletTransferV2=i.createWalletTransferV1=void 0;var h=Ya(),y=Mp();function S(P){let O=(0,h.beginCell)().storeUint(P.seqno,32);P.message&&(O.storeUint(P.sendMode,8),O.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(P.message))));let B=(0,y.sign)(O.endCell().hash(),P.secretKey);return(0,h.beginCell)().storeBuffer(B).storeBuilder(O).endCell()}i.createWalletTransferV1=S;function f(P){if(P.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let O=(0,h.beginCell)().storeUint(P.seqno,32);if(P.seqno===0)for(let N=0;N<32;N++)O.storeBit(1);else O.storeUint(P.timeout||Math.floor(Date.now()/1e3)+60,32);for(let N of P.messages)O.storeUint(P.sendMode,8),O.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(N)));let B=(0,y.sign)(O.endCell().hash(),P.secretKey);return(0,h.beginCell)().storeBuffer(B).storeBuilder(O).endCell()}i.createWalletTransferV2=f;function g(P){if(P.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let O=(0,h.beginCell)().storeUint(P.walletId,32);if(P.seqno===0)for(let N=0;N<32;N++)O.storeBit(1);else O.storeUint(P.timeout||Math.floor(Date.now()/1e3)+60,32);O.storeUint(P.seqno,32);for(let N of P.messages)O.storeUint(P.sendMode,8),O.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(N)));let B=(0,y.sign)(O.endCell().hash(),P.secretKey);return(0,h.beginCell)().storeBuffer(B).storeBuilder(O).endCell()}i.createWalletTransferV3=g;function x(P){if(P.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let O=(0,h.beginCell)().storeUint(P.walletId,32);if(P.seqno===0)for(let N=0;N<32;N++)O.storeBit(1);else O.storeUint(P.timeout||Math.floor(Date.now()/1e3)+60,32);O.storeUint(P.seqno,32),O.storeUint(0,8);for(let N of P.messages)O.storeUint(P.sendMode,8),O.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(N)));let B=(0,y.sign)(O.endCell().hash(),P.secretKey);return(0,h.beginCell)().storeBuffer(B).storeBuilder(O).endCell()}i.createWalletTransferV4=x}),Zz=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV1R1=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g){this.workchain=f,this.publicKey=g;let x=h.Cell.fromBoc(yt.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],P=(0,h.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:x,data:P},this.address=(0,h.contractAddress)(f,{code:x,data:P})}static create(f){return new S(f.workchain,f.publicKey)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){let g=await f.getState();return g.state.type==="active"?h.Cell.fromBoc(g.state.data)[0].beginParse().loadUint(32):0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV1)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,message:f.message})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,message:(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})});await this.send(f,O)}}}};i.WalletContractV1R1=S}),Xz=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV1R2=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g){this.workchain=f,this.publicKey=g;let x=h.Cell.fromBoc(yt.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],P=(0,h.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:x,data:P},this.address=(0,h.contractAddress)(f,{code:x,data:P})}static create(f){return new S(f.workchain,f.publicKey)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV1)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,message:f.message})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,message:(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})});await this.send(f,O)}}}};i.WalletContractV1R2=S}),Jz=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV1R3=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g){this.workchain=f,this.publicKey=g;let x=h.Cell.fromBoc(yt.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],P=(0,h.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:x,data:P},this.address=(0,h.contractAddress)(f,{code:x,data:P})}static create(f){return new S(f.workchain,f.publicKey)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV1)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,message:f.message})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,message:(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})});await this.send(f,O)}}}};i.WalletContractV1R3=S}),eH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV2R1=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g){this.workchain=f,this.publicKey=g;let x=h.Cell.fromBoc(yt.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],P=(0,h.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:x,data:P},this.address=(0,h.contractAddress)(f,{code:x,data:P})}static create(f){return new S(f.workchain,f.publicKey)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV2)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,messages:f.messages,timeout:f.timeout})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,messages:[(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})]});await this.send(f,O)}}}};i.WalletContractV2R1=S}),tH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV2R2=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g){this.workchain=f,this.publicKey=g;let x=h.Cell.fromBoc(yt.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],P=(0,h.beginCell)().storeUint(0,32).storeBuffer(g).endCell();this.init={code:x,data:P},this.address=(0,h.contractAddress)(f,{code:x,data:P})}static create(f){return new S(f.workchain,f.publicKey)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV2)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,messages:f.messages,timeout:f.timeout})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,messages:[(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})]});await this.send(f,O)}}}};i.WalletContractV2R2=S}),rH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV3R1=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g,x){this.workchain=f,this.publicKey=g,x!=null?this.walletId=x:this.walletId=698983191+f;let P=h.Cell.fromBoc(yt.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],O=(0,h.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(g).endCell();this.init={code:P,data:O},this.address=(0,h.contractAddress)(f,{code:P,data:O})}static create(f){return new S(f.workchain,f.publicKey,f.walletId)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV3)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,messages:f.messages,timeout:f.timeout,walletId:this.walletId})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,messages:[(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})]});await this.send(f,O)}}}};i.WalletContractV3R1=S}),nH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV3R2=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g,x){this.workchain=f,this.publicKey=g,x!=null?this.walletId=x:this.walletId=698983191+f;let P=h.Cell.fromBoc(yt.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],O=(0,h.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(g).endCell();this.init={code:P,data:O},this.address=(0,h.contractAddress)(f,{code:P,data:O})}static create(f){return new S(f.workchain,f.publicKey,f.walletId)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV3)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,messages:f.messages,timeout:f.timeout,walletId:this.walletId})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,messages:[(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})]});await this.send(f,O)}}}};i.WalletContractV3R2=S}),iH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.WalletContractV4=void 0;var h=Ya(),y=zc(),S=class{constructor(f,g,x){this.workchain=f,this.publicKey=g,x!=null?this.walletId=x:this.walletId=698983191+f;let P=h.Cell.fromBoc(yt.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],O=(0,h.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:P,data:O},this.address=(0,h.contractAddress)(f,{code:P,data:O})}static create(f){return new S(f.workchain,f.publicKey,f.walletId)}async getBalance(f){return(await f.getState()).balance}async getSeqno(f){return(await f.getState()).state.type==="active"?(await f.get("seqno",[])).stack.readNumber():0}async send(f,g){await f.external(g)}async sendTransfer(f,g){let x=this.createTransfer(g);await this.send(f,x)}createTransfer(f){let g=h.SendMode.PAY_GAS_SEPARATELY;return f.sendMode!==null&&f.sendMode!==void 0&&(g=f.sendMode),(0,y.createWalletTransferV4)({seqno:f.seqno,sendMode:g,secretKey:f.secretKey,messages:f.messages,timeout:f.timeout,walletId:this.walletId})}sender(f,g){return{send:async x=>{let P=await this.getSeqno(f),O=this.createTransfer({seqno:P,secretKey:g,sendMode:x.sendMode,messages:[(0,h.internal)({to:x.to,value:x.value,init:x.init,body:x.body,bounce:x.bounce})]});await this.send(f,O)}}}};i.WalletContractV4=S}),oH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.JettonMaster=void 0;var h=Ya(),y=class{constructor(S){this.address=S}static create(S){return new y(S)}async getWalletAddress(S,f){return(await S.get("get_wallet_address",[{type:"slice",cell:(0,h.beginCell)().storeAddress(f).endCell()}])).stack.readAddress()}async getJettonData(S){let f=await S.get("get_jetton_data",[]),g=f.stack.readBigNumber(),x=f.stack.readBoolean(),P=f.stack.readAddress(),O=f.stack.readCell(),B=f.stack.readCell();return{totalSupply:g,mintable:x,adminAddress:P,content:O,walletCode:B}}};i.JettonMaster=y}),aH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.JettonWallet=void 0;var h=class{constructor(y){this.address=y}static create(y){return new h(y)}async getBalance(y){return(await y.getState()).state.type!=="active"?0n:(await y.get("get_wallet_data",[])).stack.readBigNumber()}};i.JettonWallet=h}),J8=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.MultisigOrder=void 0;var h=Mp(),y=Ya(),S=class{constructor(f){this.signatures={},this.payload=f}static fromCell(f){let g=f.beginParse(),x=g.loadMaybeRef()?.beginParse(),P=g.asCell(),O=new S(P);if(x){for(;x.remainingBits>0;){let B=x.loadBuffer(64),N=x.loadUint(8);O.signatures[N]=B,x.remainingRefs>0?x=x.loadRef().asSlice():x.skip(1)}x.endParse()}return O}static fromPayload(f){return new S(f)}addSignature(f,g,x){let P=this.payload.hash();if(!(0,h.signVerify)(P,g,x.owners.get(f).slice(0,-1)))throw Error("invalid signature");this.signatures[f]=g}sign(f,g){let x=this.payload.hash();return this.signatures[f]=(0,h.sign)(x,g),x}unionSignatures(f){this.signatures=Object.assign({},this.signatures,f.signatures)}clearSignatures(){this.signatures={}}toCell(f){let g=(0,y.beginCell)().storeBit(0);for(let x in this.signatures){let P=this.signatures[x];g=(0,y.beginCell)().storeBit(1).storeRef((0,y.beginCell)().storeBuffer(P).storeUint(parseInt(x),8).storeBuilder(g).endCell())}return(0,y.beginCell)().storeUint(f,8).storeBuilder(g).storeBuilder(this.payload.asBuilder()).endCell()}};i.MultisigOrder=S}),sH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.MultisigOrderBuilder=void 0;var h=Ya(),y=J8(),S=class{constructor(f,g){this.messages=(0,h.beginCell)(),this.queryId=0n,this.walletId=f,this.queryOffset=g||7200}addMessage(f,g){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(g,8),this.messages.storeRef((0,h.beginCell)().store((0,h.storeMessageRelaxed)(f)).endCell())}clearMessages(){this.messages=(0,h.beginCell)()}build(){return y.MultisigOrder.fromPayload((0,h.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){let f=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=f<<32n}};i.MultisigOrderBuilder=S}),lH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.MultisigWallet=void 0;var h=Mp(),y=Ya(),S=y.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ=="),f=class{constructor(g,x,P,O,B){this.provider=null,this.owners=y.Dictionary.empty(),this.workchain=x,this.walletId=P,this.k=O;for(let N=0;N{b(),m(),_(),xt(),ce();var h=i&&i.__createBinding||(Object.create?function(et,_t,Ue,We){We===void 0&&(We=Ue),Object.defineProperty(et,We,{enumerable:!0,get:function(){return _t[Ue]}})}:function(et,_t,Ue,We){We===void 0&&(We=Ue),et[We]=_t[Ue]}),y=i&&i.__exportStar||function(et,_t){for(var Ue in et)Ue!=="default"&&!Object.prototype.hasOwnProperty.call(_t,Ue)&&h(_t,et,Ue)};Object.defineProperty(i,"__esModule",{value:!0}),i.MultisigWallet=i.MultisigOrderBuilder=i.MultisigOrder=i.JettonWallet=i.JettonMaster=i.WalletContractV4=i.WalletContractV3R2=i.WalletContractV3R1=i.WalletContractV2R2=i.WalletContractV2R1=i.WalletContractV1R3=i.WalletContractV1R2=i.WalletContractV1R1=i.TonClient4=i.TonClient=i.HttpApi=void 0,y(Ya(),i);var S=X8();Object.defineProperty(i,"HttpApi",{enumerable:!0,get:function(){return S.HttpApi}});var f=Gz();Object.defineProperty(i,"TonClient",{enumerable:!0,get:function(){return f.TonClient}});var g=Qz();Object.defineProperty(i,"TonClient4",{enumerable:!0,get:function(){return g.TonClient4}});var x=Zz();Object.defineProperty(i,"WalletContractV1R1",{enumerable:!0,get:function(){return x.WalletContractV1R1}});var P=Xz();Object.defineProperty(i,"WalletContractV1R2",{enumerable:!0,get:function(){return P.WalletContractV1R2}});var O=Jz();Object.defineProperty(i,"WalletContractV1R3",{enumerable:!0,get:function(){return O.WalletContractV1R3}});var B=eH();Object.defineProperty(i,"WalletContractV2R1",{enumerable:!0,get:function(){return B.WalletContractV2R1}});var N=tH();Object.defineProperty(i,"WalletContractV2R2",{enumerable:!0,get:function(){return N.WalletContractV2R2}});var R=rH();Object.defineProperty(i,"WalletContractV3R1",{enumerable:!0,get:function(){return R.WalletContractV3R1}});var re=nH();Object.defineProperty(i,"WalletContractV3R2",{enumerable:!0,get:function(){return re.WalletContractV3R2}});var _e=iH();Object.defineProperty(i,"WalletContractV4",{enumerable:!0,get:function(){return _e.WalletContractV4}});var Ce=oH();Object.defineProperty(i,"JettonMaster",{enumerable:!0,get:function(){return Ce.JettonMaster}});var qe=aH();Object.defineProperty(i,"JettonWallet",{enumerable:!0,get:function(){return qe.JettonWallet}});var Ve=J8();Object.defineProperty(i,"MultisigOrder",{enumerable:!0,get:function(){return Ve.MultisigOrder}});var Pe=sH();Object.defineProperty(i,"MultisigOrderBuilder",{enumerable:!0,get:function(){return Pe.MultisigOrderBuilder}});var Qe=lH();Object.defineProperty(i,"MultisigWallet",{enumerable:!0,get:function(){return Qe.MultisigWallet}})}),cH=u((i,h)=>{b(),m(),_(),xt(),ce(),function(y,S){S(typeof i=="object"&&typeof h<"u"?i:y.WHATWGFetch={})}(i,function(y){var S=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof S<"u"&&S,f={searchParams:"URLSearchParams"in S,iterable:"Symbol"in S&&"iterator"in Symbol,blob:"FileReader"in S&&"Blob"in S&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in S,arrayBuffer:"ArrayBuffer"in S};function g(Se){return Se&&DataView.prototype.isPrototypeOf(Se)}if(f.arrayBuffer)var x=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],P=ArrayBuffer.isView||function(Se){return Se&&x.indexOf(Object.prototype.toString.call(Se))>-1};function O(Se){if(typeof Se!="string"&&(Se=String(Se)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(Se)||Se==="")throw new TypeError('Invalid character in header field name: "'+Se+'"');return Se.toLowerCase()}function B(Se){return typeof Se!="string"&&(Se=String(Se)),Se}function N(Se){var Fe={next:function(){var mt=Se.shift();return{done:mt===void 0,value:mt}}};return f.iterable&&(Fe[Symbol.iterator]=function(){return Fe}),Fe}function R(Se){this.map={},Se instanceof R?Se.forEach(function(Fe,mt){this.append(mt,Fe)},this):Array.isArray(Se)?Se.forEach(function(Fe){this.append(Fe[0],Fe[1])},this):Se&&Object.getOwnPropertyNames(Se).forEach(function(Fe){this.append(Fe,Se[Fe])},this)}R.prototype.append=function(Se,Fe){Se=O(Se),Fe=B(Fe);var mt=this.map[Se];this.map[Se]=mt?mt+", "+Fe:Fe},R.prototype.delete=function(Se){delete this.map[O(Se)]},R.prototype.get=function(Se){return Se=O(Se),this.has(Se)?this.map[Se]:null},R.prototype.has=function(Se){return this.map.hasOwnProperty(O(Se))},R.prototype.set=function(Se,Fe){this.map[O(Se)]=B(Fe)},R.prototype.forEach=function(Se,Fe){for(var mt in this.map)this.map.hasOwnProperty(mt)&&Se.call(Fe,this.map[mt],mt,this)},R.prototype.keys=function(){var Se=[];return this.forEach(function(Fe,mt){Se.push(mt)}),N(Se)},R.prototype.values=function(){var Se=[];return this.forEach(function(Fe){Se.push(Fe)}),N(Se)},R.prototype.entries=function(){var Se=[];return this.forEach(function(Fe,mt){Se.push([mt,Fe])}),N(Se)},f.iterable&&(R.prototype[Symbol.iterator]=R.prototype.entries);function re(Se){if(Se.bodyUsed)return Promise.reject(new TypeError("Already read"));Se.bodyUsed=!0}function _e(Se){return new Promise(function(Fe,mt){Se.onload=function(){Fe(Se.result)},Se.onerror=function(){mt(Se.error)}})}function Ce(Se){var Fe=new FileReader,mt=_e(Fe);return Fe.readAsArrayBuffer(Se),mt}function qe(Se){var Fe=new FileReader,mt=_e(Fe);return Fe.readAsText(Se),mt}function Ve(Se){for(var Fe=new Uint8Array(Se),mt=new Array(Fe.length),$t=0;$t-1?Fe:Se}function Ue(Se,Fe){if(!(this instanceof Ue))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');Fe=Fe||{};var mt=Fe.body;if(Se instanceof Ue){if(Se.bodyUsed)throw new TypeError("Already read");this.url=Se.url,this.credentials=Se.credentials,Fe.headers||(this.headers=new R(Se.headers)),this.method=Se.method,this.mode=Se.mode,this.signal=Se.signal,!mt&&Se._bodyInit!=null&&(mt=Se._bodyInit,Se.bodyUsed=!0)}else this.url=String(Se);if(this.credentials=Fe.credentials||this.credentials||"same-origin",(Fe.headers||!this.headers)&&(this.headers=new R(Fe.headers)),this.method=_t(Fe.method||this.method||"GET"),this.mode=Fe.mode||this.mode||null,this.signal=Fe.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&mt)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(mt),(this.method==="GET"||this.method==="HEAD")&&(Fe.cache==="no-store"||Fe.cache==="no-cache")){var $t=/([?&])_=[^&]*/;if($t.test(this.url))this.url=this.url.replace($t,"$1_="+new Date().getTime());else{var hr=/\?/;this.url+=(hr.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Ue.prototype.clone=function(){return new Ue(this,{body:this._bodyInit})};function We(Se){var Fe=new FormData;return Se.trim().split("&").forEach(function(mt){if(mt){var $t=mt.split("="),hr=$t.shift().replace(/\+/g," "),kr=$t.join("=").replace(/\+/g," ");Fe.append(decodeURIComponent(hr),decodeURIComponent(kr))}}),Fe}function ht(Se){var Fe=new R,mt=Se.replace(/\r?\n[\t ]+/g," ");return mt.split("\r").map(function($t){return $t.indexOf(` `)===0?$t.substr(1,$t.length):$t}).forEach(function($t){var hr=$t.split(":"),kr=hr.shift().trim();if(kr){var qr=hr.join(":").trim();Fe.append(kr,qr)}}),Fe}Qe.call(Ue.prototype);function gt(Se,Fe){if(!(this instanceof gt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');Fe||(Fe={}),this.type="default",this.status=Fe.status===void 0?200:Fe.status,this.ok=this.status>=200&&this.status<300,this.statusText=Fe.statusText===void 0?"":""+Fe.statusText,this.headers=new R(Fe.headers),this.url=Fe.url||"",this._initBody(Se)}Qe.call(gt.prototype),gt.prototype.clone=function(){return new gt(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new R(this.headers),url:this.url})},gt.error=function(){var Se=new gt(null,{status:0,statusText:""});return Se.type="error",Se};var Je=[301,302,303,307,308];gt.redirect=function(Se,Fe){if(Je.indexOf(Fe)===-1)throw new RangeError("Invalid status code");return new gt(null,{status:Fe,headers:{location:Se}})},y.DOMException=S.DOMException;try{new y.DOMException}catch{y.DOMException=function(Se,Fe){this.message=Se,this.name=Fe;var mt=Error(Se);this.stack=mt.stack},y.DOMException.prototype=Object.create(Error.prototype),y.DOMException.prototype.constructor=y.DOMException}function Be(Se,Fe){return new Promise(function(mt,$t){var hr=new Ue(Se,Fe);if(hr.signal&&hr.signal.aborted)return $t(new y.DOMException("Aborted","AbortError"));var kr=new XMLHttpRequest;function qr(){kr.abort()}kr.onload=function(){var Qt={status:kr.status,statusText:kr.statusText,headers:ht(kr.getAllResponseHeaders()||"")};Qt.url="responseURL"in kr?kr.responseURL:Qt.headers.get("X-Request-URL");var ti="response"in kr?kr.response:kr.responseText;setTimeout(function(){mt(new gt(ti,Qt))},0)},kr.onerror=function(){setTimeout(function(){$t(new TypeError("Network request failed"))},0)},kr.ontimeout=function(){setTimeout(function(){$t(new TypeError("Network request failed"))},0)},kr.onabort=function(){setTimeout(function(){$t(new y.DOMException("Aborted","AbortError"))},0)};function jn(Qt){try{return Qt===""&&S.location.href?S.location.href:Qt}catch{return Qt}}kr.open(hr.method,jn(hr.url),!0),hr.credentials==="include"?kr.withCredentials=!0:hr.credentials==="omit"&&(kr.withCredentials=!1),"responseType"in kr&&(f.blob?kr.responseType="blob":f.arrayBuffer&&hr.headers.get("Content-Type")&&hr.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(kr.responseType="arraybuffer")),Fe&&typeof Fe.headers=="object"&&!(Fe.headers instanceof R)?Object.getOwnPropertyNames(Fe.headers).forEach(function(Qt){kr.setRequestHeader(Qt,B(Fe.headers[Qt]))}):hr.headers.forEach(function(Qt,ti){kr.setRequestHeader(ti,Qt)}),hr.signal&&(hr.signal.addEventListener("abort",qr),kr.onreadystatechange=function(){kr.readyState===4&&hr.signal.removeEventListener("abort",qr)}),kr.send(typeof hr._bodyInit>"u"?null:hr._bodyInit)})}Be.polyfill=!0,S.fetch||(S.fetch=Be,S.Headers=R,S.Request=Ue,S.Response=gt),y.Headers=R,y.Request=Ue,y.Response=gt,y.fetch=Be,Object.defineProperty(y,"__esModule",{value:!0})})}),dH=u((i,h)=>{b(),m(),_(),xt(),ce(),cH(),h.exports=self.fetch.bind(self)}),fH=u(i=>{b(),m(),_(),xt(),ce();var h=i&&i.__awaiter||function(S,f,g,x){function P(O){return O instanceof g?O:new g(function(B){B(O)})}return new(g||(g=Promise))(function(O,B){function N(_e){try{re(x.next(_e))}catch(Ce){B(Ce)}}function R(_e){try{re(x.throw(_e))}catch(Ce){B(Ce)}}function re(_e){_e.done?O(_e.value):P(_e.value).then(N,R)}re((x=x.apply(S,f||[])).next())})};Object.defineProperty(i,"__esModule",{value:!0}),i.Nodes=void 0,dH();var y=class{constructor(){this.nodeIndex=-1,this.committee=new Set,this.topology=[],this.initTime=0}init(S){return h(this,void 0,void 0,function*(){this.nodeIndex=-1,this.committee.clear(),this.topology=[],this.initTime=Date.now();let f=[];try{f=yield(yield fetch(S)).json()}catch(g){throw new Error(`exception in fetch(${S}): ${g}`)}for(let g of f)g.Healthy==="1"&&this.topology.push(g);if(this.topology.length===0)throw new Error(`no healthy nodes in ${S}`)})}getHealthyFor(S){var f;let g=[];for(let x of this.topology)x.Weight>0&&!((f=x.Mngr)===null||f===void 0)&&f.health[S]&&g.push(x);return g}};i.Nodes=y}),pH=u((i,h)=>{h.exports={name:"@orbs-network/ton-access",version:"2.3.3",description:"Unthrottled anonymous RPC access to TON blockchain via a robust decentralized network",source:"lib/index.js",main:"lib/index.js",types:"lib/index.d.ts",files:["lib/**/*"],scripts:{test:"env mocha -r ts-node/register test/**/*.ts","test:v2":"env mocha -r ts-node/register test/ton-v2.ts","test:v4":"env mocha -r ts-node/register test/ton-v4.ts",cleanup:"rimraf ./lib","build:web:reg":"esbuild ./lib/web.js --bundle --sourcemap --target=es2015 --outfile=./dist/index.js","build:web:min":"esbuild ./lib/web.js --bundle --minify --target=es2015 --outfile=./dist/index.min.js","build:web":"rimraf ./dist && npm run build:web:reg && npm run build:web:min",build:"npm run lint && rimraf ./lib && tsc && npm run build:web",format:'prettier --write "src/**/*.ts"',lint:"tslint -p tsconfig.json",prepare:"npm run build",prepublishOnly:"npm test && npm run lint",preversion:"npm run lint",version:"npm run format && git add -A src",postversion:"git push && git push --tags"},repository:{type:"git",url:"git+https://github.com/orbs-network/ton-access.git"},author:"yuval@orbs.com",license:"MIT",bugs:{url:"https://github.com/orbs-network/ton-access/issues"},homepage:"https://github.com/orbs-network/ton-access#readme",dependencies:{"isomorphic-fetch":"^3.0.0"},devDependencies:{"@types/bn.js":"^5.1.1","@types/chai":"^4.3.4","@types/isomorphic-fetch":"^0.0.36","@types/mocha":"^10.0.0",buffer:"^6.0.3",chai:"^4.3.7",esbuild:"^0.15.14",mocha:"^10.1.0",prettier:"^2.7.1",rimraf:"^3.0.2",ton:"^12.1.3","ton-lite-client":"npm:@truecarry/ton-lite-client@^1.6.1",tonweb:"^0.0.58","ts-node":"^10.9.1",tslib:"^2.4.0",tslint:"^6.1.3","tslint-config-prettier":"^1.18.0"}}}),hH=u(i=>{b(),m(),_(),xt(),ce();var h=i&&i.__awaiter||function(B,N,R,re){function _e(Ce){return Ce instanceof R?Ce:new R(function(qe){qe(Ce)})}return new(R||(R=Promise))(function(Ce,qe){function Ve(et){try{Qe(re.next(et))}catch(_t){qe(_t)}}function Pe(et){try{Qe(re.throw(et))}catch(_t){qe(_t)}}function Qe(et){et.done?Ce(et.value):_e(et.value).then(Ve,Pe)}Qe((re=re.apply(B,N||[])).next())})};Object.defineProperty(i,"__esModule",{value:!0}),i.getHttpV4Endpoint=i.getHttpV4Endpoints=i.getHttpEndpoint=i.getHttpEndpoints=i.Access=void 0;var y=fH(),S=class{constructor(){this.host="ton.access.orbs.network",this.urlVersion=1,this.nodes=new y.Nodes}init(){return h(this,void 0,void 0,function*(){let B=pH();yield this.nodes.init(`https://${this.host}/mngr/nodes?npm_version=${B.version}`)})}makeProtonet(B,N){let R="";switch(B){case"toncenter-api-v2":R+="v2-";break;case"ton-api-v4":R+="v4-";break}return R+=N,R}weightedRandom(B){let N=0;for(let _e of B)N+=_e.Weight;let R=Math.floor(Math.random()*N),re=0;for(let _e of B){if(R>=re&&Ruv,__asyncDelegator:()=>AH,__asyncGenerator:()=>EH,__asyncValues:()=>TH,__await:()=>qg,__awaiter:()=>wH,__classPrivateFieldGet:()=>MH,__classPrivateFieldSet:()=>BH,__createBinding:()=>_H,__decorate:()=>yH,__exportStar:()=>SH,__extends:()=>gH,__generator:()=>xH,__importDefault:()=>PH,__importStar:()=>RH,__makeTemplateObject:()=>IH,__metadata:()=>bH,__param:()=>vH,__read:()=>eA,__rest:()=>mH,__spread:()=>CH,__spreadArrays:()=>kH,__values:()=>__});function gH(i,h){lv(i,h);function y(){this.constructor=i}i.prototype=h===null?Object.create(h):(y.prototype=h.prototype,new y)}function mH(i,h){var y={};for(var S in i)Object.prototype.hasOwnProperty.call(i,S)&&h.indexOf(S)<0&&(y[S]=i[S]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,S=Object.getOwnPropertySymbols(i);f=0;P--)(x=i[P])&&(g=(f<3?x(g):f>3?x(h,y,g):x(h,y))||g);return f>3&&g&&Object.defineProperty(h,y,g),g}function vH(i,h){return function(y,S){h(y,S,i)}}function bH(i,h){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,h)}function wH(i,h,y,S){function f(g){return g instanceof y?g:new y(function(x){x(g)})}return new(y||(y=Promise))(function(g,x){function P(N){try{B(S.next(N))}catch(R){x(R)}}function O(N){try{B(S.throw(N))}catch(R){x(R)}}function B(N){N.done?g(N.value):f(N.value).then(P,O)}B((S=S.apply(i,h||[])).next())})}function xH(i,h){var y={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},S,f,g,x;return x={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(x[Symbol.iterator]=function(){return this}),x;function P(B){return function(N){return O([B,N])}}function O(B){if(S)throw new TypeError("Generator is already executing.");for(;y;)try{if(S=1,f&&(g=B[0]&2?f.return:B[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,B[1])).done)return g;switch(f=0,g&&(B=[B[0]&2,g.value]),B[0]){case 0:case 1:g=B;break;case 4:return y.label++,{value:B[1],done:!1};case 5:y.label++,f=B[1],B=[0];continue;case 7:B=y.ops.pop(),y.trys.pop();continue;default:if(g=y.trys,!(g=g.length>0&&g[g.length-1])&&(B[0]===6||B[0]===2)){y=0;continue}if(B[0]===3&&(!g||B[1]>g[0]&&B[1]=i.length&&(i=void 0),{value:i&&i[S++],done:!i}}};throw new TypeError(h?"Object is not iterable.":"Symbol.iterator is not defined.")}function eA(i,h){var y=typeof Symbol=="function"&&i[Symbol.iterator];if(!y)return i;var S=y.call(i),f,g=[],x;try{for(;(h===void 0||h-- >0)&&!(f=S.next()).done;)g.push(f.value)}catch(P){x={error:P}}finally{try{f&&!f.done&&(y=S.return)&&y.call(S)}finally{if(x)throw x.error}}return g}function CH(){for(var i=[],h=0;h1||P(re,_e)})})}function P(re,_e){try{O(S[re](_e))}catch(Ce){R(g[0][3],Ce)}}function O(re){re.value instanceof qg?Promise.resolve(re.value.v).then(B,N):R(g[0][2],re)}function B(re){P("next",re)}function N(re){P("throw",re)}function R(re,_e){re(_e),g.shift(),g.length&&P(g[0][0],g[0][1])}}function AH(i){var h,y;return h={},S("next"),S("throw",function(f){throw f}),S("return"),h[Symbol.iterator]=function(){return this},h;function S(f,g){h[f]=i[f]?function(x){return(y=!y)?{value:qg(i[f](x)),done:f==="return"}:g?g(x):x}:g}}function TH(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var h=i[Symbol.asyncIterator],y;return h?h.call(i):(i=typeof __=="function"?__(i):i[Symbol.iterator](),y={},S("next"),S("throw"),S("return"),y[Symbol.asyncIterator]=function(){return this},y);function S(g){y[g]=i[g]&&function(x){return new Promise(function(P,O){x=i[g](x),f(P,O,x.done,x.value)})}}function f(g,x,P,O){Promise.resolve(O).then(function(B){g({value:B,done:P})},x)}}function IH(i,h){return Object.defineProperty?Object.defineProperty(i,"raw",{value:h}):i.raw=h,i}function RH(i){if(i&&i.__esModule)return i;var h={};if(i!=null)for(var y in i)Object.hasOwnProperty.call(i,y)&&(h[y]=i[y]);return h.default=i,h}function PH(i){return i&&i.__esModule?i:{default:i}}function MH(i,h){if(!h.has(i))throw new TypeError("attempted to get private field on non-instance");return h.get(i)}function BH(i,h,y){if(!h.has(i))throw new TypeError("attempted to set private field on non-instance");return h.set(i,y),y}var lv,uv,tA=l(()=>{b(),m(),_(),xt(),ce(),lv=function(i,h){return lv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,S){y.__proto__=S}||function(y,S){for(var f in S)S.hasOwnProperty(f)&&(y[f]=S[f])},lv(i,h)},uv=function(){return uv=Object.assign||function(i){for(var h,y=1,S=arguments.length;y{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.MAX_HASHABLE_LENGTH=i.INIT=i.KEY=i.DIGEST_LENGTH=i.BLOCK_SIZE=void 0,i.BLOCK_SIZE=64,i.DIGEST_LENGTH=32,i.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),i.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1}),OH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.RawSha256=void 0;var h=rA(),y=function(){function S(){this.state=Int32Array.from(h.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return S.prototype.update=function(f){if(this.finished)throw new Error("Attempted to update an already finished hash.");var g=0,x=f.byteLength;if(this.bytesHashed+=x,this.bytesHashed*8>h.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;x>0;)this.buffer[this.bufferLength++]=f[g++],x--,this.bufferLength===h.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},S.prototype.digest=function(){if(!this.finished){var f=this.bytesHashed*8,g=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),x=this.bufferLength;if(g.setUint8(this.bufferLength++,128),x%h.BLOCK_SIZE>=h.BLOCK_SIZE-8){for(var P=this.bufferLength;P>>24&255,O[P*4+1]=this.state[P]>>>16&255,O[P*4+2]=this.state[P]>>>8&255,O[P*4+3]=this.state[P]>>>0&255;return O},S.prototype.hashBuffer=function(){for(var f=this,g=f.buffer,x=f.state,P=x[0],O=x[1],B=x[2],N=x[3],R=x[4],re=x[5],_e=x[6],Ce=x[7],qe=0;qe>>17|Ve<<15)^(Ve>>>19|Ve<<13)^Ve>>>10;Ve=this.temp[qe-15];var Qe=(Ve>>>7|Ve<<25)^(Ve>>>18|Ve<<14)^Ve>>>3;this.temp[qe]=(Pe+this.temp[qe-7]|0)+(Qe+this.temp[qe-16]|0)}var et=(((R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&re^~R&_e)|0)+(Ce+(h.KEY[qe]+this.temp[qe]|0)|0)|0,_t=((P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10))+(P&O^P&B^O&B)|0;Ce=_e,_e=re,re=R,R=N+et|0,N=B,B=O,O=P,P=et+_t|0}x[0]+=P,x[1]+=O,x[2]+=B,x[3]+=N,x[4]+=R,x[5]+=re,x[6]+=_e,x[7]+=Ce},S}();i.RawSha256=y}),UH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.toUtf8=i.fromUtf8=void 0;var h=S=>{let f=[];for(let g=0,x=S.length;g>6|192,P&63|128);else if(g+1>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else f.push(P>>12|224,P>>6&63|128,P&63|128)}return Uint8Array.from(f)};i.fromUtf8=h;var y=S=>{let f="";for(let g=0,x=S.length;gB.toString(16)).join("%");f+=decodeURIComponent(O)}else f+=String.fromCharCode((P&15)<<12|(S[++g]&63)<<6|S[++g]&63)}return f};i.toUtf8=y}),LH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.toUtf8=i.fromUtf8=void 0;function h(S){return new TextEncoder().encode(S)}i.fromUtf8=h;function y(S){return new TextDecoder("utf-8").decode(S)}i.toUtf8=y}),DH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.toUtf8=i.fromUtf8=void 0;var h=UH(),y=LH(),S=g=>typeof TextEncoder=="function"?(0,y.fromUtf8)(g):(0,h.fromUtf8)(g);i.fromUtf8=S;var f=g=>typeof TextDecoder=="function"?(0,y.toUtf8)(g):(0,h.toUtf8)(g);i.toUtf8=f}),NH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.convertToBuffer=void 0;var h=DH(),y=typeof yt<"u"&&yt.from?function(f){return yt.from(f,"utf8")}:h.fromUtf8;function S(f){return f instanceof Uint8Array?f:typeof f=="string"?y(f):ArrayBuffer.isView(f)?new Uint8Array(f.buffer,f.byteOffset,f.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(f)}i.convertToBuffer=S}),jH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.isEmptyData=void 0;function h(y){return typeof y=="string"?y.length===0:y.byteLength===0}i.isEmptyData=h}),FH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.numToUint8=void 0;function h(y){return new Uint8Array([(y&4278190080)>>24,(y&16711680)>>16,(y&65280)>>8,y&255])}i.numToUint8=h}),$H=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.uint32ArrayFrom=void 0;function h(y){if(!Uint32Array.from){for(var S=new Uint32Array(y.length),f=0;f{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.uint32ArrayFrom=i.numToUint8=i.isEmptyData=i.convertToBuffer=void 0;var h=NH();Object.defineProperty(i,"convertToBuffer",{enumerable:!0,get:function(){return h.convertToBuffer}});var y=jH();Object.defineProperty(i,"isEmptyData",{enumerable:!0,get:function(){return y.isEmptyData}});var S=FH();Object.defineProperty(i,"numToUint8",{enumerable:!0,get:function(){return S.numToUint8}});var f=$H();Object.defineProperty(i,"uint32ArrayFrom",{enumerable:!0,get:function(){return f.uint32ArrayFrom}})}),HH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0}),i.Sha256=void 0;var h=(tA(),v(x_)),y=rA(),S=OH(),f=zH(),g=function(){function P(O){if(this.hash=new S.RawSha256,O){this.outer=new S.RawSha256;var B=x(O),N=new Uint8Array(y.BLOCK_SIZE);N.set(B);for(var R=0;Ry.BLOCK_SIZE){var B=new S.RawSha256;B.update(O),O=B.digest()}var N=new Uint8Array(y.BLOCK_SIZE);return N.set(O),N}}),WH=u(i=>{b(),m(),_(),xt(),ce(),Object.defineProperty(i,"__esModule",{value:!0});var h=(tA(),v(x_));h.__exportStar(HH(),i)}),VH=u((i,h)=>{b(),m(),_(),xt(),ce();var y={exports:{}};function S(tt){return tt instanceof Map?tt.clear=tt.delete=tt.set=function(){throw new Error("map is read-only")}:tt instanceof Set&&(tt.add=tt.clear=tt.delete=function(){throw new Error("set is read-only")}),Object.freeze(tt),Object.getOwnPropertyNames(tt).forEach(function(Ur){var hn=tt[Ur];typeof hn=="object"&&!Object.isFrozen(hn)&&S(hn)}),tt}y.exports=S,y.exports.default=S;var f=class{constructor(tt){tt.data===void 0&&(tt.data={}),this.data=tt.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function g(tt){return tt.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function x(tt,...Ur){let hn=Object.create(null);for(let zn in tt)hn[zn]=tt[zn];return Ur.forEach(function(zn){for(let It in zn)hn[It]=zn[It]}),hn}var P="",O=tt=>!!tt.scope||tt.sublanguage&&tt.language,B=(tt,{prefix:Ur})=>{if(tt.includes(".")){let hn=tt.split(".");return[`${Ur}${hn.shift()}`,...hn.map((zn,It)=>`${zn}${"_".repeat(It+1)}`)].join(" ")}return`${Ur}${tt}`},N=class{constructor(tt,Ur){this.buffer="",this.classPrefix=Ur.classPrefix,tt.walk(this)}addText(tt){this.buffer+=g(tt)}openNode(tt){if(!O(tt))return;let Ur="";tt.sublanguage?Ur=`language-${tt.language}`:Ur=B(tt.scope,{prefix:this.classPrefix}),this.span(Ur)}closeNode(tt){O(tt)&&(this.buffer+=P)}value(){return this.buffer}span(tt){this.buffer+=``}},R=(tt={})=>{let Ur={children:[]};return Object.assign(Ur,tt),Ur},re=class{constructor(){this.rootNode=R(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(tt){this.top.children.push(tt)}openNode(tt){let Ur=R({scope:tt});this.add(Ur),this.stack.push(Ur)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(tt){return this.constructor._walk(tt,this.rootNode)}static _walk(tt,Ur){return typeof Ur=="string"?tt.addText(Ur):Ur.children&&(tt.openNode(Ur),Ur.children.forEach(hn=>this._walk(tt,hn)),tt.closeNode(Ur)),tt}static _collapse(tt){typeof tt!="string"&&tt.children&&(tt.children.every(Ur=>typeof Ur=="string")?tt.children=[tt.children.join("")]:tt.children.forEach(Ur=>{re._collapse(Ur)}))}},_e=class extends re{constructor(tt){super(),this.options=tt}addKeyword(tt,Ur){tt!==""&&(this.openNode(Ur),this.addText(tt),this.closeNode())}addText(tt){tt!==""&&this.add(tt)}addSublanguage(tt,Ur){let hn=tt.root;hn.sublanguage=!0,hn.language=Ur,this.add(hn)}toHTML(){return new N(this,this.options).value()}finalize(){return!0}};function Ce(tt){return tt?typeof tt=="string"?tt:tt.source:null}function qe(tt){return Qe("(?=",tt,")")}function Ve(tt){return Qe("(?:",tt,")*")}function Pe(tt){return Qe("(?:",tt,")?")}function Qe(...tt){return tt.map(Ur=>Ce(Ur)).join("")}function et(tt){let Ur=tt[tt.length-1];return typeof Ur=="object"&&Ur.constructor===Object?(tt.splice(tt.length-1,1),Ur):{}}function _t(...tt){return"("+(et(tt).capture?"":"?:")+tt.map(Ur=>Ce(Ur)).join("|")+")"}function Ue(tt){return new RegExp(tt.toString()+"|").exec("").length-1}function We(tt,Ur){let hn=tt&&tt.exec(Ur);return hn&&hn.index===0}var ht=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function gt(tt,{joinWith:Ur}){let hn=0;return tt.map(zn=>{hn+=1;let It=hn,Mt=Ce(zn),Vt="";for(;Mt.length>0;){let K=ht.exec(Mt);if(!K){Vt+=Mt;break}Vt+=Mt.substring(0,K.index),Mt=Mt.substring(K.index+K[0].length),K[0][0]==="\\"&&K[1]?Vt+="\\"+String(Number(K[1])+It):(Vt+=K[0],K[0]==="("&&hn++)}return Vt}).map(zn=>`(${zn})`).join(Ur)}var Je=/\b\B/,Be="[a-zA-Z]\\w*",Se="[a-zA-Z_]\\w*",Fe="\\b\\d+(\\.\\d+)?",mt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$t="\\b(0b[01]+)",hr="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",kr=(tt={})=>{let Ur=/^#![ ]*\//;return tt.binary&&(tt.begin=Qe(Ur,/.*\b/,tt.binary,/\b.*/)),x({scope:"meta",begin:Ur,end:/$/,relevance:0,"on:begin":(hn,zn)=>{hn.index!==0&&zn.ignoreMatch()}},tt)},qr={begin:"\\\\[\\s\\S]",relevance:0},jn={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[qr]},Qt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[qr]},ti={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ii=function(tt,Ur,hn={}){let zn=x({scope:"comment",begin:tt,end:Ur,contains:[]},hn);zn.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let It=_t("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return zn.contains.push({begin:Qe(/[ ]+/,"(",It,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),zn},Si=ii("//","$"),Ci=ii("/\\*","\\*/"),ri=ii("#","$"),ui={scope:"number",begin:Fe,relevance:0},xn={scope:"number",begin:mt,relevance:0},ki={scope:"number",begin:$t,relevance:0},io={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[qr,{begin:/\[/,end:/\]/,relevance:0,contains:[qr]}]}]},Ui={scope:"title",begin:Be,relevance:0},rr={scope:"title",begin:Se,relevance:0},Ir={begin:"\\.\\s*"+Se,relevance:0},ln=function(tt){return Object.assign(tt,{"on:begin":(Ur,hn)=>{hn.data._beginMatch=Ur[1]},"on:end":(Ur,hn)=>{hn.data._beginMatch!==Ur[1]&&hn.ignoreMatch()}})},Vn=Object.freeze({__proto__:null,MATCH_NOTHING_RE:Je,IDENT_RE:Be,UNDERSCORE_IDENT_RE:Se,NUMBER_RE:Fe,C_NUMBER_RE:mt,BINARY_NUMBER_RE:$t,RE_STARTERS_RE:hr,SHEBANG:kr,BACKSLASH_ESCAPE:qr,APOS_STRING_MODE:jn,QUOTE_STRING_MODE:Qt,PHRASAL_WORDS_MODE:ti,COMMENT:ii,C_LINE_COMMENT_MODE:Si,C_BLOCK_COMMENT_MODE:Ci,HASH_COMMENT_MODE:ri,NUMBER_MODE:ui,C_NUMBER_MODE:xn,BINARY_NUMBER_MODE:ki,REGEXP_MODE:io,TITLE_MODE:Ui,UNDERSCORE_TITLE_MODE:rr,METHOD_GUARD:Ir,END_SAME_AS_BEGIN:ln});function Li(tt,Ur){tt.input[tt.index-1]==="."&&Ur.ignoreMatch()}function Qi(tt,Ur){tt.className!==void 0&&(tt.scope=tt.className,delete tt.className)}function ai(tt,Ur){Ur&&tt.beginKeywords&&(tt.begin="\\b("+tt.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",tt.__beforeBegin=Li,tt.keywords=tt.keywords||tt.beginKeywords,delete tt.beginKeywords,tt.relevance===void 0&&(tt.relevance=0))}function _i(tt,Ur){Array.isArray(tt.illegal)&&(tt.illegal=_t(...tt.illegal))}function bi(tt,Ur){if(tt.match){if(tt.begin||tt.end)throw new Error("begin & end are not supported with match");tt.begin=tt.match,delete tt.match}}function oo(tt,Ur){tt.relevance===void 0&&(tt.relevance=1)}var Di=(tt,Ur)=>{if(!tt.beforeMatch)return;if(tt.starts)throw new Error("beforeMatch cannot be used with starts");let hn=Object.assign({},tt);Object.keys(tt).forEach(zn=>{delete tt[zn]}),tt.keywords=hn.keywords,tt.begin=Qe(hn.beforeMatch,qe(hn.begin)),tt.starts={relevance:0,contains:[Object.assign(hn,{endsParent:!0})]},tt.relevance=0,delete hn.beforeMatch},ao=["of","and","for","in","not","or","if","then","parent","list","value"],so="keyword";function Zi(tt,Ur,hn=so){let zn=Object.create(null);return typeof tt=="string"?It(hn,tt.split(" ")):Array.isArray(tt)?It(hn,tt):Object.keys(tt).forEach(function(Mt){Object.assign(zn,Zi(tt[Mt],Ur,Mt))}),zn;function It(Mt,Vt){Ur&&(Vt=Vt.map(K=>K.toLowerCase())),Vt.forEach(function(K){let me=K.split("|");zn[me[0]]=[Mt,So(me[0],me[1])]})}}function So(tt,Ur){return Ur?Number(Ur):Dt(tt)?0:1}function Dt(tt){return ao.includes(tt.toLowerCase())}var He={},Ct=tt=>{console.error(tt)},Ot=(tt,...Ur)=>{console.log(`WARN: ${tt}`,...Ur)},qt=(tt,Ur)=>{He[`${tt}/${Ur}`]||(console.log(`Deprecated as of ${tt}. ${Ur}`),He[`${tt}/${Ur}`]=!0)},ot=new Error;function pt(tt,Ur,{key:hn}){let zn=0,It=tt[hn],Mt={},Vt={};for(let K=1;K<=Ur.length;K++)Vt[K+zn]=It[K],Mt[K+zn]=!0,zn+=Ue(Ur[K-1]);tt[hn]=Vt,tt[hn]._emit=Mt,tt[hn]._multi=!0}function Xe(tt){if(Array.isArray(tt.begin)){if(tt.skip||tt.excludeBegin||tt.returnBegin)throw Ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),ot;if(typeof tt.beginScope!="object"||tt.beginScope===null)throw Ct("beginScope must be object"),ot;pt(tt,tt.begin,{key:"beginScope"}),tt.begin=gt(tt.begin,{joinWith:""})}}function Rt(tt){if(Array.isArray(tt.end)){if(tt.skip||tt.excludeEnd||tt.returnEnd)throw Ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),ot;if(typeof tt.endScope!="object"||tt.endScope===null)throw Ct("endScope must be object"),ot;pt(tt,tt.end,{key:"endScope"}),tt.end=gt(tt.end,{joinWith:""})}}function nt(tt){tt.scope&&typeof tt.scope=="object"&&tt.scope!==null&&(tt.beginScope=tt.scope,delete tt.scope)}function Xt(tt){nt(tt),typeof tt.beginScope=="string"&&(tt.beginScope={_wrap:tt.beginScope}),typeof tt.endScope=="string"&&(tt.endScope={_wrap:tt.endScope}),Xe(tt),Rt(tt)}function ur(tt){function Ur(Vt,K){return new RegExp(Ce(Vt),"m"+(tt.case_insensitive?"i":"")+(tt.unicodeRegex?"u":"")+(K?"g":""))}class hn{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(K,me){me.position=this.position++,this.matchIndexes[this.matchAt]=me,this.regexes.push([me,K]),this.matchAt+=Ue(K)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let K=this.regexes.map(me=>me[1]);this.matcherRe=Ur(gt(K,{joinWith:"|"}),!0),this.lastIndex=0}exec(K){this.matcherRe.lastIndex=this.lastIndex;let me=this.matcherRe.exec(K);if(!me)return null;let xe=me.findIndex((ae,z)=>z>0&&ae!==void 0),T=this.matchIndexes[xe];return me.splice(0,xe),Object.assign(me,T)}}class zn{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(K){if(this.multiRegexes[K])return this.multiRegexes[K];let me=new hn;return this.rules.slice(K).forEach(([xe,T])=>me.addRule(xe,T)),me.compile(),this.multiRegexes[K]=me,me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(K,me){this.rules.push([K,me]),me.type==="begin"&&this.count++}exec(K){let me=this.getMatcher(this.regexIndex);me.lastIndex=this.lastIndex;let xe=me.exec(K);if(this.resumingScanAtSamePosition()&&!(xe&&xe.index===this.lastIndex)){let T=this.getMatcher(0);T.lastIndex=this.lastIndex+1,xe=T.exec(K)}return xe&&(this.regexIndex+=xe.position+1,this.regexIndex===this.count&&this.considerAll()),xe}}function It(Vt){let K=new zn;return Vt.contains.forEach(me=>K.addRule(me.begin,{rule:me,type:"begin"})),Vt.terminatorEnd&&K.addRule(Vt.terminatorEnd,{type:"end"}),Vt.illegal&&K.addRule(Vt.illegal,{type:"illegal"}),K}function Mt(Vt,K){let me=Vt;if(Vt.isCompiled)return me;[Qi,bi,Xt,Di].forEach(T=>T(Vt,K)),tt.compilerExtensions.forEach(T=>T(Vt,K)),Vt.__beforeBegin=null,[ai,_i,oo].forEach(T=>T(Vt,K)),Vt.isCompiled=!0;let xe=null;return typeof Vt.keywords=="object"&&Vt.keywords.$pattern&&(Vt.keywords=Object.assign({},Vt.keywords),xe=Vt.keywords.$pattern,delete Vt.keywords.$pattern),xe=xe||/\w+/,Vt.keywords&&(Vt.keywords=Zi(Vt.keywords,tt.case_insensitive)),me.keywordPatternRe=Ur(xe,!0),K&&(Vt.begin||(Vt.begin=/\B|\b/),me.beginRe=Ur(me.begin),!Vt.end&&!Vt.endsWithParent&&(Vt.end=/\B|\b/),Vt.end&&(me.endRe=Ur(me.end)),me.terminatorEnd=Ce(me.end)||"",Vt.endsWithParent&&K.terminatorEnd&&(me.terminatorEnd+=(Vt.end?"|":"")+K.terminatorEnd)),Vt.illegal&&(me.illegalRe=Ur(Vt.illegal)),Vt.contains||(Vt.contains=[]),Vt.contains=[].concat(...Vt.contains.map(function(T){return zr(T==="self"?Vt:T)})),Vt.contains.forEach(function(T){Mt(T,me)}),Vt.starts&&Mt(Vt.starts,K),me.matcher=It(me),me}if(tt.compilerExtensions||(tt.compilerExtensions=[]),tt.contains&&tt.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return tt.classNameAliases=x(tt.classNameAliases||{}),Mt(tt)}function xr(tt){return tt?tt.endsWithParent||xr(tt.starts):!1}function zr(tt){return tt.variants&&!tt.cachedVariants&&(tt.cachedVariants=tt.variants.map(function(Ur){return x(tt,{variants:null},Ur)})),tt.cachedVariants?tt.cachedVariants:xr(tt)?x(tt,{starts:tt.starts?x(tt.starts):null}):Object.isFrozen(tt)?x(tt):tt}var bt="11.6.0",zt=class extends Error{constructor(tt,Ur){super(tt),this.name="HTMLInjectionError",this.html=Ur}},Ar=g,sn=x,On=Symbol("nomatch"),zi=7,si=function(tt){let Ur=Object.create(null),hn=Object.create(null),zn=[],It=!0,Mt="Could not find the language '{}', did you forget to load/include a language module?",Vt={disableAutodetect:!0,name:"Plain text",contains:[]},K={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:_e};function me(fr){return K.noHighlightRe.test(fr)}function xe(fr){let Kt=fr.className+" ";Kt+=fr.parentNode?fr.parentNode.className:"";let nr=K.languageDetectRe.exec(Kt);if(nr){let Tr=fn(nr[1]);return Tr||(Ot(Mt.replace("{}",nr[1])),Ot("Falling back to no-highlight mode for this block.",fr)),Tr?nr[1]:"no-highlight"}return Kt.split(/\s+/).find(Tr=>me(Tr)||fn(Tr))}function T(fr,Kt,nr){let Tr="",Sr="";typeof Kt=="object"?(Tr=fr,nr=Kt.ignoreIllegals,Sr=Kt.language):(qt("10.7.0","highlight(lang, code, ...args) has been deprecated."),qt("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),Sr=fr,Tr=Kt),nr===void 0&&(nr=!0);let Mr={code:Tr,language:Sr};Cn("before:highlight",Mr);let $r=Mr.result?Mr.result:ae(Mr.language,Mr.code,nr);return $r.code=Mr.code,Cn("after:highlight",$r),$r}function ae(fr,Kt,nr,Tr){let Sr=Object.create(null);function Mr(En,Hn){return En.keywords[Hn]}function $r(){if(!Bn.keywords){Ii.addText(di);return}let En=0;Bn.keywordPatternRe.lastIndex=0;let Hn=Bn.keywordPatternRe.exec(di),Ei="";for(;Hn;){Ei+=di.substring(En,Hn.index);let fo=Xi.case_insensitive?Hn[0].toLowerCase():Hn[0],Pa=Mr(Bn,fo);if(Pa){let[Ne,Ye]=Pa;if(Ii.addText(Ei),Ei="",Sr[fo]=(Sr[fo]||0)+1,Sr[fo]<=zi&&(Oo+=Ye),Ne.startsWith("_"))Ei+=Hn[0];else{let St=Xi.classNameAliases[Ne]||Ne;Ii.addKeyword(Hn[0],St)}}else Ei+=Hn[0];En=Bn.keywordPatternRe.lastIndex,Hn=Bn.keywordPatternRe.exec(di)}Ei+=di.substring(En),Ii.addText(Ei)}function Dn(){if(di==="")return;let En=null;if(typeof Bn.subLanguage=="string"){if(!Ur[Bn.subLanguage]){Ii.addText(di);return}En=ae(Bn.subLanguage,di,!0,Ao[Bn.subLanguage]),Ao[Bn.subLanguage]=En._top}else En=ne(di,Bn.subLanguage.length?Bn.subLanguage:null);Bn.relevance>0&&(Oo+=En.relevance),Ii.addSublanguage(En._emitter,En.language)}function Nn(){Bn.subLanguage!=null?Dn():$r(),di=""}function Ke(En,Hn){let Ei=1,fo=Hn.length-1;for(;Ei<=fo;){if(!En._emit[Ei]){Ei++;continue}let Pa=Xi.classNameAliases[En[Ei]]||En[Ei],Ne=Hn[Ei];Pa?Ii.addKeyword(Ne,Pa):(di=Ne,$r(),di=""),Ei++}}function ct(En,Hn){return En.scope&&typeof En.scope=="string"&&Ii.openNode(Xi.classNameAliases[En.scope]||En.scope),En.beginScope&&(En.beginScope._wrap?(Ii.addKeyword(di,Xi.classNameAliases[En.beginScope._wrap]||En.beginScope._wrap),di=""):En.beginScope._multi&&(Ke(En.beginScope,Hn),di="")),Bn=Object.create(En,{parent:{value:Bn}}),Bn}function we(En,Hn,Ei){let fo=We(En.endRe,Ei);if(fo){if(En["on:end"]){let Pa=new f(En);En["on:end"](Hn,Pa),Pa.isMatchIgnored&&(fo=!1)}if(fo){for(;En.endsParent&&En.parent;)En=En.parent;return En}}if(En.endsWithParent)return we(En.parent,Hn,Ei)}function pr(En){return Bn.matcher.regexIndex===0?(di+=En[0],1):(Gg=!0,0)}function Jr(En){let Hn=En[0],Ei=En.rule,fo=new f(Ei),Pa=[Ei.__beforeBegin,Ei["on:begin"]];for(let Ne of Pa)if(Ne&&(Ne(En,fo),fo.isMatchIgnored))return pr(Hn);return Ei.skip?di+=Hn:(Ei.excludeBegin&&(di+=Hn),Nn(),!Ei.returnBegin&&!Ei.excludeBegin&&(di=Hn)),ct(Ei,En),Ei.returnBegin?0:Hn.length}function rn(En){let Hn=En[0],Ei=Kt.substring(En.index),fo=we(Bn,En,Ei);if(!fo)return On;let Pa=Bn;Bn.endScope&&Bn.endScope._wrap?(Nn(),Ii.addKeyword(Hn,Bn.endScope._wrap)):Bn.endScope&&Bn.endScope._multi?(Nn(),Ke(Bn.endScope,En)):Pa.skip?di+=Hn:(Pa.returnEnd||Pa.excludeEnd||(di+=Hn),Nn(),Pa.excludeEnd&&(di=Hn));do Bn.scope&&Ii.closeNode(),!Bn.skip&&!Bn.subLanguage&&(Oo+=Bn.relevance),Bn=Bn.parent;while(Bn!==fo.parent);return fo.starts&&ct(fo.starts,En),Pa.returnEnd?0:Hn.length}function Jn(){let En=[];for(let Hn=Bn;Hn!==Xi;Hn=Hn.parent)Hn.scope&&En.unshift(Hn.scope);En.forEach(Hn=>Ii.openNode(Hn))}let wi={};function Bi(En,Hn){let Ei=Hn&&Hn[0];if(di+=En,Ei==null)return Nn(),0;if(wi.type==="begin"&&Hn.type==="end"&&wi.index===Hn.index&&Ei===""){if(di+=Kt.slice(Hn.index,Hn.index+1),!It){let fo=new Error(`0 width match regex (${fr})`);throw fo.languageName=fr,fo.badRule=wi.rule,fo}return 1}if(wi=Hn,Hn.type==="begin")return Jr(Hn);if(Hn.type==="illegal"&&!nr){let fo=new Error('Illegal lexeme "'+Ei+'" for mode "'+(Bn.scope||"")+'"');throw fo.mode=Bn,fo}else if(Hn.type==="end"){let fo=rn(Hn);if(fo!==On)return fo}if(Hn.type==="illegal"&&Ei==="")return 1;if(Kg>1e5&&Kg>Hn.index*3)throw new Error("potential infinite loop, way more iterations than matches");return di+=Ei,Ei.length}let Xi=fn(fr);if(!Xi)throw Ct(Mt.replace("{}",fr)),new Error('Unknown language: "'+fr+'"');let qi=ur(Xi),Co="",Bn=Tr||qi,Ao={},Ii=new K.__emitter(K);Jn();let di="",Oo=0,Ro=0,Kg=0,Gg=!1;try{for(Bn.matcher.considerAll();;){Kg++,Gg?Gg=!1:Bn.matcher.considerAll(),Bn.matcher.lastIndex=Ro;let En=Bn.matcher.exec(Kt);if(!En)break;let Hn=Kt.substring(Ro,En.index),Ei=Bi(Hn,En);Ro=En.index+Ei}return Bi(Kt.substring(Ro)),Ii.closeAllNodes(),Ii.finalize(),Co=Ii.toHTML(),{language:fr,value:Co,relevance:Oo,illegal:!1,_emitter:Ii,_top:Bn}}catch(En){if(En.message&&En.message.includes("Illegal"))return{language:fr,value:Ar(Kt),illegal:!0,relevance:0,_illegalBy:{message:En.message,index:Ro,context:Kt.slice(Ro-100,Ro+100),mode:En.mode,resultSoFar:Co},_emitter:Ii};if(It)return{language:fr,value:Ar(Kt),illegal:!1,relevance:0,errorRaised:En,_emitter:Ii,_top:Bn};throw En}}function z(fr){let Kt={value:Ar(fr),illegal:!1,relevance:0,_top:Vt,_emitter:new K.__emitter(K)};return Kt._emitter.addText(fr),Kt}function ne(fr,Kt){Kt=Kt||K.languages||Object.keys(Ur);let nr=z(fr),Tr=Kt.filter(fn).filter(en).map(Nn=>ae(Nn,fr,!1));Tr.unshift(nr);let Sr=Tr.sort((Nn,Ke)=>{if(Nn.relevance!==Ke.relevance)return Ke.relevance-Nn.relevance;if(Nn.language&&Ke.language){if(fn(Nn.language).supersetOf===Ke.language)return 1;if(fn(Ke.language).supersetOf===Nn.language)return-1}return 0}),[Mr,$r]=Sr,Dn=Mr;return Dn.secondBest=$r,Dn}function he(fr,Kt,nr){let Tr=Kt&&hn[Kt]||nr;fr.classList.add("hljs"),fr.classList.add(`language-${Tr}`)}function X(fr){let Kt=null,nr=xe(fr);if(me(nr))return;if(Cn("before:highlightElement",{el:fr,language:nr}),fr.children.length>0&&(K.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(fr)),K.throwUnescapedHTML))throw new zt("One of your code blocks includes unescaped HTML.",fr.innerHTML);Kt=fr;let Tr=Kt.textContent,Sr=nr?T(Tr,{language:nr,ignoreIllegals:!0}):ne(Tr);fr.innerHTML=Sr.value,he(fr,nr,Sr.language),fr.result={language:Sr.language,re:Sr.relevance,relevance:Sr.relevance},Sr.secondBest&&(fr.secondBest={language:Sr.secondBest.language,relevance:Sr.secondBest.relevance}),Cn("after:highlightElement",{el:fr,result:Sr,text:Tr})}function ge(fr){K=sn(K,fr)}let Te=()=>{Zt(),qt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function st(){Zt(),qt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let at=!1;function Zt(){if(document.readyState==="loading"){at=!0;return}document.querySelectorAll(K.cssSelector).forEach(X)}function _r(){at&&Zt()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_r,!1);function Yr(fr,Kt){let nr=null;try{nr=Kt(tt)}catch(Tr){if(Ct("Language definition for '{}' could not be registered.".replace("{}",fr)),It)Ct(Tr);else throw Tr;nr=Vt}nr.name||(nr.name=fr),Ur[fr]=nr,nr.rawDefinition=Kt.bind(null,tt),nr.aliases&&Pn(nr.aliases,{languageName:fr})}function Zr(fr){delete Ur[fr];for(let Kt of Object.keys(hn))hn[Kt]===fr&&delete hn[Kt]}function Xr(){return Object.keys(Ur)}function fn(fr){return fr=(fr||"").toLowerCase(),Ur[fr]||Ur[hn[fr]]}function Pn(fr,{languageName:Kt}){typeof fr=="string"&&(fr=[fr]),fr.forEach(nr=>{hn[nr.toLowerCase()]=Kt})}function en(fr){let Kt=fn(fr);return Kt&&!Kt.disableAutodetect}function gn(fr){fr["before:highlightBlock"]&&!fr["before:highlightElement"]&&(fr["before:highlightElement"]=Kt=>{fr["before:highlightBlock"](Object.assign({block:Kt.el},Kt))}),fr["after:highlightBlock"]&&!fr["after:highlightElement"]&&(fr["after:highlightElement"]=Kt=>{fr["after:highlightBlock"](Object.assign({block:Kt.el},Kt))})}function yn(fr){gn(fr),zn.push(fr)}function Cn(fr,Kt){let nr=fr;zn.forEach(function(Tr){Tr[nr]&&Tr[nr](Kt)})}function Mn(fr){return qt("10.7.0","highlightBlock will be removed entirely in v12.0"),qt("10.7.0","Please use highlightElement now."),X(fr)}Object.assign(tt,{highlight:T,highlightAuto:ne,highlightAll:Zt,highlightElement:X,highlightBlock:Mn,configure:ge,initHighlighting:Te,initHighlightingOnLoad:st,registerLanguage:Yr,unregisterLanguage:Zr,listLanguages:Xr,getLanguage:fn,registerAliases:Pn,autoDetection:en,inherit:sn,addPlugin:yn}),tt.debugMode=function(){It=!1},tt.safeMode=function(){It=!0},tt.versionString=bt,tt.regex={concat:Qe,lookahead:qe,either:_t,optional:Pe,anyNumberOfTimes:Ve};for(let fr in Vn)typeof Vn[fr]=="object"&&y.exports(Vn[fr]);return Object.assign(tt,Vn),tt},ci=si({});h.exports=ci,ci.HighlightJS=ci,ci.default=ci}),qH=u((i,h)=>{h.exports="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}"}),KH=u((i,h)=>{h.exports="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}"});b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var Op=p(uH()),GH=p(hH()),YH=p(WH()),QH=Op.Address.parse("EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL"),ZH=Op.Address.parse("EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8");function XH(i){let h=new YH.Sha256;return h.update(i),yt.from(h.digestSync())}function JH(i,h){return i.replace("ipfs://",`https://tonsource${h?"-testnet":""}.infura-ipfs.io/ipfs/`)}function nA(i){return BigInt(`0x${i.toString("hex")}`)}var eW={async getSourcesJsonUrl(i,h){let y=new Op.TonClient4({endpoint:h?.httpApiEndpointV4??await(0,GH.getHttpV4Endpoint)({network:h.testnet?"testnet":"mainnet"})}),{last:{seqno:S}}=await y.getLastBlock(),f=new Op.TupleBuilder;f.writeNumber(nA(XH(h?.verifier??"orbs.com"))),f.writeNumber(nA(yt.from(i,"base64")));let{result:g}=await y.runMethod(S,h.testnet?ZH:QH,"get_source_item_address",f.build()),x=new Op.TupleReader(g),P=x.readAddress();if(await y.isContractDeployed(S,P)){let{result:O}=await y.runMethod(S,P,"get_source_item_data");x=new Op.TupleReader(O);let B=x.skip(3).readCell().beginParse();if(B.loadUint(8)!==1)throw new Error("Unsupported version");return B.loadStringTail()}return null},async getSourcesData(i,h){let y=h.ipfsConverter??JH,S=y(i,!!h.testnet),f=await(await fetch(y(i,!!h.testnet))).json();return{files:(await Promise.all(f.sources.map(async g=>{let x=y(g.url,!!h.testnet),P=await fetch(x).then(O=>O.text());return{name:g.filename,content:P,isEntrypoint:g.isEntrypoint}}))).reverse().sort((g,x)=>Number(x.isEntrypoint)-Number(g.isEntrypoint)),verificationDate:new Date(f.verificationDate),compilerSettings:f.compilerSettings,compiler:f.compiler,ipfsHttpLink:S}}};b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var tW=p(VH(),1),iA=tW.default;b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var oA='(?!")(`([^`]+)`|((?=_)_|(?=\\{)\\{|(?=\\})\\}|(?![_`{}]))([^;,\\[\\]\\(\\)\\s~.]+))',aA=/\"[^\n\"]+\"[Hhcusa]?/,S_;try{S_=new RegExp("(-?(?!_)([\\d_]+|0x[\\d_a-fA-F]+)|0b[1_0]+)(?=/,/<=/,/=/,/>/,//,/>=/,/<=/,/!=/,/==/,/\^>>/,/~>>/,/>>/,/<>=/,/~>>=/,/\^>>=/,/&=/,/\^=/,/\|=/,/\^/,/=/,/~/,/\//,/%/,/-/,/\*/,/\+/,/>/,//,/#s/,/\$#/,/#/,/\$\+/,/\$,/,/\$\d/,/\$=/,/\$(?=\()/,/\$>smca/,/\$>s/,/\$@\+/,/\$@\?\+/,/\$@\?/,/\$@/,/\$cmp/,/\$len/,/\$pos/,/\$reverse/,/%1<>c/,/\*>>r/,/\*>>/,/\*mod/,/\*/,/\+!/,/\+/,/,/,/-!/,/-/,/-1</,/0=/,/0>/,/1\+!/,/1\+/,/1-!/,/1-/,/1</,/=/,/>>c/,/>>r/,/>>/,/>/,/\?dup/,/@'/,/@/,/B\+/,/B,/,/B=/,/B>Li@\+/,/B>Li@/,/B>Lu@\+/,/B>Lu@/,/B>boc/,/B>file/,/B>i@\+/,/B>i@/,/B>u@\+/,/B>u@/,/B@\?\+/,/B@\+/,/B@\?/,/B@/,/Bcmp/,/BhashB/,/Bhashu/,/Bhash/,/Blen/,/Bx\./,/B\|/,/Li>B/,/Lu>B/,/\[\]/,/\[compile\]/,/\[/,/\]/,/atom\?/,/b\+/,/b\._/,/b\./,/b>idict!\+/,/b>idict!/,/b>sdict!\+/,/b>sdict!/,/b>udict!\+/,/b>udict!/,/b>/,/boc+>B/,/boc>B/,/csr\./,/def\?/,/empty\?/,/eq\?/,/file-exists\?/,/file>B/,/i,/,/i>B/,/i@\+/,/i@/,/i@\?\+/,/i@\?/,/idict!\+/,/idict!/,/idict-/,/idict@-/,/idict@/,/null!/,/null\?/,/pfxdict!\+/,/pfxdict!/,/pfxdict@/,/priv>pub/,/ref@\+/,/ref@/,/ref@\?\+/,/ref@\?/,/s,/,/s>c/,/s>/,/sdict!\+/,/sdict!/,/sdict-/,/sdict@-/,/sdict@/,/smca>\$/,/sr,/,/tuple\?/,/u,/,/u>B/,/u@\+/,/u@\?\+/,/u@\?/,/udict!\+/,/udict!/,/udict-/,/udict@-/,/udict@/,/undef\?/,/x\._/,/x\./,/\|\+/,/\|/,/\|_/,new RegExp("(?<=\\s)\\.(?=\\s)"))},{scope:"number",match:i.regex.either(/(0[xX][0-9a-fA-F]+)/,/(0[bB][01]+)/,/(-?[0-9]+(\/-?[0-9]+)?)/)},{scope:"string",match:/"([^"\r\n\\]|\\.)*"/},{scope:"symbol",match:/[xX]\{[0-9a-fA-F_]*}/,relevance:10},{scope:"symbol",match:/[bB]\{[01]*}/,relevance:10},{scope:"symbol",match:/'[^\s]+/},{scope:"punctuation",match:/[\[\{\}\],]/}]}}b(),m(),_(),xt(),ce();var lA=/[a-zA-Z_][0-9a-zA-Z_]*/;function iW(i){return{name:"TL-B",aliases:["Tlb","tlb","TLB","tl-b","TL-b","Tl-B","Tl-b"],case_insensitive:!1,keywords:{keyword:[],literal:["True","BoolTrue","False","BoolFalse","Null"],type:["Type","Bool","Unit","Maybe","Either","Both","Cell","uint8","uint15","uint16","uint32","uint63","uint64","int8","int16","int32","int64","bits256","bits512"],built_in:[]},contains:[{scope:"comment",variants:[i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},{scope:"symbol",match:i.regex.either(/#[0-9a-f]*_?/,/\$[01]*_?/,/##/,/#<=/,/#=/,//)},{scope:"number",match:/[0-9]+/},{scope:"punctuation",match:/[;\(\):\[\]\{\}]/}]}}function oW(i){i.registerLanguage("fift",nW),i.registerLanguage("func",rW),i.registerLanguage("tlb",iW)}b(),m(),_(),xt(),ce();var Hc=(i,...h)=>cA("div",i,...h),uA=(i,...h)=>cA("img",i,...h);function aW(i,h){for(let y of h)if(y)switch(typeof y){case"string":let S=document.createTextNode(y);i.appendChild(S);break;default:i.appendChild(y);break}}function sW(i,h){typeof h=="string"?i.setAttribute("style",h):Object.assign(i.style,h)}function lW(i,h){h.split(/\s/).forEach(y=>{y&&i.classList.add(y)})}function uW(i,h){let y=/^on([a-z]+)$/i;for(let S in h)if(S)if(S==="style")sW(i,h[S]);else if(S==="className")lW(i,h[S]);else if(y.test(S)){let f=S.replace(y,"$1").toLowerCase();i.addEventListener(f,h[S])}else i.setAttribute(S,h[S])}function cA(i,h,...y){if(typeof i=="function")return i(h);{let S=document.createElement(i);return h&&typeof h=="object"&&uW(S,h),y&&aW(S,y),S}}b(),m(),_(),xt(),ce();var cW=` +https://github.com/highlightjs/highlight.js/issues/2277`),Sr=fr,Tr=Kt),nr===void 0&&(nr=!0);let Mr={code:Tr,language:Sr};Cn("before:highlight",Mr);let $r=Mr.result?Mr.result:ae(Mr.language,Mr.code,nr);return $r.code=Mr.code,Cn("after:highlight",$r),$r}function ae(fr,Kt,nr,Tr){let Sr=Object.create(null);function Mr(En,Hn){return En.keywords[Hn]}function $r(){if(!Bn.keywords){Ii.addText(di);return}let En=0;Bn.keywordPatternRe.lastIndex=0;let Hn=Bn.keywordPatternRe.exec(di),Ei="";for(;Hn;){Ei+=di.substring(En,Hn.index);let fo=Xi.case_insensitive?Hn[0].toLowerCase():Hn[0],Pa=Mr(Bn,fo);if(Pa){let[Ne,Ye]=Pa;if(Ii.addText(Ei),Ei="",Sr[fo]=(Sr[fo]||0)+1,Sr[fo]<=zi&&(Oo+=Ye),Ne.startsWith("_"))Ei+=Hn[0];else{let St=Xi.classNameAliases[Ne]||Ne;Ii.addKeyword(Hn[0],St)}}else Ei+=Hn[0];En=Bn.keywordPatternRe.lastIndex,Hn=Bn.keywordPatternRe.exec(di)}Ei+=di.substring(En),Ii.addText(Ei)}function Dn(){if(di==="")return;let En=null;if(typeof Bn.subLanguage=="string"){if(!Ur[Bn.subLanguage]){Ii.addText(di);return}En=ae(Bn.subLanguage,di,!0,Ao[Bn.subLanguage]),Ao[Bn.subLanguage]=En._top}else En=ne(di,Bn.subLanguage.length?Bn.subLanguage:null);Bn.relevance>0&&(Oo+=En.relevance),Ii.addSublanguage(En._emitter,En.language)}function Nn(){Bn.subLanguage!=null?Dn():$r(),di=""}function Ke(En,Hn){let Ei=1,fo=Hn.length-1;for(;Ei<=fo;){if(!En._emit[Ei]){Ei++;continue}let Pa=Xi.classNameAliases[En[Ei]]||En[Ei],Ne=Hn[Ei];Pa?Ii.addKeyword(Ne,Pa):(di=Ne,$r(),di=""),Ei++}}function ct(En,Hn){return En.scope&&typeof En.scope=="string"&&Ii.openNode(Xi.classNameAliases[En.scope]||En.scope),En.beginScope&&(En.beginScope._wrap?(Ii.addKeyword(di,Xi.classNameAliases[En.beginScope._wrap]||En.beginScope._wrap),di=""):En.beginScope._multi&&(Ke(En.beginScope,Hn),di="")),Bn=Object.create(En,{parent:{value:Bn}}),Bn}function we(En,Hn,Ei){let fo=We(En.endRe,Ei);if(fo){if(En["on:end"]){let Pa=new f(En);En["on:end"](Hn,Pa),Pa.isMatchIgnored&&(fo=!1)}if(fo){for(;En.endsParent&&En.parent;)En=En.parent;return En}}if(En.endsWithParent)return we(En.parent,Hn,Ei)}function pr(En){return Bn.matcher.regexIndex===0?(di+=En[0],1):(Gg=!0,0)}function Jr(En){let Hn=En[0],Ei=En.rule,fo=new f(Ei),Pa=[Ei.__beforeBegin,Ei["on:begin"]];for(let Ne of Pa)if(Ne&&(Ne(En,fo),fo.isMatchIgnored))return pr(Hn);return Ei.skip?di+=Hn:(Ei.excludeBegin&&(di+=Hn),Nn(),!Ei.returnBegin&&!Ei.excludeBegin&&(di=Hn)),ct(Ei,En),Ei.returnBegin?0:Hn.length}function rn(En){let Hn=En[0],Ei=Kt.substring(En.index),fo=we(Bn,En,Ei);if(!fo)return On;let Pa=Bn;Bn.endScope&&Bn.endScope._wrap?(Nn(),Ii.addKeyword(Hn,Bn.endScope._wrap)):Bn.endScope&&Bn.endScope._multi?(Nn(),Ke(Bn.endScope,En)):Pa.skip?di+=Hn:(Pa.returnEnd||Pa.excludeEnd||(di+=Hn),Nn(),Pa.excludeEnd&&(di=Hn));do Bn.scope&&Ii.closeNode(),!Bn.skip&&!Bn.subLanguage&&(Oo+=Bn.relevance),Bn=Bn.parent;while(Bn!==fo.parent);return fo.starts&&ct(fo.starts,En),Pa.returnEnd?0:Hn.length}function Jn(){let En=[];for(let Hn=Bn;Hn!==Xi;Hn=Hn.parent)Hn.scope&&En.unshift(Hn.scope);En.forEach(Hn=>Ii.openNode(Hn))}let wi={};function Bi(En,Hn){let Ei=Hn&&Hn[0];if(di+=En,Ei==null)return Nn(),0;if(wi.type==="begin"&&Hn.type==="end"&&wi.index===Hn.index&&Ei===""){if(di+=Kt.slice(Hn.index,Hn.index+1),!It){let fo=new Error(`0 width match regex (${fr})`);throw fo.languageName=fr,fo.badRule=wi.rule,fo}return 1}if(wi=Hn,Hn.type==="begin")return Jr(Hn);if(Hn.type==="illegal"&&!nr){let fo=new Error('Illegal lexeme "'+Ei+'" for mode "'+(Bn.scope||"")+'"');throw fo.mode=Bn,fo}else if(Hn.type==="end"){let fo=rn(Hn);if(fo!==On)return fo}if(Hn.type==="illegal"&&Ei==="")return 1;if(Kg>1e5&&Kg>Hn.index*3)throw new Error("potential infinite loop, way more iterations than matches");return di+=Ei,Ei.length}let Xi=fn(fr);if(!Xi)throw Ct(Mt.replace("{}",fr)),new Error('Unknown language: "'+fr+'"');let qi=ur(Xi),Co="",Bn=Tr||qi,Ao={},Ii=new K.__emitter(K);Jn();let di="",Oo=0,Ro=0,Kg=0,Gg=!1;try{for(Bn.matcher.considerAll();;){Kg++,Gg?Gg=!1:Bn.matcher.considerAll(),Bn.matcher.lastIndex=Ro;let En=Bn.matcher.exec(Kt);if(!En)break;let Hn=Kt.substring(Ro,En.index),Ei=Bi(Hn,En);Ro=En.index+Ei}return Bi(Kt.substring(Ro)),Ii.closeAllNodes(),Ii.finalize(),Co=Ii.toHTML(),{language:fr,value:Co,relevance:Oo,illegal:!1,_emitter:Ii,_top:Bn}}catch(En){if(En.message&&En.message.includes("Illegal"))return{language:fr,value:Ar(Kt),illegal:!0,relevance:0,_illegalBy:{message:En.message,index:Ro,context:Kt.slice(Ro-100,Ro+100),mode:En.mode,resultSoFar:Co},_emitter:Ii};if(It)return{language:fr,value:Ar(Kt),illegal:!1,relevance:0,errorRaised:En,_emitter:Ii,_top:Bn};throw En}}function z(fr){let Kt={value:Ar(fr),illegal:!1,relevance:0,_top:Vt,_emitter:new K.__emitter(K)};return Kt._emitter.addText(fr),Kt}function ne(fr,Kt){Kt=Kt||K.languages||Object.keys(Ur);let nr=z(fr),Tr=Kt.filter(fn).filter(en).map(Nn=>ae(Nn,fr,!1));Tr.unshift(nr);let Sr=Tr.sort((Nn,Ke)=>{if(Nn.relevance!==Ke.relevance)return Ke.relevance-Nn.relevance;if(Nn.language&&Ke.language){if(fn(Nn.language).supersetOf===Ke.language)return 1;if(fn(Ke.language).supersetOf===Nn.language)return-1}return 0}),[Mr,$r]=Sr,Dn=Mr;return Dn.secondBest=$r,Dn}function he(fr,Kt,nr){let Tr=Kt&&hn[Kt]||nr;fr.classList.add("hljs"),fr.classList.add(`language-${Tr}`)}function X(fr){let Kt=null,nr=xe(fr);if(me(nr))return;if(Cn("before:highlightElement",{el:fr,language:nr}),fr.children.length>0&&(K.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(fr)),K.throwUnescapedHTML))throw new zt("One of your code blocks includes unescaped HTML.",fr.innerHTML);Kt=fr;let Tr=Kt.textContent,Sr=nr?T(Tr,{language:nr,ignoreIllegals:!0}):ne(Tr);fr.innerHTML=Sr.value,he(fr,nr,Sr.language),fr.result={language:Sr.language,re:Sr.relevance,relevance:Sr.relevance},Sr.secondBest&&(fr.secondBest={language:Sr.secondBest.language,relevance:Sr.secondBest.relevance}),Cn("after:highlightElement",{el:fr,result:Sr,text:Tr})}function ge(fr){K=sn(K,fr)}let Te=()=>{Zt(),qt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function st(){Zt(),qt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let at=!1;function Zt(){if(document.readyState==="loading"){at=!0;return}document.querySelectorAll(K.cssSelector).forEach(X)}function _r(){at&&Zt()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",_r,!1);function Yr(fr,Kt){let nr=null;try{nr=Kt(tt)}catch(Tr){if(Ct("Language definition for '{}' could not be registered.".replace("{}",fr)),It)Ct(Tr);else throw Tr;nr=Vt}nr.name||(nr.name=fr),Ur[fr]=nr,nr.rawDefinition=Kt.bind(null,tt),nr.aliases&&Pn(nr.aliases,{languageName:fr})}function Zr(fr){delete Ur[fr];for(let Kt of Object.keys(hn))hn[Kt]===fr&&delete hn[Kt]}function Xr(){return Object.keys(Ur)}function fn(fr){return fr=(fr||"").toLowerCase(),Ur[fr]||Ur[hn[fr]]}function Pn(fr,{languageName:Kt}){typeof fr=="string"&&(fr=[fr]),fr.forEach(nr=>{hn[nr.toLowerCase()]=Kt})}function en(fr){let Kt=fn(fr);return Kt&&!Kt.disableAutodetect}function gn(fr){fr["before:highlightBlock"]&&!fr["before:highlightElement"]&&(fr["before:highlightElement"]=Kt=>{fr["before:highlightBlock"](Object.assign({block:Kt.el},Kt))}),fr["after:highlightBlock"]&&!fr["after:highlightElement"]&&(fr["after:highlightElement"]=Kt=>{fr["after:highlightBlock"](Object.assign({block:Kt.el},Kt))})}function yn(fr){gn(fr),zn.push(fr)}function Cn(fr,Kt){let nr=fr;zn.forEach(function(Tr){Tr[nr]&&Tr[nr](Kt)})}function Mn(fr){return qt("10.7.0","highlightBlock will be removed entirely in v12.0"),qt("10.7.0","Please use highlightElement now."),X(fr)}Object.assign(tt,{highlight:T,highlightAuto:ne,highlightAll:Zt,highlightElement:X,highlightBlock:Mn,configure:ge,initHighlighting:Te,initHighlightingOnLoad:st,registerLanguage:Yr,unregisterLanguage:Zr,listLanguages:Xr,getLanguage:fn,registerAliases:Pn,autoDetection:en,inherit:sn,addPlugin:yn}),tt.debugMode=function(){It=!1},tt.safeMode=function(){It=!0},tt.versionString=bt,tt.regex={concat:Qe,lookahead:qe,either:_t,optional:Pe,anyNumberOfTimes:Ve};for(let fr in Vn)typeof Vn[fr]=="object"&&y.exports(Vn[fr]);return Object.assign(tt,Vn),tt},ci=si({});h.exports=ci,ci.HighlightJS=ci,ci.default=ci}),qH=u((i,h)=>{h.exports="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#383a42;background:#fafafa}.hljs-comment,.hljs-quote{color:#a0a1a7;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#a626a4}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e45649}.hljs-literal{color:#0184bb}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#50a14f}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#986801}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#4078f2}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#c18401}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}"}),KH=u((i,h)=>{h.exports="pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-formula,.hljs-keyword{color:#c678dd}.hljs-deletion,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-addition,.hljs-attribute,.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#98c379}.hljs-attr,.hljs-number,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-pseudo,.hljs-template-variable,.hljs-type,.hljs-variable{color:#d19a66}.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-symbol,.hljs-title{color:#61aeee}.hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_{color:#e6c07b}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}.hljs-link{text-decoration:underline}"});b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var Op=p(uH()),GH=p(hH()),YH=p(WH()),QH=Op.Address.parse("EQD-BJSVUJviud_Qv7Ymfd3qzXdrmV525e3YDzWQoHIAiInL"),ZH=Op.Address.parse("EQCsdKYwUaXkgJkz2l0ol6qT_WxeRbE_wBCwnEybmR0u5TO8");function XH(i){let h=new YH.Sha256;return h.update(i),yt.from(h.digestSync())}function JH(i,h){let y;return h?y="https://tonsource-testnet.infura-ipfs.io/ipfs/":y="https://files.orbs.network/ipfs/",i.replace("ipfs://",y)}function nA(i){return BigInt(`0x${i.toString("hex")}`)}var eW={async getSourcesJsonUrl(i,h){let y=new Op.TonClient4({endpoint:h?.httpApiEndpointV4??await(0,GH.getHttpV4Endpoint)({network:h.testnet?"testnet":"mainnet"})}),{last:{seqno:S}}=await y.getLastBlock(),f=new Op.TupleBuilder;f.writeNumber(nA(XH(h?.verifier??"orbs.com"))),f.writeNumber(nA(yt.from(i,"base64")));let{result:g}=await y.runMethod(S,h.testnet?ZH:QH,"get_source_item_address",f.build()),x=new Op.TupleReader(g),P=x.readAddress();if(await y.isContractDeployed(S,P)){let{result:O}=await y.runMethod(S,P,"get_source_item_data");x=new Op.TupleReader(O);let B=x.skip(3).readCell().beginParse();if(B.loadUint(8)!==1)throw new Error("Unsupported version");return B.loadStringTail()}return null},async getSourcesData(i,h){let y=h.ipfsConverter??JH,S=y(i,!!h.testnet),f=await(await fetch(y(i,!!h.testnet))).json();return{files:(await Promise.all(f.sources.map(async g=>{let x=y(g.url,!!h.testnet),P=await fetch(x).then(O=>O.text());return{name:g.filename,content:P,isEntrypoint:g.isEntrypoint}}))).reverse().sort((g,x)=>Number(x.isEntrypoint)-Number(g.isEntrypoint)),verificationDate:new Date(f.verificationDate),compilerSettings:f.compilerSettings,compiler:f.compiler,ipfsHttpLink:S}}};b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var tW=p(VH(),1),iA=tW.default;b(),m(),_(),xt(),ce(),b(),m(),_(),xt(),ce();var oA='(?!")(`([^`]+)`|((?=_)_|(?=\\{)\\{|(?=\\})\\}|(?![_`{}]))([^;,\\[\\]\\(\\)\\s~.]+))',aA=/\"[^\n\"]+\"[Hhcusa]?/,S_;try{S_=new RegExp("(-?(?!_)([\\d_]+|0x[\\d_a-fA-F]+)|0b[1_0]+)(?=/,/<=/,/=/,/>/,//,/>=/,/<=/,/!=/,/==/,/\^>>/,/~>>/,/>>/,/<>=/,/~>>=/,/\^>>=/,/&=/,/\^=/,/\|=/,/\^/,/=/,/~/,/\//,/%/,/-/,/\*/,/\+/,/>/,//,/#s/,/\$#/,/#/,/\$\+/,/\$,/,/\$\d/,/\$=/,/\$(?=\()/,/\$>smca/,/\$>s/,/\$@\+/,/\$@\?\+/,/\$@\?/,/\$@/,/\$cmp/,/\$len/,/\$pos/,/\$reverse/,/%1<>c/,/\*>>r/,/\*>>/,/\*mod/,/\*/,/\+!/,/\+/,/,/,/-!/,/-/,/-1</,/0=/,/0>/,/1\+!/,/1\+/,/1-!/,/1-/,/1</,/=/,/>>c/,/>>r/,/>>/,/>/,/\?dup/,/@'/,/@/,/B\+/,/B,/,/B=/,/B>Li@\+/,/B>Li@/,/B>Lu@\+/,/B>Lu@/,/B>boc/,/B>file/,/B>i@\+/,/B>i@/,/B>u@\+/,/B>u@/,/B@\?\+/,/B@\+/,/B@\?/,/B@/,/Bcmp/,/BhashB/,/Bhashu/,/Bhash/,/Blen/,/Bx\./,/B\|/,/Li>B/,/Lu>B/,/\[\]/,/\[compile\]/,/\[/,/\]/,/atom\?/,/b\+/,/b\._/,/b\./,/b>idict!\+/,/b>idict!/,/b>sdict!\+/,/b>sdict!/,/b>udict!\+/,/b>udict!/,/b>/,/boc+>B/,/boc>B/,/csr\./,/def\?/,/empty\?/,/eq\?/,/file-exists\?/,/file>B/,/i,/,/i>B/,/i@\+/,/i@/,/i@\?\+/,/i@\?/,/idict!\+/,/idict!/,/idict-/,/idict@-/,/idict@/,/null!/,/null\?/,/pfxdict!\+/,/pfxdict!/,/pfxdict@/,/priv>pub/,/ref@\+/,/ref@/,/ref@\?\+/,/ref@\?/,/s,/,/s>c/,/s>/,/sdict!\+/,/sdict!/,/sdict-/,/sdict@-/,/sdict@/,/smca>\$/,/sr,/,/tuple\?/,/u,/,/u>B/,/u@\+/,/u@\?\+/,/u@\?/,/udict!\+/,/udict!/,/udict-/,/udict@-/,/udict@/,/undef\?/,/x\._/,/x\./,/\|\+/,/\|/,/\|_/,new RegExp("(?<=\\s)\\.(?=\\s)"))},{scope:"number",match:i.regex.either(/(0[xX][0-9a-fA-F]+)/,/(0[bB][01]+)/,/(-?[0-9]+(\/-?[0-9]+)?)/)},{scope:"string",match:/"([^"\r\n\\]|\\.)*"/},{scope:"symbol",match:/[xX]\{[0-9a-fA-F_]*}/,relevance:10},{scope:"symbol",match:/[bB]\{[01]*}/,relevance:10},{scope:"symbol",match:/'[^\s]+/},{scope:"punctuation",match:/[\[\{\}\],]/}]}}b(),m(),_(),xt(),ce();var lA=/[a-zA-Z_][0-9a-zA-Z_]*/;function iW(i){return{name:"TL-B",aliases:["Tlb","tlb","TLB","tl-b","TL-b","Tl-B","Tl-b"],case_insensitive:!1,keywords:{keyword:[],literal:["True","BoolTrue","False","BoolFalse","Null"],type:["Type","Bool","Unit","Maybe","Either","Both","Cell","uint8","uint15","uint16","uint32","uint63","uint64","int8","int16","int32","int64","bits256","bits512"],built_in:[]},contains:[{scope:"comment",variants:[i.C_BLOCK_COMMENT_MODE,i.C_LINE_COMMENT_MODE]},{scope:"symbol",match:i.regex.either(/#[0-9a-f]*_?/,/\$[01]*_?/,/##/,/#<=/,/#=/,//)},{scope:"number",match:/[0-9]+/},{scope:"punctuation",match:/[;\(\):\[\]\{\}]/}]}}function oW(i){i.registerLanguage("fift",nW),i.registerLanguage("func",rW),i.registerLanguage("tlb",iW)}b(),m(),_(),xt(),ce();var Hc=(i,...h)=>cA("div",i,...h),uA=(i,...h)=>cA("img",i,...h);function aW(i,h){for(let y of h)if(y)switch(typeof y){case"string":let S=document.createTextNode(y);i.appendChild(S);break;default:i.appendChild(y);break}}function sW(i,h){typeof h=="string"?i.setAttribute("style",h):Object.assign(i.style,h)}function lW(i,h){h.split(/\s/).forEach(y=>{y&&i.classList.add(y)})}function uW(i,h){let y=/^on([a-z]+)$/i;for(let S in h)if(S)if(S==="style")sW(i,h[S]);else if(S==="className")lW(i,h[S]);else if(y.test(S)){let f=S.replace(y,"$1").toLowerCase();i.addEventListener(f,h[S])}else i.setAttribute(S,h[S])}function cA(i,h,...y){if(typeof i=="function")return i(h);{let S=document.createElement(i);return h&&typeof h=="object"&&uW(S,h),y&&aW(S,y),S}}b(),m(),_(),xt(),ce();var cW=` @@ -1239,4 +1239,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel. - `},Q5e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Z5e(e){let{announcements:t=Q5e,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=Y5e}=e;const{announce:a,announcement:s}=q5e(),l=Qy("DndLiveRegion"),[u,c]=J.exports.useState(!1);if(J.exports.useEffect(()=>{c(!0)},[]),K5e(J.exports.useMemo(()=>({onDragStart(p){let{active:v}=p;a(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:w}=p;t.onDragMove&&a(t.onDragMove({active:v,over:w}))},onDragOver(p){let{active:v,over:w}=p;a(t.onDragOver({active:v,over:w}))},onDragEnd(p){let{active:v,over:w}=p;a(t.onDragEnd({active:v,over:w}))},onDragCancel(p){let{active:v,over:w}=p;a(t.onDragCancel({active:v,over:w}))}}),[a,t])),!u)return null;const d=Lt(ra,{children:[D(H5e,{id:n,value:o.draggable}),D(V5e,{id:l,announcement:s})]});return r?bl.exports.createPortal(d,r):d}var _a;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_a||(_a={}));function Qb(){}function g3(e,t){return J.exports.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function X5e(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const au=Object.freeze({x:0,y:0});function i$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function o$(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function J5e(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function WB(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function a$(e,t){if(!e||e.length===0)return null;const[r]=e;return t?r[t]:r}function VB(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const e3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=VB(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,u=r.get(l);if(u){const c=i$(VB(u),o);a.push({id:l,data:{droppableContainer:s,value:c}})}}return a.sort(o$)},t3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=WB(t),a=[];for(const s of n){const{id:l}=s,u=r.get(l);if(u){const c=WB(u),d=o.reduce((v,w,b)=>v+i$(c[b],w),0),p=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:p}})}}return a.sort(o$)};function r3e(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const u=r3e(l,t);u>0&&o.push({id:s,data:{droppableContainer:a,value:u}})}}return o.sort(J5e)};function i3e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function s$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:au}function o3e(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const a3e=o3e(1);function s3e(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function l3e(e,t,r){const n=s3e(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,u=e.left-s-(1-o)*parseFloat(r),c=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,p=a?e.height/a:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const u3e={ignoreTransform:!1};function $g(e,t){t===void 0&&(t=u3e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:c}=$s(e),{transform:d,transformOrigin:p}=c(e);d&&(r=l3e(r,d,p))}const{top:n,left:o,width:a,height:s,bottom:l,right:u}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:u}}function qB(e){return $g(e,{ignoreTransform:!0})}function c3e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function d3e(e,t){return t===void 0&&(t=$s(e).getComputedStyle(e)),t.position==="fixed"}function f3e(e,t){t===void 0&&(t=$s(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function l_(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(XE(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Gy(o)||O5e(o)||r.includes(o))return r;const{getComputedStyle:a}=$s(o),s=a(o);return o!==e&&f3e(o,s)&&r.push(o),d3e(o,s)?r:n(o.parentNode)}return e?n(e):r}function l$(e){const[t]=l_(e,1);return t??null}function m3(e){return!s_||!e?null:jg(e)?e:ZE(e)?XE(e)||e===Fg(e).scrollingElement?window:Gy(e)?e:null:null}function u$(e){return jg(e)?e.scrollX:e.scrollLeft}function c$(e){return jg(e)?e.scrollY:e.scrollTop}function l4(e){return{x:u$(e),y:c$(e)}}var Oa;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oa||(Oa={}));function d$(e){return!s_||!e?!1:e===document.scrollingElement}function f$(e){const t={x:0,y:0},r=d$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:n,minScroll:t}}const p3e={x:.2,y:.2};function h3e(e,t,r,n,o){let{top:a,left:s,right:l,bottom:u}=r;n===void 0&&(n=10),o===void 0&&(o=p3e);const{isTop:c,isBottom:d,isLeft:p,isRight:v}=f$(e),w={x:0,y:0},b={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!c&&a<=t.top+m.height?(w.y=Oa.Backward,b.y=n*Math.abs((t.top+m.height-a)/m.height)):!d&&u>=t.bottom-m.height&&(w.y=Oa.Forward,b.y=n*Math.abs((t.bottom-m.height-u)/m.height)),!v&&l>=t.right-m.width?(w.x=Oa.Forward,b.x=n*Math.abs((t.right-m.width-l)/m.width)):!p&&s<=t.left+m.width&&(w.x=Oa.Backward,b.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:w,speed:b}}function g3e(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function p$(e){return e.reduce((t,r)=>Mh(t,l4(r)),au)}function m3e(e){return e.reduce((t,r)=>t+u$(r),0)}function y3e(e){return e.reduce((t,r)=>t+c$(r),0)}function v3e(e,t){if(t===void 0&&(t=$g),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);!l$(e)||(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const b3e=[["x",["left","right"],m3e],["y",["top","bottom"],y3e]];class t8{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=l_(r),o=p$(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of b3e)for(const u of s)Object.defineProperty(this,u,{get:()=>{const c=l(n),d=o[a]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class b0{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function w3e(e){const{EventTarget:t}=$s(e);return e instanceof t?e:Fg(e)}function y3(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var ml;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ml||(ml={}));function KB(e){e.preventDefault()}function x3e(e){e.stopPropagation()}var Hi;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Hi||(Hi={}));const h$={start:[Hi.Space,Hi.Enter],cancel:[Hi.Esc],end:[Hi.Space,Hi.Enter]},_3e=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Hi.Right:return{...r,x:r.x+25};case Hi.Left:return{...r,x:r.x-25};case Hi.Down:return{...r,y:r.y+25};case Hi.Up:return{...r,y:r.y-25}}};class r8{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new b0(Fg(r)),this.windowListeners=new b0($s(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ml.Resize,this.handleCancel),this.windowListeners.add(ml.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ml.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&v3e(n),r(au)}handleKeyDown(t){if(e8(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=h$,coordinateGetter:s=_3e,scrollBehavior:l="smooth"}=o,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:au;this.referenceCoordinates||(this.referenceCoordinates=d);const p=s(t,{active:r,context:n.current,currentCoordinates:d});if(p){const v=my(p,d),w={x:0,y:0},{scrollableAncestors:b}=n.current;for(const m of b){const _=t.code,{isTop:k,isRight:A,isLeft:U,isBottom:M,maxScroll:L,minScroll:F}=f$(m),j=g3e(m),ee={x:Math.min(_===Hi.Right?j.right-j.width/2:j.right,Math.max(_===Hi.Right?j.left:j.left+j.width/2,p.x)),y:Math.min(_===Hi.Down?j.bottom-j.height/2:j.bottom,Math.max(_===Hi.Down?j.top:j.top+j.height/2,p.y))},te=_===Hi.Right&&!A||_===Hi.Left&&!U,Z=_===Hi.Down&&!M||_===Hi.Up&&!k;if(te&&ee.x!==p.x){const se=m.scrollLeft+v.x,W=_===Hi.Right&&se<=L.x||_===Hi.Left&&se>=F.x;if(W&&!v.y){m.scrollTo({left:se,behavior:l});return}W?w.x=m.scrollLeft-se:w.x=_===Hi.Right?m.scrollLeft-L.x:m.scrollLeft-F.x,w.x&&m.scrollBy({left:-w.x,behavior:l});break}else if(Z&&ee.y!==p.y){const se=m.scrollTop+v.y,W=_===Hi.Down&&se<=L.y||_===Hi.Up&&se>=F.y;if(W&&!v.x){m.scrollTo({top:se,behavior:l});return}W?w.y=m.scrollTop-se:w.y=_===Hi.Down?m.scrollTop-L.y:m.scrollTop-F.y,w.y&&m.scrollBy({top:-w.y,behavior:l});break}}this.handleMove(t,Mh(my(p,this.referenceCoordinates),w))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}r8.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=h$,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function GB(e){return Boolean(e&&"distance"in e)}function YB(e){return Boolean(e&&"delay"in e)}class n8{constructor(t,r,n){var o;n===void 0&&(n=w3e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Fg(s),this.documentListeners=new b0(this.document),this.listeners=new b0(n),this.windowListeners=new b0($s(s)),this.initialCoordinates=(o=s4(a))!=null?o:au,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(ml.Resize,this.handleCancel),this.windowListeners.add(ml.DragStart,KB),this.windowListeners.add(ml.VisibilityChange,this.handleCancel),this.windowListeners.add(ml.ContextMenu,KB),this.documentListeners.add(ml.Keydown,this.handleKeydown),r){if(GB(r))return;if(YB(r)){this.timeoutId=setTimeout(this.handleStart,r.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(ml.Click,x3e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ml.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const u=(r=s4(t))!=null?r:au,c=my(o,u);if(!n&&l){if(YB(l))return y3(c,l.tolerance)?this.handleCancel():void 0;if(GB(l))return l.tolerance!=null&&y3(c,l.tolerance)?this.handleCancel():y3(c,l.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Hi.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const S3e={move:{name:"pointermove"},end:{name:"pointerup"}};class g$ extends n8{constructor(t){const{event:r}=t,n=Fg(r.target);super(t,S3e,n)}}g$.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const C3e={move:{name:"mousemove"},end:{name:"mouseup"}};var u4;(function(e){e[e.RightClick=2]="RightClick"})(u4||(u4={}));class m$ extends n8{constructor(t){super(t,C3e,Fg(t.event.target))}}m$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===u4.RightClick?!1:(n?.({event:r}),!0)}}];const v3={move:{name:"touchmove"},end:{name:"touchend"}};class y$ extends n8{constructor(t){super(t,v3)}static setup(){return window.addEventListener(v3.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(v3.move.name,t)};function t(){}}}y$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var w0;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(w0||(w0={}));var Zb;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zb||(Zb={}));function k3e(e){let{acceleration:t,activator:r=w0.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:s=5,order:l=Zb.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:v}=e;const w=A3e({delta:p,disabled:!a}),[b,m]=U5e(),_=J.exports.useRef({x:0,y:0}),k=J.exports.useRef({x:0,y:0}),A=J.exports.useMemo(()=>{switch(r){case w0.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case w0.DraggableRect:return o}},[r,o,u]),U=J.exports.useRef(null),M=J.exports.useCallback(()=>{const F=U.current;if(!F)return;const j=_.current.x*k.current.x,ee=_.current.y*k.current.y;F.scrollBy(j,ee)},[]),L=J.exports.useMemo(()=>l===Zb.TreeOrder?[...c].reverse():c,[l,c]);J.exports.useEffect(()=>{if(!a||!c.length||!A){m();return}for(const F of L){if(n?.(F)===!1)continue;const j=c.indexOf(F),ee=d[j];if(!ee)continue;const{direction:te,speed:Z}=h3e(F,ee,A,t,v);for(const se of["x","y"])w[se][te[se]]||(Z[se]=0,te[se]=0);if(Z.x>0||Z.y>0){m(),U.current=F,b(M,s),_.current=Z,k.current=te;return}}_.current={x:0,y:0},k.current={x:0,y:0},m()},[t,M,n,m,a,s,JSON.stringify(A),JSON.stringify(w),b,c,L,d,JSON.stringify(v)])}const E3e={x:{[Oa.Backward]:!1,[Oa.Forward]:!1},y:{[Oa.Backward]:!1,[Oa.Forward]:!1}};function A3e(e){let{delta:t,disabled:r}=e;const n=a4(t);return Yy(o=>{if(r||!n||!o)return E3e;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Oa.Backward]:o.x[Oa.Backward]||a.x===-1,[Oa.Forward]:o.x[Oa.Forward]||a.x===1},y:{[Oa.Backward]:o.y[Oa.Backward]||a.y===-1,[Oa.Forward]:o.y[Oa.Forward]||a.y===1}}},[r,t,n])}function T3e(e,t){const r=t!==null?e.get(t):void 0,n=r?r.node.current:null;return Yy(o=>{var a;return t===null?null:(a=n??o)!=null?a:null},[n,t])}function I3e(e,t){return J.exports.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...a]},[]),[e,t])}var vy;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vy||(vy={}));var c4;(function(e){e.Optimized="optimized"})(c4||(c4={}));const QB=new Map;function R3e(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,s]=J.exports.useState(null),{frequency:l,measure:u,strategy:c}=o,d=J.exports.useRef(e),p=_(),v=gy(p),w=J.exports.useCallback(function(k){k===void 0&&(k=[]),!v.current&&s(A=>A===null?k:A.concat(k.filter(U=>!A.includes(U))))},[v]),b=J.exports.useRef(null),m=Yy(k=>{if(p&&!r)return QB;if(!k||k===QB||d.current!==e||a!=null){const A=new Map;for(let U of e){if(!U)continue;if(a&&a.length>0&&!a.includes(U.id)&&U.rect.current){A.set(U.id,U.rect.current);continue}const M=U.node.current,L=M?new t8(u(M),M):null;U.rect.current=L,L&&A.set(U.id,L)}return A}return k},[e,a,r,p,u]);return J.exports.useEffect(()=>{d.current=e},[e]),J.exports.useEffect(()=>{p||w()},[r,p]),J.exports.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),J.exports.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{w(),b.current=null},l))},[l,p,w,...n]),{droppableRects:m,measureDroppableContainers:w,measuringScheduled:a!=null};function _(){switch(c){case vy.Always:return!1;case vy.BeforeDragging:return r;default:return!r}}}function v$(e,t){return Yy(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function P3e(e,t){return v$(e,t)}function M3e(e){let{callback:t,disabled:r}=e;const n=JE(t),o=J.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return J.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function u_(e){let{callback:t,disabled:r}=e;const n=JE(t),o=J.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return J.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function B3e(e){return new t8($g(e),e)}function ZB(e,t,r){t===void 0&&(t=B3e);const[n,o]=J.exports.useReducer(l,null),a=M3e({callback(u){if(!!e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),s=u_({callback:o});return ou(()=>{o(),e?(s?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),a?.disconnect())},[e]),n;function l(u){if(!e)return null;if(e.isConnected===!1){var c;return(c=u??r)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d}}function O3e(e){const t=v$(e);return s$(e,t)}const XB=[];function U3e(e){const t=J.exports.useRef(e),r=Yy(n=>e?n&&n!==XB&&e&&t.current&&e.parentNode===t.current.parentNode?n:l_(e):XB,[e]);return J.exports.useEffect(()=>{t.current=e},[e]),r}function L3e(e){const[t,r]=J.exports.useState(null),n=J.exports.useRef(e),o=J.exports.useCallback(a=>{const s=m3(a.target);!s||r(l=>l?(l.set(s,l4(s)),new Map(l)):null)},[]);return J.exports.useEffect(()=>{const a=n.current;if(e!==a){s(a);const l=e.map(u=>{const c=m3(u);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,l4(c)]):null}).filter(u=>u!=null);r(l.length?new Map(l):null),n.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(u=>{const c=m3(u);c?.removeEventListener("scroll",o)})}},[o,e]),J.exports.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Mh(a,s),au):p$(e):au,[e,t])}function JB(e,t){t===void 0&&(t=[]);const r=J.exports.useRef(null);return J.exports.useEffect(()=>{r.current=null},t),J.exports.useEffect(()=>{const n=e!==au;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?my(e,r.current):au}function D3e(e){J.exports.useEffect(()=>{if(!s_)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function N3e(e,t){return J.exports.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function b$(e){return J.exports.useMemo(()=>e?c3e(e):null,[e])}const b3=[];function j3e(e,t){t===void 0&&(t=$g);const[r]=e,n=b$(r?$s(r):null),[o,a]=J.exports.useReducer(l,b3),s=u_({callback:a});return e.length>0&&o===b3&&a(),ou(()=>{e.length?e.forEach(u=>s?.observe(u)):(s?.disconnect(),a())},[e]),o;function l(){return e.length?e.map(u=>d$(u)?n:new t8(t(u),u)):b3}}function F3e(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Gy(t)?t:e}function $3e(e){let{measure:t}=e;const[r,n]=J.exports.useState(null),o=J.exports.useCallback(c=>{for(const{target:d}of c)if(Gy(d)){n(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),a=u_({callback:o}),s=J.exports.useCallback(c=>{const d=F3e(c);a?.disconnect(),d&&a?.observe(d),n(d?t(d):null)},[t,a]),[l,u]=Yb(s);return J.exports.useMemo(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const z3e=[{sensor:g$,options:{}},{sensor:r8,options:{}}],H3e={current:{}},I1={draggable:{measure:qB},droppable:{measure:qB,strategy:vy.WhileDragging,frequency:c4.Optimized},dragOverlay:{measure:$g}};class x0 extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const W3e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new x0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:I1,measureDroppableContainers:Qb,windowRect:null,measuringScheduled:!1},V3e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qb,draggableNodes:new Map,over:null,measureDroppableContainers:Qb},c_=J.exports.createContext(V3e),w$=J.exports.createContext(W3e);function q3e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new x0}}}function K3e(e,t){switch(t.type){case _a.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _a.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case _a.DragEnd:case _a.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _a.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new x0(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case _a.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const s=new x0(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case _a.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new x0(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function G3e(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=J.exports.useContext(c_),a=a4(n),s=a4(r?.id);return J.exports.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!e8(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=N5e(d);if(p){p.focus();break}}})}},[n,t,o,s,a]),null}function Y3e(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function Q3e(e){return J.exports.useMemo(()=>({draggable:{...I1.draggable,...e?.draggable},droppable:{...I1.droppable,...e?.droppable},dragOverlay:{...I1.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Z3e(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=J.exports.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;ou(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!n)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=r(c),p=s$(d,n);if(s||(p.x=0),l||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=l$(c);v&&v.scrollBy({top:p.y,left:p.x})}},[t,s,l,n,r])}const x$=J.exports.createContext({...au,scaleX:1,scaleY:1});var Jc;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Jc||(Jc={}));const X3e=J.exports.memo(function(t){var r,n,o,a;let{id:s,accessibility:l,autoScroll:u=!0,children:c,sensors:d=z3e,collisionDetection:p=n3e,measuring:v,modifiers:w,...b}=t;const m=J.exports.useReducer(K3e,void 0,q3e),[_,k]=m,[A,U]=G5e(),[M,L]=J.exports.useState(Jc.Uninitialized),F=M===Jc.Initialized,{draggable:{active:j,nodes:ee,translate:te},droppable:{containers:Z}}=_,se=j?ee.get(j):null,W=J.exports.useRef({initial:null,translated:null}),q=J.exports.useMemo(()=>{var Tn;return j!=null?{id:j,data:(Tn=se?.data)!=null?Tn:H3e,rect:W}:null},[j,se]),C=J.exports.useRef(null),[G,le]=J.exports.useState(null),[pe,be]=J.exports.useState(null),Q=gy(b,Object.values(b)),lt=Qy("DndDescribedBy",s),Le=J.exports.useMemo(()=>Z.getEnabled(),[Z]),$e=Q3e(v),{droppableRects:ir,measureDroppableContainers:Ut,measuringScheduled:Pt}=R3e(Le,{dragging:F,dependencies:[te.x,te.y],config:$e.droppable}),er=T3e(ee,j),br=J.exports.useMemo(()=>pe?s4(pe):null,[pe]),Tt=Kn(),Et=P3e(er,$e.draggable.measure);Z3e({activeNode:j?ee.get(j):null,config:Tt.layoutShiftCompensation,initialRect:Et,measure:$e.draggable.measure});const kt=ZB(er,$e.draggable.measure,Et),Nt=ZB(er?er.parentElement:null),Gt=J.exports.useRef({activatorEvent:null,active:null,activeNode:er,collisionRect:null,collisions:null,droppableRects:ir,draggableNodes:ee,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),vr=Z.getNodeFor((r=Gt.current.over)==null?void 0:r.id),ie=$3e({measure:$e.dragOverlay.measure}),Bt=(n=ie.nodeRef.current)!=null?n:er,jt=F?(o=ie.rect)!=null?o:kt:null,Ie=Boolean(ie.nodeRef.current&&ie.rect),Ae=O3e(Ie?null:kt),fe=b$(Bt?$s(Bt):null),Oe=U3e(F?vr??er:null),rt=j3e(Oe),ut=Y3e(w,{transform:{x:te.x-Ae.x,y:te.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:pe,active:q,activeNodeRect:kt,containerNodeRect:Nt,draggingNodeRect:jt,over:Gt.current.over,overlayNodeRect:ie.rect,scrollableAncestors:Oe,scrollableAncestorRects:rt,windowRect:fe}),Ft=br?Mh(br,te):null,ce=L3e(Oe),oe=JB(ce),de=JB(ce,[kt]),$=Mh(ut,oe),E=jt?a3e(jt,ut):null,I=q&&E?p({active:q,collisionRect:E,droppableRects:ir,droppableContainers:Le,pointerCoordinates:Ft}):null,Y=a$(I,"id"),[ve,je]=J.exports.useState(null),dt=Ie?ut:Mh(ut,de),cr=i3e(dt,(a=ve?.rect)!=null?a:null,kt),Lr=J.exports.useCallback((Tn,In)=>{let{sensor:yt,options:Ai}=In;if(C.current==null)return;const Qn=ee.get(C.current);if(!Qn)return;const Mi=Tn.nativeEvent,ro=new yt({active:C.current,activeNode:Qn,event:Mi,options:Ai,context:Gt,onStart(no){const Bo=C.current;if(Bo==null)return;const Vi=ee.get(Bo);if(!Vi)return;const{onDragStart:ha}=Q.current,ue={active:{id:Bo,data:Vi.data,rect:W}};bl.exports.unstable_batchedUpdates(()=>{ha?.(ue),L(Jc.Initializing),k({type:_a.DragStart,initialCoordinates:no,active:Bo}),A({type:"onDragStart",event:ue})})},onMove(no){k({type:_a.DragMove,coordinates:no})},onEnd:Ko(_a.DragEnd),onCancel:Ko(_a.DragCancel)});bl.exports.unstable_batchedUpdates(()=>{le(ro),be(Tn.nativeEvent)});function Ko(no){return async function(){const{active:Vi,collisions:ha,over:ue,scrollAdjustedTranslate:Re}=Gt.current;let Ee=null;if(Vi&&Re){const{cancelDrop:H}=Q.current;Ee={activatorEvent:Mi,active:Vi,collisions:ha,delta:Re,over:ue},no===_a.DragEnd&&typeof H=="function"&&await Promise.resolve(H(Ee))&&(no=_a.DragCancel)}C.current=null,bl.exports.unstable_batchedUpdates(()=>{k({type:no}),L(Jc.Uninitialized),je(null),le(null),be(null);const H=no===_a.DragEnd?"onDragEnd":"onDragCancel";if(Ee){const ze=Q.current[H];ze?.(Ee),A({type:H,event:Ee})}})}}},[ee]),gr=J.exports.useCallback((Tn,In)=>(yt,Ai)=>{const Qn=yt.nativeEvent,Mi=ee.get(Ai);if(C.current!==null||!Mi||Qn.dndKit||Qn.defaultPrevented)return;const ro={active:Mi};Tn(yt,In.options,ro)===!0&&(Qn.dndKit={capturedBy:In.sensor},C.current=Ai,Lr(yt,In))},[ee,Lr]),Rr=I3e(d,gr);D3e(d),ou(()=>{kt&&M===Jc.Initializing&&L(Jc.Initialized)},[kt,M]),J.exports.useEffect(()=>{const{onDragMove:Tn}=Q.current,{active:In,activatorEvent:yt,collisions:Ai,over:Qn}=Gt.current;if(!In||!yt)return;const Mi={active:In,activatorEvent:yt,collisions:Ai,delta:{x:$.x,y:$.y},over:Qn};bl.exports.unstable_batchedUpdates(()=>{Tn?.(Mi),A({type:"onDragMove",event:Mi})})},[$.x,$.y]),J.exports.useEffect(()=>{const{active:Tn,activatorEvent:In,collisions:yt,droppableContainers:Ai,scrollAdjustedTranslate:Qn}=Gt.current;if(!Tn||C.current==null||!In||!Qn)return;const{onDragOver:Mi}=Q.current,ro=Ai.get(Y),Ko=ro&&ro.rect.current?{id:ro.id,rect:ro.rect.current,data:ro.data,disabled:ro.disabled}:null,no={active:Tn,activatorEvent:In,collisions:yt,delta:{x:Qn.x,y:Qn.y},over:Ko};bl.exports.unstable_batchedUpdates(()=>{je(Ko),Mi?.(no),A({type:"onDragOver",event:no})})},[Y]),ou(()=>{Gt.current={activatorEvent:pe,active:q,activeNode:er,collisionRect:E,collisions:I,droppableRects:ir,draggableNodes:ee,draggingNode:Bt,draggingNodeRect:jt,droppableContainers:Z,over:ve,scrollableAncestors:Oe,scrollAdjustedTranslate:$},W.current={initial:jt,translated:E}},[q,er,I,E,ee,Bt,jt,ir,Z,ve,Oe,$]),k3e({...Tt,delta:te,draggingRect:E,pointerCoordinates:Ft,scrollableAncestors:Oe,scrollableAncestorRects:rt});const Gr=J.exports.useMemo(()=>({active:q,activeNode:er,activeNodeRect:kt,activatorEvent:pe,collisions:I,containerNodeRect:Nt,dragOverlay:ie,draggableNodes:ee,droppableContainers:Z,droppableRects:ir,over:ve,measureDroppableContainers:Ut,scrollableAncestors:Oe,scrollableAncestorRects:rt,measuringConfiguration:$e,measuringScheduled:Pt,windowRect:fe}),[q,er,kt,pe,I,Nt,ie,ee,Z,ir,ve,Ut,Oe,rt,$e,Pt,fe]),Nr=J.exports.useMemo(()=>({activatorEvent:pe,activators:Rr,active:q,activeNodeRect:kt,ariaDescribedById:{draggable:lt},dispatch:k,draggableNodes:ee,over:ve,measureDroppableContainers:Ut}),[pe,Rr,q,kt,k,lt,ee,ve,Ut]);return Lt(n$.Provider,{value:U,children:[Lt(c_.Provider,{value:Nr,children:[D(w$.Provider,{value:Gr,children:D(x$.Provider,{value:cr,children:c})}),D(G3e,{disabled:l?.restoreFocus===!1})]}),D(Z5e,{...l,hiddenTextDescribedById:lt})]});function Kn(){const Tn=G?.autoScrollEnabled===!1,In=typeof u=="object"?u.enabled===!1:u===!1,yt=F&&!Tn&&!In;return typeof u=="object"?{...u,enabled:yt}:{enabled:yt}}}),J3e=J.exports.createContext(null),eO="button",eSe="Droppable";function tSe(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=Qy(eSe),{activators:s,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:v}=J.exports.useContext(c_),{role:w=eO,roleDescription:b="draggable",tabIndex:m=0}=o??{},_=u?.id===t,k=J.exports.useContext(_?x$:J3e),[A,U]=Yb(),[M,L]=Yb(),F=N3e(s,t),j=gy(r);ou(()=>(p.set(t,{id:t,key:a,node:A,activatorNode:M,data:j}),()=>{const te=p.get(t);te&&te.key===a&&p.delete(t)}),[p,t]);const ee=J.exports.useMemo(()=>({role:w,tabIndex:m,"aria-disabled":n,"aria-pressed":_&&w===eO?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,w,m,_,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:ee,isDragging:_,listeners:n?void 0:F,node:A,over:v,setNodeRef:U,setActivatorNodeRef:L,transform:k}}function rSe(){return J.exports.useContext(w$)}const nSe="Droppable",iSe={timeout:25};function oSe(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=Qy(nSe),{active:s,dispatch:l,over:u,measureDroppableContainers:c}=J.exports.useContext(c_),d=J.exports.useRef({disabled:r}),p=J.exports.useRef(!1),v=J.exports.useRef(null),w=J.exports.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:_}={...iSe,...o},k=gy(m??n),A=J.exports.useCallback(()=>{if(!p.current){p.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{c(Array.isArray(k.current)?k.current:[k.current]),w.current=null},_)},[_]),U=u_({callback:A,disabled:b||!s}),M=J.exports.useCallback((ee,te)=>{!U||(te&&(U.unobserve(te),p.current=!1),ee&&U.observe(ee))},[U]),[L,F]=Yb(M),j=gy(t);return J.exports.useEffect(()=>{!U||!L.current||(U.disconnect(),p.current=!1,U.observe(L.current))},[L,U]),ou(()=>(l({type:_a.RegisterDroppable,element:{id:n,key:a,disabled:r,node:L,rect:v,data:j}}),()=>l({type:_a.UnregisterDroppable,key:a,id:n})),[n]),J.exports.useEffect(()=>{r!==d.current.disabled&&(l({type:_a.SetDroppableDisabled,id:n,key:a,disabled:r}),d.current.disabled=r)},[n,a,r,l]),{active:s,rect:v,isOver:u?.id===n,node:L,over:u,setNodeRef:F}}function _$(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function aSe(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function e1(e){return e!==null&&e>=0}function sSe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=_$(t,n,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},t1={scaleX:1,scaleY:1},uSe=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:a,overIndex:s}=e;const l=(t=a[r])!=null?t:n;if(!l)return null;if(o===r){const c=a[s];return c?{x:0,y:rr&&o<=s?{x:0,y:-l.height-u,...t1}:o=s?{x:0,y:l.height+u,...t1}:{x:0,y:0,...t1}};function cSe(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return n?rn.map(F=>typeof F=="object"&&"id"in F?F.id:F),[n]),b=s!=null,m=s?w.indexOf(s.id):-1,_=c?w.indexOf(c.id):-1,k=J.exports.useRef(w),A=!sSe(w,k.current),U=_!==-1&&m===-1||A,M=lSe(a);ou(()=>{A&&b&&d(w)},[A,w,b,d]),J.exports.useEffect(()=>{k.current=w},[w]);const L=J.exports.useMemo(()=>({activeIndex:m,containerId:p,disabled:M,disableTransforms:U,items:w,overIndex:_,useDragOverlay:v,sortedRects:aSe(w,u),strategy:o}),[m,p,M.draggable,M.droppable,U,w,_,u,v,o]);return D(k$.Provider,{value:L,children:t})}const fSe=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return _$(r,n,o).indexOf(t)},pSe=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:u,transition:c}=e;return!c||!n||l!==a&&o===s?!1:r?!0:s!==o&&t===u},hSe={duration:200,easing:"ease"},E$="transform",gSe=yy.Transition.toString({property:E$,duration:0,easing:"linear"}),mSe={roleDescription:"sortable"};function ySe(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,s]=J.exports.useState(null),l=J.exports.useRef(r);return ou(()=>{if(!t&&r!==l.current&&n.current){const u=o.current;if(u){const c=$g(n.current,{ignoreTransform:!0}),d={x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height};(d.x||d.y)&&s(d)}}r!==l.current&&(l.current=r)},[t,r,n,o]),J.exports.useEffect(()=>{a&&s(null)},[a]),a}function A$(e){let{animateLayoutChanges:t=pSe,attributes:r,disabled:n,data:o,getNewIndex:a=fSe,id:s,strategy:l,resizeObserverConfig:u,transition:c=hSe}=e;const{items:d,containerId:p,activeIndex:v,disabled:w,disableTransforms:b,sortedRects:m,overIndex:_,useDragOverlay:k,strategy:A}=J.exports.useContext(k$),U=vSe(n,w),M=d.indexOf(s),L=J.exports.useMemo(()=>({sortable:{containerId:p,index:M,items:d},...o}),[p,o,M,d]),F=J.exports.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:j,node:ee,isOver:te,setNodeRef:Z}=oSe({id:s,data:L,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...u}}),{active:se,activatorEvent:W,activeNodeRect:q,attributes:C,setNodeRef:G,listeners:le,isDragging:pe,over:be,setActivatorNodeRef:Q,transform:lt}=tSe({id:s,data:L,attributes:{...mSe,...r},disabled:U.draggable}),Le=B5e(Z,G),$e=Boolean(se),ir=$e&&!b&&e1(v)&&e1(_),Ut=!k&&pe,Pt=Ut&&ir?lt:null,br=ir?Pt??(l??A)({rects:m,activeNodeRect:q,activeIndex:v,overIndex:_,index:M}):null,Tt=e1(v)&&e1(_)?a({id:s,items:d,activeIndex:v,overIndex:_}):M,Et=se?.id,kt=J.exports.useRef({activeId:Et,items:d,newIndex:Tt,containerId:p}),Nt=d!==kt.current.items,Gt=t({active:se,containerId:p,isDragging:pe,isSorting:$e,id:s,index:M,items:d,newIndex:kt.current.newIndex,previousItems:kt.current.items,previousContainerId:kt.current.containerId,transition:c,wasDragging:kt.current.activeId!=null}),vr=ySe({disabled:!Gt,index:M,node:ee,rect:j});return J.exports.useEffect(()=>{$e&&kt.current.newIndex!==Tt&&(kt.current.newIndex=Tt),p!==kt.current.containerId&&(kt.current.containerId=p),d!==kt.current.items&&(kt.current.items=d)},[$e,Tt,p,d]),J.exports.useEffect(()=>{if(Et===kt.current.activeId)return;if(Et&&!kt.current.activeId){kt.current.activeId=Et;return}const Bt=setTimeout(()=>{kt.current.activeId=Et},50);return()=>clearTimeout(Bt)},[Et]),{active:se,activeIndex:v,attributes:C,data:L,rect:j,index:M,newIndex:Tt,items:d,isOver:te,isSorting:$e,isDragging:pe,listeners:le,node:ee,overIndex:_,over:be,setNodeRef:Le,setActivatorNodeRef:Q,setDroppableNodeRef:Z,setDraggableNodeRef:G,transform:vr??br,transition:ie()};function ie(){if(vr||Nt&&kt.current.newIndex===M)return gSe;if(!(Ut&&!e8(W)||!c)&&($e||Gt))return yy.Transition.toString({...c,property:E$})}}function vSe(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function Xb(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const bSe=[Hi.Down,Hi.Right,Hi.Up,Hi.Left],wSe=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(bSe.includes(e.code)){if(e.preventDefault(),!r||!n)return;const u=[];a.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const v=o.get(p.id);if(!!v)switch(e.code){case Hi.Down:n.topv.top&&u.push(p);break;case Hi.Left:n.left>v.left&&u.push(p);break;case Hi.Right:n.left1&&(d=c[1].id),d!=null){const p=a.get(r.id),v=a.get(d),w=v?o.get(v.id):null,b=v?.node.current;if(b&&w&&p&&v){const _=l_(b).some((F,j)=>l[j]!==F),k=T$(p,v),A=xSe(p,v),U=_||!k?{x:0,y:0}:{x:A?n.width-w.width:0,y:A?n.height-w.height:0},M={x:w.left,y:w.top};return U.x&&U.y?M:my(M,U)}}}};function T$(e,t){return!Xb(e)||!Xb(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function xSe(e,t){return!Xb(e)||!Xb(t)||!T$(e,t)?!1:e.data.current.sortable.indext(!0),o=()=>t(!1);return J.exports.useEffect(()=>{const a=r.current;if(a)return a.addEventListener("mouseover",n),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",n),a.removeEventListener("mouseout",o)}},[r.current]),{hoverRef:r,isHover:e}}const SSe="/assets/delete.42fb1897.svg",CSe="/assets/dnd.dcf4594c.svg",kSe=to("input")({display:"flex",alignItems:"center",width:300,height:44,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",paddingLeft:10,outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),is=to(sk)({border:"none",padding:0}),th=to(sk)({fontWeight:700}),Kl=to("hr")({display:"block",width:"100%",height:1,backgroundColor:"#ccc",border:"none"}),ESe=e=>e.replace(/\/+/g,"/").replace(/^\/[^\/]/,"").replace(/\/$/,"");function tO({file:e,pos:t,isHover:r}){const n=e.fileObj.name,{attributes:o,listeners:a}=A$({id:n}),s=ua(),l=sa(s.breakpoints.down("lg")),{setInclueInCommand:u,setDirectory:c,removeFile:d}=Gu(),{data:p}=Yu(),v=!!p?.result?.msgCell;return Lt(ra,{children:[D(is,{sx:{paddingLeft:1},...o,...a,children:Lt(Fn,{sx:{color:"#D8D8D8"},children:[t,".",D(Fn,{ml:5,style:{cursor:"pointer",visibility:r?"visible":"hidden"},children:D("img",{src:CSe,alt:"Drag n drop icon",width:24,height:24})})]})}),D(is,{children:D(kSe,{disabled:v,value:e.folder,onBlur:w=>{c(n,ESe(w.target.value))},onChange:w=>{c(n,w.target.value)}})}),D(is,{sx:{paddingLeft:l?2:0},children:Lt(Fn,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"flex-start"},children:[D(Fo,{sx:{fontSize:14},children:e.fileObj.name}),Lt(Fo,{sx:{fontSize:12,color:"#C1C1C1"},children:[e.fileObj.size," bytes"]})]})}),D(is,{children:D(bae,{disabled:v,checked:e.includeInCommand,onChange:w=>{u(n,w.target.checked)}})}),D(is,{align:"right",children:D(js,{sx:{visibility:r?"visible":"hidden",opacity:.5,cursor:"pointer",marginRight:1},onClick:()=>{d(n)},children:D("img",{src:SSe,alt:"Delete icon",width:18,height:18})})})]})}function ASe({file:e,pos:t}){const r=e.fileObj.name,{hoverRef:n,isHover:o}=_Se(),{data:a}=Yu(),s=!!a?.result?.msgCell,{setNodeRef:l,transform:u,transition:c,isDragging:d}=A$({id:r}),p={transform:yy.Transform.toString(u),transition:c};return s?D(Ec,{sx:{height:60},children:D(tO,{file:e,pos:t,isDragging:!1,isHover:!1})}):D(Ec,{sx:{height:60,transition:".15s all","&:hover":{background:"#FAFAFA"}},ref:v=>{l(v),n.current=v},style:p,children:D(tO,{file:e,pos:t,isDragging:d,isHover:o})},r)}function TSe(){const{files:e,reorderFiles:t}=Gu(),{data:r}=Yu(),n=ua(),o=sa(n.breakpoints.down("lg")),a=!!r?.result?.msgCell,s=X5e(g3(m$,{}),g3(y$,{}),g3(r8,{coordinateGetter:wSe}));function l(u){const{active:c,over:d}=u;c.id!==d.id&&t(c.id,d.id)}return D(X3e,{sensors:s,collisionDetection:e3e,onDragEnd:l,modifiers:[$5e,F5e],children:D(Zae,{children:Lt(ok,{sx:{minWidth:650},children:[Lt(vL,{sx:{"&.MuiTableHead-root th":{border:"none"}},children:[Lt(Ec,{sx:{fontWeight:700},children:[D(th,{sx:{paddingLeft:0,paddingBottom:o?0:2,width:100},children:"Order"}),D(th,{sx:{paddingLeft:0,paddingBottom:o?0:2},children:"Directory"}),D(th,{sx:{paddingLeft:o?2:0,width:300,paddingBottom:o?0:2},children:"File"}),D(th,{sx:{paddingLeft:0,width:150,paddingBottom:o?0:2},children:"Include in command"}),D(th,{sx:{paddingLeft:0,width:100,paddingBottom:o?0:2}})]}),Lt(Ec,{children:[D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})})]})]}),D(ak,{children:D(dSe,{disabled:a,items:e.map(u=>u.fileObj.name),strategy:uSe,children:e.map((u,c)=>D(ASe,{file:u,pos:c+1},u.fileObj.name))})})]})})})}const w3=to(tL)({flexGrow:1}),x3=to(gL)(({theme:e})=>({borderRadius:e.spacing(1.2),height:e.spacing(5.3),minWidth:150,".MuiOutlinedInput-notchedOutline":{border:"1px solid #D8D8D8"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"1px solid #807e7e"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #b0b0b0"}})),r1=to(rL)(({theme:e})=>({color:"#000",fontSize:12,marginLeft:e.spacing(1),marginBottom:e.spacing(1)})),ISe=to("input")(({theme:e})=>({display:"flex",alignItems:"center",boxSizing:"border-box",width:"100%",flex:2,height:e.spacing(5.3),borderRadius:e.spacing(1.2),border:"1px solid #D8D8D8",outline:"none",padding:"0 40px 0 125px",color:"#000",background:"transparent",fontFamily:"Mulish",fontSize:14,"&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}})),RSe="/assets/undo.944d3e45.svg";function PSe(){const{compilerSettings:e,setOverrideCommandLine:t,setFuncCliVersion:r,setTactCliVersion:n,compiler:o,setCompiler:a}=OE(),{data:s}=Yu(),l=ua(),u=sa(l.breakpoints.down("md")),c=!!s?.result?.msgCell,{data:{funcVersions:d,tactVersions:p}}=BE();return Lt(fa,{mt:4,children:[D(Fo,{variant:"h5",style:{fontWeight:800,fontSize:16,marginBottom:16},children:"Compiler"}),Lt(Fn,{sx:{gap:1,alignItems:u?"center":"flex-end",flexDirection:u?"column":"inherit"},children:[D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{children:[D(r1,{children:"Compiler"}),Lt(x3,{value:o,onChange:v=>{a(v.target.value)},children:[D(dm,{value:"func",children:"func"}),D(dm,{value:"tact",children:"tact"}),{}.VITE_ALLOW_FIFT&&D(dm,{value:"fift",children:"fift"})]})]})}),o==="func"&&Lt(ra,{children:[D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{disabled:c,children:[D(r1,{children:"Version"}),D(x3,{value:e.funcVersion,onChange:v=>{r(v.target.value)},children:d?.map(v=>D(dm,{value:v,children:v},v))})]})}),Lt(fa,{sx:{width:"100%",position:"relative"},children:[D(r1,{sx:{display:"block"},children:"Func command"}),D(ISe,{disabled:c,value:e.commandLine,onChange:v=>{t(v.target.value)}}),D(Fte,{sx:{position:"absolute",left:3,top:28,height:37,background:"#F5F5F5",borderRadius:1.5,color:"#000",fontSize:14},label:"func -o tmp.fif"}),!!e.overrideCommandLine&&D(js,{sx:{color:"blue",position:"absolute",right:10,top:31},onClick:()=>{t(null)},children:D("img",{src:RSe,alt:"Undo icon",width:15,height:15})})]})]}),o==="tact"&&D(ra,{children:D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{disabled:c,children:[D(r1,{children:"Version"}),D(x3,{value:e.tactVersion,disabled:!0,children:p?.map(v=>D(dm,{value:v,children:v},v))})]})})})]})]})}const MSe="/assets/reorder-hint.5f3a54fb.svg",BSe="/assets/light-bulb.7768be40.svg",I$="/assets/like.af7e7b33.svg",OSe=lr(kn)({maxWidth:1160,width:"calc(100% - 50px)",margin:"auto"}),USe=lr(kn)({display:"flex",justifyContent:"space-between",height:73}),LSe=lr(kn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(1.5)})),DSe=lr(kn)(({theme:e})=>({display:"flex",flexWrap:"wrap",justifyContent:"space-between",marginTop:e.spacing(3),marginBottom:e.spacing(2),color:"#728A96",fontSize:14,[e.breakpoints.down("md")]:{"& > *":{marginBottom:`${e.spacing(1)} !important`}}})),NSe=lr("hr")({height:"1px",backgroundColor:"#e6e6e6",border:"none"}),rO=lr(hc)(({theme:e})=>({display:"inline-flex",alignItems:"center",color:"inherit",textDecoration:"none",[e.breakpoints.down("md")]:{justifyContent:"flex-end"}})),Zy=lr(kn)({display:"flex",justifyContent:"center",alignItems:"center"}),jSe=lr(Zy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"100%",flex:2,order:3}})),R$=lr(Zy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"50%"}})),FSe=lr(R$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"start"},[e.breakpoints.down("sm")]:{minWidth:100}})),$Se=lr(R$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"end"},[e.breakpoints.down("sm")]:{minWidth:100}})),zSe="/assets/heart.52fe96d0.svg",HSe="/assets/orbs.eb35e74b.svg",WSe="/assets/telegram.bcba2ca3.svg",VSe="/assets/telegram-hover.72b9d3ce.svg",qSe="/assets/github-footer.0bd3bbab.svg",KSe="/assets/github-hover.33daf3ef.svg",nO=lr(kn)(e=>({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",width:t.spacing(3),height:t.spacing(3),background:`url(${e.iconUrl})`,"&:hover":{transitionDuration:".25s",background:`url(${e.disabled?e.iconUrl:e.hoveredIconUrl})`,cursor:e.disabled?"cursor":"pointer"}})),iO=({iconUrl:e,hoveredIconUrl:t,link:r})=>r.length?D(hc,{target:"_blank",href:r,children:D(nO,{iconUrl:e,hoveredIconUrl:t})}):D(nO,{iconUrl:e,hoveredIconUrl:t,disabled:!0});function P$(){const e=v6(),[t,r]=Iw();return()=>{t.has("testnet")?t.delete("testnet"):t.append("testnet",""),r(t),e(0)}}function i8(){const e=P$();return D(kn,{sx:{background:"red",color:"white",py:2},children:Lt(WE,{sx:{gap:4,px:4},children:[D(Fo,{sx:{fontWeight:"bold",flexGrow:1},children:"Testnet"}),D(Fo,{onClick:()=>{e()},sx:{cursor:"pointer"},children:"Switch to mainnet"})]})})}const d4="https://t.me/tonverifier";function Jb(){const e=sa("(max-width: 450px)"),t=Mc(),r=P$();return Lt(OSe,{children:[Lt(USe,{mb:e?5:"inherit",sx:{flexDirection:e?"column":"inherit",alignItems:e?"center":"inherit"},children:[D(Fn,{children:Lt(mp,{sx:{color:"#000"},onClick:()=>t("/"),children:[D("img",{src:Rw,alt:"App icon",width:30,height:30}),D(kx,{children:"TON VERIFIER"})]})}),Lt(LSe,{children:[D(iO,{iconUrl:WSe,hoveredIconUrl:VSe,link:d4}),D(iO,{iconUrl:qSe,hoveredIconUrl:KSe,link:"https://github.com/orbs-network/ton-contract-verifier"})]})]}),D(NSe,{}),Lt(DSe,{children:[D(FSe,{children:D(Fo,{variant:"body2",children:"\xA9 2023"})}),D(jSe,{children:Lt(Fn,{sx:{gap:.1},children:["Contributed with",D(Fn,{mx:.4,children:D("img",{src:zSe,alt:"Heart",width:12,height:12})}),"by",D(Fn,{mx:.4,children:D("img",{src:HSe,alt:"Orbs logo",width:12,height:12})}),D(rO,{sx:{color:"#5E75E8"},target:"_blank",href:"https://orbs.com/powered-by",children:"Orbs"})]})}),Lt($Se,{children:[D(rO,{target:"_blank",href:d4,children:D(Fo,{variant:"body2",children:"Support"})}),!window.isTestnet&&D(Fo,{onClick:()=>{r()},sx:{ml:2,cursor:"pointer"},variant:"body2",children:"Switch to Testnet"})]})]})]})}const GSe=lr("li")({maxWidth:650,fontSize:14,fontWeight:400,marginBottom:10});function YSe(e,t){switch(e){case Fa.ENTRYPOINT_MISSING:return"There usually should be at least one file containing an entrypoint (recv_internal, main)";case Fa.STDLIB_ORDER:return"stdlib.fc should usually be the first file in the list (unless it's imported from another file)";case Fa.STDLIB_MISSING:return"You can try to add stdlib.fc to your sources.";case Fa.NOT_SIMILAR:return"Source code compiles correctly but does not match the on-chain contract hash. Make sure you are using the correct compiler version, command line and file order.";case Fa.FILE_ORDER:return"Make sure all files in the command line are in the correct order";case Fa.COMPILER_VERSION:return"Try to use the same compiler version as the contract was compiled with";case Fa.REQUIRED_FILES:return"Make sure all required files are included in the command line";case Fa.SUPPORT_GROUP:return Lt("div",{children:["If you are still facing issues, you can use the"," ",D(hc,{target:"_blank",href:d4,sx:{textDecoration:"none",cursor:"pointer"},children:"Telegram support group"})]})}}const QSe=({hint:e})=>{const{data:t}=Yu();return D(GSe,{children:YSe(e,t?.result.compileResult)})},zd=lr(Fo)({fontSize:14,fontWeight:400,marginBottom:"10px"}),oO=lr(Fo)({fontSize:14,fontWeight:700}),M$=lr(Fo)({fontSize:14,fontWeight:400}),aO=lr(Fn)({padding:"20px 30px",paddingLeft:0,"&:hover":{background:"transparent"}}),sO=lr(AF)({minWidth:200,fontSize:14,fontWeight:600}),ZSe=lr(fa)({borderBottom:"1px solid rgba(0, 0, 0, 0.2)"}),lO=lr(TF)({color:"#000",fontSize:14,fontWeight:400});function XSe(){const{data:e,error:t}=Yu(),{data:r}=Ap(),n=e?.result?.compileResult,o=e?.hints??[];return Lt(fa,{my:3,children:[["similar"].includes(n?.result??"")&&D(Is,{singleLine:!0,type:hs.SUCCESS,title:Lt(Fn,{sx:{height:42},children:[D(Fn,{mr:1,children:D("img",{src:I$,alt:"Like icon",width:31,height:31})}),Lt(M$,{children:[" ",D("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:D(fa,{})}),["not_similar"].includes(n?.result??"")&&D(Is,{type:hs.ERROR,title:Lt(Fn,{children:[D(Fn,{mr:1,children:D("img",{src:MSe,alt:"Reorder icon",width:39,height:26})}),D(oO,{children:"Hashes are not similar"})]}),notificationBody:Lt(fa,{sx:{display:"flex",flexDirection:"column"},children:[Lt(aO,{children:[D(sO,{children:"Contract hash"}),D(lO,{children:r?.codeCellHash.base64??"-"})]}),D(ZSe,{}),Lt(aO,{children:[D(sO,{children:"Compile output hash"}),D(lO,{children:n?.hash??"-"})]})]})}),n?.error&&D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:D(fa,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:n.error})})})}),!!t&&D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Server error"]}),notificationBody:D(fa,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:t.toString()})})})}),o.length>0&&D(Is,{type:hs.HINT,title:Lt(Fn,{mb:2,children:[D(Fn,{mr:1,children:D("img",{src:BSe,alt:"Light bulb icon",width:21,height:22})}),D(oO,{children:"Possible reasons for failure"})]}),notificationBody:D("ul",{style:{paddingLeft:25},children:o.map(a=>D(QSe,{hint:a},a))})})]})}function B$(){const[e]=Og();return D(Va,{background:"#1976d2",hoverBackground:"#156cc2",height:37,fontSize:14,fontWeight:700,textColor:"#fff",type:"button",onClick:()=>e.connectWallet(),children:"Connect wallet"})}const JSe=to(fa)({padding:"15px 24px"});function eCe(){const e=Yx(),{hasFiles:t}=Gu(),{step:r,proceedToPublish:n,toggleSection:o,currentSection:a}=a_(),{mutate:s,data:l,error:u,isLoading:c,compileStatus:d}=Yu(),p=!!l?.result?.msgCell,v=()=>o(fc.SOURCES);return Lt(vg,{children:[D(fa,{sx:{cursor:r===bc.PUBLISH&&p?"pointer":"inherit"},onClick:v,children:D(M5e,{})}),a===fc.SOURCES&&D(Iy,{in:a===fc.SOURCES,children:D(JSe,{children:Lt(ra,{children:[t()&&Lt(ra,{children:[D(TSe,{}),D(PSe,{})]}),(l||u)&&D(XSe,{}),t()&&D(Fn,{sx:{justifyContent:"center"},mt:3,mb:"9px",children:e?l?.result?.msgCell?D(Va,{disabled:r===bc.PUBLISH,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:n,children:"Ready to publish"}):Lt(Va,{disabled:!t(),fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(null)},children:[c&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Compile"]}):D(B$,{})})]})})})]})}const tCe=lr(_2)({borderRadius:40,fontFamily:"inherit",fontWeight:700,textTransform:"none",background:"#0088CC","&:disabled":{backgroundColor:"#e0e0e0"}});function ud(e){return D(tCe,{disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,variant:"contained",disabled:e.disabled,onClick:e.disabled?void 0:e.onClick,...e,children:e.text})}const rCe="/assets/publish.83df630b.svg";function nCe(){const{data:e}=Yu(),{sendTXN:t,status:r,clearTXN:n}=tF(),{step:o,toggleSection:a,currentSection:s}=a_();Gu();const l=!!e?.result?.msgCell;let u;const c=()=>o===bc.PUBLISH&&l&&a(fc.PUBLISH);switch(r){case"initial":u=D("span",{children:"To store your contract\u2019s verification proof on-chain, you will need to issue a transaction. This will cost 0.5 TON"});break;case"rejected":u="Transaction rejected, please retry.";break;case"pending":u="Check your wallet for a pending transaction.";break;case"issued":u="Transaction issued, monitoring proof deployment on-chain.";break;case"success":u="Your contract is now verified! Click below to view it.";break;case"expired":u="Transaction expired, please retry.";break;case"error":u="The transaction is taking too long to complete or have failed. Please use a blockchain explorer to monitor it. You can also use our telegram support group."}return Lt(vg,{mb:6,children:[Lt(Fn,{p:s===fc.PUBLISH?"30px 24px 0 24px":"20px 24px",onClick:c,sx:{opacity:o===bc.PUBLISH&&l?1:.25,cursor:o===bc.PUBLISH&&l?"pointer":"inherit"},children:[D(bg,{children:D("img",{src:r==="success"?t$:rCe,alt:"publish icon",width:41,height:41})}),D(Kd,{children:"Publish"})]}),s===fc.PUBLISH&&l&&D(Iy,{in:s===fc.PUBLISH,children:Lt(fa,{children:[D(fa,{sx:{padding:"0 30px"},children:D(Is,{type:hs.INFO,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:D(zd,{sx:{marginBottom:0},children:u})})})}),Lt(Fn,{mb:3,sx:{justifyContent:"center"},children:[r!=="success"&&Lt(Va,{disabled:r==="pending"||r==="issued",fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{t()},children:[(r==="pending"||r==="issued")&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Publish"]}),r==="success"&&D(ud,{sx:{height:44},text:"View verified contract",onClick:()=>{location.reload()}})]})]})})]})}const iCe="/assets/verification-alert.0ebcec4f.svg",oCe="/assets/verification-binary.d6844d86.svg",aCe="/assets/verification-bomb.3bf48d9c.svg",sCe="/assets/verification-paper.34a39e79.svg",lCe="/assets/show.836c8f4f.svg",uCe="/assets/verification.fbd44dba.svg",cCe=to(js)(()=>({color:"#000"})),dCe=to(fa)({display:"flex",alignItems:"center",flexDirection:"column","& .title":{texAlign:"center",fontWeight:500,fontSize:20,marginBottom:20},"& .base-button":{height:40,marginTop:30}});function fCe({open:e,onClose:t,children:r,backgroundColor:n="rgba(48, 48, 48, 0.4)",blur:o=!0,className:a="",maxWidth:s,hideCloseButton:l,paddingTop:u}){return D(tne,{className:`${a} ${o&&"popup-filter"}`,fullWidth:!0,onClose:t,open:e,PaperProps:{style:{maxWidth:s||"unset",width:"100%",borderRadius:"10px",padding:0,overflow:"unset",margin:20}},BackdropProps:{style:{backgroundColor:n}},children:Lt(fa,{sx:{overflow:"scroll","::-webkit-scrollbar":{display:"none"}},children:[!l&&D(fa,{sx:{display:"flex",justifyContent:"end",width:"100%"},children:D(cCe,{onClick:t,children:D(Gk,{style:{width:23,height:23}})})}),D(dCe,{px:3,pb:3,pt:u?3:0,children:r})]})})}const pCe="/assets/verification-popup.1a3fc640.svg",hCe=lr(ok)({overflow:"scroll",background:"#F7F9FB",borderRadius:"5px",width:"100%"}),gCe=lr(kn)({background:"#F7F9FB",borderRadius:"5px",width:"100%"}),mCe=lr(vL)({"&.MuiTableHead-root th":{border:"none",fontSize:13}}),yCe=lr(Ec)({fontWeight:700}),Yp=lr(th)({paddingLeft:0,paddingBottom:"2px"}),Qp=lr(is)({paddingBottom:10}),vCe=lr(Fn)({width:59,height:21,background:"#08D088",borderRadius:40,color:"#fff",justifyContent:"space-around",fontSize:12}),cd=lr(is)({paddingBottom:16}),bCe=lr(hc)({textDecoration:"none",cursor:"pointer",color:"#0088CC"}),wCe=lr(kn)({width:"100%",display:"flex",justifyContent:"flex-end"}),_3=lr(Fo)({color:"#728A96",fontSize:14}),xCe=lr(Kd)({fontSize:18,fontWeight:800,color:"#000",textAlign:"center"}),_Ce=lr(kn)({display:"inline-flex",alignItems:"center",height:"20px",padding:"0 7px",background:"rgba(146, 146, 146, 0.3)",borderRadius:"10px",color:"#212121",fontWeight:400,fontSize:"14px",fontFamily:"IBM Plex Mono, monospace"});lr(_Ce)({position:"relative",top:5,display:"inline-block",whiteSpace:"nowrap",lineHeight:"20px",width:"100%",maxWidth:600,overflow:"hidden",textOverflow:"ellipsis"});const SCe="/assets/verified.4e0dc210.svg",Dm=()=>D(es,{width:"85%",variant:"text",sx:{transform:"none",background:"#e6e8eb"}}),CCe=()=>Lt(mCe,{children:[Lt(yCe,{children:[D(Yp,{sx:{width:80,paddingLeft:3},children:"Status"}),D(Yp,{sx:{width:370},children:"Public Key"}),D(Yp,{sx:{width:35}}),D(Yp,{sx:{width:105},children:"IP"}),D(Yp,{sx:{width:150},children:"Verification date"}),D(Yp,{sx:{width:100},children:"Verifier"})]}),Lt(Ec,{children:[D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})})]})]}),uO=()=>Lt(Ec,{children:[D(is,{sx:{paddingLeft:3,paddingBottom:2},children:D(Dm,{})}),D(cd,{children:D(Dm,{})}),D(cd,{children:D(es,{width:25,variant:"text",sx:{transform:"none",background:"#e6e8eb"}})}),D(cd,{children:D(Dm,{})}),D(cd,{children:D(Dm,{})}),D(is,{sx:{paddingRight:3,paddingBottom:2},children:D(Dm,{})})]}),kCe=({pubKey:e,endpoint:t,name:r,onCopy:n,date:o,url:a})=>Lt(Ec,{children:[D(is,{sx:{paddingLeft:3,paddingBottom:2},children:Lt(vCe,{px:1,children:[D("img",{src:SCe,alt:"Verified icon",width:11,height:11}),"Verified"]})}),D(cd,{children:D(_3,{children:e})}),D(cd,{children:D(js,{onClick:()=>n(e),sx:{padding:.5},children:D("img",{src:o_,alt:"Copy icon",width:16,height:16})})}),D(cd,{children:D(_3,{children:t})}),D(cd,{children:D(_3,{children:o})}),D(is,{sx:{paddingRight:3,paddingBottom:2},children:D(Fn,{children:D(bCe,{target:"_blank",href:a,children:r})})})]});function ECe(){const{data:e,isLoading:t,error:r}=Dc(),{data:n,isLoading:o,error:a}=n_(),{showNotification:s}=Fy(),l=n?.find(c=>c.name===window.verifierId),u=J.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Lt(kn,{sx:{overflow:"scroll",borderRadius:"5px","::-webkit-scrollbar":{display:"none"}},children:[Lt(hCe,{sx:{minWidth:900},children:[D(CCe,{}),D(ak,{children:t||o?Lt(ra,{children:[D(uO,{}),D(uO,{})]}):l&&e&&Object.entries(l.pubKeyEndpoints).map(([c,d])=>D(kCe,{pubKey:c,onCopy:u,url:l.url,date:e?.verificationDate?.toLocaleDateString()||"",endpoint:d,name:l.name},c))})]}),(!!r||!!a)&&`${r} ${a} (App notification)`]})}const ACe="modulepreload",TCe=function(e){return"/"+e},cO={},Nm=function(t,r,n){if(!r||r.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=TCe(a),a in cO)return;cO[a]=!0;const s=a.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!n)for(let d=o.length-1;d>=0;d--){const p=o[d];if(p.href===a&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":ACe,s||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),s)return new Promise((d,p)=>{c.addEventListener("load",d),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())};var R1=(e=>(e.VALID="VALID",e.WASM="WebAssembly is not supported",e.COMPILER="Only FunC contracts can be verified",e.VERSION="FunC version is not supported",e))(R1||{});const ICe=["0.2.0","0.3.0","0.4.0","0.4.1"];function RCe(){const{data:e}=Dc(),{data:t}=Ap(),[r,n]=J.exports.useState(null),[o,a]=J.exports.useState(!1),[s,l]=J.exports.useState(null),u=async()=>{xa(ma.IN_BROWSER_COMPILE_START),n(null),a(!0);const{FuncCompiler:p}=await Nm(()=>import("./index.142cec87.js").then(A=>A.i),[]),v=e?.files?.map(A=>({filename:A.name,content:A.content}))??[],w=e?.compilerSettings?.funcVersion;if(!w){n("FunC is not available for in-browser verification"),a(!1);return}let b;switch(w){case"0.2.0":{let{object:A}=await Nm(()=>import("./index.fbca1507.js").then(U=>U.i),[]);b=A;break}case"0.3.0":{let{object:A}=await Nm(()=>import("./index.f65cb428.js").then(U=>U.i),[]);b=A;break}case"0.4.0":{let{object:A}=await Nm(()=>import("./index.fb59a6c3.js").then(U=>U.i),[]);b=A;break}case"0.4.1":{let{object:A}=await Nm(()=>import("./index.bf0da248.js").then(U=>U.i),[]);b=A;break}}let _=await new p(b).compileFunc({sources:v,targets:(e?.compilerSettings).commandLine.split(" ").filter(A=>A.match(/\.(fc|func)$/))});if(_.status==="error"){n(_.message),a(!1),xa(ma.IN_BROWSER_COMPILE_ERROR);return}const k=Wn.Cell.fromBoc(Buffer.from(_.codeBoc,"base64"))[0];a(!1),t?.codeCellToCompileBase64===k.hash().toString("base64")&&l(k.hash().toString("base64")),xa(ma.IN_BROWSER_COMPILE_SUCCESS)},c=()=>wF()?e?.compiler!=="func"?"Only FunC contracts can be verified":d()?"VALID":"FunC version is not supported":"WebAssembly is not supported",d=()=>ICe.some(p=>p===e?.compilerSettings?.funcVersion);return{verifyContract:u,isVerificationEnabled:c,loading:o,error:r,hash:s}}function PCe(){const{verifyContract:e,isVerificationEnabled:t,error:r,loading:n,hash:o}=RCe(),a=ua(),s=sa(a.breakpoints.down("md"));return Lt(kn,{p:2,children:[Lt(Fo,{sx:{fontSize:14},children:["You are not required to rely on third-party validators. You can now verify this contract by yourself by having your browser download the sources and compile them locally in-browser using"," ",D(hc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/func-js",target:"_blank",children:"WASM"}),".",!B2e()&&D(Fn,{mt:1,sx:{overflow:"auto",maxHeight:300},children:Lt(zd,{sx:{margin:0},children:["The web page you're looking at is"," ",D(hc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/contract-verifier",target:"_blank",children:"open source"}),", you can also fork or run it locally if you wish to have absolute control."]})})]}),t()!==R1.VALID?D(mL,{arrow:!0,title:D(Fo,{sx:{fontSize:13},children:t()}),placement:"top",children:D(kn,{sx:{width:144,margin:"auto"},children:D(Va,{onClick:()=>e(),disabled:t()!==R1.VALID||n||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:"Verify"})})}):Lt(Va,{onClick:()=>e(),disabled:t()!==R1.VALID||n||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:[n&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Verify"]}),r&&Lt(ra,{children:[D(Is,{noBottomMargin:!0,type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:D(kn,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:r})})})}),Lt(Fo,{sx:{marginTop:1,fontSize:13},children:["You can ask for help in our"," ",D(hc,{sx:{textDecoration:"none",cursor:"pointer",color:"#0088CC"},href:"https://t.me/tonverifier",target:"_blank",children:"Telegram support group"})]})]}),!!o&&D(Is,{noBottomMargin:!0,singleLine:!s,type:hs.SUCCESS,title:Lt(Fn,{sx:{height:42},children:[D(Fn,{mr:1,children:D("img",{src:I$,alt:"Like icon",width:31,height:31})}),Lt(M$,{children:[" ",D("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:D(kn,{})})]})}function MCe(){const{data:e,isLoading:t}=Dc(),{isLoading:r}=n_();return Lt(kn,{sx:{width:"100%"},children:[e&&!r&&Lt(gCe,{pt:3,pb:1,children:[D(xCe,{children:"Verify manually"}),D(BCe,{})]}),(t||r)&&D(es,{width:"100%",height:250,sx:{transform:"none",borderRadius:"20px",background:"#e6e8eb"}})]})}to(bL)({borderBottom:"none","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function BCe(){return D(kn,{sx:{width:"100%"},children:D(PCe,{})})}function OCe({onClose:e}){const t=ua(),r=sa(t.breakpoints.down("lg"));return D(fCe,{open:!0,maxWidth:r?"88%":1e3,hideCloseButton:!0,children:D(z6,{onClickAway:e,children:Lt(kn,{sx:{width:"100%"},children:[D(wCe,{pt:2,children:D(js,{sx:{padding:0},onClick:e,children:D("img",{src:$6,alt:"Close icon",width:15,height:15})})}),Lt(Fn,{mb:4,justifyContent:"center",children:[D("img",{src:pCe,alt:"Popup icon",width:41,height:41}),D(Kd,{pl:2,sx:{fontSize:18,fontWeight:800},children:"Verification Proof"})]}),D(ECe,{}),D(Fn,{mt:3,children:D(MCe,{})})]})})})}const UCe=to(Fn)(({theme:e})=>t=>({flexWrap:t.makeFlexible?"wrap":"inherit",gap:t.makeFlexible?20:"inherit",justifyContent:t.makeFlexible?"center":"space-between",padding:24,[e.breakpoints.down("lg")]:{width:"70%",margin:"auto"}})),LCe=to(Zy)({boxSizing:"border-box",display:"flex",minWidth:200,maxWidth:260,height:108,background:"#F7F9FB",borderRadius:14,padding:"28px 13px"}),DCe=to(Fo)({fontSize:14,color:"#000"}),NCe=[{icon:sCe,description:"This source code compiles to the same exact bytecode that is found on-chain."},{icon:aCe,description:"You can review verification proofs and perform your own client-side verification."},{icon:iCe,description:"Variable/function names may not reflect actual usage. compiler may remove unused code."},{icon:oCe,description:"Comments may not be honest and should generally be ignored."}],jCe=()=>{const[e]=Iw(),[t,r]=Yn.useState(e.get("showProof")!==null),n=ua(),o=sa(n.breakpoints.down("lg")),a=sa(n.breakpoints.down("md")),s=sa("(max-width: 450px)");return Lt(vg,{children:[D(k2,{mb:1,children:Lt(Fn,{sx:{justifyContent:"space-between",flexDirection:s?"column":"inherit",width:"100%"},children:[Lt(Fn,{mb:s?2:0,sx:{width:"100%"},children:[D(bg,{children:D("img",{src:uCe,alt:"Verification icon",width:41,height:41})}),D(Kd,{children:"How is this contract verified?"})]}),Lt("div",{children:[Lt(Va,{fontSize:12,fontWeight:800,textColor:"#fff",background:"#1976d2",hoverBackground:"#156cc2",height:37,width:132,onClick:()=>{r(!0)},children:[D("img",{src:lCe,alt:"Show icon",width:19,height:19}),"Show Proof"]}),t&&D(OCe,{onClose:()=>r(!1)})]})]})}),D(UCe,{makeFlexible:o,isMobile:a,children:NCe.map(u=>Lt(LCe,{children:[D(Zy,{sx:{alignSelf:"flex-start"},mr:1.5,children:D("img",{alt:"Icon",src:u.icon,width:41,height:41})}),D(DCe,{children:u.description})]},u.description))})]})};function FCe(){const e=Jj(T1),{isLoading:t,error:r,data:n}=Cc(["latestVerifiedContracts"],async()=>(await(await fetch(`${e}/latestVerified`,{method:"GET"})).json()).slice(0,100));return{isLoading:t,error:r,data:n}}const $Ce=lr(kn)(({theme:e})=>({background:"white",padding:"16px 20px",borderRadius:10,boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",border:"0.5px solid rgba(114, 138, 150, 0.24)",cursor:"pointer",[e.breakpoints.down("sm")]:{width:280}})),zCe=lr(kn)(({theme:e})=>({maxWidth:1160,width:"calc(100% - 50px)",paddingTop:20,margin:"0 auto"})),HCe=lr(kn)({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,margin:"0 auto",justifyContent:"left",overflow:"auto",marginTop:24,"-webkit-text-size-adjust":"100%"}),WCe=lr(kn)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,color:"#728A96"}),VCe=lr(kn)({marginLeft:"auto",fontSize:14,background:"#F0F0F099",color:"#728A9699",padding:"2px 12px",borderRadius:4});function qCe(){const{data:e,isLoading:t}=FCe(),r=Mc(),n=J.exports.useRef(new Array(30).fill(null).map(o=>Math.random()*100));return Lt(zCe,{children:[D(Fo,{variant:"h6",children:D("b",{children:"Latest verified contracts"})}),Lt(HCe,{children:[t&&n.current.map(o=>D(es,{sx:{borderRadius:2},variant:"rectangular",width:400+o,height:70})),e?.map(o=>Lt($Ce,{onClick:a=>{r(`/${o.address}`)},children:[D(WCe,{children:o.address}),Lt("div",{style:{display:"flex",alignItems:"center",marginTop:6.5},children:[D(Fo,{sx:{fontSize:14,color:"#728A9699"},children:o.mainFile}),D(VCe,{children:o.compiler})]})]}))]})]})}const O$=to(kn)({maxWidth:1160,margin:"auto"}),U$=to(kn)(e=>({display:e.isMobile?"inherit":"flex",gap:20})),n1=to(kn)({boxSizing:"border-box",maxWidth:1160,width:"100%",marginTop:20,backgroundColor:"#fff",borderRadius:20,padding:20,color:"#000"});function dO(){const{isLoading:e,data:t,error:r}=Dc(),[n,o]=J.exports.useState(!1),a=ua(),s=exe(),{contractAddress:l,isAddressEmpty:u}=qu(),{hasFiles:c}=Gu(),d=J.exports.useRef(),p=sa(a.breakpoints.down("lg")),v=sa(a.breakpoints.down("md")),w=!r&&e&&l;EN(),rxe(),N2e(),J.exports.useEffect(()=>{window.scrollTo({behavior:"auto",top:d.current?.offsetTop})},[window.location.pathname]);const{initialize:b}=OE(),{data:{funcVersions:m}}=BE();return J.exports.useEffect(()=>{(m?.length??0)>0&&b(m[0])},[m]),Lt(kn,{onDragEnter:()=>o(!0),onDrop:()=>o(!1),onClick:()=>o(!1),children:[D(x2,{sx:{color:"#fff",zIndex:4},open:n,onDragEnd:()=>o(!1)}),D(kn,{ref:d}),window.isTestnet&&D(i8,{}),D(W1e,{}),l===null&&u&&D(qCe,{}),l===null&&!u&&D(kn,{m:4,children:D(Is,{singleLine:!0,type:hs.ERROR,title:Lt(Fn,{sx:{height:42},children:[D("span",{style:{color:"#FC5656",marginRight:4},children:"Error: "}),"Invalid address"]}),notificationBody:D(kn,{})})}),Lt(O$,{px:p?"20px":0,children:[!!r&&D(kn,{mt:4,children:D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Unable to fetch contract data"]}),notificationBody:D(kn,{sx:{overflow:"auto",maxHeight:300},children:D("pre",{children:D("code",{children:r.toString()})})})})}),w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:200}})]}),D(es,{variant:"rectangular",width:"100%",height:250})]}),Lt(U$,{isMobile:v,children:[D(uxe,{}),t?.hasOnchainProof&&D(U_e,{})]}),w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:200}})]}),D(es,{variant:"rectangular",width:"100%",height:250})]}),!e&&t?.hasOnchainProof&&D(jCe,{}),t&&(!t.hasOnchainProof||s)&&Lt(ra,{children:[D(eCe,{}),c()&&D(nCe,{})]}),t&&!c()?D(n1,{sx:{padding:0},mb:5,children:D(J2e,{})}):D(ra,{children:w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:5,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:250}})]}),D(es,{variant:"rectangular",width:"100%",height:500})]})}),t&&D(Jb,{})]}),!t&&D(Zy,{sx:{bottom:0,width:"100%"},children:D(Jb,{})})]})}function L$({space:e}){return D("div",{style:{height:e}})}function KCe(){const[e,t]=J.exports.useState({spec:[],builder:Wn.beginCell()});return Lt("div",{children:[D("h4",{children:"Build the cell"}),D(Rh,{required:!0,id:"outlined-required",label:"UINT",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const[n,o]=r.target.value.split(",");t(a=>({spec:[...a.spec,{type:"uint"+o,value:n}],builder:a.builder.storeUint(n,o)})),r.target.value=""}}}),D(Rh,{required:!0,id:"outlined-required",label:"Address",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const n=r.target.value;t(o=>({spec:[...o.spec,{type:"address",value:n}],builder:o.builder.storeAddress(Wn.Address.parse(n))})),r.target.value=""}}}),D("div",{children:JSON.stringify(e.spec)}),D(L$,{space:30}),D(_2,{variant:"outlined",children:"Send the message"})]})}function GCe(){return Lt("div",{style:{margin:"0 auto",maxWidth:1100,padding:40},children:[D(B$,{}),D(L$,{space:35}),D(Rh,{required:!0,id:"outlined-required",label:"Contract address",fullWidth:!0}),D(Rh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),Lt("div",{children:[D("h3",{children:"OPs"}),D(Rh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),D(KCe,{})]})]})}const YCe=F6({typography:{fontFamily:"Mulish"},components:{MuiSwitch:{styleOverrides:{switchBase:{color:"#ccc"},colorPrimary:{"&.Mui-checked":{color:"#fff"}},track:{opacity:1,backgroundColor:"#D1D1D6",".Mui-checked.Mui-checked + &":{opacity:1,backgroundColor:"#0088CC"}},thumb:{background:"#fff",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.16)"}}}}});function o8({label:e,data:t}){return Lt("div",{className:"InfoPiece",children:[D("div",{className:"InfoPiece-Label",children:e}),D("div",{className:"InfoPiece-Data",children:t})]})}var Xy=e=>e.type==="checkbox",wh=e=>e instanceof Date,fs=e=>e==null;const D$=e=>typeof e=="object";var Ea=e=>!fs(e)&&!Array.isArray(e)&&D$(e)&&!wh(e),N$=e=>Ea(e)&&e.target?Xy(e.target)?e.target.checked:e.target.value:e,QCe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,j$=(e,t)=>e.has(QCe(t)),ZCe=e=>{const t=e.constructor&&e.constructor.prototype;return Ea(t)&&t.hasOwnProperty("isPrototypeOf")},a8=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ts(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(a8&&(e instanceof Blob||e instanceof FileList))&&(r||Ea(e)))if(t=r?[]:{},!r&&!ZCe(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=ts(e[n]));else return e;return t}var zg=e=>Array.isArray(e)?e.filter(Boolean):[],Po=e=>e===void 0,vn=(e,t,r)=>{if(!t||!Ea(e))return r;const n=zg(t.split(/[,[\].]+?/)).reduce((o,a)=>fs(o)?o:o[a],e);return Po(n)||n===e?Po(e[t])?r:e[t]:n},Su=e=>typeof e=="boolean";const ew={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ic={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XCe=Yn.createContext(null),d_=()=>Yn.useContext(XCe);var F$=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const s=a;return t._proxyFormState[s]!==xl.all&&(t._proxyFormState[s]=!n||xl.all),r&&(r[s]=!0),e[s]}});return o},Gs=e=>Ea(e)&&!Object.keys(e).length,$$=(e,t,r,n)=>{r(e);const{name:o,...a}=e;return Gs(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!n||xl.all))},Zs=e=>Array.isArray(e)?e:[e],z$=(e,t,r)=>!e||!t||e===t||Zs(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function f_(e){const t=Yn.useRef(e);t.current=e,Yn.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function JCe(e){const t=d_(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[s,l]=Yn.useState(r._formState),u=Yn.useRef(!0),c=Yn.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Yn.useRef(o);return d.current=o,f_({disabled:n,next:p=>u.current&&z$(d.current,p.name,a)&&$$(p,c.current,r._updateFormState)&&l({...r._formState,...p}),subject:r._subjects.state}),Yn.useEffect(()=>(u.current=!0,c.current.isValid&&r._updateValid(!0),()=>{u.current=!1}),[r]),F$(s,r,c.current,!1)}var ku=e=>typeof e=="string",H$=(e,t,r,n,o)=>ku(e)?(n&&t.watch.add(e),vn(r,e,o)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),vn(r,a))):(n&&(t.watchAll=!0),r);function e4e(e){const t=d_(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:s}=e||{},l=Yn.useRef(n);l.current=n,f_({disabled:a,subject:r._subjects.values,next:d=>{z$(l.current,d.name,s)&&c(ts(H$(l.current,r._names,d.values||r._formValues,!1,o)))}});const[u,c]=Yn.useState(r._getWatch(n,o));return Yn.useEffect(()=>r._removeUnmounted()),u}var s8=e=>/^\w*$/.test(e),W$=e=>zg(e.replace(/["|']|\]/g,"").split(/\.|\[/));function To(e,t,r){let n=-1;const o=s8(t)?[t]:W$(t),a=o.length,s=a-1;for(;++n{const d=o._options.shouldUnregister||a,p=(v,w)=>{const b=vn(o._fields,v);b&&(b._f.mount=w)};if(p(r,!0),d){const v=ts(vn(o._options.defaultValues,r));To(o._defaultValues,r,v),Po(vn(o._formValues,r))&&To(o._formValues,r,v)}return()=>{(s?d&&!o._state.action:d)?o.unregister(r):p(r,!1)}},[r,o,s,a]),Yn.useEffect(()=>{vn(o._fields,r)&&o._updateDisabledField({disabled:n,fields:o._fields,name:r,value:vn(o._fields,r)._f.value})},[n,r,o]),{field:{name:r,value:l,...Su(n)||Su(u.disabled)?{disabled:u.disabled||n}:{},onChange:Yn.useCallback(d=>c.current.onChange({target:{value:N$(d),name:r},type:ew.CHANGE}),[r]),onBlur:Yn.useCallback(()=>c.current.onBlur({target:{value:vn(o._formValues,r),name:r},type:ew.BLUR}),[r,o]),ref:d=>{const p=vn(o._fields,r);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:v=>d.setCustomValidity(v),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!vn(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!vn(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!vn(u.touchedFields,r)},error:{enumerable:!0,get:()=>vn(u.errors,r)}})}}const r4e=e=>e.render(t4e(e));var n4e=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Gc=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},S3=(e,t,r={})=>r.shouldFocus||Po(r.shouldFocus)?r.focusName||`${e}.${Po(r.focusIndex)?t:r.focusIndex}.`:"",f4=e=>({isOnSubmit:!e||e===xl.onSubmit,isOnBlur:e===xl.onBlur,isOnChange:e===xl.onChange,isOnAll:e===xl.all,isOnTouch:e===xl.onTouched}),p4=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const _0=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const a=vn(e,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!n)break;if(s.ref&&t(s.ref,s.name)&&!n)break}else Ea(l)&&_0(l,t)}}};var V$=(e,t,r)=>{const n=zg(vn(e,r));return To(n,"root",t[r]),To(e,r,n),e},l8=e=>e.type==="file",dd=e=>typeof e=="function",tw=e=>{if(!a8)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P1=e=>ku(e),u8=e=>e.type==="radio",rw=e=>e instanceof RegExp;const fO={value:!1,isValid:!1},pO={value:!0,isValid:!0};var q$=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Po(e[0].attributes.value)?Po(e[0].value)||e[0].value===""?pO:{value:e[0].value,isValid:!0}:pO:fO}return fO};const hO={isValid:!1,value:null};var K$=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hO):hO;function gO(e,t,r="validate"){if(P1(e)||Array.isArray(e)&&e.every(P1)||Su(e)&&!e)return{type:r,message:P1(e)?e:"",ref:t}}var Zp=e=>Ea(e)&&!rw(e)?e:{value:e,message:""},h4=async(e,t,r,n,o)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:d,max:p,pattern:v,validate:w,name:b,valueAsNumber:m,mount:_,disabled:k}=e._f,A=vn(t,b);if(!_||k)return{};const U=s?s[0]:a,M=W=>{n&&U.reportValidity&&(U.setCustomValidity(Su(W)?"":W||""),U.reportValidity())},L={},F=u8(a),j=Xy(a),ee=F||j,te=(m||l8(a))&&Po(a.value)&&Po(A)||tw(a)&&a.value===""||A===""||Array.isArray(A)&&!A.length,Z=n4e.bind(null,b,r,L),se=(W,q,C,G=ic.maxLength,le=ic.minLength)=>{const pe=W?q:C;L[b]={type:W?G:le,message:pe,ref:a,...Z(W?G:le,pe)}};if(o?!Array.isArray(A)||!A.length:l&&(!ee&&(te||fs(A))||Su(A)&&!A||j&&!q$(s).isValid||F&&!K$(s).isValid)){const{value:W,message:q}=P1(l)?{value:!!l,message:l}:Zp(l);if(W&&(L[b]={type:ic.required,message:q,ref:U,...Z(ic.required,q)},!r))return M(q),L}if(!te&&(!fs(d)||!fs(p))){let W,q;const C=Zp(p),G=Zp(d);if(!fs(A)&&!isNaN(A)){const le=a.valueAsNumber||A&&+A;fs(C.value)||(W=le>C.value),fs(G.value)||(q=lenew Date(new Date().toDateString()+" "+lt),be=a.type=="time",Q=a.type=="week";ku(C.value)&&A&&(W=be?pe(A)>pe(C.value):Q?A>C.value:le>new Date(C.value)),ku(G.value)&&A&&(q=be?pe(A)+W.value,G=!fs(q.value)&&A.length<+q.value;if((C||G)&&(se(C,W.message,q.message),!r))return M(L[b].message),L}if(v&&!te&&ku(A)){const{value:W,message:q}=Zp(v);if(rw(W)&&!A.match(W)&&(L[b]={type:ic.pattern,message:q,ref:a,...Z(ic.pattern,q)},!r))return M(q),L}if(w){if(dd(w)){const W=await w(A,t),q=gO(W,U);if(q&&(L[b]={...q,...Z(ic.validate,q.message)},!r))return M(q.message),L}else if(Ea(w)){let W={};for(const q in w){if(!Gs(W)&&!r)break;const C=gO(await w[q](A,t),U,q);C&&(W={...C,...Z(q,C.message)},M(C.message),r&&(L[b]=W))}if(!Gs(W)&&(L[b]={ref:U,...W},!r))return L}}return M(!0),L};function C3(e,t){return[...e,...Zs(t)]}var k3=e=>Array.isArray(e)?e.map(()=>{}):void 0;function E3(e,t,r){return[...e.slice(0,t),...Zs(r),...e.slice(t)]}var A3=(e,t,r)=>Array.isArray(e)?(Po(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function T3(e,t){return[...Zs(t),...Zs(e)]}function i4e(e,t){let r=0;const n=[...e];for(const o of t)n.splice(o-r,1),r++;return zg(n).length?n:[]}var I3=(e,t)=>Po(t)?[]:i4e(e,Zs(t).sort((r,n)=>r-n)),R3=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function o4e(e,t){const r=t.slice(0,-1).length;let n=0;for(;n(e[t]=r,e);function s4e(e){const t=d_(),{control:r=t.control,name:n,keyName:o="id",shouldUnregister:a}=e,[s,l]=Yn.useState(r._getFieldArray(n)),u=Yn.useRef(r._getFieldArray(n).map(Gc)),c=Yn.useRef(s),d=Yn.useRef(n),p=Yn.useRef(!1);d.current=n,c.current=s,r._names.array.add(n),e.rules&&r.register(n,e.rules),f_({next:({values:L,name:F})=>{if(F===d.current||!F){const j=vn(L,d.current);Array.isArray(j)&&(l(j),u.current=j.map(Gc))}},subject:r._subjects.array});const v=Yn.useCallback(L=>{p.current=!0,r._updateFieldArray(n,L)},[r,n]),w=(L,F)=>{const j=Zs(ts(L)),ee=C3(r._getFieldArray(n),j);r._names.focus=S3(n,ee.length-1,F),u.current=C3(u.current,j.map(Gc)),v(ee),l(ee),r._updateFieldArray(n,ee,C3,{argA:k3(L)})},b=(L,F)=>{const j=Zs(ts(L)),ee=T3(r._getFieldArray(n),j);r._names.focus=S3(n,0,F),u.current=T3(u.current,j.map(Gc)),v(ee),l(ee),r._updateFieldArray(n,ee,T3,{argA:k3(L)})},m=L=>{const F=I3(r._getFieldArray(n),L);u.current=I3(u.current,L),v(F),l(F),r._updateFieldArray(n,F,I3,{argA:L})},_=(L,F,j)=>{const ee=Zs(ts(F)),te=E3(r._getFieldArray(n),L,ee);r._names.focus=S3(n,L,j),u.current=E3(u.current,L,ee.map(Gc)),v(te),l(te),r._updateFieldArray(n,te,E3,{argA:L,argB:k3(F)})},k=(L,F)=>{const j=r._getFieldArray(n);R3(j,L,F),R3(u.current,L,F),v(j),l(j),r._updateFieldArray(n,j,R3,{argA:L,argB:F},!1)},A=(L,F)=>{const j=r._getFieldArray(n);A3(j,L,F),A3(u.current,L,F),v(j),l(j),r._updateFieldArray(n,j,A3,{argA:L,argB:F},!1)},U=(L,F)=>{const j=ts(F),ee=mO(r._getFieldArray(n),L,j);u.current=[...ee].map((te,Z)=>!te||Z===L?Gc():u.current[Z]),v(ee),l([...ee]),r._updateFieldArray(n,ee,mO,{argA:L,argB:j},!0,!1)},M=L=>{const F=Zs(ts(L));u.current=F.map(Gc),v([...F]),l([...F]),r._updateFieldArray(n,[...F],j=>j,{},!0,!1)};return Yn.useEffect(()=>{if(r._state.action=!1,p4(n,r._names)&&r._subjects.state.next({...r._formState}),p.current&&(!f4(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(L=>{const F=vn(L.errors,n),j=vn(r._formState.errors,n);(j?!F&&j.type||F&&(j.type!==F.type||j.message!==F.message):F&&F.type)&&(F?To(r._formState.errors,n,F):Ma(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const L=vn(r._fields,n);L&&L._f&&h4(L,r._formValues,r._options.criteriaMode===xl.all,r._options.shouldUseNativeValidation,!0).then(F=>!Gs(F)&&r._subjects.state.next({errors:V$(r._formState.errors,F,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&_0(r._fields,(L,F)=>{if(r._names.focus&&F.startsWith(r._names.focus)&&L.focus)return L.focus(),1}),r._names.focus="",r._updateValid(),p.current=!1},[s,n,r]),Yn.useEffect(()=>(!vn(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||a)&&r.unregister(n)}),[n,r,o,a]),{swap:Yn.useCallback(k,[v,n,r]),move:Yn.useCallback(A,[v,n,r]),prepend:Yn.useCallback(b,[v,n,r]),append:Yn.useCallback(w,[v,n,r]),remove:Yn.useCallback(m,[v,n,r]),insert:Yn.useCallback(_,[v,n,r]),update:Yn.useCallback(U,[v,n,r]),replace:Yn.useCallback(M,[v,n,r]),fields:Yn.useMemo(()=>s.map((L,F)=>({...L,[o]:u.current[F]||Gc()})),[s,o])}}function P3(){let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}}var nw=e=>fs(e)||!D$(e);function If(e,t){if(nw(e)||nw(t))return e===t;if(wh(e)&&wh(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const a=e[o];if(!n.includes(o))return!1;if(o!=="ref"){const s=t[o];if(wh(a)&&wh(s)||Ea(a)&&Ea(s)||Array.isArray(a)&&Array.isArray(s)?!If(a,s):a!==s)return!1}}return!0}var G$=e=>e.type==="select-multiple",l4e=e=>u8(e)||Xy(e),M3=e=>tw(e)&&e.isConnected,Y$=e=>{for(const t in e)if(dd(e[t]))return!0;return!1};function iw(e,t={}){const r=Array.isArray(e);if(Ea(e)||r)for(const n in e)Array.isArray(e[n])||Ea(e[n])&&!Y$(e[n])?(t[n]=Array.isArray(e[n])?[]:{},iw(e[n],t[n])):fs(e[n])||(t[n]=!0);return t}function Q$(e,t,r){const n=Array.isArray(e);if(Ea(e)||n)for(const o in e)Array.isArray(e[o])||Ea(e[o])&&!Y$(e[o])?Po(t)||nw(r[o])?r[o]=Array.isArray(e[o])?iw(e[o],[]):{...iw(e[o])}:Q$(e[o],fs(t)?{}:t[o],r[o]):r[o]=!If(e[o],t[o]);return r}var B3=(e,t)=>Q$(e,t,iw(t)),Z$=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Po(e)?e:t?e===""?NaN:e&&+e:r&&ku(e)?new Date(e):n?n(e):e;function O3(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return l8(t)?t.files:u8(t)?K$(e.refs).value:G$(t)?[...t.selectedOptions].map(({value:r})=>r):Xy(t)?q$(e.refs).value:Z$(Po(t.value)?e.ref.value:t.value,e)}var u4e=(e,t,r,n)=>{const o={};for(const a of e){const s=vn(t,a);s&&To(o,a,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},jm=e=>Po(e)?e:rw(e)?e.source:Ea(e)?rw(e.value)?e.value.source:e.value:e,c4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function yO(e,t,r){const n=vn(e,r);if(n||s8(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),s=vn(t,a),l=vn(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:r}}var d4e=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,f4e=(e,t)=>!zg(vn(e,t)).length&&Ma(e,t);const p4e={mode:xl.onSubmit,reValidateMode:xl.onChange,shouldFocusError:!0};function h4e(e={},t){let r={...p4e,...e},n={submitCount:0,isDirty:!1,isLoading:dd(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},a=Ea(r.defaultValues)||Ea(r.values)?ts(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:ts(a),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:P3(),array:P3(),state:P3()},w=e.resetOptions&&e.resetOptions.keepDirtyValues,b=f4(r.mode),m=f4(r.reValidateMode),_=r.criteriaMode===xl.all,k=fe=>Oe=>{clearTimeout(d),d=setTimeout(fe,Oe)},A=async fe=>{if(p.isValid||fe){const Oe=r.resolver?Gs((await te()).errors):await se(o,!0);Oe!==n.isValid&&v.state.next({isValid:Oe})}},U=fe=>p.isValidating&&v.state.next({isValidating:fe}),M=(fe,Oe=[],rt,ut,Ft=!0,ce=!0)=>{if(ut&&rt){if(l.action=!0,ce&&Array.isArray(vn(o,fe))){const oe=rt(vn(o,fe),ut.argA,ut.argB);Ft&&To(o,fe,oe)}if(ce&&Array.isArray(vn(n.errors,fe))){const oe=rt(vn(n.errors,fe),ut.argA,ut.argB);Ft&&To(n.errors,fe,oe),f4e(n.errors,fe)}if(p.touchedFields&&ce&&Array.isArray(vn(n.touchedFields,fe))){const oe=rt(vn(n.touchedFields,fe),ut.argA,ut.argB);Ft&&To(n.touchedFields,fe,oe)}p.dirtyFields&&(n.dirtyFields=B3(a,s)),v.state.next({name:fe,isDirty:q(fe,Oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else To(s,fe,Oe)},L=(fe,Oe)=>{To(n.errors,fe,Oe),v.state.next({errors:n.errors})},F=(fe,Oe,rt,ut)=>{const Ft=vn(o,fe);if(Ft){const ce=vn(s,fe,Po(rt)?vn(a,fe):rt);Po(ce)||ut&&ut.defaultChecked||Oe?To(s,fe,Oe?ce:O3(Ft._f)):le(fe,ce),l.mount&&A()}},j=(fe,Oe,rt,ut,Ft)=>{let ce=!1,oe=!1;const de={name:fe};if(!rt||ut){p.isDirty&&(oe=n.isDirty,n.isDirty=de.isDirty=q(),ce=oe!==de.isDirty);const $=If(vn(a,fe),Oe);oe=vn(n.dirtyFields,fe),$?Ma(n.dirtyFields,fe):To(n.dirtyFields,fe,!0),de.dirtyFields=n.dirtyFields,ce=ce||p.dirtyFields&&oe!==!$}if(rt){const $=vn(n.touchedFields,fe);$||(To(n.touchedFields,fe,rt),de.touchedFields=n.touchedFields,ce=ce||p.touchedFields&&$!==rt)}return ce&&Ft&&v.state.next(de),ce?de:{}},ee=(fe,Oe,rt,ut)=>{const Ft=vn(n.errors,fe),ce=p.isValid&&Su(Oe)&&n.isValid!==Oe;if(e.delayError&&rt?(c=k(()=>L(fe,rt)),c(e.delayError)):(clearTimeout(d),c=null,rt?To(n.errors,fe,rt):Ma(n.errors,fe)),(rt?!If(Ft,rt):Ft)||!Gs(ut)||ce){const oe={...ut,...ce&&Su(Oe)?{isValid:Oe}:{},errors:n.errors,name:fe};n={...n,...oe},v.state.next(oe)}U(!1)},te=async fe=>r.resolver(s,r.context,u4e(fe||u.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),Z=async fe=>{const{errors:Oe}=await te(fe);if(fe)for(const rt of fe){const ut=vn(Oe,rt);ut?To(n.errors,rt,ut):Ma(n.errors,rt)}else n.errors=Oe;return Oe},se=async(fe,Oe,rt={valid:!0})=>{for(const ut in fe){const Ft=fe[ut];if(Ft){const{_f:ce,...oe}=Ft;if(ce){const de=u.array.has(ce.name),$=await h4(Ft,s,_,r.shouldUseNativeValidation&&!Oe,de);if($[ce.name]&&(rt.valid=!1,Oe))break;!Oe&&(vn($,ce.name)?de?V$(n.errors,$,ce.name):To(n.errors,ce.name,$[ce.name]):Ma(n.errors,ce.name))}oe&&await se(oe,Oe,rt)}}return rt.valid},W=()=>{for(const fe of u.unMount){const Oe=vn(o,fe);Oe&&(Oe._f.refs?Oe._f.refs.every(rt=>!M3(rt)):!M3(Oe._f.ref))&&br(fe)}u.unMount=new Set},q=(fe,Oe)=>(fe&&Oe&&To(s,fe,Oe),!If($e(),a)),C=(fe,Oe,rt)=>H$(fe,u,{...l.mount?s:Po(Oe)?a:ku(fe)?{[fe]:Oe}:Oe},rt,Oe),G=fe=>zg(vn(l.mount?s:a,fe,e.shouldUnregister?vn(a,fe,[]):[])),le=(fe,Oe,rt={})=>{const ut=vn(o,fe);let Ft=Oe;if(ut){const ce=ut._f;ce&&(!ce.disabled&&To(s,fe,Z$(Oe,ce)),Ft=tw(ce.ref)&&fs(Oe)?"":Oe,G$(ce.ref)?[...ce.ref.options].forEach(oe=>oe.selected=Ft.includes(oe.value)):ce.refs?Xy(ce.ref)?ce.refs.length>1?ce.refs.forEach(oe=>(!oe.defaultChecked||!oe.disabled)&&(oe.checked=Array.isArray(Ft)?!!Ft.find(de=>de===oe.value):Ft===oe.value)):ce.refs[0]&&(ce.refs[0].checked=!!Ft):ce.refs.forEach(oe=>oe.checked=oe.value===Ft):l8(ce.ref)?ce.ref.value="":(ce.ref.value=Ft,ce.ref.type||v.values.next({name:fe,values:{...s}})))}(rt.shouldDirty||rt.shouldTouch)&&j(fe,Ft,rt.shouldTouch,rt.shouldDirty,!0),rt.shouldValidate&&Le(fe)},pe=(fe,Oe,rt)=>{for(const ut in Oe){const Ft=Oe[ut],ce=`${fe}.${ut}`,oe=vn(o,ce);(u.array.has(fe)||!nw(Ft)||oe&&!oe._f)&&!wh(Ft)?pe(ce,Ft,rt):le(ce,Ft,rt)}},be=(fe,Oe,rt={})=>{const ut=vn(o,fe),Ft=u.array.has(fe),ce=ts(Oe);To(s,fe,ce),Ft?(v.array.next({name:fe,values:{...s}}),(p.isDirty||p.dirtyFields)&&rt.shouldDirty&&v.state.next({name:fe,dirtyFields:B3(a,s),isDirty:q(fe,ce)})):ut&&!ut._f&&!fs(ce)?pe(fe,ce,rt):le(fe,ce,rt),p4(fe,u)&&v.state.next({...n}),v.values.next({name:fe,values:{...s}}),!l.mount&&t()},Q=async fe=>{const Oe=fe.target;let rt=Oe.name,ut=!0;const Ft=vn(o,rt),ce=()=>Oe.type?O3(Ft._f):N$(fe),oe=de=>{ut=Number.isNaN(de)||de===vn(s,rt,de)};if(Ft){let de,$;const E=ce(),I=fe.type===ew.BLUR||fe.type===ew.FOCUS_OUT,Y=!c4e(Ft._f)&&!r.resolver&&!vn(n.errors,rt)&&!Ft._f.deps||d4e(I,vn(n.touchedFields,rt),n.isSubmitted,m,b),ve=p4(rt,u,I);To(s,rt,E),I?(Ft._f.onBlur&&Ft._f.onBlur(fe),c&&c(0)):Ft._f.onChange&&Ft._f.onChange(fe);const je=j(rt,E,I,!1),dt=!Gs(je)||ve;if(!I&&v.values.next({name:rt,type:fe.type,values:{...s}}),Y)return p.isValid&&A(),dt&&v.state.next({name:rt,...ve?{}:je});if(!I&&ve&&v.state.next({...n}),U(!0),r.resolver){const{errors:cr}=await te([rt]);if(oe(E),ut){const Lr=yO(n.errors,o,rt),gr=yO(cr,o,Lr.name||rt);de=gr.error,rt=gr.name,$=Gs(cr)}}else de=(await h4(Ft,s,_,r.shouldUseNativeValidation))[rt],oe(E),ut&&(de?$=!1:p.isValid&&($=await se(o,!0)));ut&&(Ft._f.deps&&Le(Ft._f.deps),ee(rt,$,de,je))}},lt=(fe,Oe)=>{if(vn(n.errors,Oe)&&fe.focus)return fe.focus(),1},Le=async(fe,Oe={})=>{let rt,ut;const Ft=Zs(fe);if(U(!0),r.resolver){const ce=await Z(Po(fe)?fe:Ft);rt=Gs(ce),ut=fe?!Ft.some(oe=>vn(ce,oe)):rt}else fe?(ut=(await Promise.all(Ft.map(async ce=>{const oe=vn(o,ce);return await se(oe&&oe._f?{[ce]:oe}:oe)}))).every(Boolean),!(!ut&&!n.isValid)&&A()):ut=rt=await se(o);return v.state.next({...!ku(fe)||p.isValid&&rt!==n.isValid?{}:{name:fe},...r.resolver||!fe?{isValid:rt}:{},errors:n.errors,isValidating:!1}),Oe.shouldFocus&&!ut&&_0(o,lt,fe?Ft:u.mount),ut},$e=fe=>{const Oe={...a,...l.mount?s:{}};return Po(fe)?Oe:ku(fe)?vn(Oe,fe):fe.map(rt=>vn(Oe,rt))},ir=(fe,Oe)=>({invalid:!!vn((Oe||n).errors,fe),isDirty:!!vn((Oe||n).dirtyFields,fe),isTouched:!!vn((Oe||n).touchedFields,fe),error:vn((Oe||n).errors,fe)}),Ut=fe=>{fe&&Zs(fe).forEach(Oe=>Ma(n.errors,Oe)),v.state.next({errors:fe?n.errors:{}})},Pt=(fe,Oe,rt)=>{const ut=(vn(o,fe,{_f:{}})._f||{}).ref;To(n.errors,fe,{...Oe,ref:ut}),v.state.next({name:fe,errors:n.errors,isValid:!1}),rt&&rt.shouldFocus&&ut&&ut.focus&&ut.focus()},er=(fe,Oe)=>dd(fe)?v.values.subscribe({next:rt=>fe(C(void 0,Oe),rt)}):C(fe,Oe,!0),br=(fe,Oe={})=>{for(const rt of fe?Zs(fe):u.mount)u.mount.delete(rt),u.array.delete(rt),Oe.keepValue||(Ma(o,rt),Ma(s,rt)),!Oe.keepError&&Ma(n.errors,rt),!Oe.keepDirty&&Ma(n.dirtyFields,rt),!Oe.keepTouched&&Ma(n.touchedFields,rt),!r.shouldUnregister&&!Oe.keepDefaultValue&&Ma(a,rt);v.values.next({values:{...s}}),v.state.next({...n,...Oe.keepDirty?{isDirty:q()}:{}}),!Oe.keepIsValid&&A()},Tt=({disabled:fe,name:Oe,field:rt,fields:ut,value:Ft})=>{if(Su(fe)){const ce=fe?void 0:Po(Ft)?O3(rt?rt._f:vn(ut,Oe)._f):Ft;To(s,Oe,ce),j(Oe,ce,!1,!1,!0)}},Et=(fe,Oe={})=>{let rt=vn(o,fe);const ut=Su(Oe.disabled);return To(o,fe,{...rt||{},_f:{...rt&&rt._f?rt._f:{ref:{name:fe}},name:fe,mount:!0,...Oe}}),u.mount.add(fe),rt?Tt({field:rt,disabled:Oe.disabled,name:fe}):F(fe,!0,Oe.value),{...ut?{disabled:Oe.disabled}:{},...r.progressive?{required:!!Oe.required,min:jm(Oe.min),max:jm(Oe.max),minLength:jm(Oe.minLength),maxLength:jm(Oe.maxLength),pattern:jm(Oe.pattern)}:{},name:fe,onChange:Q,onBlur:Q,ref:Ft=>{if(Ft){Et(fe,Oe),rt=vn(o,fe);const ce=Po(Ft.value)&&Ft.querySelectorAll&&Ft.querySelectorAll("input,select,textarea")[0]||Ft,oe=l4e(ce),de=rt._f.refs||[];if(oe?de.find($=>$===ce):ce===rt._f.ref)return;To(o,fe,{_f:{...rt._f,...oe?{refs:[...de.filter(M3),ce,...Array.isArray(vn(a,fe))?[{}]:[]],ref:{type:ce.type,name:fe}}:{ref:ce}}}),F(fe,!1,void 0,ce)}else rt=vn(o,fe,{}),rt._f&&(rt._f.mount=!1),(r.shouldUnregister||Oe.shouldUnregister)&&!(j$(u.array,fe)&&l.action)&&u.unMount.add(fe)}}},kt=()=>r.shouldFocusError&&_0(o,lt,u.mount),Nt=fe=>{Su(fe)&&(v.state.next({disabled:fe}),_0(o,Oe=>{Oe.disabled=fe},0,!1))},Gt=(fe,Oe)=>async rt=>{rt&&(rt.preventDefault&&rt.preventDefault(),rt.persist&&rt.persist());let ut=ts(s);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:Ft,values:ce}=await te();n.errors=Ft,ut=ce}else await se(o);Ma(n.errors,"root"),Gs(n.errors)?(v.state.next({errors:{}}),await fe(ut,rt)):(Oe&&await Oe({...n.errors},rt),kt(),setTimeout(kt)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Gs(n.errors),submitCount:n.submitCount+1,errors:n.errors})},vr=(fe,Oe={})=>{vn(o,fe)&&(Po(Oe.defaultValue)?be(fe,vn(a,fe)):(be(fe,Oe.defaultValue),To(a,fe,Oe.defaultValue)),Oe.keepTouched||Ma(n.touchedFields,fe),Oe.keepDirty||(Ma(n.dirtyFields,fe),n.isDirty=Oe.defaultValue?q(fe,vn(a,fe)):q()),Oe.keepError||(Ma(n.errors,fe),p.isValid&&A()),v.state.next({...n}))},ie=(fe,Oe={})=>{const rt=fe?ts(fe):a,ut=ts(rt),Ft=fe&&!Gs(fe)?ut:a;if(Oe.keepDefaultValues||(a=rt),!Oe.keepValues){if(Oe.keepDirtyValues||w)for(const ce of u.mount)vn(n.dirtyFields,ce)?To(Ft,ce,vn(s,ce)):be(ce,vn(Ft,ce));else{if(a8&&Po(fe))for(const ce of u.mount){const oe=vn(o,ce);if(oe&&oe._f){const de=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(tw(de)){const $=de.closest("form");if($){$.reset();break}}}}o={}}s=e.shouldUnregister?Oe.keepDefaultValues?ts(a):{}:ts(Ft),v.array.next({values:{...Ft}}),v.values.next({values:{...Ft}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!Oe.keepIsValid,l.watch=!!e.shouldUnregister,v.state.next({submitCount:Oe.keepSubmitCount?n.submitCount:0,isDirty:Oe.keepDirty?n.isDirty:!!(Oe.keepDefaultValues&&!If(fe,a)),isSubmitted:Oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe.keepDirtyValues?n.dirtyFields:Oe.keepDefaultValues&&fe?B3(a,fe):{},touchedFields:Oe.keepTouched?n.touchedFields:{},errors:Oe.keepErrors?n.errors:{},isSubmitSuccessful:Oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Bt=(fe,Oe)=>ie(dd(fe)?fe(s):fe,Oe);return{control:{register:Et,unregister:br,getFieldState:ir,handleSubmit:Gt,setError:Pt,_executeSchema:te,_getWatch:C,_getDirty:q,_updateValid:A,_removeUnmounted:W,_updateFieldArray:M,_updateDisabledField:Tt,_getFieldArray:G,_reset:ie,_resetDefaultValues:()=>dd(r.defaultValues)&&r.defaultValues().then(fe=>{Bt(fe,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:fe=>{n={...n,...fe}},_disableForm:Nt,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(fe){l=fe},get _defaultValues(){return a},get _names(){return u},set _names(fe){u=fe},get _formState(){return n},set _formState(fe){n=fe},get _options(){return r},set _options(fe){r={...r,...fe}}},trigger:Le,register:Et,handleSubmit:Gt,watch:er,setValue:be,getValues:$e,reset:Bt,resetField:vr,clearErrors:Ut,unregister:br,setError:Pt,setFocus:(fe,Oe={})=>{const rt=vn(o,fe),ut=rt&&rt._f;if(ut){const Ft=ut.refs?ut.refs[0]:ut.ref;Ft.focus&&(Ft.focus(),Oe.shouldSelect&&Ft.select())}},getFieldState:ir}}function M1(e={}){const t=Yn.useRef(),r=Yn.useRef(),[n,o]=Yn.useState({isDirty:!1,isValidating:!1,isLoading:dd(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:dd(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...h4e(e,()=>o(s=>({...s}))),formState:n});const a=t.current.control;return a._options=e,f_({subject:a._subjects.state,next:s=>{$$(s,a._proxyFormState,a._updateFormState,!0)&&o({...a._formState})}}),Yn.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Yn.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==n.isDirty&&a._subjects.state.next({isDirty:s})}},[a,n.isDirty]),Yn.useEffect(()=>{e.values&&!If(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()},[e.values,a]),Yn.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=F$(n,a),t.current}function uc({label:e,name:t,control:r}){return D(r4e,{name:t,control:r,render:({field:n,fieldState:{error:o}})=>D(Rh,{helperText:o?o.message:null,error:!!o,fullWidth:!0,label:e,variant:"outlined",...n})})}function g4e(e){return Wn.beginCell().storeUint(2003,32).storeUint(0,64).storeAddress(e).endCell()}function m4e(e){return Wn.beginCell().storeUint(3004,32).storeUint(0,64).storeAddress(e).endCell()}function y4e(e,t){return Wn.beginCell().storeUint(6007,32).storeUint(0,64).storeCoins(e).storeCoins(t).endCell()}function v4e(){const{data:e,isLoading:t}=qy();Og();const r=LE(),n=M1({defaultValues:{admin:e?.admin||""}}),o=M1({defaultValues:{verifierRegistry:e?.verifierRegistry||""}}),a=M1({defaultValues:{minTon:e?.deploymentCosts.min||"",maxTon:e?.deploymentCosts.max||""}});async function s(c){if(!e?.address)throw new Error("no address");if(c.admin!==e?.admin)try{const d=m4e(Wn.Address.parse(c.admin));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&n.setError("admin",{message:"Failed to change admin"})}catch(d){let p="Failed to change admin";"message"in d&&(p=d.message),n.setError("admin",{message:p})}}async function l(c){if(!e?.address)throw new Error("no address");if(c.verifierRegistry!==e?.verifierRegistry)try{const d=g4e(Wn.Address.parse(c.verifierRegistry));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&o.setError("verifierRegistry",{message:"Failed to change verifier registry"})}catch(d){let p="Failed to change verifier registry";"message"in d&&(p=d.message),o.setError("verifierRegistry",{message:p})}}async function u(c){if(!e?.address)throw new Error("no address");if(c.minTon!==e?.deploymentCosts.min||c.maxTon!==e?.deploymentCosts.max)try{const d=y4e(Wn.toNano(c.minTon),Wn.toNano(c.maxTon));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&a.setError("root",{message:"Failed to change deployment costs"})}catch(d){let p="Failed to change deployment costs";"message"in d&&(p=d.message),a.setError("root",{message:p})}}return J.exports.useEffect(()=>{e&&(n.reset({admin:e.admin}),o.reset({verifierRegistry:e.verifierRegistry}),a.reset({minTon:e.deploymentCosts.min,maxTon:e.deploymentCosts.max}))},[e]),Lt(ks,{spacing:4,p:4,children:[D("h1",{children:"Sources Registry"}),t&&D(yg,{}),e&&Lt(ra,{children:[D(o8,{label:"Address",data:e.address.toString()}),D("form",{id:"adminForm",onSubmit:n.handleSubmit(s),children:Lt(ks,{spacing:2,children:[!n.formState.isValid&&D(_1,{severity:"error",children:Object.entries(n.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...n.register("admin"),control:n.control,label:"Admin"}),D(ud,{text:"Save",type:"submit",disabled:!n.formState.isDirty})]})]})}),D("form",{id:"verifierRegistryForm",onSubmit:o.handleSubmit(l),children:Lt(ks,{spacing:2,children:[!o.formState.isValid&&D(_1,{severity:"error",children:Object.entries(o.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...o.register("verifierRegistry"),control:o.control,label:"Verifier Reg."}),D(ud,{text:"Save",type:"submit",disabled:!o.formState.isDirty})]})]})}),D("form",{id:"sourcesRegistryForm",onSubmit:a.handleSubmit(u),children:Lt(ks,{spacing:2,children:[!a.formState.isValid&&D(_1,{severity:"error",children:Object.entries(a.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...a.register("minTon"),control:a.control,label:"Min Ton"}),D(uc,{...a.register("maxTon"),control:a.control,label:"Max Ton"}),D(ud,{text:"Save",type:"submit",disabled:!a.formState.isDirty})]})]})})]})]})}const X$={removeVerifier:435836471,updateVerifier:1610798618,forwardMessage:1965127512};function vO(e){return $b(xwe(e))}function b4e(e){let t=e.split(".");return((+t[0]*256+ +t[1])*256+ +t[2])*256+ +t[3]}function w4e(){return{serialize:(e,t)=>{t.storeSlice(e)},parse:e=>e}}function x4e(e){let t=Wn.beginCell();t.storeUint(X$.updateVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.storeUint(e.quorum,8);let r=Wn.Dictionary.empty(Wn.Dictionary.Keys.BigUint(256),w4e());return e.endpoints.forEach(function(n,o){r.set(o,Wn.beginCell().storeUint(n,32).endCell().beginParse())}),t.storeDict(r),t.storeRef(Wn.beginCell().storeBuffer(Buffer.from(e.name)).endCell()),t.storeRef(Wn.beginCell().storeBuffer(Buffer.from(e.marketingUrl)).endCell()),t.endCell()}function _4e(e){let t=Wn.beginCell();return t.storeUint(X$.removeVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.endCell()}function bO({verifier:e,altColor:t,isNew:r}){const n=LE(),{data:o}=qy(),a=J.exports.useMemo(()=>Object.entries(e.pubKeyEndpoints).map(([p,v])=>({pubKey:p,ip:v})),[e.pubKeyEndpoints]),s=M1({defaultValues:{quorum:e.quorum.toString()||"",name:e.name||"",url:e.url||"",pubKeyEndpoints:a||[]},mode:"onChange"});async function l(p){if(!p.name){s.setError("name",{message:"Name is required"});return}if(!p.url){s.setError("url",{message:"Url is required"});return}if(!p.quorum||Number(p.quorum)<1){s.setError("quorum",{message:"Quorum is required and should be at least 1"});return}try{await n(o?.verifierRegistry??"",Wn.toNano(r?"1000":"0.01"),x4e({id:vO(p.name),quorum:Number(p.quorum),endpoints:new Map(p.pubKeyEndpoints.map(({pubKey:w,ip:b})=>[$b(Buffer.from(w,"base64")),b4e(b)])),name:p.name,marketingUrl:p.url}))==="rejected"&&s.setError("root",{message:`Failed to update config of ${p.name}`})}catch(v){let w=`Failed to update config of ${p.name}`;"message"in v&&(w=v.message),s.setError("root",{message:w})}}const{fields:u,append:c,remove:d}=s4e({control:s.control,name:"pubKeyEndpoints"});return D("form",{id:e.admin.toString(),onSubmit:s.handleSubmit(l),children:Lt(ks,{spacing:4,px:4,py:6,style:{backgroundColor:t?"#eeeeef":"transparent"},children:[!s.formState.isValid&&D(_1,{severity:"error",children:Object.entries(s.formState.errors).map(([p,v])=>D("div",{children:v.message},p))}),Lt(ks,{flexDirection:"row",alignItems:"center",gap:2,children:[D("h3",{style:{margin:0},children:r?"Add Verifier":s.getValues("name")}),!r&&D(ud,{text:"Remove",onClick:()=>{n(o.verifierRegistry,Wn.toNano("0.01"),_4e({id:vO(s.getValues("name"))}))}})]}),D(o8,{label:"Admin",data:e.admin.toString()}),r&&D(uc,{label:"Name",name:"name",control:s.control}),D(uc,{label:"Url",name:"url",control:s.control}),D(uc,{label:"Quorum",name:"quorum",control:s.control}),Lt(ks,{spacing:2,alignItems:"flex-start",children:[Lt(ks,{direction:"row",spacing:4,alignItems:"center",children:[D("h4",{children:"Public Key Endpoints"}),D(ud,{size:"small",text:"Add",onClick:()=>{c({pubKey:"",ip:""})}})]}),u.map((p,v)=>Lt(Ov,{container:!0,alignItems:"center",gap:2,wrap:"nowrap",children:[D(Ov,{item:!0,xs:6,children:D(uc,{label:`PubKey-${v}`,name:`pubKeyEndpoints.${v}.pubKey`,control:s.control})}),D(Ov,{item:!0,xs:5,children:D(uc,{label:`IP-${v}`,name:`pubKeyEndpoints.${v}.ip`,control:s.control})}),D(Ov,{item:!0,xs:1,children:D(ud,{text:"Remove",onClick:()=>d(v)})})]},p.id))]}),D(ud,{text:r?"Add verifier":"Update config",type:"submit",disabled:!s.formState.isDirty})]})})}function S4e(){const{data:e,isLoading:t}=n_(),{data:r}=qy(),[n]=Og();return Lt(ks,{spacing:4,p:4,children:[D("h1",{children:"Verifier Registry"}),D(o8,{label:"Address",data:r?.verifierRegistry??""}),t&&D(yg,{}),Lt(ks,{children:[t&&"Loading...",e?.map((o,a)=>D(bO,{verifier:o,altColor:a%2!==1,isNew:!1}))]}),n.account?.address&&D(bO,{isNew:!0,altColor:!0,verifier:{admin:Wn.Address.parse(n.account?.address),name:"",quorum:0,url:"",pubKeyEndpoints:{}}})]})}function C4e(){return Lt("div",{children:[window.isTestnet&&D(i8,{}),Lt(ks,{direction:"row",justifyContent:"space-between",alignItems:"center",p:4,children:[D("h1",{children:"Admin"}),D(Qx,{})]}),D(v4e,{}),D(S4e,{}),D(Jb,{})]})}const k4e=lr(kn)(({theme:e})=>t=>({display:t.isMobile?"flex":"inherit",alignItems:t.isMobile?"center":"inherit",fontWight:700,color:"#fff",height:t.isMobile?90:100,background:"#fff",borderBottomLeftRadius:e.spacing(6),borderBottomRightRadius:e.spacing(6),border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px"}));function E4e(){const e=ua(),t=sa(e.breakpoints.down("md")),r=sa(e.breakpoints.down("lg"));return D(k4e,{px:r?3.4:0,isMobile:t,children:Lt(TN,{mb:5,children:[Lt(mp,{children:[D("img",{src:Rw,width:30,height:30,alt:"App icon"}),D(kx,{children:"TACT DEPLOYER"})]}),Lt(AN,{children:[D(Fn,{mr:t?0:2,children:D(Qx,{})}),!t&&Lt(mp,{href:lk,target:"_blank",children:[D("img",{src:b6,alt:"Github icon",width:20,height:20}),D(Vk,{children:"GitHub"})]})]})]})})}const A4e=lr("input")({display:"flex",alignItems:"center",paddingLeft:14,boxSizing:"border-box",height:34,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),T4e=Wn.Cell.fromBoc(Buffer.from("te6cckEBAQEADgAAGJRqmLYAAAAAAAAAAOnNeQ0=","base64"))[0];async function U3(e){const t=`https://tact-deployer${window.isTestnet?"-testnet":""}.infura-ipfs.io`;return fetch(`${t}/ipfs/${e}`)}function c8({workchain:e}){const{ipfsHash:t}=Z9(),{data:r,error:n,isLoading:o}=Cc(["tactDeploy",t],async()=>{if(!t)return null;const a=await Ep(),s=await U3(t).then(_=>_.json()),l=await U3(s.pkg).then(_=>_.json()),u=await U3(s.dataCell).then(_=>_.arrayBuffer()).then(_=>Wn.Cell.fromBoc(Buffer.from(_))[0]),c=Wn.Cell.fromBoc(Buffer.from(l.code,"base64"))[0],d=Wn.contractAddress(e,{code:c,data:u}),p={code:c,data:u},v=u.hash().toString("base64"),w=c.hash().toString("base64"),b=await a.isContractDeployed(d),m=b&&await DE(w);return{address:d,stateInit:p,pkg:l,codeCellHash:w,dataCellHash:v,isDeployed:b,hasProof:m}});return{data:r,error:n,isLoading:o}}function I4e(e,t,r){const{sendTXN:n,data:o,clearTXN:a}=eF("deployContract",async s=>{if(!r)throw new Error("No address");const l=await Ep();return s>20?"error":await l.isContractDeployed(r)?"success":"issued"});return{sendTXN:()=>{!r||n(r,Wn.toNano(e),T4e,t)},status:o.status,clearTXN:a}}function R4e(){const e=[],{data:t,error:r}=c8({workchain:0});return t&&(e.push({title:"Name",value:t.pkg.name}),e.push({title:"Compiler",value:`Tact ${t.pkg.compiler.version}`}),e.push({title:"Code Hash",value:t.codeCellHash}),e.push({title:"Data Hash",value:t.dataCellHash}),e.push({title:"Workchain",value:IF(t.address.toString())})),D(KE,{title:"Contract",icon:qE,dataRows:e,isLoading:!1,isFlexibleWrapper:!0})}function P4e(){const[e,t]=J.exports.useState("0.5"),{data:r,error:n}=c8({workchain:0}),{sendTXN:o,status:a}=I4e(e,r?.stateInit,r?.address),{markPreloaded:s}=EF(),l=Mc(),u=Gu();let c="";if(n)c=n.toString();else if(r?.isDeployed)c=Lt("div",{children:["Contract is already deployed.",!r.hasProof&&" You can publish its sources to verify it."]});else switch(a){case"initial":c="Contract is ready for deployment";break;case"pending":c="Please approve the transaction in your wallet";break;case"issued":c="Transaction was issued. Monitoring deployment...";break;case"rejected":c="Transaction was rejected. Please retry.";break;case"error":c="Transaction failed. Please retry.";break;case"expired":c="Transaction expired. Please retry.";break;case"success":c="Contract deployed successfully! You can now publish its sources to verify it.";break}let d=Lt(Va,{disabled:a==="pending"||a==="issued"||r?.isDeployed,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{o()},children:[(a==="pending"||a==="issued")&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Deploy"]});return(a==="success"||r?.isDeployed&&!r.hasProof)&&(d=D(Va,{fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(),l("/"+r.address.toString()),u.addFiles([new File([JSON.stringify(r.pkg)],r.pkg.name+".pkg",{type:"text/plain"})])},children:"Verify"})),Lt(vg,{mb:6,children:[Lt(Fn,{p:"30px 24px 0 24px",children:[D(bg,{children:D("img",{src:qE,alt:"publish icon",width:41,height:41})}),D(Kd,{children:"Deploy"})]}),Lt(kn,{children:[Lt(kn,{sx:{padding:"0 30px"},children:[Lt(WE,{gap:2,sx:{mt:2},children:[D(Ic,{children:D("div",{children:"Value to initialize contract (TON)"})}),D(Ic,{children:D(A4e,{disabled:!!r?.isDeployed||a==="issued"||a=="pending",value:e,type:"number",onChange:p=>{t(p.target.value)}})})]}),D(Is,{type:hs.HINT,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:Lt(zd,{sx:{marginBottom:0},children:[D(kn,{sx:{fontWeight:600},children:"Contract Address"}),D(kn,{sx:{fontSize:18,fontWeight:700,wordBreak:"break-all"},children:r?.address.toString()})]})})}),D(Is,{type:hs.INFO,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:D(zd,{sx:{marginBottom:0},children:c})})}),d]}),D(Fn,{mb:3,sx:{justifyContent:"center"}})]})]})}function M4e(){const e=ua(),t=sa(e.breakpoints.down("md")),r=sa(e.breakpoints.down("lg")),{data:n,error:o,isLoading:a}=c8({workchain:0});return Lt(kn,{children:[window.isTestnet&&D(i8,{}),D(E4e,{}),Lt(O$,{px:r?"20px":0,children:[a&&Lt(Ic,{sx:{marginTop:3},children:[D(es,{height:330,variant:"rounded",sx:{marginBottom:3}}),D(es,{height:280,variant:"rounded"})]}),!a&&Lt(ra,{children:[D(U$,{isMobile:t,children:D(R4e,{})}),D(P4e,{})]})]}),")",D(Jb,{})]})}const B4e=new qW({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});swe();BS.createRoot(document.getElementById("root")).render(D(Ohe,{maxSnack:3,children:D(BZ,{theme:YCe,children:D(IK,{client:B4e,children:D(N1e,{manifestUrl:"https://verifier.ton.org/tonconnect-manifest.json",children:D(zG,{basename:"/",children:Lt(FG,{children:[D(Xp,{path:"/interact",element:D(GCe,{})}),D(Xp,{path:"/admin",element:D(C4e,{})}),D(Xp,{path:"/tactDeployer/:ipfsHash",element:D(M4e,{})}),D(Xp,{path:"/:contractAddress",element:D(dO,{})}),D(Xp,{path:"/",element:D(dO,{})})]})})})})})}));export{ow as g}; + `},Q5e={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Z5e(e){let{announcements:t=Q5e,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=Y5e}=e;const{announce:a,announcement:s}=q5e(),l=Qy("DndLiveRegion"),[u,c]=J.exports.useState(!1);if(J.exports.useEffect(()=>{c(!0)},[]),K5e(J.exports.useMemo(()=>({onDragStart(p){let{active:v}=p;a(t.onDragStart({active:v}))},onDragMove(p){let{active:v,over:w}=p;t.onDragMove&&a(t.onDragMove({active:v,over:w}))},onDragOver(p){let{active:v,over:w}=p;a(t.onDragOver({active:v,over:w}))},onDragEnd(p){let{active:v,over:w}=p;a(t.onDragEnd({active:v,over:w}))},onDragCancel(p){let{active:v,over:w}=p;a(t.onDragCancel({active:v,over:w}))}}),[a,t])),!u)return null;const d=Lt(ra,{children:[D(H5e,{id:n,value:o.draggable}),D(V5e,{id:l,announcement:s})]});return r?bl.exports.createPortal(d,r):d}var _a;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_a||(_a={}));function Qb(){}function g3(e,t){return J.exports.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function X5e(){for(var e=arguments.length,t=new Array(e),r=0;r[...t].filter(n=>n!=null),[...t])}const au=Object.freeze({x:0,y:0});function i$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function o$(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function J5e(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function WB(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function a$(e,t){if(!e||e.length===0)return null;const[r]=e;return t?r[t]:r}function VB(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const e3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=VB(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,u=r.get(l);if(u){const c=i$(VB(u),o);a.push({id:l,data:{droppableContainer:s,value:c}})}}return a.sort(o$)},t3e=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=WB(t),a=[];for(const s of n){const{id:l}=s,u=r.get(l);if(u){const c=WB(u),d=o.reduce((v,w,b)=>v+i$(c[b],w),0),p=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:p}})}}return a.sort(o$)};function r3e(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const u=r3e(l,t);u>0&&o.push({id:s,data:{droppableContainer:a,value:u}})}}return o.sort(J5e)};function i3e(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function s$(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:au}function o3e(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const a3e=o3e(1);function s3e(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function l3e(e,t,r){const n=s3e(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,u=e.left-s-(1-o)*parseFloat(r),c=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,p=a?e.height/a:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const u3e={ignoreTransform:!1};function $g(e,t){t===void 0&&(t=u3e);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{getComputedStyle:c}=$s(e),{transform:d,transformOrigin:p}=c(e);d&&(r=l3e(r,d,p))}const{top:n,left:o,width:a,height:s,bottom:l,right:u}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:u}}function qB(e){return $g(e,{ignoreTransform:!0})}function c3e(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function d3e(e,t){return t===void 0&&(t=$s(e).getComputedStyle(e)),t.position==="fixed"}function f3e(e,t){t===void 0&&(t=$s(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function l_(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(XE(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!Gy(o)||O5e(o)||r.includes(o))return r;const{getComputedStyle:a}=$s(o),s=a(o);return o!==e&&f3e(o,s)&&r.push(o),d3e(o,s)?r:n(o.parentNode)}return e?n(e):r}function l$(e){const[t]=l_(e,1);return t??null}function m3(e){return!s_||!e?null:jg(e)?e:ZE(e)?XE(e)||e===Fg(e).scrollingElement?window:Gy(e)?e:null:null}function u$(e){return jg(e)?e.scrollX:e.scrollLeft}function c$(e){return jg(e)?e.scrollY:e.scrollTop}function l4(e){return{x:u$(e),y:c$(e)}}var Oa;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Oa||(Oa={}));function d$(e){return!s_||!e?!1:e===document.scrollingElement}function f$(e){const t={x:0,y:0},r=d$(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:n,minScroll:t}}const p3e={x:.2,y:.2};function h3e(e,t,r,n,o){let{top:a,left:s,right:l,bottom:u}=r;n===void 0&&(n=10),o===void 0&&(o=p3e);const{isTop:c,isBottom:d,isLeft:p,isRight:v}=f$(e),w={x:0,y:0},b={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!c&&a<=t.top+m.height?(w.y=Oa.Backward,b.y=n*Math.abs((t.top+m.height-a)/m.height)):!d&&u>=t.bottom-m.height&&(w.y=Oa.Forward,b.y=n*Math.abs((t.bottom-m.height-u)/m.height)),!v&&l>=t.right-m.width?(w.x=Oa.Forward,b.x=n*Math.abs((t.right-m.width-l)/m.width)):!p&&s<=t.left+m.width&&(w.x=Oa.Backward,b.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:w,speed:b}}function g3e(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function p$(e){return e.reduce((t,r)=>Mh(t,l4(r)),au)}function m3e(e){return e.reduce((t,r)=>t+u$(r),0)}function y3e(e){return e.reduce((t,r)=>t+c$(r),0)}function v3e(e,t){if(t===void 0&&(t=$g),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);!l$(e)||(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const b3e=[["x",["left","right"],m3e],["y",["top","bottom"],y3e]];class t8{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=l_(r),o=p$(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of b3e)for(const u of s)Object.defineProperty(this,u,{get:()=>{const c=l(n),d=o[a]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class b0{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function w3e(e){const{EventTarget:t}=$s(e);return e instanceof t?e:Fg(e)}function y3(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var ml;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ml||(ml={}));function KB(e){e.preventDefault()}function x3e(e){e.stopPropagation()}var Hi;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Hi||(Hi={}));const h$={start:[Hi.Space,Hi.Enter],cancel:[Hi.Esc],end:[Hi.Space,Hi.Enter]},_3e=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Hi.Right:return{...r,x:r.x+25};case Hi.Left:return{...r,x:r.x-25};case Hi.Down:return{...r,y:r.y+25};case Hi.Up:return{...r,y:r.y-25}}};class r8{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new b0(Fg(r)),this.windowListeners=new b0($s(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ml.Resize,this.handleCancel),this.windowListeners.add(ml.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ml.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&v3e(n),r(au)}handleKeyDown(t){if(e8(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=h$,coordinateGetter:s=_3e,scrollBehavior:l="smooth"}=o,{code:u}=t;if(a.end.includes(u)){this.handleEnd(t);return}if(a.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=n.current,d=c?{x:c.left,y:c.top}:au;this.referenceCoordinates||(this.referenceCoordinates=d);const p=s(t,{active:r,context:n.current,currentCoordinates:d});if(p){const v=my(p,d),w={x:0,y:0},{scrollableAncestors:b}=n.current;for(const m of b){const _=t.code,{isTop:k,isRight:A,isLeft:U,isBottom:M,maxScroll:L,minScroll:F}=f$(m),j=g3e(m),ee={x:Math.min(_===Hi.Right?j.right-j.width/2:j.right,Math.max(_===Hi.Right?j.left:j.left+j.width/2,p.x)),y:Math.min(_===Hi.Down?j.bottom-j.height/2:j.bottom,Math.max(_===Hi.Down?j.top:j.top+j.height/2,p.y))},te=_===Hi.Right&&!A||_===Hi.Left&&!U,Z=_===Hi.Down&&!M||_===Hi.Up&&!k;if(te&&ee.x!==p.x){const se=m.scrollLeft+v.x,W=_===Hi.Right&&se<=L.x||_===Hi.Left&&se>=F.x;if(W&&!v.y){m.scrollTo({left:se,behavior:l});return}W?w.x=m.scrollLeft-se:w.x=_===Hi.Right?m.scrollLeft-L.x:m.scrollLeft-F.x,w.x&&m.scrollBy({left:-w.x,behavior:l});break}else if(Z&&ee.y!==p.y){const se=m.scrollTop+v.y,W=_===Hi.Down&&se<=L.y||_===Hi.Up&&se>=F.y;if(W&&!v.x){m.scrollTo({top:se,behavior:l});return}W?w.y=m.scrollTop-se:w.y=_===Hi.Down?m.scrollTop-L.y:m.scrollTop-F.y,w.y&&m.scrollBy({top:-w.y,behavior:l});break}}this.handleMove(t,Mh(my(p,this.referenceCoordinates),w))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}r8.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=h$,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function GB(e){return Boolean(e&&"distance"in e)}function YB(e){return Boolean(e&&"delay"in e)}class n8{constructor(t,r,n){var o;n===void 0&&(n=w3e(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=Fg(s),this.documentListeners=new b0(this.document),this.listeners=new b0(n),this.windowListeners=new b0($s(s)),this.initialCoordinates=(o=s4(a))!=null?o:au,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(ml.Resize,this.handleCancel),this.windowListeners.add(ml.DragStart,KB),this.windowListeners.add(ml.VisibilityChange,this.handleCancel),this.windowListeners.add(ml.ContextMenu,KB),this.documentListeners.add(ml.Keydown,this.handleKeydown),r){if(GB(r))return;if(YB(r)){this.timeoutId=setTimeout(this.handleStart,r.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(ml.Click,x3e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ml.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const u=(r=s4(t))!=null?r:au,c=my(o,u);if(!n&&l){if(YB(l))return y3(c,l.tolerance)?this.handleCancel():void 0;if(GB(l))return l.tolerance!=null&&y3(c,l.tolerance)?this.handleCancel():y3(c,l.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),s(u)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Hi.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const S3e={move:{name:"pointermove"},end:{name:"pointerup"}};class g$ extends n8{constructor(t){const{event:r}=t,n=Fg(r.target);super(t,S3e,n)}}g$.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const C3e={move:{name:"mousemove"},end:{name:"mouseup"}};var u4;(function(e){e[e.RightClick=2]="RightClick"})(u4||(u4={}));class m$ extends n8{constructor(t){super(t,C3e,Fg(t.event.target))}}m$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===u4.RightClick?!1:(n?.({event:r}),!0)}}];const v3={move:{name:"touchmove"},end:{name:"touchend"}};class y$ extends n8{constructor(t){super(t,v3)}static setup(){return window.addEventListener(v3.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(v3.move.name,t)};function t(){}}}y$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var w0;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(w0||(w0={}));var Zb;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zb||(Zb={}));function k3e(e){let{acceleration:t,activator:r=w0.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:s=5,order:l=Zb.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:v}=e;const w=A3e({delta:p,disabled:!a}),[b,m]=U5e(),_=J.exports.useRef({x:0,y:0}),k=J.exports.useRef({x:0,y:0}),A=J.exports.useMemo(()=>{switch(r){case w0.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case w0.DraggableRect:return o}},[r,o,u]),U=J.exports.useRef(null),M=J.exports.useCallback(()=>{const F=U.current;if(!F)return;const j=_.current.x*k.current.x,ee=_.current.y*k.current.y;F.scrollBy(j,ee)},[]),L=J.exports.useMemo(()=>l===Zb.TreeOrder?[...c].reverse():c,[l,c]);J.exports.useEffect(()=>{if(!a||!c.length||!A){m();return}for(const F of L){if(n?.(F)===!1)continue;const j=c.indexOf(F),ee=d[j];if(!ee)continue;const{direction:te,speed:Z}=h3e(F,ee,A,t,v);for(const se of["x","y"])w[se][te[se]]||(Z[se]=0,te[se]=0);if(Z.x>0||Z.y>0){m(),U.current=F,b(M,s),_.current=Z,k.current=te;return}}_.current={x:0,y:0},k.current={x:0,y:0},m()},[t,M,n,m,a,s,JSON.stringify(A),JSON.stringify(w),b,c,L,d,JSON.stringify(v)])}const E3e={x:{[Oa.Backward]:!1,[Oa.Forward]:!1},y:{[Oa.Backward]:!1,[Oa.Forward]:!1}};function A3e(e){let{delta:t,disabled:r}=e;const n=a4(t);return Yy(o=>{if(r||!n||!o)return E3e;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[Oa.Backward]:o.x[Oa.Backward]||a.x===-1,[Oa.Forward]:o.x[Oa.Forward]||a.x===1},y:{[Oa.Backward]:o.y[Oa.Backward]||a.y===-1,[Oa.Forward]:o.y[Oa.Forward]||a.y===1}}},[r,t,n])}function T3e(e,t){const r=t!==null?e.get(t):void 0,n=r?r.node.current:null;return Yy(o=>{var a;return t===null?null:(a=n??o)!=null?a:null},[n,t])}function I3e(e,t){return J.exports.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...a]},[]),[e,t])}var vy;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vy||(vy={}));var c4;(function(e){e.Optimized="optimized"})(c4||(c4={}));const QB=new Map;function R3e(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,s]=J.exports.useState(null),{frequency:l,measure:u,strategy:c}=o,d=J.exports.useRef(e),p=_(),v=gy(p),w=J.exports.useCallback(function(k){k===void 0&&(k=[]),!v.current&&s(A=>A===null?k:A.concat(k.filter(U=>!A.includes(U))))},[v]),b=J.exports.useRef(null),m=Yy(k=>{if(p&&!r)return QB;if(!k||k===QB||d.current!==e||a!=null){const A=new Map;for(let U of e){if(!U)continue;if(a&&a.length>0&&!a.includes(U.id)&&U.rect.current){A.set(U.id,U.rect.current);continue}const M=U.node.current,L=M?new t8(u(M),M):null;U.rect.current=L,L&&A.set(U.id,L)}return A}return k},[e,a,r,p,u]);return J.exports.useEffect(()=>{d.current=e},[e]),J.exports.useEffect(()=>{p||w()},[r,p]),J.exports.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),J.exports.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{w(),b.current=null},l))},[l,p,w,...n]),{droppableRects:m,measureDroppableContainers:w,measuringScheduled:a!=null};function _(){switch(c){case vy.Always:return!1;case vy.BeforeDragging:return r;default:return!r}}}function v$(e,t){return Yy(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function P3e(e,t){return v$(e,t)}function M3e(e){let{callback:t,disabled:r}=e;const n=JE(t),o=J.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return J.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function u_(e){let{callback:t,disabled:r}=e;const n=JE(t),o=J.exports.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return J.exports.useEffect(()=>()=>o?.disconnect(),[o]),o}function B3e(e){return new t8($g(e),e)}function ZB(e,t,r){t===void 0&&(t=B3e);const[n,o]=J.exports.useReducer(l,null),a=M3e({callback(u){if(!!e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){o();break}}}}),s=u_({callback:o});return ou(()=>{o(),e?(s?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),a?.disconnect())},[e]),n;function l(u){if(!e)return null;if(e.isConnected===!1){var c;return(c=u??r)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d}}function O3e(e){const t=v$(e);return s$(e,t)}const XB=[];function U3e(e){const t=J.exports.useRef(e),r=Yy(n=>e?n&&n!==XB&&e&&t.current&&e.parentNode===t.current.parentNode?n:l_(e):XB,[e]);return J.exports.useEffect(()=>{t.current=e},[e]),r}function L3e(e){const[t,r]=J.exports.useState(null),n=J.exports.useRef(e),o=J.exports.useCallback(a=>{const s=m3(a.target);!s||r(l=>l?(l.set(s,l4(s)),new Map(l)):null)},[]);return J.exports.useEffect(()=>{const a=n.current;if(e!==a){s(a);const l=e.map(u=>{const c=m3(u);return c?(c.addEventListener("scroll",o,{passive:!0}),[c,l4(c)]):null}).filter(u=>u!=null);r(l.length?new Map(l):null),n.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(u=>{const c=m3(u);c?.removeEventListener("scroll",o)})}},[o,e]),J.exports.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Mh(a,s),au):p$(e):au,[e,t])}function JB(e,t){t===void 0&&(t=[]);const r=J.exports.useRef(null);return J.exports.useEffect(()=>{r.current=null},t),J.exports.useEffect(()=>{const n=e!==au;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?my(e,r.current):au}function D3e(e){J.exports.useEffect(()=>{if(!s_)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function N3e(e,t){return J.exports.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function b$(e){return J.exports.useMemo(()=>e?c3e(e):null,[e])}const b3=[];function j3e(e,t){t===void 0&&(t=$g);const[r]=e,n=b$(r?$s(r):null),[o,a]=J.exports.useReducer(l,b3),s=u_({callback:a});return e.length>0&&o===b3&&a(),ou(()=>{e.length?e.forEach(u=>s?.observe(u)):(s?.disconnect(),a())},[e]),o;function l(){return e.length?e.map(u=>d$(u)?n:new t8(t(u),u)):b3}}function F3e(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Gy(t)?t:e}function $3e(e){let{measure:t}=e;const[r,n]=J.exports.useState(null),o=J.exports.useCallback(c=>{for(const{target:d}of c)if(Gy(d)){n(p=>{const v=t(d);return p?{...p,width:v.width,height:v.height}:v});break}},[t]),a=u_({callback:o}),s=J.exports.useCallback(c=>{const d=F3e(c);a?.disconnect(),d&&a?.observe(d),n(d?t(d):null)},[t,a]),[l,u]=Yb(s);return J.exports.useMemo(()=>({nodeRef:l,rect:r,setRef:u}),[r,l,u])}const z3e=[{sensor:g$,options:{}},{sensor:r8,options:{}}],H3e={current:{}},I1={draggable:{measure:qB},droppable:{measure:qB,strategy:vy.WhileDragging,frequency:c4.Optimized},dragOverlay:{measure:$g}};class x0 extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const W3e={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new x0,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Qb},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:I1,measureDroppableContainers:Qb,windowRect:null,measuringScheduled:!1},V3e={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Qb,draggableNodes:new Map,over:null,measureDroppableContainers:Qb},c_=J.exports.createContext(V3e),w$=J.exports.createContext(W3e);function q3e(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new x0}}}function K3e(e,t){switch(t.type){case _a.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _a.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case _a.DragEnd:case _a.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _a.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new x0(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case _a.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const s=new x0(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case _a.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new x0(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function G3e(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=J.exports.useContext(c_),a=a4(n),s=a4(r?.id);return J.exports.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!e8(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=N5e(d);if(p){p.focus();break}}})}},[n,t,o,s,a]),null}function Y3e(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function Q3e(e){return J.exports.useMemo(()=>({draggable:{...I1.draggable,...e?.draggable},droppable:{...I1.droppable,...e?.droppable},dragOverlay:{...I1.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Z3e(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=J.exports.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;ou(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!n)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=r(c),p=s$(d,n);if(s||(p.x=0),l||(p.y=0),a.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const v=l$(c);v&&v.scrollBy({top:p.y,left:p.x})}},[t,s,l,n,r])}const x$=J.exports.createContext({...au,scaleX:1,scaleY:1});var Jc;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Jc||(Jc={}));const X3e=J.exports.memo(function(t){var r,n,o,a;let{id:s,accessibility:l,autoScroll:u=!0,children:c,sensors:d=z3e,collisionDetection:p=n3e,measuring:v,modifiers:w,...b}=t;const m=J.exports.useReducer(K3e,void 0,q3e),[_,k]=m,[A,U]=G5e(),[M,L]=J.exports.useState(Jc.Uninitialized),F=M===Jc.Initialized,{draggable:{active:j,nodes:ee,translate:te},droppable:{containers:Z}}=_,se=j?ee.get(j):null,W=J.exports.useRef({initial:null,translated:null}),q=J.exports.useMemo(()=>{var Tn;return j!=null?{id:j,data:(Tn=se?.data)!=null?Tn:H3e,rect:W}:null},[j,se]),C=J.exports.useRef(null),[G,le]=J.exports.useState(null),[pe,be]=J.exports.useState(null),Q=gy(b,Object.values(b)),lt=Qy("DndDescribedBy",s),Le=J.exports.useMemo(()=>Z.getEnabled(),[Z]),$e=Q3e(v),{droppableRects:ir,measureDroppableContainers:Ut,measuringScheduled:Pt}=R3e(Le,{dragging:F,dependencies:[te.x,te.y],config:$e.droppable}),er=T3e(ee,j),br=J.exports.useMemo(()=>pe?s4(pe):null,[pe]),Tt=Kn(),Et=P3e(er,$e.draggable.measure);Z3e({activeNode:j?ee.get(j):null,config:Tt.layoutShiftCompensation,initialRect:Et,measure:$e.draggable.measure});const kt=ZB(er,$e.draggable.measure,Et),Nt=ZB(er?er.parentElement:null),Gt=J.exports.useRef({activatorEvent:null,active:null,activeNode:er,collisionRect:null,collisions:null,droppableRects:ir,draggableNodes:ee,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),vr=Z.getNodeFor((r=Gt.current.over)==null?void 0:r.id),ie=$3e({measure:$e.dragOverlay.measure}),Bt=(n=ie.nodeRef.current)!=null?n:er,jt=F?(o=ie.rect)!=null?o:kt:null,Ie=Boolean(ie.nodeRef.current&&ie.rect),Ae=O3e(Ie?null:kt),fe=b$(Bt?$s(Bt):null),Oe=U3e(F?vr??er:null),rt=j3e(Oe),ut=Y3e(w,{transform:{x:te.x-Ae.x,y:te.y-Ae.y,scaleX:1,scaleY:1},activatorEvent:pe,active:q,activeNodeRect:kt,containerNodeRect:Nt,draggingNodeRect:jt,over:Gt.current.over,overlayNodeRect:ie.rect,scrollableAncestors:Oe,scrollableAncestorRects:rt,windowRect:fe}),Ft=br?Mh(br,te):null,ce=L3e(Oe),oe=JB(ce),de=JB(ce,[kt]),$=Mh(ut,oe),E=jt?a3e(jt,ut):null,I=q&&E?p({active:q,collisionRect:E,droppableRects:ir,droppableContainers:Le,pointerCoordinates:Ft}):null,Y=a$(I,"id"),[ve,je]=J.exports.useState(null),dt=Ie?ut:Mh(ut,de),cr=i3e(dt,(a=ve?.rect)!=null?a:null,kt),Lr=J.exports.useCallback((Tn,In)=>{let{sensor:yt,options:Ai}=In;if(C.current==null)return;const Qn=ee.get(C.current);if(!Qn)return;const Mi=Tn.nativeEvent,ro=new yt({active:C.current,activeNode:Qn,event:Mi,options:Ai,context:Gt,onStart(no){const Bo=C.current;if(Bo==null)return;const Vi=ee.get(Bo);if(!Vi)return;const{onDragStart:ha}=Q.current,ue={active:{id:Bo,data:Vi.data,rect:W}};bl.exports.unstable_batchedUpdates(()=>{ha?.(ue),L(Jc.Initializing),k({type:_a.DragStart,initialCoordinates:no,active:Bo}),A({type:"onDragStart",event:ue})})},onMove(no){k({type:_a.DragMove,coordinates:no})},onEnd:Ko(_a.DragEnd),onCancel:Ko(_a.DragCancel)});bl.exports.unstable_batchedUpdates(()=>{le(ro),be(Tn.nativeEvent)});function Ko(no){return async function(){const{active:Vi,collisions:ha,over:ue,scrollAdjustedTranslate:Re}=Gt.current;let Ee=null;if(Vi&&Re){const{cancelDrop:H}=Q.current;Ee={activatorEvent:Mi,active:Vi,collisions:ha,delta:Re,over:ue},no===_a.DragEnd&&typeof H=="function"&&await Promise.resolve(H(Ee))&&(no=_a.DragCancel)}C.current=null,bl.exports.unstable_batchedUpdates(()=>{k({type:no}),L(Jc.Uninitialized),je(null),le(null),be(null);const H=no===_a.DragEnd?"onDragEnd":"onDragCancel";if(Ee){const ze=Q.current[H];ze?.(Ee),A({type:H,event:Ee})}})}}},[ee]),gr=J.exports.useCallback((Tn,In)=>(yt,Ai)=>{const Qn=yt.nativeEvent,Mi=ee.get(Ai);if(C.current!==null||!Mi||Qn.dndKit||Qn.defaultPrevented)return;const ro={active:Mi};Tn(yt,In.options,ro)===!0&&(Qn.dndKit={capturedBy:In.sensor},C.current=Ai,Lr(yt,In))},[ee,Lr]),Rr=I3e(d,gr);D3e(d),ou(()=>{kt&&M===Jc.Initializing&&L(Jc.Initialized)},[kt,M]),J.exports.useEffect(()=>{const{onDragMove:Tn}=Q.current,{active:In,activatorEvent:yt,collisions:Ai,over:Qn}=Gt.current;if(!In||!yt)return;const Mi={active:In,activatorEvent:yt,collisions:Ai,delta:{x:$.x,y:$.y},over:Qn};bl.exports.unstable_batchedUpdates(()=>{Tn?.(Mi),A({type:"onDragMove",event:Mi})})},[$.x,$.y]),J.exports.useEffect(()=>{const{active:Tn,activatorEvent:In,collisions:yt,droppableContainers:Ai,scrollAdjustedTranslate:Qn}=Gt.current;if(!Tn||C.current==null||!In||!Qn)return;const{onDragOver:Mi}=Q.current,ro=Ai.get(Y),Ko=ro&&ro.rect.current?{id:ro.id,rect:ro.rect.current,data:ro.data,disabled:ro.disabled}:null,no={active:Tn,activatorEvent:In,collisions:yt,delta:{x:Qn.x,y:Qn.y},over:Ko};bl.exports.unstable_batchedUpdates(()=>{je(Ko),Mi?.(no),A({type:"onDragOver",event:no})})},[Y]),ou(()=>{Gt.current={activatorEvent:pe,active:q,activeNode:er,collisionRect:E,collisions:I,droppableRects:ir,draggableNodes:ee,draggingNode:Bt,draggingNodeRect:jt,droppableContainers:Z,over:ve,scrollableAncestors:Oe,scrollAdjustedTranslate:$},W.current={initial:jt,translated:E}},[q,er,I,E,ee,Bt,jt,ir,Z,ve,Oe,$]),k3e({...Tt,delta:te,draggingRect:E,pointerCoordinates:Ft,scrollableAncestors:Oe,scrollableAncestorRects:rt});const Gr=J.exports.useMemo(()=>({active:q,activeNode:er,activeNodeRect:kt,activatorEvent:pe,collisions:I,containerNodeRect:Nt,dragOverlay:ie,draggableNodes:ee,droppableContainers:Z,droppableRects:ir,over:ve,measureDroppableContainers:Ut,scrollableAncestors:Oe,scrollableAncestorRects:rt,measuringConfiguration:$e,measuringScheduled:Pt,windowRect:fe}),[q,er,kt,pe,I,Nt,ie,ee,Z,ir,ve,Ut,Oe,rt,$e,Pt,fe]),Nr=J.exports.useMemo(()=>({activatorEvent:pe,activators:Rr,active:q,activeNodeRect:kt,ariaDescribedById:{draggable:lt},dispatch:k,draggableNodes:ee,over:ve,measureDroppableContainers:Ut}),[pe,Rr,q,kt,k,lt,ee,ve,Ut]);return Lt(n$.Provider,{value:U,children:[Lt(c_.Provider,{value:Nr,children:[D(w$.Provider,{value:Gr,children:D(x$.Provider,{value:cr,children:c})}),D(G3e,{disabled:l?.restoreFocus===!1})]}),D(Z5e,{...l,hiddenTextDescribedById:lt})]});function Kn(){const Tn=G?.autoScrollEnabled===!1,In=typeof u=="object"?u.enabled===!1:u===!1,yt=F&&!Tn&&!In;return typeof u=="object"?{...u,enabled:yt}:{enabled:yt}}}),J3e=J.exports.createContext(null),eO="button",eSe="Droppable";function tSe(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=Qy(eSe),{activators:s,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:v}=J.exports.useContext(c_),{role:w=eO,roleDescription:b="draggable",tabIndex:m=0}=o??{},_=u?.id===t,k=J.exports.useContext(_?x$:J3e),[A,U]=Yb(),[M,L]=Yb(),F=N3e(s,t),j=gy(r);ou(()=>(p.set(t,{id:t,key:a,node:A,activatorNode:M,data:j}),()=>{const te=p.get(t);te&&te.key===a&&p.delete(t)}),[p,t]);const ee=J.exports.useMemo(()=>({role:w,tabIndex:m,"aria-disabled":n,"aria-pressed":_&&w===eO?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[n,w,m,_,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:ee,isDragging:_,listeners:n?void 0:F,node:A,over:v,setNodeRef:U,setActivatorNodeRef:L,transform:k}}function rSe(){return J.exports.useContext(w$)}const nSe="Droppable",iSe={timeout:25};function oSe(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=Qy(nSe),{active:s,dispatch:l,over:u,measureDroppableContainers:c}=J.exports.useContext(c_),d=J.exports.useRef({disabled:r}),p=J.exports.useRef(!1),v=J.exports.useRef(null),w=J.exports.useRef(null),{disabled:b,updateMeasurementsFor:m,timeout:_}={...iSe,...o},k=gy(m??n),A=J.exports.useCallback(()=>{if(!p.current){p.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{c(Array.isArray(k.current)?k.current:[k.current]),w.current=null},_)},[_]),U=u_({callback:A,disabled:b||!s}),M=J.exports.useCallback((ee,te)=>{!U||(te&&(U.unobserve(te),p.current=!1),ee&&U.observe(ee))},[U]),[L,F]=Yb(M),j=gy(t);return J.exports.useEffect(()=>{!U||!L.current||(U.disconnect(),p.current=!1,U.observe(L.current))},[L,U]),ou(()=>(l({type:_a.RegisterDroppable,element:{id:n,key:a,disabled:r,node:L,rect:v,data:j}}),()=>l({type:_a.UnregisterDroppable,key:a,id:n})),[n]),J.exports.useEffect(()=>{r!==d.current.disabled&&(l({type:_a.SetDroppableDisabled,id:n,key:a,disabled:r}),d.current.disabled=r)},[n,a,r,l]),{active:s,rect:v,isOver:u?.id===n,node:L,over:u,setNodeRef:F}}function _$(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function aSe(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function e1(e){return e!==null&&e>=0}function sSe(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=_$(t,n,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},t1={scaleX:1,scaleY:1},uSe=e=>{var t;let{activeIndex:r,activeNodeRect:n,index:o,rects:a,overIndex:s}=e;const l=(t=a[r])!=null?t:n;if(!l)return null;if(o===r){const c=a[s];return c?{x:0,y:rr&&o<=s?{x:0,y:-l.height-u,...t1}:o=s?{x:0,y:l.height+u,...t1}:{x:0,y:0,...t1}};function cSe(e,t,r){const n=e[t],o=e[t-1],a=e[t+1];return n?rn.map(F=>typeof F=="object"&&"id"in F?F.id:F),[n]),b=s!=null,m=s?w.indexOf(s.id):-1,_=c?w.indexOf(c.id):-1,k=J.exports.useRef(w),A=!sSe(w,k.current),U=_!==-1&&m===-1||A,M=lSe(a);ou(()=>{A&&b&&d(w)},[A,w,b,d]),J.exports.useEffect(()=>{k.current=w},[w]);const L=J.exports.useMemo(()=>({activeIndex:m,containerId:p,disabled:M,disableTransforms:U,items:w,overIndex:_,useDragOverlay:v,sortedRects:aSe(w,u),strategy:o}),[m,p,M.draggable,M.droppable,U,w,_,u,v,o]);return D(k$.Provider,{value:L,children:t})}const fSe=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return _$(r,n,o).indexOf(t)},pSe=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:u,transition:c}=e;return!c||!n||l!==a&&o===s?!1:r?!0:s!==o&&t===u},hSe={duration:200,easing:"ease"},E$="transform",gSe=yy.Transition.toString({property:E$,duration:0,easing:"linear"}),mSe={roleDescription:"sortable"};function ySe(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,s]=J.exports.useState(null),l=J.exports.useRef(r);return ou(()=>{if(!t&&r!==l.current&&n.current){const u=o.current;if(u){const c=$g(n.current,{ignoreTransform:!0}),d={x:u.left-c.left,y:u.top-c.top,scaleX:u.width/c.width,scaleY:u.height/c.height};(d.x||d.y)&&s(d)}}r!==l.current&&(l.current=r)},[t,r,n,o]),J.exports.useEffect(()=>{a&&s(null)},[a]),a}function A$(e){let{animateLayoutChanges:t=pSe,attributes:r,disabled:n,data:o,getNewIndex:a=fSe,id:s,strategy:l,resizeObserverConfig:u,transition:c=hSe}=e;const{items:d,containerId:p,activeIndex:v,disabled:w,disableTransforms:b,sortedRects:m,overIndex:_,useDragOverlay:k,strategy:A}=J.exports.useContext(k$),U=vSe(n,w),M=d.indexOf(s),L=J.exports.useMemo(()=>({sortable:{containerId:p,index:M,items:d},...o}),[p,o,M,d]),F=J.exports.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:j,node:ee,isOver:te,setNodeRef:Z}=oSe({id:s,data:L,disabled:U.droppable,resizeObserverConfig:{updateMeasurementsFor:F,...u}}),{active:se,activatorEvent:W,activeNodeRect:q,attributes:C,setNodeRef:G,listeners:le,isDragging:pe,over:be,setActivatorNodeRef:Q,transform:lt}=tSe({id:s,data:L,attributes:{...mSe,...r},disabled:U.draggable}),Le=B5e(Z,G),$e=Boolean(se),ir=$e&&!b&&e1(v)&&e1(_),Ut=!k&&pe,Pt=Ut&&ir?lt:null,br=ir?Pt??(l??A)({rects:m,activeNodeRect:q,activeIndex:v,overIndex:_,index:M}):null,Tt=e1(v)&&e1(_)?a({id:s,items:d,activeIndex:v,overIndex:_}):M,Et=se?.id,kt=J.exports.useRef({activeId:Et,items:d,newIndex:Tt,containerId:p}),Nt=d!==kt.current.items,Gt=t({active:se,containerId:p,isDragging:pe,isSorting:$e,id:s,index:M,items:d,newIndex:kt.current.newIndex,previousItems:kt.current.items,previousContainerId:kt.current.containerId,transition:c,wasDragging:kt.current.activeId!=null}),vr=ySe({disabled:!Gt,index:M,node:ee,rect:j});return J.exports.useEffect(()=>{$e&&kt.current.newIndex!==Tt&&(kt.current.newIndex=Tt),p!==kt.current.containerId&&(kt.current.containerId=p),d!==kt.current.items&&(kt.current.items=d)},[$e,Tt,p,d]),J.exports.useEffect(()=>{if(Et===kt.current.activeId)return;if(Et&&!kt.current.activeId){kt.current.activeId=Et;return}const Bt=setTimeout(()=>{kt.current.activeId=Et},50);return()=>clearTimeout(Bt)},[Et]),{active:se,activeIndex:v,attributes:C,data:L,rect:j,index:M,newIndex:Tt,items:d,isOver:te,isSorting:$e,isDragging:pe,listeners:le,node:ee,overIndex:_,over:be,setNodeRef:Le,setActivatorNodeRef:Q,setDroppableNodeRef:Z,setDraggableNodeRef:G,transform:vr??br,transition:ie()};function ie(){if(vr||Nt&&kt.current.newIndex===M)return gSe;if(!(Ut&&!e8(W)||!c)&&($e||Gt))return yy.Transition.toString({...c,property:E$})}}function vSe(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function Xb(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const bSe=[Hi.Down,Hi.Right,Hi.Up,Hi.Left],wSe=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(bSe.includes(e.code)){if(e.preventDefault(),!r||!n)return;const u=[];a.getEnabled().forEach(p=>{if(!p||p!=null&&p.disabled)return;const v=o.get(p.id);if(!!v)switch(e.code){case Hi.Down:n.topv.top&&u.push(p);break;case Hi.Left:n.left>v.left&&u.push(p);break;case Hi.Right:n.left1&&(d=c[1].id),d!=null){const p=a.get(r.id),v=a.get(d),w=v?o.get(v.id):null,b=v?.node.current;if(b&&w&&p&&v){const _=l_(b).some((F,j)=>l[j]!==F),k=T$(p,v),A=xSe(p,v),U=_||!k?{x:0,y:0}:{x:A?n.width-w.width:0,y:A?n.height-w.height:0},M={x:w.left,y:w.top};return U.x&&U.y?M:my(M,U)}}}};function T$(e,t){return!Xb(e)||!Xb(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function xSe(e,t){return!Xb(e)||!Xb(t)||!T$(e,t)?!1:e.data.current.sortable.indext(!0),o=()=>t(!1);return J.exports.useEffect(()=>{const a=r.current;if(a)return a.addEventListener("mouseover",n),a.addEventListener("mouseout",o),()=>{a.removeEventListener("mouseover",n),a.removeEventListener("mouseout",o)}},[r.current]),{hoverRef:r,isHover:e}}const SSe="/assets/delete.42fb1897.svg",CSe="/assets/dnd.dcf4594c.svg",kSe=to("input")({display:"flex",alignItems:"center",width:300,height:44,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",paddingLeft:10,outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),is=to(sk)({border:"none",padding:0}),th=to(sk)({fontWeight:700}),Kl=to("hr")({display:"block",width:"100%",height:1,backgroundColor:"#ccc",border:"none"}),ESe=e=>e.replace(/\/+/g,"/").replace(/^\/[^\/]/,"").replace(/\/$/,"");function tO({file:e,pos:t,isHover:r}){const n=e.fileObj.name,{attributes:o,listeners:a}=A$({id:n}),s=ua(),l=sa(s.breakpoints.down("lg")),{setInclueInCommand:u,setDirectory:c,removeFile:d}=Gu(),{data:p}=Yu(),v=!!p?.result?.msgCell;return Lt(ra,{children:[D(is,{sx:{paddingLeft:1},...o,...a,children:Lt(Fn,{sx:{color:"#D8D8D8"},children:[t,".",D(Fn,{ml:5,style:{cursor:"pointer",visibility:r?"visible":"hidden"},children:D("img",{src:CSe,alt:"Drag n drop icon",width:24,height:24})})]})}),D(is,{children:D(kSe,{disabled:v,value:e.folder,onBlur:w=>{c(n,ESe(w.target.value))},onChange:w=>{c(n,w.target.value)}})}),D(is,{sx:{paddingLeft:l?2:0},children:Lt(Fn,{sx:{flexDirection:"column",justifyContent:"center",alignItems:"flex-start"},children:[D(Fo,{sx:{fontSize:14},children:e.fileObj.name}),Lt(Fo,{sx:{fontSize:12,color:"#C1C1C1"},children:[e.fileObj.size," bytes"]})]})}),D(is,{children:D(bae,{disabled:v,checked:e.includeInCommand,onChange:w=>{u(n,w.target.checked)}})}),D(is,{align:"right",children:D(js,{sx:{visibility:r?"visible":"hidden",opacity:.5,cursor:"pointer",marginRight:1},onClick:()=>{d(n)},children:D("img",{src:SSe,alt:"Delete icon",width:18,height:18})})})]})}function ASe({file:e,pos:t}){const r=e.fileObj.name,{hoverRef:n,isHover:o}=_Se(),{data:a}=Yu(),s=!!a?.result?.msgCell,{setNodeRef:l,transform:u,transition:c,isDragging:d}=A$({id:r}),p={transform:yy.Transform.toString(u),transition:c};return s?D(Ec,{sx:{height:60},children:D(tO,{file:e,pos:t,isDragging:!1,isHover:!1})}):D(Ec,{sx:{height:60,transition:".15s all","&:hover":{background:"#FAFAFA"}},ref:v=>{l(v),n.current=v},style:p,children:D(tO,{file:e,pos:t,isDragging:d,isHover:o})},r)}function TSe(){const{files:e,reorderFiles:t}=Gu(),{data:r}=Yu(),n=ua(),o=sa(n.breakpoints.down("lg")),a=!!r?.result?.msgCell,s=X5e(g3(m$,{}),g3(y$,{}),g3(r8,{coordinateGetter:wSe}));function l(u){const{active:c,over:d}=u;c.id!==d.id&&t(c.id,d.id)}return D(X3e,{sensors:s,collisionDetection:e3e,onDragEnd:l,modifiers:[$5e,F5e],children:D(Zae,{children:Lt(ok,{sx:{minWidth:650},children:[Lt(vL,{sx:{"&.MuiTableHead-root th":{border:"none"}},children:[Lt(Ec,{sx:{fontWeight:700},children:[D(th,{sx:{paddingLeft:0,paddingBottom:o?0:2,width:100},children:"Order"}),D(th,{sx:{paddingLeft:0,paddingBottom:o?0:2},children:"Directory"}),D(th,{sx:{paddingLeft:o?2:0,width:300,paddingBottom:o?0:2},children:"File"}),D(th,{sx:{paddingLeft:0,width:150,paddingBottom:o?0:2},children:"Include in command"}),D(th,{sx:{paddingLeft:0,width:100,paddingBottom:o?0:2}})]}),Lt(Ec,{children:[D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})}),D(is,{sx:{paddingBottom:o?0:2},children:D(Kl,{})})]})]}),D(ak,{children:D(dSe,{disabled:a,items:e.map(u=>u.fileObj.name),strategy:uSe,children:e.map((u,c)=>D(ASe,{file:u,pos:c+1},u.fileObj.name))})})]})})})}const w3=to(tL)({flexGrow:1}),x3=to(gL)(({theme:e})=>({borderRadius:e.spacing(1.2),height:e.spacing(5.3),minWidth:150,".MuiOutlinedInput-notchedOutline":{border:"1px solid #D8D8D8"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{border:"1px solid #807e7e"},"&:hover .MuiOutlinedInput-notchedOutline":{border:"1px solid #b0b0b0"}})),r1=to(rL)(({theme:e})=>({color:"#000",fontSize:12,marginLeft:e.spacing(1),marginBottom:e.spacing(1)})),ISe=to("input")(({theme:e})=>({display:"flex",alignItems:"center",boxSizing:"border-box",width:"100%",flex:2,height:e.spacing(5.3),borderRadius:e.spacing(1.2),border:"1px solid #D8D8D8",outline:"none",padding:"0 40px 0 125px",color:"#000",background:"transparent",fontFamily:"Mulish",fontSize:14,"&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}})),RSe="/assets/undo.944d3e45.svg";function PSe(){const{compilerSettings:e,setOverrideCommandLine:t,setFuncCliVersion:r,setTactCliVersion:n,compiler:o,setCompiler:a}=OE(),{data:s}=Yu(),l=ua(),u=sa(l.breakpoints.down("md")),c=!!s?.result?.msgCell,{data:{funcVersions:d,tactVersions:p}}=BE();return Lt(fa,{mt:4,children:[D(Fo,{variant:"h5",style:{fontWeight:800,fontSize:16,marginBottom:16},children:"Compiler"}),Lt(Fn,{sx:{gap:1,alignItems:u?"center":"flex-end",flexDirection:u?"column":"inherit"},children:[D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{children:[D(r1,{children:"Compiler"}),Lt(x3,{value:o,onChange:v=>{a(v.target.value)},children:[D(dm,{value:"func",children:"func"}),D(dm,{value:"tact",children:"tact"}),{}.VITE_ALLOW_FIFT&&D(dm,{value:"fift",children:"fift"})]})]})}),o==="func"&&Lt(ra,{children:[D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{disabled:c,children:[D(r1,{children:"Version"}),D(x3,{value:e.funcVersion,onChange:v=>{r(v.target.value)},children:d?.map(v=>D(dm,{value:v,children:v},v))})]})}),Lt(fa,{sx:{width:"100%",position:"relative"},children:[D(r1,{sx:{display:"block"},children:"Func command"}),D(ISe,{disabled:c,value:e.commandLine,onChange:v=>{t(v.target.value)}}),D(Fte,{sx:{position:"absolute",left:3,top:28,height:37,background:"#F5F5F5",borderRadius:1.5,color:"#000",fontSize:14},label:"func -o tmp.fif"}),!!e.overrideCommandLine&&D(js,{sx:{color:"blue",position:"absolute",right:10,top:31},onClick:()=>{t(null)},children:D("img",{src:RSe,alt:"Undo icon",width:15,height:15})})]})]}),o==="tact"&&D(ra,{children:D(Fn,{mb:u?1:0,sx:{width:u?"100%":"inherit"},children:Lt(w3,{disabled:c,children:[D(r1,{children:"Version"}),D(x3,{value:e.tactVersion,disabled:!0,children:p?.map(v=>D(dm,{value:v,children:v},v))})]})})})]})]})}const MSe="/assets/reorder-hint.5f3a54fb.svg",BSe="/assets/light-bulb.7768be40.svg",I$="/assets/like.af7e7b33.svg",OSe=lr(kn)({maxWidth:1160,width:"calc(100% - 50px)",margin:"auto"}),USe=lr(kn)({display:"flex",justifyContent:"space-between",height:73}),LSe=lr(kn)(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(1.5)})),DSe=lr(kn)(({theme:e})=>({display:"flex",flexWrap:"wrap",justifyContent:"space-between",marginTop:e.spacing(3),marginBottom:e.spacing(2),color:"#728A96",fontSize:14,[e.breakpoints.down("md")]:{"& > *":{marginBottom:`${e.spacing(1)} !important`}}})),NSe=lr("hr")({height:"1px",backgroundColor:"#e6e6e6",border:"none"}),rO=lr(hc)(({theme:e})=>({display:"inline-flex",alignItems:"center",color:"inherit",textDecoration:"none",[e.breakpoints.down("md")]:{justifyContent:"flex-end"}})),Zy=lr(kn)({display:"flex",justifyContent:"center",alignItems:"center"}),jSe=lr(Zy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"100%",flex:2,order:3}})),R$=lr(Zy)(({theme:e})=>({[e.breakpoints.down("md")]:{minWidth:"50%"}})),FSe=lr(R$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"start"},[e.breakpoints.down("sm")]:{minWidth:100}})),$Se=lr(R$)(({theme:e})=>({[e.breakpoints.down("md")]:{justifyContent:"end"},[e.breakpoints.down("sm")]:{minWidth:100}})),zSe="/assets/heart.52fe96d0.svg",HSe="/assets/orbs.eb35e74b.svg",WSe="/assets/telegram.bcba2ca3.svg",VSe="/assets/telegram-hover.72b9d3ce.svg",qSe="/assets/github-footer.0bd3bbab.svg",KSe="/assets/github-hover.33daf3ef.svg",nO=lr(kn)(e=>({theme:t})=>({display:"flex",alignItems:"center",justifyContent:"center",width:t.spacing(3),height:t.spacing(3),background:`url(${e.iconUrl})`,"&:hover":{transitionDuration:".25s",background:`url(${e.disabled?e.iconUrl:e.hoveredIconUrl})`,cursor:e.disabled?"cursor":"pointer"}})),iO=({iconUrl:e,hoveredIconUrl:t,link:r})=>r.length?D(hc,{target:"_blank",href:r,children:D(nO,{iconUrl:e,hoveredIconUrl:t})}):D(nO,{iconUrl:e,hoveredIconUrl:t,disabled:!0});function P$(){const e=v6(),[t,r]=Iw();return()=>{t.has("testnet")?t.delete("testnet"):t.append("testnet",""),r(t),e(0)}}function i8(){const e=P$();return D(kn,{sx:{background:"red",color:"white",py:2},children:Lt(WE,{sx:{gap:4,px:4},children:[D(Fo,{sx:{fontWeight:"bold",flexGrow:1},children:"Testnet"}),D(Fo,{onClick:()=>{e()},sx:{cursor:"pointer"},children:"Switch to mainnet"})]})})}const d4="https://t.me/tonverifier";function Jb(){const e=sa("(max-width: 450px)"),t=Mc(),r=P$();return Lt(OSe,{children:[Lt(USe,{mb:e?5:"inherit",sx:{flexDirection:e?"column":"inherit",alignItems:e?"center":"inherit"},children:[D(Fn,{children:Lt(mp,{sx:{color:"#000"},onClick:()=>t("/"),children:[D("img",{src:Rw,alt:"App icon",width:30,height:30}),D(kx,{children:"TON VERIFIER"})]})}),Lt(LSe,{children:[D(iO,{iconUrl:WSe,hoveredIconUrl:VSe,link:d4}),D(iO,{iconUrl:qSe,hoveredIconUrl:KSe,link:"https://github.com/orbs-network/ton-contract-verifier"})]})]}),D(NSe,{}),Lt(DSe,{children:[D(FSe,{children:D(Fo,{variant:"body2",children:"\xA9 2023"})}),D(jSe,{children:Lt(Fn,{sx:{gap:.1},children:["Contributed with",D(Fn,{mx:.4,children:D("img",{src:zSe,alt:"Heart",width:12,height:12})}),"by",D(Fn,{mx:.4,children:D("img",{src:HSe,alt:"Orbs logo",width:12,height:12})}),D(rO,{sx:{color:"#5E75E8"},target:"_blank",href:"https://orbs.com/powered-by",children:"Orbs"})]})}),Lt($Se,{children:[D(rO,{target:"_blank",href:d4,children:D(Fo,{variant:"body2",children:"Support"})}),!window.isTestnet&&D(Fo,{onClick:()=>{r()},sx:{ml:2,cursor:"pointer"},variant:"body2",children:"Switch to Testnet"})]})]})]})}const GSe=lr("li")({maxWidth:650,fontSize:14,fontWeight:400,marginBottom:10});function YSe(e,t){switch(e){case Fa.ENTRYPOINT_MISSING:return"There usually should be at least one file containing an entrypoint (recv_internal, main)";case Fa.STDLIB_ORDER:return"stdlib.fc should usually be the first file in the list (unless it's imported from another file)";case Fa.STDLIB_MISSING:return"You can try to add stdlib.fc to your sources.";case Fa.NOT_SIMILAR:return"Source code compiles correctly but does not match the on-chain contract hash. Make sure you are using the correct compiler version, command line and file order.";case Fa.FILE_ORDER:return"Make sure all files in the command line are in the correct order";case Fa.COMPILER_VERSION:return"Try to use the same compiler version as the contract was compiled with";case Fa.REQUIRED_FILES:return"Make sure all required files are included in the command line";case Fa.SUPPORT_GROUP:return Lt("div",{children:["If you are still facing issues, you can use the"," ",D(hc,{target:"_blank",href:d4,sx:{textDecoration:"none",cursor:"pointer"},children:"Telegram support group"})]})}}const QSe=({hint:e})=>{const{data:t}=Yu();return D(GSe,{children:YSe(e,t?.result.compileResult)})},zd=lr(Fo)({fontSize:14,fontWeight:400,marginBottom:"10px"}),oO=lr(Fo)({fontSize:14,fontWeight:700}),M$=lr(Fo)({fontSize:14,fontWeight:400}),aO=lr(Fn)({padding:"20px 30px",paddingLeft:0,"&:hover":{background:"transparent"}}),sO=lr(AF)({minWidth:200,fontSize:14,fontWeight:600}),ZSe=lr(fa)({borderBottom:"1px solid rgba(0, 0, 0, 0.2)"}),lO=lr(TF)({color:"#000",fontSize:14,fontWeight:400});function XSe(){const{data:e,error:t}=Yu(),{data:r}=Ap(),n=e?.result?.compileResult,o=e?.hints??[];return Lt(fa,{my:3,children:[["similar"].includes(n?.result??"")&&D(Is,{singleLine:!0,type:hs.SUCCESS,title:Lt(Fn,{sx:{height:42},children:[D(Fn,{mr:1,children:D("img",{src:I$,alt:"Like icon",width:31,height:31})}),Lt(M$,{children:[" ",D("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:D(fa,{})}),["not_similar"].includes(n?.result??"")&&D(Is,{type:hs.ERROR,title:Lt(Fn,{children:[D(Fn,{mr:1,children:D("img",{src:MSe,alt:"Reorder icon",width:39,height:26})}),D(oO,{children:"Hashes are not similar"})]}),notificationBody:Lt(fa,{sx:{display:"flex",flexDirection:"column"},children:[Lt(aO,{children:[D(sO,{children:"Contract hash"}),D(lO,{children:r?.codeCellHash.base64??"-"})]}),D(ZSe,{}),Lt(aO,{children:[D(sO,{children:"Compile output hash"}),D(lO,{children:n?.hash??"-"})]})]})}),n?.error&&D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:D(fa,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:n.error})})})}),!!t&&D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Server error"]}),notificationBody:D(fa,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:t.toString()})})})}),o.length>0&&D(Is,{type:hs.HINT,title:Lt(Fn,{mb:2,children:[D(Fn,{mr:1,children:D("img",{src:BSe,alt:"Light bulb icon",width:21,height:22})}),D(oO,{children:"Possible reasons for failure"})]}),notificationBody:D("ul",{style:{paddingLeft:25},children:o.map(a=>D(QSe,{hint:a},a))})})]})}function B$(){const[e]=Og();return D(Va,{background:"#1976d2",hoverBackground:"#156cc2",height:37,fontSize:14,fontWeight:700,textColor:"#fff",type:"button",onClick:()=>e.connectWallet(),children:"Connect wallet"})}const JSe=to(fa)({padding:"15px 24px"});function eCe(){const e=Yx(),{hasFiles:t}=Gu(),{step:r,proceedToPublish:n,toggleSection:o,currentSection:a}=a_(),{mutate:s,data:l,error:u,isLoading:c,compileStatus:d}=Yu(),p=!!l?.result?.msgCell,v=()=>o(fc.SOURCES);return Lt(vg,{children:[D(fa,{sx:{cursor:r===bc.PUBLISH&&p?"pointer":"inherit"},onClick:v,children:D(M5e,{})}),a===fc.SOURCES&&D(Iy,{in:a===fc.SOURCES,children:D(JSe,{children:Lt(ra,{children:[t()&&Lt(ra,{children:[D(TSe,{}),D(PSe,{})]}),(l||u)&&D(XSe,{}),t()&&D(Fn,{sx:{justifyContent:"center"},mt:3,mb:"9px",children:e?l?.result?.msgCell?D(Va,{disabled:r===bc.PUBLISH,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:n,children:"Ready to publish"}):Lt(Va,{disabled:!t(),fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(null)},children:[c&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Compile"]}):D(B$,{})})]})})})]})}const tCe=lr(_2)({borderRadius:40,fontFamily:"inherit",fontWeight:700,textTransform:"none",background:"#0088CC","&:disabled":{backgroundColor:"#e0e0e0"}});function ud(e){return D(tCe,{disableElevation:!0,disableRipple:!0,disableFocusRipple:!0,disableTouchRipple:!0,variant:"contained",disabled:e.disabled,onClick:e.disabled?void 0:e.onClick,...e,children:e.text})}const rCe="/assets/publish.83df630b.svg";function nCe(){const{data:e}=Yu(),{sendTXN:t,status:r,clearTXN:n}=tF(),{step:o,toggleSection:a,currentSection:s}=a_();Gu();const l=!!e?.result?.msgCell;let u;const c=()=>o===bc.PUBLISH&&l&&a(fc.PUBLISH);switch(r){case"initial":u=D("span",{children:"To store your contract\u2019s verification proof on-chain, you will need to issue a transaction. This will cost 0.5 TON"});break;case"rejected":u="Transaction rejected, please retry.";break;case"pending":u="Check your wallet for a pending transaction.";break;case"issued":u="Transaction issued, monitoring proof deployment on-chain.";break;case"success":u="Your contract is now verified! Click below to view it.";break;case"expired":u="Transaction expired, please retry.";break;case"error":u="The transaction is taking too long to complete or have failed. Please use a blockchain explorer to monitor it. You can also use our telegram support group."}return Lt(vg,{mb:6,children:[Lt(Fn,{p:s===fc.PUBLISH?"30px 24px 0 24px":"20px 24px",onClick:c,sx:{opacity:o===bc.PUBLISH&&l?1:.25,cursor:o===bc.PUBLISH&&l?"pointer":"inherit"},children:[D(bg,{children:D("img",{src:r==="success"?t$:rCe,alt:"publish icon",width:41,height:41})}),D(Kd,{children:"Publish"})]}),s===fc.PUBLISH&&l&&D(Iy,{in:s===fc.PUBLISH,children:Lt(fa,{children:[D(fa,{sx:{padding:"0 30px"},children:D(Is,{type:hs.INFO,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:D(zd,{sx:{marginBottom:0},children:u})})})}),Lt(Fn,{mb:3,sx:{justifyContent:"center"},children:[r!=="success"&&Lt(Va,{disabled:r==="pending"||r==="issued",fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{t()},children:[(r==="pending"||r==="issued")&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Publish"]}),r==="success"&&D(ud,{sx:{height:44},text:"View verified contract",onClick:()=>{location.reload()}})]})]})})]})}const iCe="/assets/verification-alert.0ebcec4f.svg",oCe="/assets/verification-binary.d6844d86.svg",aCe="/assets/verification-bomb.3bf48d9c.svg",sCe="/assets/verification-paper.34a39e79.svg",lCe="/assets/show.836c8f4f.svg",uCe="/assets/verification.fbd44dba.svg",cCe=to(js)(()=>({color:"#000"})),dCe=to(fa)({display:"flex",alignItems:"center",flexDirection:"column","& .title":{texAlign:"center",fontWeight:500,fontSize:20,marginBottom:20},"& .base-button":{height:40,marginTop:30}});function fCe({open:e,onClose:t,children:r,backgroundColor:n="rgba(48, 48, 48, 0.4)",blur:o=!0,className:a="",maxWidth:s,hideCloseButton:l,paddingTop:u}){return D(tne,{className:`${a} ${o&&"popup-filter"}`,fullWidth:!0,onClose:t,open:e,PaperProps:{style:{maxWidth:s||"unset",width:"100%",borderRadius:"10px",padding:0,overflow:"unset",margin:20}},BackdropProps:{style:{backgroundColor:n}},children:Lt(fa,{sx:{overflow:"scroll","::-webkit-scrollbar":{display:"none"}},children:[!l&&D(fa,{sx:{display:"flex",justifyContent:"end",width:"100%"},children:D(cCe,{onClick:t,children:D(Gk,{style:{width:23,height:23}})})}),D(dCe,{px:3,pb:3,pt:u?3:0,children:r})]})})}const pCe="/assets/verification-popup.1a3fc640.svg",hCe=lr(ok)({overflow:"scroll",background:"#F7F9FB",borderRadius:"5px",width:"100%"}),gCe=lr(kn)({background:"#F7F9FB",borderRadius:"5px",width:"100%"}),mCe=lr(vL)({"&.MuiTableHead-root th":{border:"none",fontSize:13}}),yCe=lr(Ec)({fontWeight:700}),Yp=lr(th)({paddingLeft:0,paddingBottom:"2px"}),Qp=lr(is)({paddingBottom:10}),vCe=lr(Fn)({width:59,height:21,background:"#08D088",borderRadius:40,color:"#fff",justifyContent:"space-around",fontSize:12}),cd=lr(is)({paddingBottom:16}),bCe=lr(hc)({textDecoration:"none",cursor:"pointer",color:"#0088CC"}),wCe=lr(kn)({width:"100%",display:"flex",justifyContent:"flex-end"}),_3=lr(Fo)({color:"#728A96",fontSize:14}),xCe=lr(Kd)({fontSize:18,fontWeight:800,color:"#000",textAlign:"center"}),_Ce=lr(kn)({display:"inline-flex",alignItems:"center",height:"20px",padding:"0 7px",background:"rgba(146, 146, 146, 0.3)",borderRadius:"10px",color:"#212121",fontWeight:400,fontSize:"14px",fontFamily:"IBM Plex Mono, monospace"});lr(_Ce)({position:"relative",top:5,display:"inline-block",whiteSpace:"nowrap",lineHeight:"20px",width:"100%",maxWidth:600,overflow:"hidden",textOverflow:"ellipsis"});const SCe="/assets/verified.4e0dc210.svg",Dm=()=>D(es,{width:"85%",variant:"text",sx:{transform:"none",background:"#e6e8eb"}}),CCe=()=>Lt(mCe,{children:[Lt(yCe,{children:[D(Yp,{sx:{width:80,paddingLeft:3},children:"Status"}),D(Yp,{sx:{width:370},children:"Public Key"}),D(Yp,{sx:{width:35}}),D(Yp,{sx:{width:105},children:"IP"}),D(Yp,{sx:{width:150},children:"Verification date"}),D(Yp,{sx:{width:100},children:"Verifier"})]}),Lt(Ec,{children:[D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})}),D(Qp,{children:D(Kl,{})})]})]}),uO=()=>Lt(Ec,{children:[D(is,{sx:{paddingLeft:3,paddingBottom:2},children:D(Dm,{})}),D(cd,{children:D(Dm,{})}),D(cd,{children:D(es,{width:25,variant:"text",sx:{transform:"none",background:"#e6e8eb"}})}),D(cd,{children:D(Dm,{})}),D(cd,{children:D(Dm,{})}),D(is,{sx:{paddingRight:3,paddingBottom:2},children:D(Dm,{})})]}),kCe=({pubKey:e,endpoint:t,name:r,onCopy:n,date:o,url:a})=>Lt(Ec,{children:[D(is,{sx:{paddingLeft:3,paddingBottom:2},children:Lt(vCe,{px:1,children:[D("img",{src:SCe,alt:"Verified icon",width:11,height:11}),"Verified"]})}),D(cd,{children:D(_3,{children:e})}),D(cd,{children:D(js,{onClick:()=>n(e),sx:{padding:.5},children:D("img",{src:o_,alt:"Copy icon",width:16,height:16})})}),D(cd,{children:D(_3,{children:t})}),D(cd,{children:D(_3,{children:o})}),D(is,{sx:{paddingRight:3,paddingBottom:2},children:D(Fn,{children:D(bCe,{target:"_blank",href:a,children:r})})})]});function ECe(){const{data:e,isLoading:t,error:r}=Dc(),{data:n,isLoading:o,error:a}=n_(),{showNotification:s}=Fy(),l=n?.find(c=>c.name===window.verifierId),u=J.exports.useCallback(async c=>{navigator.clipboard.writeText(c),s("Copied to clipboard!","success")},[]);return Lt(kn,{sx:{overflow:"scroll",borderRadius:"5px","::-webkit-scrollbar":{display:"none"}},children:[Lt(hCe,{sx:{minWidth:900},children:[D(CCe,{}),D(ak,{children:t||o?Lt(ra,{children:[D(uO,{}),D(uO,{})]}):l&&e&&Object.entries(l.pubKeyEndpoints).map(([c,d])=>D(kCe,{pubKey:c,onCopy:u,url:l.url,date:e?.verificationDate?.toLocaleDateString()||"",endpoint:d,name:l.name},c))})]}),(!!r||!!a)&&`${r} ${a} (App notification)`]})}const ACe="modulepreload",TCe=function(e){return"/"+e},cO={},Nm=function(t,r,n){if(!r||r.length===0)return t();const o=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=TCe(a),a in cO)return;cO[a]=!0;const s=a.endsWith(".css"),l=s?'[rel="stylesheet"]':"";if(!!n)for(let d=o.length-1;d>=0;d--){const p=o[d];if(p.href===a&&(!s||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${l}`))return;const c=document.createElement("link");if(c.rel=s?"stylesheet":ACe,s||(c.as="script",c.crossOrigin=""),c.href=a,document.head.appendChild(c),s)return new Promise((d,p)=>{c.addEventListener("load",d),c.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>t())};var R1=(e=>(e.VALID="VALID",e.WASM="WebAssembly is not supported",e.COMPILER="Only FunC contracts can be verified",e.VERSION="FunC version is not supported",e))(R1||{});const ICe=["0.2.0","0.3.0","0.4.0","0.4.1"];function RCe(){const{data:e}=Dc(),{data:t}=Ap(),[r,n]=J.exports.useState(null),[o,a]=J.exports.useState(!1),[s,l]=J.exports.useState(null),u=async()=>{xa(ma.IN_BROWSER_COMPILE_START),n(null),a(!0);const{FuncCompiler:p}=await Nm(()=>import("./index.429f2611.js").then(A=>A.i),[]),v=e?.files?.map(A=>({filename:A.name,content:A.content}))??[],w=e?.compilerSettings?.funcVersion;if(!w){n("FunC is not available for in-browser verification"),a(!1);return}let b;switch(w){case"0.2.0":{let{object:A}=await Nm(()=>import("./index.fbca1507.js").then(U=>U.i),[]);b=A;break}case"0.3.0":{let{object:A}=await Nm(()=>import("./index.f65cb428.js").then(U=>U.i),[]);b=A;break}case"0.4.0":{let{object:A}=await Nm(()=>import("./index.fb59a6c3.js").then(U=>U.i),[]);b=A;break}case"0.4.1":{let{object:A}=await Nm(()=>import("./index.bf0da248.js").then(U=>U.i),[]);b=A;break}}let _=await new p(b).compileFunc({sources:v,targets:(e?.compilerSettings).commandLine.split(" ").filter(A=>A.match(/\.(fc|func)$/))});if(_.status==="error"){n(_.message),a(!1),xa(ma.IN_BROWSER_COMPILE_ERROR);return}const k=Wn.Cell.fromBoc(Buffer.from(_.codeBoc,"base64"))[0];a(!1),t?.codeCellToCompileBase64===k.hash().toString("base64")&&l(k.hash().toString("base64")),xa(ma.IN_BROWSER_COMPILE_SUCCESS)},c=()=>wF()?e?.compiler!=="func"?"Only FunC contracts can be verified":d()?"VALID":"FunC version is not supported":"WebAssembly is not supported",d=()=>ICe.some(p=>p===e?.compilerSettings?.funcVersion);return{verifyContract:u,isVerificationEnabled:c,loading:o,error:r,hash:s}}function PCe(){const{verifyContract:e,isVerificationEnabled:t,error:r,loading:n,hash:o}=RCe(),a=ua(),s=sa(a.breakpoints.down("md"));return Lt(kn,{p:2,children:[Lt(Fo,{sx:{fontSize:14},children:["You are not required to rely on third-party validators. You can now verify this contract by yourself by having your browser download the sources and compile them locally in-browser using"," ",D(hc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/func-js",target:"_blank",children:"WASM"}),".",!B2e()&&D(Fn,{mt:1,sx:{overflow:"auto",maxHeight:300},children:Lt(zd,{sx:{margin:0},children:["The web page you're looking at is"," ",D(hc,{sx:{textDecoration:"none"},href:"https://github.com/ton-community/contract-verifier",target:"_blank",children:"open source"}),", you can also fork or run it locally if you wish to have absolute control."]})})]}),t()!==R1.VALID?D(mL,{arrow:!0,title:D(Fo,{sx:{fontSize:13},children:t()}),placement:"top",children:D(kn,{sx:{width:144,margin:"auto"},children:D(Va,{onClick:()=>e(),disabled:t()!==R1.VALID||n||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:"Verify"})})}):Lt(Va,{onClick:()=>e(),disabled:t()!==R1.VALID||n||!!o,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",children:[n&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Verify"]}),r&&Lt(ra,{children:[D(Is,{noBottomMargin:!0,type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Compile error"]}),notificationBody:D(kn,{sx:{overflow:"auto",maxHeight:300},children:D("div",{children:D("code",{children:r})})})}),Lt(Fo,{sx:{marginTop:1,fontSize:13},children:["You can ask for help in our"," ",D(hc,{sx:{textDecoration:"none",cursor:"pointer",color:"#0088CC"},href:"https://t.me/tonverifier",target:"_blank",children:"Telegram support group"})]})]}),!!o&&D(Is,{noBottomMargin:!0,singleLine:!s,type:hs.SUCCESS,title:Lt(Fn,{sx:{height:42},children:[D(Fn,{mr:1,children:D("img",{src:I$,alt:"Like icon",width:31,height:31})}),Lt(M$,{children:[" ",D("b",{children:"Great!"})," Compile output hash matches this on-chain contract"]})]}),notificationBody:D(kn,{})})]})}function MCe(){const{data:e,isLoading:t}=Dc(),{isLoading:r}=n_();return Lt(kn,{sx:{width:"100%"},children:[e&&!r&&Lt(gCe,{pt:3,pb:1,children:[D(xCe,{children:"Verify manually"}),D(BCe,{})]}),(t||r)&&D(es,{width:"100%",height:250,sx:{transform:"none",borderRadius:"20px",background:"#e6e8eb"}})]})}to(bL)({borderBottom:"none","& .MuiTabs-indicator":{borderBottom:"4px solid #0088CC",borderRadius:20},"& .MuiTab-root.Mui-selected":{color:"#000",fontWeight:800}});function BCe(){return D(kn,{sx:{width:"100%"},children:D(PCe,{})})}function OCe({onClose:e}){const t=ua(),r=sa(t.breakpoints.down("lg"));return D(fCe,{open:!0,maxWidth:r?"88%":1e3,hideCloseButton:!0,children:D(z6,{onClickAway:e,children:Lt(kn,{sx:{width:"100%"},children:[D(wCe,{pt:2,children:D(js,{sx:{padding:0},onClick:e,children:D("img",{src:$6,alt:"Close icon",width:15,height:15})})}),Lt(Fn,{mb:4,justifyContent:"center",children:[D("img",{src:pCe,alt:"Popup icon",width:41,height:41}),D(Kd,{pl:2,sx:{fontSize:18,fontWeight:800},children:"Verification Proof"})]}),D(ECe,{}),D(Fn,{mt:3,children:D(MCe,{})})]})})})}const UCe=to(Fn)(({theme:e})=>t=>({flexWrap:t.makeFlexible?"wrap":"inherit",gap:t.makeFlexible?20:"inherit",justifyContent:t.makeFlexible?"center":"space-between",padding:24,[e.breakpoints.down("lg")]:{width:"70%",margin:"auto"}})),LCe=to(Zy)({boxSizing:"border-box",display:"flex",minWidth:200,maxWidth:260,height:108,background:"#F7F9FB",borderRadius:14,padding:"28px 13px"}),DCe=to(Fo)({fontSize:14,color:"#000"}),NCe=[{icon:sCe,description:"This source code compiles to the same exact bytecode that is found on-chain."},{icon:aCe,description:"You can review verification proofs and perform your own client-side verification."},{icon:iCe,description:"Variable/function names may not reflect actual usage. compiler may remove unused code."},{icon:oCe,description:"Comments may not be honest and should generally be ignored."}],jCe=()=>{const[e]=Iw(),[t,r]=Yn.useState(e.get("showProof")!==null),n=ua(),o=sa(n.breakpoints.down("lg")),a=sa(n.breakpoints.down("md")),s=sa("(max-width: 450px)");return Lt(vg,{children:[D(k2,{mb:1,children:Lt(Fn,{sx:{justifyContent:"space-between",flexDirection:s?"column":"inherit",width:"100%"},children:[Lt(Fn,{mb:s?2:0,sx:{width:"100%"},children:[D(bg,{children:D("img",{src:uCe,alt:"Verification icon",width:41,height:41})}),D(Kd,{children:"How is this contract verified?"})]}),Lt("div",{children:[Lt(Va,{fontSize:12,fontWeight:800,textColor:"#fff",background:"#1976d2",hoverBackground:"#156cc2",height:37,width:132,onClick:()=>{r(!0)},children:[D("img",{src:lCe,alt:"Show icon",width:19,height:19}),"Show Proof"]}),t&&D(OCe,{onClose:()=>r(!1)})]})]})}),D(UCe,{makeFlexible:o,isMobile:a,children:NCe.map(u=>Lt(LCe,{children:[D(Zy,{sx:{alignSelf:"flex-start"},mr:1.5,children:D("img",{alt:"Icon",src:u.icon,width:41,height:41})}),D(DCe,{children:u.description})]},u.description))})]})};function FCe(){const e=Jj(T1),{isLoading:t,error:r,data:n}=Cc(["latestVerifiedContracts"],async()=>(await(await fetch(`${e}/latestVerified`,{method:"GET"})).json()).slice(0,100));return{isLoading:t,error:r,data:n}}const $Ce=lr(kn)(({theme:e})=>({background:"white",padding:"16px 20px",borderRadius:10,boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px",border:"0.5px solid rgba(114, 138, 150, 0.24)",cursor:"pointer",[e.breakpoints.down("sm")]:{width:280}})),zCe=lr(kn)(({theme:e})=>({maxWidth:1160,width:"calc(100% - 50px)",paddingTop:20,margin:"0 auto"})),HCe=lr(kn)({display:"flex",flexDirection:"row",flexWrap:"wrap",gap:24,margin:"0 auto",justifyContent:"left",overflow:"auto",marginTop:24,"-webkit-text-size-adjust":"100%"}),WCe=lr(kn)({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:16,color:"#728A96"}),VCe=lr(kn)({marginLeft:"auto",fontSize:14,background:"#F0F0F099",color:"#728A9699",padding:"2px 12px",borderRadius:4});function qCe(){const{data:e,isLoading:t}=FCe(),r=Mc(),n=J.exports.useRef(new Array(30).fill(null).map(o=>Math.random()*100));return Lt(zCe,{children:[D(Fo,{variant:"h6",children:D("b",{children:"Latest verified contracts"})}),Lt(HCe,{children:[t&&n.current.map(o=>D(es,{sx:{borderRadius:2},variant:"rectangular",width:400+o,height:70})),e?.map(o=>Lt($Ce,{onClick:a=>{r(`/${o.address}`)},children:[D(WCe,{children:o.address}),Lt("div",{style:{display:"flex",alignItems:"center",marginTop:6.5},children:[D(Fo,{sx:{fontSize:14,color:"#728A9699"},children:o.mainFile}),D(VCe,{children:o.compiler})]})]}))]})]})}const O$=to(kn)({maxWidth:1160,margin:"auto"}),U$=to(kn)(e=>({display:e.isMobile?"inherit":"flex",gap:20})),n1=to(kn)({boxSizing:"border-box",maxWidth:1160,width:"100%",marginTop:20,backgroundColor:"#fff",borderRadius:20,padding:20,color:"#000"});function dO(){const{isLoading:e,data:t,error:r}=Dc(),[n,o]=J.exports.useState(!1),a=ua(),s=exe(),{contractAddress:l,isAddressEmpty:u}=qu(),{hasFiles:c}=Gu(),d=J.exports.useRef(),p=sa(a.breakpoints.down("lg")),v=sa(a.breakpoints.down("md")),w=!r&&e&&l;EN(),rxe(),N2e(),J.exports.useEffect(()=>{window.scrollTo({behavior:"auto",top:d.current?.offsetTop})},[window.location.pathname]);const{initialize:b}=OE(),{data:{funcVersions:m}}=BE();return J.exports.useEffect(()=>{(m?.length??0)>0&&b(m[0])},[m]),Lt(kn,{onDragEnter:()=>o(!0),onDrop:()=>o(!1),onClick:()=>o(!1),children:[D(x2,{sx:{color:"#fff",zIndex:4},open:n,onDragEnd:()=>o(!1)}),D(kn,{ref:d}),window.isTestnet&&D(i8,{}),D(W1e,{}),l===null&&u&&D(qCe,{}),l===null&&!u&&D(kn,{m:4,children:D(Is,{singleLine:!0,type:hs.ERROR,title:Lt(Fn,{sx:{height:42},children:[D("span",{style:{color:"#FC5656",marginRight:4},children:"Error: "}),"Invalid address"]}),notificationBody:D(kn,{})})}),Lt(O$,{px:p?"20px":0,children:[!!r&&D(kn,{mt:4,children:D(Is,{type:hs.ERROR,title:Lt(zd,{children:[D("span",{style:{color:"#FC5656"},children:"Error: "}),"Unable to fetch contract data"]}),notificationBody:D(kn,{sx:{overflow:"auto",maxHeight:300},children:D("pre",{children:D("code",{children:r.toString()})})})})}),w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:200}})]}),D(es,{variant:"rectangular",width:"100%",height:250})]}),Lt(U$,{isMobile:v,children:[D(uxe,{}),t?.hasOnchainProof&&D(U_e,{})]}),w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:3,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:200}})]}),D(es,{variant:"rectangular",width:"100%",height:250})]}),!e&&t?.hasOnchainProof&&D(jCe,{}),t&&(!t.hasOnchainProof||s)&&Lt(ra,{children:[D(eCe,{}),c()&&D(nCe,{})]}),t&&!c()?D(n1,{sx:{padding:0},mb:5,children:D(J2e,{})}):D(ra,{children:w&&Lt(n1,{sx:{padding:"30px 24px 24px 24px"},mb:5,children:[Lt(Fn,{mb:3,children:[D(es,{variant:"circular",width:41,height:41,sx:{marginRight:2}}),D(es,{variant:"text",sx:{fontSize:"20px",width:250}})]}),D(es,{variant:"rectangular",width:"100%",height:500})]})}),t&&D(Jb,{})]}),!t&&D(Zy,{sx:{bottom:0,width:"100%"},children:D(Jb,{})})]})}function L$({space:e}){return D("div",{style:{height:e}})}function KCe(){const[e,t]=J.exports.useState({spec:[],builder:Wn.beginCell()});return Lt("div",{children:[D("h4",{children:"Build the cell"}),D(Rh,{required:!0,id:"outlined-required",label:"UINT",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const[n,o]=r.target.value.split(",");t(a=>({spec:[...a.spec,{type:"uint"+o,value:n}],builder:a.builder.storeUint(n,o)})),r.target.value=""}}}),D(Rh,{required:!0,id:"outlined-required",label:"Address",fullWidth:!0,onKeyUp:r=>{if(r.code==="Enter"){const n=r.target.value;t(o=>({spec:[...o.spec,{type:"address",value:n}],builder:o.builder.storeAddress(Wn.Address.parse(n))})),r.target.value=""}}}),D("div",{children:JSON.stringify(e.spec)}),D(L$,{space:30}),D(_2,{variant:"outlined",children:"Send the message"})]})}function GCe(){return Lt("div",{style:{margin:"0 auto",maxWidth:1100,padding:40},children:[D(B$,{}),D(L$,{space:35}),D(Rh,{required:!0,id:"outlined-required",label:"Contract address",fullWidth:!0}),D(Rh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),Lt("div",{children:[D("h3",{children:"OPs"}),D(Rh,{required:!0,id:"outlined-required",label:"Value",fullWidth:!0,type:"number"}),D(KCe,{})]})]})}const YCe=F6({typography:{fontFamily:"Mulish"},components:{MuiSwitch:{styleOverrides:{switchBase:{color:"#ccc"},colorPrimary:{"&.Mui-checked":{color:"#fff"}},track:{opacity:1,backgroundColor:"#D1D1D6",".Mui-checked.Mui-checked + &":{opacity:1,backgroundColor:"#0088CC"}},thumb:{background:"#fff",boxShadow:"0px 2px 8px rgba(0, 0, 0, 0.16)"}}}}});function o8({label:e,data:t}){return Lt("div",{className:"InfoPiece",children:[D("div",{className:"InfoPiece-Label",children:e}),D("div",{className:"InfoPiece-Data",children:t})]})}var Xy=e=>e.type==="checkbox",wh=e=>e instanceof Date,fs=e=>e==null;const D$=e=>typeof e=="object";var Ea=e=>!fs(e)&&!Array.isArray(e)&&D$(e)&&!wh(e),N$=e=>Ea(e)&&e.target?Xy(e.target)?e.target.checked:e.target.value:e,QCe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,j$=(e,t)=>e.has(QCe(t)),ZCe=e=>{const t=e.constructor&&e.constructor.prototype;return Ea(t)&&t.hasOwnProperty("isPrototypeOf")},a8=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ts(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(a8&&(e instanceof Blob||e instanceof FileList))&&(r||Ea(e)))if(t=r?[]:{},!r&&!ZCe(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=ts(e[n]));else return e;return t}var zg=e=>Array.isArray(e)?e.filter(Boolean):[],Po=e=>e===void 0,vn=(e,t,r)=>{if(!t||!Ea(e))return r;const n=zg(t.split(/[,[\].]+?/)).reduce((o,a)=>fs(o)?o:o[a],e);return Po(n)||n===e?Po(e[t])?r:e[t]:n},Su=e=>typeof e=="boolean";const ew={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},xl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ic={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XCe=Yn.createContext(null),d_=()=>Yn.useContext(XCe);var F$=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const s=a;return t._proxyFormState[s]!==xl.all&&(t._proxyFormState[s]=!n||xl.all),r&&(r[s]=!0),e[s]}});return o},Gs=e=>Ea(e)&&!Object.keys(e).length,$$=(e,t,r,n)=>{r(e);const{name:o,...a}=e;return Gs(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!n||xl.all))},Zs=e=>Array.isArray(e)?e:[e],z$=(e,t,r)=>!e||!t||e===t||Zs(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n)));function f_(e){const t=Yn.useRef(e);t.current=e,Yn.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function JCe(e){const t=d_(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[s,l]=Yn.useState(r._formState),u=Yn.useRef(!0),c=Yn.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=Yn.useRef(o);return d.current=o,f_({disabled:n,next:p=>u.current&&z$(d.current,p.name,a)&&$$(p,c.current,r._updateFormState)&&l({...r._formState,...p}),subject:r._subjects.state}),Yn.useEffect(()=>(u.current=!0,c.current.isValid&&r._updateValid(!0),()=>{u.current=!1}),[r]),F$(s,r,c.current,!1)}var ku=e=>typeof e=="string",H$=(e,t,r,n,o)=>ku(e)?(n&&t.watch.add(e),vn(r,e,o)):Array.isArray(e)?e.map(a=>(n&&t.watch.add(a),vn(r,a))):(n&&(t.watchAll=!0),r);function e4e(e){const t=d_(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:s}=e||{},l=Yn.useRef(n);l.current=n,f_({disabled:a,subject:r._subjects.values,next:d=>{z$(l.current,d.name,s)&&c(ts(H$(l.current,r._names,d.values||r._formValues,!1,o)))}});const[u,c]=Yn.useState(r._getWatch(n,o));return Yn.useEffect(()=>r._removeUnmounted()),u}var s8=e=>/^\w*$/.test(e),W$=e=>zg(e.replace(/["|']|\]/g,"").split(/\.|\[/));function To(e,t,r){let n=-1;const o=s8(t)?[t]:W$(t),a=o.length,s=a-1;for(;++n{const d=o._options.shouldUnregister||a,p=(v,w)=>{const b=vn(o._fields,v);b&&(b._f.mount=w)};if(p(r,!0),d){const v=ts(vn(o._options.defaultValues,r));To(o._defaultValues,r,v),Po(vn(o._formValues,r))&&To(o._formValues,r,v)}return()=>{(s?d&&!o._state.action:d)?o.unregister(r):p(r,!1)}},[r,o,s,a]),Yn.useEffect(()=>{vn(o._fields,r)&&o._updateDisabledField({disabled:n,fields:o._fields,name:r,value:vn(o._fields,r)._f.value})},[n,r,o]),{field:{name:r,value:l,...Su(n)||Su(u.disabled)?{disabled:u.disabled||n}:{},onChange:Yn.useCallback(d=>c.current.onChange({target:{value:N$(d),name:r},type:ew.CHANGE}),[r]),onBlur:Yn.useCallback(()=>c.current.onBlur({target:{value:vn(o._formValues,r),name:r},type:ew.BLUR}),[r,o]),ref:d=>{const p=vn(o._fields,r);p&&d&&(p._f.ref={focus:()=>d.focus(),select:()=>d.select(),setCustomValidity:v=>d.setCustomValidity(v),reportValidity:()=>d.reportValidity()})}},formState:u,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!vn(u.errors,r)},isDirty:{enumerable:!0,get:()=>!!vn(u.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!vn(u.touchedFields,r)},error:{enumerable:!0,get:()=>vn(u.errors,r)}})}}const r4e=e=>e.render(t4e(e));var n4e=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Gc=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const r=(Math.random()*16+e)%16|0;return(t=="x"?r:r&3|8).toString(16)})},S3=(e,t,r={})=>r.shouldFocus||Po(r.shouldFocus)?r.focusName||`${e}.${Po(r.focusIndex)?t:r.focusIndex}.`:"",f4=e=>({isOnSubmit:!e||e===xl.onSubmit,isOnBlur:e===xl.onBlur,isOnChange:e===xl.onChange,isOnAll:e===xl.all,isOnTouch:e===xl.onTouched}),p4=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const _0=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const a=vn(e,o);if(a){const{_f:s,...l}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],o)&&!n)break;if(s.ref&&t(s.ref,s.name)&&!n)break}else Ea(l)&&_0(l,t)}}};var V$=(e,t,r)=>{const n=zg(vn(e,r));return To(n,"root",t[r]),To(e,r,n),e},l8=e=>e.type==="file",dd=e=>typeof e=="function",tw=e=>{if(!a8)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},P1=e=>ku(e),u8=e=>e.type==="radio",rw=e=>e instanceof RegExp;const fO={value:!1,isValid:!1},pO={value:!0,isValid:!0};var q$=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Po(e[0].attributes.value)?Po(e[0].value)||e[0].value===""?pO:{value:e[0].value,isValid:!0}:pO:fO}return fO};const hO={isValid:!1,value:null};var K$=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,hO):hO;function gO(e,t,r="validate"){if(P1(e)||Array.isArray(e)&&e.every(P1)||Su(e)&&!e)return{type:r,message:P1(e)?e:"",ref:t}}var Zp=e=>Ea(e)&&!rw(e)?e:{value:e,message:""},h4=async(e,t,r,n,o)=>{const{ref:a,refs:s,required:l,maxLength:u,minLength:c,min:d,max:p,pattern:v,validate:w,name:b,valueAsNumber:m,mount:_,disabled:k}=e._f,A=vn(t,b);if(!_||k)return{};const U=s?s[0]:a,M=W=>{n&&U.reportValidity&&(U.setCustomValidity(Su(W)?"":W||""),U.reportValidity())},L={},F=u8(a),j=Xy(a),ee=F||j,te=(m||l8(a))&&Po(a.value)&&Po(A)||tw(a)&&a.value===""||A===""||Array.isArray(A)&&!A.length,Z=n4e.bind(null,b,r,L),se=(W,q,C,G=ic.maxLength,le=ic.minLength)=>{const pe=W?q:C;L[b]={type:W?G:le,message:pe,ref:a,...Z(W?G:le,pe)}};if(o?!Array.isArray(A)||!A.length:l&&(!ee&&(te||fs(A))||Su(A)&&!A||j&&!q$(s).isValid||F&&!K$(s).isValid)){const{value:W,message:q}=P1(l)?{value:!!l,message:l}:Zp(l);if(W&&(L[b]={type:ic.required,message:q,ref:U,...Z(ic.required,q)},!r))return M(q),L}if(!te&&(!fs(d)||!fs(p))){let W,q;const C=Zp(p),G=Zp(d);if(!fs(A)&&!isNaN(A)){const le=a.valueAsNumber||A&&+A;fs(C.value)||(W=le>C.value),fs(G.value)||(q=lenew Date(new Date().toDateString()+" "+lt),be=a.type=="time",Q=a.type=="week";ku(C.value)&&A&&(W=be?pe(A)>pe(C.value):Q?A>C.value:le>new Date(C.value)),ku(G.value)&&A&&(q=be?pe(A)+W.value,G=!fs(q.value)&&A.length<+q.value;if((C||G)&&(se(C,W.message,q.message),!r))return M(L[b].message),L}if(v&&!te&&ku(A)){const{value:W,message:q}=Zp(v);if(rw(W)&&!A.match(W)&&(L[b]={type:ic.pattern,message:q,ref:a,...Z(ic.pattern,q)},!r))return M(q),L}if(w){if(dd(w)){const W=await w(A,t),q=gO(W,U);if(q&&(L[b]={...q,...Z(ic.validate,q.message)},!r))return M(q.message),L}else if(Ea(w)){let W={};for(const q in w){if(!Gs(W)&&!r)break;const C=gO(await w[q](A,t),U,q);C&&(W={...C,...Z(q,C.message)},M(C.message),r&&(L[b]=W))}if(!Gs(W)&&(L[b]={ref:U,...W},!r))return L}}return M(!0),L};function C3(e,t){return[...e,...Zs(t)]}var k3=e=>Array.isArray(e)?e.map(()=>{}):void 0;function E3(e,t,r){return[...e.slice(0,t),...Zs(r),...e.slice(t)]}var A3=(e,t,r)=>Array.isArray(e)?(Po(e[r])&&(e[r]=void 0),e.splice(r,0,e.splice(t,1)[0]),e):[];function T3(e,t){return[...Zs(t),...Zs(e)]}function i4e(e,t){let r=0;const n=[...e];for(const o of t)n.splice(o-r,1),r++;return zg(n).length?n:[]}var I3=(e,t)=>Po(t)?[]:i4e(e,Zs(t).sort((r,n)=>r-n)),R3=(e,t,r)=>{e[t]=[e[r],e[r]=e[t]][0]};function o4e(e,t){const r=t.slice(0,-1).length;let n=0;for(;n(e[t]=r,e);function s4e(e){const t=d_(),{control:r=t.control,name:n,keyName:o="id",shouldUnregister:a}=e,[s,l]=Yn.useState(r._getFieldArray(n)),u=Yn.useRef(r._getFieldArray(n).map(Gc)),c=Yn.useRef(s),d=Yn.useRef(n),p=Yn.useRef(!1);d.current=n,c.current=s,r._names.array.add(n),e.rules&&r.register(n,e.rules),f_({next:({values:L,name:F})=>{if(F===d.current||!F){const j=vn(L,d.current);Array.isArray(j)&&(l(j),u.current=j.map(Gc))}},subject:r._subjects.array});const v=Yn.useCallback(L=>{p.current=!0,r._updateFieldArray(n,L)},[r,n]),w=(L,F)=>{const j=Zs(ts(L)),ee=C3(r._getFieldArray(n),j);r._names.focus=S3(n,ee.length-1,F),u.current=C3(u.current,j.map(Gc)),v(ee),l(ee),r._updateFieldArray(n,ee,C3,{argA:k3(L)})},b=(L,F)=>{const j=Zs(ts(L)),ee=T3(r._getFieldArray(n),j);r._names.focus=S3(n,0,F),u.current=T3(u.current,j.map(Gc)),v(ee),l(ee),r._updateFieldArray(n,ee,T3,{argA:k3(L)})},m=L=>{const F=I3(r._getFieldArray(n),L);u.current=I3(u.current,L),v(F),l(F),r._updateFieldArray(n,F,I3,{argA:L})},_=(L,F,j)=>{const ee=Zs(ts(F)),te=E3(r._getFieldArray(n),L,ee);r._names.focus=S3(n,L,j),u.current=E3(u.current,L,ee.map(Gc)),v(te),l(te),r._updateFieldArray(n,te,E3,{argA:L,argB:k3(F)})},k=(L,F)=>{const j=r._getFieldArray(n);R3(j,L,F),R3(u.current,L,F),v(j),l(j),r._updateFieldArray(n,j,R3,{argA:L,argB:F},!1)},A=(L,F)=>{const j=r._getFieldArray(n);A3(j,L,F),A3(u.current,L,F),v(j),l(j),r._updateFieldArray(n,j,A3,{argA:L,argB:F},!1)},U=(L,F)=>{const j=ts(F),ee=mO(r._getFieldArray(n),L,j);u.current=[...ee].map((te,Z)=>!te||Z===L?Gc():u.current[Z]),v(ee),l([...ee]),r._updateFieldArray(n,ee,mO,{argA:L,argB:j},!0,!1)},M=L=>{const F=Zs(ts(L));u.current=F.map(Gc),v([...F]),l([...F]),r._updateFieldArray(n,[...F],j=>j,{},!0,!1)};return Yn.useEffect(()=>{if(r._state.action=!1,p4(n,r._names)&&r._subjects.state.next({...r._formState}),p.current&&(!f4(r._options.mode).isOnSubmit||r._formState.isSubmitted))if(r._options.resolver)r._executeSchema([n]).then(L=>{const F=vn(L.errors,n),j=vn(r._formState.errors,n);(j?!F&&j.type||F&&(j.type!==F.type||j.message!==F.message):F&&F.type)&&(F?To(r._formState.errors,n,F):Ma(r._formState.errors,n),r._subjects.state.next({errors:r._formState.errors}))});else{const L=vn(r._fields,n);L&&L._f&&h4(L,r._formValues,r._options.criteriaMode===xl.all,r._options.shouldUseNativeValidation,!0).then(F=>!Gs(F)&&r._subjects.state.next({errors:V$(r._formState.errors,F,n)}))}r._subjects.values.next({name:n,values:{...r._formValues}}),r._names.focus&&_0(r._fields,(L,F)=>{if(r._names.focus&&F.startsWith(r._names.focus)&&L.focus)return L.focus(),1}),r._names.focus="",r._updateValid(),p.current=!1},[s,n,r]),Yn.useEffect(()=>(!vn(r._formValues,n)&&r._updateFieldArray(n),()=>{(r._options.shouldUnregister||a)&&r.unregister(n)}),[n,r,o,a]),{swap:Yn.useCallback(k,[v,n,r]),move:Yn.useCallback(A,[v,n,r]),prepend:Yn.useCallback(b,[v,n,r]),append:Yn.useCallback(w,[v,n,r]),remove:Yn.useCallback(m,[v,n,r]),insert:Yn.useCallback(_,[v,n,r]),update:Yn.useCallback(U,[v,n,r]),replace:Yn.useCallback(M,[v,n,r]),fields:Yn.useMemo(()=>s.map((L,F)=>({...L,[o]:u.current[F]||Gc()})),[s,o])}}function P3(){let e=[];return{get observers(){return e},next:o=>{for(const a of e)a.next&&a.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(a=>a!==o)}}),unsubscribe:()=>{e=[]}}}var nw=e=>fs(e)||!D$(e);function If(e,t){if(nw(e)||nw(t))return e===t;if(wh(e)&&wh(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const o of r){const a=e[o];if(!n.includes(o))return!1;if(o!=="ref"){const s=t[o];if(wh(a)&&wh(s)||Ea(a)&&Ea(s)||Array.isArray(a)&&Array.isArray(s)?!If(a,s):a!==s)return!1}}return!0}var G$=e=>e.type==="select-multiple",l4e=e=>u8(e)||Xy(e),M3=e=>tw(e)&&e.isConnected,Y$=e=>{for(const t in e)if(dd(e[t]))return!0;return!1};function iw(e,t={}){const r=Array.isArray(e);if(Ea(e)||r)for(const n in e)Array.isArray(e[n])||Ea(e[n])&&!Y$(e[n])?(t[n]=Array.isArray(e[n])?[]:{},iw(e[n],t[n])):fs(e[n])||(t[n]=!0);return t}function Q$(e,t,r){const n=Array.isArray(e);if(Ea(e)||n)for(const o in e)Array.isArray(e[o])||Ea(e[o])&&!Y$(e[o])?Po(t)||nw(r[o])?r[o]=Array.isArray(e[o])?iw(e[o],[]):{...iw(e[o])}:Q$(e[o],fs(t)?{}:t[o],r[o]):r[o]=!If(e[o],t[o]);return r}var B3=(e,t)=>Q$(e,t,iw(t)),Z$=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Po(e)?e:t?e===""?NaN:e&&+e:r&&ku(e)?new Date(e):n?n(e):e;function O3(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return l8(t)?t.files:u8(t)?K$(e.refs).value:G$(t)?[...t.selectedOptions].map(({value:r})=>r):Xy(t)?q$(e.refs).value:Z$(Po(t.value)?e.ref.value:t.value,e)}var u4e=(e,t,r,n)=>{const o={};for(const a of e){const s=vn(t,a);s&&To(o,a,s._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}},jm=e=>Po(e)?e:rw(e)?e.source:Ea(e)?rw(e.value)?e.value.source:e.value:e,c4e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function yO(e,t,r){const n=vn(e,r);if(n||s8(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const a=o.join("."),s=vn(t,a),l=vn(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(l&&l.type)return{name:a,error:l};o.pop()}return{name:r}}var d4e=(e,t,r,n,o)=>o.isOnAll?!1:!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:(r?n.isOnChange:o.isOnChange)?e:!0,f4e=(e,t)=>!zg(vn(e,t)).length&&Ma(e,t);const p4e={mode:xl.onSubmit,reValidateMode:xl.onChange,shouldFocusError:!0};function h4e(e={},t){let r={...p4e,...e},n={submitCount:0,isDirty:!1,isLoading:dd(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{},disabled:!1},o={},a=Ea(r.defaultValues)||Ea(r.values)?ts(r.defaultValues||r.values)||{}:{},s=r.shouldUnregister?{}:ts(a),l={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0;const p={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},v={values:P3(),array:P3(),state:P3()},w=e.resetOptions&&e.resetOptions.keepDirtyValues,b=f4(r.mode),m=f4(r.reValidateMode),_=r.criteriaMode===xl.all,k=fe=>Oe=>{clearTimeout(d),d=setTimeout(fe,Oe)},A=async fe=>{if(p.isValid||fe){const Oe=r.resolver?Gs((await te()).errors):await se(o,!0);Oe!==n.isValid&&v.state.next({isValid:Oe})}},U=fe=>p.isValidating&&v.state.next({isValidating:fe}),M=(fe,Oe=[],rt,ut,Ft=!0,ce=!0)=>{if(ut&&rt){if(l.action=!0,ce&&Array.isArray(vn(o,fe))){const oe=rt(vn(o,fe),ut.argA,ut.argB);Ft&&To(o,fe,oe)}if(ce&&Array.isArray(vn(n.errors,fe))){const oe=rt(vn(n.errors,fe),ut.argA,ut.argB);Ft&&To(n.errors,fe,oe),f4e(n.errors,fe)}if(p.touchedFields&&ce&&Array.isArray(vn(n.touchedFields,fe))){const oe=rt(vn(n.touchedFields,fe),ut.argA,ut.argB);Ft&&To(n.touchedFields,fe,oe)}p.dirtyFields&&(n.dirtyFields=B3(a,s)),v.state.next({name:fe,isDirty:q(fe,Oe),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else To(s,fe,Oe)},L=(fe,Oe)=>{To(n.errors,fe,Oe),v.state.next({errors:n.errors})},F=(fe,Oe,rt,ut)=>{const Ft=vn(o,fe);if(Ft){const ce=vn(s,fe,Po(rt)?vn(a,fe):rt);Po(ce)||ut&&ut.defaultChecked||Oe?To(s,fe,Oe?ce:O3(Ft._f)):le(fe,ce),l.mount&&A()}},j=(fe,Oe,rt,ut,Ft)=>{let ce=!1,oe=!1;const de={name:fe};if(!rt||ut){p.isDirty&&(oe=n.isDirty,n.isDirty=de.isDirty=q(),ce=oe!==de.isDirty);const $=If(vn(a,fe),Oe);oe=vn(n.dirtyFields,fe),$?Ma(n.dirtyFields,fe):To(n.dirtyFields,fe,!0),de.dirtyFields=n.dirtyFields,ce=ce||p.dirtyFields&&oe!==!$}if(rt){const $=vn(n.touchedFields,fe);$||(To(n.touchedFields,fe,rt),de.touchedFields=n.touchedFields,ce=ce||p.touchedFields&&$!==rt)}return ce&&Ft&&v.state.next(de),ce?de:{}},ee=(fe,Oe,rt,ut)=>{const Ft=vn(n.errors,fe),ce=p.isValid&&Su(Oe)&&n.isValid!==Oe;if(e.delayError&&rt?(c=k(()=>L(fe,rt)),c(e.delayError)):(clearTimeout(d),c=null,rt?To(n.errors,fe,rt):Ma(n.errors,fe)),(rt?!If(Ft,rt):Ft)||!Gs(ut)||ce){const oe={...ut,...ce&&Su(Oe)?{isValid:Oe}:{},errors:n.errors,name:fe};n={...n,...oe},v.state.next(oe)}U(!1)},te=async fe=>r.resolver(s,r.context,u4e(fe||u.mount,o,r.criteriaMode,r.shouldUseNativeValidation)),Z=async fe=>{const{errors:Oe}=await te(fe);if(fe)for(const rt of fe){const ut=vn(Oe,rt);ut?To(n.errors,rt,ut):Ma(n.errors,rt)}else n.errors=Oe;return Oe},se=async(fe,Oe,rt={valid:!0})=>{for(const ut in fe){const Ft=fe[ut];if(Ft){const{_f:ce,...oe}=Ft;if(ce){const de=u.array.has(ce.name),$=await h4(Ft,s,_,r.shouldUseNativeValidation&&!Oe,de);if($[ce.name]&&(rt.valid=!1,Oe))break;!Oe&&(vn($,ce.name)?de?V$(n.errors,$,ce.name):To(n.errors,ce.name,$[ce.name]):Ma(n.errors,ce.name))}oe&&await se(oe,Oe,rt)}}return rt.valid},W=()=>{for(const fe of u.unMount){const Oe=vn(o,fe);Oe&&(Oe._f.refs?Oe._f.refs.every(rt=>!M3(rt)):!M3(Oe._f.ref))&&br(fe)}u.unMount=new Set},q=(fe,Oe)=>(fe&&Oe&&To(s,fe,Oe),!If($e(),a)),C=(fe,Oe,rt)=>H$(fe,u,{...l.mount?s:Po(Oe)?a:ku(fe)?{[fe]:Oe}:Oe},rt,Oe),G=fe=>zg(vn(l.mount?s:a,fe,e.shouldUnregister?vn(a,fe,[]):[])),le=(fe,Oe,rt={})=>{const ut=vn(o,fe);let Ft=Oe;if(ut){const ce=ut._f;ce&&(!ce.disabled&&To(s,fe,Z$(Oe,ce)),Ft=tw(ce.ref)&&fs(Oe)?"":Oe,G$(ce.ref)?[...ce.ref.options].forEach(oe=>oe.selected=Ft.includes(oe.value)):ce.refs?Xy(ce.ref)?ce.refs.length>1?ce.refs.forEach(oe=>(!oe.defaultChecked||!oe.disabled)&&(oe.checked=Array.isArray(Ft)?!!Ft.find(de=>de===oe.value):Ft===oe.value)):ce.refs[0]&&(ce.refs[0].checked=!!Ft):ce.refs.forEach(oe=>oe.checked=oe.value===Ft):l8(ce.ref)?ce.ref.value="":(ce.ref.value=Ft,ce.ref.type||v.values.next({name:fe,values:{...s}})))}(rt.shouldDirty||rt.shouldTouch)&&j(fe,Ft,rt.shouldTouch,rt.shouldDirty,!0),rt.shouldValidate&&Le(fe)},pe=(fe,Oe,rt)=>{for(const ut in Oe){const Ft=Oe[ut],ce=`${fe}.${ut}`,oe=vn(o,ce);(u.array.has(fe)||!nw(Ft)||oe&&!oe._f)&&!wh(Ft)?pe(ce,Ft,rt):le(ce,Ft,rt)}},be=(fe,Oe,rt={})=>{const ut=vn(o,fe),Ft=u.array.has(fe),ce=ts(Oe);To(s,fe,ce),Ft?(v.array.next({name:fe,values:{...s}}),(p.isDirty||p.dirtyFields)&&rt.shouldDirty&&v.state.next({name:fe,dirtyFields:B3(a,s),isDirty:q(fe,ce)})):ut&&!ut._f&&!fs(ce)?pe(fe,ce,rt):le(fe,ce,rt),p4(fe,u)&&v.state.next({...n}),v.values.next({name:fe,values:{...s}}),!l.mount&&t()},Q=async fe=>{const Oe=fe.target;let rt=Oe.name,ut=!0;const Ft=vn(o,rt),ce=()=>Oe.type?O3(Ft._f):N$(fe),oe=de=>{ut=Number.isNaN(de)||de===vn(s,rt,de)};if(Ft){let de,$;const E=ce(),I=fe.type===ew.BLUR||fe.type===ew.FOCUS_OUT,Y=!c4e(Ft._f)&&!r.resolver&&!vn(n.errors,rt)&&!Ft._f.deps||d4e(I,vn(n.touchedFields,rt),n.isSubmitted,m,b),ve=p4(rt,u,I);To(s,rt,E),I?(Ft._f.onBlur&&Ft._f.onBlur(fe),c&&c(0)):Ft._f.onChange&&Ft._f.onChange(fe);const je=j(rt,E,I,!1),dt=!Gs(je)||ve;if(!I&&v.values.next({name:rt,type:fe.type,values:{...s}}),Y)return p.isValid&&A(),dt&&v.state.next({name:rt,...ve?{}:je});if(!I&&ve&&v.state.next({...n}),U(!0),r.resolver){const{errors:cr}=await te([rt]);if(oe(E),ut){const Lr=yO(n.errors,o,rt),gr=yO(cr,o,Lr.name||rt);de=gr.error,rt=gr.name,$=Gs(cr)}}else de=(await h4(Ft,s,_,r.shouldUseNativeValidation))[rt],oe(E),ut&&(de?$=!1:p.isValid&&($=await se(o,!0)));ut&&(Ft._f.deps&&Le(Ft._f.deps),ee(rt,$,de,je))}},lt=(fe,Oe)=>{if(vn(n.errors,Oe)&&fe.focus)return fe.focus(),1},Le=async(fe,Oe={})=>{let rt,ut;const Ft=Zs(fe);if(U(!0),r.resolver){const ce=await Z(Po(fe)?fe:Ft);rt=Gs(ce),ut=fe?!Ft.some(oe=>vn(ce,oe)):rt}else fe?(ut=(await Promise.all(Ft.map(async ce=>{const oe=vn(o,ce);return await se(oe&&oe._f?{[ce]:oe}:oe)}))).every(Boolean),!(!ut&&!n.isValid)&&A()):ut=rt=await se(o);return v.state.next({...!ku(fe)||p.isValid&&rt!==n.isValid?{}:{name:fe},...r.resolver||!fe?{isValid:rt}:{},errors:n.errors,isValidating:!1}),Oe.shouldFocus&&!ut&&_0(o,lt,fe?Ft:u.mount),ut},$e=fe=>{const Oe={...a,...l.mount?s:{}};return Po(fe)?Oe:ku(fe)?vn(Oe,fe):fe.map(rt=>vn(Oe,rt))},ir=(fe,Oe)=>({invalid:!!vn((Oe||n).errors,fe),isDirty:!!vn((Oe||n).dirtyFields,fe),isTouched:!!vn((Oe||n).touchedFields,fe),error:vn((Oe||n).errors,fe)}),Ut=fe=>{fe&&Zs(fe).forEach(Oe=>Ma(n.errors,Oe)),v.state.next({errors:fe?n.errors:{}})},Pt=(fe,Oe,rt)=>{const ut=(vn(o,fe,{_f:{}})._f||{}).ref;To(n.errors,fe,{...Oe,ref:ut}),v.state.next({name:fe,errors:n.errors,isValid:!1}),rt&&rt.shouldFocus&&ut&&ut.focus&&ut.focus()},er=(fe,Oe)=>dd(fe)?v.values.subscribe({next:rt=>fe(C(void 0,Oe),rt)}):C(fe,Oe,!0),br=(fe,Oe={})=>{for(const rt of fe?Zs(fe):u.mount)u.mount.delete(rt),u.array.delete(rt),Oe.keepValue||(Ma(o,rt),Ma(s,rt)),!Oe.keepError&&Ma(n.errors,rt),!Oe.keepDirty&&Ma(n.dirtyFields,rt),!Oe.keepTouched&&Ma(n.touchedFields,rt),!r.shouldUnregister&&!Oe.keepDefaultValue&&Ma(a,rt);v.values.next({values:{...s}}),v.state.next({...n,...Oe.keepDirty?{isDirty:q()}:{}}),!Oe.keepIsValid&&A()},Tt=({disabled:fe,name:Oe,field:rt,fields:ut,value:Ft})=>{if(Su(fe)){const ce=fe?void 0:Po(Ft)?O3(rt?rt._f:vn(ut,Oe)._f):Ft;To(s,Oe,ce),j(Oe,ce,!1,!1,!0)}},Et=(fe,Oe={})=>{let rt=vn(o,fe);const ut=Su(Oe.disabled);return To(o,fe,{...rt||{},_f:{...rt&&rt._f?rt._f:{ref:{name:fe}},name:fe,mount:!0,...Oe}}),u.mount.add(fe),rt?Tt({field:rt,disabled:Oe.disabled,name:fe}):F(fe,!0,Oe.value),{...ut?{disabled:Oe.disabled}:{},...r.progressive?{required:!!Oe.required,min:jm(Oe.min),max:jm(Oe.max),minLength:jm(Oe.minLength),maxLength:jm(Oe.maxLength),pattern:jm(Oe.pattern)}:{},name:fe,onChange:Q,onBlur:Q,ref:Ft=>{if(Ft){Et(fe,Oe),rt=vn(o,fe);const ce=Po(Ft.value)&&Ft.querySelectorAll&&Ft.querySelectorAll("input,select,textarea")[0]||Ft,oe=l4e(ce),de=rt._f.refs||[];if(oe?de.find($=>$===ce):ce===rt._f.ref)return;To(o,fe,{_f:{...rt._f,...oe?{refs:[...de.filter(M3),ce,...Array.isArray(vn(a,fe))?[{}]:[]],ref:{type:ce.type,name:fe}}:{ref:ce}}}),F(fe,!1,void 0,ce)}else rt=vn(o,fe,{}),rt._f&&(rt._f.mount=!1),(r.shouldUnregister||Oe.shouldUnregister)&&!(j$(u.array,fe)&&l.action)&&u.unMount.add(fe)}}},kt=()=>r.shouldFocusError&&_0(o,lt,u.mount),Nt=fe=>{Su(fe)&&(v.state.next({disabled:fe}),_0(o,Oe=>{Oe.disabled=fe},0,!1))},Gt=(fe,Oe)=>async rt=>{rt&&(rt.preventDefault&&rt.preventDefault(),rt.persist&&rt.persist());let ut=ts(s);if(v.state.next({isSubmitting:!0}),r.resolver){const{errors:Ft,values:ce}=await te();n.errors=Ft,ut=ce}else await se(o);Ma(n.errors,"root"),Gs(n.errors)?(v.state.next({errors:{}}),await fe(ut,rt)):(Oe&&await Oe({...n.errors},rt),kt(),setTimeout(kt)),v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Gs(n.errors),submitCount:n.submitCount+1,errors:n.errors})},vr=(fe,Oe={})=>{vn(o,fe)&&(Po(Oe.defaultValue)?be(fe,vn(a,fe)):(be(fe,Oe.defaultValue),To(a,fe,Oe.defaultValue)),Oe.keepTouched||Ma(n.touchedFields,fe),Oe.keepDirty||(Ma(n.dirtyFields,fe),n.isDirty=Oe.defaultValue?q(fe,vn(a,fe)):q()),Oe.keepError||(Ma(n.errors,fe),p.isValid&&A()),v.state.next({...n}))},ie=(fe,Oe={})=>{const rt=fe?ts(fe):a,ut=ts(rt),Ft=fe&&!Gs(fe)?ut:a;if(Oe.keepDefaultValues||(a=rt),!Oe.keepValues){if(Oe.keepDirtyValues||w)for(const ce of u.mount)vn(n.dirtyFields,ce)?To(Ft,ce,vn(s,ce)):be(ce,vn(Ft,ce));else{if(a8&&Po(fe))for(const ce of u.mount){const oe=vn(o,ce);if(oe&&oe._f){const de=Array.isArray(oe._f.refs)?oe._f.refs[0]:oe._f.ref;if(tw(de)){const $=de.closest("form");if($){$.reset();break}}}}o={}}s=e.shouldUnregister?Oe.keepDefaultValues?ts(a):{}:ts(Ft),v.array.next({values:{...Ft}}),v.values.next({values:{...Ft}})}u={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!l.mount&&t(),l.mount=!p.isValid||!!Oe.keepIsValid,l.watch=!!e.shouldUnregister,v.state.next({submitCount:Oe.keepSubmitCount?n.submitCount:0,isDirty:Oe.keepDirty?n.isDirty:!!(Oe.keepDefaultValues&&!If(fe,a)),isSubmitted:Oe.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Oe.keepDirtyValues?n.dirtyFields:Oe.keepDefaultValues&&fe?B3(a,fe):{},touchedFields:Oe.keepTouched?n.touchedFields:{},errors:Oe.keepErrors?n.errors:{},isSubmitSuccessful:Oe.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Bt=(fe,Oe)=>ie(dd(fe)?fe(s):fe,Oe);return{control:{register:Et,unregister:br,getFieldState:ir,handleSubmit:Gt,setError:Pt,_executeSchema:te,_getWatch:C,_getDirty:q,_updateValid:A,_removeUnmounted:W,_updateFieldArray:M,_updateDisabledField:Tt,_getFieldArray:G,_reset:ie,_resetDefaultValues:()=>dd(r.defaultValues)&&r.defaultValues().then(fe=>{Bt(fe,r.resetOptions),v.state.next({isLoading:!1})}),_updateFormState:fe=>{n={...n,...fe}},_disableForm:Nt,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return s},get _state(){return l},set _state(fe){l=fe},get _defaultValues(){return a},get _names(){return u},set _names(fe){u=fe},get _formState(){return n},set _formState(fe){n=fe},get _options(){return r},set _options(fe){r={...r,...fe}}},trigger:Le,register:Et,handleSubmit:Gt,watch:er,setValue:be,getValues:$e,reset:Bt,resetField:vr,clearErrors:Ut,unregister:br,setError:Pt,setFocus:(fe,Oe={})=>{const rt=vn(o,fe),ut=rt&&rt._f;if(ut){const Ft=ut.refs?ut.refs[0]:ut.ref;Ft.focus&&(Ft.focus(),Oe.shouldSelect&&Ft.select())}},getFieldState:ir}}function M1(e={}){const t=Yn.useRef(),r=Yn.useRef(),[n,o]=Yn.useState({isDirty:!1,isValidating:!1,isLoading:dd(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},disabled:!1,defaultValues:dd(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...h4e(e,()=>o(s=>({...s}))),formState:n});const a=t.current.control;return a._options=e,f_({subject:a._subjects.state,next:s=>{$$(s,a._proxyFormState,a._updateFormState,!0)&&o({...a._formState})}}),Yn.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Yn.useEffect(()=>{if(a._proxyFormState.isDirty){const s=a._getDirty();s!==n.isDirty&&a._subjects.state.next({isDirty:s})}},[a,n.isDirty]),Yn.useEffect(()=>{e.values&&!If(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values):a._resetDefaultValues()},[e.values,a]),Yn.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=F$(n,a),t.current}function uc({label:e,name:t,control:r}){return D(r4e,{name:t,control:r,render:({field:n,fieldState:{error:o}})=>D(Rh,{helperText:o?o.message:null,error:!!o,fullWidth:!0,label:e,variant:"outlined",...n})})}function g4e(e){return Wn.beginCell().storeUint(2003,32).storeUint(0,64).storeAddress(e).endCell()}function m4e(e){return Wn.beginCell().storeUint(3004,32).storeUint(0,64).storeAddress(e).endCell()}function y4e(e,t){return Wn.beginCell().storeUint(6007,32).storeUint(0,64).storeCoins(e).storeCoins(t).endCell()}function v4e(){const{data:e,isLoading:t}=qy();Og();const r=LE(),n=M1({defaultValues:{admin:e?.admin||""}}),o=M1({defaultValues:{verifierRegistry:e?.verifierRegistry||""}}),a=M1({defaultValues:{minTon:e?.deploymentCosts.min||"",maxTon:e?.deploymentCosts.max||""}});async function s(c){if(!e?.address)throw new Error("no address");if(c.admin!==e?.admin)try{const d=m4e(Wn.Address.parse(c.admin));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&n.setError("admin",{message:"Failed to change admin"})}catch(d){let p="Failed to change admin";"message"in d&&(p=d.message),n.setError("admin",{message:p})}}async function l(c){if(!e?.address)throw new Error("no address");if(c.verifierRegistry!==e?.verifierRegistry)try{const d=g4e(Wn.Address.parse(c.verifierRegistry));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&o.setError("verifierRegistry",{message:"Failed to change verifier registry"})}catch(d){let p="Failed to change verifier registry";"message"in d&&(p=d.message),o.setError("verifierRegistry",{message:p})}}async function u(c){if(!e?.address)throw new Error("no address");if(c.minTon!==e?.deploymentCosts.min||c.maxTon!==e?.deploymentCosts.max)try{const d=y4e(Wn.toNano(c.minTon),Wn.toNano(c.maxTon));await r(e.address.toString(),Wn.toNano("0.01"),d)==="rejected"&&a.setError("root",{message:"Failed to change deployment costs"})}catch(d){let p="Failed to change deployment costs";"message"in d&&(p=d.message),a.setError("root",{message:p})}}return J.exports.useEffect(()=>{e&&(n.reset({admin:e.admin}),o.reset({verifierRegistry:e.verifierRegistry}),a.reset({minTon:e.deploymentCosts.min,maxTon:e.deploymentCosts.max}))},[e]),Lt(ks,{spacing:4,p:4,children:[D("h1",{children:"Sources Registry"}),t&&D(yg,{}),e&&Lt(ra,{children:[D(o8,{label:"Address",data:e.address.toString()}),D("form",{id:"adminForm",onSubmit:n.handleSubmit(s),children:Lt(ks,{spacing:2,children:[!n.formState.isValid&&D(_1,{severity:"error",children:Object.entries(n.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...n.register("admin"),control:n.control,label:"Admin"}),D(ud,{text:"Save",type:"submit",disabled:!n.formState.isDirty})]})]})}),D("form",{id:"verifierRegistryForm",onSubmit:o.handleSubmit(l),children:Lt(ks,{spacing:2,children:[!o.formState.isValid&&D(_1,{severity:"error",children:Object.entries(o.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...o.register("verifierRegistry"),control:o.control,label:"Verifier Reg."}),D(ud,{text:"Save",type:"submit",disabled:!o.formState.isDirty})]})]})}),D("form",{id:"sourcesRegistryForm",onSubmit:a.handleSubmit(u),children:Lt(ks,{spacing:2,children:[!a.formState.isValid&&D(_1,{severity:"error",children:Object.entries(a.formState.errors).map(([c,d])=>D("div",{children:d.message},c))}),Lt(ks,{direction:"row",spacing:2,alignItems:"center",children:[D(uc,{...a.register("minTon"),control:a.control,label:"Min Ton"}),D(uc,{...a.register("maxTon"),control:a.control,label:"Max Ton"}),D(ud,{text:"Save",type:"submit",disabled:!a.formState.isDirty})]})]})})]})]})}const X$={removeVerifier:435836471,updateVerifier:1610798618,forwardMessage:1965127512};function vO(e){return $b(xwe(e))}function b4e(e){let t=e.split(".");return((+t[0]*256+ +t[1])*256+ +t[2])*256+ +t[3]}function w4e(){return{serialize:(e,t)=>{t.storeSlice(e)},parse:e=>e}}function x4e(e){let t=Wn.beginCell();t.storeUint(X$.updateVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.storeUint(e.quorum,8);let r=Wn.Dictionary.empty(Wn.Dictionary.Keys.BigUint(256),w4e());return e.endpoints.forEach(function(n,o){r.set(o,Wn.beginCell().storeUint(n,32).endCell().beginParse())}),t.storeDict(r),t.storeRef(Wn.beginCell().storeBuffer(Buffer.from(e.name)).endCell()),t.storeRef(Wn.beginCell().storeBuffer(Buffer.from(e.marketingUrl)).endCell()),t.endCell()}function _4e(e){let t=Wn.beginCell();return t.storeUint(X$.removeVerifier,32),t.storeUint(e.queryId||0,64),t.storeUint(e.id,256),t.endCell()}function bO({verifier:e,altColor:t,isNew:r}){const n=LE(),{data:o}=qy(),a=J.exports.useMemo(()=>Object.entries(e.pubKeyEndpoints).map(([p,v])=>({pubKey:p,ip:v})),[e.pubKeyEndpoints]),s=M1({defaultValues:{quorum:e.quorum.toString()||"",name:e.name||"",url:e.url||"",pubKeyEndpoints:a||[]},mode:"onChange"});async function l(p){if(!p.name){s.setError("name",{message:"Name is required"});return}if(!p.url){s.setError("url",{message:"Url is required"});return}if(!p.quorum||Number(p.quorum)<1){s.setError("quorum",{message:"Quorum is required and should be at least 1"});return}try{await n(o?.verifierRegistry??"",Wn.toNano(r?"1000":"0.01"),x4e({id:vO(p.name),quorum:Number(p.quorum),endpoints:new Map(p.pubKeyEndpoints.map(({pubKey:w,ip:b})=>[$b(Buffer.from(w,"base64")),b4e(b)])),name:p.name,marketingUrl:p.url}))==="rejected"&&s.setError("root",{message:`Failed to update config of ${p.name}`})}catch(v){let w=`Failed to update config of ${p.name}`;"message"in v&&(w=v.message),s.setError("root",{message:w})}}const{fields:u,append:c,remove:d}=s4e({control:s.control,name:"pubKeyEndpoints"});return D("form",{id:e.admin.toString(),onSubmit:s.handleSubmit(l),children:Lt(ks,{spacing:4,px:4,py:6,style:{backgroundColor:t?"#eeeeef":"transparent"},children:[!s.formState.isValid&&D(_1,{severity:"error",children:Object.entries(s.formState.errors).map(([p,v])=>D("div",{children:v.message},p))}),Lt(ks,{flexDirection:"row",alignItems:"center",gap:2,children:[D("h3",{style:{margin:0},children:r?"Add Verifier":s.getValues("name")}),!r&&D(ud,{text:"Remove",onClick:()=>{n(o.verifierRegistry,Wn.toNano("0.01"),_4e({id:vO(s.getValues("name"))}))}})]}),D(o8,{label:"Admin",data:e.admin.toString()}),r&&D(uc,{label:"Name",name:"name",control:s.control}),D(uc,{label:"Url",name:"url",control:s.control}),D(uc,{label:"Quorum",name:"quorum",control:s.control}),Lt(ks,{spacing:2,alignItems:"flex-start",children:[Lt(ks,{direction:"row",spacing:4,alignItems:"center",children:[D("h4",{children:"Public Key Endpoints"}),D(ud,{size:"small",text:"Add",onClick:()=>{c({pubKey:"",ip:""})}})]}),u.map((p,v)=>Lt(Ov,{container:!0,alignItems:"center",gap:2,wrap:"nowrap",children:[D(Ov,{item:!0,xs:6,children:D(uc,{label:`PubKey-${v}`,name:`pubKeyEndpoints.${v}.pubKey`,control:s.control})}),D(Ov,{item:!0,xs:5,children:D(uc,{label:`IP-${v}`,name:`pubKeyEndpoints.${v}.ip`,control:s.control})}),D(Ov,{item:!0,xs:1,children:D(ud,{text:"Remove",onClick:()=>d(v)})})]},p.id))]}),D(ud,{text:r?"Add verifier":"Update config",type:"submit",disabled:!s.formState.isDirty})]})})}function S4e(){const{data:e,isLoading:t}=n_(),{data:r}=qy(),[n]=Og();return Lt(ks,{spacing:4,p:4,children:[D("h1",{children:"Verifier Registry"}),D(o8,{label:"Address",data:r?.verifierRegistry??""}),t&&D(yg,{}),Lt(ks,{children:[t&&"Loading...",e?.map((o,a)=>D(bO,{verifier:o,altColor:a%2!==1,isNew:!1}))]}),n.account?.address&&D(bO,{isNew:!0,altColor:!0,verifier:{admin:Wn.Address.parse(n.account?.address),name:"",quorum:0,url:"",pubKeyEndpoints:{}}})]})}function C4e(){return Lt("div",{children:[window.isTestnet&&D(i8,{}),Lt(ks,{direction:"row",justifyContent:"space-between",alignItems:"center",p:4,children:[D("h1",{children:"Admin"}),D(Qx,{})]}),D(v4e,{}),D(S4e,{}),D(Jb,{})]})}const k4e=lr(kn)(({theme:e})=>t=>({display:t.isMobile?"flex":"inherit",alignItems:t.isMobile?"center":"inherit",fontWight:700,color:"#fff",height:t.isMobile?90:100,background:"#fff",borderBottomLeftRadius:e.spacing(6),borderBottomRightRadius:e.spacing(6),border:"0.5px solid rgba(114, 138, 150, 0.24)",boxShadow:"rgb(114 138 150 / 8%) 0px 2px 16px"}));function E4e(){const e=ua(),t=sa(e.breakpoints.down("md")),r=sa(e.breakpoints.down("lg"));return D(k4e,{px:r?3.4:0,isMobile:t,children:Lt(TN,{mb:5,children:[Lt(mp,{children:[D("img",{src:Rw,width:30,height:30,alt:"App icon"}),D(kx,{children:"TACT DEPLOYER"})]}),Lt(AN,{children:[D(Fn,{mr:t?0:2,children:D(Qx,{})}),!t&&Lt(mp,{href:lk,target:"_blank",children:[D("img",{src:b6,alt:"Github icon",width:20,height:20}),D(Vk,{children:"GitHub"})]})]})]})})}const A4e=lr("input")({display:"flex",alignItems:"center",paddingLeft:14,boxSizing:"border-box",height:34,background:"#FFFFFF",border:"1px solid #D8D8D8",borderRadius:"12px",fontSize:14,fontFamily:"Mulish",outline:"none","&:hover":{border:"1px solid #b0b0b0"},"&:focus":{border:"1px solid #807e7e"}}),T4e=Wn.Cell.fromBoc(Buffer.from("te6cckEBAQEADgAAGJRqmLYAAAAAAAAAAOnNeQ0=","base64"))[0];async function U3(e){const t=`https://tact-deployer${window.isTestnet?"-testnet":""}.infura-ipfs.io`;return fetch(`${t}/ipfs/${e}`)}function c8({workchain:e}){const{ipfsHash:t}=Z9(),{data:r,error:n,isLoading:o}=Cc(["tactDeploy",t],async()=>{if(!t)return null;const a=await Ep(),s=await U3(t).then(_=>_.json()),l=await U3(s.pkg).then(_=>_.json()),u=await U3(s.dataCell).then(_=>_.arrayBuffer()).then(_=>Wn.Cell.fromBoc(Buffer.from(_))[0]),c=Wn.Cell.fromBoc(Buffer.from(l.code,"base64"))[0],d=Wn.contractAddress(e,{code:c,data:u}),p={code:c,data:u},v=u.hash().toString("base64"),w=c.hash().toString("base64"),b=await a.isContractDeployed(d),m=b&&await DE(w);return{address:d,stateInit:p,pkg:l,codeCellHash:w,dataCellHash:v,isDeployed:b,hasProof:m}});return{data:r,error:n,isLoading:o}}function I4e(e,t,r){const{sendTXN:n,data:o,clearTXN:a}=eF("deployContract",async s=>{if(!r)throw new Error("No address");const l=await Ep();return s>20?"error":await l.isContractDeployed(r)?"success":"issued"});return{sendTXN:()=>{!r||n(r,Wn.toNano(e),T4e,t)},status:o.status,clearTXN:a}}function R4e(){const e=[],{data:t,error:r}=c8({workchain:0});return t&&(e.push({title:"Name",value:t.pkg.name}),e.push({title:"Compiler",value:`Tact ${t.pkg.compiler.version}`}),e.push({title:"Code Hash",value:t.codeCellHash}),e.push({title:"Data Hash",value:t.dataCellHash}),e.push({title:"Workchain",value:IF(t.address.toString())})),D(KE,{title:"Contract",icon:qE,dataRows:e,isLoading:!1,isFlexibleWrapper:!0})}function P4e(){const[e,t]=J.exports.useState("0.5"),{data:r,error:n}=c8({workchain:0}),{sendTXN:o,status:a}=I4e(e,r?.stateInit,r?.address),{markPreloaded:s}=EF(),l=Mc(),u=Gu();let c="";if(n)c=n.toString();else if(r?.isDeployed)c=Lt("div",{children:["Contract is already deployed.",!r.hasProof&&" You can publish its sources to verify it."]});else switch(a){case"initial":c="Contract is ready for deployment";break;case"pending":c="Please approve the transaction in your wallet";break;case"issued":c="Transaction was issued. Monitoring deployment...";break;case"rejected":c="Transaction was rejected. Please retry.";break;case"error":c="Transaction failed. Please retry.";break;case"expired":c="Transaction expired. Please retry.";break;case"success":c="Contract deployed successfully! You can now publish its sources to verify it.";break}let d=Lt(Va,{disabled:a==="pending"||a==="issued"||r?.isDeployed,fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{o()},children:[(a==="pending"||a==="issued")&&D(yg,{sx:{color:"#fff",height:"20px !important",width:"20px !important"}}),"Deploy"]});return(a==="success"||r?.isDeployed&&!r.hasProof)&&(d=D(Va,{fontSize:14,fontWeight:800,textColor:"#fff",height:44,width:144,background:"#1976d2",hoverBackground:"#156cc2",onClick:()=>{s(),l("/"+r.address.toString()),u.addFiles([new File([JSON.stringify(r.pkg)],r.pkg.name+".pkg",{type:"text/plain"})])},children:"Verify"})),Lt(vg,{mb:6,children:[Lt(Fn,{p:"30px 24px 0 24px",children:[D(bg,{children:D("img",{src:qE,alt:"publish icon",width:41,height:41})}),D(Kd,{children:"Deploy"})]}),Lt(kn,{children:[Lt(kn,{sx:{padding:"0 30px"},children:[Lt(WE,{gap:2,sx:{mt:2},children:[D(Ic,{children:D("div",{children:"Value to initialize contract (TON)"})}),D(Ic,{children:D(A4e,{disabled:!!r?.isDeployed||a==="issued"||a=="pending",value:e,type:"number",onChange:p=>{t(p.target.value)}})})]}),D(Is,{type:hs.HINT,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:Lt(zd,{sx:{marginBottom:0},children:[D(kn,{sx:{fontWeight:600},children:"Contract Address"}),D(kn,{sx:{fontSize:18,fontWeight:700,wordBreak:"break-all"},children:r?.address.toString()})]})})}),D(Is,{type:hs.INFO,title:D(ra,{}),notificationBody:D(Fn,{sx:{overflow:"auto",maxHeight:300},children:D(zd,{sx:{marginBottom:0},children:c})})}),d]}),D(Fn,{mb:3,sx:{justifyContent:"center"}})]})]})}function M4e(){const e=ua(),t=sa(e.breakpoints.down("md")),r=sa(e.breakpoints.down("lg")),{data:n,error:o,isLoading:a}=c8({workchain:0});return Lt(kn,{children:[window.isTestnet&&D(i8,{}),D(E4e,{}),Lt(O$,{px:r?"20px":0,children:[a&&Lt(Ic,{sx:{marginTop:3},children:[D(es,{height:330,variant:"rounded",sx:{marginBottom:3}}),D(es,{height:280,variant:"rounded"})]}),!a&&Lt(ra,{children:[D(U$,{isMobile:t,children:D(R4e,{})}),D(P4e,{})]})]}),")",D(Jb,{})]})}const B4e=new qW({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});swe();BS.createRoot(document.getElementById("root")).render(D(Ohe,{maxSnack:3,children:D(BZ,{theme:YCe,children:D(IK,{client:B4e,children:D(N1e,{manifestUrl:"https://verifier.ton.org/tonconnect-manifest.json",children:D(zG,{basename:"/",children:Lt(FG,{children:[D(Xp,{path:"/interact",element:D(GCe,{})}),D(Xp,{path:"/admin",element:D(C4e,{})}),D(Xp,{path:"/tactDeployer/:ipfsHash",element:D(M4e,{})}),D(Xp,{path:"/:contractAddress",element:D(dO,{})}),D(Xp,{path:"/",element:D(dO,{})})]})})})})})}));export{ow as g}; diff --git a/index.html b/index.html index 3c268d3..05aaf6c 100644 --- a/index.html +++ b/index.html @@ -38,7 +38,7 @@ - +