@elizaos/client 1.7.2-alpha.10 → 1.7.2-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-37QAKDTI-BPeGsEwm.js","assets/react-vendor-CSPnBj6z.js","assets/ui-vendor-B7JxFfFk.js","assets/main-CkdfNj0n.js"])))=>i.map(i=>d[i]);
2
- var pB=Object.defineProperty;var a=(e,t)=>pB(e,"name",{value:t,configurable:!0});import{g as Ol,j as v,S as Rl,r as F,R as LA,a as DA,T as jA,P as UA,C as sp,b as BA,X as Hn,O as op,c as lp,D as up,d as mB,e as gB,f as bB,h as vB,i as zA,k as yB,l as FA,m as HA,L as By,n as zy,o as ZA,p as wB,V as xB,G as _B,q as GA,I as EB,s as ha,t as SB,u as VA,v as kB,w as WA,x as AB,y as Va,z as TB,A as YA,B as QA,E as $A,F as XA,H as JA,J as nn,K as NB,M as IB,N as CB,Q as MB,U as OB,W as RB,Y as PB,Z as LB,_ as DB,$ as KA,a0 as qA,a1 as eT,a2 as tT,a3 as rT,a4 as nT,a5 as pi,a6 as jB,a7 as iT,a8 as aT,a9 as UB,aa as sT,ab as cn,ac as Fy,ad as Yc,ae as oT,af as lT,ag as BB,ah as zB,ai as Hy,aj as uT,ak as FB,al as HB,am as cT,an as ZB,ao as ro,ap as v0,aq as ja,ar as na,as as n1,at as fo,au as GB,av as aa,aw as mn,ax as an,ay as dT,az as fT,aA as hT,aB as pT,aC as mT,aD as ei,aE as cp,aF as VB,aG as WB,aH as YB,aI as dp,aJ as fp,aK as Ou,aL as ho,aM as vs,aN as i1,aO as QB,aP as Qc,aQ as hp,aR as ic,aS as $B,aT as a1,aU as XB,aV as gT,aW as JB,aX as bT,aY as vT,aZ as yT,a_ as wT,a$ as xT,b0 as KB,b1 as Zy,b2 as lv,b3 as _T,b4 as qB,b5 as lh,b6 as Gy,b7 as ez,b8 as tz,b9 as rz,ba as nz,bb as iz,bc as Vy,bd as az,be as sz,bf as oz,bg as Wy,bh as Yy,bi as lz,bj as ET,bk as uv,bl as uz,bm as ST,bn as cz,bo as dz,bp as fz,bq as hz,br as pz,bs as mz,bt as gz,bu as bz,bv as vz,bw as kT,bx as AT,by as TT,bz as NT,bA as yz,bB as wz,bC as xz,bD as cv,bE as _z,bF as Ez,bG as pp,bH as Sz,bI as IT,bJ as kz,bK as Az,bL as y0,bM as s1,bN as o1,bO as Tz,bP as Qy,bQ as Nz,bR as Iz,bS as Cz,bT as Mz,bU as Oz,bV as Rz,bW as Pz,bX as Lz,bY as Dz,bZ as jz,b_ as yi,b$ as Uz}from"./react-vendor-CSPnBj6z.js";import{_ as CT}from"./main-CkdfNj0n.js";function MT(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=MT(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}a(MT,"r");function mp(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=MT(e))&&(n&&(n+=" "),n+=t);return n}a(mp,"clsx");const l1=a(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),u1=mp,$a=a((e,t)=>r=>{var n;if(t?.variants==null)return u1(e,r?.class,r?.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const d=r?.[c],f=s?.[c];if(d===null)return null;const g=l1(d)||l1(f);return i[c][g]}),l=r&&Object.entries(r).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:g,...m}=d;return Object.entries(m).every(w=>{let[E,A]=w;return Array.isArray(A)?A.includes({...s,...l}[E]):{...s,...l}[E]===A})?[...c,f,g]:c},[]);return u1(e,o,u,r?.class,r?.className)},"cva"),Fa="user",zd="client_chat",Ru="client_group_chat",ac=512;var Bf=(e=>(e.REQUIRED="required",e.OPTIONAL="optional",e))(Bf||{});const Fo={name:"required",username:"optional",system:"required","settings.voice.model":"optional",bio:"optional",topics:"optional",adjectives:"optional","style.all":"optional","style.chat":"optional","style.post":"optional"};var zf={exports:{}},Bz=zf.exports,c1;function zz(){return c1||(c1=1,(function(e,t){(function(r,n){e.exports=n()})(Bz,(function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",l="minute",u="hour",c="day",d="week",f="month",g="quarter",m="year",w="date",E="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(b){var x=["th","st","nd","rd"],_=b%100;return"["+b+(x[(_-20)%10]||x[_]||x[0])+"]"},"ordinal")},R=a(function(b,x,_){var N=String(b);return!N||N.length>=x?b:""+Array(x+1-N.length).join(_)+b},"m"),P={s:R,z:a(function(b){var x=-b.utcOffset(),_=Math.abs(x),N=Math.floor(_/60),T=_%60;return(x<=0?"+":"-")+R(N,2,"0")+":"+R(T,2,"0")},"z"),m:a(function b(x,_){if(x.date()<_.date())return-b(_,x);var N=12*(_.year()-x.year())+(_.month()-x.month()),T=x.clone().add(N,f),k=_-T<0,p=x.clone().add(N+(k?-1:1),f);return+(-(N+(_-T)/(k?T-p:p-T))||0)},"t2"),a:a(function(b){return b<0?Math.ceil(b)||0:Math.floor(b)},"a"),p:a(function(b){return{M:f,y:m,w:d,d:c,D:w,h:u,m:l,s:o,ms:s,Q:g}[b]||String(b||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(b){return b===void 0},"u")},L="en",j={};j[L]=O;var G="$isDayjsObject",Z=a(function(b){return b instanceof h||!(!b||!b[G])},"S"),K=a(function b(x,_,N){var T;if(!x)return L;if(typeof x=="string"){var k=x.toLowerCase();j[k]&&(T=k),_&&(j[k]=_,T=k);var p=x.split("-");if(!T&&p.length>1)return b(p[0])}else{var S=x.name;j[S]=x,T=S}return!N&&T&&(L=T),T||!N&&L},"t2"),z=a(function(b,x){if(Z(b))return b.clone();var _=typeof x=="object"?x:{};return _.date=b,_.args=arguments,new h(_)},"O"),V=P;V.l=K,V.i=Z,V.w=function(b,x){return z(b,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var h=(function(){function b(_){this.$L=K(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[G]=!0}a(b,"M2");var x=b.prototype;return x.parse=function(_){this.$d=(function(N){var T=N.date,k=N.utc;if(T===null)return new Date(NaN);if(V.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var p=T.match(A);if(p){var S=p[2]-1||0,I=(p[7]||"0").substring(0,3);return k?new Date(Date.UTC(p[1],S,p[3]||1,p[4]||0,p[5]||0,p[6]||0,I)):new Date(p[1],S,p[3]||1,p[4]||0,p[5]||0,p[6]||0,I)}}return new Date(T)})(_),this.init()},x.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},x.$utils=function(){return V},x.isValid=function(){return this.$d.toString()!==E},x.isSame=function(_,N){var T=z(_);return this.startOf(N)<=T&&T<=this.endOf(N)},x.isAfter=function(_,N){return z(_)<this.startOf(N)},x.isBefore=function(_,N){return this.endOf(N)<z(_)},x.$g=function(_,N,T){return V.u(_)?this[N]:this.set(T,_)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(_,N){var T=this,k=!!V.u(N)||N,p=V.p(_),S=a(function(ie,ne){var Ne=V.w(T.$u?Date.UTC(T.$y,ne,ie):new Date(T.$y,ne,ie),T);return k?Ne:Ne.endOf(c)},"l2"),I=a(function(ie,ne){return V.w(T.toDate()[ie].apply(T.toDate("s"),(k?[0,0,0,0]:[23,59,59,999]).slice(ne)),T)},"$2"),M=this.$W,U=this.$M,B=this.$D,H="set"+(this.$u?"UTC":"");switch(p){case m:return k?S(1,0):S(31,11);case f:return k?S(1,U):S(0,U+1);case d:var $=this.$locale().weekStart||0,ae=(M<$?M+7:M)-$;return S(k?B-ae:B+(6-ae),U);case c:case w:return I(H+"Hours",0);case u:return I(H+"Minutes",1);case l:return I(H+"Seconds",2);case o:return I(H+"Milliseconds",3);default:return this.clone()}},x.endOf=function(_){return this.startOf(_,!1)},x.$set=function(_,N){var T,k=V.p(_),p="set"+(this.$u?"UTC":""),S=(T={},T[c]=p+"Date",T[w]=p+"Date",T[f]=p+"Month",T[m]=p+"FullYear",T[u]=p+"Hours",T[l]=p+"Minutes",T[o]=p+"Seconds",T[s]=p+"Milliseconds",T)[k],I=k===c?this.$D+(N-this.$W):N;if(k===f||k===m){var M=this.clone().set(w,1);M.$d[S](I),M.init(),this.$d=M.set(w,Math.min(this.$D,M.daysInMonth())).$d}else S&&this.$d[S](I);return this.init(),this},x.set=function(_,N){return this.clone().$set(_,N)},x.get=function(_){return this[V.p(_)]()},x.add=function(_,N){var T,k=this;_=Number(_);var p=V.p(N),S=a(function(U){var B=z(k);return V.w(B.date(B.date()+Math.round(U*_)),k)},"y2");if(p===f)return this.set(f,this.$M+_);if(p===m)return this.set(m,this.$y+_);if(p===c)return S(1);if(p===d)return S(7);var I=(T={},T[l]=n,T[u]=i,T[o]=r,T)[p]||1,M=this.$d.getTime()+_*I;return V.w(M,this)},x.subtract=function(_,N){return this.add(-1*_,N)},x.format=function(_){var N=this,T=this.$locale();if(!this.isValid())return T.invalidDate||E;var k=_||"YYYY-MM-DDTHH:mm:ssZ",p=V.z(this),S=this.$H,I=this.$m,M=this.$M,U=T.weekdays,B=T.months,H=T.meridiem,$=a(function(ne,Ne,ve,he){return ne&&(ne[Ne]||ne(N,k))||ve[Ne].slice(0,he)},"h2"),ae=a(function(ne){return V.s(S%12||12,ne,"0")},"d2"),ie=H||function(ne,Ne,ve){var he=ne<12?"AM":"PM";return ve?he.toLowerCase():he};return k.replace(C,(function(ne,Ne){return Ne||(function(ve){switch(ve){case"YY":return String(N.$y).slice(-2);case"YYYY":return V.s(N.$y,4,"0");case"M":return M+1;case"MM":return V.s(M+1,2,"0");case"MMM":return $(T.monthsShort,M,B,3);case"MMMM":return $(B,M);case"D":return N.$D;case"DD":return V.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return $(T.weekdaysMin,N.$W,U,2);case"ddd":return $(T.weekdaysShort,N.$W,U,3);case"dddd":return U[N.$W];case"H":return String(S);case"HH":return V.s(S,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return ie(S,I,!0);case"A":return ie(S,I,!1);case"m":return String(I);case"mm":return V.s(I,2,"0");case"s":return String(N.$s);case"ss":return V.s(N.$s,2,"0");case"SSS":return V.s(N.$ms,3,"0");case"Z":return p}return null})(ne)||p.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(_,N,T){var k,p=this,S=V.p(N),I=z(_),M=(I.utcOffset()-this.utcOffset())*n,U=this-I,B=a(function(){return V.m(p,I)},"D2");switch(S){case m:k=B()/12;break;case f:k=B();break;case g:k=B()/3;break;case d:k=(U-M)/6048e5;break;case c:k=(U-M)/864e5;break;case u:k=U/i;break;case l:k=U/n;break;case o:k=U/r;break;default:k=U}return T?k:V.a(k)},x.daysInMonth=function(){return this.endOf(f).$D},x.$locale=function(){return j[this.$L]},x.locale=function(_,N){if(!_)return this.$L;var T=this.clone(),k=K(_,N,!0);return k&&(T.$L=k),T},x.clone=function(){return V.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},b})(),y=h.prototype;return z.prototype=y,[["$ms",s],["$s",o],["$m",l],["$H",u],["$W",c],["$M",f],["$y",m],["$D",w]].forEach((function(b){y[b[1]]=function(x){return this.$g(x,b[0],b[1])}})),z.extend=function(b,x){return b.$i||(b(x,h,z),b.$i=!0),z},z.locale=K,z.isDayjs=Z,z.unix=function(b){return z(1e3*b)},z.en=j[L],z.Ls=j,z.p={},z}))})(zf)),zf.exports}a(zz,"requireDayjs_min");var Fz=zz();const OT=Ol(Fz);var Ff={exports:{}},Hz=Ff.exports,d1;function Zz(){return d1||(d1=1,(function(e,t){(function(r,n){e.exports=n()})(Hz,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(n,i,s){var o=i.prototype,l=o.format;s.en.formats=r,o.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,d=(function(f,g){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(m,w,E){var A=E&&E.toUpperCase();return w||g[E]||r[E]||g[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(C,O,R){return O||R.slice(1)}))}))})(u,c===void 0?{}:c);return l.call(this,d)}}}))})(Ff)),Ff.exports}a(Zz,"requireLocalizedFormat");var Gz=Zz();const Vz=Ol(Gz),Wz=a((e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},"concatArrays"),Yz=a((e,t)=>({classGroupId:e,validator:t}),"createClassValidatorObject"),RT=a((e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),"createClassPartObject"),uh="-",f1=[],Qz="arbitrary..",$z=a(e=>{const t=Jz(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a(o=>{if(o.startsWith("[")&&o.endsWith("]"))return Xz(o);const l=o.split(uh),u=l[0]===""&&l.length>1?1:0;return PT(l,u,t)},"getClassGroupId"),getConflictingClassGroupIds:a((o,l)=>{if(l){const u=n[o],c=r[o];return u?c?Wz(c,u):u:c||f1}return r[o]||f1},"getConflictingClassGroupIds")}},"createClassGroupUtils"),PT=a((e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],s=r.nextPart.get(i);if(s){const c=PT(e,t+1,s);if(c)return c}const o=r.validators;if(o===null)return;const l=t===0?e.join(uh):e.slice(t).join(uh),u=o.length;for(let c=0;c<u;c++){const d=o[c];if(d.validator(l))return d.classGroupId}},"getGroupRecursive"),Xz=a(e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Qz+n:void 0})(),"getGroupIdForArbitraryProperty"),Jz=a(e=>{const{theme:t,classGroups:r}=e;return Kz(r,t)},"createClassMap"),Kz=a((e,t)=>{const r=RT();for(const n in e){const i=e[n];$y(i,r,n,t)}return r},"processClassGroups"),$y=a((e,t,r,n)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];qz(o,t,r,n)}},"processClassesRecursively"),qz=a((e,t,r,n)=>{if(typeof e=="string"){eF(e,t,r);return}if(typeof e=="function"){tF(e,t,r,n);return}rF(e,t,r,n)},"processClassDefinition"),eF=a((e,t,r)=>{const n=e===""?t:LT(t,e);n.classGroupId=r},"processStringDefinition"),tF=a((e,t,r,n)=>{if(nF(e)){$y(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Yz(r,e))},"processFunctionDefinition"),rF=a((e,t,r,n)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[l,u]=i[o];$y(u,LT(t,l),r,n)}},"processObjectDefinition"),LT=a((e,t)=>{let r=e;const n=t.split(uh),i=n.length;for(let s=0;s<i;s++){const o=n[s];let l=r.nextPart.get(o);l||(l=RT(),r.nextPart.set(o,l)),r=l}return r},"getPart"),nF=a(e=>"isThemeGetter"in e&&e.isThemeGetter===!0,"isThemeGetter"),iF=a(e=>{if(e<1)return{get:a(()=>{},"get"),set:a(()=>{},"set")};let t=0,r=Object.create(null),n=Object.create(null);const i=a((s,o)=>{r[s]=o,t++,t>e&&(t=0,n=r,r=Object.create(null))},"update");return{get(s){let o=r[s];if(o!==void 0)return o;if((o=n[s])!==void 0)return i(s,o),o},set(s,o){s in r?r[s]=o:i(s,o)}}},"createLruCache"),dv="!",h1=":",aF=[],p1=a((e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),"createResultObject"),sF=a(e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a(i=>{const s=[];let o=0,l=0,u=0,c;const d=i.length;for(let E=0;E<d;E++){const A=i[E];if(o===0&&l===0){if(A===h1){s.push(i.slice(u,E)),u=E+1;continue}if(A==="/"){c=E;continue}}A==="["?o++:A==="]"?o--:A==="("?l++:A===")"&&l--}const f=s.length===0?i:i.slice(u);let g=f,m=!1;f.endsWith(dv)?(g=f.slice(0,-1),m=!0):f.startsWith(dv)&&(g=f.slice(1),m=!0);const w=c&&c>u?c-u:void 0;return p1(s,m,g,w)},"parseClassName");if(t){const i=t+h1,s=n;n=a(o=>o.startsWith(i)?s(o.slice(i.length)):p1(aF,!1,o,void 0,!0),"parseClassName")}if(r){const i=n;n=a(s=>r({className:s,parseClassName:i}),"parseClassName")}return n},"createParseClassName"),oF=a(e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let s=0;s<r.length;s++){const o=r[s],l=o[0]==="[",u=t.has(o);l||u?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},"createSortModifiers"),lF=a(e=>({cache:iF(e.cacheSize),parseClassName:sF(e),sortModifiers:oF(e),...$z(e)}),"createConfigUtils"),uF=/\s+/,cF=a((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],l=e.trim().split(uF);let u="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{isExternal:f,modifiers:g,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:E}=r(d);if(f){u=d+(u.length>0?" "+u:u);continue}let A=!!E,C=n(A?w.substring(0,E):w);if(!C){if(!A){u=d+(u.length>0?" "+u:u);continue}if(C=n(w),!C){u=d+(u.length>0?" "+u:u);continue}A=!1}const O=g.length===0?"":g.length===1?g[0]:s(g).join(":"),R=m?O+dv:O,P=R+C;if(o.indexOf(P)>-1)continue;o.push(P);const L=i(C,A);for(let j=0;j<L.length;++j){const G=L[j];o.push(R+G)}u=d+(u.length>0?" "+u:u)}return u},"mergeClassList"),dF=a((...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=DT(r))&&(i&&(i+=" "),i+=n);return i},"twJoin"),DT=a(e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=DT(e[n]))&&(r&&(r+=" "),r+=t);return r},"toValue"),fF=a((e,...t)=>{let r,n,i,s;const o=a(u=>{const c=t.reduce((d,f)=>f(d),e());return r=lF(c),n=r.cache.get,i=r.cache.set,s=l,l(u)},"initTailwindMerge"),l=a(u=>{const c=n(u);if(c)return c;const d=cF(u,r);return i(u,d),d},"tailwindMerge");return s=o,(...u)=>s(dF(...u))},"createTailwindMerge"),hF=[],Qr=a(e=>{const t=a(r=>r[e]||hF,"themeGetter");return t.isThemeGetter=!0,t},"fromTheme"),jT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,UT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pF=/^\d+\/\d+$/,mF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ho=a(e=>pF.test(e),"isFraction"),Qt=a(e=>!!e&&!Number.isNaN(Number(e)),"isNumber$1"),ts=a(e=>!!e&&Number.isInteger(Number(e)),"isInteger$1"),w0=a(e=>e.endsWith("%")&&Qt(e.slice(0,-1)),"isPercent"),Sa=a(e=>mF.test(e),"isTshirtSize"),wF=a(()=>!0,"isAny"),xF=a(e=>gF.test(e)&&!bF.test(e),"isLengthOnly"),BT=a(()=>!1,"isNever"),_F=a(e=>vF.test(e),"isShadow"),EF=a(e=>yF.test(e),"isImage"),SF=a(e=>!St(e)&&!kt(e),"isAnyNonArbitrary"),kF=a(e=>Pl(e,HT,BT),"isArbitrarySize"),St=a(e=>jT.test(e),"isArbitraryValue"),Ls=a(e=>Pl(e,ZT,xF),"isArbitraryLength"),x0=a(e=>Pl(e,CF,Qt),"isArbitraryNumber"),m1=a(e=>Pl(e,zT,BT),"isArbitraryPosition"),AF=a(e=>Pl(e,FT,EF),"isArbitraryImage"),Fd=a(e=>Pl(e,GT,_F),"isArbitraryShadow"),kt=a(e=>UT.test(e),"isArbitraryVariable"),$l=a(e=>Ll(e,ZT),"isArbitraryVariableLength"),TF=a(e=>Ll(e,MF),"isArbitraryVariableFamilyName"),g1=a(e=>Ll(e,zT),"isArbitraryVariablePosition"),NF=a(e=>Ll(e,HT),"isArbitraryVariableSize"),IF=a(e=>Ll(e,FT),"isArbitraryVariableImage"),Hd=a(e=>Ll(e,GT,!0),"isArbitraryVariableShadow"),Pl=a((e,t,r)=>{const n=jT.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},"getIsArbitraryValue"),Ll=a((e,t,r=!1)=>{const n=UT.exec(e);return n?n[1]?t(n[1]):r:!1},"getIsArbitraryVariable"),zT=a(e=>e==="position"||e==="percentage","isLabelPosition"),FT=a(e=>e==="image"||e==="url","isLabelImage"),HT=a(e=>e==="length"||e==="size"||e==="bg-size","isLabelSize"),ZT=a(e=>e==="length","isLabelLength"),CF=a(e=>e==="number","isLabelNumber"),MF=a(e=>e==="family-name","isLabelFamilyName"),GT=a(e=>e==="shadow","isLabelShadow"),OF=a(()=>{const e=Qr("color"),t=Qr("font"),r=Qr("text"),n=Qr("font-weight"),i=Qr("tracking"),s=Qr("leading"),o=Qr("breakpoint"),l=Qr("container"),u=Qr("spacing"),c=Qr("radius"),d=Qr("shadow"),f=Qr("inset-shadow"),g=Qr("text-shadow"),m=Qr("drop-shadow"),w=Qr("blur"),E=Qr("perspective"),A=Qr("aspect"),C=Qr("ease"),O=Qr("animate"),R=a(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),P=a(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),L=a(()=>[...P(),kt,St],"scalePositionWithArbitrary"),j=a(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),G=a(()=>["auto","contain","none"],"scaleOverscroll"),Z=a(()=>[kt,St,u],"scaleUnambiguousSpacing"),K=a(()=>[Ho,"full","auto",...Z()],"scaleInset"),z=a(()=>[ts,"none","subgrid",kt,St],"scaleGridTemplateColsRows"),V=a(()=>["auto",{span:["full",ts,kt,St]},ts,kt,St],"scaleGridColRowStartAndEnd"),h=a(()=>[ts,"auto",kt,St],"scaleGridColRowStartOrEnd"),y=a(()=>["auto","min","max","fr",kt,St],"scaleGridAutoColsRows"),b=a(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),x=a(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),_=a(()=>["auto",...Z()],"scaleMargin"),N=a(()=>[Ho,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],"scaleSizing"),T=a(()=>[e,kt,St],"scaleColor"),k=a(()=>[...P(),g1,m1,{position:[kt,St]}],"scaleBgPosition"),p=a(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),S=a(()=>["auto","cover","contain",NF,kF,{size:[kt,St]}],"scaleBgSize"),I=a(()=>[w0,$l,Ls],"scaleGradientStopPosition"),M=a(()=>["","none","full",c,kt,St],"scaleRadius"),U=a(()=>["",Qt,$l,Ls],"scaleBorderWidth"),B=a(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),H=a(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),$=a(()=>[Qt,w0,g1,m1],"scaleMaskImagePosition"),ae=a(()=>["","none",w,kt,St],"scaleBlur"),ie=a(()=>["none",Qt,kt,St],"scaleRotate"),ne=a(()=>["none",Qt,kt,St],"scaleScale"),Ne=a(()=>[Qt,kt,St],"scaleSkew"),ve=a(()=>[Ho,"full",...Z()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sa],breakpoint:[Sa],color:[wF],container:[Sa],"drop-shadow":[Sa],ease:["in","out","in-out"],font:[SF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sa],shadow:[Sa],spacing:["px",Qt],text:[Sa],"text-shadow":[Sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ho,St,kt,A]}],container:["container"],columns:[{columns:[Qt,St,kt,l]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[ts,"auto",kt,St]}],basis:[{basis:[Ho,"full","auto",l,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qt,Ho,"auto","initial","none",St]}],grow:[{grow:["",Qt,kt,St]}],shrink:[{shrink:["",Qt,kt,St]}],order:[{order:[ts,"first","last","none",kt,St]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":h()}],"col-end":[{"col-end":h()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":h()}],"row-end":[{"row-end":h()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":y()}],"auto-rows":[{"auto-rows":y()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...b(),"normal"]}],"justify-items":[{"justify-items":[...x(),"normal"]}],"justify-self":[{"justify-self":["auto",...x()]}],"align-content":[{content:["normal",...b()]}],"align-items":[{items:[...x(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...x(),{baseline:["","last"]}]}],"place-content":[{"place-content":b()}],"place-items":[{"place-items":[...x(),"baseline"]}],"place-self":[{"place-self":["auto",...x()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[l,"screen",...N()]}],"min-w":[{"min-w":[l,"screen","none",...N()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",r,$l,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kt,x0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",w0,St]}],"font-family":[{font:[TF,St,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,kt,St]}],"line-clamp":[{"line-clamp":[Qt,"none",kt,x0]}],leading:[{leading:[s,...Z()]}],"list-image":[{"list-image":["none",kt,St]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kt,St]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qt,"from-font","auto",kt,Ls]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Qt,"auto",kt,St]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kt,St]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kt,St]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:p()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ts,kt,St],radial:["",kt,St],conic:[ts,kt,St]},IF,AF]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qt,kt,St]}],"outline-w":[{outline:["",Qt,$l,Ls]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",d,Hd,Fd]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,Hd,Fd]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Qt,Ls]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",g,Hd,Fd]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Qt,kt,St]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[kt,St]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:p()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kt,St]}],filter:[{filter:["","none",kt,St]}],blur:[{blur:ae()}],brightness:[{brightness:[Qt,kt,St]}],contrast:[{contrast:[Qt,kt,St]}],"drop-shadow":[{"drop-shadow":["","none",m,Hd,Fd]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Qt,kt,St]}],"hue-rotate":[{"hue-rotate":[Qt,kt,St]}],invert:[{invert:["",Qt,kt,St]}],saturate:[{saturate:[Qt,kt,St]}],sepia:[{sepia:["",Qt,kt,St]}],"backdrop-filter":[{"backdrop-filter":["","none",kt,St]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Qt,kt,St]}],"backdrop-contrast":[{"backdrop-contrast":[Qt,kt,St]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qt,kt,St]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qt,kt,St]}],"backdrop-invert":[{"backdrop-invert":["",Qt,kt,St]}],"backdrop-opacity":[{"backdrop-opacity":[Qt,kt,St]}],"backdrop-saturate":[{"backdrop-saturate":[Qt,kt,St]}],"backdrop-sepia":[{"backdrop-sepia":["",Qt,kt,St]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kt,St]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qt,"initial",kt,St]}],ease:[{ease:["linear","initial",C,kt,St]}],delay:[{delay:[Qt,kt,St]}],animate:[{animate:["none",O,kt,St]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,kt,St]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[kt,St,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",kt,St]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kt,St]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Qt,$l,Ls,x0]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig"),VT=fF(OF);var Di={},RF=Object.create,{getPrototypeOf:PF,defineProperty:sc,getOwnPropertyNames:WT,getOwnPropertyDescriptor:LF}=Object,YT=Object.prototype.hasOwnProperty,Gi=a((e,t,r)=>{r=e!=null?RF(PF(e)):{};let n=t||!e||!e.__esModule?sc(r,"default",{value:e,enumerable:!0}):r;for(let i of WT(e))YT.call(n,i)||sc(n,i,{get:a(()=>e[i],"get"),enumerable:!0});return n},"R8"),b1=new WeakMap,qt=a(e=>{var t=b1.get(e),r;return t||(t=sc({},"__esModule",{value:!0}),(e&&typeof e=="object"||typeof e=="function")&&WT(e).map(n=>!YT.call(t,n)&&sc(t,n,{get:a(()=>e[n],"get"),enumerable:!(r=LF(e,n))||r.enumerable})),b1.set(e,t),t)},"H6"),it=a((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"N$"),vn=a((e,t)=>{for(var r in t)sc(e,r,{get:t[r],enumerable:!0,configurable:!0,set:a(n=>t[r]=()=>n,"set")})},"Rq"),$c=a((e,t)=>()=>(e&&(t=e(e=0)),t),"P4"),Hf=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:a((t,r)=>(typeof require<"u"?require:t)[r],"get")}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),DF=it((e,t)=>{t.exports=function(r,n){if(typeof r!="string")throw TypeError("Expected a string");return n=typeof n>"u"?"_":n,r.replace(/([a-z\d])([A-Z])/g,"$1"+n+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+n+"$2").toLowerCase()}}),jF=it((e,t)=>{var r=/[\p{Lu}]/u,n=/[\p{Ll}]/u,i=/^[\p{Lu}](?![\p{Lu}])/gu,s=/([\p{Alpha}\p{N}_]|$)/u,o=/[_.\- ]+/,l=new RegExp("^"+o.source),u=new RegExp(o.source+s.source,"gu"),c=new RegExp("\\d+"+s.source,"gu"),d=a((w,E,A)=>{let C=!1,O=!1,R=!1;for(let P=0;P<w.length;P++){let L=w[P];C&&r.test(L)?(w=w.slice(0,P)+"-"+w.slice(P),C=!1,R=O,O=!0,P++):O&&R&&n.test(L)?(w=w.slice(0,P-1)+"-"+w.slice(P-1),R=O,O=!1,C=!0):(C=E(L)===L&&A(L)!==L,R=O,O=A(L)===L&&E(L)!==L)}return w},"XI"),f=a((w,E)=>(i.lastIndex=0,w.replace(i,A=>E(A))),"AI"),g=a((w,E)=>(u.lastIndex=0,c.lastIndex=0,w.replace(u,(A,C)=>E(C)).replace(c,A=>E(A))),"kI"),m=a((w,E)=>{if(!(typeof w=="string"||Array.isArray(w)))throw TypeError("Expected the input to be `string | string[]`");if(E={pascalCase:!1,preserveConsecutiveUppercase:!1,...E},Array.isArray(w)?w=w.map(O=>O.trim()).filter(O=>O.length).join("-"):w=w.trim(),w.length===0)return"";let A=E.locale===!1?O=>O.toLowerCase():O=>O.toLocaleLowerCase(E.locale),C=E.locale===!1?O=>O.toUpperCase():O=>O.toLocaleUpperCase(E.locale);return w.length===1?E.pascalCase?C(w):A(w):(w!==A(w)&&(w=d(w,A,C)),w=w.replace(l,""),E.preserveConsecutiveUppercase?w=f(w,A):w=A(w),E.pascalCase&&(w=C(w.charAt(0))+w.slice(1)),g(w,C))},"BZ");t.exports=m,t.exports.default=m}),UF=it((e,t)=>{var r=Object.prototype.hasOwnProperty,n="~";function i(){}a(i,"aP"),Object.create&&(i.prototype=Object.create(null),!new i().__proto__&&(n=!1));function s(c,d,f){this.fn=c,this.context=d,this.once=f||!1}a(s,"ch");function o(c,d,f,g,m){if(typeof f!="function")throw TypeError("The listener must be a function");var w=new s(f,g||c,m),E=n?n+d:d;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],w]:c._events[E].push(w):(c._events[E]=w,c._eventsCount++),c}a(o,"rX");function l(c,d){--c._eventsCount===0?c._events=new i:delete c._events[d]}a(l,"A9");function u(){this._events=new i,this._eventsCount=0}a(u,"hq"),u.prototype.eventNames=function(){var c=[],d,f;if(this._eventsCount===0)return c;for(f in d=this._events)r.call(d,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},u.prototype.listeners=function(c){var d=n?n+c:c,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,m=f.length,w=Array(m);g<m;g++)w[g]=f[g].fn;return w},u.prototype.listenerCount=function(c){var d=n?n+c:c,f=this._events[d];return f?f.fn?1:f.length:0},u.prototype.emit=function(c,d,f,g,m,w){var E=n?n+c:c;if(!this._events[E])return!1;var A=this._events[E],C=arguments.length,O,R;if(A.fn){switch(A.once&&this.removeListener(c,A.fn,void 0,!0),C){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,d),!0;case 3:return A.fn.call(A.context,d,f),!0;case 4:return A.fn.call(A.context,d,f,g),!0;case 5:return A.fn.call(A.context,d,f,g,m),!0;case 6:return A.fn.call(A.context,d,f,g,m,w),!0}for(R=1,O=Array(C-1);R<C;R++)O[R-1]=arguments[R];A.fn.apply(A.context,O)}else{var P=A.length,L;for(R=0;R<P;R++)switch(A[R].once&&this.removeListener(c,A[R].fn,void 0,!0),C){case 1:A[R].fn.call(A[R].context);break;case 2:A[R].fn.call(A[R].context,d);break;case 3:A[R].fn.call(A[R].context,d,f);break;case 4:A[R].fn.call(A[R].context,d,f,g);break;default:if(!O)for(L=1,O=Array(C-1);L<C;L++)O[L-1]=arguments[L];A[R].fn.apply(A[R].context,O)}}return!0},u.prototype.on=function(c,d,f){return o(this,c,d,f,!1)},u.prototype.once=function(c,d,f){return o(this,c,d,f,!0)},u.prototype.removeListener=function(c,d,f,g){var m=n?n+c:c;if(!this._events[m])return this;if(!d)return l(this,m),this;var w=this._events[m];if(w.fn)w.fn===d&&(!g||w.once)&&(!f||w.context===f)&&l(this,m);else{for(var E=0,A=[],C=w.length;E<C;E++)(w[E].fn!==d||g&&!w[E].once||f&&w[E].context!==f)&&A.push(w[E]);A.length?this._events[m]=A.length===1?A[0]:A:l(this,m)}return this},u.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&l(this,d)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}),BF=it((e,t)=>{t.exports=(r,n)=>(n=n||(()=>{}),r.then(i=>new Promise(s=>{s(n())}).then(()=>i),i=>new Promise(s=>{s(n())}).then(()=>{throw i})))}),zF=it((e,t)=>{var r=BF();class n extends Error{static{a(this,"pO")}constructor(o){super(o),this.name="TimeoutError"}}var i=a((s,o,l)=>new Promise((u,c)=>{if(typeof o!="number"||o<0)throw TypeError("Expected `milliseconds` to be a positive number");if(o===1/0){u(s);return}let d=setTimeout(()=>{if(typeof l=="function"){try{u(l())}catch(m){c(m)}return}let f=typeof l=="string"?l:`Promise timed out after ${o} milliseconds`,g=l instanceof Error?l:new n(f);typeof s.cancel=="function"&&s.cancel(),c(g)},o);r(s.then(u,c),()=>{clearTimeout(d)})}),"BX");t.exports=i,t.exports.default=i,t.exports.TimeoutError=n}),FF=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r,n,i){let s=0,o=r.length;for(;o>0;){let l=o/2|0,u=s+l;i(r[u],n)<=0?(s=++u,o-=l+1):o=l}return s}a(t,"dh"),e.default=t}),HF=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=FF();class r{static{a(this,"QX")}constructor(){this._queue=[]}enqueue(i,s){s=Object.assign({priority:0},s);let o={priority:s.priority,run:i};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(o);return}let l=t.default(this._queue,o,(u,c)=>c.priority-u.priority);this._queue.splice(l,0,o)}dequeue(){let i=this._queue.shift();return i?.run}filter(i){return this._queue.filter(s=>s.priority===i.priority).map(s=>s.run)}get size(){return this._queue.length}}e.default=r}),Xy=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=UF(),r=zF(),n=HF(),i=a(()=>{},"G9"),s=new r.TimeoutError;class o extends t{static{a(this,"$A")}constructor(u){var c,d,f,g;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=i,this._resolveIdle=i,u=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},u),!(typeof u.intervalCap=="number"&&u.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(d=(c=u.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&d!==void 0?d:""}\` (${typeof u.intervalCap})`);if(u.interval===void 0||!(Number.isFinite(u.interval)&&u.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(g=(f=u.interval)===null||f===void 0?void 0:f.toString())!==null&&g!==void 0?g:""}\` (${typeof u.interval})`);this._carryoverConcurrencyCount=u.carryoverConcurrencyCount,this._isIntervalIgnored=u.intervalCap===1/0||u.interval===0,this._intervalCap=u.intervalCap,this._interval=u.interval,this._queue=new u.queueClass,this._queueClass=u.queueClass,this.concurrency=u.concurrency,this._timeout=u.timeout,this._throwOnTimeout=u.throwOnTimeout===!0,this._isPaused=u.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=i,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=i,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let u=Date.now();if(this._intervalId===void 0){let c=this._intervalEnd-u;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let u=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let c=this._queue.dequeue();return c?(this.emit("active"),c(),u&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(u){if(!(typeof u=="number"&&u>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${u}\` (${typeof u})`);this._concurrency=u,this._processQueue()}async add(u,c={}){return new Promise((d,f)=>{let g=a(async()=>{this._pendingCount++,this._intervalCount++;try{let m=this._timeout===void 0&&c.timeout===void 0?u():r.default(Promise.resolve(u()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&f(s)});d(await m)}catch(m){f(m)}this._next()},"K");this._queue.enqueue(g,c),this._tryToStartAnother(),this.emit("add")})}async addAll(u,c){return Promise.all(u.map(async d=>this.add(d,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(u=>{let c=this._resolveEmpty;this._resolveEmpty=()=>{c(),u()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(u=>{let c=this._resolveIdle;this._resolveIdle=()=>{c(),u()}})}get size(){return this._queue.size}sizeBy(u){return this._queue.filter(u).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(u){this._timeout=u}}e.default=o}),gp=it((e,t)=>{var r=Number.MAX_SAFE_INTEGER||9007199254740991,n=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:r,RELEASE_TYPES:n,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),bp=it((e,t)=>{var r=typeof process=="object"&&Di&&Di.NODE_DEBUG&&/\bsemver\b/i.test(Di.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};t.exports=r}),Xc=it((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=gp(),s=bp();e=t.exports={};var o=e.re=[],l=e.safeRe=[],u=e.src=[],c=e.safeSrc=[],d=e.t={},f=0,g="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[g,n]],w=a(A=>{for(let[C,O]of m)A=A.split(`${C}*`).join(`${C}{0,${O}}`).split(`${C}+`).join(`${C}{1,${O}}`);return A},"OD"),E=a((A,C,O)=>{let R=w(C),P=f++;s(A,P,C),d[A]=P,u[P]=C,c[P]=R,o[P]=new RegExp(C,O?"g":void 0),l[P]=new RegExp(R,O?"g":void 0)},"v6");E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),E("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${g}+`),E("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),E("FULL",`^${u[d.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),E("LOOSE",`^${u[d.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),E("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),E("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",u[d.COERCE],!0),E("COERCERTLFULL",u[d.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),Jy=it((e,t)=>{var r=Object.freeze({loose:!0}),n=Object.freeze({}),i=a(s=>s?typeof s!="object"?r:s:n,"zD");t.exports=i}),QT=it((e,t)=>{var r=/^[0-9]+$/,n=a((s,o)=>{if(typeof s=="number"&&typeof o=="number")return s===o?0:s<o?-1:1;let l=r.test(s),u=r.test(o);return l&&u&&(s=+s,o=+o),s===o?0:l&&!u?-1:u&&!l?1:s<o?-1:1},"jA"),i=a((s,o)=>n(o,s),"JD");t.exports={compareIdentifiers:n,rcompareIdentifiers:i}}),Nn=it((e,t)=>{var r=bp(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=gp(),{safeRe:s,t:o}=Xc(),l=Jy(),{compareIdentifiers:u}=QT();class c{static{a(this,"g8")}constructor(f,g){if(g=l(g),f instanceof c){if(f.loose===!!g.loose&&f.includePrerelease===!!g.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>n)throw TypeError(`version is longer than ${n} characters`);r("SemVer",f,g),this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease;let m=f.trim().match(g.loose?s[o.LOOSE]:s[o.FULL]);if(!m)throw TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(w=>{if(/^[0-9]+$/.test(w)){let E=+w;if(E>=0&&E<i)return E}return w}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(r("SemVer.compare",this.version,this.options,f),!(f instanceof c)){if(typeof f=="string"&&f===this.version)return 0;f=new c(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof c||(f=new c(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof c||(f=new c(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let g=0;do{let m=this.prerelease[g],w=f.prerelease[g];if(r("prerelease compare",g,m,w),m===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(m===void 0)return-1;if(m===w)continue;return u(m,w)}while(++g)}compareBuild(f){f instanceof c||(f=new c(f,this.options));let g=0;do{let m=this.build[g],w=f.build[g];if(r("build compare",g,m,w),m===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(m===void 0)return-1;if(m===w)continue;return u(m,w)}while(++g)}inc(f,g,m){if(f.startsWith("pre")){if(!g&&m===!1)throw Error("invalid increment argument: identifier is empty");if(g){let w=`-${g}`.match(this.options.loose?s[o.PRERELEASELOOSE]:s[o.PRERELEASE]);if(!w||w[1]!==g)throw Error(`invalid identifier: ${g}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",g,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",g,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",g,m),this.inc("pre",g,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",g,m),this.inc("pre",g,m);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let w=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[w];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(g===this.prerelease.join(".")&&m===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(w)}}if(g){let E=[g,w];m===!1&&(E=[g]),u(this.prerelease[0],g)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=c}),Dl=it((e,t)=>{var r=Nn(),n=a((i,s,o=!1)=>{if(i instanceof r)return i;try{return new r(i,s)}catch(l){if(!o)return null;throw l}},"HD");t.exports=n}),ZF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,s);return o?o.version:null},"wD");t.exports=n}),GF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i.trim().replace(/^[=v]+/,""),s);return o?o.version:null},"fD");t.exports=n}),VF=it((e,t)=>{var r=Nn(),n=a((i,s,o,l,u)=>{typeof o=="string"&&(u=l,l=o,o=void 0);try{return new r(i instanceof r?i.version:i,o).inc(s,l,u).version}catch{return null}},"XD");t.exports=n}),WF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,null,!0),l=r(s,null,!0),u=o.compare(l);if(u===0)return null;let c=u>0,d=c?o:l,f=c?l:o,g=!!d.prerelease.length;if(f.prerelease.length&&!g){if(!f.patch&&!f.minor)return"major";if(f.compareMain(d)===0)return f.minor&&!f.patch?"minor":"patch"}let m=g?"pre":"";return o.major!==l.major?m+"major":o.minor!==l.minor?m+"minor":o.patch!==l.patch?m+"patch":"prerelease"},"AD");t.exports=n}),YF=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).major,"GD");t.exports=n}),QF=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).minor,"SD");t.exports=n}),$F=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).patch,"ND");t.exports=n}),XF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,s);return o&&o.prerelease.length?o.prerelease:null},"ED");t.exports=n}),Vi=it((e,t)=>{var r=Nn(),n=a((i,s,o)=>new r(i,o).compare(new r(s,o)),"RD");t.exports=n}),JF=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(s,i,o),"hD");t.exports=n}),KF=it((e,t)=>{var r=Vi(),n=a((i,s)=>r(i,s,!0),"LD");t.exports=n}),Ky=it((e,t)=>{var r=Nn(),n=a((i,s,o)=>{let l=new r(i,o),u=new r(s,o);return l.compare(u)||l.compareBuild(u)},"gD");t.exports=n}),qF=it((e,t)=>{var r=Ky(),n=a((i,s)=>i.sort((o,l)=>r(o,l,s)),"yD");t.exports=n}),e8=it((e,t)=>{var r=Ky(),n=a((i,s)=>i.sort((o,l)=>r(l,o,s)),"xD");t.exports=n}),vp=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)>0,"cD");t.exports=n}),qy=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)<0,"dD");t.exports=n}),$T=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)===0,"rD");t.exports=n}),XT=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)!==0,"nD");t.exports=n}),ew=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)>=0,"BD");t.exports=n}),tw=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)<=0,"tD");t.exports=n}),JT=it((e,t)=>{var r=$T(),n=XT(),i=vp(),s=ew(),o=qy(),l=tw(),u=a((c,d,f,g)=>{switch(d){case"===":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c===f;case"!==":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c!==f;case"":case"=":case"==":return r(c,f,g);case"!=":return n(c,f,g);case">":return i(c,f,g);case">=":return s(c,f,g);case"<":return o(c,f,g);case"<=":return l(c,f,g);default:throw TypeError(`Invalid operator: ${d}`)}},"qL");t.exports=u}),t8=it((e,t)=>{var r=Nn(),n=Dl(),{safeRe:i,t:s}=Xc(),o=a((l,u)=>{if(l instanceof r)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;u=u||{};let c=null;if(!u.rtl)c=l.match(u.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);else{let E=u.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL],A;for(;(A=E.exec(l))&&(!c||c.index+c[0].length!==l.length);)(!c||A.index+A[0].length!==c.index+c[0].length)&&(c=A),E.lastIndex=A.index+A[1].length+A[2].length;E.lastIndex=-1}if(c===null)return null;let d=c[2],f=c[3]||"0",g=c[4]||"0",m=u.includePrerelease&&c[5]?`-${c[5]}`:"",w=u.includePrerelease&&c[6]?`+${c[6]}`:"";return n(`${d}.${f}.${g}${m}${w}`,u)},"PL");t.exports=o}),r8=it((e,t)=>{class r{static{a(this,"eA")}constructor(){this.max=1e3,this.map=new Map}get(i){let s=this.map.get(i);if(s!==void 0)return this.map.delete(i),this.map.set(i,s),s}delete(i){return this.map.delete(i)}set(i,s){if(!this.delete(i)&&s!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(i,s)}return this}}t.exports=r}),Wi=it((e,t)=>{var r=/\s+/g;class n{static{a(this,"q1")}constructor(N,T){if(T=o(T),N instanceof n)return N.loose===!!T.loose&&N.includePrerelease===!!T.includePrerelease?N:new n(N.raw,T);if(N instanceof l)return this.raw=N.value,this.set=[[N]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=N.trim().replace(r," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let k=this.set[0];if(this.set=this.set.filter(p=>!C(p[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(let p of this.set)if(p.length===1&&O(p[0])){this.set=[p];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let N=0;N<this.set.length;N++){N>0&&(this.formatted+="||");let T=this.set[N];for(let k=0;k<T.length;k++)k>0&&(this.formatted+=" "),this.formatted+=T[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(N){let T=((this.options.includePrerelease&&E)|(this.options.loose&&A))+":"+N,k=s.get(T);if(k)return k;let p=this.options.loose,S=p?d[f.HYPHENRANGELOOSE]:d[f.HYPHENRANGE];N=N.replace(S,b(this.options.includePrerelease)),u("hyphen replace",N),N=N.replace(d[f.COMPARATORTRIM],g),u("comparator trim",N),N=N.replace(d[f.TILDETRIM],m),u("tilde trim",N),N=N.replace(d[f.CARETTRIM],w),u("caret trim",N);let I=N.split(" ").map(H=>P(H,this.options)).join(" ").split(/\s+/).map(H=>y(H,this.options));p&&(I=I.filter(H=>(u("loose invalid filter",H,this.options),!!H.match(d[f.COMPARATORLOOSE])))),u("range list",I);let M=new Map,U=I.map(H=>new l(H,this.options));for(let H of U){if(C(H))return[H];M.set(H.value,H)}M.size>1&&M.has("")&&M.delete("");let B=[...M.values()];return s.set(T,B),B}intersects(N,T){if(!(N instanceof n))throw TypeError("a Range is required");return this.set.some(k=>R(k,T)&&N.set.some(p=>R(p,T)&&k.every(S=>p.every(I=>S.intersects(I,T)))))}test(N){if(!N)return!1;if(typeof N=="string")try{N=new c(N,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(x(this.set[T],N,this.options))return!0;return!1}}t.exports=n;var i=r8(),s=new i,o=Jy(),l=yp(),u=bp(),c=Nn(),{safeRe:d,t:f,comparatorTrimReplace:g,tildeTrimReplace:m,caretTrimReplace:w}=Xc(),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:A}=gp(),C=a(_=>_.value==="<0.0.0-0","_k"),O=a(_=>_.value==="","wL"),R=a((_,N)=>{let T=!0,k=_.slice(),p=k.pop();for(;T&&k.length;)T=k.every(S=>p.intersects(S,N)),p=k.pop();return T},"Kk"),P=a((_,N)=>(_=_.replace(d[f.BUILD],""),u("comp",_,N),_=Z(_,N),u("caret",_),_=j(_,N),u("tildes",_),_=z(_,N),u("xrange",_),_=h(_,N),u("stars",_),_),"ZL"),L=a(_=>!_||_.toLowerCase()==="x"||_==="*","pq"),j=a((_,N)=>_.trim().split(/\s+/).map(T=>G(T,N)).join(" "),"fL"),G=a((_,N)=>{let T=N.loose?d[f.TILDELOOSE]:d[f.TILDE];return _.replace(T,(k,p,S,I,M)=>{u("tilde",_,k,p,S,I,M);let U;return L(p)?U="":L(S)?U=`>=${p}.0.0 <${+p+1}.0.0-0`:L(I)?U=`>=${p}.${S}.0 <${p}.${+S+1}.0-0`:M?(u("replaceTilde pr",M),U=`>=${p}.${S}.${I}-${M} <${p}.${+S+1}.0-0`):U=`>=${p}.${S}.${I} <${p}.${+S+1}.0-0`,u("tilde return",U),U})},"XL"),Z=a((_,N)=>_.trim().split(/\s+/).map(T=>K(T,N)).join(" "),"AL"),K=a((_,N)=>{u("caret",_,N);let T=N.loose?d[f.CARETLOOSE]:d[f.CARET],k=N.includePrerelease?"-0":"";return _.replace(T,(p,S,I,M,U)=>{u("caret",_,p,S,I,M,U);let B;return L(S)?B="":L(I)?B=`>=${S}.0.0${k} <${+S+1}.0.0-0`:L(M)?S==="0"?B=`>=${S}.${I}.0${k} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.0${k} <${+S+1}.0.0-0`:U?(u("replaceCaret pr",U),S==="0"?I==="0"?B=`>=${S}.${I}.${M}-${U} <${S}.${I}.${+M+1}-0`:B=`>=${S}.${I}.${M}-${U} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.${M}-${U} <${+S+1}.0.0-0`):(u("no pr"),S==="0"?I==="0"?B=`>=${S}.${I}.${M}${k} <${S}.${I}.${+M+1}-0`:B=`>=${S}.${I}.${M}${k} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.${M} <${+S+1}.0.0-0`),u("caret return",B),B})},"kL"),z=a((_,N)=>(u("replaceXRanges",_,N),_.split(/\s+/).map(T=>V(T,N)).join(" ")),"GL"),V=a((_,N)=>{_=_.trim();let T=N.loose?d[f.XRANGELOOSE]:d[f.XRANGE];return _.replace(T,(k,p,S,I,M,U)=>{u("xRange",_,k,p,S,I,M,U);let B=L(S),H=B||L(I),$=H||L(M),ae=$;return p==="="&&ae&&(p=""),U=N.includePrerelease?"-0":"",B?p===">"||p==="<"?k="<0.0.0-0":k="*":p&&ae?(H&&(I=0),M=0,p===">"?(p=">=",H?(S=+S+1,I=0,M=0):(I=+I+1,M=0)):p==="<="&&(p="<",H?S=+S+1:I=+I+1),p==="<"&&(U="-0"),k=`${p+S}.${I}.${M}${U}`):H?k=`>=${S}.0.0${U} <${+S+1}.0.0-0`:$&&(k=`>=${S}.${I}.0${U} <${S}.${+I+1}.0-0`),u("xRange return",k),k})},"VL"),h=a((_,N)=>(u("replaceStars",_,N),_.trim().replace(d[f.STAR],"")),"SL"),y=a((_,N)=>(u("replaceGTE0",_,N),_.trim().replace(d[N.includePrerelease?f.GTE0PRE:f.GTE0],"")),"ML"),b=a(_=>(N,T,k,p,S,I,M,U,B,H,$,ae)=>(L(k)?T="":L(p)?T=`>=${k}.0.0${_?"-0":""}`:L(S)?T=`>=${k}.${p}.0${_?"-0":""}`:I?T=`>=${T}`:T=`>=${T}${_?"-0":""}`,L(B)?U="":L(H)?U=`<${+B+1}.0.0-0`:L($)?U=`<${B}.${+H+1}.0-0`:ae?U=`<=${B}.${H}.${$}-${ae}`:_?U=`<${B}.${H}.${+$+1}-0`:U=`<=${U}`,`${T} ${U}`.trim()),"NL"),x=a((_,N,T)=>{for(let k=0;k<_.length;k++)if(!_[k].test(N))return!1;if(N.prerelease.length&&!T.includePrerelease){for(let k=0;k<_.length;k++)if(u(_[k].semver),_[k].semver!==l.ANY&&_[k].semver.prerelease.length>0){let p=_[k].semver;if(p.major===N.major&&p.minor===N.minor&&p.patch===N.patch)return!0}return!1}return!0},"CL")}),yp=it((e,t)=>{var r=Symbol("SemVer ANY");class n{static{a(this,"u9")}static get ANY(){return r}constructor(g,m){if(m=i(m),g instanceof n){if(g.loose===!!m.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),u("comparator",g,m),this.options=m,this.loose=!!m.loose,this.parse(g),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(g){let m=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],w=g.match(m);if(!w)throw TypeError(`Invalid comparator: ${g}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new c(w[2],this.options.loose):this.semver=r}toString(){return this.value}test(g){if(u("Comparator.test",g,this.options.loose),this.semver===r||g===r)return!0;if(typeof g=="string")try{g=new c(g,this.options)}catch{return!1}return l(g,this.operator,this.semver,this.options)}intersects(g,m){if(!(g instanceof n))throw TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(g.value,m).test(this.value):g.operator===""?g.value===""?!0:new d(this.value,m).test(g.semver):(m=i(m),m.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||l(this.semver,"<",g.semver,m)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||l(this.semver,">",g.semver,m)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}t.exports=n;var i=Jy(),{safeRe:s,t:o}=Xc(),l=JT(),u=bp(),c=Nn(),d=Wi()}),wp=it((e,t)=>{var r=Wi(),n=a((i,s,o)=>{try{s=new r(s,o)}catch{return!1}return s.test(i)},"RL");t.exports=n}),n8=it((e,t)=>{var r=Wi(),n=a((i,s)=>new r(i,s).set.map(o=>o.map(l=>l.value).join(" ").trim().split(" ")),"hL");t.exports=n}),i8=it((e,t)=>{var r=Nn(),n=Wi(),i=a((s,o,l)=>{let u=null,c=null,d=null;try{d=new n(o,l)}catch{return null}return s.forEach(f=>{d.test(f)&&(!u||c.compare(f)===-1)&&(u=f,c=new r(u,l))}),u},"gL");t.exports=i}),a8=it((e,t)=>{var r=Nn(),n=Wi(),i=a((s,o,l)=>{let u=null,c=null,d=null;try{d=new n(o,l)}catch{return null}return s.forEach(f=>{d.test(f)&&(!u||c.compare(f)===1)&&(u=f,c=new r(u,l))}),u},"uL");t.exports=i}),s8=it((e,t)=>{var r=Nn(),n=Wi(),i=vp(),s=a((o,l)=>{o=new n(o,l);let u=new r("0.0.0");if(o.test(u)||(u=new r("0.0.0-0"),o.test(u)))return u;u=null;for(let c=0;c<o.set.length;++c){let d=o.set[c],f=null;d.forEach(g=>{let m=new r(g.semver.version);switch(g.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!f||i(m,f))&&(f=m);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${g.operator}`)}}),f&&(!u||i(u,f))&&(u=f)}return u&&o.test(u)?u:null},"pL");t.exports=s}),o8=it((e,t)=>{var r=Wi(),n=a((i,s)=>{try{return new r(i,s).range||"*"}catch{return null}},"mL");t.exports=n}),rw=it((e,t)=>{var r=Nn(),n=yp(),{ANY:i}=n,s=Wi(),o=wp(),l=vp(),u=qy(),c=tw(),d=ew(),f=a((g,m,w,E)=>{g=new r(g,E),m=new s(m,E);let A,C,O,R,P;switch(w){case">":A=l,C=c,O=u,R=">",P=">=";break;case"<":A=u,C=d,O=l,R="<",P="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(o(g,m,E))return!1;for(let L=0;L<m.set.length;++L){let j=m.set[L],G=null,Z=null;if(j.forEach(K=>{K.semver===i&&(K=new n(">=0.0.0")),G=G||K,Z=Z||K,A(K.semver,G.semver,E)?G=K:O(K.semver,Z.semver,E)&&(Z=K)}),G.operator===R||G.operator===P||(!Z.operator||Z.operator===R)&&C(g,Z.semver))return!1;if(Z.operator===P&&O(g,Z.semver))return!1}return!0},"BL");t.exports=f}),l8=it((e,t)=>{var r=rw(),n=a((i,s,o)=>r(i,s,">",o),"tL");t.exports=n}),u8=it((e,t)=>{var r=rw(),n=a((i,s,o)=>r(i,s,"<",o),"QL");t.exports=n}),c8=it((e,t)=>{var r=Wi(),n=a((i,s,o)=>(i=new r(i,o),s=new r(s,o),i.intersects(s,o)),"aL");t.exports=n}),d8=it((e,t)=>{var r=wp(),n=Vi();t.exports=(i,s,o)=>{let l=[],u=null,c=null,d=i.sort((w,E)=>n(w,E,o));for(let w of d)r(w,s,o)?(c=w,!u&&(u=w)):(c&&l.push([u,c]),c=null,u=null);u&&l.push([u,null]);let f=[];for(let[w,E]of l)w===E?f.push(w):!E&&w===d[0]?f.push("*"):E?w===d[0]?f.push(`<=${E}`):f.push(`${w} - ${E}`):f.push(`>=${w}`);let g=f.join(" || "),m=typeof s.raw=="string"?s.raw:String(s);return g.length<m.length?g:s}}),f8=it((e,t)=>{var r=Wi(),n=yp(),{ANY:i}=n,s=wp(),o=Vi(),l=a((m,w,E={})=>{if(m===w)return!0;m=new r(m,E),w=new r(w,E);let A=!1;e:for(let C of m.set){for(let O of w.set){let R=d(C,O,E);if(A=A||R!==null,R)continue e}if(A)return!1}return!0},"$g"),u=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],d=a((m,w,E)=>{if(m===w)return!0;if(m.length===1&&m[0].semver===i){if(w.length===1&&w[0].semver===i)return!0;E.includePrerelease?m=u:m=c}if(w.length===1&&w[0].semver===i){if(E.includePrerelease)return!0;w=c}let A=new Set,C,O;for(let z of m)z.operator===">"||z.operator===">="?C=f(C,z,E):z.operator==="<"||z.operator==="<="?O=g(O,z,E):A.add(z.semver);if(A.size>1)return null;let R;if(C&&O){if(R=o(C.semver,O.semver,E),R>0)return null;if(R===0&&(C.operator!==">="||O.operator!=="<="))return null}for(let z of A){if(C&&!s(z,String(C),E)||O&&!s(z,String(O),E))return null;for(let V of w)if(!s(z,String(V),E))return!1;return!0}let P,L,j,G,Z=O&&!E.includePrerelease&&O.semver.prerelease.length?O.semver:!1,K=C&&!E.includePrerelease&&C.semver.prerelease.length?C.semver:!1;Z&&Z.prerelease.length===1&&O.operator==="<"&&Z.prerelease[0]===0&&(Z=!1);for(let z of w){if(G=G||z.operator===">"||z.operator===">=",j=j||z.operator==="<"||z.operator==="<=",C){if(K&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===K.major&&z.semver.minor===K.minor&&z.semver.patch===K.patch&&(K=!1),z.operator===">"||z.operator===">="){if(P=f(C,z,E),P===z&&P!==C)return!1}else if(C.operator===">="&&!s(C.semver,String(z),E))return!1}if(O){if(Z&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===Z.major&&z.semver.minor===Z.minor&&z.semver.patch===Z.patch&&(Z=!1),z.operator==="<"||z.operator==="<="){if(L=g(O,z,E),L===z&&L!==O)return!1}else if(O.operator==="<="&&!s(O.semver,String(z),E))return!1}if(!z.operator&&(O||C)&&R!==0)return!1}return!(C&&j&&!O&&R!==0||O&&G&&!C&&R!==0||K||Z)},"_g"),f=a((m,w,E)=>{if(!m)return w;let A=o(m.semver,w.semver,E);return A>0?m:A<0||w.operator===">"&&m.operator===">="?w:m},"ck"),g=a((m,w,E)=>{if(!m)return w;let A=o(m.semver,w.semver,E);return A<0?m:A>0||w.operator==="<"&&m.operator==="<="?w:m},"mk");t.exports=l}),h8=it((e,t)=>{var r=Xc(),n=gp(),i=Nn(),s=QT(),o=Dl(),l=ZF(),u=GF(),c=VF(),d=WF(),f=YF(),g=QF(),m=$F(),w=XF(),E=Vi(),A=JF(),C=KF(),O=Ky(),R=qF(),P=e8(),L=vp(),j=qy(),G=$T(),Z=XT(),K=ew(),z=tw(),V=JT(),h=t8(),y=yp(),b=Wi(),x=wp(),_=n8(),N=i8(),T=a8(),k=s8(),p=o8(),S=rw(),I=l8(),M=u8(),U=c8(),B=d8(),H=f8();t.exports={parse:o,valid:l,clean:u,inc:c,diff:d,major:f,minor:g,patch:m,prerelease:w,compare:E,rcompare:A,compareLoose:C,compareBuild:O,sort:R,rsort:P,gt:L,lt:j,eq:G,neq:Z,gte:K,lte:z,cmp:V,coerce:h,Comparator:y,Range:b,satisfies:x,toComparators:_,maxSatisfying:N,minSatisfying:T,minVersion:k,validRange:p,outside:S,gtr:I,ltr:M,intersects:U,simplifyRange:B,subset:H,SemVer:i,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}}),p8=it((e,t)=>{var r=a((s=0)=>o=>`\x1B[${38+s};5;${o}m`,"WG"),n=a((s=0)=>(o,l,u)=>`\x1B[${38+s};2;${o};${l};${u}m`,"HG");function i(){let s=new Map,o={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};o.color.gray=o.color.blackBright,o.bgColor.bgGray=o.bgColor.bgBlackBright,o.color.grey=o.color.blackBright,o.bgColor.bgGrey=o.bgColor.bgBlackBright;for(let[l,u]of Object.entries(o)){for(let[c,d]of Object.entries(u))o[c]={open:`\x1B[${d[0]}m`,close:`\x1B[${d[1]}m`},u[c]=o[c],s.set(d[0],d[1]);Object.defineProperty(o,l,{value:u,enumerable:!1})}return Object.defineProperty(o,"codes",{value:s,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi256=r(),o.color.ansi16m=n(),o.bgColor.ansi256=r(10),o.bgColor.ansi16m=n(10),Object.defineProperties(o,{rgbToAnsi256:{value:a((l,u,c)=>l===u&&u===c?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(u/255*5)+Math.round(c/255*5),"value"),enumerable:!1},hexToRgb:{value:a(l=>{let u=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(l.toString(16));if(!u)return[0,0,0];let{colorString:c}=u.groups;c.length===3&&(c=c.split("").map(f=>f+f).join(""));let d=Number.parseInt(c,16);return[d>>16&255,d>>8&255,d&255]},"value"),enumerable:!1},hexToAnsi256:{value:a(l=>o.rgbToAnsi256(...o.hexToRgb(l)),"value"),enumerable:!1}}),o}a(i,"Jb"),Object.defineProperty(t,"exports",{enumerable:!0,get:i})}),m8=it(e=>{e.byteLength=u,e.toByteArray=d,e.fromByteArray=m;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(s=0,o=i.length;s<o;++s)t[s]=i[s],r[i.charCodeAt(s)]=s;var s,o;r[45]=62,r[95]=63;function l(w){var E=w.length;if(E%4>0)throw Error("Invalid string. Length must be a multiple of 4");var A=w.indexOf("=");A===-1&&(A=E);var C=A===E?0:4-A%4;return[A,C]}a(l,"eV");function u(w){var E=l(w),A=E[0],C=E[1];return(A+C)*3/4-C}a(u,"hc");function c(w,E,A){return(E+A)*3/4-A}a(c,"Dc");function d(w){var E,A=l(w),C=A[0],O=A[1],R=new n(c(w,C,O)),P=0,L=O>0?C-4:C,j;for(j=0;j<L;j+=4)E=r[w.charCodeAt(j)]<<18|r[w.charCodeAt(j+1)]<<12|r[w.charCodeAt(j+2)]<<6|r[w.charCodeAt(j+3)],R[P++]=E>>16&255,R[P++]=E>>8&255,R[P++]=E&255;return O===2&&(E=r[w.charCodeAt(j)]<<2|r[w.charCodeAt(j+1)]>>4,R[P++]=E&255),O===1&&(E=r[w.charCodeAt(j)]<<10|r[w.charCodeAt(j+1)]<<4|r[w.charCodeAt(j+2)]>>2,R[P++]=E>>8&255,R[P++]=E&255),R}a(d,"Lc");function f(w){return t[w>>18&63]+t[w>>12&63]+t[w>>6&63]+t[w&63]}a(f,"gc");function g(w,E,A){for(var C,O=[],R=E;R<A;R+=3)C=(w[R]<<16&16711680)+(w[R+1]<<8&65280)+(w[R+2]&255),O.push(f(C));return O.join("")}a(g,"bc");function m(w){for(var E,A=w.length,C=A%3,O=[],R=16383,P=0,L=A-C;P<L;P+=R)O.push(g(w,P,P+R>L?L:P+R));return C===1?(E=w[A-1],O.push(t[E>>2]+t[E<<4&63]+"==")):C===2&&(E=(w[A-2]<<8)+w[A-1],O.push(t[E>>10]+t[E>>4&63]+t[E<<2&63]+"=")),O.join("")}a(m,"yc")}),Zn=it(e=>{e.__esModule=!0,e.extend=s,e.indexOf=c,e.escapeExpression=d,e.isEmpty=f,e.createFrame=g,e.blockParams=m,e.appendContextPath=w;var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},r=/[&<>"'`=]/g,n=/[&<>"'`=]/;function i(E){return t[E]}a(i,"ac");function s(E){for(var A=1;A<arguments.length;A++)for(var C in arguments[A])Object.prototype.hasOwnProperty.call(arguments[A],C)&&(E[C]=arguments[A][C]);return E}a(s,"_0");var o=Object.prototype.toString;e.toString=o;var l=a(function(E){return typeof E=="function"},"aW");l(/x/)&&(e.isFunction=l=a(function(E){return typeof E=="function"&&o.call(E)==="[object Function]"},"aW")),e.isFunction=l;var u=Array.isArray||function(E){return E&&typeof E=="object"?o.call(E)==="[object Array]":!1};e.isArray=u;function c(E,A){for(var C=0,O=E.length;C<O;C++)if(E[C]===A)return C;return-1}a(c,"ec");function d(E){if(typeof E!="string"){if(E&&E.toHTML)return E.toHTML();if(E==null)return"";if(!E)return E+"";E=""+E}return n.test(E)?E.replace(r,i):E}a(d,"sc");function f(E){return!E&&E!==0?!0:!!(u(E)&&E.length===0)}a(f,"$m");function g(E){var A=s({},E);return A._parent=E,A}a(g,"qm");function m(E,A){return E.path=A,E}a(m,"_m");function w(E,A){return(E?E+".":"")+A}a(w,"Km")}),Yi=it((e,t)=>{e.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(i,s){var o=s&&s.loc,l=void 0,u=void 0,c=void 0,d=void 0;o&&(l=o.start.line,u=o.end.line,c=o.start.column,d=o.end.column,i+=" - "+l+":"+c);for(var f=Error.prototype.constructor.call(this,i),g=0;g<r.length;g++)this[r[g]]=f[r[g]];Error.captureStackTrace&&Error.captureStackTrace(this,n);try{o&&(this.lineNumber=l,this.endLineNumber=u,Object.defineProperty?(Object.defineProperty(this,"column",{value:c,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:d,enumerable:!0})):(this.column=c,this.endColumn=d))}catch{}}a(n,"$H"),n.prototype=Error(),e.default=n,t.exports=e.default}),g8=it((e,t)=>{e.__esModule=!0;var r=Zn();e.default=function(n){n.registerHelper("blockHelperMissing",function(i,s){var{inverse:o,fn:l}=s;if(i===!0)return l(this);if(i===!1||i==null)return o(this);if(r.isArray(i))return i.length>0?(s.ids&&(s.ids=[s.name]),n.helpers.each(i,s)):o(this);if(s.data&&s.ids){var u=r.createFrame(s.data);u.contextPath=r.appendContextPath(s.data.contextPath,s.name),s={data:u}}return l(i,s)})},t.exports=e.default}),b8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"Gm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("each",function(l,u){if(!u)throw new s.default("Must pass iterator to #each");var{fn:c,inverse:d}=u,f=0,g="",m=void 0,w=void 0;u.data&&u.ids&&(w=n.appendContextPath(u.data.contextPath,u.ids[0])+"."),n.isFunction(l)&&(l=l.call(this)),u.data&&(m=n.createFrame(u.data));function E(P,L,j){m&&(m.key=P,m.index=L,m.first=L===0,m.last=!!j,w&&(m.contextPath=w+P)),g=g+c(l[P],{data:m,blockParams:n.blockParams([l[P],P],[w+P,null])})}if(a(E,"T"),l&&typeof l=="object")if(n.isArray(l))for(var A=l.length;f<A;f++)f in l&&E(f,f,f===l.length-1);else if(typeof Symbol=="function"&&l[Symbol.iterator]){for(var C=[],O=l[Symbol.iterator](),R=O.next();!R.done;R=O.next())C.push(R.value);l=C;for(var A=l.length;f<A;f++)E(f,f,f===l.length-1)}else(function(){var P=void 0;Object.keys(l).forEach(function(L){P!==void 0&&E(P,f-1),P=L,f++}),P!==void 0&&E(P,f-1,!0)})();return f===0&&(g=d(this)),g})},t.exports=e.default}),v8=it((e,t)=>{e.__esModule=!0;function r(s){return s&&s.__esModule?s:{default:s}}a(r,"Cm");var n=Yi(),i=r(n);e.default=function(s){s.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default}),y8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"Dm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("if",function(l,u){if(arguments.length!=2)throw new s.default("#if requires exactly one argument");return n.isFunction(l)&&(l=l.call(this)),!u.hash.includeZero&&!l||n.isEmpty(l)?u.inverse(this):u.fn(this)}),o.registerHelper("unless",function(l,u){if(arguments.length!=2)throw new s.default("#unless requires exactly one argument");return o.helpers.if.call(this,l,{fn:u.inverse,inverse:u.fn,hash:u.hash})})},t.exports=e.default}),w8=it((e,t)=>{e.__esModule=!0,e.default=function(r){r.registerHelper("log",function(){for(var n=[void 0],i=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)n.push(arguments[s]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),n[0]=o,r.log.apply(r,n)})},t.exports=e.default}),x8=it((e,t)=>{e.__esModule=!0,e.default=function(r){r.registerHelper("lookup",function(n,i,s){return n&&s.lookupProperty(n,i)})},t.exports=e.default}),_8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"cm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("with",function(l,u){if(arguments.length!=2)throw new s.default("#with requires exactly one argument");n.isFunction(l)&&(l=l.call(this));var c=u.fn;if(n.isEmpty(l))return u.inverse(this);var d=u.data;return u.data&&u.ids&&(d=n.createFrame(u.data),d.contextPath=n.appendContextPath(u.data.contextPath,u.ids[0])),c(l,{data:d,blockParams:n.blockParams([l],[d&&d.contextPath])})})},t.exports=e.default}),KT=it(e=>{e.__esModule=!0,e.registerDefaultHelpers=A,e.moveHelperToHooks=C;function t(O){return O&&O.__esModule?O:{default:O}}a(t,"oK");var r=g8(),n=t(r),i=b8(),s=t(i),o=v8(),l=t(o),u=y8(),c=t(u),d=w8(),f=t(d),g=x8(),m=t(g),w=_8(),E=t(w);function A(O){n.default(O),s.default(O),l.default(O),c.default(O),f.default(O),m.default(O),E.default(O)}a(A,"Kd");function C(O,R,P){O.helpers[R]&&(O.hooks[R]=O.helpers[R],!P&&delete O.helpers[R])}a(C,"Pd")}),E8=it((e,t)=>{e.__esModule=!0;var r=Zn();e.default=function(n){n.registerDecorator("inline",function(i,s,o,l){var u=i;return s.partials||(s.partials={},u=a(function(c,d){var f=o.partials;o.partials=r.extend({},f,s.partials);var g=i(c,d);return o.partials=f,g},"O")),s.partials[l.args[0]]=l.fn,u})},t.exports=e.default}),S8=it(e=>{e.__esModule=!0,e.registerDefaultDecorators=i;function t(s){return s&&s.__esModule?s:{default:s}}a(t,"Hd");var r=E8(),n=t(r);function i(s){n.default(s)}a(i,"Zd")}),qT=it((e,t)=>{e.__esModule=!0;var r=Zn(),n={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:a(function(i){if(typeof i=="string"){var s=r.indexOf(n.methodMap,i.toLowerCase());s>=0?i=s:i=parseInt(i,10)}return i},"lookupLevel"),log:a(function(i){if(i=n.lookupLevel(i),typeof console<"u"&&n.lookupLevel(n.level)<=i){var s=n.methodMap[i];console[s]||(s="log");for(var o=arguments.length,l=Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];console[s].apply(console,l)}},"log")};e.default=n,t.exports=e.default}),k8=it(e=>{e.__esModule=!0,e.createNewLookupObject=r;var t=Zn();function r(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return t.extend.apply(void 0,[Object.create(null)].concat(i))}a(r,"Md")}),eN=it(e=>{e.__esModule=!0,e.createProtoAccessControl=o,e.resultIsAllowed=l,e.resetLoggedProperties=d;function t(f){return f&&f.__esModule?f:{default:f}}a(t,"Rd");var r=k8(),n=qT(),i=t(n),s=Object.create(null);function o(f){var g=Object.create(null);g.constructor=!1,g.__defineGetter__=!1,g.__defineSetter__=!1,g.__lookupGetter__=!1;var m=Object.create(null);return m.__proto__=!1,{properties:{whitelist:r.createNewLookupObject(m,f.allowedProtoProperties),defaultValue:f.allowProtoPropertiesByDefault},methods:{whitelist:r.createNewLookupObject(g,f.allowedProtoMethods),defaultValue:f.allowProtoMethodsByDefault}}}a(o,"Dd");function l(f,g,m){return u(typeof f=="function"?g.methods:g.properties,m)}a(l,"Ld");function u(f,g){return f.whitelist[g]!==void 0?f.whitelist[g]===!0:f.defaultValue!==void 0?f.defaultValue:(c(g),!1)}a(u,"p0");function c(f){s[f]!==!0&&(s[f]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+f+`" because it is not an "own property" of its parent.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/code-block-37QAKDTI-OOURJEjm.js","assets/react-vendor-CP9LLfL8.js","assets/ui-vendor-B7JxFfFk.js","assets/main-CqTmsniN.js"])))=>i.map(i=>d[i]);
2
+ var pB=Object.defineProperty;var a=(e,t)=>pB(e,"name",{value:t,configurable:!0});import{g as Ol,j as v,S as Rl,r as F,R as LA,a as DA,T as jA,P as UA,C as sp,b as BA,X as Hn,O as op,c as lp,D as up,d as mB,e as gB,f as bB,h as vB,i as zA,k as yB,l as FA,m as HA,L as By,n as zy,o as ZA,p as wB,V as xB,G as _B,q as GA,I as EB,s as ha,t as SB,u as VA,v as kB,w as WA,x as AB,y as Va,z as TB,A as YA,B as QA,E as $A,F as XA,H as JA,J as nn,K as NB,M as IB,N as CB,Q as MB,U as OB,W as RB,Y as PB,Z as LB,_ as DB,$ as KA,a0 as qA,a1 as eT,a2 as tT,a3 as rT,a4 as nT,a5 as pi,a6 as jB,a7 as iT,a8 as aT,a9 as UB,aa as sT,ab as cn,ac as Fy,ad as Yc,ae as oT,af as lT,ag as BB,ah as zB,ai as Hy,aj as uT,ak as FB,al as HB,am as cT,an as ZB,ao as ro,ap as v0,aq as ja,ar as na,as as n1,at as fo,au as GB,av as aa,aw as mn,ax as an,ay as dT,az as fT,aA as hT,aB as pT,aC as mT,aD as ei,aE as cp,aF as VB,aG as WB,aH as YB,aI as dp,aJ as fp,aK as Ou,aL as ho,aM as vs,aN as i1,aO as QB,aP as Qc,aQ as hp,aR as ic,aS as $B,aT as a1,aU as XB,aV as gT,aW as JB,aX as bT,aY as vT,aZ as yT,a_ as wT,a$ as xT,b0 as KB,b1 as Zy,b2 as lv,b3 as _T,b4 as qB,b5 as lh,b6 as Gy,b7 as ez,b8 as tz,b9 as rz,ba as nz,bb as iz,bc as Vy,bd as az,be as sz,bf as oz,bg as Wy,bh as Yy,bi as lz,bj as ET,bk as uv,bl as uz,bm as ST,bn as cz,bo as dz,bp as fz,bq as hz,br as pz,bs as mz,bt as gz,bu as bz,bv as vz,bw as kT,bx as AT,by as TT,bz as NT,bA as yz,bB as wz,bC as xz,bD as cv,bE as _z,bF as Ez,bG as pp,bH as Sz,bI as IT,bJ as kz,bK as Az,bL as y0,bM as s1,bN as o1,bO as Tz,bP as Qy,bQ as Nz,bR as Iz,bS as Cz,bT as Mz,bU as Oz,bV as Rz,bW as Pz,bX as Lz,bY as Dz,bZ as jz,b_ as yi,b$ as Uz}from"./react-vendor-CP9LLfL8.js";import{_ as CT}from"./main-CqTmsniN.js";function MT(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=MT(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}a(MT,"r");function mp(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=MT(e))&&(n&&(n+=" "),n+=t);return n}a(mp,"clsx");const l1=a(e=>typeof e=="boolean"?`${e}`:e===0?"0":e,"falsyToString"),u1=mp,$a=a((e,t)=>r=>{var n;if(t?.variants==null)return u1(e,r?.class,r?.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(c=>{const d=r?.[c],f=s?.[c];if(d===null)return null;const g=l1(d)||l1(f);return i[c][g]}),l=r&&Object.entries(r).reduce((c,d)=>{let[f,g]=d;return g===void 0||(c[f]=g),c},{}),u=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:g,...m}=d;return Object.entries(m).every(w=>{let[E,A]=w;return Array.isArray(A)?A.includes({...s,...l}[E]):{...s,...l}[E]===A})?[...c,f,g]:c},[]);return u1(e,o,u,r?.class,r?.className)},"cva"),Fa="user",zd="client_chat",Ru="client_group_chat",ac=512;var Bf=(e=>(e.REQUIRED="required",e.OPTIONAL="optional",e))(Bf||{});const Fo={name:"required",username:"optional",system:"required","settings.voice.model":"optional",bio:"optional",topics:"optional",adjectives:"optional","style.all":"optional","style.chat":"optional","style.post":"optional"};var zf={exports:{}},Bz=zf.exports,c1;function zz(){return c1||(c1=1,(function(e,t){(function(r,n){e.exports=n()})(Bz,(function(){var r=1e3,n=6e4,i=36e5,s="millisecond",o="second",l="minute",u="hour",c="day",d="week",f="month",g="quarter",m="year",w="date",E="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:a(function(b){var x=["th","st","nd","rd"],_=b%100;return"["+b+(x[(_-20)%10]||x[_]||x[0])+"]"},"ordinal")},R=a(function(b,x,_){var N=String(b);return!N||N.length>=x?b:""+Array(x+1-N.length).join(_)+b},"m"),P={s:R,z:a(function(b){var x=-b.utcOffset(),_=Math.abs(x),N=Math.floor(_/60),T=_%60;return(x<=0?"+":"-")+R(N,2,"0")+":"+R(T,2,"0")},"z"),m:a(function b(x,_){if(x.date()<_.date())return-b(_,x);var N=12*(_.year()-x.year())+(_.month()-x.month()),T=x.clone().add(N,f),k=_-T<0,p=x.clone().add(N+(k?-1:1),f);return+(-(N+(_-T)/(k?T-p:p-T))||0)},"t2"),a:a(function(b){return b<0?Math.ceil(b)||0:Math.floor(b)},"a"),p:a(function(b){return{M:f,y:m,w:d,d:c,D:w,h:u,m:l,s:o,ms:s,Q:g}[b]||String(b||"").toLowerCase().replace(/s$/,"")},"p"),u:a(function(b){return b===void 0},"u")},L="en",j={};j[L]=O;var G="$isDayjsObject",Z=a(function(b){return b instanceof h||!(!b||!b[G])},"S"),K=a(function b(x,_,N){var T;if(!x)return L;if(typeof x=="string"){var k=x.toLowerCase();j[k]&&(T=k),_&&(j[k]=_,T=k);var p=x.split("-");if(!T&&p.length>1)return b(p[0])}else{var S=x.name;j[S]=x,T=S}return!N&&T&&(L=T),T||!N&&L},"t2"),z=a(function(b,x){if(Z(b))return b.clone();var _=typeof x=="object"?x:{};return _.date=b,_.args=arguments,new h(_)},"O"),V=P;V.l=K,V.i=Z,V.w=function(b,x){return z(b,{locale:x.$L,utc:x.$u,x:x.$x,$offset:x.$offset})};var h=(function(){function b(_){this.$L=K(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[G]=!0}a(b,"M2");var x=b.prototype;return x.parse=function(_){this.$d=(function(N){var T=N.date,k=N.utc;if(T===null)return new Date(NaN);if(V.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var p=T.match(A);if(p){var S=p[2]-1||0,I=(p[7]||"0").substring(0,3);return k?new Date(Date.UTC(p[1],S,p[3]||1,p[4]||0,p[5]||0,p[6]||0,I)):new Date(p[1],S,p[3]||1,p[4]||0,p[5]||0,p[6]||0,I)}}return new Date(T)})(_),this.init()},x.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},x.$utils=function(){return V},x.isValid=function(){return this.$d.toString()!==E},x.isSame=function(_,N){var T=z(_);return this.startOf(N)<=T&&T<=this.endOf(N)},x.isAfter=function(_,N){return z(_)<this.startOf(N)},x.isBefore=function(_,N){return this.endOf(N)<z(_)},x.$g=function(_,N,T){return V.u(_)?this[N]:this.set(T,_)},x.unix=function(){return Math.floor(this.valueOf()/1e3)},x.valueOf=function(){return this.$d.getTime()},x.startOf=function(_,N){var T=this,k=!!V.u(N)||N,p=V.p(_),S=a(function(ie,ne){var Ne=V.w(T.$u?Date.UTC(T.$y,ne,ie):new Date(T.$y,ne,ie),T);return k?Ne:Ne.endOf(c)},"l2"),I=a(function(ie,ne){return V.w(T.toDate()[ie].apply(T.toDate("s"),(k?[0,0,0,0]:[23,59,59,999]).slice(ne)),T)},"$2"),M=this.$W,U=this.$M,B=this.$D,H="set"+(this.$u?"UTC":"");switch(p){case m:return k?S(1,0):S(31,11);case f:return k?S(1,U):S(0,U+1);case d:var $=this.$locale().weekStart||0,ae=(M<$?M+7:M)-$;return S(k?B-ae:B+(6-ae),U);case c:case w:return I(H+"Hours",0);case u:return I(H+"Minutes",1);case l:return I(H+"Seconds",2);case o:return I(H+"Milliseconds",3);default:return this.clone()}},x.endOf=function(_){return this.startOf(_,!1)},x.$set=function(_,N){var T,k=V.p(_),p="set"+(this.$u?"UTC":""),S=(T={},T[c]=p+"Date",T[w]=p+"Date",T[f]=p+"Month",T[m]=p+"FullYear",T[u]=p+"Hours",T[l]=p+"Minutes",T[o]=p+"Seconds",T[s]=p+"Milliseconds",T)[k],I=k===c?this.$D+(N-this.$W):N;if(k===f||k===m){var M=this.clone().set(w,1);M.$d[S](I),M.init(),this.$d=M.set(w,Math.min(this.$D,M.daysInMonth())).$d}else S&&this.$d[S](I);return this.init(),this},x.set=function(_,N){return this.clone().$set(_,N)},x.get=function(_){return this[V.p(_)]()},x.add=function(_,N){var T,k=this;_=Number(_);var p=V.p(N),S=a(function(U){var B=z(k);return V.w(B.date(B.date()+Math.round(U*_)),k)},"y2");if(p===f)return this.set(f,this.$M+_);if(p===m)return this.set(m,this.$y+_);if(p===c)return S(1);if(p===d)return S(7);var I=(T={},T[l]=n,T[u]=i,T[o]=r,T)[p]||1,M=this.$d.getTime()+_*I;return V.w(M,this)},x.subtract=function(_,N){return this.add(-1*_,N)},x.format=function(_){var N=this,T=this.$locale();if(!this.isValid())return T.invalidDate||E;var k=_||"YYYY-MM-DDTHH:mm:ssZ",p=V.z(this),S=this.$H,I=this.$m,M=this.$M,U=T.weekdays,B=T.months,H=T.meridiem,$=a(function(ne,Ne,ve,he){return ne&&(ne[Ne]||ne(N,k))||ve[Ne].slice(0,he)},"h2"),ae=a(function(ne){return V.s(S%12||12,ne,"0")},"d2"),ie=H||function(ne,Ne,ve){var he=ne<12?"AM":"PM";return ve?he.toLowerCase():he};return k.replace(C,(function(ne,Ne){return Ne||(function(ve){switch(ve){case"YY":return String(N.$y).slice(-2);case"YYYY":return V.s(N.$y,4,"0");case"M":return M+1;case"MM":return V.s(M+1,2,"0");case"MMM":return $(T.monthsShort,M,B,3);case"MMMM":return $(B,M);case"D":return N.$D;case"DD":return V.s(N.$D,2,"0");case"d":return String(N.$W);case"dd":return $(T.weekdaysMin,N.$W,U,2);case"ddd":return $(T.weekdaysShort,N.$W,U,3);case"dddd":return U[N.$W];case"H":return String(S);case"HH":return V.s(S,2,"0");case"h":return ae(1);case"hh":return ae(2);case"a":return ie(S,I,!0);case"A":return ie(S,I,!1);case"m":return String(I);case"mm":return V.s(I,2,"0");case"s":return String(N.$s);case"ss":return V.s(N.$s,2,"0");case"SSS":return V.s(N.$ms,3,"0");case"Z":return p}return null})(ne)||p.replace(":","")}))},x.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},x.diff=function(_,N,T){var k,p=this,S=V.p(N),I=z(_),M=(I.utcOffset()-this.utcOffset())*n,U=this-I,B=a(function(){return V.m(p,I)},"D2");switch(S){case m:k=B()/12;break;case f:k=B();break;case g:k=B()/3;break;case d:k=(U-M)/6048e5;break;case c:k=(U-M)/864e5;break;case u:k=U/i;break;case l:k=U/n;break;case o:k=U/r;break;default:k=U}return T?k:V.a(k)},x.daysInMonth=function(){return this.endOf(f).$D},x.$locale=function(){return j[this.$L]},x.locale=function(_,N){if(!_)return this.$L;var T=this.clone(),k=K(_,N,!0);return k&&(T.$L=k),T},x.clone=function(){return V.w(this.$d,this)},x.toDate=function(){return new Date(this.valueOf())},x.toJSON=function(){return this.isValid()?this.toISOString():null},x.toISOString=function(){return this.$d.toISOString()},x.toString=function(){return this.$d.toUTCString()},b})(),y=h.prototype;return z.prototype=y,[["$ms",s],["$s",o],["$m",l],["$H",u],["$W",c],["$M",f],["$y",m],["$D",w]].forEach((function(b){y[b[1]]=function(x){return this.$g(x,b[0],b[1])}})),z.extend=function(b,x){return b.$i||(b(x,h,z),b.$i=!0),z},z.locale=K,z.isDayjs=Z,z.unix=function(b){return z(1e3*b)},z.en=j[L],z.Ls=j,z.p={},z}))})(zf)),zf.exports}a(zz,"requireDayjs_min");var Fz=zz();const OT=Ol(Fz);var Ff={exports:{}},Hz=Ff.exports,d1;function Zz(){return d1||(d1=1,(function(e,t){(function(r,n){e.exports=n()})(Hz,(function(){var r={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(n,i,s){var o=i.prototype,l=o.format;s.en.formats=r,o.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var c=this.$locale().formats,d=(function(f,g){return f.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(m,w,E){var A=E&&E.toUpperCase();return w||g[E]||r[E]||g[A].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(C,O,R){return O||R.slice(1)}))}))})(u,c===void 0?{}:c);return l.call(this,d)}}}))})(Ff)),Ff.exports}a(Zz,"requireLocalizedFormat");var Gz=Zz();const Vz=Ol(Gz),Wz=a((e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},"concatArrays"),Yz=a((e,t)=>({classGroupId:e,validator:t}),"createClassValidatorObject"),RT=a((e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),"createClassPartObject"),uh="-",f1=[],Qz="arbitrary..",$z=a(e=>{const t=Jz(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a(o=>{if(o.startsWith("[")&&o.endsWith("]"))return Xz(o);const l=o.split(uh),u=l[0]===""&&l.length>1?1:0;return PT(l,u,t)},"getClassGroupId"),getConflictingClassGroupIds:a((o,l)=>{if(l){const u=n[o],c=r[o];return u?c?Wz(c,u):u:c||f1}return r[o]||f1},"getConflictingClassGroupIds")}},"createClassGroupUtils"),PT=a((e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],s=r.nextPart.get(i);if(s){const c=PT(e,t+1,s);if(c)return c}const o=r.validators;if(o===null)return;const l=t===0?e.join(uh):e.slice(t).join(uh),u=o.length;for(let c=0;c<u;c++){const d=o[c];if(d.validator(l))return d.classGroupId}},"getGroupRecursive"),Xz=a(e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?Qz+n:void 0})(),"getGroupIdForArbitraryProperty"),Jz=a(e=>{const{theme:t,classGroups:r}=e;return Kz(r,t)},"createClassMap"),Kz=a((e,t)=>{const r=RT();for(const n in e){const i=e[n];$y(i,r,n,t)}return r},"processClassGroups"),$y=a((e,t,r,n)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];qz(o,t,r,n)}},"processClassesRecursively"),qz=a((e,t,r,n)=>{if(typeof e=="string"){eF(e,t,r);return}if(typeof e=="function"){tF(e,t,r,n);return}rF(e,t,r,n)},"processClassDefinition"),eF=a((e,t,r)=>{const n=e===""?t:LT(t,e);n.classGroupId=r},"processStringDefinition"),tF=a((e,t,r,n)=>{if(nF(e)){$y(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(Yz(r,e))},"processFunctionDefinition"),rF=a((e,t,r,n)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[l,u]=i[o];$y(u,LT(t,l),r,n)}},"processObjectDefinition"),LT=a((e,t)=>{let r=e;const n=t.split(uh),i=n.length;for(let s=0;s<i;s++){const o=n[s];let l=r.nextPart.get(o);l||(l=RT(),r.nextPart.set(o,l)),r=l}return r},"getPart"),nF=a(e=>"isThemeGetter"in e&&e.isThemeGetter===!0,"isThemeGetter"),iF=a(e=>{if(e<1)return{get:a(()=>{},"get"),set:a(()=>{},"set")};let t=0,r=Object.create(null),n=Object.create(null);const i=a((s,o)=>{r[s]=o,t++,t>e&&(t=0,n=r,r=Object.create(null))},"update");return{get(s){let o=r[s];if(o!==void 0)return o;if((o=n[s])!==void 0)return i(s,o),o},set(s,o){s in r?r[s]=o:i(s,o)}}},"createLruCache"),dv="!",h1=":",aF=[],p1=a((e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),"createResultObject"),sF=a(e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a(i=>{const s=[];let o=0,l=0,u=0,c;const d=i.length;for(let E=0;E<d;E++){const A=i[E];if(o===0&&l===0){if(A===h1){s.push(i.slice(u,E)),u=E+1;continue}if(A==="/"){c=E;continue}}A==="["?o++:A==="]"?o--:A==="("?l++:A===")"&&l--}const f=s.length===0?i:i.slice(u);let g=f,m=!1;f.endsWith(dv)?(g=f.slice(0,-1),m=!0):f.startsWith(dv)&&(g=f.slice(1),m=!0);const w=c&&c>u?c-u:void 0;return p1(s,m,g,w)},"parseClassName");if(t){const i=t+h1,s=n;n=a(o=>o.startsWith(i)?s(o.slice(i.length)):p1(aF,!1,o,void 0,!0),"parseClassName")}if(r){const i=n;n=a(s=>r({className:s,parseClassName:i}),"parseClassName")}return n},"createParseClassName"),oF=a(e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let s=0;s<r.length;s++){const o=r[s],l=o[0]==="[",u=t.has(o);l||u?(i.length>0&&(i.sort(),n.push(...i),i=[]),n.push(o)):i.push(o)}return i.length>0&&(i.sort(),n.push(...i)),n}},"createSortModifiers"),lF=a(e=>({cache:iF(e.cacheSize),parseClassName:sF(e),sortModifiers:oF(e),...$z(e)}),"createConfigUtils"),uF=/\s+/,cF=a((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],l=e.trim().split(uF);let u="";for(let c=l.length-1;c>=0;c-=1){const d=l[c],{isExternal:f,modifiers:g,hasImportantModifier:m,baseClassName:w,maybePostfixModifierPosition:E}=r(d);if(f){u=d+(u.length>0?" "+u:u);continue}let A=!!E,C=n(A?w.substring(0,E):w);if(!C){if(!A){u=d+(u.length>0?" "+u:u);continue}if(C=n(w),!C){u=d+(u.length>0?" "+u:u);continue}A=!1}const O=g.length===0?"":g.length===1?g[0]:s(g).join(":"),R=m?O+dv:O,P=R+C;if(o.indexOf(P)>-1)continue;o.push(P);const L=i(C,A);for(let j=0;j<L.length;++j){const G=L[j];o.push(R+G)}u=d+(u.length>0?" "+u:u)}return u},"mergeClassList"),dF=a((...e)=>{let t=0,r,n,i="";for(;t<e.length;)(r=e[t++])&&(n=DT(r))&&(i&&(i+=" "),i+=n);return i},"twJoin"),DT=a(e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=DT(e[n]))&&(r&&(r+=" "),r+=t);return r},"toValue"),fF=a((e,...t)=>{let r,n,i,s;const o=a(u=>{const c=t.reduce((d,f)=>f(d),e());return r=lF(c),n=r.cache.get,i=r.cache.set,s=l,l(u)},"initTailwindMerge"),l=a(u=>{const c=n(u);if(c)return c;const d=cF(u,r);return i(u,d),d},"tailwindMerge");return s=o,(...u)=>s(dF(...u))},"createTailwindMerge"),hF=[],Qr=a(e=>{const t=a(r=>r[e]||hF,"themeGetter");return t.isThemeGetter=!0,t},"fromTheme"),jT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,UT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,pF=/^\d+\/\d+$/,mF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,bF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,vF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,yF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ho=a(e=>pF.test(e),"isFraction"),Qt=a(e=>!!e&&!Number.isNaN(Number(e)),"isNumber$1"),ts=a(e=>!!e&&Number.isInteger(Number(e)),"isInteger$1"),w0=a(e=>e.endsWith("%")&&Qt(e.slice(0,-1)),"isPercent"),Sa=a(e=>mF.test(e),"isTshirtSize"),wF=a(()=>!0,"isAny"),xF=a(e=>gF.test(e)&&!bF.test(e),"isLengthOnly"),BT=a(()=>!1,"isNever"),_F=a(e=>vF.test(e),"isShadow"),EF=a(e=>yF.test(e),"isImage"),SF=a(e=>!St(e)&&!kt(e),"isAnyNonArbitrary"),kF=a(e=>Pl(e,HT,BT),"isArbitrarySize"),St=a(e=>jT.test(e),"isArbitraryValue"),Ls=a(e=>Pl(e,ZT,xF),"isArbitraryLength"),x0=a(e=>Pl(e,CF,Qt),"isArbitraryNumber"),m1=a(e=>Pl(e,zT,BT),"isArbitraryPosition"),AF=a(e=>Pl(e,FT,EF),"isArbitraryImage"),Fd=a(e=>Pl(e,GT,_F),"isArbitraryShadow"),kt=a(e=>UT.test(e),"isArbitraryVariable"),$l=a(e=>Ll(e,ZT),"isArbitraryVariableLength"),TF=a(e=>Ll(e,MF),"isArbitraryVariableFamilyName"),g1=a(e=>Ll(e,zT),"isArbitraryVariablePosition"),NF=a(e=>Ll(e,HT),"isArbitraryVariableSize"),IF=a(e=>Ll(e,FT),"isArbitraryVariableImage"),Hd=a(e=>Ll(e,GT,!0),"isArbitraryVariableShadow"),Pl=a((e,t,r)=>{const n=jT.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},"getIsArbitraryValue"),Ll=a((e,t,r=!1)=>{const n=UT.exec(e);return n?n[1]?t(n[1]):r:!1},"getIsArbitraryVariable"),zT=a(e=>e==="position"||e==="percentage","isLabelPosition"),FT=a(e=>e==="image"||e==="url","isLabelImage"),HT=a(e=>e==="length"||e==="size"||e==="bg-size","isLabelSize"),ZT=a(e=>e==="length","isLabelLength"),CF=a(e=>e==="number","isLabelNumber"),MF=a(e=>e==="family-name","isLabelFamilyName"),GT=a(e=>e==="shadow","isLabelShadow"),OF=a(()=>{const e=Qr("color"),t=Qr("font"),r=Qr("text"),n=Qr("font-weight"),i=Qr("tracking"),s=Qr("leading"),o=Qr("breakpoint"),l=Qr("container"),u=Qr("spacing"),c=Qr("radius"),d=Qr("shadow"),f=Qr("inset-shadow"),g=Qr("text-shadow"),m=Qr("drop-shadow"),w=Qr("blur"),E=Qr("perspective"),A=Qr("aspect"),C=Qr("ease"),O=Qr("animate"),R=a(()=>["auto","avoid","all","avoid-page","page","left","right","column"],"scaleBreak"),P=a(()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],"scalePosition"),L=a(()=>[...P(),kt,St],"scalePositionWithArbitrary"),j=a(()=>["auto","hidden","clip","visible","scroll"],"scaleOverflow"),G=a(()=>["auto","contain","none"],"scaleOverscroll"),Z=a(()=>[kt,St,u],"scaleUnambiguousSpacing"),K=a(()=>[Ho,"full","auto",...Z()],"scaleInset"),z=a(()=>[ts,"none","subgrid",kt,St],"scaleGridTemplateColsRows"),V=a(()=>["auto",{span:["full",ts,kt,St]},ts,kt,St],"scaleGridColRowStartAndEnd"),h=a(()=>[ts,"auto",kt,St],"scaleGridColRowStartOrEnd"),y=a(()=>["auto","min","max","fr",kt,St],"scaleGridAutoColsRows"),b=a(()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],"scaleAlignPrimaryAxis"),x=a(()=>["start","end","center","stretch","center-safe","end-safe"],"scaleAlignSecondaryAxis"),_=a(()=>["auto",...Z()],"scaleMargin"),N=a(()=>[Ho,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],"scaleSizing"),T=a(()=>[e,kt,St],"scaleColor"),k=a(()=>[...P(),g1,m1,{position:[kt,St]}],"scaleBgPosition"),p=a(()=>["no-repeat",{repeat:["","x","y","space","round"]}],"scaleBgRepeat"),S=a(()=>["auto","cover","contain",NF,kF,{size:[kt,St]}],"scaleBgSize"),I=a(()=>[w0,$l,Ls],"scaleGradientStopPosition"),M=a(()=>["","none","full",c,kt,St],"scaleRadius"),U=a(()=>["",Qt,$l,Ls],"scaleBorderWidth"),B=a(()=>["solid","dashed","dotted","double"],"scaleLineStyle"),H=a(()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"scaleBlendMode"),$=a(()=>[Qt,w0,g1,m1],"scaleMaskImagePosition"),ae=a(()=>["","none",w,kt,St],"scaleBlur"),ie=a(()=>["none",Qt,kt,St],"scaleRotate"),ne=a(()=>["none",Qt,kt,St],"scaleScale"),Ne=a(()=>[Qt,kt,St],"scaleSkew"),ve=a(()=>[Ho,"full",...Z()],"scaleTranslate");return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Sa],breakpoint:[Sa],color:[wF],container:[Sa],"drop-shadow":[Sa],ease:["in","out","in-out"],font:[SF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Sa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Sa],shadow:[Sa],spacing:["px",Qt],text:[Sa],"text-shadow":[Sa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ho,St,kt,A]}],container:["container"],columns:[{columns:[Qt,St,kt,l]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:L()}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:G()}],"overscroll-x":[{"overscroll-x":G()}],"overscroll-y":[{"overscroll-y":G()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[ts,"auto",kt,St]}],basis:[{basis:[Ho,"full","auto",l,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qt,Ho,"auto","initial","none",St]}],grow:[{grow:["",Qt,kt,St]}],shrink:[{shrink:["",Qt,kt,St]}],order:[{order:[ts,"first","last","none",kt,St]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":h()}],"col-end":[{"col-end":h()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":h()}],"row-end":[{"row-end":h()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":y()}],"auto-rows":[{"auto-rows":y()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...b(),"normal"]}],"justify-items":[{"justify-items":[...x(),"normal"]}],"justify-self":[{"justify-self":["auto",...x()]}],"align-content":[{content:["normal",...b()]}],"align-items":[{items:[...x(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...x(),{baseline:["","last"]}]}],"place-content":[{"place-content":b()}],"place-items":[{"place-items":[...x(),"baseline"]}],"place-self":[{"place-self":["auto",...x()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:N()}],w:[{w:[l,"screen",...N()]}],"min-w":[{"min-w":[l,"screen","none",...N()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...N()]}],h:[{h:["screen","lh",...N()]}],"min-h":[{"min-h":["screen","lh","none",...N()]}],"max-h":[{"max-h":["screen","lh",...N()]}],"font-size":[{text:["base",r,$l,Ls]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,kt,x0]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",w0,St]}],"font-family":[{font:[TF,St,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,kt,St]}],"line-clamp":[{"line-clamp":[Qt,"none",kt,x0]}],leading:[{leading:[s,...Z()]}],"list-image":[{"list-image":["none",kt,St]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",kt,St]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...B(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qt,"from-font","auto",kt,Ls]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Qt,"auto",kt,St]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",kt,St]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",kt,St]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:p()}],"bg-size":[{bg:S()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ts,kt,St],radial:["",kt,St],conic:[ts,kt,St]},IF,AF]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:I()}],"gradient-via-pos":[{via:I()}],"gradient-to-pos":[{to:I()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...B(),"hidden","none"]}],"divide-style":[{divide:[...B(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...B(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qt,kt,St]}],"outline-w":[{outline:["",Qt,$l,Ls]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",d,Hd,Fd]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,Hd,Fd]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Qt,Ls]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",g,Hd,Fd]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Qt,kt,St]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":$()}],"mask-image-linear-to-pos":[{"mask-linear-to":$()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":$()}],"mask-image-t-to-pos":[{"mask-t-to":$()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":$()}],"mask-image-r-to-pos":[{"mask-r-to":$()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":$()}],"mask-image-b-to-pos":[{"mask-b-to":$()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":$()}],"mask-image-l-to-pos":[{"mask-l-to":$()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":$()}],"mask-image-x-to-pos":[{"mask-x-to":$()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":$()}],"mask-image-y-to-pos":[{"mask-y-to":$()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[kt,St]}],"mask-image-radial-from-pos":[{"mask-radial-from":$()}],"mask-image-radial-to-pos":[{"mask-radial-to":$()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":P()}],"mask-image-conic-pos":[{"mask-conic":[Qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":$()}],"mask-image-conic-to-pos":[{"mask-conic-to":$()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:p()}],"mask-size":[{mask:S()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",kt,St]}],filter:[{filter:["","none",kt,St]}],blur:[{blur:ae()}],brightness:[{brightness:[Qt,kt,St]}],contrast:[{contrast:[Qt,kt,St]}],"drop-shadow":[{"drop-shadow":["","none",m,Hd,Fd]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Qt,kt,St]}],"hue-rotate":[{"hue-rotate":[Qt,kt,St]}],invert:[{invert:["",Qt,kt,St]}],saturate:[{saturate:[Qt,kt,St]}],sepia:[{sepia:["",Qt,kt,St]}],"backdrop-filter":[{"backdrop-filter":["","none",kt,St]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[Qt,kt,St]}],"backdrop-contrast":[{"backdrop-contrast":[Qt,kt,St]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qt,kt,St]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qt,kt,St]}],"backdrop-invert":[{"backdrop-invert":["",Qt,kt,St]}],"backdrop-opacity":[{"backdrop-opacity":[Qt,kt,St]}],"backdrop-saturate":[{"backdrop-saturate":[Qt,kt,St]}],"backdrop-sepia":[{"backdrop-sepia":["",Qt,kt,St]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",kt,St]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qt,"initial",kt,St]}],ease:[{ease:["linear","initial",C,kt,St]}],delay:[{delay:[Qt,kt,St]}],animate:[{animate:["none",O,kt,St]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,kt,St]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:ne()}],"scale-x":[{"scale-x":ne()}],"scale-y":[{"scale-y":ne()}],"scale-z":[{"scale-z":ne()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[kt,St,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ve()}],"translate-x":[{"translate-x":ve()}],"translate-y":[{"translate-y":ve()}],"translate-z":[{"translate-z":ve()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",kt,St]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",kt,St]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Qt,$l,Ls,x0]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},"getDefaultConfig"),VT=fF(OF);var Di={},RF=Object.create,{getPrototypeOf:PF,defineProperty:sc,getOwnPropertyNames:WT,getOwnPropertyDescriptor:LF}=Object,YT=Object.prototype.hasOwnProperty,Gi=a((e,t,r)=>{r=e!=null?RF(PF(e)):{};let n=t||!e||!e.__esModule?sc(r,"default",{value:e,enumerable:!0}):r;for(let i of WT(e))YT.call(n,i)||sc(n,i,{get:a(()=>e[i],"get"),enumerable:!0});return n},"R8"),b1=new WeakMap,qt=a(e=>{var t=b1.get(e),r;return t||(t=sc({},"__esModule",{value:!0}),(e&&typeof e=="object"||typeof e=="function")&&WT(e).map(n=>!YT.call(t,n)&&sc(t,n,{get:a(()=>e[n],"get"),enumerable:!(r=LF(e,n))||r.enumerable})),b1.set(e,t),t)},"H6"),it=a((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"N$"),vn=a((e,t)=>{for(var r in t)sc(e,r,{get:t[r],enumerable:!0,configurable:!0,set:a(n=>t[r]=()=>n,"set")})},"Rq"),$c=a((e,t)=>()=>(e&&(t=e(e=0)),t),"P4"),Hf=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:a((t,r)=>(typeof require<"u"?require:t)[r],"get")}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),DF=it((e,t)=>{t.exports=function(r,n){if(typeof r!="string")throw TypeError("Expected a string");return n=typeof n>"u"?"_":n,r.replace(/([a-z\d])([A-Z])/g,"$1"+n+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+n+"$2").toLowerCase()}}),jF=it((e,t)=>{var r=/[\p{Lu}]/u,n=/[\p{Ll}]/u,i=/^[\p{Lu}](?![\p{Lu}])/gu,s=/([\p{Alpha}\p{N}_]|$)/u,o=/[_.\- ]+/,l=new RegExp("^"+o.source),u=new RegExp(o.source+s.source,"gu"),c=new RegExp("\\d+"+s.source,"gu"),d=a((w,E,A)=>{let C=!1,O=!1,R=!1;for(let P=0;P<w.length;P++){let L=w[P];C&&r.test(L)?(w=w.slice(0,P)+"-"+w.slice(P),C=!1,R=O,O=!0,P++):O&&R&&n.test(L)?(w=w.slice(0,P-1)+"-"+w.slice(P-1),R=O,O=!1,C=!0):(C=E(L)===L&&A(L)!==L,R=O,O=A(L)===L&&E(L)!==L)}return w},"XI"),f=a((w,E)=>(i.lastIndex=0,w.replace(i,A=>E(A))),"AI"),g=a((w,E)=>(u.lastIndex=0,c.lastIndex=0,w.replace(u,(A,C)=>E(C)).replace(c,A=>E(A))),"kI"),m=a((w,E)=>{if(!(typeof w=="string"||Array.isArray(w)))throw TypeError("Expected the input to be `string | string[]`");if(E={pascalCase:!1,preserveConsecutiveUppercase:!1,...E},Array.isArray(w)?w=w.map(O=>O.trim()).filter(O=>O.length).join("-"):w=w.trim(),w.length===0)return"";let A=E.locale===!1?O=>O.toLowerCase():O=>O.toLocaleLowerCase(E.locale),C=E.locale===!1?O=>O.toUpperCase():O=>O.toLocaleUpperCase(E.locale);return w.length===1?E.pascalCase?C(w):A(w):(w!==A(w)&&(w=d(w,A,C)),w=w.replace(l,""),E.preserveConsecutiveUppercase?w=f(w,A):w=A(w),E.pascalCase&&(w=C(w.charAt(0))+w.slice(1)),g(w,C))},"BZ");t.exports=m,t.exports.default=m}),UF=it((e,t)=>{var r=Object.prototype.hasOwnProperty,n="~";function i(){}a(i,"aP"),Object.create&&(i.prototype=Object.create(null),!new i().__proto__&&(n=!1));function s(c,d,f){this.fn=c,this.context=d,this.once=f||!1}a(s,"ch");function o(c,d,f,g,m){if(typeof f!="function")throw TypeError("The listener must be a function");var w=new s(f,g||c,m),E=n?n+d:d;return c._events[E]?c._events[E].fn?c._events[E]=[c._events[E],w]:c._events[E].push(w):(c._events[E]=w,c._eventsCount++),c}a(o,"rX");function l(c,d){--c._eventsCount===0?c._events=new i:delete c._events[d]}a(l,"A9");function u(){this._events=new i,this._eventsCount=0}a(u,"hq"),u.prototype.eventNames=function(){var c=[],d,f;if(this._eventsCount===0)return c;for(f in d=this._events)r.call(d,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},u.prototype.listeners=function(c){var d=n?n+c:c,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var g=0,m=f.length,w=Array(m);g<m;g++)w[g]=f[g].fn;return w},u.prototype.listenerCount=function(c){var d=n?n+c:c,f=this._events[d];return f?f.fn?1:f.length:0},u.prototype.emit=function(c,d,f,g,m,w){var E=n?n+c:c;if(!this._events[E])return!1;var A=this._events[E],C=arguments.length,O,R;if(A.fn){switch(A.once&&this.removeListener(c,A.fn,void 0,!0),C){case 1:return A.fn.call(A.context),!0;case 2:return A.fn.call(A.context,d),!0;case 3:return A.fn.call(A.context,d,f),!0;case 4:return A.fn.call(A.context,d,f,g),!0;case 5:return A.fn.call(A.context,d,f,g,m),!0;case 6:return A.fn.call(A.context,d,f,g,m,w),!0}for(R=1,O=Array(C-1);R<C;R++)O[R-1]=arguments[R];A.fn.apply(A.context,O)}else{var P=A.length,L;for(R=0;R<P;R++)switch(A[R].once&&this.removeListener(c,A[R].fn,void 0,!0),C){case 1:A[R].fn.call(A[R].context);break;case 2:A[R].fn.call(A[R].context,d);break;case 3:A[R].fn.call(A[R].context,d,f);break;case 4:A[R].fn.call(A[R].context,d,f,g);break;default:if(!O)for(L=1,O=Array(C-1);L<C;L++)O[L-1]=arguments[L];A[R].fn.apply(A[R].context,O)}}return!0},u.prototype.on=function(c,d,f){return o(this,c,d,f,!1)},u.prototype.once=function(c,d,f){return o(this,c,d,f,!0)},u.prototype.removeListener=function(c,d,f,g){var m=n?n+c:c;if(!this._events[m])return this;if(!d)return l(this,m),this;var w=this._events[m];if(w.fn)w.fn===d&&(!g||w.once)&&(!f||w.context===f)&&l(this,m);else{for(var E=0,A=[],C=w.length;E<C;E++)(w[E].fn!==d||g&&!w[E].once||f&&w[E].context!==f)&&A.push(w[E]);A.length?this._events[m]=A.length===1?A[0]:A:l(this,m)}return this},u.prototype.removeAllListeners=function(c){var d;return c?(d=n?n+c:c,this._events[d]&&l(this,d)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}),BF=it((e,t)=>{t.exports=(r,n)=>(n=n||(()=>{}),r.then(i=>new Promise(s=>{s(n())}).then(()=>i),i=>new Promise(s=>{s(n())}).then(()=>{throw i})))}),zF=it((e,t)=>{var r=BF();class n extends Error{static{a(this,"pO")}constructor(o){super(o),this.name="TimeoutError"}}var i=a((s,o,l)=>new Promise((u,c)=>{if(typeof o!="number"||o<0)throw TypeError("Expected `milliseconds` to be a positive number");if(o===1/0){u(s);return}let d=setTimeout(()=>{if(typeof l=="function"){try{u(l())}catch(m){c(m)}return}let f=typeof l=="string"?l:`Promise timed out after ${o} milliseconds`,g=l instanceof Error?l:new n(f);typeof s.cancel=="function"&&s.cancel(),c(g)},o);r(s.then(u,c),()=>{clearTimeout(d)})}),"BX");t.exports=i,t.exports.default=i,t.exports.TimeoutError=n}),FF=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r,n,i){let s=0,o=r.length;for(;o>0;){let l=o/2|0,u=s+l;i(r[u],n)<=0?(s=++u,o-=l+1):o=l}return s}a(t,"dh"),e.default=t}),HF=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=FF();class r{static{a(this,"QX")}constructor(){this._queue=[]}enqueue(i,s){s=Object.assign({priority:0},s);let o={priority:s.priority,run:i};if(this.size&&this._queue[this.size-1].priority>=s.priority){this._queue.push(o);return}let l=t.default(this._queue,o,(u,c)=>c.priority-u.priority);this._queue.splice(l,0,o)}dequeue(){let i=this._queue.shift();return i?.run}filter(i){return this._queue.filter(s=>s.priority===i.priority).map(s=>s.run)}get size(){return this._queue.length}}e.default=r}),Xy=it(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=UF(),r=zF(),n=HF(),i=a(()=>{},"G9"),s=new r.TimeoutError;class o extends t{static{a(this,"$A")}constructor(u){var c,d,f,g;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=i,this._resolveIdle=i,u=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:n.default},u),!(typeof u.intervalCap=="number"&&u.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(d=(c=u.intervalCap)===null||c===void 0?void 0:c.toString())!==null&&d!==void 0?d:""}\` (${typeof u.intervalCap})`);if(u.interval===void 0||!(Number.isFinite(u.interval)&&u.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(g=(f=u.interval)===null||f===void 0?void 0:f.toString())!==null&&g!==void 0?g:""}\` (${typeof u.interval})`);this._carryoverConcurrencyCount=u.carryoverConcurrencyCount,this._isIntervalIgnored=u.intervalCap===1/0||u.interval===0,this._intervalCap=u.intervalCap,this._interval=u.interval,this._queue=new u.queueClass,this._queueClass=u.queueClass,this.concurrency=u.concurrency,this._timeout=u.timeout,this._throwOnTimeout=u.throwOnTimeout===!0,this._isPaused=u.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=i,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=i,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){let u=Date.now();if(this._intervalId===void 0){let c=this._intervalEnd-u;if(c<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},c)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let u=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let c=this._queue.dequeue();return c?(this.emit("active"),c(),u&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(u){if(!(typeof u=="number"&&u>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${u}\` (${typeof u})`);this._concurrency=u,this._processQueue()}async add(u,c={}){return new Promise((d,f)=>{let g=a(async()=>{this._pendingCount++,this._intervalCount++;try{let m=this._timeout===void 0&&c.timeout===void 0?u():r.default(Promise.resolve(u()),c.timeout===void 0?this._timeout:c.timeout,()=>{(c.throwOnTimeout===void 0?this._throwOnTimeout:c.throwOnTimeout)&&f(s)});d(await m)}catch(m){f(m)}this._next()},"K");this._queue.enqueue(g,c),this._tryToStartAnother(),this.emit("add")})}async addAll(u,c){return Promise.all(u.map(async d=>this.add(d,c)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(u=>{let c=this._resolveEmpty;this._resolveEmpty=()=>{c(),u()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(u=>{let c=this._resolveIdle;this._resolveIdle=()=>{c(),u()}})}get size(){return this._queue.size}sizeBy(u){return this._queue.filter(u).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(u){this._timeout=u}}e.default=o}),gp=it((e,t)=>{var r=Number.MAX_SAFE_INTEGER||9007199254740991,n=["major","premajor","minor","preminor","patch","prepatch","prerelease"];t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:r,RELEASE_TYPES:n,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}),bp=it((e,t)=>{var r=typeof process=="object"&&Di&&Di.NODE_DEBUG&&/\bsemver\b/i.test(Di.NODE_DEBUG)?(...n)=>console.error("SEMVER",...n):()=>{};t.exports=r}),Xc=it((e,t)=>{var{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=gp(),s=bp();e=t.exports={};var o=e.re=[],l=e.safeRe=[],u=e.src=[],c=e.safeSrc=[],d=e.t={},f=0,g="[a-zA-Z0-9-]",m=[["\\s",1],["\\d",i],[g,n]],w=a(A=>{for(let[C,O]of m)A=A.split(`${C}*`).join(`${C}{0,${O}}`).split(`${C}+`).join(`${C}{1,${O}}`);return A},"OD"),E=a((A,C,O)=>{let R=w(C),P=f++;s(A,P,C),d[A]=P,u[P]=C,c[P]=R,o[P]=new RegExp(C,O?"g":void 0),l[P]=new RegExp(R,O?"g":void 0)},"v6");E("NUMERICIDENTIFIER","0|[1-9]\\d*"),E("NUMERICIDENTIFIERLOOSE","\\d+"),E("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),E("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),E("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),E("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),E("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),E("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),E("BUILDIDENTIFIER",`${g}+`),E("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),E("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),E("FULL",`^${u[d.FULLPLAIN]}$`),E("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),E("LOOSE",`^${u[d.LOOSEPLAIN]}$`),E("GTLT","((?:<|>)?=?)"),E("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),E("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),E("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),E("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),E("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),E("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),E("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),E("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),E("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`),E("COERCERTL",u[d.COERCE],!0),E("COERCERTLFULL",u[d.COERCEFULL],!0),E("LONETILDE","(?:~>?)"),E("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",E("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),E("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),E("LONECARET","(?:\\^)"),E("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",E("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),E("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),E("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),E("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),E("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",E("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),E("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),E("STAR","(<|>)?=?\\s*\\*"),E("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),E("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}),Jy=it((e,t)=>{var r=Object.freeze({loose:!0}),n=Object.freeze({}),i=a(s=>s?typeof s!="object"?r:s:n,"zD");t.exports=i}),QT=it((e,t)=>{var r=/^[0-9]+$/,n=a((s,o)=>{if(typeof s=="number"&&typeof o=="number")return s===o?0:s<o?-1:1;let l=r.test(s),u=r.test(o);return l&&u&&(s=+s,o=+o),s===o?0:l&&!u?-1:u&&!l?1:s<o?-1:1},"jA"),i=a((s,o)=>n(o,s),"JD");t.exports={compareIdentifiers:n,rcompareIdentifiers:i}}),Nn=it((e,t)=>{var r=bp(),{MAX_LENGTH:n,MAX_SAFE_INTEGER:i}=gp(),{safeRe:s,t:o}=Xc(),l=Jy(),{compareIdentifiers:u}=QT();class c{static{a(this,"g8")}constructor(f,g){if(g=l(g),f instanceof c){if(f.loose===!!g.loose&&f.includePrerelease===!!g.includePrerelease)return f;f=f.version}else if(typeof f!="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof f}".`);if(f.length>n)throw TypeError(`version is longer than ${n} characters`);r("SemVer",f,g),this.options=g,this.loose=!!g.loose,this.includePrerelease=!!g.includePrerelease;let m=f.trim().match(g.loose?s[o.LOOSE]:s[o.FULL]);if(!m)throw TypeError(`Invalid Version: ${f}`);if(this.raw=f,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>i||this.major<0)throw TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(w=>{if(/^[0-9]+$/.test(w)){let E=+w;if(E>=0&&E<i)return E}return w}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(f){if(r("SemVer.compare",this.version,this.options,f),!(f instanceof c)){if(typeof f=="string"&&f===this.version)return 0;f=new c(f,this.options)}return f.version===this.version?0:this.compareMain(f)||this.comparePre(f)}compareMain(f){return f instanceof c||(f=new c(f,this.options)),this.major<f.major?-1:this.major>f.major?1:this.minor<f.minor?-1:this.minor>f.minor?1:this.patch<f.patch?-1:this.patch>f.patch?1:0}comparePre(f){if(f instanceof c||(f=new c(f,this.options)),this.prerelease.length&&!f.prerelease.length)return-1;if(!this.prerelease.length&&f.prerelease.length)return 1;if(!this.prerelease.length&&!f.prerelease.length)return 0;let g=0;do{let m=this.prerelease[g],w=f.prerelease[g];if(r("prerelease compare",g,m,w),m===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(m===void 0)return-1;if(m===w)continue;return u(m,w)}while(++g)}compareBuild(f){f instanceof c||(f=new c(f,this.options));let g=0;do{let m=this.build[g],w=f.build[g];if(r("build compare",g,m,w),m===void 0&&w===void 0)return 0;if(w===void 0)return 1;if(m===void 0)return-1;if(m===w)continue;return u(m,w)}while(++g)}inc(f,g,m){if(f.startsWith("pre")){if(!g&&m===!1)throw Error("invalid increment argument: identifier is empty");if(g){let w=`-${g}`.match(this.options.loose?s[o.PRERELEASELOOSE]:s[o.PRERELEASE]);if(!w||w[1]!==g)throw Error(`invalid identifier: ${g}`)}}switch(f){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",g,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",g,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",g,m),this.inc("pre",g,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",g,m),this.inc("pre",g,m);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let w=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[w];else{let E=this.prerelease.length;for(;--E>=0;)typeof this.prerelease[E]=="number"&&(this.prerelease[E]++,E=-2);if(E===-1){if(g===this.prerelease.join(".")&&m===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(w)}}if(g){let E=[g,w];m===!1&&(E=[g]),u(this.prerelease[0],g)===0?isNaN(this.prerelease[1])&&(this.prerelease=E):this.prerelease=E}break}default:throw Error(`invalid increment argument: ${f}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}t.exports=c}),Dl=it((e,t)=>{var r=Nn(),n=a((i,s,o=!1)=>{if(i instanceof r)return i;try{return new r(i,s)}catch(l){if(!o)return null;throw l}},"HD");t.exports=n}),ZF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,s);return o?o.version:null},"wD");t.exports=n}),GF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i.trim().replace(/^[=v]+/,""),s);return o?o.version:null},"fD");t.exports=n}),VF=it((e,t)=>{var r=Nn(),n=a((i,s,o,l,u)=>{typeof o=="string"&&(u=l,l=o,o=void 0);try{return new r(i instanceof r?i.version:i,o).inc(s,l,u).version}catch{return null}},"XD");t.exports=n}),WF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,null,!0),l=r(s,null,!0),u=o.compare(l);if(u===0)return null;let c=u>0,d=c?o:l,f=c?l:o,g=!!d.prerelease.length;if(f.prerelease.length&&!g){if(!f.patch&&!f.minor)return"major";if(f.compareMain(d)===0)return f.minor&&!f.patch?"minor":"patch"}let m=g?"pre":"";return o.major!==l.major?m+"major":o.minor!==l.minor?m+"minor":o.patch!==l.patch?m+"patch":"prerelease"},"AD");t.exports=n}),YF=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).major,"GD");t.exports=n}),QF=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).minor,"SD");t.exports=n}),$F=it((e,t)=>{var r=Nn(),n=a((i,s)=>new r(i,s).patch,"ND");t.exports=n}),XF=it((e,t)=>{var r=Dl(),n=a((i,s)=>{let o=r(i,s);return o&&o.prerelease.length?o.prerelease:null},"ED");t.exports=n}),Vi=it((e,t)=>{var r=Nn(),n=a((i,s,o)=>new r(i,o).compare(new r(s,o)),"RD");t.exports=n}),JF=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(s,i,o),"hD");t.exports=n}),KF=it((e,t)=>{var r=Vi(),n=a((i,s)=>r(i,s,!0),"LD");t.exports=n}),Ky=it((e,t)=>{var r=Nn(),n=a((i,s,o)=>{let l=new r(i,o),u=new r(s,o);return l.compare(u)||l.compareBuild(u)},"gD");t.exports=n}),qF=it((e,t)=>{var r=Ky(),n=a((i,s)=>i.sort((o,l)=>r(o,l,s)),"yD");t.exports=n}),e8=it((e,t)=>{var r=Ky(),n=a((i,s)=>i.sort((o,l)=>r(l,o,s)),"xD");t.exports=n}),vp=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)>0,"cD");t.exports=n}),qy=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)<0,"dD");t.exports=n}),$T=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)===0,"rD");t.exports=n}),XT=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)!==0,"nD");t.exports=n}),ew=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)>=0,"BD");t.exports=n}),tw=it((e,t)=>{var r=Vi(),n=a((i,s,o)=>r(i,s,o)<=0,"tD");t.exports=n}),JT=it((e,t)=>{var r=$T(),n=XT(),i=vp(),s=ew(),o=qy(),l=tw(),u=a((c,d,f,g)=>{switch(d){case"===":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c===f;case"!==":return typeof c=="object"&&(c=c.version),typeof f=="object"&&(f=f.version),c!==f;case"":case"=":case"==":return r(c,f,g);case"!=":return n(c,f,g);case">":return i(c,f,g);case">=":return s(c,f,g);case"<":return o(c,f,g);case"<=":return l(c,f,g);default:throw TypeError(`Invalid operator: ${d}`)}},"qL");t.exports=u}),t8=it((e,t)=>{var r=Nn(),n=Dl(),{safeRe:i,t:s}=Xc(),o=a((l,u)=>{if(l instanceof r)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;u=u||{};let c=null;if(!u.rtl)c=l.match(u.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);else{let E=u.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL],A;for(;(A=E.exec(l))&&(!c||c.index+c[0].length!==l.length);)(!c||A.index+A[0].length!==c.index+c[0].length)&&(c=A),E.lastIndex=A.index+A[1].length+A[2].length;E.lastIndex=-1}if(c===null)return null;let d=c[2],f=c[3]||"0",g=c[4]||"0",m=u.includePrerelease&&c[5]?`-${c[5]}`:"",w=u.includePrerelease&&c[6]?`+${c[6]}`:"";return n(`${d}.${f}.${g}${m}${w}`,u)},"PL");t.exports=o}),r8=it((e,t)=>{class r{static{a(this,"eA")}constructor(){this.max=1e3,this.map=new Map}get(i){let s=this.map.get(i);if(s!==void 0)return this.map.delete(i),this.map.set(i,s),s}delete(i){return this.map.delete(i)}set(i,s){if(!this.delete(i)&&s!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(i,s)}return this}}t.exports=r}),Wi=it((e,t)=>{var r=/\s+/g;class n{static{a(this,"q1")}constructor(N,T){if(T=o(T),N instanceof n)return N.loose===!!T.loose&&N.includePrerelease===!!T.includePrerelease?N:new n(N.raw,T);if(N instanceof l)return this.raw=N.value,this.set=[[N]],this.formatted=void 0,this;if(this.options=T,this.loose=!!T.loose,this.includePrerelease=!!T.includePrerelease,this.raw=N.trim().replace(r," "),this.set=this.raw.split("||").map(k=>this.parseRange(k.trim())).filter(k=>k.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let k=this.set[0];if(this.set=this.set.filter(p=>!C(p[0])),this.set.length===0)this.set=[k];else if(this.set.length>1){for(let p of this.set)if(p.length===1&&O(p[0])){this.set=[p];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let N=0;N<this.set.length;N++){N>0&&(this.formatted+="||");let T=this.set[N];for(let k=0;k<T.length;k++)k>0&&(this.formatted+=" "),this.formatted+=T[k].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(N){let T=((this.options.includePrerelease&&E)|(this.options.loose&&A))+":"+N,k=s.get(T);if(k)return k;let p=this.options.loose,S=p?d[f.HYPHENRANGELOOSE]:d[f.HYPHENRANGE];N=N.replace(S,b(this.options.includePrerelease)),u("hyphen replace",N),N=N.replace(d[f.COMPARATORTRIM],g),u("comparator trim",N),N=N.replace(d[f.TILDETRIM],m),u("tilde trim",N),N=N.replace(d[f.CARETTRIM],w),u("caret trim",N);let I=N.split(" ").map(H=>P(H,this.options)).join(" ").split(/\s+/).map(H=>y(H,this.options));p&&(I=I.filter(H=>(u("loose invalid filter",H,this.options),!!H.match(d[f.COMPARATORLOOSE])))),u("range list",I);let M=new Map,U=I.map(H=>new l(H,this.options));for(let H of U){if(C(H))return[H];M.set(H.value,H)}M.size>1&&M.has("")&&M.delete("");let B=[...M.values()];return s.set(T,B),B}intersects(N,T){if(!(N instanceof n))throw TypeError("a Range is required");return this.set.some(k=>R(k,T)&&N.set.some(p=>R(p,T)&&k.every(S=>p.every(I=>S.intersects(I,T)))))}test(N){if(!N)return!1;if(typeof N=="string")try{N=new c(N,this.options)}catch{return!1}for(let T=0;T<this.set.length;T++)if(x(this.set[T],N,this.options))return!0;return!1}}t.exports=n;var i=r8(),s=new i,o=Jy(),l=yp(),u=bp(),c=Nn(),{safeRe:d,t:f,comparatorTrimReplace:g,tildeTrimReplace:m,caretTrimReplace:w}=Xc(),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:A}=gp(),C=a(_=>_.value==="<0.0.0-0","_k"),O=a(_=>_.value==="","wL"),R=a((_,N)=>{let T=!0,k=_.slice(),p=k.pop();for(;T&&k.length;)T=k.every(S=>p.intersects(S,N)),p=k.pop();return T},"Kk"),P=a((_,N)=>(_=_.replace(d[f.BUILD],""),u("comp",_,N),_=Z(_,N),u("caret",_),_=j(_,N),u("tildes",_),_=z(_,N),u("xrange",_),_=h(_,N),u("stars",_),_),"ZL"),L=a(_=>!_||_.toLowerCase()==="x"||_==="*","pq"),j=a((_,N)=>_.trim().split(/\s+/).map(T=>G(T,N)).join(" "),"fL"),G=a((_,N)=>{let T=N.loose?d[f.TILDELOOSE]:d[f.TILDE];return _.replace(T,(k,p,S,I,M)=>{u("tilde",_,k,p,S,I,M);let U;return L(p)?U="":L(S)?U=`>=${p}.0.0 <${+p+1}.0.0-0`:L(I)?U=`>=${p}.${S}.0 <${p}.${+S+1}.0-0`:M?(u("replaceTilde pr",M),U=`>=${p}.${S}.${I}-${M} <${p}.${+S+1}.0-0`):U=`>=${p}.${S}.${I} <${p}.${+S+1}.0-0`,u("tilde return",U),U})},"XL"),Z=a((_,N)=>_.trim().split(/\s+/).map(T=>K(T,N)).join(" "),"AL"),K=a((_,N)=>{u("caret",_,N);let T=N.loose?d[f.CARETLOOSE]:d[f.CARET],k=N.includePrerelease?"-0":"";return _.replace(T,(p,S,I,M,U)=>{u("caret",_,p,S,I,M,U);let B;return L(S)?B="":L(I)?B=`>=${S}.0.0${k} <${+S+1}.0.0-0`:L(M)?S==="0"?B=`>=${S}.${I}.0${k} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.0${k} <${+S+1}.0.0-0`:U?(u("replaceCaret pr",U),S==="0"?I==="0"?B=`>=${S}.${I}.${M}-${U} <${S}.${I}.${+M+1}-0`:B=`>=${S}.${I}.${M}-${U} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.${M}-${U} <${+S+1}.0.0-0`):(u("no pr"),S==="0"?I==="0"?B=`>=${S}.${I}.${M}${k} <${S}.${I}.${+M+1}-0`:B=`>=${S}.${I}.${M}${k} <${S}.${+I+1}.0-0`:B=`>=${S}.${I}.${M} <${+S+1}.0.0-0`),u("caret return",B),B})},"kL"),z=a((_,N)=>(u("replaceXRanges",_,N),_.split(/\s+/).map(T=>V(T,N)).join(" ")),"GL"),V=a((_,N)=>{_=_.trim();let T=N.loose?d[f.XRANGELOOSE]:d[f.XRANGE];return _.replace(T,(k,p,S,I,M,U)=>{u("xRange",_,k,p,S,I,M,U);let B=L(S),H=B||L(I),$=H||L(M),ae=$;return p==="="&&ae&&(p=""),U=N.includePrerelease?"-0":"",B?p===">"||p==="<"?k="<0.0.0-0":k="*":p&&ae?(H&&(I=0),M=0,p===">"?(p=">=",H?(S=+S+1,I=0,M=0):(I=+I+1,M=0)):p==="<="&&(p="<",H?S=+S+1:I=+I+1),p==="<"&&(U="-0"),k=`${p+S}.${I}.${M}${U}`):H?k=`>=${S}.0.0${U} <${+S+1}.0.0-0`:$&&(k=`>=${S}.${I}.0${U} <${S}.${+I+1}.0-0`),u("xRange return",k),k})},"VL"),h=a((_,N)=>(u("replaceStars",_,N),_.trim().replace(d[f.STAR],"")),"SL"),y=a((_,N)=>(u("replaceGTE0",_,N),_.trim().replace(d[N.includePrerelease?f.GTE0PRE:f.GTE0],"")),"ML"),b=a(_=>(N,T,k,p,S,I,M,U,B,H,$,ae)=>(L(k)?T="":L(p)?T=`>=${k}.0.0${_?"-0":""}`:L(S)?T=`>=${k}.${p}.0${_?"-0":""}`:I?T=`>=${T}`:T=`>=${T}${_?"-0":""}`,L(B)?U="":L(H)?U=`<${+B+1}.0.0-0`:L($)?U=`<${B}.${+H+1}.0-0`:ae?U=`<=${B}.${H}.${$}-${ae}`:_?U=`<${B}.${H}.${+$+1}-0`:U=`<=${U}`,`${T} ${U}`.trim()),"NL"),x=a((_,N,T)=>{for(let k=0;k<_.length;k++)if(!_[k].test(N))return!1;if(N.prerelease.length&&!T.includePrerelease){for(let k=0;k<_.length;k++)if(u(_[k].semver),_[k].semver!==l.ANY&&_[k].semver.prerelease.length>0){let p=_[k].semver;if(p.major===N.major&&p.minor===N.minor&&p.patch===N.patch)return!0}return!1}return!0},"CL")}),yp=it((e,t)=>{var r=Symbol("SemVer ANY");class n{static{a(this,"u9")}static get ANY(){return r}constructor(g,m){if(m=i(m),g instanceof n){if(g.loose===!!m.loose)return g;g=g.value}g=g.trim().split(/\s+/).join(" "),u("comparator",g,m),this.options=m,this.loose=!!m.loose,this.parse(g),this.semver===r?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(g){let m=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],w=g.match(m);if(!w)throw TypeError(`Invalid comparator: ${g}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new c(w[2],this.options.loose):this.semver=r}toString(){return this.value}test(g){if(u("Comparator.test",g,this.options.loose),this.semver===r||g===r)return!0;if(typeof g=="string")try{g=new c(g,this.options)}catch{return!1}return l(g,this.operator,this.semver,this.options)}intersects(g,m){if(!(g instanceof n))throw TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(g.value,m).test(this.value):g.operator===""?g.value===""?!0:new d(this.value,m).test(g.semver):(m=i(m),m.includePrerelease&&(this.value==="<0.0.0-0"||g.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||g.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&g.operator.startsWith(">")||this.operator.startsWith("<")&&g.operator.startsWith("<")||this.semver.version===g.semver.version&&this.operator.includes("=")&&g.operator.includes("=")||l(this.semver,"<",g.semver,m)&&this.operator.startsWith(">")&&g.operator.startsWith("<")||l(this.semver,">",g.semver,m)&&this.operator.startsWith("<")&&g.operator.startsWith(">")))}}t.exports=n;var i=Jy(),{safeRe:s,t:o}=Xc(),l=JT(),u=bp(),c=Nn(),d=Wi()}),wp=it((e,t)=>{var r=Wi(),n=a((i,s,o)=>{try{s=new r(s,o)}catch{return!1}return s.test(i)},"RL");t.exports=n}),n8=it((e,t)=>{var r=Wi(),n=a((i,s)=>new r(i,s).set.map(o=>o.map(l=>l.value).join(" ").trim().split(" ")),"hL");t.exports=n}),i8=it((e,t)=>{var r=Nn(),n=Wi(),i=a((s,o,l)=>{let u=null,c=null,d=null;try{d=new n(o,l)}catch{return null}return s.forEach(f=>{d.test(f)&&(!u||c.compare(f)===-1)&&(u=f,c=new r(u,l))}),u},"gL");t.exports=i}),a8=it((e,t)=>{var r=Nn(),n=Wi(),i=a((s,o,l)=>{let u=null,c=null,d=null;try{d=new n(o,l)}catch{return null}return s.forEach(f=>{d.test(f)&&(!u||c.compare(f)===1)&&(u=f,c=new r(u,l))}),u},"uL");t.exports=i}),s8=it((e,t)=>{var r=Nn(),n=Wi(),i=vp(),s=a((o,l)=>{o=new n(o,l);let u=new r("0.0.0");if(o.test(u)||(u=new r("0.0.0-0"),o.test(u)))return u;u=null;for(let c=0;c<o.set.length;++c){let d=o.set[c],f=null;d.forEach(g=>{let m=new r(g.semver.version);switch(g.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!f||i(m,f))&&(f=m);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${g.operator}`)}}),f&&(!u||i(u,f))&&(u=f)}return u&&o.test(u)?u:null},"pL");t.exports=s}),o8=it((e,t)=>{var r=Wi(),n=a((i,s)=>{try{return new r(i,s).range||"*"}catch{return null}},"mL");t.exports=n}),rw=it((e,t)=>{var r=Nn(),n=yp(),{ANY:i}=n,s=Wi(),o=wp(),l=vp(),u=qy(),c=tw(),d=ew(),f=a((g,m,w,E)=>{g=new r(g,E),m=new s(m,E);let A,C,O,R,P;switch(w){case">":A=l,C=c,O=u,R=">",P=">=";break;case"<":A=u,C=d,O=l,R="<",P="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(o(g,m,E))return!1;for(let L=0;L<m.set.length;++L){let j=m.set[L],G=null,Z=null;if(j.forEach(K=>{K.semver===i&&(K=new n(">=0.0.0")),G=G||K,Z=Z||K,A(K.semver,G.semver,E)?G=K:O(K.semver,Z.semver,E)&&(Z=K)}),G.operator===R||G.operator===P||(!Z.operator||Z.operator===R)&&C(g,Z.semver))return!1;if(Z.operator===P&&O(g,Z.semver))return!1}return!0},"BL");t.exports=f}),l8=it((e,t)=>{var r=rw(),n=a((i,s,o)=>r(i,s,">",o),"tL");t.exports=n}),u8=it((e,t)=>{var r=rw(),n=a((i,s,o)=>r(i,s,"<",o),"QL");t.exports=n}),c8=it((e,t)=>{var r=Wi(),n=a((i,s,o)=>(i=new r(i,o),s=new r(s,o),i.intersects(s,o)),"aL");t.exports=n}),d8=it((e,t)=>{var r=wp(),n=Vi();t.exports=(i,s,o)=>{let l=[],u=null,c=null,d=i.sort((w,E)=>n(w,E,o));for(let w of d)r(w,s,o)?(c=w,!u&&(u=w)):(c&&l.push([u,c]),c=null,u=null);u&&l.push([u,null]);let f=[];for(let[w,E]of l)w===E?f.push(w):!E&&w===d[0]?f.push("*"):E?w===d[0]?f.push(`<=${E}`):f.push(`${w} - ${E}`):f.push(`>=${w}`);let g=f.join(" || "),m=typeof s.raw=="string"?s.raw:String(s);return g.length<m.length?g:s}}),f8=it((e,t)=>{var r=Wi(),n=yp(),{ANY:i}=n,s=wp(),o=Vi(),l=a((m,w,E={})=>{if(m===w)return!0;m=new r(m,E),w=new r(w,E);let A=!1;e:for(let C of m.set){for(let O of w.set){let R=d(C,O,E);if(A=A||R!==null,R)continue e}if(A)return!1}return!0},"$g"),u=[new n(">=0.0.0-0")],c=[new n(">=0.0.0")],d=a((m,w,E)=>{if(m===w)return!0;if(m.length===1&&m[0].semver===i){if(w.length===1&&w[0].semver===i)return!0;E.includePrerelease?m=u:m=c}if(w.length===1&&w[0].semver===i){if(E.includePrerelease)return!0;w=c}let A=new Set,C,O;for(let z of m)z.operator===">"||z.operator===">="?C=f(C,z,E):z.operator==="<"||z.operator==="<="?O=g(O,z,E):A.add(z.semver);if(A.size>1)return null;let R;if(C&&O){if(R=o(C.semver,O.semver,E),R>0)return null;if(R===0&&(C.operator!==">="||O.operator!=="<="))return null}for(let z of A){if(C&&!s(z,String(C),E)||O&&!s(z,String(O),E))return null;for(let V of w)if(!s(z,String(V),E))return!1;return!0}let P,L,j,G,Z=O&&!E.includePrerelease&&O.semver.prerelease.length?O.semver:!1,K=C&&!E.includePrerelease&&C.semver.prerelease.length?C.semver:!1;Z&&Z.prerelease.length===1&&O.operator==="<"&&Z.prerelease[0]===0&&(Z=!1);for(let z of w){if(G=G||z.operator===">"||z.operator===">=",j=j||z.operator==="<"||z.operator==="<=",C){if(K&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===K.major&&z.semver.minor===K.minor&&z.semver.patch===K.patch&&(K=!1),z.operator===">"||z.operator===">="){if(P=f(C,z,E),P===z&&P!==C)return!1}else if(C.operator===">="&&!s(C.semver,String(z),E))return!1}if(O){if(Z&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===Z.major&&z.semver.minor===Z.minor&&z.semver.patch===Z.patch&&(Z=!1),z.operator==="<"||z.operator==="<="){if(L=g(O,z,E),L===z&&L!==O)return!1}else if(O.operator==="<="&&!s(O.semver,String(z),E))return!1}if(!z.operator&&(O||C)&&R!==0)return!1}return!(C&&j&&!O&&R!==0||O&&G&&!C&&R!==0||K||Z)},"_g"),f=a((m,w,E)=>{if(!m)return w;let A=o(m.semver,w.semver,E);return A>0?m:A<0||w.operator===">"&&m.operator===">="?w:m},"ck"),g=a((m,w,E)=>{if(!m)return w;let A=o(m.semver,w.semver,E);return A<0?m:A>0||w.operator==="<"&&m.operator==="<="?w:m},"mk");t.exports=l}),h8=it((e,t)=>{var r=Xc(),n=gp(),i=Nn(),s=QT(),o=Dl(),l=ZF(),u=GF(),c=VF(),d=WF(),f=YF(),g=QF(),m=$F(),w=XF(),E=Vi(),A=JF(),C=KF(),O=Ky(),R=qF(),P=e8(),L=vp(),j=qy(),G=$T(),Z=XT(),K=ew(),z=tw(),V=JT(),h=t8(),y=yp(),b=Wi(),x=wp(),_=n8(),N=i8(),T=a8(),k=s8(),p=o8(),S=rw(),I=l8(),M=u8(),U=c8(),B=d8(),H=f8();t.exports={parse:o,valid:l,clean:u,inc:c,diff:d,major:f,minor:g,patch:m,prerelease:w,compare:E,rcompare:A,compareLoose:C,compareBuild:O,sort:R,rsort:P,gt:L,lt:j,eq:G,neq:Z,gte:K,lte:z,cmp:V,coerce:h,Comparator:y,Range:b,satisfies:x,toComparators:_,maxSatisfying:N,minSatisfying:T,minVersion:k,validRange:p,outside:S,gtr:I,ltr:M,intersects:U,simplifyRange:B,subset:H,SemVer:i,re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}}),p8=it((e,t)=>{var r=a((s=0)=>o=>`\x1B[${38+s};5;${o}m`,"WG"),n=a((s=0)=>(o,l,u)=>`\x1B[${38+s};2;${o};${l};${u}m`,"HG");function i(){let s=new Map,o={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};o.color.gray=o.color.blackBright,o.bgColor.bgGray=o.bgColor.bgBlackBright,o.color.grey=o.color.blackBright,o.bgColor.bgGrey=o.bgColor.bgBlackBright;for(let[l,u]of Object.entries(o)){for(let[c,d]of Object.entries(u))o[c]={open:`\x1B[${d[0]}m`,close:`\x1B[${d[1]}m`},u[c]=o[c],s.set(d[0],d[1]);Object.defineProperty(o,l,{value:u,enumerable:!1})}return Object.defineProperty(o,"codes",{value:s,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi256=r(),o.color.ansi16m=n(),o.bgColor.ansi256=r(10),o.bgColor.ansi16m=n(10),Object.defineProperties(o,{rgbToAnsi256:{value:a((l,u,c)=>l===u&&u===c?l<8?16:l>248?231:Math.round((l-8)/247*24)+232:16+36*Math.round(l/255*5)+6*Math.round(u/255*5)+Math.round(c/255*5),"value"),enumerable:!1},hexToRgb:{value:a(l=>{let u=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(l.toString(16));if(!u)return[0,0,0];let{colorString:c}=u.groups;c.length===3&&(c=c.split("").map(f=>f+f).join(""));let d=Number.parseInt(c,16);return[d>>16&255,d>>8&255,d&255]},"value"),enumerable:!1},hexToAnsi256:{value:a(l=>o.rgbToAnsi256(...o.hexToRgb(l)),"value"),enumerable:!1}}),o}a(i,"Jb"),Object.defineProperty(t,"exports",{enumerable:!0,get:i})}),m8=it(e=>{e.byteLength=u,e.toByteArray=d,e.fromByteArray=m;var t=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(s=0,o=i.length;s<o;++s)t[s]=i[s],r[i.charCodeAt(s)]=s;var s,o;r[45]=62,r[95]=63;function l(w){var E=w.length;if(E%4>0)throw Error("Invalid string. Length must be a multiple of 4");var A=w.indexOf("=");A===-1&&(A=E);var C=A===E?0:4-A%4;return[A,C]}a(l,"eV");function u(w){var E=l(w),A=E[0],C=E[1];return(A+C)*3/4-C}a(u,"hc");function c(w,E,A){return(E+A)*3/4-A}a(c,"Dc");function d(w){var E,A=l(w),C=A[0],O=A[1],R=new n(c(w,C,O)),P=0,L=O>0?C-4:C,j;for(j=0;j<L;j+=4)E=r[w.charCodeAt(j)]<<18|r[w.charCodeAt(j+1)]<<12|r[w.charCodeAt(j+2)]<<6|r[w.charCodeAt(j+3)],R[P++]=E>>16&255,R[P++]=E>>8&255,R[P++]=E&255;return O===2&&(E=r[w.charCodeAt(j)]<<2|r[w.charCodeAt(j+1)]>>4,R[P++]=E&255),O===1&&(E=r[w.charCodeAt(j)]<<10|r[w.charCodeAt(j+1)]<<4|r[w.charCodeAt(j+2)]>>2,R[P++]=E>>8&255,R[P++]=E&255),R}a(d,"Lc");function f(w){return t[w>>18&63]+t[w>>12&63]+t[w>>6&63]+t[w&63]}a(f,"gc");function g(w,E,A){for(var C,O=[],R=E;R<A;R+=3)C=(w[R]<<16&16711680)+(w[R+1]<<8&65280)+(w[R+2]&255),O.push(f(C));return O.join("")}a(g,"bc");function m(w){for(var E,A=w.length,C=A%3,O=[],R=16383,P=0,L=A-C;P<L;P+=R)O.push(g(w,P,P+R>L?L:P+R));return C===1?(E=w[A-1],O.push(t[E>>2]+t[E<<4&63]+"==")):C===2&&(E=(w[A-2]<<8)+w[A-1],O.push(t[E>>10]+t[E>>4&63]+t[E<<2&63]+"=")),O.join("")}a(m,"yc")}),Zn=it(e=>{e.__esModule=!0,e.extend=s,e.indexOf=c,e.escapeExpression=d,e.isEmpty=f,e.createFrame=g,e.blockParams=m,e.appendContextPath=w;var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},r=/[&<>"'`=]/g,n=/[&<>"'`=]/;function i(E){return t[E]}a(i,"ac");function s(E){for(var A=1;A<arguments.length;A++)for(var C in arguments[A])Object.prototype.hasOwnProperty.call(arguments[A],C)&&(E[C]=arguments[A][C]);return E}a(s,"_0");var o=Object.prototype.toString;e.toString=o;var l=a(function(E){return typeof E=="function"},"aW");l(/x/)&&(e.isFunction=l=a(function(E){return typeof E=="function"&&o.call(E)==="[object Function]"},"aW")),e.isFunction=l;var u=Array.isArray||function(E){return E&&typeof E=="object"?o.call(E)==="[object Array]":!1};e.isArray=u;function c(E,A){for(var C=0,O=E.length;C<O;C++)if(E[C]===A)return C;return-1}a(c,"ec");function d(E){if(typeof E!="string"){if(E&&E.toHTML)return E.toHTML();if(E==null)return"";if(!E)return E+"";E=""+E}return n.test(E)?E.replace(r,i):E}a(d,"sc");function f(E){return!E&&E!==0?!0:!!(u(E)&&E.length===0)}a(f,"$m");function g(E){var A=s({},E);return A._parent=E,A}a(g,"qm");function m(E,A){return E.path=A,E}a(m,"_m");function w(E,A){return(E?E+".":"")+A}a(w,"Km")}),Yi=it((e,t)=>{e.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(i,s){var o=s&&s.loc,l=void 0,u=void 0,c=void 0,d=void 0;o&&(l=o.start.line,u=o.end.line,c=o.start.column,d=o.end.column,i+=" - "+l+":"+c);for(var f=Error.prototype.constructor.call(this,i),g=0;g<r.length;g++)this[r[g]]=f[r[g]];Error.captureStackTrace&&Error.captureStackTrace(this,n);try{o&&(this.lineNumber=l,this.endLineNumber=u,Object.defineProperty?(Object.defineProperty(this,"column",{value:c,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:d,enumerable:!0})):(this.column=c,this.endColumn=d))}catch{}}a(n,"$H"),n.prototype=Error(),e.default=n,t.exports=e.default}),g8=it((e,t)=>{e.__esModule=!0;var r=Zn();e.default=function(n){n.registerHelper("blockHelperMissing",function(i,s){var{inverse:o,fn:l}=s;if(i===!0)return l(this);if(i===!1||i==null)return o(this);if(r.isArray(i))return i.length>0?(s.ids&&(s.ids=[s.name]),n.helpers.each(i,s)):o(this);if(s.data&&s.ids){var u=r.createFrame(s.data);u.contextPath=r.appendContextPath(s.data.contextPath,s.name),s={data:u}}return l(i,s)})},t.exports=e.default}),b8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"Gm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("each",function(l,u){if(!u)throw new s.default("Must pass iterator to #each");var{fn:c,inverse:d}=u,f=0,g="",m=void 0,w=void 0;u.data&&u.ids&&(w=n.appendContextPath(u.data.contextPath,u.ids[0])+"."),n.isFunction(l)&&(l=l.call(this)),u.data&&(m=n.createFrame(u.data));function E(P,L,j){m&&(m.key=P,m.index=L,m.first=L===0,m.last=!!j,w&&(m.contextPath=w+P)),g=g+c(l[P],{data:m,blockParams:n.blockParams([l[P],P],[w+P,null])})}if(a(E,"T"),l&&typeof l=="object")if(n.isArray(l))for(var A=l.length;f<A;f++)f in l&&E(f,f,f===l.length-1);else if(typeof Symbol=="function"&&l[Symbol.iterator]){for(var C=[],O=l[Symbol.iterator](),R=O.next();!R.done;R=O.next())C.push(R.value);l=C;for(var A=l.length;f<A;f++)E(f,f,f===l.length-1)}else(function(){var P=void 0;Object.keys(l).forEach(function(L){P!==void 0&&E(P,f-1),P=L,f++}),P!==void 0&&E(P,f-1,!0)})();return f===0&&(g=d(this)),g})},t.exports=e.default}),v8=it((e,t)=>{e.__esModule=!0;function r(s){return s&&s.__esModule?s:{default:s}}a(r,"Cm");var n=Yi(),i=r(n);e.default=function(s){s.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default}),y8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"Dm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("if",function(l,u){if(arguments.length!=2)throw new s.default("#if requires exactly one argument");return n.isFunction(l)&&(l=l.call(this)),!u.hash.includeZero&&!l||n.isEmpty(l)?u.inverse(this):u.fn(this)}),o.registerHelper("unless",function(l,u){if(arguments.length!=2)throw new s.default("#unless requires exactly one argument");return o.helpers.if.call(this,l,{fn:u.inverse,inverse:u.fn,hash:u.hash})})},t.exports=e.default}),w8=it((e,t)=>{e.__esModule=!0,e.default=function(r){r.registerHelper("log",function(){for(var n=[void 0],i=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)n.push(arguments[s]);var o=1;i.hash.level!=null?o=i.hash.level:i.data&&i.data.level!=null&&(o=i.data.level),n[0]=o,r.log.apply(r,n)})},t.exports=e.default}),x8=it((e,t)=>{e.__esModule=!0,e.default=function(r){r.registerHelper("lookup",function(n,i,s){return n&&s.lookupProperty(n,i)})},t.exports=e.default}),_8=it((e,t)=>{e.__esModule=!0;function r(o){return o&&o.__esModule?o:{default:o}}a(r,"cm");var n=Zn(),i=Yi(),s=r(i);e.default=function(o){o.registerHelper("with",function(l,u){if(arguments.length!=2)throw new s.default("#with requires exactly one argument");n.isFunction(l)&&(l=l.call(this));var c=u.fn;if(n.isEmpty(l))return u.inverse(this);var d=u.data;return u.data&&u.ids&&(d=n.createFrame(u.data),d.contextPath=n.appendContextPath(u.data.contextPath,u.ids[0])),c(l,{data:d,blockParams:n.blockParams([l],[d&&d.contextPath])})})},t.exports=e.default}),KT=it(e=>{e.__esModule=!0,e.registerDefaultHelpers=A,e.moveHelperToHooks=C;function t(O){return O&&O.__esModule?O:{default:O}}a(t,"oK");var r=g8(),n=t(r),i=b8(),s=t(i),o=v8(),l=t(o),u=y8(),c=t(u),d=w8(),f=t(d),g=x8(),m=t(g),w=_8(),E=t(w);function A(O){n.default(O),s.default(O),l.default(O),c.default(O),f.default(O),m.default(O),E.default(O)}a(A,"Kd");function C(O,R,P){O.helpers[R]&&(O.hooks[R]=O.helpers[R],!P&&delete O.helpers[R])}a(C,"Pd")}),E8=it((e,t)=>{e.__esModule=!0;var r=Zn();e.default=function(n){n.registerDecorator("inline",function(i,s,o,l){var u=i;return s.partials||(s.partials={},u=a(function(c,d){var f=o.partials;o.partials=r.extend({},f,s.partials);var g=i(c,d);return o.partials=f,g},"O")),s.partials[l.args[0]]=l.fn,u})},t.exports=e.default}),S8=it(e=>{e.__esModule=!0,e.registerDefaultDecorators=i;function t(s){return s&&s.__esModule?s:{default:s}}a(t,"Hd");var r=E8(),n=t(r);function i(s){n.default(s)}a(i,"Zd")}),qT=it((e,t)=>{e.__esModule=!0;var r=Zn(),n={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:a(function(i){if(typeof i=="string"){var s=r.indexOf(n.methodMap,i.toLowerCase());s>=0?i=s:i=parseInt(i,10)}return i},"lookupLevel"),log:a(function(i){if(i=n.lookupLevel(i),typeof console<"u"&&n.lookupLevel(n.level)<=i){var s=n.methodMap[i];console[s]||(s="log");for(var o=arguments.length,l=Array(o>1?o-1:0),u=1;u<o;u++)l[u-1]=arguments[u];console[s].apply(console,l)}},"log")};e.default=n,t.exports=e.default}),k8=it(e=>{e.__esModule=!0,e.createNewLookupObject=r;var t=Zn();function r(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];return t.extend.apply(void 0,[Object.create(null)].concat(i))}a(r,"Md")}),eN=it(e=>{e.__esModule=!0,e.createProtoAccessControl=o,e.resultIsAllowed=l,e.resetLoggedProperties=d;function t(f){return f&&f.__esModule?f:{default:f}}a(t,"Rd");var r=k8(),n=qT(),i=t(n),s=Object.create(null);function o(f){var g=Object.create(null);g.constructor=!1,g.__defineGetter__=!1,g.__defineSetter__=!1,g.__lookupGetter__=!1;var m=Object.create(null);return m.__proto__=!1,{properties:{whitelist:r.createNewLookupObject(m,f.allowedProtoProperties),defaultValue:f.allowProtoPropertiesByDefault},methods:{whitelist:r.createNewLookupObject(g,f.allowedProtoMethods),defaultValue:f.allowProtoMethodsByDefault}}}a(o,"Dd");function l(f,g,m){return u(typeof f=="function"?g.methods:g.properties,m)}a(l,"Ld");function u(f,g){return f.whitelist[g]!==void 0?f.whitelist[g]===!0:f.defaultValue!==void 0?f.defaultValue:(c(g),!1)}a(u,"p0");function c(f){s[f]!==!0&&(s[f]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+f+`" because it is not an "own property" of its parent.
3
3
  You can add a runtime option to disable the check or this warning:
4
4
  See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}a(c,"gd");function d(){Object.keys(s).forEach(function(f){delete s[f]})}a(d,"bd")}),nw=it(e=>{e.__esModule=!0,e.HandlebarsEnvironment=E;function t(C){return C&&C.__esModule?C:{default:C}}a(t,"c0");var r=Zn(),n=Yi(),i=t(n),s=KT(),o=S8(),l=qT(),u=t(l),c=eN(),d="4.7.8";e.VERSION=d;var f=8;e.COMPILER_REVISION=f;var g=7;e.LAST_COMPATIBLE_COMPILER_REVISION=g;var m={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};e.REVISION_CHANGES=m;var w="[object Object]";function E(C,O,R){this.helpers=C||{},this.partials=O||{},this.decorators=R||{},s.registerDefaultHelpers(this),o.registerDefaultDecorators(this)}a(E,"jH"),E.prototype={constructor:E,logger:u.default,log:u.default.log,registerHelper:a(function(C,O){if(r.toString.call(C)===w){if(O)throw new i.default("Arg not supported with multiple helpers");r.extend(this.helpers,C)}else this.helpers[C]=O},"registerHelper"),unregisterHelper:a(function(C){delete this.helpers[C]},"unregisterHelper"),registerPartial:a(function(C,O){if(r.toString.call(C)===w)r.extend(this.partials,C);else{if(typeof O>"u")throw new i.default('Attempting to register a partial called "'+C+'" as undefined');this.partials[C]=O}},"registerPartial"),unregisterPartial:a(function(C){delete this.partials[C]},"unregisterPartial"),registerDecorator:a(function(C,O){if(r.toString.call(C)===w){if(O)throw new i.default("Arg not supported with multiple decorators");r.extend(this.decorators,C)}else this.decorators[C]=O},"registerDecorator"),unregisterDecorator:a(function(C){delete this.decorators[C]},"unregisterDecorator"),resetLoggedPropertyAccesses:a(function(){c.resetLoggedProperties()},"resetLoggedPropertyAccesses")};var A=u.default.log;e.log=A,e.createFrame=r.createFrame,e.logger=u.default}),A8=it((e,t)=>{e.__esModule=!0;function r(n){this.string=n}a(r,"vH"),r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},e.default=r,t.exports=e.default}),T8=it(e=>{e.__esModule=!0,e.wrapHelper=t;function t(r,n){if(typeof r!="function")return r;var i=a(function(){var s=arguments[arguments.length-1];return arguments[arguments.length-1]=n(s),r.apply(this,arguments)},"_");return i}a(t,"jl")}),N8=it(e=>{e.__esModule=!0,e.checkRevision=f,e.template=g,e.wrapProgram=m,e.resolvePartial=w,e.invokePartial=E,e.noop=A;function t(L){return L&&L.__esModule?L:{default:L}}a(t,"Wl");function r(L){if(L&&L.__esModule)return L;var j={};if(L!=null)for(var G in L)Object.prototype.hasOwnProperty.call(L,G)&&(j[G]=L[G]);return j.default=L,j}a(r,"Hl");var n=Zn(),i=r(n),s=Yi(),o=t(s),l=nw(),u=KT(),c=T8(),d=eN();function f(L){var j=L&&L[0]||1,G=l.COMPILER_REVISION;if(!(j>=l.LAST_COMPATIBLE_COMPILER_REVISION&&j<=l.COMPILER_REVISION))if(j<l.LAST_COMPATIBLE_COMPILER_REVISION){var Z=l.REVISION_CHANGES[G],K=l.REVISION_CHANGES[j];throw new o.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+Z+") or downgrade your runtime to an older version ("+K+").")}else throw new o.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+L[1]+").")}a(f,"fl");function g(L,j){if(!j)throw new o.default("No environment passed to template");if(!L||!L.main)throw new o.default("Unknown template object: "+typeof L);L.main.decorator=L.main_d,j.VM.checkRevision(L.compiler);var G=L.compiler&&L.compiler[0]===7;function Z(V,h,y){y.hash&&(h=i.extend({},h,y.hash),y.ids&&(y.ids[0]=!0)),V=j.VM.resolvePartial.call(this,V,h,y);var b=i.extend({},y,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),x=j.VM.invokePartial.call(this,V,h,b);if(x==null&&j.compile&&(y.partials[y.name]=j.compile(V,L.compilerOptions,j),x=y.partials[y.name](h,b)),x!=null){if(y.indent){for(var _=x.split(`
5
5
  `),N=0,T=_.length;N<T&&!(!_[N]&&N+1===T);N++)_[N]=y.indent+_[N];x=_.join(`
@@ -32,10 +32,10 @@ Expecting `+V.join(", ")+", got '"+(this.terminals_[R]||R)+"'":h="Parse error on
32
32
  `)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(t===""?"":t+`
33
33
  `)+" "+e.join(`,
34
34
  `)+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}a(tZ,"PB");function jN(e){return Array.isArray(e)}a(jN,"JC");function ow(e){return typeof e=="boolean"}a(ow,"Ww");function _p(e){return e===null}a(_p,"kY");function rZ(e){return e==null}a(rZ,"OB");function UN(e){return typeof e=="number"}a(UN,"WC");function Ep(e){return typeof e=="string"}a(Ep,"GY");function nZ(e){return typeof e=="symbol"}a(nZ,"jB");function ll(e){return e===void 0}a(ll,"kP");function Zf(e){return jl(e)&&lw(e)==="[object RegExp]"}a(Zf,"ZY");function jl(e){return typeof e=="object"&&e!==null}a(jl,"GP");function vv(e){return jl(e)&&lw(e)==="[object Date]"}a(vv,"zw");function Gf(e){return jl(e)&&(lw(e)==="[object Error]"||e instanceof Error)}a(Gf,"fY");function Vf(e){return typeof e=="function"}a(Vf,"XY");function iZ(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}a(iZ,"vB");function aZ(e){return e instanceof Buffer}a(aZ,"zB");function lw(e){return Object.prototype.toString.call(e)}a(lw,"Hw");function T0(e){return e<10?"0"+e.toString(10):e.toString(10)}a(T0,"jw");function sZ(){var e=new Date,t=[T0(e.getHours()),T0(e.getMinutes()),T0(e.getSeconds())].join(":");return[e.getDate(),VN[e.getMonth()],t].join(" ")}a(sZ,"WB");function BN(...e){console.log("%s - %s",sZ(),sw.apply(null,e))}a(BN,"HC");function zN(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}a(zN,"TC");function yv(e,t){if(!t||!jl(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}a(yv,"Tw");function FN(e,t){return Object.prototype.hasOwnProperty.call(e,t)}a(FN,"wC");function uw(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}a(uw,"ww");function HN(e){if(typeof e!="function")throw TypeError('The "original" argument must be of type Function');function t(...r){var n=r.pop();if(typeof n!="function")throw TypeError("The last argument must be of type Function");var i=this,s=a(function(...o){return n.apply(i,...o)},"O");e.apply(this,r).then(function(o){process.nextTick(s.bind(null,null,o))},function(o){process.nextTick(uw.bind(null,o,s))})}return a(t,"q"),Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),t}a(HN,"fC");var ZN,GN,ms,oZ=a(()=>{},"YB"),VN,wv,xv,_v,WN,lZ=$c(()=>{ZN=/%[sdj%]/g,GN=((e={},t={},r)=>((r=typeof process<"u"&&!1)&&(r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),t=new RegExp("^"+r+"$","i"),n=>(n=n.toUpperCase(),!e[n]&&(t.test(n)?e[n]=function(...i){console.error("%s: %s",n,pid,sw.apply(null,...i))}:e[n]=function(){}),e[n])))(),ms=(e=>(e.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.custom=Symbol.for("nodejs.util.inspect.custom"),e))(function(e,t,...r){var n={seen:[],stylize:JH};return r.length>=1&&(n.depth=r[0]),r.length>=2&&(n.colors=r[1]),ow(t)?n.showHidden=t:t&&yv(n,t),ll(n.showHidden)&&(n.showHidden=!1),ll(n.depth)&&(n.depth=2),ll(n.colors)&&(n.colors=!1),n.colors&&(n.stylize=XH),dh(n,e,n.depth)}),VN=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wv=(e=>(e.custom=Symbol.for("nodejs.util.promisify.custom"),e))(function(e){if(typeof e!="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var t=e[kCustomPromisifiedSymbol];if(typeof t!="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(...r){var n,i,s=new Promise(function(o,l){n=o,i=l});r.push(function(o,l){o?i(o):n(l)});try{e.apply(this,r)}catch(o){i(o)}return s}return a(t,"q"),Object.setPrototypeOf(t,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol&&Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}),{TextEncoder:xv,TextDecoder:_v}=globalThis,WN={TextEncoder:xv,TextDecoder:_v,promisify:wv,log:BN,inherits:zN,_extend:yv,callbackifyOnRejected:uw,callbackify:HN}}),Lu={};vn(Lu,{setMaxListeners:a(()=>XN,"setMaxListeners"),once:a(()=>QN,"once"),listenerCount:a(()=>JN,"listenerCount"),init:a(()=>Da,"init"),getMaxListeners:a(()=>qN,"getMaxListeners"),getEventListeners:a(()=>$N,"getEventListeners"),default:a(()=>tI,"default"),captureRejectionSymbol:a(()=>Av,"captureRejectionSymbol"),addAbortListener:a(()=>eI,"addAbortListener"),EventEmitter:a(()=>Da,"EventEmitter")});function YN(e,t){var{_events:r}=e;if(t[0]??=Error("Unhandled error."),!r)throw t[0];var n=r[Sv];if(n)for(var i of Tv.call(n))i.apply(e,t);var s=r.error;if(!s)throw t[0];for(var i of Tv.call(s))i.apply(e,t);return!0}a(YN,"EC");function uZ(e,t,r,n){t.then(void 0,function(i){queueMicrotask(()=>cZ(e,i,r,n))})}a(uZ,"ZB");function cZ(e,t,r,n){if(typeof e[kv]=="function")e[kv](t,r,...n);else try{e[fs]=!1,e.emit("error",t)}finally{e[fs]=!0}}a(cZ,"fB");function N1(e,t,r){r.warned=!0;let n=Error(`Possible EventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);n.name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=r.length,console.warn(n)}a(N1,"RC");function I1(e,t,...r){this.removeListener(e,t),t.apply(this,r)}a(I1,"IC");function QN(e,t,r){var n=r?.signal;if(KN(n,"options.signal"),n?.aborted)throw new Nv(void 0,{cause:n?.reason});let{resolve:i,reject:s,promise:o}=$newPromiseCapability(Promise),l=a(d=>{e.removeListener(t,u),n!=null&&Gd(n,"abort",c),s(d)},"v"),u=a((...d)=>{typeof e.removeListener=="function"&&e.removeListener("error",l),n!=null&&Gd(n,"abort",c),i(d)},"W");C1(e,t,u,{once:!0}),t!=="error"&&typeof e.once=="function"&&e.once("error",l);function c(){Gd(e,t,u),Gd(e,"error",l),s(new Nv(void 0,{cause:n?.reason}))}return a(c,"T"),n!=null&&C1(n,"abort",c,{once:!0}),o}a(QN,"hC");function $N(e,t){return e.listeners(t)}a($N,"DC");function XN(e,...t){Ev(e,"setMaxListeners",0);var r;if(t&&(r=t.length))for(let n=0;n<r;n++)t[n].setMaxListeners(e);else Xs=e}a(XN,"LC");function JN(e,t){return e.listenerCount(t)}a(JN,"gC");function Gd(e,t,r,n){typeof e.removeListener=="function"?e.removeListener(t,r):e.removeEventListener(t,r,n)}a(Gd,"VY");function C1(e,t,r,n){typeof e.on=="function"?n.once?e.once(t,r):e.on(t,r):e.addEventListener(t,r,n)}a(C1,"MC");function gl(e,t,r){let n=TypeError(`The "${e}" argument must be of type ${t}. Received ${r}`);return n.code="ERR_INVALID_ARG_TYPE",n}a(gl,"VP");function dZ(e,t,r){let n=RangeError(`The "${e}" argument is out of range. It must be ${t}. Received ${r}`);return n.code="ERR_OUT_OF_RANGE",n}a(dZ,"kB");function KN(e,t){if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw gl(t,"AbortSignal",e)}a(KN,"bC");function Ev(e,t,r,n){if(typeof e!="number")throw gl(t,"number",e);if(e<r||n!=null||Number.isNaN(e))throw dZ(t,`${`>= ${r}`}`,e)}a(Ev,"Xw");function Xl(e){if(typeof e!="function")throw TypeError("The listener must be a function")}a(Xl,"C7");function fZ(e,t){if(typeof e!="boolean")throw gl(t,"boolean",e)}a(fZ,"GB");function qN(e){return e?._maxListeners??Xs}a(qN,"yC");function eI(e,t){if(e===void 0)throw gl("signal","AbortSignal",e);if(KN(e,"signal"),typeof t!="function")throw gl("listener","function",t);let r;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0}),r=a(()=>{e.removeEventListener("abort",t)},"_")),{__proto__:null,[Symbol.dispose](){r?.()}}}a(eI,"uC");var Vd,fs,Sv,M1,O1,kv,Av,Tv,Xs=10,Da=a(function(e){(this._events===void 0||this._events===this.__proto__._events)&&(this._events={__proto__:null},this._eventsCount=0),this._maxListeners??=void 0,(this[fs]=e?.captureRejections?!!e?.captureRejections:xr[fs])&&(this.emit=pZ)},"ZK"),xr,hZ=a(function(e,...t){if(e==="error")return YN(this,t);var{_events:r}=this;if(r===void 0)return!1;var n=r[e];if(n===void 0)return!1;let i=n.length>1?n.slice():n;for(let s=0,{length:o}=i;s<o;s++){let l=i[s];switch(t.length){case 0:l.call(this);break;case 1:l.call(this,t[0]);break;case 2:l.call(this,t[0],t[1]);break;case 3:l.call(this,t[0],t[1],t[2]);break;default:l.apply(this,t);break}}return!0},"XB"),pZ=a(function(e,...t){if(e==="error")return YN(this,t);var{_events:r}=this;if(r===void 0)return!1;var n=r[e];if(n===void 0)return!1;let i=n.length>1?n.slice():n;for(let s=0,{length:o}=i;s<o;s++){let l=i[s],u;switch(t.length){case 0:u=l.call(this);break;case 1:u=l.call(this,t[0]);break;case 2:u=l.call(this,t[0],t[1]);break;case 3:u=l.call(this,t[0],t[1],t[2]);break;default:u=l.apply(this,t);break}u!==void 0&&typeof u?.then=="function"&&u.then===Promise.prototype.then&&uZ(this,u,e,t)}return!0},"AB"),Nv,tI,Wd=$c(()=>{Vd=Symbol.for,fs=Symbol("kCapture"),Sv=Vd("events.errorMonitor"),M1=Symbol("events.maxEventTargetListeners"),O1=Symbol("events.maxEventTargetListenersWarned"),kv=Vd("nodejs.rejection"),Av=Vd("nodejs.rejection"),Tv=Array.prototype.slice,xr=Da.prototype={},xr._events=void 0,xr._eventsCount=0,xr._maxListeners=void 0,xr.setMaxListeners=function(e){return Ev(e,"setMaxListeners",0),this._maxListeners=e,this},xr.constructor=Da,xr.getMaxListeners=function(){return this?._maxListeners??Xs},xr.emit=hZ,xr.addListener=function(e,t){Xl(t);var r=this._events;r?r.newListener&&this.emit("newListener",e,t.listener??t):(r=this._events={__proto__:null},this._eventsCount=0);var n=r[e];if(!n)r[e]=[t],this._eventsCount++;else{n.push(t);var i=this._maxListeners??Xs;i>0&&n.length>i&&!n.warned&&N1(this,e,n)}return this},xr.on=xr.addListener,xr.prependListener=function(e,t){Xl(t);var r=this._events;r?r.newListener&&this.emit("newListener",e,t.listener??t):(r=this._events={__proto__:null},this._eventsCount=0);var n=r[e];if(!n)r[e]=[t],this._eventsCount++;else{n.unshift(t);var i=this._maxListeners??Xs;i>0&&n.length>i&&!n.warned&&N1(this,e,n)}return this},xr.once=function(e,t){Xl(t);let r=I1.bind(this,e,t);return r.listener=t,this.addListener(e,r),this},xr.prependOnceListener=function(e,t){Xl(t);let r=I1.bind(this,e,t);return r.listener=t,this.prependListener(e,r),this},xr.removeListener=function(e,t){Xl(t);var{_events:r}=this;if(!r)return this;var n=r[e];if(!n)return this;var i=n.length;let s=-1;for(let o=i-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=o;break}return s<0?this:(s===0?n.shift():n.splice(s,1),n.length===0&&(delete r[e],this._eventsCount--),this)},xr.off=xr.removeListener,xr.removeAllListeners=function(e){var{_events:t}=this;return e&&t?t[e]&&(delete t[e],this._eventsCount--):this._events={__proto__:null},this},xr.listeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];return r?r.map(n=>n.listener??n):[]},xr.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];return r?r.slice():[]},xr.listenerCount=function(e){var{_events:t}=this;return t?t[e]?.length??0:0},xr.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},xr[fs]=!1,Nv=class extends Error{static{a(this,"Zw")}constructor(t="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw gl("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}},Object.defineProperties(Da,{captureRejections:{get(){return xr[fs]},set(e){fZ(e,"EventEmitter.captureRejections"),xr[fs]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:a(()=>Xs,"get"),set:a(e=>{Ev(e,"defaultMaxListeners",0),Xs=e},"set")},kMaxEventTargetListeners:{value:M1,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:O1,enumerable:!1,configurable:!1,writable:!1}}),Object.assign(Da,{once:QN,getEventListeners:$N,getMaxListeners:qN,setMaxListeners:XN,EventEmitter:Da,usingDomains:!1,captureRejectionSymbol:Av,errorMonitor:Sv,addAbortListener:eI,init:Da,listenerCount:JN}),tI=Da}),rI=it((e,t)=>{var r=a((N,T)=>()=>(T||N((T={exports:{}}).exports,T),T.exports),"C6"),n=r((N,T)=>{class k extends Error{static{a(this,"_")}constructor(S){if(!Array.isArray(S))throw TypeError(`Expected input to be an Array, got ${typeof S}`);let I="";for(let M=0;M<S.length;M++)I+=` ${S[M].stack}
35
- `;super(I),this.name="AggregateError",this.errors=S}}T.exports={AggregateError:k,ArrayIsArray(p){return Array.isArray(p)},ArrayPrototypeIncludes(p,S){return p.includes(S)},ArrayPrototypeIndexOf(p,S){return p.indexOf(S)},ArrayPrototypeJoin(p,S){return p.join(S)},ArrayPrototypeMap(p,S){return p.map(S)},ArrayPrototypePop(p,S){return p.pop(S)},ArrayPrototypePush(p,S){return p.push(S)},ArrayPrototypeSlice(p,S,I){return p.slice(S,I)},Error,FunctionPrototypeCall(p,S,...I){return p.call(S,...I)},FunctionPrototypeSymbolHasInstance(p,S){return Function.prototype[Symbol.hasInstance].call(p,S)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(p,S){return Object.defineProperties(p,S)},ObjectDefineProperty(p,S,I){return Object.defineProperty(p,S,I)},ObjectGetOwnPropertyDescriptor(p,S){return Object.getOwnPropertyDescriptor(p,S)},ObjectKeys(p){return Object.keys(p)},ObjectSetPrototypeOf(p,S){return Object.setPrototypeOf(p,S)},Promise,PromisePrototypeCatch(p,S){return p.catch(S)},PromisePrototypeThen(p,S,I){return p.then(S,I)},PromiseReject(p){return Promise.reject(p)},PromiseResolve(p){return Promise.resolve(p)},ReflectApply:Reflect.apply,RegExpPrototypeTest(p,S){return p.test(S)},SafeSet:Set,String,StringPrototypeSlice(p,S,I){return p.slice(S,I)},StringPrototypeToLowerCase(p){return p.toLowerCase()},StringPrototypeToUpperCase(p){return p.toUpperCase()},StringPrototypeTrim(p){return p.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(p,S,I){return p.set(S,I)},Boolean,Uint8Array}}),i=r((N,T)=>{T.exports={format(k,...p){return k.replace(/%([sdifj])/g,function(...[S,I]){let M=p.shift();return I==="f"?M.toFixed(6):I==="j"?JSON.stringify(M):I==="s"&&typeof M=="object"?`${M.constructor!==Object?M.constructor.name:""} {}`.trim():M.toString()})},inspect(k){switch(typeof k){case"string":if(k.includes("'"))if(k.includes('"')){if(!k.includes("`")&&!k.includes("${"))return`\`${k}\``}else return`"${k}"`;return`'${k}'`;case"number":return isNaN(k)?"NaN":Object.is(k,-0)?String(k):k;case"bigint":return`${String(k)}n`;case"boolean":case"undefined":return String(k);case"object":return"{}"}}}}),s=r((N,T)=>{var{format:k,inspect:p}=i(),{AggregateError:S}=n(),I=globalThis.AggregateError||S,M=Symbol("kIsNodeError"),U=["string","function","number","object","Function","Object","boolean","bigint","symbol"],B=/^([A-Z][a-z0-9]*)+$/,H={};function $(Se,Q){if(!Se)throw new H.ERR_INTERNAL_ASSERTION(Q)}a($,"Z");function ae(Se){let Q="",se=Se.length,J=Se[0]==="-"?1:0;for(;se>=J+4;se-=3)Q=`_${Se.slice(se-3,se)}${Q}`;return`${Se.slice(0,se)}${Q}`}a(ae,"w");function ie(Se,Q,se){if(typeof Q=="function")return $(Q.length<=se.length,`Code: ${Se}; The provided arguments length (${se.length}) does not match the required ones (${Q.length}).`),Q(...se);let J=(Q.match(/%[dfijoOs]/g)||[]).length;return $(J===se.length,`Code: ${Se}; The provided arguments length (${se.length}) does not match the required ones (${J}).`),se.length===0?Q:k(Q,...se)}a(ie,"k");function ne(Se,Q,se){se||(se=Error);class J extends se{static{a(this,"b")}constructor(...de){super(ie(Se,Q,de))}toString(){return`${this.name} [${Se}]: ${this.message}`}}Object.defineProperties(J.prototype,{name:{value:se.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${Se}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),J.prototype.code=Se,J.prototype[M]=!0,H[Se]=J}a(ne,"M");function Ne(Se){let Q="__node_internal_"+Se.name;return Object.defineProperty(Se,"name",{value:Q}),Se}a(Ne,"N");function ve(Se,Q){if(Se&&Q&&Se!==Q){if(Array.isArray(Q.errors))return Q.errors.push(Se),Q;let se=new I([Q,Se],Q.message);return se.code=Q.code,se}return Se||Q}a(ve,"R");class he extends Error{static{a(this,"E")}constructor(Q="The operation was aborted",se=void 0){if(se!==void 0&&typeof se!="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",se);super(Q,se),this.code="ABORT_ERR",this.name="AbortError"}}ne("ERR_ASSERTION","%s",Error),ne("ERR_INVALID_ARG_TYPE",(Se,Q,se)=>{$(typeof Se=="string","'name' must be a string"),!Array.isArray(Q)&&(Q=[Q]);let J="The ";Se.endsWith(" argument")?J+=`${Se} `:J+=`"${Se}" ${Se.includes(".")?"property":"argument"} `,J+="must be ";let te=[],de=[],be=[];for(let oe of Q)$(typeof oe=="string","All expected entries have to be of type string"),U.includes(oe)?te.push(oe.toLowerCase()):B.test(oe)?de.push(oe):($(oe!=="object",'The value "object" should be written as "Object"'),be.push(oe));if(de.length>0){let oe=te.indexOf("object");oe!==-1&&(te.splice(te,oe,1),de.push("Object"))}if(te.length>0){switch(te.length){case 1:J+=`of type ${te[0]}`;break;case 2:J+=`one of type ${te[0]} or ${te[1]}`;break;default:{let oe=te.pop();J+=`one of type ${te.join(", ")}, or ${oe}`}}(de.length>0||be.length>0)&&(J+=" or ")}if(de.length>0){switch(de.length){case 1:J+=`an instance of ${de[0]}`;break;case 2:J+=`an instance of ${de[0]} or ${de[1]}`;break;default:{let oe=de.pop();J+=`an instance of ${de.join(", ")}, or ${oe}`}}be.length>0&&(J+=" or ")}switch(be.length){case 0:break;case 1:be[0].toLowerCase()!==be[0]&&(J+="an "),J+=`${be[0]}`;break;case 2:J+=`one of ${be[0]} or ${be[1]}`;break;default:{let oe=be.pop();J+=`one of ${be.join(", ")}, or ${oe}`}}if(se==null)J+=`. Received ${se}`;else if(typeof se=="function"&&se.name)J+=`. Received function ${se.name}`;else if(typeof se=="object"){var Ae;if((Ae=se.constructor)!==null&&Ae!==void 0&&Ae.name)J+=`. Received an instance of ${se.constructor.name}`;else{let oe=p(se,{depth:-1});J+=`. Received ${oe}`}}else{let oe=p(se,{colors:!1});oe.length>25&&(oe=`${oe.slice(0,25)}...`),J+=`. Received type ${typeof se} (${oe})`}return J},TypeError),ne("ERR_INVALID_ARG_VALUE",(Se,Q,se="is invalid")=>{let J=p(Q);return J.length>128&&(J=J.slice(0,128)+"..."),`The ${Se.includes(".")?"property":"argument"} '${Se}' ${se}. Received ${J}`},TypeError),ne("ERR_INVALID_RETURN_VALUE",(Se,Q,se)=>{var J;let te=se!=null&&(J=se.constructor)!==null&&J!==void 0&&J.name?`instance of ${se.constructor.name}`:`type ${typeof se}`;return`Expected ${Se} to be returned from the "${Q}" function but got ${te}.`},TypeError),ne("ERR_MISSING_ARGS",(...Se)=>{$(Se.length>0,"At least one arg needs to be specified");let Q,se=Se.length;switch(Se=(Array.isArray(Se)?Se:[Se]).map(J=>`"${J}"`).join(" or "),se){case 1:Q+=`The ${Se[0]} argument`;break;case 2:Q+=`The ${Se[0]} and ${Se[1]} arguments`;break;default:{let J=Se.pop();Q+=`The ${Se.join(", ")}, and ${J} arguments`}break}return`${Q} must be specified`},TypeError),ne("ERR_OUT_OF_RANGE",(Se,Q,se)=>{$(Q,'Missing "range" argument');let J;if(Number.isInteger(se)&&Math.abs(se)>4294967296)J=ae(String(se));else if(typeof se=="bigint"){J=String(se);let te=BigInt(2)**BigInt(32);(se>te||se<-te)&&(J=ae(J)),J+="n"}else J=p(se);return`The value of "${Se}" is out of range. It must be ${Q}. Received ${J}`},RangeError),ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),ne("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),ne("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),ne("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),ne("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),ne("ERR_STREAM_WRITE_AFTER_END","write after end",Error),ne("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),T.exports={AbortError:he,aggregateTwoErrors:Ne(ve),hideStackFrames:Ne,codes:H}}),o=r((N,T)=>{Object.defineProperty(N,"__esModule",{value:!0});var k=new WeakMap,p=new WeakMap;function S(Y){let ee=k.get(Y);return console.assert(ee!=null,"'this' is expected an Event object, but got",Y),ee}a(S,"K");function I(Y){if(Y.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",Y.passiveListener);return}Y.event.cancelable&&(Y.canceled=!0,typeof Y.event.preventDefault=="function"&&Y.event.preventDefault())}a(I,"O");function M(Y,ee){k.set(this,{eventTarget:Y,event:ee,eventPhase:2,currentTarget:Y,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:ee.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let X=Object.keys(ee);for(let W=0;W<X.length;++W){let q=X[W];q in this||Object.defineProperty(this,q,U(q))}}a(M,"Y"),M.prototype={get type(){return S(this).event.type},get target(){return S(this).eventTarget},get currentTarget(){return S(this).currentTarget},composedPath(){let Y=S(this).currentTarget;return Y==null?[]:[Y]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return S(this).eventPhase},stopPropagation(){let Y=S(this);Y.stopped=!0,typeof Y.event.stopPropagation=="function"&&Y.event.stopPropagation()},stopImmediatePropagation(){let Y=S(this);Y.stopped=!0,Y.immediateStopped=!0,typeof Y.event.stopImmediatePropagation=="function"&&Y.event.stopImmediatePropagation()},get bubbles(){return!!S(this).event.bubbles},get cancelable(){return!!S(this).event.cancelable},preventDefault(){I(S(this))},get defaultPrevented(){return S(this).canceled},get composed(){return!!S(this).event.composed},get timeStamp(){return S(this).timeStamp},get srcElement(){return S(this).eventTarget},get cancelBubble(){return S(this).stopped},set cancelBubble(Y){if(!Y)return;let ee=S(this);ee.stopped=!0,typeof ee.event.cancelBubble=="boolean"&&(ee.event.cancelBubble=!0)},get returnValue(){return!S(this).canceled},set returnValue(Y){Y||I(S(this))},initEvent(){}},Object.defineProperty(M.prototype,"constructor",{value:M,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(M.prototype,window.Event.prototype),p.set(window.Event.prototype,M));function U(Y){return{get(){return S(this).event[Y]},set(ee){S(this).event[Y]=ee},configurable:!0,enumerable:!0}}a(U,"v");function B(Y){return{value(){let ee=S(this).event;return ee[Y].apply(ee,arguments)},configurable:!0,enumerable:!0}}a(B,"W");function H(Y,ee){let X=Object.keys(ee);if(X.length===0)return Y;function W(q,re){Y.call(this,q,re)}a(W,"J"),W.prototype=Object.create(Y.prototype,{constructor:{value:W,configurable:!0,writable:!0}});for(let q=0;q<X.length;++q){let re=X[q];if(!(re in Y.prototype)){let Oe=typeof Object.getOwnPropertyDescriptor(ee,re).value=="function";Object.defineProperty(W.prototype,re,Oe?B(re):U(re))}}return W}a(H,"T");function $(Y){if(Y==null||Y===Object.prototype)return M;let ee=p.get(Y);return ee==null&&(ee=H($(Object.getPrototypeOf(Y)),Y),p.set(Y,ee)),ee}a($,"Z");function ae(Y,ee){return new($(Object.getPrototypeOf(ee)))(Y,ee)}a(ae,"w");function ie(Y){return S(Y).immediateStopped}a(ie,"k");function ne(Y,ee){S(Y).eventPhase=ee}a(ne,"M");function Ne(Y,ee){S(Y).currentTarget=ee}a(Ne,"N");function ve(Y,ee){S(Y).passiveListener=ee}a(ve,"R");var he=new WeakMap,Se=1,Q=2,se=3;function J(Y){return Y!==null&&typeof Y=="object"}a(J,"b");function te(Y){let ee=he.get(Y);if(ee==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return ee}a(te,"y");function de(Y){return{get(){let ee=te(this).get(Y);for(;ee!=null;){if(ee.listenerType===se)return ee.listener;ee=ee.next}return null},set(ee){typeof ee!="function"&&!J(ee)&&(ee=null);let X=te(this),W=null,q=X.get(Y);for(;q!=null;)q.listenerType===se?W!==null?W.next=q.next:q.next!==null?X.set(Y,q.next):X.delete(Y):W=q,q=q.next;if(ee!==null){let re={listener:ee,listenerType:se,passive:!1,once:!1,next:null};W===null?X.set(Y,re):W.next=re}},configurable:!0,enumerable:!0}}a(de,"p");function be(Y,ee){Object.defineProperty(Y,`on${ee}`,de(ee))}a(be,"i");function Ae(Y){function ee(){oe.call(this)}a(ee,"a"),ee.prototype=Object.create(oe.prototype,{constructor:{value:ee,configurable:!0,writable:!0}});for(let X=0;X<Y.length;++X)be(ee.prototype,Y[X]);return ee}a(Ae,"$$");function oe(){if(this instanceof oe){he.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Ae(arguments[0]);if(arguments.length>0){let Y=Array(arguments.length);for(let ee=0;ee<arguments.length;++ee)Y[ee]=arguments[ee];return Ae(Y)}throw TypeError("Cannot call a class as a function")}a(oe,"Q"),oe.prototype={addEventListener(Y,ee,X){if(ee==null)return;if(typeof ee!="function"&&!J(ee))throw TypeError("'listener' should be a function or an object.");let W=te(this),q=J(X),re=(q?X.capture:X)?Se:Q,Oe={listener:ee,listenerType:re,passive:q&&!!X.passive,once:q&&!!X.once,next:null},Ee=W.get(Y);if(Ee===void 0){W.set(Y,Oe);return}let Be=null;for(;Ee!=null;){if(Ee.listener===ee&&Ee.listenerType===re)return;Be=Ee,Ee=Ee.next}Be.next=Oe},removeEventListener(Y,ee,X){if(ee==null)return;let W=te(this),q=(J(X)?X.capture:X)?Se:Q,re=null,Oe=W.get(Y);for(;Oe!=null;){if(Oe.listener===ee&&Oe.listenerType===q){re!==null?re.next=Oe.next:Oe.next!==null?W.set(Y,Oe.next):W.delete(Y);return}re=Oe,Oe=Oe.next}},dispatchEvent(Y){if(Y==null||typeof Y.type!="string")throw TypeError('"event.type" should be a string.');let ee=te(this),X=Y.type,W=ee.get(X);if(W==null)return!0;let q=ae(this,Y),re=null;for(;W!=null;){if(W.once?re!==null?re.next=W.next:W.next!==null?ee.set(X,W.next):ee.delete(X):re=W,ve(q,W.passive?W.listener:null),typeof W.listener=="function")try{W.listener.call(this,q)}catch(Oe){typeof console<"u"&&typeof console.error=="function"&&console.error(Oe)}else W.listenerType!==se&&typeof W.listener.handleEvent=="function"&&W.listener.handleEvent(q);if(ie(q))break;W=W.next}return ve(q,null),ne(q,0),Ne(q,null),!q.defaultPrevented}},Object.defineProperty(oe.prototype,"constructor",{value:oe,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(oe.prototype,window.EventTarget.prototype),N.defineEventAttribute=be,N.EventTarget=oe,N.default=oe,T.exports=oe,T.exports.EventTarget=T.exports.default=oe,T.exports.defineEventAttribute=be}),l=r((N,T)=>{Object.defineProperty(N,"__esModule",{value:!0});var k=o();class p extends k.EventTarget{static{a(this,"P")}constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let ae=M.get(this);if(typeof ae!="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return ae}}k.defineEventAttribute(p.prototype,"abort");function S(){let $=Object.create(p.prototype);return k.EventTarget.call($),M.set($,!1),$}a(S,"K");function I($){M.get($)===!1&&(M.set($,!0),$.dispatchEvent({type:"abort"}))}a(I,"O");var M=new WeakMap;Object.defineProperties(p.prototype,{aborted:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(p.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class U{static{a(this,"v")}constructor(){B.set(this,S())}get signal(){return H(this)}abort(){I(H(this))}}var B=new WeakMap;function H($){let ae=B.get($);if(ae==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${$===null?"null":typeof $}`);return ae}a(H,"T"),Object.defineProperties(U.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(U.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"}),N.AbortController=U,N.AbortSignal=p,N.default=U,T.exports=U,T.exports.AbortController=T.exports.default=U,T.exports.AbortSignal=p}),u=r((N,T)=>{var k=(ln(),qt(qr)),{format:p,inspect:S}=i(),{codes:{ERR_INVALID_ARG_TYPE:I}}=s(),{kResistStopPropagation:M,AggregateError:U,SymbolDispose:B}=n(),H=globalThis.AbortSignal||l().AbortSignal,$=globalThis.AbortController||l().AbortController,ae=Object.getPrototypeOf(async function(){}).constructor,ie=globalThis.Blob||k.Blob,ne=typeof ie<"u"?function(he){return he instanceof ie}:function(he){return!1},Ne=a((he,Se)=>{if(he!==void 0&&(he===null||typeof he!="object"||!("aborted"in he)))throw new I(Se,"AbortSignal",he)},"N"),ve=a((he,Se)=>{if(typeof he!="function")throw new I(Se,"Function",he)},"R");T.exports={AggregateError:U,kEmptyObject:Object.freeze({}),once(he){let Se=!1;return function(...Q){Se||(Se=!0,he.apply(this,Q))}},createDeferredPromise:a(function(){let he,Se;return{promise:new Promise((Q,se)=>{he=Q,Se=se}),resolve:he,reject:Se}},"createDeferredPromise"),promisify(he){return new Promise((Se,Q)=>{he((se,...J)=>se?Q(se):Se(...J))})},debuglog(){return function(){}},format:p,inspect:S,types:{isAsyncFunction(he){return he instanceof ae},isArrayBufferView(he){return ArrayBuffer.isView(he)}},isBlob:ne,deprecate(he,Se){return he},addAbortListener:(Wd(),qt(Lu)).addAbortListener||function(he,Se){if(he===void 0)throw new I("signal","AbortSignal",he);Ne(he,"signal"),ve(Se,"listener");let Q;return he.aborted?queueMicrotask(()=>Se()):(he.addEventListener("abort",Se,{__proto__:null,once:!0,[M]:!0}),Q=a(()=>{he.removeEventListener("abort",Se)},"h")),{__proto__:null,[B](){var se;(se=Q)===null||se===void 0||se()}}},AbortSignalAny:H.any||function(he){if(he.length===1)return he[0];let Se=new $,Q=a(()=>Se.abort(),"h");return he.forEach(se=>{Ne(se,"signals"),se.addEventListener("abort",Q,{once:!0})}),Se.signal.addEventListener("abort",()=>{he.forEach(se=>se.removeEventListener("abort",Q))},{once:!0}),Se.signal}},T.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),c=r((N,T)=>{var{ArrayIsArray:k,ArrayPrototypeIncludes:p,ArrayPrototypeJoin:S,ArrayPrototypeMap:I,NumberIsInteger:M,NumberIsNaN:U,NumberMAX_SAFE_INTEGER:B,NumberMIN_SAFE_INTEGER:H,NumberParseInt:$,ObjectPrototypeHasOwnProperty:ae,RegExpPrototypeExec:ie,String:ne,StringPrototypeToUpperCase:Ne,StringPrototypeTrim:ve}=n(),{hideStackFrames:he,codes:{ERR_SOCKET_BAD_PORT:Se,ERR_INVALID_ARG_TYPE:Q,ERR_INVALID_ARG_VALUE:se,ERR_OUT_OF_RANGE:J,ERR_UNKNOWN_SIGNAL:te}}=s(),{normalizeEncoding:de}=u(),{isAsyncFunction:be,isArrayBufferView:Ae}=u().types,oe={};function Y(ce){return ce===(ce|0)}a(Y,"c");function ee(ce){return ce===ce>>>0}a(ee,"a");var X=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function q(ce,Ce,et){if(typeof ce>"u"&&(ce=et),typeof ce=="string"){if(ie(X,ce)===null)throw new se(Ce,ce,W);ce=$(ce,8)}return Ee(ce,Ce),ce}a(q,"X");var re=he((ce,Ce,et=H,ke=B)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);if(ce<et||ce>ke)throw new J(Ce,`>= ${et} && <= ${ke}`,ce)}),Oe=he((ce,Ce,et=-2147483648,ke=2147483647)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);if(ce<et||ce>ke)throw new J(Ce,`>= ${et} && <= ${ke}`,ce)}),Ee=he((ce,Ce,et=!1)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);let ke=et?1:0,tt=4294967295;if(ce<ke||ce>tt)throw new J(Ce,`>= ${ke} && <= ${tt}`,ce)});function Be(ce,Ce){if(typeof ce!="string")throw new Q(Ce,"string",ce)}a(Be,"S");function pt(ce,Ce,et=void 0,ke){if(typeof ce!="number")throw new Q(Ce,"number",ce);if(et!=null&&ce<et||ke!=null&&ce>ke||(et!=null||ke!=null)&&U(ce))throw new J(Ce,`${et!=null?`>= ${et}`:""}${et!=null&&ke!=null?" && ":""}${ke!=null?`<= ${ke}`:""}`,ce)}a(pt,"A");var xe=he((ce,Ce,et)=>{if(!p(et,ce)){let ke="must be one of: "+S(I(et,tt=>typeof tt=="string"?`'${tt}'`:ne(tt)),", ");throw new se(Ce,ce,ke)}});function Ge(ce,Ce){if(typeof ce!="boolean")throw new Q(Ce,"boolean",ce)}a(Ge,"G");function ge(ce,Ce,et){return ce==null||!ae(ce,Ce)?et:ce[Ce]}a(ge,"I");var _e=he((ce,Ce,et=null)=>{let ke=ge(et,"allowArray",!1),tt=ge(et,"allowFunction",!1);if(!ge(et,"nullable",!1)&&ce===null||!ke&&k(ce)||typeof ce!="object"&&(!tt||typeof ce!="function"))throw new Q(Ce,"Object",ce)}),Re=he((ce,Ce)=>{if(ce!=null&&typeof ce!="object"&&typeof ce!="function")throw new Q(Ce,"a dictionary",ce)}),ze=he((ce,Ce,et=0)=>{if(!k(ce))throw new Q(Ce,"Array",ce);if(ce.length<et){let ke=`must be longer than ${et}`;throw new se(Ce,ce,ke)}});function Pe(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++)Be(ce[et],`${Ce}[${et}]`)}a(Pe,"l");function We(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++)Ge(ce[et],`${Ce}[${et}]`)}a(We,"o");function _t(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++){let ke=ce[et],tt=`${Ce}[${et}]`;if(ke==null)throw new Q(tt,"AbortSignal",ke);$e(ke,tt)}}a(_t,"T$");function Ve(ce,Ce="signal"){if(Be(ce,Ce),oe[ce]===void 0)throw oe[Ne(ce)]!==void 0?new te(ce+" (signals must use all capital letters)"):new te(ce)}a(Ve,"e");var Te=he((ce,Ce="buffer")=>{if(!Ae(ce))throw new Q(Ce,["Buffer","TypedArray","DataView"],ce)});function Ye(ce,Ce){let et=de(Ce),ke=ce.length;if(et==="hex"&&ke%2!==0)throw new se("encoding",Ce,`is invalid for data of length ${ke}`)}a(Ye,"j$");function Me(ce,Ce="Port",et=!0){if(typeof ce!="number"&&typeof ce!="string"||typeof ce=="string"&&ve(ce).length===0||+ce!==+ce>>>0||ce>65535||ce===0&&!et)throw new Se(Ce,ce,et);return ce|0}a(Me,"s");var $e=he((ce,Ce)=>{if(ce!==void 0&&(ce===null||typeof ce!="object"||!("aborted"in ce)))throw new Q(Ce,"AbortSignal",ce)}),mt=he((ce,Ce)=>{if(typeof ce!="function")throw new Q(Ce,"Function",ce)}),ue=he((ce,Ce)=>{if(typeof ce!="function"||be(ce))throw new Q(Ce,"Function",ce)}),me=he((ce,Ce)=>{if(ce!==void 0)throw new Q(Ce,"undefined",ce)});function He(ce,Ce,et){if(!p(et,ce))throw new Q(Ce,`('${S(et,"|")}')`,ce)}a(He,"W$");var Ie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function je(ce,Ce){if(typeof ce>"u"||!ie(Ie,ce))throw new se(Ce,ce,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}a(je,"_$");function rt(ce){if(typeof ce=="string")return je(ce,"hints"),ce;if(k(ce)){let Ce=ce.length,et="";if(Ce===0)return et;for(let ke=0;ke<Ce;ke++){let tt=ce[ke];je(tt,"hints"),et+=tt,ke!==Ce-1&&(et+=", ")}return et}throw new se("hints",ce,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}a(rt,"v$"),T.exports={isInt32:Y,isUint32:ee,parseFileMode:q,validateArray:ze,validateStringArray:Pe,validateBooleanArray:We,validateAbortSignalArray:_t,validateBoolean:Ge,validateBuffer:Te,validateDictionary:Re,validateEncoding:Ye,validateFunction:mt,validateInt32:Oe,validateInteger:re,validateNumber:pt,validateObject:_e,validateOneOf:xe,validatePlainFunction:ue,validatePort:Me,validateSignalName:Ve,validateString:Be,validateUint32:Ee,validateUndefined:me,validateUnion:He,validateAbortSignal:$e,validateLinkHeaderValue:rt}}),d=r((N,T)=>{T.exports=globalThis.process}),f=r((N,T)=>{var{SymbolAsyncIterator:k,SymbolIterator:p,SymbolFor:S}=n(),I=S("nodejs.stream.destroyed"),M=S("nodejs.stream.errored"),U=S("nodejs.stream.readable"),B=S("nodejs.stream.writable"),H=S("nodejs.stream.disturbed"),$=S("nodejs.webstream.isClosedPromise"),ae=S("nodejs.webstream.controllerErrorFunction");function ie(ge,_e=!1){var Re;return!!(ge&&typeof ge.pipe=="function"&&typeof ge.on=="function"&&(!_e||typeof ge.pause=="function"&&typeof ge.resume=="function")&&(!ge._writableState||((Re=ge._readableState)===null||Re===void 0?void 0:Re.readable)!==!1)&&(!ge._writableState||ge._readableState))}a(ie,"k");function ne(ge){var _e;return!!(ge&&typeof ge.write=="function"&&typeof ge.on=="function"&&(!ge._readableState||((_e=ge._writableState)===null||_e===void 0?void 0:_e.writable)!==!1))}a(ne,"M");function Ne(ge){return!!(ge&&typeof ge.pipe=="function"&&ge._readableState&&typeof ge.on=="function"&&typeof ge.write=="function")}a(Ne,"N");function ve(ge){return ge&&(ge._readableState||ge._writableState||typeof ge.write=="function"&&typeof ge.on=="function"||typeof ge.pipe=="function"&&typeof ge.on=="function")}a(ve,"R");function he(ge){return!!(ge&&!ve(ge)&&typeof ge.pipeThrough=="function"&&typeof ge.getReader=="function"&&typeof ge.cancel=="function")}a(he,"E");function Se(ge){return!!(ge&&!ve(ge)&&typeof ge.getWriter=="function"&&typeof ge.abort=="function")}a(Se,"D");function Q(ge){return!!(ge&&!ve(ge)&&typeof ge.readable=="object"&&typeof ge.writable=="object")}a(Q,"h");function se(ge){return he(ge)||Se(ge)||Q(ge)}a(se,"L");function J(ge,_e){return ge==null?!1:_e===!0?typeof ge[k]=="function":_e===!1?typeof ge[p]=="function":typeof ge[k]=="function"||typeof ge[p]=="function"}a(J,"b");function te(ge){if(!ve(ge))return null;let{_writableState:_e,_readableState:Re}=ge,ze=_e||Re;return!!(ge.destroyed||ge[I]||ze!=null&&ze.destroyed)}a(te,"y");function de(ge){if(!ne(ge))return null;if(ge.writableEnded===!0)return!0;let _e=ge._writableState;return _e!=null&&_e.errored?!1:typeof _e?.ended!="boolean"?null:_e.ended}a(de,"p");function be(ge,_e){if(!ne(ge))return null;if(ge.writableFinished===!0)return!0;let Re=ge._writableState;return Re!=null&&Re.errored?!1:typeof Re?.finished!="boolean"?null:!!(Re.finished||_e===!1&&Re.ended===!0&&Re.length===0)}a(be,"i");function Ae(ge){if(!ie(ge))return null;if(ge.readableEnded===!0)return!0;let _e=ge._readableState;return!_e||_e.errored?!1:typeof _e?.ended!="boolean"?null:_e.ended}a(Ae,"$$");function oe(ge,_e){if(!ie(ge))return null;let Re=ge._readableState;return Re!=null&&Re.errored?!1:typeof Re?.endEmitted!="boolean"?null:!!(Re.endEmitted||_e===!1&&Re.ended===!0&&Re.length===0)}a(oe,"Q");function Y(ge){return ge&&ge[U]!=null?ge[U]:typeof ge?.readable!="boolean"?null:te(ge)?!1:ie(ge)&&ge.readable&&!oe(ge)}a(Y,"c");function ee(ge){return ge&&ge[B]!=null?ge[B]:typeof ge?.writable!="boolean"?null:te(ge)?!1:ne(ge)&&ge.writable&&!de(ge)}a(ee,"a");function X(ge,_e){return ve(ge)?te(ge)?!0:!(_e?.readable!==!1&&Y(ge)||_e?.writable!==!1&&ee(ge)):null}a(X,"j");function W(ge){var _e,Re;return ve(ge)?ge.writableErrored?ge.writableErrored:(_e=(Re=ge._writableState)===null||Re===void 0?void 0:Re.errored)!==null&&_e!==void 0?_e:null:null}a(W,"J");function q(ge){var _e,Re;return ve(ge)?ge.readableErrored?ge.readableErrored:(_e=(Re=ge._readableState)===null||Re===void 0?void 0:Re.errored)!==null&&_e!==void 0?_e:null:null}a(q,"X");function re(ge){if(!ve(ge))return null;if(typeof ge.closed=="boolean")return ge.closed;let{_writableState:_e,_readableState:Re}=ge;return typeof _e?.closed=="boolean"||typeof Re?.closed=="boolean"?_e?.closed||Re?.closed:typeof ge._closed=="boolean"&&Oe(ge)?ge._closed:null}a(re,"H");function Oe(ge){return typeof ge._closed=="boolean"&&typeof ge._defaultKeepAlive=="boolean"&&typeof ge._removedConnection=="boolean"&&typeof ge._removedContLen=="boolean"}a(Oe,"f");function Ee(ge){return typeof ge._sent100=="boolean"&&Oe(ge)}a(Ee,"V");function Be(ge){var _e;return typeof ge._consuming=="boolean"&&typeof ge._dumped=="boolean"&&((_e=ge.req)===null||_e===void 0?void 0:_e.upgradeOrConnect)===void 0}a(Be,"S");function pt(ge){if(!ve(ge))return null;let{_writableState:_e,_readableState:Re}=ge,ze=_e||Re;return!ze&&Ee(ge)||!!(ze&&ze.autoDestroy&&ze.emitClose&&ze.closed===!1)}a(pt,"A");function xe(ge){var _e;return!!(ge&&((_e=ge[H])!==null&&_e!==void 0?_e:ge.readableDidRead||ge.readableAborted))}a(xe,"z");function Ge(ge){var _e,Re,ze,Pe,We,_t,Ve,Te,Ye,Me;return!!(ge&&((_e=(Re=(ze=(Pe=(We=(_t=ge[M])!==null&&_t!==void 0?_t:ge.readableErrored)!==null&&We!==void 0?We:ge.writableErrored)!==null&&Pe!==void 0?Pe:(Ve=ge._readableState)===null||Ve===void 0?void 0:Ve.errorEmitted)!==null&&ze!==void 0?ze:(Te=ge._writableState)===null||Te===void 0?void 0:Te.errorEmitted)!==null&&Re!==void 0?Re:(Ye=ge._readableState)===null||Ye===void 0?void 0:Ye.errored)!==null&&_e!==void 0?_e:!((Me=ge._writableState)===null||Me===void 0)&&Me.errored))}a(Ge,"G"),T.exports={isDestroyed:te,kIsDestroyed:I,isDisturbed:xe,kIsDisturbed:H,isErrored:Ge,kIsErrored:M,isReadable:Y,kIsReadable:U,kIsClosedPromise:$,kControllerErrorFunction:ae,kIsWritable:B,isClosed:re,isDuplexNodeStream:Ne,isFinished:X,isIterable:J,isReadableNodeStream:ie,isReadableStream:he,isReadableEnded:Ae,isReadableFinished:oe,isReadableErrored:q,isNodeStream:ve,isWebStream:se,isWritable:ee,isWritableNodeStream:ne,isWritableStream:Se,isWritableEnded:de,isWritableFinished:be,isWritableErrored:W,isServerRequest:Be,isServerResponse:Ee,willEmitClose:pt,isTransformStream:Q}}),g=r((N,T)=>{var k=d(),{AbortError:p,codes:S}=s(),{ERR_INVALID_ARG_TYPE:I,ERR_STREAM_PREMATURE_CLOSE:M}=S,{kEmptyObject:U,once:B}=u(),{validateAbortSignal:H,validateFunction:$,validateObject:ae,validateBoolean:ie}=c(),{Promise:ne,PromisePrototypeThen:Ne,SymbolDispose:ve}=n(),{isClosed:he,isReadable:Se,isReadableNodeStream:Q,isReadableStream:se,isReadableFinished:J,isReadableErrored:te,isWritable:de,isWritableNodeStream:be,isWritableStream:Ae,isWritableFinished:oe,isWritableErrored:Y,isNodeStream:ee,willEmitClose:X,kIsClosedPromise:W}=f(),q;function re(xe){return xe.setHeader&&typeof xe.abort=="function"}a(re,"H");var Oe=a(()=>{},"f");function Ee(xe,Ge,ge){var _e,Re;if(arguments.length===2?(ge=Ge,Ge=U):Ge==null?Ge=U:ae(Ge,"options"),$(ge,"callback"),H(Ge.signal,"options.signal"),ge=B(ge),se(xe)||Ae(xe))return Be(xe,Ge,ge);if(!ee(xe))throw new I("stream",["ReadableStream","WritableStream","Stream"],xe);let ze=(_e=Ge.readable)!==null&&_e!==void 0?_e:Q(xe),Pe=(Re=Ge.writable)!==null&&Re!==void 0?Re:be(xe),We=xe._writableState,_t=xe._readableState,Ve=a(()=>{xe.writable||Me()},"e"),Te=X(xe)&&Q(xe)===ze&&be(xe)===Pe,Ye=oe(xe,!1),Me=a(()=>{Ye=!0,xe.destroyed&&(Te=!1),!(Te&&(!xe.readable||ze))&&(!ze||$e)&&ge.call(xe)},"s"),$e=J(xe,!1),mt=a(()=>{$e=!0,xe.destroyed&&(Te=!1),!(Te&&(!xe.writable||Pe))&&(!Pe||Ye)&&ge.call(xe)},"n$"),ue=a(ce=>{ge.call(xe,ce)},"m"),me=he(xe),He=a(()=>{me=!0;let ce=Y(xe)||te(xe);if(ce&&typeof ce!="boolean")return ge.call(xe,ce);if(ze&&!$e&&Q(xe,!0)&&!J(xe,!1))return ge.call(xe,new M);if(Pe&&!Ye&&!oe(xe,!1))return ge.call(xe,new M);ge.call(xe)},"W$"),Ie=a(()=>{me=!0;let ce=Y(xe)||te(xe);if(ce&&typeof ce!="boolean")return ge.call(xe,ce);ge.call(xe)},"q$"),je=a(()=>{xe.req.on("finish",Me)},"_$");re(xe)?(xe.on("complete",Me),!Te&&xe.on("abort",He),xe.req?je():xe.on("request",je)):Pe&&!We&&(xe.on("end",Ve),xe.on("close",Ve)),!Te&&typeof xe.aborted=="boolean"&&xe.on("aborted",He),xe.on("end",mt),xe.on("finish",Me),Ge.error!==!1&&xe.on("error",ue),xe.on("close",He),me?k.nextTick(He):We!=null&&We.errorEmitted||_t!=null&&_t.errorEmitted?Te||k.nextTick(Ie):(!ze&&(!Te||Se(xe))&&(Ye||de(xe)===!1)||!Pe&&(!Te||de(xe))&&($e||Se(xe)===!1)||_t&&xe.req&&xe.aborted)&&k.nextTick(Ie);let rt=a(()=>{ge=Oe,xe.removeListener("aborted",He),xe.removeListener("complete",Me),xe.removeListener("abort",He),xe.removeListener("request",je),xe.req&&xe.req.removeListener("finish",Me),xe.removeListener("end",Ve),xe.removeListener("close",Ve),xe.removeListener("finish",Me),xe.removeListener("end",mt),xe.removeListener("error",ue),xe.removeListener("close",He)},"v$");if(Ge.signal&&!me){let ce=a(()=>{let Ce=ge;rt(),Ce.call(xe,new p(void 0,{cause:Ge.signal.reason}))},"d");if(Ge.signal.aborted)k.nextTick(ce);else{q=q||u().addAbortListener;let Ce=q(Ge.signal,ce),et=ge;ge=B((...ke)=>{Ce[ve](),et.apply(xe,ke)})}}return rt}a(Ee,"V");function Be(xe,Ge,ge){let _e=!1,Re=Oe;if(Ge.signal)if(Re=a(()=>{_e=!0,ge.call(xe,new p(void 0,{cause:Ge.signal.reason}))},"g"),Ge.signal.aborted)k.nextTick(Re);else{q=q||u().addAbortListener;let Pe=q(Ge.signal,Re),We=ge;ge=B((..._t)=>{Pe[ve](),We.apply(xe,_t)})}let ze=a((...Pe)=>{_e||k.nextTick(()=>ge.apply(xe,Pe))},"x");return Ne(xe[W].promise,ze,ze),Oe}a(Be,"S");function pt(xe,Ge){var ge;let _e=!1;return Ge===null&&(Ge=U),(ge=Ge)!==null&&ge!==void 0&&ge.cleanup&&(ie(Ge.cleanup,"cleanup"),_e=Ge.cleanup),new ne((Re,ze)=>{let Pe=Ee(xe,Ge,We=>{_e&&Pe(),We?ze(We):Re()})})}a(pt,"A"),T.exports=Ee,T.exports.finished=pt}),m=r((N,T)=>{var k=d(),{aggregateTwoErrors:p,codes:{ERR_MULTIPLE_CALLBACK:S},AbortError:I}=s(),{Symbol:M}=n(),{kIsDestroyed:U,isDestroyed:B,isFinished:H,isServerRequest:$}=f(),ae=M("kDestroy"),ie=M("kConstruct");function ne(X,W,q){X&&(X.stack,W&&!W.errored&&(W.errored=X),q&&!q.errored&&(q.errored=X))}a(ne,"M");function Ne(X,W){let q=this._readableState,re=this._writableState,Oe=re||q;return re!=null&&re.destroyed||q!=null&&q.destroyed?(typeof W=="function"&&W(),this):(ne(X,re,q),re&&(re.destroyed=!0),q&&(q.destroyed=!0),Oe.constructed?ve(this,X,W):this.once(ae,function(Ee){ve(this,p(Ee,X),W)}),this)}a(Ne,"N");function ve(X,W,q){let re=!1;function Oe(Ee){if(re)return;re=!0;let{_readableState:Be,_writableState:pt}=X;ne(Ee,pt,Be),pt&&(pt.closed=!0),Be&&(Be.closed=!0),typeof q=="function"&&q(Ee),Ee?k.nextTick(he,X,Ee):k.nextTick(Se,X)}a(Oe,"f");try{X._destroy(W||null,Oe)}catch(Ee){Oe(Ee)}}a(ve,"R");function he(X,W){Q(X,W),Se(X)}a(he,"E");function Se(X){let{_readableState:W,_writableState:q}=X;q&&(q.closeEmitted=!0),W&&(W.closeEmitted=!0),(q!=null&&q.emitClose||W!=null&&W.emitClose)&&X.emit("close")}a(Se,"D");function Q(X,W){let{_readableState:q,_writableState:re}=X;re!=null&&re.errorEmitted||q!=null&&q.errorEmitted||(re&&(re.errorEmitted=!0),q&&(q.errorEmitted=!0),X.emit("error",W))}a(Q,"h");function se(){let X=this._readableState,W=this._writableState;X&&(X.constructed=!0,X.closed=!1,X.closeEmitted=!1,X.destroyed=!1,X.errored=null,X.errorEmitted=!1,X.reading=!1,X.ended=X.readable===!1,X.endEmitted=X.readable===!1),W&&(W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1)}a(se,"L");function J(X,W,q){let{_readableState:re,_writableState:Oe}=X;if(Oe!=null&&Oe.destroyed||re!=null&&re.destroyed)return this;re!=null&&re.autoDestroy||Oe!=null&&Oe.autoDestroy?X.destroy(W):W&&(W.stack,Oe&&!Oe.errored&&(Oe.errored=W),re&&!re.errored&&(re.errored=W),q?k.nextTick(Q,X,W):Q(X,W))}a(J,"b");function te(X,W){if(typeof X._construct!="function")return;let{_readableState:q,_writableState:re}=X;q&&(q.constructed=!1),re&&(re.constructed=!1),X.once(ie,W),!(X.listenerCount(ie)>1)&&k.nextTick(de,X)}a(te,"y");function de(X){let W=!1;function q(re){if(W){J(X,re??new S);return}W=!0;let{_readableState:Oe,_writableState:Ee}=X,Be=Ee||Oe;Oe&&(Oe.constructed=!0),Ee&&(Ee.constructed=!0),Be.destroyed?X.emit(ae,re):re?J(X,re,!0):k.nextTick(be,X)}a(q,"X");try{X._construct(re=>{k.nextTick(q,re)})}catch(re){k.nextTick(q,re)}}a(de,"p");function be(X){X.emit(ie)}a(be,"i");function Ae(X){return X?.setHeader&&typeof X.abort=="function"}a(Ae,"$$");function oe(X){X.emit("close")}a(oe,"Q");function Y(X,W){X.emit("error",W),k.nextTick(oe,X)}a(Y,"c");function ee(X,W){!X||B(X)||(!W&&!H(X)&&(W=new I),$(X)?(X.socket=null,X.destroy(W)):Ae(X)?X.abort():Ae(X.req)?X.req.abort():typeof X.destroy=="function"?X.destroy(W):typeof X.close=="function"?X.close():W?k.nextTick(Y,X,W):k.nextTick(oe,X),X.destroyed||(X[U]=!0))}a(ee,"a"),T.exports={construct:te,destroyer:ee,destroy:Ne,undestroy:se,errorOrDestroy:J}}),w=r((N,T)=>{var{ArrayIsArray:k,ObjectSetPrototypeOf:p}=n(),{EventEmitter:S}=(Wd(),qt(Lu));function I(U){S.call(this,U)}a(I,"O"),p(I.prototype,S.prototype),p(I,S),I.prototype.pipe=function(U,B){let H=this;function $(Se){U.writable&&U.write(Se)===!1&&H.pause&&H.pause()}a($,"Z"),H.on("data",$);function ae(){H.readable&&H.resume&&H.resume()}a(ae,"w"),U.on("drain",ae),!U._isStdio&&(!B||B.end!==!1)&&(H.on("end",ne),H.on("close",Ne));let ie=!1;function ne(){ie||(ie=!0,U.end())}a(ne,"M");function Ne(){ie||(ie=!0,typeof U.destroy=="function"&&U.destroy())}a(Ne,"N");function ve(Se){he(),S.listenerCount(this,"error")===0&&this.emit("error",Se)}a(ve,"R"),M(H,"error",ve),M(U,"error",ve);function he(){H.removeListener("data",$),U.removeListener("drain",ae),H.removeListener("end",ne),H.removeListener("close",Ne),H.removeListener("error",ve),U.removeListener("error",ve),H.removeListener("end",he),H.removeListener("close",he),U.removeListener("close",he)}return a(he,"E"),H.on("end",he),H.on("close",he),U.on("close",he),U.emit("pipe",H),U};function M(U,B,H){if(typeof U.prependListener=="function")return U.prependListener(B,H);!U._events||!U._events[B]?U.on(B,H):k(U._events[B])?U._events[B].unshift(H):U._events[B]=[H,U._events[B]]}a(M,"Y"),T.exports={Stream:I,prependListener:M}}),E=r((N,T)=>{var{SymbolDispose:k}=n(),{AbortError:p,codes:S}=s(),{isNodeStream:I,isWebStream:M,kControllerErrorFunction:U}=f(),B=g(),{ERR_INVALID_ARG_TYPE:H}=S,$,ae=a((ie,ne)=>{if(typeof ie!="object"||!("aborted"in ie))throw new H(ne,"AbortSignal",ie)},"w");T.exports.addAbortSignal=function(ie,ne){if(ae(ie,"signal"),!I(ne)&&!M(ne))throw new H("stream",["ReadableStream","WritableStream","Stream"],ne);return T.exports.addAbortSignalNoValidate(ie,ne)},T.exports.addAbortSignalNoValidate=function(ie,ne){if(typeof ie!="object"||!("aborted"in ie))return ne;let Ne=I(ne)?()=>{ne.destroy(new p(void 0,{cause:ie.reason}))}:()=>{ne[U](new p(void 0,{cause:ie.reason}))};if(ie.aborted)Ne();else{$=$||u().addAbortListener;let ve=$(ie,Ne);B(ne,ve[k])}return ne}}),A=r((N,T)=>{var{StringPrototypeSlice:k,SymbolIterator:p,TypedArrayPrototypeSet:S,Uint8Array:I}=n(),{Buffer:M}=(ln(),qt(qr)),{inspect:U}=u();T.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(B){let H={data:B,next:null};this.length>0?this.tail.next=H:this.head=H,this.tail=H,++this.length}unshift(B){let H={data:B,next:this.head};this.length===0&&(this.tail=H),this.head=H,++this.length}shift(){if(this.length===0)return;let B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}clear(){this.head=this.tail=null,this.length=0}join(B){if(this.length===0)return"";let H=this.head,$=""+H.data;for(;(H=H.next)!==null;)$+=B+H.data;return $}concat(B){if(this.length===0)return M.alloc(0);let H=M.allocUnsafe(B>>>0),$=this.head,ae=0;for(;$;)S(H,$.data,ae),ae+=$.data.length,$=$.next;return H}consume(B,H){let $=this.head.data;if(B<$.length){let ae=$.slice(0,B);return this.head.data=$.slice(B),ae}return B===$.length?this.shift():H?this._getString(B):this._getBuffer(B)}first(){return this.head.data}*[p](){for(let B=this.head;B;B=B.next)yield B.data}_getString(B){let H="",$=this.head,ae=0;do{let ie=$.data;if(B>ie.length)H+=ie,B-=ie.length;else{B===ie.length?(H+=ie,++ae,$.next?this.head=$.next:this.head=this.tail=null):(H+=k(ie,0,B),this.head=$,$.data=k(ie,B));break}++ae}while(($=$.next)!==null);return this.length-=ae,H}_getBuffer(B){let H=M.allocUnsafe(B),$=B,ae=this.head,ie=0;do{let ne=ae.data;if(B>ne.length)S(H,ne,$-B),B-=ne.length;else{B===ne.length?(S(H,ne,$-B),++ie,ae.next?this.head=ae.next:this.head=this.tail=null):(S(H,new I(ne.buffer,ne.byteOffset,B),$-B),this.head=ae,ae.data=ne.slice(B));break}++ie}while((ae=ae.next)!==null);return this.length-=ie,H}[Symbol.for("nodejs.util.inspect.custom")](B,H){return U(this,{...H,depth:0,customInspect:!1})}}}),C=r((N,T)=>{var{MathFloor:k,NumberIsInteger:p}=n(),{validateInteger:S}=c(),{ERR_INVALID_ARG_VALUE:I}=s().codes,M=16384,U=16;function B(ie,ne,Ne){return ie.highWaterMark!=null?ie.highWaterMark:ne?ie[Ne]:null}a(B,"W");function H(ie){return ie?U:M}a(H,"T");function $(ie,ne){S(ne,"value",0),ie?U=ne:M=ne}a($,"Z");function ae(ie,ne,Ne,ve){let he=B(ne,ve,Ne);if(he!=null){if(!p(he)||he<0){let Se=ve?`options.${Ne}`:"options.highWaterMark";throw new I(Se,he)}return k(he)}return H(ie.objectMode)}a(ae,"w"),T.exports={getHighWaterMark:ae,getDefaultHighWaterMark:H,setDefaultHighWaterMark:$}}),O=r((N,T)=>{var k=(ln(),qt(qr)),p=k.Buffer;function S(M,U){for(var B in M)U[B]=M[B]}a(S,"K"),p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?T.exports=k:(S(k,N),N.Buffer=I);function I(M,U,B){return p(M,U,B)}a(I,"O"),I.prototype=Object.create(p.prototype),S(p,I),I.from=function(M,U,B){if(typeof M=="number")throw TypeError("Argument must not be a number");return p(M,U,B)},I.alloc=function(M,U,B){if(typeof M!="number")throw TypeError("Argument must be a number");var H=p(M);return U!==void 0?typeof B=="string"?H.fill(U,B):H.fill(U):H.fill(0),H},I.allocUnsafe=function(M){if(typeof M!="number")throw TypeError("Argument must be a number");return p(M)},I.allocUnsafeSlow=function(M){if(typeof M!="number")throw TypeError("Argument must be a number");return k.SlowBuffer(M)}}),R=r(N=>{var T=O().Buffer,k=T.isEncoding||function(Q){switch(Q=""+Q,Q&&Q.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function p(Q){if(!Q)return"utf8";for(var se;;)switch(Q){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return Q;default:if(se)return;Q=(""+Q).toLowerCase(),se=!0}}a(p,"P");function S(Q){var se=p(Q);if(typeof se!="string"&&(T.isEncoding===k||!k(Q)))throw Error("Unknown encoding: "+Q);return se||Q}a(S,"K"),N.StringDecoder=I;function I(Q){this.encoding=S(Q);var se;switch(this.encoding){case"utf16le":this.text=ie,this.end=ne,se=4;break;case"utf8":this.fillLast=H,se=4;break;case"base64":this.text=Ne,this.end=ve,se=3;break;default:this.write=he,this.end=Se;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=T.allocUnsafe(se)}a(I,"O"),I.prototype.write=function(Q){if(Q.length===0)return"";var se,J;if(this.lastNeed){if(se=this.fillLast(Q),se===void 0)return"";J=this.lastNeed,this.lastNeed=0}else J=0;return J<Q.length?se?se+this.text(Q,J):this.text(Q,J):se||""},I.prototype.end=ae,I.prototype.text=$,I.prototype.fillLast=function(Q){if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,Q.length),this.lastNeed-=Q.length};function M(Q){return Q<=127?0:Q>>5===6?2:Q>>4===14?3:Q>>3===30?4:Q>>6===2?-1:-2}a(M,"Y");function U(Q,se,J){var te=se.length-1;if(te<J)return 0;var de=M(se[te]);return de>=0?(de>0&&(Q.lastNeed=de-1),de):--te<J||de===-2?0:(de=M(se[te]),de>=0?(de>0&&(Q.lastNeed=de-2),de):--te<J||de===-2?0:(de=M(se[te]),de>=0?(de>0&&(de===2?de=0:Q.lastNeed=de-3),de):0))}a(U,"v");function B(Q,se,J){if((se[0]&192)!==128)return Q.lastNeed=0,"�";if(Q.lastNeed>1&&se.length>1){if((se[1]&192)!==128)return Q.lastNeed=1,"�";if(Q.lastNeed>2&&se.length>2&&(se[2]&192)!==128)return Q.lastNeed=2,"�"}}a(B,"W");function H(Q){var se=this.lastTotal-this.lastNeed,J=B(this,Q);if(J!==void 0)return J;if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,se,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,se,0,Q.length),this.lastNeed-=Q.length}a(H,"T");function $(Q,se){var J=U(this,Q,se);if(!this.lastNeed)return Q.toString("utf8",se);this.lastTotal=J;var te=Q.length-(J-this.lastNeed);return Q.copy(this.lastChar,0,te),Q.toString("utf8",se,te)}a($,"Z");function ae(Q){var se=Q&&Q.length?this.write(Q):"";return this.lastNeed?se+"�":se}a(ae,"w");function ie(Q,se){if((Q.length-se)%2===0){var J=Q.toString("utf16le",se);if(J){var te=J.charCodeAt(J.length-1);if(te>=55296&&te<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1],J.slice(0,-1)}return J}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Q[Q.length-1],Q.toString("utf16le",se,Q.length-1)}a(ie,"k");function ne(Q){var se=Q&&Q.length?this.write(Q):"";if(this.lastNeed){var J=this.lastTotal-this.lastNeed;return se+this.lastChar.toString("utf16le",0,J)}return se}a(ne,"M");function Ne(Q,se){var J=(Q.length-se)%3;return J===0?Q.toString("base64",se):(this.lastNeed=3-J,this.lastTotal=3,J===1?this.lastChar[0]=Q[Q.length-1]:(this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1]),Q.toString("base64",se,Q.length-J))}a(Ne,"N");function ve(Q){var se=Q&&Q.length?this.write(Q):"";return this.lastNeed?se+this.lastChar.toString("base64",0,3-this.lastNeed):se}a(ve,"R");function he(Q){return Q.toString(this.encoding)}a(he,"E");function Se(Q){return Q&&Q.length?this.write(Q):""}a(Se,"D")}),P=r((N,T)=>{var k=d(),{PromisePrototypeThen:p,SymbolAsyncIterator:S,SymbolIterator:I}=n(),{Buffer:M}=(ln(),qt(qr)),{ERR_INVALID_ARG_TYPE:U,ERR_STREAM_NULL_VALUES:B}=s().codes;function H($,ae,ie){let ne;if(typeof ae=="string"||ae instanceof M)return new $({objectMode:!0,...ie,read(){this.push(ae),this.push(null)}});let Ne;if(ae&&ae[S])Ne=!0,ne=ae[S]();else if(ae&&ae[I])Ne=!1,ne=ae[I]();else throw new U("iterable",["Iterable"],ae);let ve=new $({objectMode:!0,highWaterMark:1,...ie}),he=!1;ve._read=function(){he||(he=!0,Q())},ve._destroy=function(se,J){p(Se(se),()=>k.nextTick(J,se),te=>k.nextTick(J,te||se))};async function Se(se){let J=se!=null,te=typeof ne.throw=="function";if(J&&te){let{value:de,done:be}=await ne.throw(se);if(await de,be)return}if(typeof ne.return=="function"){let{value:de}=await ne.return();await de}}a(Se,"D");async function Q(){for(;;){try{let{value:se,done:J}=Ne?await ne.next():ne.next();if(J)ve.push(null);else{let te=se&&typeof se.then=="function"?await se:se;if(te===null)throw he=!1,new B;if(ve.push(te))continue;he=!1}}catch(se){ve.destroy(se)}break}}return a(Q,"h"),ve}a(H,"T"),T.exports=H}),L=r((N,T)=>{var k=d(),{ArrayPrototypeIndexOf:p,NumberIsInteger:S,NumberIsNaN:I,NumberParseInt:M,ObjectDefineProperties:U,ObjectKeys:B,ObjectSetPrototypeOf:H,Promise:$,SafeSet:ae,SymbolAsyncDispose:ie,SymbolAsyncIterator:ne,Symbol:Ne}=n();T.exports=ke,ke.ReadableState=et;var{EventEmitter:ve}=(Wd(),qt(Lu)),{Stream:he,prependListener:Se}=w(),{Buffer:Q}=(ln(),qt(qr)),{addAbortSignal:se}=E(),J=g(),te=u().debuglog("stream",fe=>{te=fe}),de=A(),be=m(),{getHighWaterMark:Ae,getDefaultHighWaterMark:oe}=C(),{aggregateTwoErrors:Y,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:X,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:re},AbortError:Oe}=s(),{validateObject:Ee}=c(),Be=Ne("kPaused"),{StringDecoder:pt}=R(),xe=P();H(ke.prototype,he.prototype),H(ke,he);var Ge=a(()=>{},"G"),{errorOrDestroy:ge}=be,_e=1,Re=2,ze=4,Pe=8,We=16,_t=32,Ve=64,Te=128,Ye=256,Me=512,$e=1024,mt=2048,ue=4096,me=8192,He=16384,Ie=32768,je=65536,rt=131072,ce=262144;function Ce(fe){return{enumerable:!1,get(){return(this.state&fe)!==0},set(ye){ye?this.state|=fe:this.state&=~fe}}}a(Ce,"B"),U(et.prototype,{objectMode:Ce(_e),ended:Ce(Re),endEmitted:Ce(ze),reading:Ce(Pe),constructed:Ce(We),sync:Ce(_t),needReadable:Ce(Ve),emittedReadable:Ce(Te),readableListening:Ce(Ye),resumeScheduled:Ce(Me),errorEmitted:Ce($e),emitClose:Ce(mt),autoDestroy:Ce(ue),destroyed:Ce(me),closed:Ce(He),closeEmitted:Ce(Ie),multiAwaitDrain:Ce(je),readingMore:Ce(rt),dataEmitted:Ce(ce)});function et(fe,ye,ht){typeof ht!="boolean"&&(ht=ye instanceof Z()),this.state=mt|ue|We|_t,fe&&fe.objectMode&&(this.state|=_e),ht&&fe&&fe.readableObjectMode&&(this.state|=_e),this.highWaterMark=fe?Ae(this,fe,"readableHighWaterMark",ht):oe(!1),this.buffer=new de,this.length=0,this.pipes=[],this.flowing=null,this[Be]=null,fe&&fe.emitClose===!1&&(this.state&=~mt),fe&&fe.autoDestroy===!1&&(this.state&=~ue),this.errored=null,this.defaultEncoding=fe&&fe.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,fe&&fe.encoding&&(this.decoder=new pt(fe.encoding),this.encoding=fe.encoding)}a(et,"H$");function ke(fe){if(!(this instanceof ke))return new ke(fe);let ye=this instanceof Z();this._readableState=new et(fe,this,ye),fe&&(typeof fe.read=="function"&&(this._read=fe.read),typeof fe.destroy=="function"&&(this._destroy=fe.destroy),typeof fe.construct=="function"&&(this._construct=fe.construct),fe.signal&&!ye&&se(fe.signal,this)),he.call(this,fe),be.construct(this,()=>{this._readableState.needReadable&&Ot(this,this._readableState)})}a(ke,"t"),ke.prototype.destroy=be.destroy,ke.prototype._undestroy=be.undestroy,ke.prototype._destroy=function(fe,ye){ye(fe)},ke.prototype[ve.captureRejectionSymbol]=function(fe){this.destroy(fe)},ke.prototype[ie]=function(){let fe;return this.destroyed||(fe=this.readableEnded?null:new Oe,this.destroy(fe)),new $((ye,ht)=>J(this,wt=>wt&&wt!==fe?ht(wt):ye(null)))},ke.prototype.push=function(fe,ye){return tt(this,fe,ye,!1)},ke.prototype.unshift=function(fe,ye){return tt(this,fe,ye,!0)};function tt(fe,ye,ht,wt){te("readableAddChunk",ye);let At=fe._readableState,dn;if((At.state&_e)===0&&(typeof ye=="string"?(ht=ht||At.defaultEncoding,At.encoding!==ht&&(wt&&At.encoding?ye=Q.from(ye,ht).toString(At.encoding):(ye=Q.from(ye,ht),ht=""))):ye instanceof Q?ht="":he._isUint8Array(ye)?(ye=he._uint8ArrayToBuffer(ye),ht=""):ye!=null&&(dn=new ee("chunk",["string","Buffer","Uint8Array"],ye))),dn)ge(fe,dn);else if(ye===null)At.state&=~Pe,Je(fe,At);else if((At.state&_e)!==0||ye&&ye.length>0)if(wt)if((At.state&ze)!==0)ge(fe,new re);else{if(At.destroyed||At.errored)return!1;Tt(fe,At,ye,!0)}else if(At.ended)ge(fe,new q);else{if(At.destroyed||At.errored)return!1;At.state&=~Pe,At.decoder&&!ht?(ye=At.decoder.write(ye),At.objectMode||ye.length!==0?Tt(fe,At,ye,!1):Ot(fe,At)):Tt(fe,At,ye,!1)}else wt||(At.state&=~Pe,Ot(fe,At));return!At.ended&&(At.length<At.highWaterMark||At.length===0)}a(tt,"F");function Tt(fe,ye,ht,wt){ye.flowing&&ye.length===0&&!ye.sync&&fe.listenerCount("data")>0?((ye.state&je)!==0?ye.awaitDrainWriters.clear():ye.awaitDrainWriters=null,ye.dataEmitted=!0,fe.emit("data",ht)):(ye.length+=ye.objectMode?1:ht.length,wt?ye.buffer.unshift(ht):ye.buffer.push(ht),(ye.state&Ve)!==0&&xt(fe)),Ot(fe,ye)}a(Tt,"A$"),ke.prototype.isPaused=function(){let fe=this._readableState;return fe[Be]===!0||fe.flowing===!1},ke.prototype.setEncoding=function(fe){let ye=new pt(fe);this._readableState.decoder=ye,this._readableState.encoding=this._readableState.decoder.encoding;let ht=this._readableState.buffer,wt="";for(let At of ht)wt+=ye.write(At);return ht.clear(),wt!==""&&ht.push(wt),this._readableState.length=wt.length,this};var Ke=1073741824;function st(fe){if(fe>Ke)throw new W("size","<= 1GiB",fe);return fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++,fe}a(st,"z$");function Ze(fe,ye){return fe<=0||ye.length===0&&ye.ended?0:(ye.state&_e)!==0?1:I(fe)?ye.flowing&&ye.length?ye.buffer.first().length:ye.length:fe<=ye.length?fe:ye.ended?ye.length:0}a(Ze,"G6"),ke.prototype.read=function(fe){te("read",fe),fe===void 0?fe=NaN:S(fe)||(fe=M(fe,10));let ye=this._readableState,ht=fe;if(fe>ye.highWaterMark&&(ye.highWaterMark=st(fe)),fe!==0&&(ye.state&=~Te),fe===0&&ye.needReadable&&((ye.highWaterMark!==0?ye.length>=ye.highWaterMark:ye.length>0)||ye.ended))return te("read: emitReadable",ye.length,ye.ended),ye.length===0&&ye.ended?kr(this):xt(this),null;if(fe=Ze(fe,ye),fe===0&&ye.ended)return ye.length===0&&kr(this),null;let wt=(ye.state&Ve)!==0;if(te("need readable",wt),(ye.length===0||ye.length-fe<ye.highWaterMark)&&(wt=!0,te("length less than watermark",wt)),ye.ended||ye.reading||ye.destroyed||ye.errored||!ye.constructed)wt=!1,te("reading, ended or constructing",wt);else if(wt){te("do read"),ye.state|=Pe|_t,ye.length===0&&(ye.state|=Ve);try{this._read(ye.highWaterMark)}catch(dn){ge(this,dn)}ye.state&=~_t,!ye.reading&&(fe=Ze(ht,ye))}let At;return fe>0?At=mr(fe,ye):At=null,At===null?(ye.needReadable=ye.length<=ye.highWaterMark,fe=0):(ye.length-=fe,ye.multiAwaitDrain?ye.awaitDrainWriters.clear():ye.awaitDrainWriters=null),ye.length===0&&(ye.ended||(ye.needReadable=!0),ht!==fe&&ye.ended&&kr(this)),At!==null&&!ye.errorEmitted&&!ye.closeEmitted&&(ye.dataEmitted=!0,this.emit("data",At)),At};function Je(fe,ye){if(te("onEofChunk"),!ye.ended){if(ye.decoder){let ht=ye.decoder.end();ht&&ht.length&&(ye.buffer.push(ht),ye.length+=ye.objectMode?1:ht.length)}ye.ended=!0,ye.sync?xt(fe):(ye.needReadable=!1,ye.emittedReadable=!0,Ft(fe))}}a(Je,"X$");function xt(fe){let ye=fe._readableState;te("emitReadable",ye.needReadable,ye.emittedReadable),ye.needReadable=!1,!ye.emittedReadable&&(te("emitReadable",ye.flowing),ye.emittedReadable=!0,k.nextTick(Ft,fe))}a(xt,"k$");function Ft(fe){let ye=fe._readableState;te("emitReadable_",ye.destroyed,ye.length,ye.ended),!ye.destroyed&&!ye.errored&&(ye.length||ye.ended)&&(fe.emit("readable"),ye.emittedReadable=!1),ye.needReadable=!ye.flowing&&!ye.ended&&ye.length<=ye.highWaterMark,pr(fe)}a(Ft,"B6");function Ot(fe,ye){!ye.readingMore&&ye.constructed&&(ye.readingMore=!0,k.nextTick(nr,fe,ye))}a(Ot,"M$");function nr(fe,ye){for(;!ye.reading&&!ye.ended&&(ye.length<ye.highWaterMark||ye.flowing&&ye.length===0);){let ht=ye.length;if(te("maybeReadMore read 0"),fe.read(0),ht===ye.length)break}ye.readingMore=!1}a(nr,"S$"),ke.prototype._read=function(fe){throw new X("_read()")},ke.prototype.pipe=function(fe,ye){let ht=this,wt=this._readableState;wt.pipes.length===1&&(wt.multiAwaitDrain||(wt.multiAwaitDrain=!0,wt.awaitDrainWriters=new ae(wt.awaitDrainWriters?[wt.awaitDrainWriters]:[]))),wt.pipes.push(fe),te("pipe count=%d opts=%j",wt.pipes.length,ye);let At=(!ye||ye.end!==!1)&&fe!==k.stdout&&fe!==k.stderr?oi:Ql;wt.endEmitted?k.nextTick(At):ht.once("end",At),fe.on("unpipe",dn);function dn(Ps,Ea){te("onunpipe"),Ps===ht&&Ea&&Ea.hasUnpiped===!1&&(Ea.hasUnpiped=!0,hB())}a(dn,"G$");function oi(){te("onend"),fe.end()}a(oi,"V$");let Rs,e1=!1;function hB(){te("cleanup"),fe.removeListener("close",g0),fe.removeListener("finish",b0),Rs&&fe.removeListener("drain",Rs),fe.removeListener("error",m0),fe.removeListener("unpipe",dn),ht.removeListener("end",oi),ht.removeListener("end",Ql),ht.removeListener("data",r1),e1=!0,Rs&&wt.awaitDrainWriters&&(!fe._writableState||fe._writableState.needDrain)&&Rs()}a(hB,"p$");function t1(){e1||(wt.pipes.length===1&&wt.pipes[0]===fe?(te("false write response, pause",0),wt.awaitDrainWriters=fe,wt.multiAwaitDrain=!1):wt.pipes.length>1&&wt.pipes.includes(fe)&&(te("false write response, pause",wt.awaitDrainWriters.size),wt.awaitDrainWriters.add(fe)),ht.pause()),Rs||(Rs=wr(ht,fe),fe.on("drain",Rs))}a(t1,"kq"),ht.on("data",r1);function r1(Ps){te("ondata");let Ea=fe.write(Ps);te("dest.write",Ea),Ea===!1&&t1()}a(r1,"L$");function m0(Ps){if(te("onerror",Ps),Ql(),fe.removeListener("error",m0),fe.listenerCount("error")===0){let Ea=fe._writableState||fe._readableState;Ea&&!Ea.errorEmitted?ge(fe,Ps):fe.emit("error",Ps)}}a(m0,"C$"),Se(fe,"error",m0);function g0(){fe.removeListener("finish",b0),Ql()}a(g0,"l6"),fe.once("close",g0);function b0(){te("onfinish"),fe.removeListener("close",g0),Ql()}a(b0,"w6"),fe.once("finish",b0);function Ql(){te("unpipe"),ht.unpipe(fe)}return a(Ql,"z6"),fe.emit("pipe",ht),fe.writableNeedDrain===!0?t1():wt.flowing||(te("pipe resume"),ht.resume()),fe};function wr(fe,ye){return function(){let ht=fe._readableState;ht.awaitDrainWriters===ye?(te("pipeOnDrain",1),ht.awaitDrainWriters=null):ht.multiAwaitDrain&&(te("pipeOnDrain",ht.awaitDrainWriters.size),ht.awaitDrainWriters.delete(ye)),(!ht.awaitDrainWriters||ht.awaitDrainWriters.size===0)&&fe.listenerCount("data")&&fe.resume()}}a(wr,"Cq"),ke.prototype.unpipe=function(fe){let ye=this._readableState,ht={hasUnpiped:!1};if(ye.pipes.length===0)return this;if(!fe){let At=ye.pipes;ye.pipes=[],this.pause();for(let dn=0;dn<At.length;dn++)At[dn].emit("unpipe",this,{hasUnpiped:!1});return this}let wt=p(ye.pipes,fe);return wt===-1?this:(ye.pipes.splice(wt,1),ye.pipes.length===0&&this.pause(),fe.emit("unpipe",this,ht),this)},ke.prototype.on=function(fe,ye){let ht=he.prototype.on.call(this,fe,ye),wt=this._readableState;return fe==="data"?(wt.readableListening=this.listenerCount("readable")>0,wt.flowing!==!1&&this.resume()):fe==="readable"&&!wt.endEmitted&&!wt.readableListening&&(wt.readableListening=wt.needReadable=!0,wt.flowing=!1,wt.emittedReadable=!1,te("on readable",wt.length,wt.reading),wt.length?xt(this):wt.reading||k.nextTick(er,this)),ht},ke.prototype.addListener=ke.prototype.on,ke.prototype.removeListener=function(fe,ye){let ht=he.prototype.removeListener.call(this,fe,ye);return fe==="readable"&&k.nextTick(ir,this),ht},ke.prototype.off=ke.prototype.removeListener,ke.prototype.removeAllListeners=function(fe){let ye=he.prototype.removeAllListeners.apply(this,arguments);return(fe==="readable"||fe===void 0)&&k.nextTick(ir,this),ye};function ir(fe){let ye=fe._readableState;ye.readableListening=fe.listenerCount("readable")>0,ye.resumeScheduled&&ye[Be]===!1?ye.flowing=!0:fe.listenerCount("data")>0?fe.resume():ye.readableListening||(ye.flowing=null)}a(ir,"E$");function er(fe){te("readable nexttick read 0"),fe.read(0)}a(er,"g$"),ke.prototype.resume=function(){let fe=this._readableState;return fe.flowing||(te("resume"),fe.flowing=!fe.readableListening,Ar(this,fe)),fe[Be]=!1,this};function Ar(fe,ye){ye.resumeScheduled||(ye.resumeScheduled=!0,k.nextTick(Ir,fe,ye))}a(Ar,"Eq");function Ir(fe,ye){te("resume",ye.reading),!ye.reading&&fe.read(0),ye.resumeScheduled=!1,fe.emit("resume"),pr(fe),ye.flowing&&!ye.reading&&fe.read(0)}a(Ir,"b$"),ke.prototype.pause=function(){return te("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(te("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Be]=!0,this};function pr(fe){let ye=fe._readableState;for(te("flow",ye.flowing);ye.flowing&&fe.read()!==null;);}a(pr,"R$"),ke.prototype.wrap=function(fe){let ye=!1;fe.on("data",wt=>{!this.push(wt)&&fe.pause&&(ye=!0,fe.pause())}),fe.on("end",()=>{this.push(null)}),fe.on("error",wt=>{ge(this,wt)}),fe.on("close",()=>{this.destroy()}),fe.on("destroy",()=>{this.destroy()}),this._read=()=>{ye&&fe.resume&&(ye=!1,fe.resume())};let ht=B(fe);for(let wt=1;wt<ht.length;wt++){let At=ht[wt];this[At]===void 0&&typeof fe[At]=="function"&&(this[At]=fe[At].bind(fe))}return this},ke.prototype[ne]=function(){return Sr(this)},ke.prototype.iterator=function(fe){return fe!==void 0&&Ee(fe,"options"),Sr(this,fe)};function Sr(fe,ye){typeof fe.read!="function"&&(fe=ke.wrap(fe,{objectMode:!0}));let ht=or(fe,ye);return ht.stream=fe,ht}a(Sr,"Aq");async function*or(fe,ye){let ht=Ge;function wt(oi){this===fe?(ht(),ht=Ge):ht=oi}a(wt,"O$"),fe.on("readable",wt);let At,dn=J(fe,{writable:!1},oi=>{At=oi?Y(At,oi):null,ht(),ht=Ge});try{for(;;){let oi=fe.destroyed?null:fe.read();if(oi!==null)yield oi;else{if(At)throw At;if(At===null)return;await new $(wt)}}}catch(oi){throw At=Y(At,oi),At}finally{(At||ye?.destroyOnReturn!==!1)&&(At===void 0||fe._readableState.autoDestroy)?be.destroyer(fe,null):(fe.off("readable",wt),dn())}}a(or,"y$"),U(ke.prototype,{readable:{__proto__:null,get(){let fe=this._readableState;return!!fe&&fe.readable!==!1&&!fe.destroyed&&!fe.errorEmitted&&!fe.endEmitted},set(fe){this._readableState&&(this._readableState.readable=!!fe)}},readableDidRead:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:a(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(fe){this._readableState&&(this._readableState.flowing=fe)},"set")},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(fe){this._readableState&&(this._readableState.destroyed=fe)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),U(et.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Be]!==!1},set(fe){this[Be]=!!fe}}}),ke._fromList=mr;function mr(fe,ye){if(ye.length===0)return null;let ht;return ye.objectMode?ht=ye.buffer.shift():!fe||fe>=ye.length?(ye.decoder?ht=ye.buffer.join(""):ye.buffer.length===1?ht=ye.buffer.first():ht=ye.buffer.concat(ye.length),ye.buffer.clear()):ht=ye.buffer.consume(fe,ye.decoder),ht}a(mr,"I$");function kr(fe){let ye=fe._readableState;te("endReadable",ye.endEmitted),!ye.endEmitted&&(ye.ended=!0,k.nextTick(Cr,ye,fe))}a(kr,"Hq");function Cr(fe,ye){if(te("endReadableNT",fe.endEmitted,fe.length),!fe.errored&&!fe.closeEmitted&&!fe.endEmitted&&fe.length===0){if(fe.endEmitted=!0,ye.emit("end"),ye.writable&&ye.allowHalfOpen===!1)k.nextTick(Mr,ye);else if(fe.autoDestroy){let ht=ye._writableState;(!ht||ht.autoDestroy&&(ht.finished||ht.writable===!1))&&ye.destroy()}}}a(Cr,"u$");function Mr(fe){fe.writable&&!fe.writableEnded&&!fe.destroyed&&fe.end()}a(Mr,"x$"),ke.from=function(fe,ye){return xe(ke,fe,ye)};var Or;function zo(){return Or===void 0&&(Or={}),Or}a(zo,"h$"),ke.fromWeb=function(fe,ye){return zo().newStreamReadableFromReadableStream(fe,ye)},ke.toWeb=function(fe,ye){return zo().newReadableStreamFromStreamReadable(fe,ye)},ke.wrap=function(fe,ye){var ht,wt;return new ke({objectMode:(ht=(wt=fe.readableObjectMode)!==null&&wt!==void 0?wt:fe.objectMode)!==null&&ht!==void 0?ht:!0,...ye,destroy(At,dn){be.destroyer(fe,At),dn(At)}}).wrap(fe)}}),j=r((N,T)=>{var k=d(),{ArrayPrototypeSlice:p,Error:S,FunctionPrototypeSymbolHasInstance:I,ObjectDefineProperty:M,ObjectDefineProperties:U,ObjectSetPrototypeOf:B,StringPrototypeToLowerCase:H,Symbol:$,SymbolHasInstance:ae}=n();T.exports=Ee,Ee.WritableState=re;var{EventEmitter:ie}=(Wd(),qt(Lu)),ne=w().Stream,{Buffer:Ne}=(ln(),qt(qr)),ve=m(),{addAbortSignal:he}=E(),{getHighWaterMark:Se,getDefaultHighWaterMark:Q}=C(),{ERR_INVALID_ARG_TYPE:se,ERR_METHOD_NOT_IMPLEMENTED:J,ERR_MULTIPLE_CALLBACK:te,ERR_STREAM_CANNOT_PIPE:de,ERR_STREAM_DESTROYED:be,ERR_STREAM_ALREADY_FINISHED:Ae,ERR_STREAM_NULL_VALUES:oe,ERR_STREAM_WRITE_AFTER_END:Y,ERR_UNKNOWN_ENCODING:ee}=s().codes,{errorOrDestroy:X}=ve;B(Ee.prototype,ne.prototype),B(Ee,ne);function W(){}a(W,"J");var q=$("kOnFinished");function re(ue,me,He){typeof He!="boolean"&&(He=me instanceof Z()),this.objectMode=!!(ue&&ue.objectMode),He&&(this.objectMode=this.objectMode||!!(ue&&ue.writableObjectMode)),this.highWaterMark=ue?Se(this,ue,"writableHighWaterMark",He):Q(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let Ie=!!(ue&&ue.decodeStrings===!1);this.decodeStrings=!Ie,this.defaultEncoding=ue&&ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ge.bind(void 0,me),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Oe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ue||ue.emitClose!==!1,this.autoDestroy=!ue||ue.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}a(re,"H");function Oe(ue){ue.buffered=[],ue.bufferedIndex=0,ue.allBuffers=!0,ue.allNoop=!0}a(Oe,"f"),re.prototype.getBuffer=function(){return p(this.buffered,this.bufferedIndex)},M(re.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ee(ue){let me=this instanceof Z();if(!me&&!I(Ee,this))return new Ee(ue);this._writableState=new re(ue,this,me),ue&&(typeof ue.write=="function"&&(this._write=ue.write),typeof ue.writev=="function"&&(this._writev=ue.writev),typeof ue.destroy=="function"&&(this._destroy=ue.destroy),typeof ue.final=="function"&&(this._final=ue.final),typeof ue.construct=="function"&&(this._construct=ue.construct),ue.signal&&he(ue.signal,this)),ne.call(this,ue),ve.construct(this,()=>{let He=this._writableState;He.writing||Pe(this,He),Te(this,He)})}a(Ee,"V"),M(Ee,ae,{__proto__:null,value:a(function(ue){return I(this,ue)?!0:this!==Ee?!1:ue&&ue._writableState instanceof re},"value")}),Ee.prototype.pipe=function(){X(this,new de)};function Be(ue,me,He,Ie){let je=ue._writableState;if(typeof He=="function")Ie=He,He=je.defaultEncoding;else{if(!He)He=je.defaultEncoding;else if(He!=="buffer"&&!Ne.isEncoding(He))throw new ee(He);typeof Ie!="function"&&(Ie=W)}if(me===null)throw new oe;if(!je.objectMode)if(typeof me=="string")je.decodeStrings!==!1&&(me=Ne.from(me,He),He="buffer");else if(me instanceof Ne)He="buffer";else if(ne._isUint8Array(me))me=ne._uint8ArrayToBuffer(me),He="buffer";else throw new se("chunk",["string","Buffer","Uint8Array"],me);let rt;return je.ending?rt=new Y:je.destroyed&&(rt=new be("write")),rt?(k.nextTick(Ie,rt),X(ue,rt,!0),rt):(je.pendingcb++,pt(ue,je,me,He,Ie))}a(Be,"S"),Ee.prototype.write=function(ue,me,He){return Be(this,ue,me,He)===!0},Ee.prototype.cork=function(){this._writableState.corked++},Ee.prototype.uncork=function(){let ue=this._writableState;ue.corked&&(ue.corked--,!ue.writing&&Pe(this,ue))},Ee.prototype.setDefaultEncoding=function(ue){if(typeof ue=="string"&&(ue=H(ue)),!Ne.isEncoding(ue))throw new ee(ue);return this._writableState.defaultEncoding=ue,this};function pt(ue,me,He,Ie,je){let rt=me.objectMode?1:He.length;me.length+=rt;let ce=me.length<me.highWaterMark;return ce||(me.needDrain=!0),me.writing||me.corked||me.errored||!me.constructed?(me.buffered.push({chunk:He,encoding:Ie,callback:je}),me.allBuffers&&Ie!=="buffer"&&(me.allBuffers=!1),me.allNoop&&je!==W&&(me.allNoop=!1)):(me.writelen=rt,me.writecb=je,me.writing=!0,me.sync=!0,ue._write(He,Ie,me.onwrite),me.sync=!1),ce&&!me.errored&&!me.destroyed}a(pt,"A");function xe(ue,me,He,Ie,je,rt,ce){me.writelen=Ie,me.writecb=ce,me.writing=!0,me.sync=!0,me.destroyed?me.onwrite(new be("write")):He?ue._writev(je,me.onwrite):ue._write(je,rt,me.onwrite),me.sync=!1}a(xe,"z");function Ge(ue,me,He,Ie){--me.pendingcb,Ie(He),ze(me),X(ue,He)}a(Ge,"G");function ge(ue,me){let He=ue._writableState,Ie=He.sync,je=He.writecb;if(typeof je!="function"){X(ue,new te);return}He.writing=!1,He.writecb=null,He.length-=He.writelen,He.writelen=0,me?(me.stack,!He.errored&&(He.errored=me),ue._readableState&&!ue._readableState.errored&&(ue._readableState.errored=me),Ie?k.nextTick(Ge,ue,He,me,je):Ge(ue,He,me,je)):(He.buffered.length>He.bufferedIndex&&Pe(ue,He),Ie?He.afterWriteTickInfo!==null&&He.afterWriteTickInfo.cb===je?He.afterWriteTickInfo.count++:(He.afterWriteTickInfo={count:1,cb:je,stream:ue,state:He},k.nextTick(_e,He.afterWriteTickInfo)):Re(ue,He,1,je))}a(ge,"I");function _e({stream:ue,state:me,count:He,cb:Ie}){return me.afterWriteTickInfo=null,Re(ue,me,He,Ie)}a(_e,"C");function Re(ue,me,He,Ie){for(!me.ending&&!ue.destroyed&&me.length===0&&me.needDrain&&(me.needDrain=!1,ue.emit("drain"));He-- >0;)me.pendingcb--,Ie();me.destroyed&&ze(me),Te(ue,me)}a(Re,"g");function ze(ue){if(ue.writing)return;for(let je=ue.bufferedIndex;je<ue.buffered.length;++je){var me;let{chunk:rt,callback:ce}=ue.buffered[je],Ce=ue.objectMode?1:rt.length;ue.length-=Ce,ce((me=ue.errored)!==null&&me!==void 0?me:new be("write"))}let He=ue[q].splice(0);for(let je=0;je<He.length;je++){var Ie;He[je]((Ie=ue.errored)!==null&&Ie!==void 0?Ie:new be("end"))}Oe(ue)}a(ze,"x");function Pe(ue,me){if(me.corked||me.bufferProcessing||me.destroyed||!me.constructed)return;let{buffered:He,bufferedIndex:Ie,objectMode:je}=me,rt=He.length-Ie;if(!rt)return;let ce=Ie;if(me.bufferProcessing=!0,rt>1&&ue._writev){me.pendingcb-=rt-1;let Ce=me.allNoop?W:ke=>{for(let tt=ce;tt<He.length;++tt)He[tt].callback(ke)},et=me.allNoop&&ce===0?He:p(He,ce);et.allBuffers=me.allBuffers,xe(ue,me,!0,me.length,et,"",Ce),Oe(me)}else{do{let{chunk:Ce,encoding:et,callback:ke}=He[ce];He[ce++]=null;let tt=je?1:Ce.length;xe(ue,me,!1,tt,Ce,et,ke)}while(ce<He.length&&!me.writing);ce===He.length?Oe(me):ce>256?(He.splice(0,ce),me.bufferedIndex=0):me.bufferedIndex=ce}me.bufferProcessing=!1}a(Pe,"l"),Ee.prototype._write=function(ue,me,He){if(this._writev)this._writev([{chunk:ue,encoding:me}],He);else throw new J("_write()")},Ee.prototype._writev=null,Ee.prototype.end=function(ue,me,He){let Ie=this._writableState;typeof ue=="function"?(He=ue,ue=null,me=null):typeof me=="function"&&(He=me,me=null);let je;if(ue!=null){let rt=Be(this,ue,me);rt instanceof S&&(je=rt)}return Ie.corked&&(Ie.corked=1,this.uncork()),je||(!Ie.errored&&!Ie.ending?(Ie.ending=!0,Te(this,Ie,!0),Ie.ended=!0):Ie.finished?je=new Ae("end"):Ie.destroyed&&(je=new be("end"))),typeof He=="function"&&(je||Ie.finished?k.nextTick(He,je):Ie[q].push(He)),this};function We(ue){return ue.ending&&!ue.destroyed&&ue.constructed&&ue.length===0&&!ue.errored&&ue.buffered.length===0&&!ue.finished&&!ue.writing&&!ue.errorEmitted&&!ue.closeEmitted}a(We,"o");function _t(ue,me){let He=!1;function Ie(je){if(He){X(ue,je??te());return}if(He=!0,me.pendingcb--,je){let rt=me[q].splice(0);for(let ce=0;ce<rt.length;ce++)rt[ce](je);X(ue,je,me.sync)}else We(me)&&(me.prefinished=!0,ue.emit("prefinish"),me.pendingcb++,k.nextTick(Ye,ue,me))}a(Ie,"q$"),me.sync=!0,me.pendingcb++;try{ue._final(Ie)}catch(je){Ie(je)}me.sync=!1}a(_t,"T$");function Ve(ue,me){!me.prefinished&&!me.finalCalled&&(typeof ue._final=="function"&&!me.destroyed?(me.finalCalled=!0,_t(ue,me)):(me.prefinished=!0,ue.emit("prefinish")))}a(Ve,"e");function Te(ue,me,He){We(me)&&(Ve(ue,me),me.pendingcb===0&&(He?(me.pendingcb++,k.nextTick((Ie,je)=>{We(je)?Ye(Ie,je):je.pendingcb--},ue,me)):We(me)&&(me.pendingcb++,Ye(ue,me))))}a(Te,"n");function Ye(ue,me){me.pendingcb--,me.finished=!0;let He=me[q].splice(0);for(let Ie=0;Ie<He.length;Ie++)He[Ie]();if(ue.emit("finish"),me.autoDestroy){let Ie=ue._readableState;(!Ie||Ie.autoDestroy&&(Ie.endEmitted||Ie.readable===!1))&&ue.destroy()}}a(Ye,"j$"),U(Ee.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ue){this._writableState&&(this._writableState.destroyed=ue)}},writable:{__proto__:null,get(){let ue=this._writableState;return!!ue&&ue.writable!==!1&&!ue.destroyed&&!ue.errored&&!ue.ending&&!ue.ended},set(ue){this._writableState&&(this._writableState.writable=!!ue)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let ue=this._writableState;return ue?!ue.destroyed&&!ue.ending&&ue.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:a(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var Me=ve.destroy;Ee.prototype.destroy=function(ue,me){let He=this._writableState;return!He.destroyed&&(He.bufferedIndex<He.buffered.length||He[q].length)&&k.nextTick(ze,He),Me.call(this,ue,me),this},Ee.prototype._undestroy=ve.undestroy,Ee.prototype._destroy=function(ue,me){me(ue)},Ee.prototype[ie.captureRejectionSymbol]=function(ue){this.destroy(ue)};var $e;function mt(){return $e===void 0&&($e={}),$e}a(mt,"n$"),Ee.fromWeb=function(ue,me){return mt().newStreamWritableFromWritableStream(ue,me)},Ee.toWeb=function(ue){return mt().newWritableStreamFromStreamWritable(ue)}}),G=r((N,T)=>{var k=d(),p=(ln(),qt(qr)),{isReadable:S,isWritable:I,isIterable:M,isNodeStream:U,isReadableNodeStream:B,isWritableNodeStream:H,isDuplexNodeStream:$,isReadableStream:ae,isWritableStream:ie}=f(),ne=g(),{AbortError:Ne,codes:{ERR_INVALID_ARG_TYPE:ve,ERR_INVALID_RETURN_VALUE:he}}=s(),{destroyer:Se}=m(),Q=Z(),se=L(),J=j(),{createDeferredPromise:te}=u(),de=P(),be=globalThis.Blob||p.Blob,Ae=typeof be<"u"?function(q){return q instanceof be}:function(q){return!1},oe=globalThis.AbortController||l().AbortController,{FunctionPrototypeCall:Y}=n();class ee extends Q{static{a(this,"a")}constructor(re){super(re),re?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),re?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}T.exports=a(function q(re,Oe){if($(re))return re;if(B(re))return W({readable:re});if(H(re))return W({writable:re});if(U(re))return W({writable:!1,readable:!1});if(ae(re))return W({readable:se.fromWeb(re)});if(ie(re))return W({writable:J.fromWeb(re)});if(typeof re=="function"){let{value:Be,write:pt,final:xe,destroy:Ge}=X(re);if(M(Be))return de(ee,Be,{objectMode:!0,write:pt,final:xe,destroy:Ge});let ge=Be?.then;if(typeof ge=="function"){let _e,Re=Y(ge,Be,ze=>{if(ze!=null)throw new he("nully","body",ze)},ze=>{Se(_e,ze)});return _e=new ee({objectMode:!0,readable:!1,write:pt,final(ze){xe(async()=>{try{await Re,k.nextTick(ze,null)}catch(Pe){k.nextTick(ze,Pe)}})},destroy:Ge})}throw new he("Iterable, AsyncIterable or AsyncFunction",Oe,Be)}if(Ae(re))return q(re.arrayBuffer());if(M(re))return de(ee,re,{objectMode:!0,writable:!1});if(ae(re?.readable)&&ie(re?.writable))return ee.fromWeb(re);if(typeof re?.writable=="object"||typeof re?.readable=="object"){let Be=re!=null&&re.readable?B(re?.readable)?re?.readable:q(re.readable):void 0,pt=re!=null&&re.writable?H(re?.writable)?re?.writable:q(re.writable):void 0;return W({readable:Be,writable:pt})}let Ee=re?.then;if(typeof Ee=="function"){let Be;return Y(Ee,re,pt=>{pt!=null&&Be.push(pt),Be.push(null)},pt=>{Se(Be,pt)}),Be=new ee({objectMode:!0,writable:!1,read(){}})}throw new ve(Oe,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],re)},"X");function X(q){let{promise:re,resolve:Oe}=te(),Ee=new oe,Be=Ee.signal;return{value:q((async function*(){for(;;){let pt=re;re=null;let{chunk:xe,done:Ge,cb:ge}=await pt;if(k.nextTick(ge),Ge)return;if(Be.aborted)throw new Ne(void 0,{cause:Be.reason});({promise:re,resolve:Oe}=te()),yield xe}})(),{signal:Be}),write(pt,xe,Ge){let ge=Oe;Oe=null,ge({chunk:pt,done:!1,cb:Ge})},final(pt){let xe=Oe;Oe=null,xe({done:!0,cb:pt})},destroy(pt,xe){Ee.abort(),xe(pt)}}}a(X,"j");function W(q){let re=q.readable&&typeof q.readable.read!="function"?se.wrap(q.readable):q.readable,Oe=q.writable,Ee=!!S(re),Be=!!I(Oe),pt,xe,Ge,ge,_e;function Re(ze){let Pe=ge;ge=null,Pe?Pe(ze):ze&&_e.destroy(ze)}return a(Re,"g"),_e=new ee({readableObjectMode:!!(re!=null&&re.readableObjectMode),writableObjectMode:!!(Oe!=null&&Oe.writableObjectMode),readable:Ee,writable:Be}),Be&&(ne(Oe,ze=>{Be=!1,ze&&Se(re,ze),Re(ze)}),_e._write=function(ze,Pe,We){Oe.write(ze,Pe)?We():pt=We},_e._final=function(ze){Oe.end(),xe=ze},Oe.on("drain",function(){if(pt){let ze=pt;pt=null,ze()}}),Oe.on("finish",function(){if(xe){let ze=xe;xe=null,ze()}})),Ee&&(ne(re,ze=>{Ee=!1,ze&&Se(re,ze),Re(ze)}),re.on("readable",function(){if(Ge){let ze=Ge;Ge=null,ze()}}),re.on("end",function(){_e.push(null)}),_e._read=function(){for(;;){let ze=re.read();if(ze===null){Ge=_e._read;return}if(!_e.push(ze))return}}),_e._destroy=function(ze,Pe){!ze&&ge!==null&&(ze=new Ne),Ge=null,pt=null,xe=null,ge===null?Pe(ze):(ge=Pe,Se(Oe,ze),Se(re,ze))},_e}a(W,"J")}),Z=r((N,T)=>{var{ObjectDefineProperties:k,ObjectGetOwnPropertyDescriptor:p,ObjectKeys:S,ObjectSetPrototypeOf:I}=n();T.exports=B;var M=L(),U=j();I(B.prototype,M.prototype),I(B,M);{let ie=S(U.prototype);for(let ne=0;ne<ie.length;ne++){let Ne=ie[ne];B.prototype[Ne]||(B.prototype[Ne]=U.prototype[Ne])}}function B(ie){if(!(this instanceof B))return new B(ie);M.call(this,ie),U.call(this,ie),ie?(this.allowHalfOpen=ie.allowHalfOpen!==!1,ie.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),ie.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}a(B,"W"),k(B.prototype,{writable:{__proto__:null,...p(U.prototype,"writable")},writableHighWaterMark:{__proto__:null,...p(U.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...p(U.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...p(U.prototype,"writableBuffer")},writableLength:{__proto__:null,...p(U.prototype,"writableLength")},writableFinished:{__proto__:null,...p(U.prototype,"writableFinished")},writableCorked:{__proto__:null,...p(U.prototype,"writableCorked")},writableEnded:{__proto__:null,...p(U.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...p(U.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(ie){this._readableState&&this._writableState&&(this._readableState.destroyed=ie,this._writableState.destroyed=ie)}}});var H;function $(){return H===void 0&&(H={}),H}a($,"Z"),B.fromWeb=function(ie,ne){return $().newStreamDuplexFromReadableWritablePair(ie,ne)},B.toWeb=function(ie){return $().newReadableWritablePairFromDuplex(ie)};var ae;B.from=function(ie){return ae||(ae=G()),ae(ie,"body")}}),K=r((N,T)=>{var{ObjectSetPrototypeOf:k,Symbol:p}=n();T.exports=B;var{ERR_METHOD_NOT_IMPLEMENTED:S}=s().codes,I=Z(),{getHighWaterMark:M}=C();k(B.prototype,I.prototype),k(B,I);var U=p("kCallback");function B(ae){if(!(this instanceof B))return new B(ae);let ie=ae?M(this,ae,"readableHighWaterMark",!0):null;ie===0&&(ae={...ae,highWaterMark:null,readableHighWaterMark:ie,writableHighWaterMark:ae.writableHighWaterMark||0}),I.call(this,ae),this._readableState.sync=!1,this[U]=null,ae&&(typeof ae.transform=="function"&&(this._transform=ae.transform),typeof ae.flush=="function"&&(this._flush=ae.flush)),this.on("prefinish",$)}a(B,"W");function H(ae){typeof this._flush=="function"&&!this.destroyed?this._flush((ie,ne)=>{if(ie){ae?ae(ie):this.destroy(ie);return}ne!=null&&this.push(ne),this.push(null),ae&&ae()}):(this.push(null),ae&&ae())}a(H,"T");function $(){this._final!==H&&H.call(this)}a($,"Z"),B.prototype._final=H,B.prototype._transform=function(ae,ie,ne){throw new S("_transform()")},B.prototype._write=function(ae,ie,ne){let Ne=this._readableState,ve=this._writableState,he=Ne.length;this._transform(ae,ie,(Se,Q)=>{if(Se){ne(Se);return}Q!=null&&this.push(Q),ve.ended||he===Ne.length||Ne.length<Ne.highWaterMark?ne():this[U]=ne})},B.prototype._read=function(){if(this[U]){let ae=this[U];this[U]=null,ae()}}}),z=r((N,T)=>{var{ObjectSetPrototypeOf:k}=n();T.exports=S;var p=K();k(S.prototype,p.prototype),k(S,p);function S(I){if(!(this instanceof S))return new S(I);p.call(this,I)}a(S,"K"),S.prototype._transform=function(I,M,U){U(null,I)}}),V=r((N,T)=>{var k=d(),{ArrayIsArray:p,Promise:S,SymbolAsyncIterator:I,SymbolDispose:M}=n(),U=g(),{once:B}=u(),H=m(),$=Z(),{aggregateTwoErrors:ae,codes:{ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_RETURN_VALUE:ne,ERR_MISSING_ARGS:Ne,ERR_STREAM_DESTROYED:ve,ERR_STREAM_PREMATURE_CLOSE:he},AbortError:Se}=s(),{validateFunction:Q,validateAbortSignal:se}=c(),{isIterable:J,isReadable:te,isReadableNodeStream:de,isNodeStream:be,isTransformStream:Ae,isWebStream:oe,isReadableStream:Y,isReadableFinished:ee}=f(),X=globalThis.AbortController||l().AbortController,W,q,re;function Oe(ze,Pe,We){let _t=!1;ze.on("close",()=>{_t=!0});let Ve=U(ze,{readable:Pe,writable:We},Te=>{_t=!Te});return{destroy:a(Te=>{_t||(_t=!0,H.destroyer(ze,Te||new ve("pipe")))},"destroy"),cleanup:Ve}}a(Oe,"f");function Ee(ze){return Q(ze[ze.length-1],"streams[stream.length - 1]"),ze.pop()}a(Ee,"V");function Be(ze){if(J(ze))return ze;if(de(ze))return pt(ze);throw new ie("val",["Readable","Iterable","AsyncIterable"],ze)}a(Be,"S");async function*pt(ze){q||(q=L()),yield*q.prototype[I].call(ze)}a(pt,"A");async function xe(ze,Pe,We,{end:_t}){let Ve,Te=null,Ye=a(mt=>{if(mt&&(Ve=mt),Te){let ue=Te;Te=null,ue()}},"j$"),Me=a(()=>new S((mt,ue)=>{Ve?ue(Ve):Te=a(()=>{Ve?ue(Ve):mt()},"n")}),"s");Pe.on("drain",Ye);let $e=U(Pe,{readable:!1},Ye);try{Pe.writableNeedDrain&&await Me();for await(let mt of ze)Pe.write(mt)||await Me();_t&&(Pe.end(),await Me()),We()}catch(mt){We(Ve!==mt?ae(Ve,mt):mt)}finally{$e(),Pe.off("drain",Ye)}}a(xe,"z");async function Ge(ze,Pe,We,{end:_t}){Ae(Pe)&&(Pe=Pe.writable);let Ve=Pe.getWriter();try{for await(let Te of ze)await Ve.ready,Ve.write(Te).catch(()=>{});await Ve.ready,_t&&await Ve.close(),We()}catch(Te){try{await Ve.abort(Te),We(Te)}catch(Ye){We(Ye)}}}a(Ge,"G");function ge(...ze){return _e(ze,B(Ee(ze)))}a(ge,"I");function _e(ze,Pe,We){if(ze.length===1&&p(ze[0])&&(ze=ze[0]),ze.length<2)throw new Ne("streams");let _t=new X,Ve=_t.signal,Te=We?.signal,Ye=[];se(Te,"options.signal");function Me(){je(new Se)}a(Me,"s"),re=re||u().addAbortListener;let $e;Te&&($e=re(Te,Me));let mt,ue,me=[],He=0;function Ie(et){je(et,--He===0)}a(Ie,"q$");function je(et,ke){var tt;if(et&&(!mt||mt.code==="ERR_STREAM_PREMATURE_CLOSE")&&(mt=et),!(!mt&&!ke)){for(;me.length;)me.shift()(mt);(tt=$e)===null||tt===void 0||tt[M](),_t.abort(),ke&&(mt||Ye.forEach(Tt=>Tt()),k.nextTick(Pe,mt,ue))}}a(je,"_$");let rt;for(let et=0;et<ze.length;et++){let ke=ze[et],tt=et<ze.length-1,Tt=et>0,Ke=tt||We?.end!==!1,st=et===ze.length-1;if(be(ke)){let Ze=a(function(Je){Je&&Je.name!=="AbortError"&&Je.code!=="ERR_STREAM_PREMATURE_CLOSE"&&Ie(Je)},"X$");if(Ke){let{destroy:Je,cleanup:xt}=Oe(ke,tt,Tt);me.push(Je),te(ke)&&st&&Ye.push(xt)}ke.on("error",Ze),te(ke)&&st&&Ye.push(()=>{ke.removeListener("error",Ze)})}if(et===0)if(typeof ke=="function"){if(rt=ke({signal:Ve}),!J(rt))throw new ne("Iterable, AsyncIterable or Stream","source",rt)}else J(ke)||de(ke)||Ae(ke)?rt=ke:rt=$.from(ke);else if(typeof ke=="function"){if(Ae(rt)){var ce;rt=Be((ce=rt)===null||ce===void 0?void 0:ce.readable)}else rt=Be(rt);if(rt=ke(rt,{signal:Ve}),tt){if(!J(rt,!0))throw new ne("AsyncIterable",`transform[${et-1}]`,rt)}else{var Ce;W||(W=z());let Ze=new W({objectMode:!0}),Je=(Ce=rt)===null||Ce===void 0?void 0:Ce.then;if(typeof Je=="function")He++,Je.call(rt,Ot=>{ue=Ot,Ot!=null&&Ze.write(Ot),Ke&&Ze.end(),k.nextTick(Ie)},Ot=>{Ze.destroy(Ot),k.nextTick(Ie,Ot)});else if(J(rt,!0))He++,xe(rt,Ze,Ie,{end:Ke});else if(Y(rt)||Ae(rt)){let Ot=rt.readable||rt;He++,xe(Ot,Ze,Ie,{end:Ke})}else throw new ne("AsyncIterable or Promise","destination",rt);rt=Ze;let{destroy:xt,cleanup:Ft}=Oe(rt,!1,!0);me.push(xt),st&&Ye.push(Ft)}}else if(be(ke)){if(de(rt)){He+=2;let Ze=Re(rt,ke,Ie,{end:Ke});te(ke)&&st&&Ye.push(Ze)}else if(Ae(rt)||Y(rt)){let Ze=rt.readable||rt;He++,xe(Ze,ke,Ie,{end:Ke})}else if(J(rt))He++,xe(rt,ke,Ie,{end:Ke});else throw new ie("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],rt);rt=ke}else if(oe(ke)){if(de(rt))He++,Ge(Be(rt),ke,Ie,{end:Ke});else if(Y(rt)||J(rt))He++,Ge(rt,ke,Ie,{end:Ke});else if(Ae(rt))He++,Ge(rt.readable,ke,Ie,{end:Ke});else throw new ie("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],rt);rt=ke}else rt=$.from(ke)}return(Ve!=null&&Ve.aborted||Te!=null&&Te.aborted)&&k.nextTick(Me),rt}a(_e,"C");function Re(ze,Pe,We,{end:_t}){let Ve=!1;if(Pe.on("close",()=>{Ve||We(new he)}),ze.pipe(Pe,{end:!1}),_t){let Te=a(function(){Ve=!0,Pe.end()},"j$");ee(ze)?k.nextTick(Te):ze.once("end",Te)}else We();return U(ze,{readable:!0,writable:!1},Te=>{let Ye=ze._readableState;Te&&Te.code==="ERR_STREAM_PREMATURE_CLOSE"&&Ye&&Ye.ended&&!Ye.errored&&!Ye.errorEmitted?ze.once("end",We).once("error",We):We(Te)}),U(Pe,{readable:!1,writable:!0},We)}a(Re,"g"),T.exports={pipelineImpl:_e,pipeline:ge}}),h=r((N,T)=>{var{pipeline:k}=V(),p=Z(),{destroyer:S}=m(),{isNodeStream:I,isReadable:M,isWritable:U,isWebStream:B,isTransformStream:H,isWritableStream:$,isReadableStream:ae}=f(),{AbortError:ie,codes:{ERR_INVALID_ARG_VALUE:ne,ERR_MISSING_ARGS:Ne}}=s(),ve=g();T.exports=function(...he){if(he.length===0)throw new Ne("streams");if(he.length===1)return p.from(he[0]);let Se=[...he];if(typeof he[0]=="function"&&(he[0]=p.from(he[0])),typeof he[he.length-1]=="function"){let X=he.length-1;he[X]=p.from(he[X])}for(let X=0;X<he.length;++X)if(!(!I(he[X])&&!B(he[X]))){if(X<he.length-1&&!(M(he[X])||ae(he[X])||H(he[X])))throw new ne(`streams[${X}]`,Se[X],"must be readable");if(X>0&&!(U(he[X])||$(he[X])||H(he[X])))throw new ne(`streams[${X}]`,Se[X],"must be writable")}let Q,se,J,te,de;function be(X){let W=te;te=null,W?W(X):X?de.destroy(X):!ee&&!Y&&de.destroy()}a(be,"i");let Ae=he[0],oe=k(he,be),Y=!!(U(Ae)||$(Ae)||H(Ae)),ee=!!(M(oe)||ae(oe)||H(oe));if(de=new p({writableObjectMode:!!(Ae!=null&&Ae.writableObjectMode),readableObjectMode:!!(oe!=null&&oe.readableObjectMode),writable:Y,readable:ee}),Y){if(I(Ae))de._write=function(W,q,re){Ae.write(W,q)?re():Q=re},de._final=function(W){Ae.end(),se=W},Ae.on("drain",function(){if(Q){let W=Q;Q=null,W()}});else if(B(Ae)){let W=(H(Ae)?Ae.writable:Ae).getWriter();de._write=async function(q,re,Oe){try{await W.ready,W.write(q).catch(()=>{}),Oe()}catch(Ee){Oe(Ee)}},de._final=async function(q){try{await W.ready,W.close().catch(()=>{}),se=q}catch(re){q(re)}}}let X=H(oe)?oe.readable:oe;ve(X,()=>{if(se){let W=se;se=null,W()}})}if(ee){if(I(oe))oe.on("readable",function(){if(J){let X=J;J=null,X()}}),oe.on("end",function(){de.push(null)}),de._read=function(){for(;;){let X=oe.read();if(X===null){J=de._read;return}if(!de.push(X))return}};else if(B(oe)){let X=(H(oe)?oe.readable:oe).getReader();de._read=async function(){for(;;)try{let{value:W,done:q}=await X.read();if(!de.push(W))return;if(q){de.push(null);return}}catch{return}}}}return de._destroy=function(X,W){!X&&te!==null&&(X=new ie),J=null,Q=null,se=null,te===null?W(X):(te=W,I(oe)&&S(oe,X))},de}}),y=r((N,T)=>{var k=globalThis.AbortController||l().AbortController,{codes:{ERR_INVALID_ARG_VALUE:p,ERR_INVALID_ARG_TYPE:S,ERR_MISSING_ARGS:I,ERR_OUT_OF_RANGE:M},AbortError:U}=s(),{validateAbortSignal:B,validateInteger:H,validateObject:$}=c(),ae=n().Symbol("kWeak"),ie=n().Symbol("kResistStopPropagation"),{finished:ne}=g(),Ne=h(),{addAbortSignalNoValidate:ve}=E(),{isWritable:he,isNodeStream:Se}=f(),{deprecate:Q}=u(),{ArrayPrototypePush:se,Boolean:J,MathFloor:te,Number:de,NumberIsNaN:be,Promise:Ae,PromiseReject:oe,PromiseResolve:Y,PromisePrototypeThen:ee,Symbol:X}=n(),W=X("kEmpty"),q=X("kEof");function re(Te,Ye){if(Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Se(Te)&&!he(Te))throw new p("stream",Te,"must be writable");let Me=Ne(this,Te);return Ye!=null&&Ye.signal&&ve(Ye.signal,Me),Me}a(re,"H");function Oe(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal");let Me=1;Ye?.concurrency!=null&&(Me=te(Ye.concurrency));let $e=Me-1;return Ye?.highWaterMark!=null&&($e=te(Ye.highWaterMark)),H(Me,"options.concurrency",1),H($e,"options.highWaterMark",0),$e+=Me,async function*(){let mt=u().AbortSignalAny([Ye?.signal].filter(J)),ue=this,me=[],He={signal:mt},Ie,je,rt=!1,ce=0;function Ce(){rt=!0,et()}a(Ce,"B");function et(){ce-=1,ke()}a(et,"H$");function ke(){je&&!rt&&ce<Me&&me.length<$e&&(je(),je=null)}a(ke,"t");async function tt(){try{for await(let Tt of ue){if(rt)return;if(mt.aborted)throw new U;try{if(Tt=Te(Tt,He),Tt===W)continue;Tt=Y(Tt)}catch(Ke){Tt=oe(Ke)}ce+=1,ee(Tt,et,Ce),me.push(Tt),Ie&&(Ie(),Ie=null),!rt&&(me.length>=$e||ce>=Me)&&await new Ae(Ke=>{je=Ke})}me.push(q)}catch(Tt){let Ke=oe(Tt);ee(Ke,et,Ce),me.push(Ke)}finally{rt=!0,Ie&&(Ie(),Ie=null)}}a(tt,"F"),tt();try{for(;;){for(;me.length>0;){let Tt=await me[0];if(Tt===q)return;if(mt.aborted)throw new U;Tt!==W&&(yield Tt),me.shift(),ke()}await new Ae(Tt=>{Ie=Tt})}}finally{rt=!0,je&&(je(),je=null)}}.call(this)}a(Oe,"f");function Ee(Te=void 0){return Te!=null&&$(Te,"options"),Te?.signal!=null&&B(Te.signal,"options.signal"),async function*(){let Ye=0;for await(let $e of this){var Me;if(Te!=null&&(Me=Te.signal)!==null&&Me!==void 0&&Me.aborted)throw new U({cause:Te.signal.reason});yield[Ye++,$e]}}.call(this)}a(Ee,"V");async function Be(Te,Ye=void 0){for await(let Me of ge.call(this,Te,Ye))return!0;return!1}a(Be,"S");async function pt(Te,Ye=void 0){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);return!await Be.call(this,async(...Me)=>!await Te(...Me),Ye)}a(pt,"A");async function xe(Te,Ye){for await(let Me of ge.call(this,Te,Ye))return Me}a(xe,"z");async function Ge(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);async function Me($e,mt){return await Te($e,mt),W}a(Me,"s");for await(let $e of Oe.call(this,Me,Ye));}a(Ge,"G");function ge(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);async function Me($e,mt){return await Te($e,mt)?$e:W}return a(Me,"s"),Oe.call(this,Me,Ye)}a(ge,"I");class _e extends I{static{a(this,"C")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Re(Te,Ye,Me){var $e;if(typeof Te!="function")throw new S("reducer",["Function","AsyncFunction"],Te);Me!=null&&$(Me,"options"),Me?.signal!=null&&B(Me.signal,"options.signal");let mt=arguments.length>1;if(Me!=null&&($e=Me.signal)!==null&&$e!==void 0&&$e.aborted){let je=new U(void 0,{cause:Me.signal.reason});throw this.once("error",()=>{}),await ne(this.destroy(je)),je}let ue=new k,me=ue.signal;if(Me!=null&&Me.signal){let je={once:!0,[ae]:this,[ie]:!0};Me.signal.addEventListener("abort",()=>ue.abort(),je)}let He=!1;try{for await(let je of this){var Ie;if(He=!0,Me!=null&&(Ie=Me.signal)!==null&&Ie!==void 0&&Ie.aborted)throw new U;mt?Ye=await Te(Ye,je,{signal:me}):(Ye=je,mt=!0)}if(!He&&!mt)throw new _e}finally{ue.abort()}return Ye}a(Re,"g");async function ze(Te){Te!=null&&$(Te,"options"),Te?.signal!=null&&B(Te.signal,"options.signal");let Ye=[];for await(let $e of this){var Me;if(Te!=null&&(Me=Te.signal)!==null&&Me!==void 0&&Me.aborted)throw new U(void 0,{cause:Te.signal.reason});se(Ye,$e)}return Ye}a(ze,"x");function Pe(Te,Ye){let Me=Oe.call(this,Te,Ye);return async function*(){for await(let $e of Me)yield*$e}.call(this)}a(Pe,"l");function We(Te){if(Te=de(Te),be(Te))return 0;if(Te<0)throw new M("number",">= 0",Te);return Te}a(We,"o");function _t(Te,Ye=void 0){return Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Te=We(Te),async function*(){var Me;if(Ye!=null&&(Me=Ye.signal)!==null&&Me!==void 0&&Me.aborted)throw new U;for await(let mt of this){var $e;if(Ye!=null&&($e=Ye.signal)!==null&&$e!==void 0&&$e.aborted)throw new U;Te--<=0&&(yield mt)}}.call(this)}a(_t,"T$");function Ve(Te,Ye=void 0){return Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Te=We(Te),async function*(){var Me;if(Ye!=null&&(Me=Ye.signal)!==null&&Me!==void 0&&Me.aborted)throw new U;for await(let mt of this){var $e;if(Ye!=null&&($e=Ye.signal)!==null&&$e!==void 0&&$e.aborted)throw new U;if(Te-- >0&&(yield mt),Te<=0)return}}.call(this)}a(Ve,"e"),T.exports.streamReturningOperators={asIndexedPairs:Q(Ee,"readable.asIndexedPairs will be removed in a future version."),drop:_t,filter:ge,flatMap:Pe,map:Oe,take:Ve,compose:re},T.exports.promiseReturningOperators={every:pt,forEach:Ge,reduce:Re,toArray:ze,some:Be,find:xe}}),b=r((N,T)=>{var{ArrayPrototypePop:k,Promise:p}=n(),{isIterable:S,isNodeStream:I,isWebStream:M}=f(),{pipelineImpl:U}=V(),{finished:B}=g();x();function H(...$){return new p((ae,ie)=>{let ne,Ne,ve=$[$.length-1];if(ve&&typeof ve=="object"&&!I(ve)&&!S(ve)&&!M(ve)){let he=k($);ne=he.signal,Ne=he.end}U($,(he,Se)=>{he?ie(he):ae(Se)},{signal:ne,end:Ne})})}a(H,"T"),T.exports={finished:B,pipeline:H}}),x=r((N,T)=>{var{Buffer:k}=(ln(),qt(qr)),{ObjectDefineProperty:p,ObjectKeys:S,ReflectApply:I}=n(),{promisify:{custom:M}}=u(),{streamReturningOperators:U,promiseReturningOperators:B}=y(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=s(),$=h(),{setDefaultHighWaterMark:ae,getDefaultHighWaterMark:ie}=C(),{pipeline:ne}=V(),{destroyer:Ne}=m(),ve=g(),he=b(),Se=f(),Q=T.exports=w().Stream;Q.isDestroyed=Se.isDestroyed,Q.isDisturbed=Se.isDisturbed,Q.isErrored=Se.isErrored,Q.isReadable=Se.isReadable,Q.isWritable=Se.isWritable,Q.Readable=L();for(let J of S(U)){let te=a(function(...be){if(new.target)throw H();return Q.Readable.from(I(de,this,be))},"y"),de=U[J];p(te,"name",{__proto__:null,value:de.name}),p(te,"length",{__proto__:null,value:de.length}),p(Q.Readable.prototype,J,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}for(let J of S(B)){let te=a(function(...be){if(new.target)throw H();return I(de,this,be)},"y"),de=B[J];p(te,"name",{__proto__:null,value:de.name}),p(te,"length",{__proto__:null,value:de.length}),p(Q.Readable.prototype,J,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}Q.Writable=j(),Q.Duplex=Z(),Q.Transform=K(),Q.PassThrough=z(),Q.pipeline=ne;var{addAbortSignal:se}=E();Q.addAbortSignal=se,Q.finished=ve,Q.destroy=Ne,Q.compose=$,Q.setDefaultHighWaterMark=ae,Q.getDefaultHighWaterMark=ie,p(Q,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return he}}),p(ne,M,{__proto__:null,enumerable:!0,get(){return he.pipeline}}),p(ve,M,{__proto__:null,enumerable:!0,get(){return he.finished}}),Q.Stream=Q,Q._isUint8Array=function(J){return J instanceof Uint8Array},Q._uint8ArrayToBuffer=function(J){return k.from(J.buffer,J.byteOffset,J.byteLength)}}),_=r((N,T)=>{rI();{let k=x(),p=b(),S=k.Readable.destroy;T.exports=k.Readable,T.exports._uint8ArrayToBuffer=k._uint8ArrayToBuffer,T.exports._isUint8Array=k._isUint8Array,T.exports.isDisturbed=k.isDisturbed,T.exports.isErrored=k.isErrored,T.exports.isReadable=k.isReadable,T.exports.Readable=k.Readable,T.exports.Writable=k.Writable,T.exports.Duplex=k.Duplex,T.exports.Transform=k.Transform,T.exports.PassThrough=k.PassThrough,T.exports.addAbortSignal=k.addAbortSignal,T.exports.finished=k.finished,T.exports.destroy=k.destroy,T.exports.destroy=S,T.exports.pipeline=k.pipeline,T.exports.compose=k.compose,Object.defineProperty(k,"promises",{configurable:!0,enumerable:!0,get(){return p}}),T.exports.Stream=k.Stream}T.exports.default=T.exports});t.exports=_()}),Ln={};vn(Ln,{webcrypto:a(()=>YI,"webcrypto"),rng:a(()=>uI,"rng"),randomUUID:a(()=>yZ,"randomUUID"),randomFillSync:a(()=>ZI,"randomFillSync"),randomFill:a(()=>HI,"randomFill"),randomBytes:a(()=>cI,"randomBytes"),publicEncrypt:a(()=>UI,"publicEncrypt"),publicDecrypt:a(()=>zI,"publicDecrypt"),pseudoRandomBytes:a(()=>lI,"pseudoRandomBytes"),prng:a(()=>oI,"prng"),privateEncrypt:a(()=>BI,"privateEncrypt"),privateDecrypt:a(()=>FI,"privateDecrypt"),pbkdf2Sync:a(()=>bI,"pbkdf2Sync"),pbkdf2:a(()=>gI,"pbkdf2"),listCiphers:a(()=>TI,"listCiphers"),getRandomValues:a(()=>vZ,"getRandomValues"),getHashes:a(()=>mI,"getHashes"),getDiffieHellman:a(()=>CI,"getDiffieHellman"),getCurves:a(()=>mZ,"getCurves"),getCiphers:a(()=>AI,"getCiphers"),default:a(()=>QI,"default"),createVerify:a(()=>LI,"createVerify"),createSign:a(()=>RI,"createSign"),createHmac:a(()=>pI,"createHmac"),createHash:a(()=>fI,"createHash"),createECDH:a(()=>jI,"createECDH"),createDiffieHellmanGroup:a(()=>II,"createDiffieHellmanGroup"),createDiffieHellman:a(()=>MI,"createDiffieHellman"),createDecipheriv:a(()=>kI,"createDecipheriv"),createDecipher:a(()=>EI,"createDecipher"),createCredentials:a(()=>GI,"createCredentials"),createCipheriv:a(()=>xI,"createCipheriv"),createCipher:a(()=>yI,"createCipher"),constants:a(()=>VI,"constants"),Verify:a(()=>DI,"Verify"),Sign:a(()=>PI,"Sign"),Hmac:a(()=>hI,"Hmac"),Hash:a(()=>dI,"Hash"),DiffieHellmanGroup:a(()=>NI,"DiffieHellmanGroup"),DiffieHellman:a(()=>OI,"DiffieHellman"),Decipheriv:a(()=>SI,"Decipheriv"),Decipher:a(()=>_I,"Decipher"),DEFAULT_ENCODING:a(()=>bZ,"DEFAULT_ENCODING"),Cipheriv:a(()=>wI,"Cipheriv"),Cipher:a(()=>vI,"Cipher")});function mZ(){return WI}a(mZ,"$F");var nI,iI,Iv,aI,sI,gZ=a((e,t,r)=>{r=e!=null?nI(iI(e)):{};let n=t||!e||!e.__esModule?Iv(r,"default",{value:e,enumerable:!0}):r;for(let i of aI(e))sI.call(n,i)||Iv(n,i,{get:a(()=>e[i],"get"),enumerable:!0});return n},"bB"),Qe=a((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"Z$"),Jl,Kl,N0,R1,Yd,Qd,fn,P1,Zo,I0,L1,D1,j1,U1,C0,B1,z1,F1,H1,Z1,G1,V1,W1,Y1,Q1,Go,ql,M0,$1,O0,R0,X1,Vo,$d,Xd,J1,P0,Jd,K1,L0,q1,D0,j0,eE,tE,rE,nE,iE,aE,sE,oE,lE,uE,cE,dE,fE,hE,Kd,U0,pE,B0,mE,gE,bE,vE,qi,ka,z0,Vn,F0,eu,yE,Mn,wE,xE,_E,H0,wi,Wo,Z0,EE,G0,SE,V0,kE,AE,TE,NE,qd,IE,ef,CE,ME,OE,RE,PE,LE,DE,jE,UE,BE,zE,FE,HE,ZE,W0,GE,Yo,VE,Y0,Q0,WE,YE,$0,QE,$E,Qo,XE,JE,KE,qE,e6,t6,X0,r6,J0,K0,q0,tf,eg,n6,tg,i6,a6,rf,s6,o6,l6,u6,Vt,oI,lI,uI,cI,dI,fI,hI,pI,mI,gI,bI,vI,yI,wI,xI,_I,EI,SI,kI,AI,TI,NI,II,CI,MI,OI,RI,PI,LI,DI,jI,UI,BI,zI,FI,HI,ZI,GI,VI,bZ="buffer",vZ=a(e=>crypto.getRandomValues(e),"at"),yZ=a(()=>crypto.randomUUID(),"et"),WI,YI,QI,Qn=$c(()=>{nI=Object.create,{getPrototypeOf:iI,defineProperty:Iv,getOwnPropertyNames:aI}=Object,sI=Object.prototype.hasOwnProperty,Jl=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).randomBytes}),Kl=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).createHash}),N0=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).createHmac}),R1=Qe((e,t)=>{t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),Yd=Qe((e,t)=>{var r=isFinite,n=Math.pow(2,30)-1;t.exports=function(i,s){if(typeof i!="number")throw TypeError("Iterations not a number");if(i<0||!r(i))throw TypeError("Bad iterations");if(typeof s!="number")throw TypeError("Key length not a number");if(s<0||s>n||s!==s)throw TypeError("Bad key length")}}),Qd=Qe((e,t)=>{var r;globalThis.process&&globalThis.process.browser?r="utf-8":globalThis.process&&globalThis.process.version?(n=parseInt(process.version.split(".")[0].slice(1),10),r=n>=6?"utf-8":"binary"):r="utf-8";var n;t.exports=r}),fn=Qe((e,t)=>{var r=(ln(),qt(qr)),n=r.Buffer;function i(o,l){for(var u in o)l[u]=o[u]}a(i,"K"),n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,l,u){return n(o,l,u)}a(s,"O"),s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,l,u){if(typeof o=="number")throw TypeError("Argument must not be a number");return n(o,l,u)},s.alloc=function(o,l,u){if(typeof o!="number")throw TypeError("Argument must be a number");var c=n(o);return l!==void 0?typeof u=="string"?c.fill(l,u):c.fill(l):c.fill(0),c},s.allocUnsafe=function(o){if(typeof o!="number")throw TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw TypeError("Argument must be a number");return r.SlowBuffer(o)}}),P1=Qe((e,t)=>{var r={}.toString;t.exports=Array.isArray||function(n){return r.call(n)=="[object Array]"}}),Zo=Qe((e,t)=>{t.exports=TypeError}),I0=Qe((e,t)=>{t.exports=Object}),L1=Qe((e,t)=>{t.exports=Error}),D1=Qe((e,t)=>{t.exports=EvalError}),j1=Qe((e,t)=>{t.exports=RangeError}),U1=Qe((e,t)=>{t.exports=ReferenceError}),C0=Qe((e,t)=>{t.exports=SyntaxError}),B1=Qe((e,t)=>{t.exports=URIError}),z1=Qe((e,t)=>{t.exports=Math.abs}),F1=Qe((e,t)=>{t.exports=Math.floor}),H1=Qe((e,t)=>{t.exports=Math.max}),Z1=Qe((e,t)=>{t.exports=Math.min}),G1=Qe((e,t)=>{t.exports=Math.pow}),V1=Qe((e,t)=>{t.exports=Math.round}),W1=Qe((e,t)=>{t.exports=Number.isNaN||function(r){return r!==r}}),Y1=Qe((e,t)=>{var r=W1();t.exports=function(n){return r(n)||n===0?n:n<0?-1:1}}),Q1=Qe((e,t)=>{t.exports=Object.getOwnPropertyDescriptor}),Go=Qe((e,t)=>{var r=Q1();if(r)try{r([],"length")}catch{r=null}t.exports=r}),ql=Qe((e,t)=>{var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}t.exports=r}),M0=Qe((e,t)=>{t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},n=Symbol("test"),i=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;r[n]=s;for(var o in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var l=Object.getOwnPropertySymbols(r);if(l.length!==1||l[0]!==n||!Object.prototype.propertyIsEnumerable.call(r,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(r,n);if(u.value!==s||u.enumerable!==!0)return!1}return!0}}),$1=Qe((e,t)=>{var r=typeof Symbol<"u"&&Symbol,n=M0();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()}}),O0=Qe((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),R0=Qe((e,t)=>{var r=I0();t.exports=r.getPrototypeOf||null}),X1=Qe((e,t)=>{var r="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,i=Math.max,s="[object Function]",o=a(function(c,d){for(var f=[],g=0;g<c.length;g+=1)f[g]=c[g];for(var m=0;m<d.length;m+=1)f[m+c.length]=d[m];return f},"Y"),l=a(function(c,d){for(var f=[],g=d,m=0;g<c.length;g+=1,m+=1)f[m]=c[g];return f},"v"),u=a(function(c,d){for(var f="",g=0;g<c.length;g+=1)f+=c[g],g+1<c.length&&(f+=d);return f},"W");t.exports=function(c){var d=this;if(typeof d!="function"||n.apply(d)!==s)throw TypeError(r+d);for(var f=l(arguments,1),g,m=a(function(){if(this instanceof g){var O=d.apply(this,o(f,arguments));return Object(O)===O?O:this}return d.apply(c,o(f,arguments))},"M"),w=i(0,d.length-f.length),E=[],A=0;A<w;A++)E[A]="$"+A;if(g=Function("binder","return function ("+u(E,",")+"){ return binder.apply(this,arguments); }")(m),d.prototype){var C=a(function(){},"D");C.prototype=d.prototype,g.prototype=new C,C.prototype=null}return g}}),Vo=Qe((e,t)=>{var r=X1();t.exports=Function.prototype.bind||r}),$d=Qe((e,t)=>{t.exports=Function.prototype.call}),Xd=Qe((e,t)=>{t.exports=Function.prototype.apply}),J1=Qe((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),P0=Qe((e,t)=>{var r=Vo(),n=Xd(),i=$d(),s=J1();t.exports=s||r.call(i,n)}),Jd=Qe((e,t)=>{var r=Vo(),n=Zo(),i=$d(),s=P0();t.exports=function(o){if(o.length<1||typeof o[0]!="function")throw new n("a function is required");return s(r,i,o)}}),K1=Qe((e,t)=>{var r=Jd(),n=Go(),i;try{i=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var s=!!i&&n&&n(Object.prototype,"__proto__"),o=Object,l=o.getPrototypeOf;t.exports=s&&typeof s.get=="function"?r([s.get]):typeof l=="function"?function(u){return l(u==null?u:o(u))}:!1}),L0=Qe((e,t)=>{var r=O0(),n=R0(),i=K1();t.exports=r?function(s){return r(s)}:n?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw TypeError("getProto: not an object");return n(s)}:i?function(s){return i(s)}:null}),q1=Qe((e,t)=>{var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=Vo();t.exports=i.call(r,n)}),D0=Qe((e,t)=>{var r,n=I0(),i=L1(),s=D1(),o=j1(),l=U1(),u=C0(),c=Zo(),d=B1(),f=z1(),g=F1(),m=H1(),w=Z1(),E=G1(),A=V1(),C=Y1(),O=Function,R=a(function(Ne){try{return O('"use strict"; return ('+Ne+").constructor;")()}catch{}},"L"),P=Go(),L=ql(),j=a(function(){throw new c},"p"),G=P?(function(){try{return arguments.callee,j}catch{try{return P(arguments,"callee").get}catch{return j}}})():j,Z=$1()(),K=L0(),z=R0(),V=O0(),h=Xd(),y=$d(),b={},x=typeof Uint8Array>"u"||!K?r:K(Uint8Array),_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&K?K([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":O,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&K?K(K([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Z||!K?r:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":o,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Z||!K?r:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&K?K(""[Symbol.iterator]()):r,"%Symbol%":Z?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":G,"%TypedArray%":x,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":d,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":y,"%Function.prototype.apply%":h,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":z,"%Math.abs%":f,"%Math.floor%":g,"%Math.max%":m,"%Math.min%":w,"%Math.pow%":E,"%Math.round%":A,"%Math.sign%":C,"%Reflect.getPrototypeOf%":V};if(K)try{null.error}catch(Ne){N=K(K(Ne)),_["%Error.prototype%"]=N}var N,T=a(function Ne(ve){var he;if(ve==="%AsyncFunction%")he=R("async function () {}");else if(ve==="%GeneratorFunction%")he=R("function* () {}");else if(ve==="%AsyncGeneratorFunction%")he=R("async function* () {}");else if(ve==="%AsyncGenerator%"){var Se=Ne("%AsyncGeneratorFunction%");Se&&(he=Se.prototype)}else if(ve==="%AsyncIteratorPrototype%"){var Q=Ne("%AsyncGenerator%");Q&&K&&(he=K(Q.prototype))}return _[ve]=he,he},"j$"),k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},p=Vo(),S=q1(),I=p.call(y,Array.prototype.concat),M=p.call(h,Array.prototype.splice),U=p.call(y,String.prototype.replace),B=p.call(y,String.prototype.slice),H=p.call(y,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,ie=a(function(Ne){var ve=B(Ne,0,1),he=B(Ne,-1);if(ve==="%"&&he!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(he==="%"&&ve!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var Se=[];return U(Ne,$,function(Q,se,J,te){Se[Se.length]=J?U(te,ae,"$1"):se||Q}),Se},"e"),ne=a(function(Ne,ve){var he=Ne,Se;if(S(k,he)&&(Se=k[he],he="%"+Se[0]+"%"),S(_,he)){var Q=_[he];if(Q===b&&(Q=T(he)),typeof Q>"u"&&!ve)throw new c("intrinsic "+Ne+" exists, but is not available. Please file an issue!");return{alias:Se,name:he,value:Q}}throw new u("intrinsic "+Ne+" does not exist!")},"n");t.exports=function(Ne,ve){if(typeof Ne!="string"||Ne.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ve!="boolean")throw new c('"allowMissing" argument must be a boolean');if(H(/^%?[^%]*%?$/,Ne)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var he=ie(Ne),Se=he.length>0?he[0]:"",Q=ne("%"+Se+"%",ve),se=Q.name,J=Q.value,te=!1,de=Q.alias;de&&(Se=de[0],M(he,I([0,1],de)));for(var be=1,Ae=!0;be<he.length;be+=1){var oe=he[be],Y=B(oe,0,1),ee=B(oe,-1);if((Y==='"'||Y==="'"||Y==="`"||ee==='"'||ee==="'"||ee==="`")&&Y!==ee)throw new u("property names with quotes must have matching quotes");if((oe==="constructor"||!Ae)&&(te=!0),Se+="."+oe,se="%"+Se+"%",S(_,se))J=_[se];else if(J!=null){if(!(oe in J)){if(!ve)throw new c("base intrinsic for "+Ne+" exists, but the property is not available.");return}if(P&&be+1>=he.length){var X=P(J,oe);Ae=!!X,Ae&&"get"in X&&!("originalValue"in X.get)?J=X.get:J=J[oe]}else Ae=S(J,oe),J=J[oe];Ae&&!te&&(_[se]=J)}}return J}}),j0=Qe((e,t)=>{var r=D0(),n=Jd(),i=n([r("%String.prototype.indexOf%")]);t.exports=function(s,o){var l=r(s,!!o);return typeof l=="function"&&i(s,".prototype.")>-1?n([l]):l}}),eE=Qe((e,t)=>{var r=Function.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,i,s;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{i=Object.defineProperty({},"length",{get:a(function(){throw s},"get")}),s={},n(function(){throw 42},null,i)}catch(P){P!==s&&(n=null)}else n=null;var o=/^\s*class\b/,l=a(function(P){try{var L=r.call(P);return o.test(L)}catch{return!1}},"v"),u=a(function(P){try{return l(P)?!1:(r.call(P),!0)}catch{return!1}},"W"),c=Object.prototype.toString,d="[object Object]",f="[object Function]",g="[object GeneratorFunction]",m="[object HTMLAllCollection]",w="[object HTML document.all class]",E="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,C=!(0 in[,]),O=a(function(){return!1},"h");typeof document=="object"&&(R=document.all,c.call(R)===c.call(document.all)&&(O=a(function(P){if((C||!P)&&(typeof P>"u"||typeof P=="object"))try{var L=c.call(P);return(L===m||L===w||L===E||L===d)&&P("")==null}catch{}return!1},"h")));var R;t.exports=n?function(P){if(O(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{n(P,null,i)}catch(L){if(L!==s)return!1}return!l(P)&&u(P)}:function(P){if(O(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(A)return u(P);if(l(P))return!1;var L=c.call(P);return L!==f&&L!==g&&!/^\[object HTML/.test(L)?!1:u(P)}}),tE=Qe((e,t)=>{var r=eE(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=a(function(c,d,f){for(var g=0,m=c.length;g<m;g++)i.call(c,g)&&(f==null?d(c[g],g,c):d.call(f,c[g],g,c))},"O"),o=a(function(c,d,f){for(var g=0,m=c.length;g<m;g++)f==null?d(c.charAt(g),g,c):d.call(f,c.charAt(g),g,c)},"Y"),l=a(function(c,d,f){for(var g in c)i.call(c,g)&&(f==null?d(c[g],g,c):d.call(f,c[g],g,c))},"v");function u(c){return n.call(c)==="[object Array]"}a(u,"W"),t.exports=function(c,d,f){if(!r(d))throw TypeError("iterator must be a function");var g;arguments.length>=3&&(g=f),u(c)?s(c,d,g):typeof c=="string"?o(c,d,g):l(c,d,g)}}),rE=Qe((e,t)=>{t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),nE=Qe((e,t)=>{var r=rE(),n=globalThis;t.exports=function(){for(var i=[],s=0;s<r.length;s++)typeof n[r[s]]=="function"&&(i[i.length]=r[s]);return i}}),iE=Qe((e,t)=>{var r=ql(),n=C0(),i=Zo(),s=Go();t.exports=function(o,l,u){if(!o||typeof o!="object"&&typeof o!="function")throw new i("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,g=arguments.length>6?arguments[6]:!1,m=!!s&&s(o,l);if(r)r(o,l,{configurable:f===null&&m?m.configurable:!f,enumerable:c===null&&m?m.enumerable:!c,value:u,writable:d===null&&m?m.writable:!d});else if(g||!c&&!d&&!f)o[l]=u;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),aE=Qe((e,t)=>{var r=ql(),n=a(function(){return!!r},"P");n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},t.exports=n}),sE=Qe((e,t)=>{var r=D0(),n=iE(),i=aE()(),s=Go(),o=Zo(),l=r("%Math.floor%");t.exports=function(u,c){if(typeof u!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||l(c)!==c)throw new o("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],f=!0,g=!0;if("length"in u&&s){var m=s(u,"length");m&&!m.configurable&&(f=!1),m&&!m.writable&&(g=!1)}return(f||g||!d)&&(i?n(u,"length",c,!0,!0):n(u,"length",c)),u}}),oE=Qe((e,t)=>{var r=Vo(),n=Xd(),i=P0();t.exports=function(){return i(r,n,arguments)}}),lE=Qe((e,t)=>{var r=sE(),n=ql(),i=Jd(),s=oE();t.exports=function(o){var l=i(arguments),u=o.length-(arguments.length-1);return r(l,1+(u>0?u:0),!0)},n?n(t.exports,"apply",{value:s}):t.exports.apply=s}),uE=Qe((e,t)=>{var r=M0();t.exports=function(){return r()&&!!Symbol.toStringTag}}),cE=Qe((e,t)=>{var r=tE(),n=nE(),i=lE(),s=j0(),o=Go(),l=L0(),u=s("Object.prototype.toString"),c=uE()(),d=globalThis,f=n(),g=s("String.prototype.slice"),m=s("Array.prototype.indexOf",!0)||function(C,O){for(var R=0;R<C.length;R+=1)if(C[R]===O)return R;return-1},w={__proto__:null};c&&o&&l?r(f,function(C){var O=new d[C];if(Symbol.toStringTag in O&&l){var R=l(O),P=o(R,Symbol.toStringTag);if(!P&&R){var L=l(R);P=o(L,Symbol.toStringTag)}w["$"+C]=i(P.get)}}):r(f,function(C){var O=new d[C],R=O.slice||O.set;R&&(w["$"+C]=i(R))});var E=a(function(C){var O=!1;return r(w,function(R,P){if(!O)try{"$"+R(C)===P&&(O=g(P,1))}catch{}}),O},"R"),A=a(function(C){var O=!1;return r(w,function(R,P){if(!O)try{R(C),O=g(P,1)}catch{}}),O},"E");t.exports=function(C){if(!C||typeof C!="object")return!1;if(!c){var O=g(u(C),8,-1);return m(f,O)>-1?O:O!=="Object"?!1:A(C)}return o?E(C):null}}),dE=Qe((e,t)=>{var r=cE();t.exports=function(n){return!!r(n)}}),fE=Qe((e,t)=>{var r=Zo(),n=j0(),i=n("TypedArray.prototype.buffer",!0),s=dE();t.exports=i||function(o){if(!s(o))throw new r("Not a Typed Array");return o.buffer}}),hE=Qe((e,t)=>{var r=fn().Buffer,n=P1(),i=fE(),s=ArrayBuffer.isView||function(c){try{return i(c),!0}catch{return!1}},o=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u=l&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);t.exports=function(c,d){if(r.isBuffer(c))return c.constructor&&!("isBuffer"in c)?r.from(c):c;if(typeof c=="string")return r.from(c,d);if(l&&s(c)){if(c.byteLength===0)return r.alloc(0);if(u){var f=r.from(c.buffer,c.byteOffset,c.byteLength);if(f.byteLength===c.byteLength)return f}var g=c instanceof Uint8Array?c:new Uint8Array(c.buffer,c.byteOffset,c.byteLength),m=r.from(g);if(m.length===c.byteLength)return m}if(o&&c instanceof Uint8Array)return r.from(c);var w=n(c);if(w)for(var E=0;E<c.length;E+=1){var A=c[E];if(typeof A!="number"||A<0||A>255||~~A!==A)throw RangeError("Array items must be numbers in the range 0-255.")}if(w||r.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return r.from(c);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),Kd=Qe((e,t)=>{var r=fn().Buffer,n=hE(),i=typeof Uint8Array<"u",s=i&&typeof ArrayBuffer<"u",o=s&&ArrayBuffer.isView;t.exports=function(l,u,c){if(typeof l=="string"||r.isBuffer(l)||i&&l instanceof Uint8Array||o&&o(l))return n(l,u);throw TypeError(c+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),U0=Qe((e,t)=>{var r={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},n={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},i=N0(),s=fn().Buffer,o=Yd(),l=Qd(),u=Kd();function c(d,f,g,m,w){o(g,m),d=u(d,l,"Password"),f=u(f,l,"Salt");var E=(w||"sha1").toLowerCase(),A=n[E]||E,C=r[A];if(typeof C!="number"||!C)throw TypeError("Digest algorithm not supported: "+w);var O=s.allocUnsafe(m),R=s.allocUnsafe(f.length+4);f.copy(R,0,0,f.length);for(var P=0,L=C,j=Math.ceil(m/L),G=1;G<=j;G++){R.writeUInt32BE(G,f.length);for(var Z=i(A,d).update(R).digest(),K=Z,z=1;z<g;z++){K=i(A,d).update(K).digest();for(var V=0;V<L;V++)Z[V]^=K[V]}Z.copy(O,P),P+=L}return O}a(c,"T"),t.exports=c}),pE=Qe((e,t)=>{var r=fn().Buffer,n=Yd(),i=Qd(),s=U0(),o=Kd(),l,u=globalThis.crypto&&globalThis.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[],f;function g(){return f||(globalThis.process&&globalThis.process.nextTick?f=globalThis.process.nextTick:globalThis.queueMicrotask?f=globalThis.queueMicrotask:globalThis.setImmediate?f=globalThis.setImmediate:f=globalThis.setTimeout,f)}a(g,"k");function m(A,C,O,R,P){return u.importKey("raw",A,{name:"PBKDF2"},!1,["deriveBits"]).then(function(L){return u.deriveBits({name:"PBKDF2",salt:C,iterations:O,hash:{name:P}},L,R<<3)}).then(function(L){return r.from(L)})}a(m,"M");function w(A){if(globalThis.process&&!globalThis.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(d[A]!==void 0)return d[A];l=l||r.alloc(8);var C=m(l,l,10,128,A).then(function(){return!0},function(){return!1});return d[A]=C,C}a(w,"N");function E(A,C){A.then(function(O){g()(function(){C(null,O)})},function(O){g()(function(){C(O)})})}a(E,"R"),t.exports=function(A,C,O,R,P,L){if(typeof P=="function"&&(L=P,P=void 0),n(O,R),A=o(A,i,"Password"),C=o(C,i,"Salt"),typeof L!="function")throw Error("No callback provided to pbkdf2");P=P||"sha1";var j=c[P.toLowerCase()];if(!j||typeof globalThis.Promise!="function"){g()(function(){var G;try{G=s(A,C,O,R,P)}catch(Z){L(Z);return}L(null,G)});return}E(w(j).then(function(G){return G?m(A,C,O,R,j):s(A,C,O,R,P)}),L)}}),B0=Qe(e=>{var t=(Qn(),qt(Ln)),r=Yd(),n=Qd(),i=Kd();function s(l,u,c,d,f,g){if(r(c,d),l=i(l,n,"Password"),u=i(u,n,"Salt"),typeof f=="function"&&(g=f,f="sha1"),typeof g!="function")throw Error("No callback provided to pbkdf2");return t.pbkdf2(l,u,c,d,f,g)}a(s,"O");function o(l,u,c,d,f){return r(c,d),l=i(l,n,"Password"),u=i(u,n,"Salt"),f=f||"sha1",t.pbkdf2Sync(l,u,c,d,f)}a(o,"Y"),!t.pbkdf2Sync||t.pbkdf2Sync.toString().indexOf("keylen, digest")===-1?(e.pbkdf2Sync=U0(),e.pbkdf2=pE()):(e.pbkdf2Sync=o,e.pbkdf2=s)}),mE=Qe(e=>{var t=(Qn(),qt(Ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),gE=Qe(e=>{var t=(Qn(),qt(Ln));e.DiffieHellmanGroup=t.DiffieHellmanGroup,e.createDiffieHellmanGroup=t.createDiffieHellmanGroup,e.getDiffieHellman=t.getDiffieHellman,e.createDiffieHellman=t.createDiffieHellman,e.DiffieHellman=t.DiffieHellman}),bE=Qe(e=>{var t=(Qn(),qt(Ln));e.createSign=t.createSign,e.Sign=t.Sign,e.createVerify=t.createVerify,e.Verify=t.Verify}),vE=Qe((e,t)=>{t.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),qi=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,_t=_[3]|0,Ve=_t&8191,Te=_t>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var xt=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=xt,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),ka=Qe((e,t)=>{t.exports=r;function r(n,i){if(!n)throw Error(i||"Assertion failed")}a(r,"_"),r.equal=function(n,i,s){if(n!=i)throw Error(s||"Assertion failed: "+n+" != "+i)}}),z0=Qe(e=>{var t=e;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var l=[];if(typeof s!="string"){for(var u=0;u<s.length;u++)l[u]=s[u]|0;return l}if(o==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var u=0;u<s.length;u+=2)l.push(parseInt(s[u]+s[u+1],16))}else for(var u=0;u<s.length;u++){var c=s.charCodeAt(u),d=c>>8,f=c&255;d?l.push(d,f):l.push(f)}return l}a(r,"_"),t.toArray=r;function n(s){return s.length===1?"0"+s:s}a(n,"P"),t.zero2=n;function i(s){for(var o="",l=0;l<s.length;l++)o+=n(s[l].toString(16));return o}a(i,"K"),t.toHex=i,t.encode=function(s,o){return o==="hex"?i(s):s}}),Vn=Qe(e=>{var t=e,r=qi(),n=ka(),i=z0();t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode;function s(d,f,g){var m=Array(Math.max(d.bitLength(),g)+1),w;for(w=0;w<m.length;w+=1)m[w]=0;var E=1<<f+1,A=d.clone();for(w=0;w<m.length;w++){var C,O=A.andln(E-1);A.isOdd()?(O>(E>>1)-1?C=(E>>1)-O:C=O,A.isubn(C)):C=0,m[w]=C,A.iushrn(1)}return m}a(s,"O"),t.getNAF=s;function o(d,f){var g=[[],[]];d=d.clone(),f=f.clone();for(var m=0,w=0,E;d.cmpn(-m)>0||f.cmpn(-w)>0;){var A=d.andln(3)+m&3,C=f.andln(3)+w&3;A===3&&(A=-1),C===3&&(C=-1);var O;(A&1)===0?O=0:(E=d.andln(7)+m&7,(E===3||E===5)&&C===2?O=-A:O=A),g[0].push(O);var R;(C&1)===0?R=0:(E=f.andln(7)+w&7,(E===3||E===5)&&A===2?R=-C:R=C),g[1].push(R),2*m===O+1&&(m=1-m),2*w===R+1&&(w=1-w),d.iushrn(1),f.iushrn(1)}return g}a(o,"Y"),t.getJSF=o;function l(d,f,g){var m="_"+f;d.prototype[f]=function(){return this[m]!==void 0?this[m]:this[m]=g.call(this)}}a(l,"v"),t.cachedProperty=l;function u(d){return typeof d=="string"?t.toArray(d,"hex"):d}a(u,"W"),t.parseBytes=u;function c(d){return new r(d,"hex","le")}a(c,"T"),t.intFromLE=c}),F0=Qe((e,t)=>{var r;t.exports=function(s){return r||(r=new n(null)),r.generate(s)};function n(s){this.rand=s}if(a(n,"P"),t.exports.Rand=n,n.prototype.generate=function(s){return this._rand(s)},n.prototype._rand=function(s){if(this.rand.getBytes)return this.rand.getBytes(s);for(var o=new Uint8Array(s),l=0;l<o.length;l++)o[l]=this.rand.getByte();return o},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(s){var o=new Uint8Array(s);return self.crypto.getRandomValues(o),o}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(s){var o=new Uint8Array(s);return self.msCrypto.getRandomValues(o),o}:typeof window=="object"&&(n.prototype._rand=function(){throw Error("Not implemented yet")});else try{if(i=(Qn(),qt(Ln)),typeof i.randomBytes!="function")throw Error("Not supported");n.prototype._rand=function(s){return i.randomBytes(s)}}catch{}var i}),eu=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.getNAF,s=n.getJSF,o=n.assert;function l(c,d){this.type=c,this.p=new r(d.p,16),this.red=d.prime?r.red(d.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=d.n&&new r(d.n,16),this.g=d.g&&this.pointFromJSON(d.g,d.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);!f||f.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}a(l,"v"),t.exports=l,l.prototype.point=function(){throw Error("Not implemented")},l.prototype.validate=function(){throw Error("Not implemented")},l.prototype._fixedNafMul=function(c,d){o(c.precomputed);var f=c._getDoubles(),g=i(d,1,this._bitLength),m=(1<<f.step+1)-(f.step%2===0?2:1);m/=3;var w=[],E,A;for(E=0;E<g.length;E+=f.step){A=0;for(var C=E+f.step-1;C>=E;C--)A=(A<<1)+g[C];w.push(A)}for(var O=this.jpoint(null,null,null),R=this.jpoint(null,null,null),P=m;P>0;P--){for(E=0;E<w.length;E++)A=w[E],A===P?R=R.mixedAdd(f.points[E]):A===-P&&(R=R.mixedAdd(f.points[E].neg()));O=O.add(R)}return O.toP()},l.prototype._wnafMul=function(c,d){var f=4,g=c._getNAFPoints(f);f=g.wnd;for(var m=g.points,w=i(d,f,this._bitLength),E=this.jpoint(null,null,null),A=w.length-1;A>=0;A--){for(var C=0;A>=0&&w[A]===0;A--)C++;if(A>=0&&C++,E=E.dblp(C),A<0)break;var O=w[A];o(O!==0),c.type==="affine"?O>0?E=E.mixedAdd(m[O-1>>1]):E=E.mixedAdd(m[-O-1>>1].neg()):O>0?E=E.add(m[O-1>>1]):E=E.add(m[-O-1>>1].neg())}return c.type==="affine"?E.toP():E},l.prototype._wnafMulAdd=function(c,d,f,g,m){var w=this._wnafT1,E=this._wnafT2,A=this._wnafT3,C=0,O,R,P;for(O=0;O<g;O++){P=d[O];var L=P._getNAFPoints(c);w[O]=L.wnd,E[O]=L.points}for(O=g-1;O>=1;O-=2){var j=O-1,G=O;if(w[j]!==1||w[G]!==1){A[j]=i(f[j],w[j],this._bitLength),A[G]=i(f[G],w[G],this._bitLength),C=Math.max(A[j].length,C),C=Math.max(A[G].length,C);continue}var Z=[d[j],null,null,d[G]];d[j].y.cmp(d[G].y)===0?(Z[1]=d[j].add(d[G]),Z[2]=d[j].toJ().mixedAdd(d[G].neg())):d[j].y.cmp(d[G].y.redNeg())===0?(Z[1]=d[j].toJ().mixedAdd(d[G]),Z[2]=d[j].add(d[G].neg())):(Z[1]=d[j].toJ().mixedAdd(d[G]),Z[2]=d[j].toJ().mixedAdd(d[G].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],z=s(f[j],f[G]);for(C=Math.max(z[0].length,C),A[j]=Array(C),A[G]=Array(C),R=0;R<C;R++){var V=z[0][R]|0,h=z[1][R]|0;A[j][R]=K[(V+1)*3+(h+1)],A[G][R]=0,E[j]=Z}}var y=this.jpoint(null,null,null),b=this._wnafT4;for(O=C;O>=0;O--){for(var x=0;O>=0;){var _=!0;for(R=0;R<g;R++)b[R]=A[R][O]|0,b[R]!==0&&(_=!1);if(!_)break;x++,O--}if(O>=0&&x++,y=y.dblp(x),O<0)break;for(R=0;R<g;R++){var N=b[R];N!==0&&(N>0?P=E[R][N-1>>1]:N<0&&(P=E[R][-N-1>>1].neg()),P.type==="affine"?y=y.mixedAdd(P):y=y.add(P))}}for(O=0;O<g;O++)E[O]=null;return m?y:y.toP()};function u(c,d){this.curve=c,this.type=d,this.precomputed=null}a(u,"W"),l.BasePoint=u,u.prototype.eq=function(){throw Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(c,d){c=n.toArray(c,d);var f=this.p.byteLength();if((c[0]===4||c[0]===6||c[0]===7)&&c.length-1===2*f){c[0]===6?o(c[c.length-1]%2===0):c[0]===7&&o(c[c.length-1]%2===1);var g=this.point(c.slice(1,1+f),c.slice(1+f,1+2*f));return g}else if((c[0]===2||c[0]===3)&&c.length-1===f)return this.pointFromX(c.slice(1,1+f),c[0]===3);throw Error("Unknown point format")},u.prototype.encodeCompressed=function(c){return this.encode(c,!0)},u.prototype._encode=function(c){var d=this.curve.p.byteLength(),f=this.getX().toArray("be",d);return c?[this.getY().isEven()?2:3].concat(f):[4].concat(f,this.getY().toArray("be",d))},u.prototype.encode=function(c,d){return n.encode(this._encode(d),c)},u.prototype.precompute=function(c){if(this.precomputed)return this;var d={doubles:null,naf:null,beta:null};return d.naf=this._getNAFPoints(8),d.doubles=this._getDoubles(4,c),d.beta=this._getBeta(),this.precomputed=d,this},u.prototype._hasDoubles=function(c){if(!this.precomputed)return!1;var d=this.precomputed.doubles;return d?d.points.length>=Math.ceil((c.bitLength()+1)/d.step):!1},u.prototype._getDoubles=function(c,d){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var f=[this],g=this,m=0;m<d;m+=c){for(var w=0;w<c;w++)g=g.dbl();f.push(g)}return{step:c,points:f}},u.prototype._getNAFPoints=function(c){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var d=[this],f=(1<<c)-1,g=f===1?null:this.dbl(),m=1;m<f;m++)d[m]=d[m-1].add(g);return{wnd:c,points:d}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(c){for(var d=this,f=0;f<c;f++)d=d.dbl();return d}}),yE=Qe((e,t)=>{typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=a(function(){},"K");i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),Mn=Qe((e,t)=>{try{if(r=(lZ(),qt(DN)),typeof r.inherits!="function")throw"";t.exports=r.inherits}catch{t.exports=yE()}var r}),wE=Qe((e,t)=>{var r=Vn(),n=qi(),i=Mn(),s=eu(),o=r.assert;function l(d){s.call(this,"short",d),this.a=new n(d.a,16).toRed(this.red),this.b=new n(d.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(d),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}a(l,"v"),i(l,s),t.exports=l,l.prototype._getEndomorphism=function(d){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var f,g;if(d.beta)f=new n(d.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);f=m[0].cmp(m[1])<0?m[0]:m[1],f=f.toRed(this.red)}if(d.lambda)g=new n(d.lambda,16);else{var w=this._getEndoRoots(this.n);this.g.mul(w[0]).x.cmp(this.g.x.redMul(f))===0?g=w[0]:(g=w[1],o(this.g.mul(g).x.cmp(this.g.x.redMul(f))===0))}var E;return d.basis?E=d.basis.map(function(A){return{a:new n(A.a,16),b:new n(A.b,16)}}):E=this._getEndoBasis(g),{beta:f,lambda:g,basis:E}}},l.prototype._getEndoRoots=function(d){var f=d===this.p?this.red:n.mont(d),g=new n(2).toRed(f).redInvm(),m=g.redNeg(),w=new n(3).toRed(f).redNeg().redSqrt().redMul(g),E=m.redAdd(w).fromRed(),A=m.redSub(w).fromRed();return[E,A]},l.prototype._getEndoBasis=function(d){for(var f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),g=d,m=this.n.clone(),w=new n(1),E=new n(0),A=new n(0),C=new n(1),O,R,P,L,j,G,Z,K=0,z,V;g.cmpn(0)!==0;){var h=m.div(g);z=m.sub(h.mul(g)),V=A.sub(h.mul(w));var y=C.sub(h.mul(E));if(!P&&z.cmp(f)<0)O=Z.neg(),R=w,P=z.neg(),L=V;else if(P&&++K===2)break;Z=z,m=g,g=z,A=w,w=V,C=E,E=y}j=z.neg(),G=V;var b=P.sqr().add(L.sqr()),x=j.sqr().add(G.sqr());return x.cmp(b)>=0&&(j=O,G=R),P.negative&&(P=P.neg(),L=L.neg()),j.negative&&(j=j.neg(),G=G.neg()),[{a:P,b:L},{a:j,b:G}]},l.prototype._endoSplit=function(d){var f=this.endo.basis,g=f[0],m=f[1],w=m.b.mul(d).divRound(this.n),E=g.b.neg().mul(d).divRound(this.n),A=w.mul(g.a),C=E.mul(m.a),O=w.mul(g.b),R=E.mul(m.b),P=d.sub(A).sub(C),L=O.add(R).neg();return{k1:P,k2:L}},l.prototype.pointFromX=function(d,f){d=new n(d,16),!d.red&&(d=d.toRed(this.red));var g=d.redSqr().redMul(d).redIAdd(d.redMul(this.a)).redIAdd(this.b),m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw Error("invalid point");var w=m.fromRed().isOdd();return(f&&!w||!f&&w)&&(m=m.redNeg()),this.point(d,m)},l.prototype.validate=function(d){if(d.inf)return!0;var{x:f,y:g}=d,m=this.a.redMul(f),w=f.redSqr().redMul(f).redIAdd(m).redIAdd(this.b);return g.redSqr().redISub(w).cmpn(0)===0},l.prototype._endoWnafMulAdd=function(d,f,g){for(var m=this._endoWnafT1,w=this._endoWnafT2,E=0;E<d.length;E++){var A=this._endoSplit(f[E]),C=d[E],O=C._getBeta();A.k1.negative&&(A.k1.ineg(),C=C.neg(!0)),A.k2.negative&&(A.k2.ineg(),O=O.neg(!0)),m[E*2]=C,m[E*2+1]=O,w[E*2]=A.k1,w[E*2+1]=A.k2}for(var R=this._wnafMulAdd(1,m,w,E*2,g),P=0;P<E*2;P++)m[P]=null,w[P]=null;return R};function u(d,f,g,m){s.BasePoint.call(this,d,"affine"),f===null&&g===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(f,16),this.y=new n(g,16),m&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}a(u,"W"),i(u,s.BasePoint),l.prototype.point=function(d,f,g){return new u(this,d,f,g)},l.prototype.pointFromJSON=function(d,f){return u.fromJSON(this,d,f)},u.prototype._getBeta=function(){if(this.curve.endo){var d=this.precomputed;if(d&&d.beta)return d.beta;var f=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(d){var g=this.curve,m=a(function(w){return g.point(w.x.redMul(g.endo.beta),w.y)},"M");d.beta=f,f.precomputed={beta:null,naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(m)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(m)}}}return f}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(d,f,g){typeof f=="string"&&(f=JSON.parse(f));var m=d.point(f[0],f[1],g);if(!f[2])return m;function w(A){return d.point(A[0],A[1],g)}a(w,"N");var E=f[2];return m.precomputed={beta:null,doubles:E.doubles&&{step:E.doubles.step,points:[m].concat(E.doubles.points.map(w))},naf:E.naf&&{wnd:E.naf.wnd,points:[m].concat(E.naf.points.map(w))}},m},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(d){if(this.inf)return d;if(d.inf)return this;if(this.eq(d))return this.dbl();if(this.neg().eq(d))return this.curve.point(null,null);if(this.x.cmp(d.x)===0)return this.curve.point(null,null);var f=this.y.redSub(d.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(d.x).redInvm()));var g=f.redSqr().redISub(this.x).redISub(d.x),m=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,m)},u.prototype.dbl=function(){if(this.inf)return this;var d=this.y.redAdd(this.y);if(d.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,g=this.x.redSqr(),m=d.redInvm(),w=g.redAdd(g).redIAdd(g).redIAdd(f).redMul(m),E=w.redSqr().redISub(this.x.redAdd(this.x)),A=w.redMul(this.x.redSub(E)).redISub(this.y);return this.curve.point(E,A)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(d){return d=new n(d,16),this.isInfinity()?this:this._hasDoubles(d)?this.curve._fixedNafMul(this,d):this.curve.endo?this.curve._endoWnafMulAdd([this],[d]):this.curve._wnafMul(this,d)},u.prototype.mulAdd=function(d,f,g){var m=[this,f],w=[d,g];return this.curve.endo?this.curve._endoWnafMulAdd(m,w):this.curve._wnafMulAdd(1,m,w,2)},u.prototype.jmulAdd=function(d,f,g){var m=[this,f],w=[d,g];return this.curve.endo?this.curve._endoWnafMulAdd(m,w,!0):this.curve._wnafMulAdd(1,m,w,2,!0)},u.prototype.eq=function(d){return this===d||this.inf===d.inf&&(this.inf||this.x.cmp(d.x)===0&&this.y.cmp(d.y)===0)},u.prototype.neg=function(d){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(d&&this.precomputed){var g=this.precomputed,m=a(function(w){return w.neg()},"M");f.precomputed={naf:g.naf&&{wnd:g.naf.wnd,points:g.naf.points.map(m)},doubles:g.doubles&&{step:g.doubles.step,points:g.doubles.points.map(m)}}}return f},u.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var d=this.curve.jpoint(this.x,this.y,this.curve.one);return d};function c(d,f,g,m){s.BasePoint.call(this,d,"jacobian"),f===null&&g===null&&m===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(f,16),this.y=new n(g,16),this.z=new n(m,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,"T"),i(c,s.BasePoint),l.prototype.jpoint=function(d,f,g){return new c(this,d,f,g)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var d=this.z.redInvm(),f=d.redSqr(),g=this.x.redMul(f),m=this.y.redMul(f).redMul(d);return this.curve.point(g,m)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(d){if(this.isInfinity())return d;if(d.isInfinity())return this;var f=d.z.redSqr(),g=this.z.redSqr(),m=this.x.redMul(f),w=d.x.redMul(g),E=this.y.redMul(f.redMul(d.z)),A=d.y.redMul(g.redMul(this.z)),C=m.redSub(w),O=E.redSub(A);if(C.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var R=C.redSqr(),P=R.redMul(C),L=m.redMul(R),j=O.redSqr().redIAdd(P).redISub(L).redISub(L),G=O.redMul(L.redISub(j)).redISub(E.redMul(P)),Z=this.z.redMul(d.z).redMul(C);return this.curve.jpoint(j,G,Z)},c.prototype.mixedAdd=function(d){if(this.isInfinity())return d.toJ();if(d.isInfinity())return this;var f=this.z.redSqr(),g=this.x,m=d.x.redMul(f),w=this.y,E=d.y.redMul(f).redMul(this.z),A=g.redSub(m),C=w.redSub(E);if(A.cmpn(0)===0)return C.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=A.redSqr(),R=O.redMul(A),P=g.redMul(O),L=C.redSqr().redIAdd(R).redISub(P).redISub(P),j=C.redMul(P.redISub(L)).redISub(w.redMul(R)),G=this.z.redMul(A);return this.curve.jpoint(L,j,G)},c.prototype.dblp=function(d){if(d===0)return this;if(this.isInfinity())return this;if(!d)return this.dbl();var f;if(this.curve.zeroA||this.curve.threeA){var g=this;for(f=0;f<d;f++)g=g.dbl();return g}var m=this.curve.a,w=this.curve.tinv,E=this.x,A=this.y,C=this.z,O=C.redSqr().redSqr(),R=A.redAdd(A);for(f=0;f<d;f++){var P=E.redSqr(),L=R.redSqr(),j=L.redSqr(),G=P.redAdd(P).redIAdd(P).redIAdd(m.redMul(O)),Z=E.redMul(L),K=G.redSqr().redISub(Z.redAdd(Z)),z=Z.redISub(K),V=G.redMul(z);V=V.redIAdd(V).redISub(j);var h=R.redMul(C);f+1<d&&(O=O.redMul(j)),E=K,C=h,R=V}return this.curve.jpoint(E,R.redMul(w),C)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var d,f,g;if(this.zOne){var m=this.x.redSqr(),w=this.y.redSqr(),E=w.redSqr(),A=this.x.redAdd(w).redSqr().redISub(m).redISub(E);A=A.redIAdd(A);var C=m.redAdd(m).redIAdd(m),O=C.redSqr().redISub(A).redISub(A),R=E.redIAdd(E);R=R.redIAdd(R),R=R.redIAdd(R),d=O,f=C.redMul(A.redISub(O)).redISub(R),g=this.y.redAdd(this.y)}else{var P=this.x.redSqr(),L=this.y.redSqr(),j=L.redSqr(),G=this.x.redAdd(L).redSqr().redISub(P).redISub(j);G=G.redIAdd(G);var Z=P.redAdd(P).redIAdd(P),K=Z.redSqr(),z=j.redIAdd(j);z=z.redIAdd(z),z=z.redIAdd(z),d=K.redISub(G).redISub(G),f=Z.redMul(G.redISub(d)).redISub(z),g=this.y.redMul(this.z),g=g.redIAdd(g)}return this.curve.jpoint(d,f,g)},c.prototype._threeDbl=function(){var d,f,g;if(this.zOne){var m=this.x.redSqr(),w=this.y.redSqr(),E=w.redSqr(),A=this.x.redAdd(w).redSqr().redISub(m).redISub(E);A=A.redIAdd(A);var C=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),O=C.redSqr().redISub(A).redISub(A);d=O;var R=E.redIAdd(E);R=R.redIAdd(R),R=R.redIAdd(R),f=C.redMul(A.redISub(O)).redISub(R),g=this.y.redAdd(this.y)}else{var P=this.z.redSqr(),L=this.y.redSqr(),j=this.x.redMul(L),G=this.x.redSub(P).redMul(this.x.redAdd(P));G=G.redAdd(G).redIAdd(G);var Z=j.redIAdd(j);Z=Z.redIAdd(Z);var K=Z.redAdd(Z);d=G.redSqr().redISub(K),g=this.y.redAdd(this.z).redSqr().redISub(L).redISub(P);var z=L.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),f=G.redMul(Z.redISub(d)).redISub(z)}return this.curve.jpoint(d,f,g)},c.prototype._dbl=function(){var d=this.curve.a,f=this.x,g=this.y,m=this.z,w=m.redSqr().redSqr(),E=f.redSqr(),A=g.redSqr(),C=E.redAdd(E).redIAdd(E).redIAdd(d.redMul(w)),O=f.redAdd(f);O=O.redIAdd(O);var R=O.redMul(A),P=C.redSqr().redISub(R.redAdd(R)),L=R.redISub(P),j=A.redSqr();j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var G=C.redMul(L).redISub(j),Z=g.redAdd(g).redMul(m);return this.curve.jpoint(P,G,Z)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var d=this.x.redSqr(),f=this.y.redSqr(),g=this.z.redSqr(),m=f.redSqr(),w=d.redAdd(d).redIAdd(d),E=w.redSqr(),A=this.x.redAdd(f).redSqr().redISub(d).redISub(m);A=A.redIAdd(A),A=A.redAdd(A).redIAdd(A),A=A.redISub(E);var C=A.redSqr(),O=m.redIAdd(m);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var R=w.redIAdd(A).redSqr().redISub(E).redISub(C).redISub(O),P=f.redMul(R);P=P.redIAdd(P),P=P.redIAdd(P);var L=this.x.redMul(C).redISub(P);L=L.redIAdd(L),L=L.redIAdd(L);var j=this.y.redMul(R.redMul(O.redISub(R)).redISub(A.redMul(C)));j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var G=this.z.redAdd(A).redSqr().redISub(g).redISub(C);return this.curve.jpoint(L,j,G)},c.prototype.mul=function(d,f){return d=new n(d,f),this.curve._wnafMul(this,d)},c.prototype.eq=function(d){if(d.type==="affine")return this.eq(d.toJ());if(this===d)return!0;var f=this.z.redSqr(),g=d.z.redSqr();if(this.x.redMul(g).redISub(d.x.redMul(f)).cmpn(0)!==0)return!1;var m=f.redMul(this.z),w=g.redMul(d.z);return this.y.redMul(w).redISub(d.y.redMul(m)).cmpn(0)===0},c.prototype.eqXToP=function(d){var f=this.z.redSqr(),g=d.toRed(this.curve.red).redMul(f);if(this.x.cmp(g)===0)return!0;for(var m=d.clone(),w=this.curve.redN.redMul(f);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(g.redIAdd(w),this.x.cmp(g)===0)return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),xE=Qe((e,t)=>{var r=qi(),n=Mn(),i=eu(),s=Vn();function o(u){i.call(this,"mont",u),this.a=new r(u.a,16).toRed(this.red),this.b=new r(u.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(o,"Y"),n(o,i),t.exports=o,o.prototype.validate=function(u){var c=u.normalize().x,d=c.redSqr(),f=d.redMul(c).redAdd(d.redMul(this.a)).redAdd(c),g=f.redSqrt();return g.redSqr().cmp(f)===0};function l(u,c,d){i.BasePoint.call(this,u,"projective"),c===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(c,16),this.z=new r(d,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(l,"v"),n(l,i.BasePoint),o.prototype.decodePoint=function(u,c){return this.point(s.toArray(u,c),1)},o.prototype.point=function(u,c){return new l(this,u,c)},o.prototype.pointFromJSON=function(u){return l.fromJSON(this,u)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(u,c){return new l(u,c[0],c[1]||u.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.z.cmpn(0)===0},l.prototype.dbl=function(){var u=this.x.redAdd(this.z),c=u.redSqr(),d=this.x.redSub(this.z),f=d.redSqr(),g=c.redSub(f),m=c.redMul(f),w=g.redMul(f.redAdd(this.curve.a24.redMul(g)));return this.curve.point(m,w)},l.prototype.add=function(){throw Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(u,c){var d=this.x.redAdd(this.z),f=this.x.redSub(this.z),g=u.x.redAdd(u.z),m=u.x.redSub(u.z),w=m.redMul(d),E=g.redMul(f),A=c.z.redMul(w.redAdd(E).redSqr()),C=c.x.redMul(w.redISub(E).redSqr());return this.curve.point(A,C)},l.prototype.mul=function(u){for(var c=u.clone(),d=this,f=this.curve.point(null,null),g=this,m=[];c.cmpn(0)!==0;c.iushrn(1))m.push(c.andln(1));for(var w=m.length-1;w>=0;w--)m[w]===0?(d=d.diffAdd(f,g),f=f.dbl()):(f=d.diffAdd(f,g),d=d.dbl());return f},l.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},l.prototype.eq=function(u){return this.getX().cmp(u.getX())===0},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),_E=Qe((e,t)=>{var r=Vn(),n=qi(),i=Mn(),s=eu(),o=r.assert;function l(c){this.twisted=(c.a|0)!==1,this.mOneA=this.twisted&&(c.a|0)===-1,this.extended=this.mOneA,s.call(this,"edwards",c),this.a=new n(c.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(c.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(c.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(c.c|0)===1}a(l,"v"),i(l,s),t.exports=l,l.prototype._mulA=function(c){return this.mOneA?c.redNeg():this.a.redMul(c)},l.prototype._mulC=function(c){return this.oneC?c:this.c.redMul(c)},l.prototype.jpoint=function(c,d,f,g){return this.point(c,d,f,g)},l.prototype.pointFromX=function(c,d){c=new n(c,16),!c.red&&(c=c.toRed(this.red));var f=c.redSqr(),g=this.c2.redSub(this.a.redMul(f)),m=this.one.redSub(this.c2.redMul(this.d).redMul(f)),w=g.redMul(m.redInvm()),E=w.redSqrt();if(E.redSqr().redSub(w).cmp(this.zero)!==0)throw Error("invalid point");var A=E.fromRed().isOdd();return(d&&!A||!d&&A)&&(E=E.redNeg()),this.point(c,E)},l.prototype.pointFromY=function(c,d){c=new n(c,16),!c.red&&(c=c.toRed(this.red));var f=c.redSqr(),g=f.redSub(this.c2),m=f.redMul(this.d).redMul(this.c2).redSub(this.a),w=g.redMul(m.redInvm());if(w.cmp(this.zero)===0){if(d)throw Error("invalid point");return this.point(this.zero,c)}var E=w.redSqrt();if(E.redSqr().redSub(w).cmp(this.zero)!==0)throw Error("invalid point");return E.fromRed().isOdd()!==d&&(E=E.redNeg()),this.point(E,c)},l.prototype.validate=function(c){if(c.isInfinity())return!0;c.normalize();var d=c.x.redSqr(),f=c.y.redSqr(),g=d.redMul(this.a).redAdd(f),m=this.c2.redMul(this.one.redAdd(this.d.redMul(d).redMul(f)));return g.cmp(m)===0};function u(c,d,f,g,m){s.BasePoint.call(this,c,"projective"),d===null&&f===null&&g===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(d,16),this.y=new n(f,16),this.z=g?new n(g,16):this.curve.one,this.t=m&&new n(m,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),!this.zOne&&(this.t=this.t.redMul(this.z.redInvm()))))}a(u,"W"),i(u,s.BasePoint),l.prototype.pointFromJSON=function(c){return u.fromJSON(this,c)},l.prototype.point=function(c,d,f,g){return new u(this,c,d,f,g)},u.fromJSON=function(c,d){return new u(c,d[0],d[1],d[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},u.prototype._extDbl=function(){var c=this.x.redSqr(),d=this.y.redSqr(),f=this.z.redSqr();f=f.redIAdd(f);var g=this.curve._mulA(c),m=this.x.redAdd(this.y).redSqr().redISub(c).redISub(d),w=g.redAdd(d),E=w.redSub(f),A=g.redSub(d),C=m.redMul(E),O=w.redMul(A),R=m.redMul(A),P=E.redMul(w);return this.curve.point(C,O,P,R)},u.prototype._projDbl=function(){var c=this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),f=this.y.redSqr(),g,m,w,E,A,C;if(this.curve.twisted){E=this.curve._mulA(d);var O=E.redAdd(f);this.zOne?(g=c.redSub(d).redSub(f).redMul(O.redSub(this.curve.two)),m=O.redMul(E.redSub(f)),w=O.redSqr().redSub(O).redSub(O)):(A=this.z.redSqr(),C=O.redSub(A).redISub(A),g=c.redSub(d).redISub(f).redMul(C),m=O.redMul(E.redSub(f)),w=O.redMul(C))}else E=d.redAdd(f),A=this.curve._mulC(this.z).redSqr(),C=E.redSub(A).redSub(A),g=this.curve._mulC(c.redISub(E)).redMul(C),m=this.curve._mulC(E).redMul(d.redISub(f)),w=E.redMul(C);return this.curve.point(g,m,w)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(c){var d=this.y.redSub(this.x).redMul(c.y.redSub(c.x)),f=this.y.redAdd(this.x).redMul(c.y.redAdd(c.x)),g=this.t.redMul(this.curve.dd).redMul(c.t),m=this.z.redMul(c.z.redAdd(c.z)),w=f.redSub(d),E=m.redSub(g),A=m.redAdd(g),C=f.redAdd(d),O=w.redMul(E),R=A.redMul(C),P=w.redMul(C),L=E.redMul(A);return this.curve.point(O,R,L,P)},u.prototype._projAdd=function(c){var d=this.z.redMul(c.z),f=d.redSqr(),g=this.x.redMul(c.x),m=this.y.redMul(c.y),w=this.curve.d.redMul(g).redMul(m),E=f.redSub(w),A=f.redAdd(w),C=this.x.redAdd(this.y).redMul(c.x.redAdd(c.y)).redISub(g).redISub(m),O=d.redMul(E).redMul(C),R,P;return this.curve.twisted?(R=d.redMul(A).redMul(m.redSub(this.curve._mulA(g))),P=E.redMul(A)):(R=d.redMul(A).redMul(m.redSub(g)),P=this.curve._mulC(E).redMul(A)),this.curve.point(O,R,P)},u.prototype.add=function(c){return this.isInfinity()?c:c.isInfinity()?this:this.curve.extended?this._extAdd(c):this._projAdd(c)},u.prototype.mul=function(c){return this._hasDoubles(c)?this.curve._fixedNafMul(this,c):this.curve._wnafMul(this,c)},u.prototype.mulAdd=function(c,d,f){return this.curve._wnafMulAdd(1,[this,d],[c,f],2,!1)},u.prototype.jmulAdd=function(c,d,f){return this.curve._wnafMulAdd(1,[this,d],[c,f],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var c=this.z.redInvm();return this.x=this.x.redMul(c),this.y=this.y.redMul(c),this.t&&(this.t=this.t.redMul(c)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(c){return this===c||this.getX().cmp(c.getX())===0&&this.getY().cmp(c.getY())===0},u.prototype.eqXToP=function(c){var d=c.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(d)===0)return!0;for(var f=c.clone(),g=this.curve.redN.redMul(this.z);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(d.redIAdd(g),this.x.cmp(d)===0)return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add}),H0=Qe(e=>{var t=e;t.base=eu(),t.short=wE(),t.mont=xE(),t.edwards=_E()}),wi=Qe(e=>{var t=ka(),r=Mn();e.inherits=r;function n(y,b){return(y.charCodeAt(b)&64512)!==55296||b<0||b+1>=y.length?!1:(y.charCodeAt(b+1)&64512)===56320}a(n,"P");function i(y,b){if(Array.isArray(y))return y.slice();if(!y)return[];var x=[];if(typeof y=="string")if(b){if(b==="hex")for(y=y.replace(/[^a-z0-9]+/ig,""),y.length%2!==0&&(y="0"+y),N=0;N<y.length;N+=2)x.push(parseInt(y[N]+y[N+1],16))}else for(var _=0,N=0;N<y.length;N++){var T=y.charCodeAt(N);T<128?x[_++]=T:T<2048?(x[_++]=T>>6|192,x[_++]=T&63|128):n(y,N)?(T=65536+((T&1023)<<10)+(y.charCodeAt(++N)&1023),x[_++]=T>>18|240,x[_++]=T>>12&63|128,x[_++]=T>>6&63|128,x[_++]=T&63|128):(x[_++]=T>>12|224,x[_++]=T>>6&63|128,x[_++]=T&63|128)}else for(N=0;N<y.length;N++)x[N]=y[N]|0;return x}a(i,"K"),e.toArray=i;function s(y){for(var b="",x=0;x<y.length;x++)b+=u(y[x].toString(16));return b}a(s,"O"),e.toHex=s;function o(y){var b=y>>>24|y>>>8&65280|y<<8&16711680|(y&255)<<24;return b>>>0}a(o,"Y"),e.htonl=o;function l(y,b){for(var x="",_=0;_<y.length;_++){var N=y[_];b==="little"&&(N=o(N)),x+=c(N.toString(16))}return x}a(l,"v"),e.toHex32=l;function u(y){return y.length===1?"0"+y:y}a(u,"W"),e.zero2=u;function c(y){return y.length===7?"0"+y:y.length===6?"00"+y:y.length===5?"000"+y:y.length===4?"0000"+y:y.length===3?"00000"+y:y.length===2?"000000"+y:y.length===1?"0000000"+y:y}a(c,"T"),e.zero8=c;function d(y,b,x,_){var N=x-b;t(N%4===0);for(var T=Array(N/4),k=0,p=b;k<T.length;k++,p+=4){var S;_==="big"?S=y[p]<<24|y[p+1]<<16|y[p+2]<<8|y[p+3]:S=y[p+3]<<24|y[p+2]<<16|y[p+1]<<8|y[p],T[k]=S>>>0}return T}a(d,"Z"),e.join32=d;function f(y,b){for(var x=Array(y.length*4),_=0,N=0;_<y.length;_++,N+=4){var T=y[_];b==="big"?(x[N]=T>>>24,x[N+1]=T>>>16&255,x[N+2]=T>>>8&255,x[N+3]=T&255):(x[N+3]=T>>>24,x[N+2]=T>>>16&255,x[N+1]=T>>>8&255,x[N]=T&255)}return x}a(f,"w"),e.split32=f;function g(y,b){return y>>>b|y<<32-b}a(g,"k"),e.rotr32=g;function m(y,b){return y<<b|y>>>32-b}a(m,"M"),e.rotl32=m;function w(y,b){return y+b>>>0}a(w,"N"),e.sum32=w;function E(y,b,x){return y+b+x>>>0}a(E,"R"),e.sum32_3=E;function A(y,b,x,_){return y+b+x+_>>>0}a(A,"E"),e.sum32_4=A;function C(y,b,x,_,N){return y+b+x+_+N>>>0}a(C,"D"),e.sum32_5=C;function O(y,b,x,_){var N=y[b],T=y[b+1],k=_+T>>>0,p=(k<_?1:0)+x+N;y[b]=p>>>0,y[b+1]=k}a(O,"h"),e.sum64=O;function R(y,b,x,_){var N=b+_>>>0,T=(N<b?1:0)+y+x;return T>>>0}a(R,"L"),e.sum64_hi=R;function P(y,b,x,_){var N=b+_;return N>>>0}a(P,"b"),e.sum64_lo=P;function L(y,b,x,_,N,T,k,p){var S=0,I=b;I=I+_>>>0,S+=I<b?1:0,I=I+T>>>0,S+=I<T?1:0,I=I+p>>>0,S+=I<p?1:0;var M=y+x+N+k+S;return M>>>0}a(L,"y"),e.sum64_4_hi=L;function j(y,b,x,_,N,T,k,p){var S=b+_+T+p;return S>>>0}a(j,"p"),e.sum64_4_lo=j;function G(y,b,x,_,N,T,k,p,S,I){var M=0,U=b;U=U+_>>>0,M+=U<b?1:0,U=U+T>>>0,M+=U<T?1:0,U=U+p>>>0,M+=U<p?1:0,U=U+I>>>0,M+=U<I?1:0;var B=y+x+N+k+S+M;return B>>>0}a(G,"i"),e.sum64_5_hi=G;function Z(y,b,x,_,N,T,k,p,S,I){var M=b+_+T+p+I;return M>>>0}a(Z,"$$"),e.sum64_5_lo=Z;function K(y,b,x){var _=b<<32-x|y>>>x;return _>>>0}a(K,"Q"),e.rotr64_hi=K;function z(y,b,x){var _=y<<32-x|b>>>x;return _>>>0}a(z,"c"),e.rotr64_lo=z;function V(y,b,x){return y>>>x}a(V,"a"),e.shr64_hi=V;function h(y,b,x){var _=y<<32-x|b>>>x;return _>>>0}a(h,"j"),e.shr64_lo=h}),Wo=Qe(e=>{var t=wi(),r=ka();function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}a(n,"P"),e.BlockHash=n,n.prototype.update=function(i,s){if(i=t.toArray(i,s),this.pending?this.pending=this.pending.concat(i):this.pending=i,this.pendingTotal+=i.length,this.pending.length>=this._delta8){i=this.pending;var o=i.length%this._delta8;this.pending=i.slice(i.length-o,i.length),this.pending.length===0&&(this.pending=null),i=t.join32(i,0,i.length-o,this.endian);for(var l=0;l<i.length;l+=this._delta32)this._update(i,l,l+this._delta32)}return this},n.prototype.digest=function(i){return this.update(this._pad()),r(this.pending===null),this._digest(i)},n.prototype._pad=function(){var i=this.pendingTotal,s=this._delta8,o=s-(i+this.padLength)%s,l=Array(o+this.padLength);l[0]=128;for(var u=1;u<o;u++)l[u]=0;if(i<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)l[u++]=0;l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=i>>>24&255,l[u++]=i>>>16&255,l[u++]=i>>>8&255,l[u++]=i&255}else for(l[u++]=i&255,l[u++]=i>>>8&255,l[u++]=i>>>16&255,l[u++]=i>>>24&255,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,c=8;c<this.padLength;c++)l[u++]=0;return l}}),Z0=Qe(e=>{var t=wi(),r=t.rotr32;function n(f,g,m,w){if(f===0)return i(g,m,w);if(f===1||f===3)return o(g,m,w);if(f===2)return s(g,m,w)}a(n,"P"),e.ft_1=n;function i(f,g,m){return f&g^~f&m}a(i,"K"),e.ch32=i;function s(f,g,m){return f&g^f&m^g&m}a(s,"O"),e.maj32=s;function o(f,g,m){return f^g^m}a(o,"Y"),e.p32=o;function l(f){return r(f,2)^r(f,13)^r(f,22)}a(l,"v"),e.s0_256=l;function u(f){return r(f,6)^r(f,11)^r(f,25)}a(u,"W"),e.s1_256=u;function c(f){return r(f,7)^r(f,18)^f>>>3}a(c,"T"),e.g0_256=c;function d(f){return r(f,17)^r(f,19)^f>>>10}a(d,"Z"),e.g1_256=d}),EE=Qe((e,t)=>{var r=wi(),n=Wo(),i=Z0(),s=r.rotl32,o=r.sum32,l=r.sum32_5,u=i.ft_1,c=n.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}a(f,"w"),r.inherits(f,c),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(g,m){for(var w=this.W,E=0;E<16;E++)w[E]=g[m+E];for(;E<w.length;E++)w[E]=s(w[E-3]^w[E-8]^w[E-14]^w[E-16],1);var A=this.h[0],C=this.h[1],O=this.h[2],R=this.h[3],P=this.h[4];for(E=0;E<w.length;E++){var L=~~(E/20),j=l(s(A,5),u(L,C,O,R),P,w[E],d[L]);P=R,R=O,O=s(C,30),C=A,A=j}this.h[0]=o(this.h[0],A),this.h[1]=o(this.h[1],C),this.h[2]=o(this.h[2],O),this.h[3]=o(this.h[3],R),this.h[4]=o(this.h[4],P)},f.prototype._digest=function(g){return g==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")}}),G0=Qe((e,t)=>{var r=wi(),n=Wo(),i=Z0(),s=ka(),o=r.sum32,l=r.sum32_4,u=r.sum32_5,c=i.ch32,d=i.maj32,f=i.s0_256,g=i.s1_256,m=i.g0_256,w=i.g1_256,E=n.BlockHash,A=[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];function C(){if(!(this instanceof C))return new C;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=A,this.W=Array(64)}a(C,"D"),r.inherits(C,E),t.exports=C,C.blockSize=512,C.outSize=256,C.hmacStrength=192,C.padLength=64,C.prototype._update=function(O,R){for(var P=this.W,L=0;L<16;L++)P[L]=O[R+L];for(;L<P.length;L++)P[L]=l(w(P[L-2]),P[L-7],m(P[L-15]),P[L-16]);var j=this.h[0],G=this.h[1],Z=this.h[2],K=this.h[3],z=this.h[4],V=this.h[5],h=this.h[6],y=this.h[7];for(s(this.k.length===P.length),L=0;L<P.length;L++){var b=u(y,g(z),c(z,V,h),this.k[L],P[L]),x=o(f(j),d(j,G,Z));y=h,h=V,V=z,z=o(K,b),K=Z,Z=G,G=j,j=o(b,x)}this.h[0]=o(this.h[0],j),this.h[1]=o(this.h[1],G),this.h[2]=o(this.h[2],Z),this.h[3]=o(this.h[3],K),this.h[4]=o(this.h[4],z),this.h[5]=o(this.h[5],V),this.h[6]=o(this.h[6],h),this.h[7]=o(this.h[7],y)},C.prototype._digest=function(O){return O==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")}}),SE=Qe((e,t)=>{var r=wi(),n=G0();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}a(i,"K"),r.inherits(i,n),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}}),V0=Qe((e,t)=>{var r=wi(),n=Wo(),i=ka(),s=r.rotr64_hi,o=r.rotr64_lo,l=r.shr64_hi,u=r.shr64_lo,c=r.sum64,d=r.sum64_hi,f=r.sum64_lo,g=r.sum64_4_hi,m=r.sum64_4_lo,w=r.sum64_5_hi,E=r.sum64_5_lo,A=n.BlockHash,C=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function O(){if(!(this instanceof O))return new O;A.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=C,this.W=Array(160)}a(O,"h"),r.inherits(O,A),t.exports=O,O.blockSize=1024,O.outSize=512,O.hmacStrength=192,O.padLength=128,O.prototype._prepareBlock=function(x,_){for(var N=this.W,T=0;T<32;T++)N[T]=x[_+T];for(;T<N.length;T+=2){var k=y(N[T-4],N[T-3]),p=b(N[T-4],N[T-3]),S=N[T-14],I=N[T-13],M=V(N[T-30],N[T-29]),U=h(N[T-30],N[T-29]),B=N[T-32],H=N[T-31];N[T]=g(k,p,S,I,M,U,B,H),N[T+1]=m(k,p,S,I,M,U,B,H)}},O.prototype._update=function(x,_){this._prepareBlock(x,_);var N=this.W,T=this.h[0],k=this.h[1],p=this.h[2],S=this.h[3],I=this.h[4],M=this.h[5],U=this.h[6],B=this.h[7],H=this.h[8],$=this.h[9],ae=this.h[10],ie=this.h[11],ne=this.h[12],Ne=this.h[13],ve=this.h[14],he=this.h[15];i(this.k.length===N.length);for(var Se=0;Se<N.length;Se+=2){var Q=ve,se=he,J=K(H,$),te=z(H,$),de=R(H,$,ae,ie,ne),be=P(H,$,ae,ie,ne,Ne),Ae=this.k[Se],oe=this.k[Se+1],Y=N[Se],ee=N[Se+1],X=w(Q,se,J,te,de,be,Ae,oe,Y,ee),W=E(Q,se,J,te,de,be,Ae,oe,Y,ee);Q=G(T,k),se=Z(T,k),J=L(T,k,p,S,I),te=j(T,k,p,S,I,M);var q=d(Q,se,J,te),re=f(Q,se,J,te);ve=ne,he=Ne,ne=ae,Ne=ie,ae=H,ie=$,H=d(U,B,X,W),$=f(B,B,X,W),U=I,B=M,I=p,M=S,p=T,S=k,T=d(X,W,q,re),k=f(X,W,q,re)}c(this.h,0,T,k),c(this.h,2,p,S),c(this.h,4,I,M),c(this.h,6,U,B),c(this.h,8,H,$),c(this.h,10,ae,ie),c(this.h,12,ne,Ne),c(this.h,14,ve,he)},O.prototype._digest=function(x){return x==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function R(x,_,N,T,k){var p=x&N^~x&k;return p<0&&(p+=4294967296),p}a(R,"L");function P(x,_,N,T,k,p){var S=_&T^~_&p;return S<0&&(S+=4294967296),S}a(P,"b");function L(x,_,N,T,k){var p=x&N^x&k^N&k;return p<0&&(p+=4294967296),p}a(L,"y");function j(x,_,N,T,k,p){var S=_&T^_&p^T&p;return S<0&&(S+=4294967296),S}a(j,"p");function G(x,_){var N=s(x,_,28),T=s(_,x,2),k=s(_,x,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(G,"i");function Z(x,_){var N=o(x,_,28),T=o(_,x,2),k=o(_,x,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(Z,"$$");function K(x,_){var N=s(x,_,14),T=s(x,_,18),k=s(_,x,9),p=N^T^k;return p<0&&(p+=4294967296),p}a(K,"Q");function z(x,_){var N=o(x,_,14),T=o(x,_,18),k=o(_,x,9),p=N^T^k;return p<0&&(p+=4294967296),p}a(z,"c");function V(x,_){var N=s(x,_,1),T=s(x,_,8),k=l(x,_,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(V,"a");function h(x,_){var N=o(x,_,1),T=o(x,_,8),k=u(x,_,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(h,"j");function y(x,_){var N=s(x,_,19),T=s(_,x,29),k=l(x,_,6),p=N^T^k;return p<0&&(p+=4294967296),p}a(y,"J");function b(x,_){var N=o(x,_,19),T=o(_,x,29),k=u(x,_,6),p=N^T^k;return p<0&&(p+=4294967296),p}a(b,"X")}),kE=Qe((e,t)=>{var r=wi(),n=V0();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}a(i,"K"),r.inherits(i,n),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}}),AE=Qe(e=>{e.sha1=EE(),e.sha224=SE(),e.sha256=G0(),e.sha384=kE(),e.sha512=V0()}),TE=Qe(e=>{var t=wi(),r=Wo(),n=t.rotl32,i=t.sum32,s=t.sum32_3,o=t.sum32_4,l=r.BlockHash;function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}a(u,"W"),t.inherits(u,l),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(A,C){for(var O=this.h[0],R=this.h[1],P=this.h[2],L=this.h[3],j=this.h[4],G=O,Z=R,K=P,z=L,V=j,h=0;h<80;h++){var y=i(n(o(O,c(h,R,P,L),A[g[h]+C],d(h)),w[h]),j);O=j,j=L,L=n(P,10),P=R,R=y,y=i(n(o(G,c(79-h,Z,K,z),A[m[h]+C],f(h)),E[h]),V),G=V,V=z,z=n(K,10),K=Z,Z=y}y=s(this.h[1],P,z),this.h[1]=s(this.h[2],L,V),this.h[2]=s(this.h[3],j,G),this.h[3]=s(this.h[4],O,Z),this.h[4]=s(this.h[0],R,K),this.h[0]=y},u.prototype._digest=function(A){return A==="hex"?t.toHex32(this.h,"little"):t.split32(this.h,"little")};function c(A,C,O,R){return A<=15?C^O^R:A<=31?C&O|~C&R:A<=47?(C|~O)^R:A<=63?C&R|O&~R:C^(O|~R)}a(c,"T");function d(A){return A<=15?0:A<=31?1518500249:A<=47?1859775393:A<=63?2400959708:2840853838}a(d,"Z");function f(A){return A<=15?1352829926:A<=31?1548603684:A<=47?1836072691:A<=63?2053994217:0}a(f,"w");var g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],w=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),NE=Qe((e,t)=>{var r=wi(),n=ka();function i(s,o,l){if(!(this instanceof i))return new i(s,o,l);this.Hash=s,this.blockSize=s.blockSize/8,this.outSize=s.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(o,l))}a(i,"K"),t.exports=i,i.prototype._init=function(s){s.length>this.blockSize&&(s=new this.Hash().update(s).digest()),n(s.length<=this.blockSize);for(var o=s.length;o<this.blockSize;o++)s.push(0);for(o=0;o<s.length;o++)s[o]^=54;for(this.inner=new this.Hash().update(s),o=0;o<s.length;o++)s[o]^=106;this.outer=new this.Hash().update(s)},i.prototype.update=function(s,o){return this.inner.update(s,o),this},i.prototype.digest=function(s){return this.outer.update(this.inner.digest()),this.outer.digest(s)}}),qd=Qe(e=>{var t=e;t.utils=wi(),t.common=Wo(),t.sha=AE(),t.ripemd=TE(),t.hmac=NE(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}),IE=Qe((e,t)=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),ef=Qe(e=>{var t=e,r=qd(),n=H0(),i=Vn(),s=i.assert;function o(c){c.type==="short"?this.curve=new n.short(c):c.type==="edwards"?this.curve=new n.edwards(c):this.curve=new n.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a(o,"Y"),t.PresetCurve=o;function l(c,d){Object.defineProperty(t,c,{configurable:!0,enumerable:!0,get:a(function(){var f=new o(d);return Object.defineProperty(t,c,{configurable:!0,enumerable:!0,value:f}),f},"get")})}a(l,"v"),l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=IE()}catch{u=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})}),CE=Qe((e,t)=>{var r=qd(),n=z0(),i=ka();function s(o){if(!(this instanceof s))return new s(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var l=n.toArray(o.entropy,o.entropyEnc||"hex"),u=n.toArray(o.nonce,o.nonceEnc||"hex"),c=n.toArray(o.pers,o.persEnc||"hex");i(l.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(l,u,c)}a(s,"O"),t.exports=s,s.prototype._init=function(o,l,u){var c=o.concat(l).concat(u);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var d=0;d<this.V.length;d++)this.K[d]=0,this.V[d]=1;this._update(c),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},s.prototype._update=function(o){var l=this._hmac().update(this.V).update([0]);o&&(l=l.update(o)),this.K=l.digest(),this.V=this._hmac().update(this.V).digest(),o&&(this.K=this._hmac().update(this.V).update([1]).update(o).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(o,l,u,c){typeof l!="string"&&(c=u,u=l,l=null),o=n.toArray(o,l),u=n.toArray(u,c),i(o.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(o.concat(u||[])),this._reseed=1},s.prototype.generate=function(o,l,u,c){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof l!="string"&&(c=u,u=l,l=null),u&&(u=n.toArray(u,c||"hex"),this._update(u));for(var d=[];d.length<o;)this.V=this._hmac().update(this.V).digest(),d=d.concat(this.V);var f=d.slice(0,o);return this._update(u),this._reseed++,n.encode(f,l)}}),ME=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert;function s(o,l){this.ec=o,this.priv=null,this.pub=null,l.priv&&this._importPrivate(l.priv,l.privEnc),l.pub&&this._importPublic(l.pub,l.pubEnc)}a(s,"O"),t.exports=s,s.fromPublic=function(o,l,u){return l instanceof s?l:new s(o,{pub:l,pubEnc:u})},s.fromPrivate=function(o,l,u){return l instanceof s?l:new s(o,{priv:l,privEnc:u})},s.prototype.validate=function(){var o=this.getPublic();return o.isInfinity()?{result:!1,reason:"Invalid public key"}:o.validate()?o.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(o,l){return typeof o=="string"&&(l=o,o=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),l?this.pub.encode(l,o):this.pub},s.prototype.getPrivate=function(o){return o==="hex"?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(o,l){this.priv=new r(o,l||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(o,l){if(o.x||o.y){this.ec.curve.type==="mont"?i(o.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&i(o.x&&o.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(o.x,o.y);return}this.pub=this.ec.curve.decodePoint(o,l)},s.prototype.derive=function(o){return o.validate()||i(o.validate(),"public point not validated"),o.mul(this.priv).getX()},s.prototype.sign=function(o,l,u){return this.ec.sign(o,this,l,u)},s.prototype.verify=function(o,l,u){return this.ec.verify(o,l,this,void 0,u)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),OE=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert;function s(d,f){if(d instanceof s)return d;this._importDER(d,f)||(i(d.r&&d.s,"Signature without r or s"),this.r=new r(d.r,16),this.s=new r(d.s,16),d.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=d.recoveryParam)}a(s,"O"),t.exports=s;function o(){this.place=0}a(o,"Y");function l(d,f){var g=d[f.place++];if(!(g&128))return g;var m=g&15;if(m===0||m>4||d[f.place]===0)return!1;for(var w=0,E=0,A=f.place;E<m;E++,A++)w<<=8,w|=d[A],w>>>=0;return w<=127?!1:(f.place=A,w)}a(l,"v");function u(d){for(var f=0,g=d.length-1;!d[f]&&!(d[f+1]&128)&&f<g;)f++;return f===0?d:d.slice(f)}a(u,"W"),s.prototype._importDER=function(d,f){d=n.toArray(d,f);var g=new o;if(d[g.place++]!==48)return!1;var m=l(d,g);if(m===!1||m+g.place!==d.length||d[g.place++]!==2)return!1;var w=l(d,g);if(w===!1||(d[g.place]&128)!==0)return!1;var E=d.slice(g.place,w+g.place);if(g.place+=w,d[g.place++]!==2)return!1;var A=l(d,g);if(A===!1||d.length!==A+g.place||(d[g.place]&128)!==0)return!1;var C=d.slice(g.place,A+g.place);if(E[0]===0)if(E[1]&128)E=E.slice(1);else return!1;if(C[0]===0)if(C[1]&128)C=C.slice(1);else return!1;return this.r=new r(E),this.s=new r(C),this.recoveryParam=null,!0};function c(d,f){if(f<128){d.push(f);return}var g=1+(Math.log(f)/Math.LN2>>>3);for(d.push(g|128);--g;)d.push(f>>>(g<<3)&255);d.push(f)}a(c,"T"),s.prototype.toDER=function(d){var f=this.r.toArray(),g=this.s.toArray();for(f[0]&128&&(f=[0].concat(f)),g[0]&128&&(g=[0].concat(g)),f=u(f),g=u(g);!g[0]&&!(g[1]&128);)g=g.slice(1);var m=[2];c(m,f.length),m=m.concat(f),m.push(2),c(m,g.length);var w=m.concat(g),E=[48];return c(E,w.length),E=E.concat(w),n.encode(E,d)}}),RE=Qe((e,t)=>{var r=qi(),n=CE(),i=Vn(),s=ef(),o=F0(),l=i.assert,u=ME(),c=OE();function d(f){if(!(this instanceof d))return new d(f);typeof f=="string"&&(l(Object.prototype.hasOwnProperty.call(s,f),"Unknown curve "+f),f=s[f]),f instanceof s.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}a(d,"Z"),t.exports=d,d.prototype.keyPair=function(f){return new u(this,f)},d.prototype.keyFromPrivate=function(f,g){return u.fromPrivate(this,f,g)},d.prototype.keyFromPublic=function(f,g){return u.fromPublic(this,f,g)},d.prototype.genKeyPair=function(f){f||(f={});for(var g=new n({hash:this.hash,pers:f.pers,persEnc:f.persEnc||"utf8",entropy:f.entropy||o(this.hash.hmacStrength),entropyEnc:f.entropy&&f.entropyEnc||"utf8",nonce:this.n.toArray()}),m=this.n.byteLength(),w=this.n.sub(new r(2));;){var E=new r(g.generate(m));if(!(E.cmp(w)>0))return E.iaddn(1),this.keyFromPrivate(E)}},d.prototype._truncateToN=function(f,g,m){var w;if(r.isBN(f)||typeof f=="number")f=new r(f,16),w=f.byteLength();else if(typeof f=="object")w=f.length,f=new r(f,16);else{var E=f.toString();w=E.length+1>>>1,f=new r(E,16)}typeof m!="number"&&(m=w*8);var A=m-this.n.bitLength();return A>0&&(f=f.ushrn(A)),!g&&f.cmp(this.n)>=0?f.sub(this.n):f},d.prototype.sign=function(f,g,m,w){if(typeof m=="object"&&(w=m,m=null),w||(w={}),typeof f!="string"&&typeof f!="number"&&!r.isBN(f)){l(typeof f=="object"&&f&&typeof f.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),l(f.length>>>0===f.length);for(var E=0;E<f.length;E++)l((f[E]&255)===f[E])}g=this.keyFromPrivate(g,m),f=this._truncateToN(f,!1,w.msgBitLength),l(!f.isNeg(),"Can not sign a negative message");var A=this.n.byteLength(),C=g.getPrivate().toArray("be",A),O=f.toArray("be",A);l(new r(O).eq(f),"Can not sign message");for(var R=new n({hash:this.hash,entropy:C,nonce:O,pers:w.pers,persEnc:w.persEnc||"utf8"}),P=this.n.sub(new r(1)),L=0;;L++){var j=w.k?w.k(L):new r(R.generate(this.n.byteLength()));if(j=this._truncateToN(j,!0),!(j.cmpn(1)<=0||j.cmp(P)>=0)){var G=this.g.mul(j);if(!G.isInfinity()){var Z=G.getX(),K=Z.umod(this.n);if(K.cmpn(0)!==0){var z=j.invm(this.n).mul(K.mul(g.getPrivate()).iadd(f));if(z=z.umod(this.n),z.cmpn(0)!==0){var V=(G.getY().isOdd()?1:0)|(Z.cmp(K)!==0?2:0);return w.canonical&&z.cmp(this.nh)>0&&(z=this.n.sub(z),V^=1),new c({r:K,s:z,recoveryParam:V})}}}}}},d.prototype.verify=function(f,g,m,w,E){E||(E={}),f=this._truncateToN(f,!1,E.msgBitLength),m=this.keyFromPublic(m,w),g=new c(g,"hex");var{r:A,s:C}=g;if(A.cmpn(1)<0||A.cmp(this.n)>=0||C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;var O=C.invm(this.n),R=O.mul(f).umod(this.n),P=O.mul(A).umod(this.n),L;return this.curve._maxwellTrick?(L=this.g.jmulAdd(R,m.getPublic(),P),L.isInfinity()?!1:L.eqXToP(A)):(L=this.g.mulAdd(R,m.getPublic(),P),L.isInfinity()?!1:L.getX().umod(this.n).cmp(A)===0)},d.prototype.recoverPubKey=function(f,g,m,w){l((3&m)===m,"The recovery param is more than two bits"),g=new c(g,w);var E=this.n,A=new r(f),C=g.r,O=g.s,R=m&1,P=m>>1;if(C.cmp(this.curve.p.umod(this.curve.n))>=0&&P)throw Error("Unable to find sencond key candinate");P?C=this.curve.pointFromX(C.add(this.curve.n),R):C=this.curve.pointFromX(C,R);var L=g.r.invm(E),j=E.sub(A).mul(L).umod(E),G=O.mul(L).umod(E);return this.g.mulAdd(j,C,G)},d.prototype.getKeyRecoveryParam=function(f,g,m,w){if(g=new c(g,w),g.recoveryParam!==null)return g.recoveryParam;for(var E=0;E<4;E++){var A;try{A=this.recoverPubKey(f,g,E)}catch{continue}if(A.eq(m))return E}throw Error("Unable to find valid recovery factor")}}),PE=Qe((e,t)=>{var r=Vn(),n=r.assert,i=r.parseBytes,s=r.cachedProperty;function o(l,u){this.eddsa=l,this._secret=i(u.secret),l.isPoint(u.pub)?this._pub=u.pub:this._pubBytes=i(u.pub)}a(o,"Y"),o.fromPublic=function(l,u){return u instanceof o?u:new o(l,{pub:u})},o.fromSecret=function(l,u){return u instanceof o?u:new o(l,{secret:u})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(o,"privBytes",function(){var l=this.eddsa,u=this.hash(),c=l.encodingLength-1,d=u.slice(0,l.encodingLength);return d[0]&=248,d[c]&=127,d[c]|=64,d}),s(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(l){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(l,this)},o.prototype.verify=function(l,u){return this.eddsa.verify(l,u,this)},o.prototype.getSecret=function(l){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),l)},o.prototype.getPublic=function(l){return r.encode(this.pubBytes(),l)},t.exports=o}),LE=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert,s=n.cachedProperty,o=n.parseBytes;function l(u,c){this.eddsa=u,typeof c!="object"&&(c=o(c)),Array.isArray(c)&&(i(c.length===u.encodingLength*2,"Signature has invalid size"),c={R:c.slice(0,u.encodingLength),S:c.slice(u.encodingLength)}),i(c.R&&c.S,"Signature without R or S"),u.isPoint(c.R)&&(this._R=c.R),c.S instanceof r&&(this._S=c.S),this._Rencoded=Array.isArray(c.R)?c.R:c.Rencoded,this._Sencoded=Array.isArray(c.S)?c.S:c.Sencoded}a(l,"v"),s(l,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(l,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(l,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(l,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=l}),DE=Qe((e,t)=>{var r=qd(),n=ef(),i=Vn(),s=i.assert,o=i.parseBytes,l=PE(),u=LE();function c(d){if(s(d==="ed25519","only tested with ed25519 so far"),!(this instanceof c))return new c(d);d=n[d].curve,this.curve=d,this.g=d.g,this.g.precompute(d.n.bitLength()+1),this.pointClass=d.point().constructor,this.encodingLength=Math.ceil(d.n.bitLength()/8),this.hash=r.sha512}a(c,"T"),t.exports=c,c.prototype.sign=function(d,f){d=o(d);var g=this.keyFromSecret(f),m=this.hashInt(g.messagePrefix(),d),w=this.g.mul(m),E=this.encodePoint(w),A=this.hashInt(E,g.pubBytes(),d).mul(g.priv()),C=m.add(A).umod(this.curve.n);return this.makeSignature({R:w,S:C,Rencoded:E})},c.prototype.verify=function(d,f,g){if(d=o(d),f=this.makeSignature(f),f.S().gte(f.eddsa.curve.n)||f.S().isNeg())return!1;var m=this.keyFromPublic(g),w=this.hashInt(f.Rencoded(),m.pubBytes(),d),E=this.g.mul(f.S()),A=f.R().add(m.pub().mul(w));return A.eq(E)},c.prototype.hashInt=function(){for(var d=this.hash(),f=0;f<arguments.length;f++)d.update(arguments[f]);return i.intFromLE(d.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(d){return l.fromPublic(this,d)},c.prototype.keyFromSecret=function(d){return l.fromSecret(this,d)},c.prototype.makeSignature=function(d){return d instanceof u?d:new u(this,d)},c.prototype.encodePoint=function(d){var f=d.getY().toArray("le",this.encodingLength);return f[this.encodingLength-1]|=d.getX().isOdd()?128:0,f},c.prototype.decodePoint=function(d){d=i.parseBytes(d);var f=d.length-1,g=d.slice(0,f).concat(d[f]&-129),m=(d[f]&128)!==0,w=i.intFromLE(g);return this.curve.pointFromY(w,m)},c.prototype.encodeInt=function(d){return d.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(d){return i.intFromLE(d)},c.prototype.isPoint=function(d){return d instanceof this.pointClass}}),jE=Qe(e=>{var t=e;t.version=vE().version,t.utils=Vn(),t.rand=F0(),t.curve=H0(),t.curves=ef(),t.ec=RE(),t.eddsa=DE()}),UE=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,_t=_[3]|0,Ve=_t&8191,Te=_t>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var xt=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=xt,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),BE=Qe((e,t)=>{var r=jE(),n=UE();t.exports=function(l){return new s(l)};var i={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1;function s(l){this.curveType=i[l],!this.curveType&&(this.curveType={name:l}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}a(s,"O"),s.prototype.generateKeys=function(l,u){return this.keys=this.curve.genKeyPair(),this.getPublicKey(l,u)},s.prototype.computeSecret=function(l,u,c){u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u));var d=this.curve.keyFromPublic(l).getPublic(),f=d.mul(this.keys.getPrivate()).getX();return o(f,c,this.curveType.byteLength)},s.prototype.getPublicKey=function(l,u){var c=this.keys.getPublic(u==="compressed",!0);return u==="hybrid"&&(c[c.length-1]%2?c[0]=7:c[0]=6),o(c,l)},s.prototype.getPrivateKey=function(l){return o(this.keys.getPrivate(),l)},s.prototype.setPublicKey=function(l,u){return u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u)),this.keys._importPublic(l),this},s.prototype.setPrivateKey=function(l,u){u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u));var c=new n(l);return c=c.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(c),this};function o(l,u,c){Array.isArray(l)||(l=l.toArray());var d=new Buffer(l);if(c&&d.length<c){var f=new Buffer(c-d.length);f.fill(0),d=Buffer.concat([f,d])}return u?d.toString(u):d}a(o,"Y")}),zE=Qe((e,t)=>{var r=(Qn(),qt(Ln)).createECDH;t.exports=r||BE()}),FE=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,_t=_[3]|0,Ve=_t&8191,Te=_t>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var xt=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=xt,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),HE=Qe(e=>{var t=Qo(),r=Mn(),n=e;n.define=function(s,o){return new i(s,o)};function i(s,o){this.name=s,this.body=o,this.decoders={},this.encoders={}}a(i,"K"),i.prototype._createNamed=function(s){var o;try{o=(()=>{throw new Error("Cannot require module vm")})().runInThisContext("(function "+this.name+`(entity) {
35
+ `;super(I),this.name="AggregateError",this.errors=S}}T.exports={AggregateError:k,ArrayIsArray(p){return Array.isArray(p)},ArrayPrototypeIncludes(p,S){return p.includes(S)},ArrayPrototypeIndexOf(p,S){return p.indexOf(S)},ArrayPrototypeJoin(p,S){return p.join(S)},ArrayPrototypeMap(p,S){return p.map(S)},ArrayPrototypePop(p,S){return p.pop(S)},ArrayPrototypePush(p,S){return p.push(S)},ArrayPrototypeSlice(p,S,I){return p.slice(S,I)},Error,FunctionPrototypeCall(p,S,...I){return p.call(S,...I)},FunctionPrototypeSymbolHasInstance(p,S){return Function.prototype[Symbol.hasInstance].call(p,S)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(p,S){return Object.defineProperties(p,S)},ObjectDefineProperty(p,S,I){return Object.defineProperty(p,S,I)},ObjectGetOwnPropertyDescriptor(p,S){return Object.getOwnPropertyDescriptor(p,S)},ObjectKeys(p){return Object.keys(p)},ObjectSetPrototypeOf(p,S){return Object.setPrototypeOf(p,S)},Promise,PromisePrototypeCatch(p,S){return p.catch(S)},PromisePrototypeThen(p,S,I){return p.then(S,I)},PromiseReject(p){return Promise.reject(p)},PromiseResolve(p){return Promise.resolve(p)},ReflectApply:Reflect.apply,RegExpPrototypeTest(p,S){return p.test(S)},SafeSet:Set,String,StringPrototypeSlice(p,S,I){return p.slice(S,I)},StringPrototypeToLowerCase(p){return p.toLowerCase()},StringPrototypeToUpperCase(p){return p.toUpperCase()},StringPrototypeTrim(p){return p.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(p,S,I){return p.set(S,I)},Boolean,Uint8Array}}),i=r((N,T)=>{T.exports={format(k,...p){return k.replace(/%([sdifj])/g,function(...[S,I]){let M=p.shift();return I==="f"?M.toFixed(6):I==="j"?JSON.stringify(M):I==="s"&&typeof M=="object"?`${M.constructor!==Object?M.constructor.name:""} {}`.trim():M.toString()})},inspect(k){switch(typeof k){case"string":if(k.includes("'"))if(k.includes('"')){if(!k.includes("`")&&!k.includes("${"))return`\`${k}\``}else return`"${k}"`;return`'${k}'`;case"number":return isNaN(k)?"NaN":Object.is(k,-0)?String(k):k;case"bigint":return`${String(k)}n`;case"boolean":case"undefined":return String(k);case"object":return"{}"}}}}),s=r((N,T)=>{var{format:k,inspect:p}=i(),{AggregateError:S}=n(),I=globalThis.AggregateError||S,M=Symbol("kIsNodeError"),U=["string","function","number","object","Function","Object","boolean","bigint","symbol"],B=/^([A-Z][a-z0-9]*)+$/,H={};function $(Se,Q){if(!Se)throw new H.ERR_INTERNAL_ASSERTION(Q)}a($,"Z");function ae(Se){let Q="",se=Se.length,J=Se[0]==="-"?1:0;for(;se>=J+4;se-=3)Q=`_${Se.slice(se-3,se)}${Q}`;return`${Se.slice(0,se)}${Q}`}a(ae,"w");function ie(Se,Q,se){if(typeof Q=="function")return $(Q.length<=se.length,`Code: ${Se}; The provided arguments length (${se.length}) does not match the required ones (${Q.length}).`),Q(...se);let J=(Q.match(/%[dfijoOs]/g)||[]).length;return $(J===se.length,`Code: ${Se}; The provided arguments length (${se.length}) does not match the required ones (${J}).`),se.length===0?Q:k(Q,...se)}a(ie,"k");function ne(Se,Q,se){se||(se=Error);class J extends se{static{a(this,"b")}constructor(...de){super(ie(Se,Q,de))}toString(){return`${this.name} [${Se}]: ${this.message}`}}Object.defineProperties(J.prototype,{name:{value:se.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${Se}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),J.prototype.code=Se,J.prototype[M]=!0,H[Se]=J}a(ne,"M");function Ne(Se){let Q="__node_internal_"+Se.name;return Object.defineProperty(Se,"name",{value:Q}),Se}a(Ne,"N");function ve(Se,Q){if(Se&&Q&&Se!==Q){if(Array.isArray(Q.errors))return Q.errors.push(Se),Q;let se=new I([Q,Se],Q.message);return se.code=Q.code,se}return Se||Q}a(ve,"R");class he extends Error{static{a(this,"E")}constructor(Q="The operation was aborted",se=void 0){if(se!==void 0&&typeof se!="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",se);super(Q,se),this.code="ABORT_ERR",this.name="AbortError"}}ne("ERR_ASSERTION","%s",Error),ne("ERR_INVALID_ARG_TYPE",(Se,Q,se)=>{$(typeof Se=="string","'name' must be a string"),!Array.isArray(Q)&&(Q=[Q]);let J="The ";Se.endsWith(" argument")?J+=`${Se} `:J+=`"${Se}" ${Se.includes(".")?"property":"argument"} `,J+="must be ";let te=[],de=[],be=[];for(let oe of Q)$(typeof oe=="string","All expected entries have to be of type string"),U.includes(oe)?te.push(oe.toLowerCase()):B.test(oe)?de.push(oe):($(oe!=="object",'The value "object" should be written as "Object"'),be.push(oe));if(de.length>0){let oe=te.indexOf("object");oe!==-1&&(te.splice(te,oe,1),de.push("Object"))}if(te.length>0){switch(te.length){case 1:J+=`of type ${te[0]}`;break;case 2:J+=`one of type ${te[0]} or ${te[1]}`;break;default:{let oe=te.pop();J+=`one of type ${te.join(", ")}, or ${oe}`}}(de.length>0||be.length>0)&&(J+=" or ")}if(de.length>0){switch(de.length){case 1:J+=`an instance of ${de[0]}`;break;case 2:J+=`an instance of ${de[0]} or ${de[1]}`;break;default:{let oe=de.pop();J+=`an instance of ${de.join(", ")}, or ${oe}`}}be.length>0&&(J+=" or ")}switch(be.length){case 0:break;case 1:be[0].toLowerCase()!==be[0]&&(J+="an "),J+=`${be[0]}`;break;case 2:J+=`one of ${be[0]} or ${be[1]}`;break;default:{let oe=be.pop();J+=`one of ${be.join(", ")}, or ${oe}`}}if(se==null)J+=`. Received ${se}`;else if(typeof se=="function"&&se.name)J+=`. Received function ${se.name}`;else if(typeof se=="object"){var Ae;if((Ae=se.constructor)!==null&&Ae!==void 0&&Ae.name)J+=`. Received an instance of ${se.constructor.name}`;else{let oe=p(se,{depth:-1});J+=`. Received ${oe}`}}else{let oe=p(se,{colors:!1});oe.length>25&&(oe=`${oe.slice(0,25)}...`),J+=`. Received type ${typeof se} (${oe})`}return J},TypeError),ne("ERR_INVALID_ARG_VALUE",(Se,Q,se="is invalid")=>{let J=p(Q);return J.length>128&&(J=J.slice(0,128)+"..."),`The ${Se.includes(".")?"property":"argument"} '${Se}' ${se}. Received ${J}`},TypeError),ne("ERR_INVALID_RETURN_VALUE",(Se,Q,se)=>{var J;let te=se!=null&&(J=se.constructor)!==null&&J!==void 0&&J.name?`instance of ${se.constructor.name}`:`type ${typeof se}`;return`Expected ${Se} to be returned from the "${Q}" function but got ${te}.`},TypeError),ne("ERR_MISSING_ARGS",(...Se)=>{$(Se.length>0,"At least one arg needs to be specified");let Q,se=Se.length;switch(Se=(Array.isArray(Se)?Se:[Se]).map(J=>`"${J}"`).join(" or "),se){case 1:Q+=`The ${Se[0]} argument`;break;case 2:Q+=`The ${Se[0]} and ${Se[1]} arguments`;break;default:{let J=Se.pop();Q+=`The ${Se.join(", ")}, and ${J} arguments`}break}return`${Q} must be specified`},TypeError),ne("ERR_OUT_OF_RANGE",(Se,Q,se)=>{$(Q,'Missing "range" argument');let J;if(Number.isInteger(se)&&Math.abs(se)>4294967296)J=ae(String(se));else if(typeof se=="bigint"){J=String(se);let te=BigInt(2)**BigInt(32);(se>te||se<-te)&&(J=ae(J)),J+="n"}else J=p(se);return`The value of "${Se}" is out of range. It must be ${Q}. Received ${J}`},RangeError),ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),ne("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),ne("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),ne("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),ne("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),ne("ERR_STREAM_WRITE_AFTER_END","write after end",Error),ne("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),T.exports={AbortError:he,aggregateTwoErrors:Ne(ve),hideStackFrames:Ne,codes:H}}),o=r((N,T)=>{Object.defineProperty(N,"__esModule",{value:!0});var k=new WeakMap,p=new WeakMap;function S(Y){let ee=k.get(Y);return console.assert(ee!=null,"'this' is expected an Event object, but got",Y),ee}a(S,"K");function I(Y){if(Y.passiveListener!=null){typeof console<"u"&&typeof console.error=="function"&&console.error("Unable to preventDefault inside passive event listener invocation.",Y.passiveListener);return}Y.event.cancelable&&(Y.canceled=!0,typeof Y.event.preventDefault=="function"&&Y.event.preventDefault())}a(I,"O");function M(Y,ee){k.set(this,{eventTarget:Y,event:ee,eventPhase:2,currentTarget:Y,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:ee.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let X=Object.keys(ee);for(let W=0;W<X.length;++W){let q=X[W];q in this||Object.defineProperty(this,q,U(q))}}a(M,"Y"),M.prototype={get type(){return S(this).event.type},get target(){return S(this).eventTarget},get currentTarget(){return S(this).currentTarget},composedPath(){let Y=S(this).currentTarget;return Y==null?[]:[Y]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return S(this).eventPhase},stopPropagation(){let Y=S(this);Y.stopped=!0,typeof Y.event.stopPropagation=="function"&&Y.event.stopPropagation()},stopImmediatePropagation(){let Y=S(this);Y.stopped=!0,Y.immediateStopped=!0,typeof Y.event.stopImmediatePropagation=="function"&&Y.event.stopImmediatePropagation()},get bubbles(){return!!S(this).event.bubbles},get cancelable(){return!!S(this).event.cancelable},preventDefault(){I(S(this))},get defaultPrevented(){return S(this).canceled},get composed(){return!!S(this).event.composed},get timeStamp(){return S(this).timeStamp},get srcElement(){return S(this).eventTarget},get cancelBubble(){return S(this).stopped},set cancelBubble(Y){if(!Y)return;let ee=S(this);ee.stopped=!0,typeof ee.event.cancelBubble=="boolean"&&(ee.event.cancelBubble=!0)},get returnValue(){return!S(this).canceled},set returnValue(Y){Y||I(S(this))},initEvent(){}},Object.defineProperty(M.prototype,"constructor",{value:M,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u"&&(Object.setPrototypeOf(M.prototype,window.Event.prototype),p.set(window.Event.prototype,M));function U(Y){return{get(){return S(this).event[Y]},set(ee){S(this).event[Y]=ee},configurable:!0,enumerable:!0}}a(U,"v");function B(Y){return{value(){let ee=S(this).event;return ee[Y].apply(ee,arguments)},configurable:!0,enumerable:!0}}a(B,"W");function H(Y,ee){let X=Object.keys(ee);if(X.length===0)return Y;function W(q,re){Y.call(this,q,re)}a(W,"J"),W.prototype=Object.create(Y.prototype,{constructor:{value:W,configurable:!0,writable:!0}});for(let q=0;q<X.length;++q){let re=X[q];if(!(re in Y.prototype)){let Oe=typeof Object.getOwnPropertyDescriptor(ee,re).value=="function";Object.defineProperty(W.prototype,re,Oe?B(re):U(re))}}return W}a(H,"T");function $(Y){if(Y==null||Y===Object.prototype)return M;let ee=p.get(Y);return ee==null&&(ee=H($(Object.getPrototypeOf(Y)),Y),p.set(Y,ee)),ee}a($,"Z");function ae(Y,ee){return new($(Object.getPrototypeOf(ee)))(Y,ee)}a(ae,"w");function ie(Y){return S(Y).immediateStopped}a(ie,"k");function ne(Y,ee){S(Y).eventPhase=ee}a(ne,"M");function Ne(Y,ee){S(Y).currentTarget=ee}a(Ne,"N");function ve(Y,ee){S(Y).passiveListener=ee}a(ve,"R");var he=new WeakMap,Se=1,Q=2,se=3;function J(Y){return Y!==null&&typeof Y=="object"}a(J,"b");function te(Y){let ee=he.get(Y);if(ee==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return ee}a(te,"y");function de(Y){return{get(){let ee=te(this).get(Y);for(;ee!=null;){if(ee.listenerType===se)return ee.listener;ee=ee.next}return null},set(ee){typeof ee!="function"&&!J(ee)&&(ee=null);let X=te(this),W=null,q=X.get(Y);for(;q!=null;)q.listenerType===se?W!==null?W.next=q.next:q.next!==null?X.set(Y,q.next):X.delete(Y):W=q,q=q.next;if(ee!==null){let re={listener:ee,listenerType:se,passive:!1,once:!1,next:null};W===null?X.set(Y,re):W.next=re}},configurable:!0,enumerable:!0}}a(de,"p");function be(Y,ee){Object.defineProperty(Y,`on${ee}`,de(ee))}a(be,"i");function Ae(Y){function ee(){oe.call(this)}a(ee,"a"),ee.prototype=Object.create(oe.prototype,{constructor:{value:ee,configurable:!0,writable:!0}});for(let X=0;X<Y.length;++X)be(ee.prototype,Y[X]);return ee}a(Ae,"$$");function oe(){if(this instanceof oe){he.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Ae(arguments[0]);if(arguments.length>0){let Y=Array(arguments.length);for(let ee=0;ee<arguments.length;++ee)Y[ee]=arguments[ee];return Ae(Y)}throw TypeError("Cannot call a class as a function")}a(oe,"Q"),oe.prototype={addEventListener(Y,ee,X){if(ee==null)return;if(typeof ee!="function"&&!J(ee))throw TypeError("'listener' should be a function or an object.");let W=te(this),q=J(X),re=(q?X.capture:X)?Se:Q,Oe={listener:ee,listenerType:re,passive:q&&!!X.passive,once:q&&!!X.once,next:null},Ee=W.get(Y);if(Ee===void 0){W.set(Y,Oe);return}let Be=null;for(;Ee!=null;){if(Ee.listener===ee&&Ee.listenerType===re)return;Be=Ee,Ee=Ee.next}Be.next=Oe},removeEventListener(Y,ee,X){if(ee==null)return;let W=te(this),q=(J(X)?X.capture:X)?Se:Q,re=null,Oe=W.get(Y);for(;Oe!=null;){if(Oe.listener===ee&&Oe.listenerType===q){re!==null?re.next=Oe.next:Oe.next!==null?W.set(Y,Oe.next):W.delete(Y);return}re=Oe,Oe=Oe.next}},dispatchEvent(Y){if(Y==null||typeof Y.type!="string")throw TypeError('"event.type" should be a string.');let ee=te(this),X=Y.type,W=ee.get(X);if(W==null)return!0;let q=ae(this,Y),re=null;for(;W!=null;){if(W.once?re!==null?re.next=W.next:W.next!==null?ee.set(X,W.next):ee.delete(X):re=W,ve(q,W.passive?W.listener:null),typeof W.listener=="function")try{W.listener.call(this,q)}catch(Oe){typeof console<"u"&&typeof console.error=="function"&&console.error(Oe)}else W.listenerType!==se&&typeof W.listener.handleEvent=="function"&&W.listener.handleEvent(q);if(ie(q))break;W=W.next}return ve(q,null),ne(q,0),Ne(q,null),!q.defaultPrevented}},Object.defineProperty(oe.prototype,"constructor",{value:oe,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u"&&Object.setPrototypeOf(oe.prototype,window.EventTarget.prototype),N.defineEventAttribute=be,N.EventTarget=oe,N.default=oe,T.exports=oe,T.exports.EventTarget=T.exports.default=oe,T.exports.defineEventAttribute=be}),l=r((N,T)=>{Object.defineProperty(N,"__esModule",{value:!0});var k=o();class p extends k.EventTarget{static{a(this,"P")}constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let ae=M.get(this);if(typeof ae!="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return ae}}k.defineEventAttribute(p.prototype,"abort");function S(){let $=Object.create(p.prototype);return k.EventTarget.call($),M.set($,!1),$}a(S,"K");function I($){M.get($)===!1&&(M.set($,!0),$.dispatchEvent({type:"abort"}))}a(I,"O");var M=new WeakMap;Object.defineProperties(p.prototype,{aborted:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(p.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class U{static{a(this,"v")}constructor(){B.set(this,S())}get signal(){return H(this)}abort(){I(H(this))}}var B=new WeakMap;function H($){let ae=B.get($);if(ae==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${$===null?"null":typeof $}`);return ae}a(H,"T"),Object.defineProperties(U.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol"&&Object.defineProperty(U.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"}),N.AbortController=U,N.AbortSignal=p,N.default=U,T.exports=U,T.exports.AbortController=T.exports.default=U,T.exports.AbortSignal=p}),u=r((N,T)=>{var k=(ln(),qt(qr)),{format:p,inspect:S}=i(),{codes:{ERR_INVALID_ARG_TYPE:I}}=s(),{kResistStopPropagation:M,AggregateError:U,SymbolDispose:B}=n(),H=globalThis.AbortSignal||l().AbortSignal,$=globalThis.AbortController||l().AbortController,ae=Object.getPrototypeOf(async function(){}).constructor,ie=globalThis.Blob||k.Blob,ne=typeof ie<"u"?function(he){return he instanceof ie}:function(he){return!1},Ne=a((he,Se)=>{if(he!==void 0&&(he===null||typeof he!="object"||!("aborted"in he)))throw new I(Se,"AbortSignal",he)},"N"),ve=a((he,Se)=>{if(typeof he!="function")throw new I(Se,"Function",he)},"R");T.exports={AggregateError:U,kEmptyObject:Object.freeze({}),once(he){let Se=!1;return function(...Q){Se||(Se=!0,he.apply(this,Q))}},createDeferredPromise:a(function(){let he,Se;return{promise:new Promise((Q,se)=>{he=Q,Se=se}),resolve:he,reject:Se}},"createDeferredPromise"),promisify(he){return new Promise((Se,Q)=>{he((se,...J)=>se?Q(se):Se(...J))})},debuglog(){return function(){}},format:p,inspect:S,types:{isAsyncFunction(he){return he instanceof ae},isArrayBufferView(he){return ArrayBuffer.isView(he)}},isBlob:ne,deprecate(he,Se){return he},addAbortListener:(Wd(),qt(Lu)).addAbortListener||function(he,Se){if(he===void 0)throw new I("signal","AbortSignal",he);Ne(he,"signal"),ve(Se,"listener");let Q;return he.aborted?queueMicrotask(()=>Se()):(he.addEventListener("abort",Se,{__proto__:null,once:!0,[M]:!0}),Q=a(()=>{he.removeEventListener("abort",Se)},"h")),{__proto__:null,[B](){var se;(se=Q)===null||se===void 0||se()}}},AbortSignalAny:H.any||function(he){if(he.length===1)return he[0];let Se=new $,Q=a(()=>Se.abort(),"h");return he.forEach(se=>{Ne(se,"signals"),se.addEventListener("abort",Q,{once:!0})}),Se.signal.addEventListener("abort",()=>{he.forEach(se=>se.removeEventListener("abort",Q))},{once:!0}),Se.signal}},T.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),c=r((N,T)=>{var{ArrayIsArray:k,ArrayPrototypeIncludes:p,ArrayPrototypeJoin:S,ArrayPrototypeMap:I,NumberIsInteger:M,NumberIsNaN:U,NumberMAX_SAFE_INTEGER:B,NumberMIN_SAFE_INTEGER:H,NumberParseInt:$,ObjectPrototypeHasOwnProperty:ae,RegExpPrototypeExec:ie,String:ne,StringPrototypeToUpperCase:Ne,StringPrototypeTrim:ve}=n(),{hideStackFrames:he,codes:{ERR_SOCKET_BAD_PORT:Se,ERR_INVALID_ARG_TYPE:Q,ERR_INVALID_ARG_VALUE:se,ERR_OUT_OF_RANGE:J,ERR_UNKNOWN_SIGNAL:te}}=s(),{normalizeEncoding:de}=u(),{isAsyncFunction:be,isArrayBufferView:Ae}=u().types,oe={};function Y(ce){return ce===(ce|0)}a(Y,"c");function ee(ce){return ce===ce>>>0}a(ee,"a");var X=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function q(ce,Ce,et){if(typeof ce>"u"&&(ce=et),typeof ce=="string"){if(ie(X,ce)===null)throw new se(Ce,ce,W);ce=$(ce,8)}return Ee(ce,Ce),ce}a(q,"X");var re=he((ce,Ce,et=H,ke=B)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);if(ce<et||ce>ke)throw new J(Ce,`>= ${et} && <= ${ke}`,ce)}),Oe=he((ce,Ce,et=-2147483648,ke=2147483647)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);if(ce<et||ce>ke)throw new J(Ce,`>= ${et} && <= ${ke}`,ce)}),Ee=he((ce,Ce,et=!1)=>{if(typeof ce!="number")throw new Q(Ce,"number",ce);if(!M(ce))throw new J(Ce,"an integer",ce);let ke=et?1:0,tt=4294967295;if(ce<ke||ce>tt)throw new J(Ce,`>= ${ke} && <= ${tt}`,ce)});function Be(ce,Ce){if(typeof ce!="string")throw new Q(Ce,"string",ce)}a(Be,"S");function pt(ce,Ce,et=void 0,ke){if(typeof ce!="number")throw new Q(Ce,"number",ce);if(et!=null&&ce<et||ke!=null&&ce>ke||(et!=null||ke!=null)&&U(ce))throw new J(Ce,`${et!=null?`>= ${et}`:""}${et!=null&&ke!=null?" && ":""}${ke!=null?`<= ${ke}`:""}`,ce)}a(pt,"A");var xe=he((ce,Ce,et)=>{if(!p(et,ce)){let ke="must be one of: "+S(I(et,tt=>typeof tt=="string"?`'${tt}'`:ne(tt)),", ");throw new se(Ce,ce,ke)}});function Ge(ce,Ce){if(typeof ce!="boolean")throw new Q(Ce,"boolean",ce)}a(Ge,"G");function ge(ce,Ce,et){return ce==null||!ae(ce,Ce)?et:ce[Ce]}a(ge,"I");var _e=he((ce,Ce,et=null)=>{let ke=ge(et,"allowArray",!1),tt=ge(et,"allowFunction",!1);if(!ge(et,"nullable",!1)&&ce===null||!ke&&k(ce)||typeof ce!="object"&&(!tt||typeof ce!="function"))throw new Q(Ce,"Object",ce)}),Re=he((ce,Ce)=>{if(ce!=null&&typeof ce!="object"&&typeof ce!="function")throw new Q(Ce,"a dictionary",ce)}),ze=he((ce,Ce,et=0)=>{if(!k(ce))throw new Q(Ce,"Array",ce);if(ce.length<et){let ke=`must be longer than ${et}`;throw new se(Ce,ce,ke)}});function Pe(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++)Be(ce[et],`${Ce}[${et}]`)}a(Pe,"l");function We(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++)Ge(ce[et],`${Ce}[${et}]`)}a(We,"o");function xt(ce,Ce){ze(ce,Ce);for(let et=0;et<ce.length;et++){let ke=ce[et],tt=`${Ce}[${et}]`;if(ke==null)throw new Q(tt,"AbortSignal",ke);$e(ke,tt)}}a(xt,"T$");function Ve(ce,Ce="signal"){if(Be(ce,Ce),oe[ce]===void 0)throw oe[Ne(ce)]!==void 0?new te(ce+" (signals must use all capital letters)"):new te(ce)}a(Ve,"e");var Te=he((ce,Ce="buffer")=>{if(!Ae(ce))throw new Q(Ce,["Buffer","TypedArray","DataView"],ce)});function Ye(ce,Ce){let et=de(Ce),ke=ce.length;if(et==="hex"&&ke%2!==0)throw new se("encoding",Ce,`is invalid for data of length ${ke}`)}a(Ye,"j$");function Me(ce,Ce="Port",et=!0){if(typeof ce!="number"&&typeof ce!="string"||typeof ce=="string"&&ve(ce).length===0||+ce!==+ce>>>0||ce>65535||ce===0&&!et)throw new Se(Ce,ce,et);return ce|0}a(Me,"s");var $e=he((ce,Ce)=>{if(ce!==void 0&&(ce===null||typeof ce!="object"||!("aborted"in ce)))throw new Q(Ce,"AbortSignal",ce)}),mt=he((ce,Ce)=>{if(typeof ce!="function")throw new Q(Ce,"Function",ce)}),ue=he((ce,Ce)=>{if(typeof ce!="function"||be(ce))throw new Q(Ce,"Function",ce)}),me=he((ce,Ce)=>{if(ce!==void 0)throw new Q(Ce,"undefined",ce)});function He(ce,Ce,et){if(!p(et,ce))throw new Q(Ce,`('${S(et,"|")}')`,ce)}a(He,"W$");var Ie=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function je(ce,Ce){if(typeof ce>"u"||!ie(Ie,ce))throw new se(Ce,ce,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}a(je,"_$");function rt(ce){if(typeof ce=="string")return je(ce,"hints"),ce;if(k(ce)){let Ce=ce.length,et="";if(Ce===0)return et;for(let ke=0;ke<Ce;ke++){let tt=ce[ke];je(tt,"hints"),et+=tt,ke!==Ce-1&&(et+=", ")}return et}throw new se("hints",ce,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}a(rt,"v$"),T.exports={isInt32:Y,isUint32:ee,parseFileMode:q,validateArray:ze,validateStringArray:Pe,validateBooleanArray:We,validateAbortSignalArray:xt,validateBoolean:Ge,validateBuffer:Te,validateDictionary:Re,validateEncoding:Ye,validateFunction:mt,validateInt32:Oe,validateInteger:re,validateNumber:pt,validateObject:_e,validateOneOf:xe,validatePlainFunction:ue,validatePort:Me,validateSignalName:Ve,validateString:Be,validateUint32:Ee,validateUndefined:me,validateUnion:He,validateAbortSignal:$e,validateLinkHeaderValue:rt}}),d=r((N,T)=>{T.exports=globalThis.process}),f=r((N,T)=>{var{SymbolAsyncIterator:k,SymbolIterator:p,SymbolFor:S}=n(),I=S("nodejs.stream.destroyed"),M=S("nodejs.stream.errored"),U=S("nodejs.stream.readable"),B=S("nodejs.stream.writable"),H=S("nodejs.stream.disturbed"),$=S("nodejs.webstream.isClosedPromise"),ae=S("nodejs.webstream.controllerErrorFunction");function ie(ge,_e=!1){var Re;return!!(ge&&typeof ge.pipe=="function"&&typeof ge.on=="function"&&(!_e||typeof ge.pause=="function"&&typeof ge.resume=="function")&&(!ge._writableState||((Re=ge._readableState)===null||Re===void 0?void 0:Re.readable)!==!1)&&(!ge._writableState||ge._readableState))}a(ie,"k");function ne(ge){var _e;return!!(ge&&typeof ge.write=="function"&&typeof ge.on=="function"&&(!ge._readableState||((_e=ge._writableState)===null||_e===void 0?void 0:_e.writable)!==!1))}a(ne,"M");function Ne(ge){return!!(ge&&typeof ge.pipe=="function"&&ge._readableState&&typeof ge.on=="function"&&typeof ge.write=="function")}a(Ne,"N");function ve(ge){return ge&&(ge._readableState||ge._writableState||typeof ge.write=="function"&&typeof ge.on=="function"||typeof ge.pipe=="function"&&typeof ge.on=="function")}a(ve,"R");function he(ge){return!!(ge&&!ve(ge)&&typeof ge.pipeThrough=="function"&&typeof ge.getReader=="function"&&typeof ge.cancel=="function")}a(he,"E");function Se(ge){return!!(ge&&!ve(ge)&&typeof ge.getWriter=="function"&&typeof ge.abort=="function")}a(Se,"D");function Q(ge){return!!(ge&&!ve(ge)&&typeof ge.readable=="object"&&typeof ge.writable=="object")}a(Q,"h");function se(ge){return he(ge)||Se(ge)||Q(ge)}a(se,"L");function J(ge,_e){return ge==null?!1:_e===!0?typeof ge[k]=="function":_e===!1?typeof ge[p]=="function":typeof ge[k]=="function"||typeof ge[p]=="function"}a(J,"b");function te(ge){if(!ve(ge))return null;let{_writableState:_e,_readableState:Re}=ge,ze=_e||Re;return!!(ge.destroyed||ge[I]||ze!=null&&ze.destroyed)}a(te,"y");function de(ge){if(!ne(ge))return null;if(ge.writableEnded===!0)return!0;let _e=ge._writableState;return _e!=null&&_e.errored?!1:typeof _e?.ended!="boolean"?null:_e.ended}a(de,"p");function be(ge,_e){if(!ne(ge))return null;if(ge.writableFinished===!0)return!0;let Re=ge._writableState;return Re!=null&&Re.errored?!1:typeof Re?.finished!="boolean"?null:!!(Re.finished||_e===!1&&Re.ended===!0&&Re.length===0)}a(be,"i");function Ae(ge){if(!ie(ge))return null;if(ge.readableEnded===!0)return!0;let _e=ge._readableState;return!_e||_e.errored?!1:typeof _e?.ended!="boolean"?null:_e.ended}a(Ae,"$$");function oe(ge,_e){if(!ie(ge))return null;let Re=ge._readableState;return Re!=null&&Re.errored?!1:typeof Re?.endEmitted!="boolean"?null:!!(Re.endEmitted||_e===!1&&Re.ended===!0&&Re.length===0)}a(oe,"Q");function Y(ge){return ge&&ge[U]!=null?ge[U]:typeof ge?.readable!="boolean"?null:te(ge)?!1:ie(ge)&&ge.readable&&!oe(ge)}a(Y,"c");function ee(ge){return ge&&ge[B]!=null?ge[B]:typeof ge?.writable!="boolean"?null:te(ge)?!1:ne(ge)&&ge.writable&&!de(ge)}a(ee,"a");function X(ge,_e){return ve(ge)?te(ge)?!0:!(_e?.readable!==!1&&Y(ge)||_e?.writable!==!1&&ee(ge)):null}a(X,"j");function W(ge){var _e,Re;return ve(ge)?ge.writableErrored?ge.writableErrored:(_e=(Re=ge._writableState)===null||Re===void 0?void 0:Re.errored)!==null&&_e!==void 0?_e:null:null}a(W,"J");function q(ge){var _e,Re;return ve(ge)?ge.readableErrored?ge.readableErrored:(_e=(Re=ge._readableState)===null||Re===void 0?void 0:Re.errored)!==null&&_e!==void 0?_e:null:null}a(q,"X");function re(ge){if(!ve(ge))return null;if(typeof ge.closed=="boolean")return ge.closed;let{_writableState:_e,_readableState:Re}=ge;return typeof _e?.closed=="boolean"||typeof Re?.closed=="boolean"?_e?.closed||Re?.closed:typeof ge._closed=="boolean"&&Oe(ge)?ge._closed:null}a(re,"H");function Oe(ge){return typeof ge._closed=="boolean"&&typeof ge._defaultKeepAlive=="boolean"&&typeof ge._removedConnection=="boolean"&&typeof ge._removedContLen=="boolean"}a(Oe,"f");function Ee(ge){return typeof ge._sent100=="boolean"&&Oe(ge)}a(Ee,"V");function Be(ge){var _e;return typeof ge._consuming=="boolean"&&typeof ge._dumped=="boolean"&&((_e=ge.req)===null||_e===void 0?void 0:_e.upgradeOrConnect)===void 0}a(Be,"S");function pt(ge){if(!ve(ge))return null;let{_writableState:_e,_readableState:Re}=ge,ze=_e||Re;return!ze&&Ee(ge)||!!(ze&&ze.autoDestroy&&ze.emitClose&&ze.closed===!1)}a(pt,"A");function xe(ge){var _e;return!!(ge&&((_e=ge[H])!==null&&_e!==void 0?_e:ge.readableDidRead||ge.readableAborted))}a(xe,"z");function Ge(ge){var _e,Re,ze,Pe,We,xt,Ve,Te,Ye,Me;return!!(ge&&((_e=(Re=(ze=(Pe=(We=(xt=ge[M])!==null&&xt!==void 0?xt:ge.readableErrored)!==null&&We!==void 0?We:ge.writableErrored)!==null&&Pe!==void 0?Pe:(Ve=ge._readableState)===null||Ve===void 0?void 0:Ve.errorEmitted)!==null&&ze!==void 0?ze:(Te=ge._writableState)===null||Te===void 0?void 0:Te.errorEmitted)!==null&&Re!==void 0?Re:(Ye=ge._readableState)===null||Ye===void 0?void 0:Ye.errored)!==null&&_e!==void 0?_e:!((Me=ge._writableState)===null||Me===void 0)&&Me.errored))}a(Ge,"G"),T.exports={isDestroyed:te,kIsDestroyed:I,isDisturbed:xe,kIsDisturbed:H,isErrored:Ge,kIsErrored:M,isReadable:Y,kIsReadable:U,kIsClosedPromise:$,kControllerErrorFunction:ae,kIsWritable:B,isClosed:re,isDuplexNodeStream:Ne,isFinished:X,isIterable:J,isReadableNodeStream:ie,isReadableStream:he,isReadableEnded:Ae,isReadableFinished:oe,isReadableErrored:q,isNodeStream:ve,isWebStream:se,isWritable:ee,isWritableNodeStream:ne,isWritableStream:Se,isWritableEnded:de,isWritableFinished:be,isWritableErrored:W,isServerRequest:Be,isServerResponse:Ee,willEmitClose:pt,isTransformStream:Q}}),g=r((N,T)=>{var k=d(),{AbortError:p,codes:S}=s(),{ERR_INVALID_ARG_TYPE:I,ERR_STREAM_PREMATURE_CLOSE:M}=S,{kEmptyObject:U,once:B}=u(),{validateAbortSignal:H,validateFunction:$,validateObject:ae,validateBoolean:ie}=c(),{Promise:ne,PromisePrototypeThen:Ne,SymbolDispose:ve}=n(),{isClosed:he,isReadable:Se,isReadableNodeStream:Q,isReadableStream:se,isReadableFinished:J,isReadableErrored:te,isWritable:de,isWritableNodeStream:be,isWritableStream:Ae,isWritableFinished:oe,isWritableErrored:Y,isNodeStream:ee,willEmitClose:X,kIsClosedPromise:W}=f(),q;function re(xe){return xe.setHeader&&typeof xe.abort=="function"}a(re,"H");var Oe=a(()=>{},"f");function Ee(xe,Ge,ge){var _e,Re;if(arguments.length===2?(ge=Ge,Ge=U):Ge==null?Ge=U:ae(Ge,"options"),$(ge,"callback"),H(Ge.signal,"options.signal"),ge=B(ge),se(xe)||Ae(xe))return Be(xe,Ge,ge);if(!ee(xe))throw new I("stream",["ReadableStream","WritableStream","Stream"],xe);let ze=(_e=Ge.readable)!==null&&_e!==void 0?_e:Q(xe),Pe=(Re=Ge.writable)!==null&&Re!==void 0?Re:be(xe),We=xe._writableState,xt=xe._readableState,Ve=a(()=>{xe.writable||Me()},"e"),Te=X(xe)&&Q(xe)===ze&&be(xe)===Pe,Ye=oe(xe,!1),Me=a(()=>{Ye=!0,xe.destroyed&&(Te=!1),!(Te&&(!xe.readable||ze))&&(!ze||$e)&&ge.call(xe)},"s"),$e=J(xe,!1),mt=a(()=>{$e=!0,xe.destroyed&&(Te=!1),!(Te&&(!xe.writable||Pe))&&(!Pe||Ye)&&ge.call(xe)},"n$"),ue=a(ce=>{ge.call(xe,ce)},"m"),me=he(xe),He=a(()=>{me=!0;let ce=Y(xe)||te(xe);if(ce&&typeof ce!="boolean")return ge.call(xe,ce);if(ze&&!$e&&Q(xe,!0)&&!J(xe,!1))return ge.call(xe,new M);if(Pe&&!Ye&&!oe(xe,!1))return ge.call(xe,new M);ge.call(xe)},"W$"),Ie=a(()=>{me=!0;let ce=Y(xe)||te(xe);if(ce&&typeof ce!="boolean")return ge.call(xe,ce);ge.call(xe)},"q$"),je=a(()=>{xe.req.on("finish",Me)},"_$");re(xe)?(xe.on("complete",Me),!Te&&xe.on("abort",He),xe.req?je():xe.on("request",je)):Pe&&!We&&(xe.on("end",Ve),xe.on("close",Ve)),!Te&&typeof xe.aborted=="boolean"&&xe.on("aborted",He),xe.on("end",mt),xe.on("finish",Me),Ge.error!==!1&&xe.on("error",ue),xe.on("close",He),me?k.nextTick(He):We!=null&&We.errorEmitted||xt!=null&&xt.errorEmitted?Te||k.nextTick(Ie):(!ze&&(!Te||Se(xe))&&(Ye||de(xe)===!1)||!Pe&&(!Te||de(xe))&&($e||Se(xe)===!1)||xt&&xe.req&&xe.aborted)&&k.nextTick(Ie);let rt=a(()=>{ge=Oe,xe.removeListener("aborted",He),xe.removeListener("complete",Me),xe.removeListener("abort",He),xe.removeListener("request",je),xe.req&&xe.req.removeListener("finish",Me),xe.removeListener("end",Ve),xe.removeListener("close",Ve),xe.removeListener("finish",Me),xe.removeListener("end",mt),xe.removeListener("error",ue),xe.removeListener("close",He)},"v$");if(Ge.signal&&!me){let ce=a(()=>{let Ce=ge;rt(),Ce.call(xe,new p(void 0,{cause:Ge.signal.reason}))},"d");if(Ge.signal.aborted)k.nextTick(ce);else{q=q||u().addAbortListener;let Ce=q(Ge.signal,ce),et=ge;ge=B((...ke)=>{Ce[ve](),et.apply(xe,ke)})}}return rt}a(Ee,"V");function Be(xe,Ge,ge){let _e=!1,Re=Oe;if(Ge.signal)if(Re=a(()=>{_e=!0,ge.call(xe,new p(void 0,{cause:Ge.signal.reason}))},"g"),Ge.signal.aborted)k.nextTick(Re);else{q=q||u().addAbortListener;let Pe=q(Ge.signal,Re),We=ge;ge=B((...xt)=>{Pe[ve](),We.apply(xe,xt)})}let ze=a((...Pe)=>{_e||k.nextTick(()=>ge.apply(xe,Pe))},"x");return Ne(xe[W].promise,ze,ze),Oe}a(Be,"S");function pt(xe,Ge){var ge;let _e=!1;return Ge===null&&(Ge=U),(ge=Ge)!==null&&ge!==void 0&&ge.cleanup&&(ie(Ge.cleanup,"cleanup"),_e=Ge.cleanup),new ne((Re,ze)=>{let Pe=Ee(xe,Ge,We=>{_e&&Pe(),We?ze(We):Re()})})}a(pt,"A"),T.exports=Ee,T.exports.finished=pt}),m=r((N,T)=>{var k=d(),{aggregateTwoErrors:p,codes:{ERR_MULTIPLE_CALLBACK:S},AbortError:I}=s(),{Symbol:M}=n(),{kIsDestroyed:U,isDestroyed:B,isFinished:H,isServerRequest:$}=f(),ae=M("kDestroy"),ie=M("kConstruct");function ne(X,W,q){X&&(X.stack,W&&!W.errored&&(W.errored=X),q&&!q.errored&&(q.errored=X))}a(ne,"M");function Ne(X,W){let q=this._readableState,re=this._writableState,Oe=re||q;return re!=null&&re.destroyed||q!=null&&q.destroyed?(typeof W=="function"&&W(),this):(ne(X,re,q),re&&(re.destroyed=!0),q&&(q.destroyed=!0),Oe.constructed?ve(this,X,W):this.once(ae,function(Ee){ve(this,p(Ee,X),W)}),this)}a(Ne,"N");function ve(X,W,q){let re=!1;function Oe(Ee){if(re)return;re=!0;let{_readableState:Be,_writableState:pt}=X;ne(Ee,pt,Be),pt&&(pt.closed=!0),Be&&(Be.closed=!0),typeof q=="function"&&q(Ee),Ee?k.nextTick(he,X,Ee):k.nextTick(Se,X)}a(Oe,"f");try{X._destroy(W||null,Oe)}catch(Ee){Oe(Ee)}}a(ve,"R");function he(X,W){Q(X,W),Se(X)}a(he,"E");function Se(X){let{_readableState:W,_writableState:q}=X;q&&(q.closeEmitted=!0),W&&(W.closeEmitted=!0),(q!=null&&q.emitClose||W!=null&&W.emitClose)&&X.emit("close")}a(Se,"D");function Q(X,W){let{_readableState:q,_writableState:re}=X;re!=null&&re.errorEmitted||q!=null&&q.errorEmitted||(re&&(re.errorEmitted=!0),q&&(q.errorEmitted=!0),X.emit("error",W))}a(Q,"h");function se(){let X=this._readableState,W=this._writableState;X&&(X.constructed=!0,X.closed=!1,X.closeEmitted=!1,X.destroyed=!1,X.errored=null,X.errorEmitted=!1,X.reading=!1,X.ended=X.readable===!1,X.endEmitted=X.readable===!1),W&&(W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1)}a(se,"L");function J(X,W,q){let{_readableState:re,_writableState:Oe}=X;if(Oe!=null&&Oe.destroyed||re!=null&&re.destroyed)return this;re!=null&&re.autoDestroy||Oe!=null&&Oe.autoDestroy?X.destroy(W):W&&(W.stack,Oe&&!Oe.errored&&(Oe.errored=W),re&&!re.errored&&(re.errored=W),q?k.nextTick(Q,X,W):Q(X,W))}a(J,"b");function te(X,W){if(typeof X._construct!="function")return;let{_readableState:q,_writableState:re}=X;q&&(q.constructed=!1),re&&(re.constructed=!1),X.once(ie,W),!(X.listenerCount(ie)>1)&&k.nextTick(de,X)}a(te,"y");function de(X){let W=!1;function q(re){if(W){J(X,re??new S);return}W=!0;let{_readableState:Oe,_writableState:Ee}=X,Be=Ee||Oe;Oe&&(Oe.constructed=!0),Ee&&(Ee.constructed=!0),Be.destroyed?X.emit(ae,re):re?J(X,re,!0):k.nextTick(be,X)}a(q,"X");try{X._construct(re=>{k.nextTick(q,re)})}catch(re){k.nextTick(q,re)}}a(de,"p");function be(X){X.emit(ie)}a(be,"i");function Ae(X){return X?.setHeader&&typeof X.abort=="function"}a(Ae,"$$");function oe(X){X.emit("close")}a(oe,"Q");function Y(X,W){X.emit("error",W),k.nextTick(oe,X)}a(Y,"c");function ee(X,W){!X||B(X)||(!W&&!H(X)&&(W=new I),$(X)?(X.socket=null,X.destroy(W)):Ae(X)?X.abort():Ae(X.req)?X.req.abort():typeof X.destroy=="function"?X.destroy(W):typeof X.close=="function"?X.close():W?k.nextTick(Y,X,W):k.nextTick(oe,X),X.destroyed||(X[U]=!0))}a(ee,"a"),T.exports={construct:te,destroyer:ee,destroy:Ne,undestroy:se,errorOrDestroy:J}}),w=r((N,T)=>{var{ArrayIsArray:k,ObjectSetPrototypeOf:p}=n(),{EventEmitter:S}=(Wd(),qt(Lu));function I(U){S.call(this,U)}a(I,"O"),p(I.prototype,S.prototype),p(I,S),I.prototype.pipe=function(U,B){let H=this;function $(Se){U.writable&&U.write(Se)===!1&&H.pause&&H.pause()}a($,"Z"),H.on("data",$);function ae(){H.readable&&H.resume&&H.resume()}a(ae,"w"),U.on("drain",ae),!U._isStdio&&(!B||B.end!==!1)&&(H.on("end",ne),H.on("close",Ne));let ie=!1;function ne(){ie||(ie=!0,U.end())}a(ne,"M");function Ne(){ie||(ie=!0,typeof U.destroy=="function"&&U.destroy())}a(Ne,"N");function ve(Se){he(),S.listenerCount(this,"error")===0&&this.emit("error",Se)}a(ve,"R"),M(H,"error",ve),M(U,"error",ve);function he(){H.removeListener("data",$),U.removeListener("drain",ae),H.removeListener("end",ne),H.removeListener("close",Ne),H.removeListener("error",ve),U.removeListener("error",ve),H.removeListener("end",he),H.removeListener("close",he),U.removeListener("close",he)}return a(he,"E"),H.on("end",he),H.on("close",he),U.on("close",he),U.emit("pipe",H),U};function M(U,B,H){if(typeof U.prependListener=="function")return U.prependListener(B,H);!U._events||!U._events[B]?U.on(B,H):k(U._events[B])?U._events[B].unshift(H):U._events[B]=[H,U._events[B]]}a(M,"Y"),T.exports={Stream:I,prependListener:M}}),E=r((N,T)=>{var{SymbolDispose:k}=n(),{AbortError:p,codes:S}=s(),{isNodeStream:I,isWebStream:M,kControllerErrorFunction:U}=f(),B=g(),{ERR_INVALID_ARG_TYPE:H}=S,$,ae=a((ie,ne)=>{if(typeof ie!="object"||!("aborted"in ie))throw new H(ne,"AbortSignal",ie)},"w");T.exports.addAbortSignal=function(ie,ne){if(ae(ie,"signal"),!I(ne)&&!M(ne))throw new H("stream",["ReadableStream","WritableStream","Stream"],ne);return T.exports.addAbortSignalNoValidate(ie,ne)},T.exports.addAbortSignalNoValidate=function(ie,ne){if(typeof ie!="object"||!("aborted"in ie))return ne;let Ne=I(ne)?()=>{ne.destroy(new p(void 0,{cause:ie.reason}))}:()=>{ne[U](new p(void 0,{cause:ie.reason}))};if(ie.aborted)Ne();else{$=$||u().addAbortListener;let ve=$(ie,Ne);B(ne,ve[k])}return ne}}),A=r((N,T)=>{var{StringPrototypeSlice:k,SymbolIterator:p,TypedArrayPrototypeSet:S,Uint8Array:I}=n(),{Buffer:M}=(ln(),qt(qr)),{inspect:U}=u();T.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(B){let H={data:B,next:null};this.length>0?this.tail.next=H:this.head=H,this.tail=H,++this.length}unshift(B){let H={data:B,next:this.head};this.length===0&&(this.tail=H),this.head=H,++this.length}shift(){if(this.length===0)return;let B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}clear(){this.head=this.tail=null,this.length=0}join(B){if(this.length===0)return"";let H=this.head,$=""+H.data;for(;(H=H.next)!==null;)$+=B+H.data;return $}concat(B){if(this.length===0)return M.alloc(0);let H=M.allocUnsafe(B>>>0),$=this.head,ae=0;for(;$;)S(H,$.data,ae),ae+=$.data.length,$=$.next;return H}consume(B,H){let $=this.head.data;if(B<$.length){let ae=$.slice(0,B);return this.head.data=$.slice(B),ae}return B===$.length?this.shift():H?this._getString(B):this._getBuffer(B)}first(){return this.head.data}*[p](){for(let B=this.head;B;B=B.next)yield B.data}_getString(B){let H="",$=this.head,ae=0;do{let ie=$.data;if(B>ie.length)H+=ie,B-=ie.length;else{B===ie.length?(H+=ie,++ae,$.next?this.head=$.next:this.head=this.tail=null):(H+=k(ie,0,B),this.head=$,$.data=k(ie,B));break}++ae}while(($=$.next)!==null);return this.length-=ae,H}_getBuffer(B){let H=M.allocUnsafe(B),$=B,ae=this.head,ie=0;do{let ne=ae.data;if(B>ne.length)S(H,ne,$-B),B-=ne.length;else{B===ne.length?(S(H,ne,$-B),++ie,ae.next?this.head=ae.next:this.head=this.tail=null):(S(H,new I(ne.buffer,ne.byteOffset,B),$-B),this.head=ae,ae.data=ne.slice(B));break}++ie}while((ae=ae.next)!==null);return this.length-=ie,H}[Symbol.for("nodejs.util.inspect.custom")](B,H){return U(this,{...H,depth:0,customInspect:!1})}}}),C=r((N,T)=>{var{MathFloor:k,NumberIsInteger:p}=n(),{validateInteger:S}=c(),{ERR_INVALID_ARG_VALUE:I}=s().codes,M=16384,U=16;function B(ie,ne,Ne){return ie.highWaterMark!=null?ie.highWaterMark:ne?ie[Ne]:null}a(B,"W");function H(ie){return ie?U:M}a(H,"T");function $(ie,ne){S(ne,"value",0),ie?U=ne:M=ne}a($,"Z");function ae(ie,ne,Ne,ve){let he=B(ne,ve,Ne);if(he!=null){if(!p(he)||he<0){let Se=ve?`options.${Ne}`:"options.highWaterMark";throw new I(Se,he)}return k(he)}return H(ie.objectMode)}a(ae,"w"),T.exports={getHighWaterMark:ae,getDefaultHighWaterMark:H,setDefaultHighWaterMark:$}}),O=r((N,T)=>{var k=(ln(),qt(qr)),p=k.Buffer;function S(M,U){for(var B in M)U[B]=M[B]}a(S,"K"),p.from&&p.alloc&&p.allocUnsafe&&p.allocUnsafeSlow?T.exports=k:(S(k,N),N.Buffer=I);function I(M,U,B){return p(M,U,B)}a(I,"O"),I.prototype=Object.create(p.prototype),S(p,I),I.from=function(M,U,B){if(typeof M=="number")throw TypeError("Argument must not be a number");return p(M,U,B)},I.alloc=function(M,U,B){if(typeof M!="number")throw TypeError("Argument must be a number");var H=p(M);return U!==void 0?typeof B=="string"?H.fill(U,B):H.fill(U):H.fill(0),H},I.allocUnsafe=function(M){if(typeof M!="number")throw TypeError("Argument must be a number");return p(M)},I.allocUnsafeSlow=function(M){if(typeof M!="number")throw TypeError("Argument must be a number");return k.SlowBuffer(M)}}),R=r(N=>{var T=O().Buffer,k=T.isEncoding||function(Q){switch(Q=""+Q,Q&&Q.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function p(Q){if(!Q)return"utf8";for(var se;;)switch(Q){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return Q;default:if(se)return;Q=(""+Q).toLowerCase(),se=!0}}a(p,"P");function S(Q){var se=p(Q);if(typeof se!="string"&&(T.isEncoding===k||!k(Q)))throw Error("Unknown encoding: "+Q);return se||Q}a(S,"K"),N.StringDecoder=I;function I(Q){this.encoding=S(Q);var se;switch(this.encoding){case"utf16le":this.text=ie,this.end=ne,se=4;break;case"utf8":this.fillLast=H,se=4;break;case"base64":this.text=Ne,this.end=ve,se=3;break;default:this.write=he,this.end=Se;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=T.allocUnsafe(se)}a(I,"O"),I.prototype.write=function(Q){if(Q.length===0)return"";var se,J;if(this.lastNeed){if(se=this.fillLast(Q),se===void 0)return"";J=this.lastNeed,this.lastNeed=0}else J=0;return J<Q.length?se?se+this.text(Q,J):this.text(Q,J):se||""},I.prototype.end=ae,I.prototype.text=$,I.prototype.fillLast=function(Q){if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,this.lastTotal-this.lastNeed,0,Q.length),this.lastNeed-=Q.length};function M(Q){return Q<=127?0:Q>>5===6?2:Q>>4===14?3:Q>>3===30?4:Q>>6===2?-1:-2}a(M,"Y");function U(Q,se,J){var te=se.length-1;if(te<J)return 0;var de=M(se[te]);return de>=0?(de>0&&(Q.lastNeed=de-1),de):--te<J||de===-2?0:(de=M(se[te]),de>=0?(de>0&&(Q.lastNeed=de-2),de):--te<J||de===-2?0:(de=M(se[te]),de>=0?(de>0&&(de===2?de=0:Q.lastNeed=de-3),de):0))}a(U,"v");function B(Q,se,J){if((se[0]&192)!==128)return Q.lastNeed=0,"�";if(Q.lastNeed>1&&se.length>1){if((se[1]&192)!==128)return Q.lastNeed=1,"�";if(Q.lastNeed>2&&se.length>2&&(se[2]&192)!==128)return Q.lastNeed=2,"�"}}a(B,"W");function H(Q){var se=this.lastTotal-this.lastNeed,J=B(this,Q);if(J!==void 0)return J;if(this.lastNeed<=Q.length)return Q.copy(this.lastChar,se,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);Q.copy(this.lastChar,se,0,Q.length),this.lastNeed-=Q.length}a(H,"T");function $(Q,se){var J=U(this,Q,se);if(!this.lastNeed)return Q.toString("utf8",se);this.lastTotal=J;var te=Q.length-(J-this.lastNeed);return Q.copy(this.lastChar,0,te),Q.toString("utf8",se,te)}a($,"Z");function ae(Q){var se=Q&&Q.length?this.write(Q):"";return this.lastNeed?se+"�":se}a(ae,"w");function ie(Q,se){if((Q.length-se)%2===0){var J=Q.toString("utf16le",se);if(J){var te=J.charCodeAt(J.length-1);if(te>=55296&&te<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1],J.slice(0,-1)}return J}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=Q[Q.length-1],Q.toString("utf16le",se,Q.length-1)}a(ie,"k");function ne(Q){var se=Q&&Q.length?this.write(Q):"";if(this.lastNeed){var J=this.lastTotal-this.lastNeed;return se+this.lastChar.toString("utf16le",0,J)}return se}a(ne,"M");function Ne(Q,se){var J=(Q.length-se)%3;return J===0?Q.toString("base64",se):(this.lastNeed=3-J,this.lastTotal=3,J===1?this.lastChar[0]=Q[Q.length-1]:(this.lastChar[0]=Q[Q.length-2],this.lastChar[1]=Q[Q.length-1]),Q.toString("base64",se,Q.length-J))}a(Ne,"N");function ve(Q){var se=Q&&Q.length?this.write(Q):"";return this.lastNeed?se+this.lastChar.toString("base64",0,3-this.lastNeed):se}a(ve,"R");function he(Q){return Q.toString(this.encoding)}a(he,"E");function Se(Q){return Q&&Q.length?this.write(Q):""}a(Se,"D")}),P=r((N,T)=>{var k=d(),{PromisePrototypeThen:p,SymbolAsyncIterator:S,SymbolIterator:I}=n(),{Buffer:M}=(ln(),qt(qr)),{ERR_INVALID_ARG_TYPE:U,ERR_STREAM_NULL_VALUES:B}=s().codes;function H($,ae,ie){let ne;if(typeof ae=="string"||ae instanceof M)return new $({objectMode:!0,...ie,read(){this.push(ae),this.push(null)}});let Ne;if(ae&&ae[S])Ne=!0,ne=ae[S]();else if(ae&&ae[I])Ne=!1,ne=ae[I]();else throw new U("iterable",["Iterable"],ae);let ve=new $({objectMode:!0,highWaterMark:1,...ie}),he=!1;ve._read=function(){he||(he=!0,Q())},ve._destroy=function(se,J){p(Se(se),()=>k.nextTick(J,se),te=>k.nextTick(J,te||se))};async function Se(se){let J=se!=null,te=typeof ne.throw=="function";if(J&&te){let{value:de,done:be}=await ne.throw(se);if(await de,be)return}if(typeof ne.return=="function"){let{value:de}=await ne.return();await de}}a(Se,"D");async function Q(){for(;;){try{let{value:se,done:J}=Ne?await ne.next():ne.next();if(J)ve.push(null);else{let te=se&&typeof se.then=="function"?await se:se;if(te===null)throw he=!1,new B;if(ve.push(te))continue;he=!1}}catch(se){ve.destroy(se)}break}}return a(Q,"h"),ve}a(H,"T"),T.exports=H}),L=r((N,T)=>{var k=d(),{ArrayPrototypeIndexOf:p,NumberIsInteger:S,NumberIsNaN:I,NumberParseInt:M,ObjectDefineProperties:U,ObjectKeys:B,ObjectSetPrototypeOf:H,Promise:$,SafeSet:ae,SymbolAsyncDispose:ie,SymbolAsyncIterator:ne,Symbol:Ne}=n();T.exports=ke,ke.ReadableState=et;var{EventEmitter:ve}=(Wd(),qt(Lu)),{Stream:he,prependListener:Se}=w(),{Buffer:Q}=(ln(),qt(qr)),{addAbortSignal:se}=E(),J=g(),te=u().debuglog("stream",fe=>{te=fe}),de=A(),be=m(),{getHighWaterMark:Ae,getDefaultHighWaterMark:oe}=C(),{aggregateTwoErrors:Y,codes:{ERR_INVALID_ARG_TYPE:ee,ERR_METHOD_NOT_IMPLEMENTED:X,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:re},AbortError:Oe}=s(),{validateObject:Ee}=c(),Be=Ne("kPaused"),{StringDecoder:pt}=R(),xe=P();H(ke.prototype,he.prototype),H(ke,he);var Ge=a(()=>{},"G"),{errorOrDestroy:ge}=be,_e=1,Re=2,ze=4,Pe=8,We=16,xt=32,Ve=64,Te=128,Ye=256,Me=512,$e=1024,mt=2048,ue=4096,me=8192,He=16384,Ie=32768,je=65536,rt=131072,ce=262144;function Ce(fe){return{enumerable:!1,get(){return(this.state&fe)!==0},set(ye){ye?this.state|=fe:this.state&=~fe}}}a(Ce,"B"),U(et.prototype,{objectMode:Ce(_e),ended:Ce(Re),endEmitted:Ce(ze),reading:Ce(Pe),constructed:Ce(We),sync:Ce(xt),needReadable:Ce(Ve),emittedReadable:Ce(Te),readableListening:Ce(Ye),resumeScheduled:Ce(Me),errorEmitted:Ce($e),emitClose:Ce(mt),autoDestroy:Ce(ue),destroyed:Ce(me),closed:Ce(He),closeEmitted:Ce(Ie),multiAwaitDrain:Ce(je),readingMore:Ce(rt),dataEmitted:Ce(ce)});function et(fe,ye,ht){typeof ht!="boolean"&&(ht=ye instanceof Z()),this.state=mt|ue|We|xt,fe&&fe.objectMode&&(this.state|=_e),ht&&fe&&fe.readableObjectMode&&(this.state|=_e),this.highWaterMark=fe?Ae(this,fe,"readableHighWaterMark",ht):oe(!1),this.buffer=new de,this.length=0,this.pipes=[],this.flowing=null,this[Be]=null,fe&&fe.emitClose===!1&&(this.state&=~mt),fe&&fe.autoDestroy===!1&&(this.state&=~ue),this.errored=null,this.defaultEncoding=fe&&fe.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,fe&&fe.encoding&&(this.decoder=new pt(fe.encoding),this.encoding=fe.encoding)}a(et,"H$");function ke(fe){if(!(this instanceof ke))return new ke(fe);let ye=this instanceof Z();this._readableState=new et(fe,this,ye),fe&&(typeof fe.read=="function"&&(this._read=fe.read),typeof fe.destroy=="function"&&(this._destroy=fe.destroy),typeof fe.construct=="function"&&(this._construct=fe.construct),fe.signal&&!ye&&se(fe.signal,this)),he.call(this,fe),be.construct(this,()=>{this._readableState.needReadable&&Ot(this,this._readableState)})}a(ke,"t"),ke.prototype.destroy=be.destroy,ke.prototype._undestroy=be.undestroy,ke.prototype._destroy=function(fe,ye){ye(fe)},ke.prototype[ve.captureRejectionSymbol]=function(fe){this.destroy(fe)},ke.prototype[ie]=function(){let fe;return this.destroyed||(fe=this.readableEnded?null:new Oe,this.destroy(fe)),new $((ye,ht)=>J(this,wt=>wt&&wt!==fe?ht(wt):ye(null)))},ke.prototype.push=function(fe,ye){return tt(this,fe,ye,!1)},ke.prototype.unshift=function(fe,ye){return tt(this,fe,ye,!0)};function tt(fe,ye,ht,wt){te("readableAddChunk",ye);let At=fe._readableState,dn;if((At.state&_e)===0&&(typeof ye=="string"?(ht=ht||At.defaultEncoding,At.encoding!==ht&&(wt&&At.encoding?ye=Q.from(ye,ht).toString(At.encoding):(ye=Q.from(ye,ht),ht=""))):ye instanceof Q?ht="":he._isUint8Array(ye)?(ye=he._uint8ArrayToBuffer(ye),ht=""):ye!=null&&(dn=new ee("chunk",["string","Buffer","Uint8Array"],ye))),dn)ge(fe,dn);else if(ye===null)At.state&=~Pe,Je(fe,At);else if((At.state&_e)!==0||ye&&ye.length>0)if(wt)if((At.state&ze)!==0)ge(fe,new re);else{if(At.destroyed||At.errored)return!1;Tt(fe,At,ye,!0)}else if(At.ended)ge(fe,new q);else{if(At.destroyed||At.errored)return!1;At.state&=~Pe,At.decoder&&!ht?(ye=At.decoder.write(ye),At.objectMode||ye.length!==0?Tt(fe,At,ye,!1):Ot(fe,At)):Tt(fe,At,ye,!1)}else wt||(At.state&=~Pe,Ot(fe,At));return!At.ended&&(At.length<At.highWaterMark||At.length===0)}a(tt,"F");function Tt(fe,ye,ht,wt){ye.flowing&&ye.length===0&&!ye.sync&&fe.listenerCount("data")>0?((ye.state&je)!==0?ye.awaitDrainWriters.clear():ye.awaitDrainWriters=null,ye.dataEmitted=!0,fe.emit("data",ht)):(ye.length+=ye.objectMode?1:ht.length,wt?ye.buffer.unshift(ht):ye.buffer.push(ht),(ye.state&Ve)!==0&&Et(fe)),Ot(fe,ye)}a(Tt,"A$"),ke.prototype.isPaused=function(){let fe=this._readableState;return fe[Be]===!0||fe.flowing===!1},ke.prototype.setEncoding=function(fe){let ye=new pt(fe);this._readableState.decoder=ye,this._readableState.encoding=this._readableState.decoder.encoding;let ht=this._readableState.buffer,wt="";for(let At of ht)wt+=ye.write(At);return ht.clear(),wt!==""&&ht.push(wt),this._readableState.length=wt.length,this};var Ke=1073741824;function st(fe){if(fe>Ke)throw new W("size","<= 1GiB",fe);return fe--,fe|=fe>>>1,fe|=fe>>>2,fe|=fe>>>4,fe|=fe>>>8,fe|=fe>>>16,fe++,fe}a(st,"z$");function Ze(fe,ye){return fe<=0||ye.length===0&&ye.ended?0:(ye.state&_e)!==0?1:I(fe)?ye.flowing&&ye.length?ye.buffer.first().length:ye.length:fe<=ye.length?fe:ye.ended?ye.length:0}a(Ze,"G6"),ke.prototype.read=function(fe){te("read",fe),fe===void 0?fe=NaN:S(fe)||(fe=M(fe,10));let ye=this._readableState,ht=fe;if(fe>ye.highWaterMark&&(ye.highWaterMark=st(fe)),fe!==0&&(ye.state&=~Te),fe===0&&ye.needReadable&&((ye.highWaterMark!==0?ye.length>=ye.highWaterMark:ye.length>0)||ye.ended))return te("read: emitReadable",ye.length,ye.ended),ye.length===0&&ye.ended?kr(this):Et(this),null;if(fe=Ze(fe,ye),fe===0&&ye.ended)return ye.length===0&&kr(this),null;let wt=(ye.state&Ve)!==0;if(te("need readable",wt),(ye.length===0||ye.length-fe<ye.highWaterMark)&&(wt=!0,te("length less than watermark",wt)),ye.ended||ye.reading||ye.destroyed||ye.errored||!ye.constructed)wt=!1,te("reading, ended or constructing",wt);else if(wt){te("do read"),ye.state|=Pe|xt,ye.length===0&&(ye.state|=Ve);try{this._read(ye.highWaterMark)}catch(dn){ge(this,dn)}ye.state&=~xt,!ye.reading&&(fe=Ze(ht,ye))}let At;return fe>0?At=mr(fe,ye):At=null,At===null?(ye.needReadable=ye.length<=ye.highWaterMark,fe=0):(ye.length-=fe,ye.multiAwaitDrain?ye.awaitDrainWriters.clear():ye.awaitDrainWriters=null),ye.length===0&&(ye.ended||(ye.needReadable=!0),ht!==fe&&ye.ended&&kr(this)),At!==null&&!ye.errorEmitted&&!ye.closeEmitted&&(ye.dataEmitted=!0,this.emit("data",At)),At};function Je(fe,ye){if(te("onEofChunk"),!ye.ended){if(ye.decoder){let ht=ye.decoder.end();ht&&ht.length&&(ye.buffer.push(ht),ye.length+=ye.objectMode?1:ht.length)}ye.ended=!0,ye.sync?Et(fe):(ye.needReadable=!1,ye.emittedReadable=!0,Ft(fe))}}a(Je,"X$");function Et(fe){let ye=fe._readableState;te("emitReadable",ye.needReadable,ye.emittedReadable),ye.needReadable=!1,!ye.emittedReadable&&(te("emitReadable",ye.flowing),ye.emittedReadable=!0,k.nextTick(Ft,fe))}a(Et,"k$");function Ft(fe){let ye=fe._readableState;te("emitReadable_",ye.destroyed,ye.length,ye.ended),!ye.destroyed&&!ye.errored&&(ye.length||ye.ended)&&(fe.emit("readable"),ye.emittedReadable=!1),ye.needReadable=!ye.flowing&&!ye.ended&&ye.length<=ye.highWaterMark,pr(fe)}a(Ft,"B6");function Ot(fe,ye){!ye.readingMore&&ye.constructed&&(ye.readingMore=!0,k.nextTick(nr,fe,ye))}a(Ot,"M$");function nr(fe,ye){for(;!ye.reading&&!ye.ended&&(ye.length<ye.highWaterMark||ye.flowing&&ye.length===0);){let ht=ye.length;if(te("maybeReadMore read 0"),fe.read(0),ht===ye.length)break}ye.readingMore=!1}a(nr,"S$"),ke.prototype._read=function(fe){throw new X("_read()")},ke.prototype.pipe=function(fe,ye){let ht=this,wt=this._readableState;wt.pipes.length===1&&(wt.multiAwaitDrain||(wt.multiAwaitDrain=!0,wt.awaitDrainWriters=new ae(wt.awaitDrainWriters?[wt.awaitDrainWriters]:[]))),wt.pipes.push(fe),te("pipe count=%d opts=%j",wt.pipes.length,ye);let At=(!ye||ye.end!==!1)&&fe!==k.stdout&&fe!==k.stderr?oi:Ql;wt.endEmitted?k.nextTick(At):ht.once("end",At),fe.on("unpipe",dn);function dn(Ps,Ea){te("onunpipe"),Ps===ht&&Ea&&Ea.hasUnpiped===!1&&(Ea.hasUnpiped=!0,hB())}a(dn,"G$");function oi(){te("onend"),fe.end()}a(oi,"V$");let Rs,e1=!1;function hB(){te("cleanup"),fe.removeListener("close",g0),fe.removeListener("finish",b0),Rs&&fe.removeListener("drain",Rs),fe.removeListener("error",m0),fe.removeListener("unpipe",dn),ht.removeListener("end",oi),ht.removeListener("end",Ql),ht.removeListener("data",r1),e1=!0,Rs&&wt.awaitDrainWriters&&(!fe._writableState||fe._writableState.needDrain)&&Rs()}a(hB,"p$");function t1(){e1||(wt.pipes.length===1&&wt.pipes[0]===fe?(te("false write response, pause",0),wt.awaitDrainWriters=fe,wt.multiAwaitDrain=!1):wt.pipes.length>1&&wt.pipes.includes(fe)&&(te("false write response, pause",wt.awaitDrainWriters.size),wt.awaitDrainWriters.add(fe)),ht.pause()),Rs||(Rs=wr(ht,fe),fe.on("drain",Rs))}a(t1,"kq"),ht.on("data",r1);function r1(Ps){te("ondata");let Ea=fe.write(Ps);te("dest.write",Ea),Ea===!1&&t1()}a(r1,"L$");function m0(Ps){if(te("onerror",Ps),Ql(),fe.removeListener("error",m0),fe.listenerCount("error")===0){let Ea=fe._writableState||fe._readableState;Ea&&!Ea.errorEmitted?ge(fe,Ps):fe.emit("error",Ps)}}a(m0,"C$"),Se(fe,"error",m0);function g0(){fe.removeListener("finish",b0),Ql()}a(g0,"l6"),fe.once("close",g0);function b0(){te("onfinish"),fe.removeListener("close",g0),Ql()}a(b0,"w6"),fe.once("finish",b0);function Ql(){te("unpipe"),ht.unpipe(fe)}return a(Ql,"z6"),fe.emit("pipe",ht),fe.writableNeedDrain===!0?t1():wt.flowing||(te("pipe resume"),ht.resume()),fe};function wr(fe,ye){return function(){let ht=fe._readableState;ht.awaitDrainWriters===ye?(te("pipeOnDrain",1),ht.awaitDrainWriters=null):ht.multiAwaitDrain&&(te("pipeOnDrain",ht.awaitDrainWriters.size),ht.awaitDrainWriters.delete(ye)),(!ht.awaitDrainWriters||ht.awaitDrainWriters.size===0)&&fe.listenerCount("data")&&fe.resume()}}a(wr,"Cq"),ke.prototype.unpipe=function(fe){let ye=this._readableState,ht={hasUnpiped:!1};if(ye.pipes.length===0)return this;if(!fe){let At=ye.pipes;ye.pipes=[],this.pause();for(let dn=0;dn<At.length;dn++)At[dn].emit("unpipe",this,{hasUnpiped:!1});return this}let wt=p(ye.pipes,fe);return wt===-1?this:(ye.pipes.splice(wt,1),ye.pipes.length===0&&this.pause(),fe.emit("unpipe",this,ht),this)},ke.prototype.on=function(fe,ye){let ht=he.prototype.on.call(this,fe,ye),wt=this._readableState;return fe==="data"?(wt.readableListening=this.listenerCount("readable")>0,wt.flowing!==!1&&this.resume()):fe==="readable"&&!wt.endEmitted&&!wt.readableListening&&(wt.readableListening=wt.needReadable=!0,wt.flowing=!1,wt.emittedReadable=!1,te("on readable",wt.length,wt.reading),wt.length?Et(this):wt.reading||k.nextTick(er,this)),ht},ke.prototype.addListener=ke.prototype.on,ke.prototype.removeListener=function(fe,ye){let ht=he.prototype.removeListener.call(this,fe,ye);return fe==="readable"&&k.nextTick(ir,this),ht},ke.prototype.off=ke.prototype.removeListener,ke.prototype.removeAllListeners=function(fe){let ye=he.prototype.removeAllListeners.apply(this,arguments);return(fe==="readable"||fe===void 0)&&k.nextTick(ir,this),ye};function ir(fe){let ye=fe._readableState;ye.readableListening=fe.listenerCount("readable")>0,ye.resumeScheduled&&ye[Be]===!1?ye.flowing=!0:fe.listenerCount("data")>0?fe.resume():ye.readableListening||(ye.flowing=null)}a(ir,"E$");function er(fe){te("readable nexttick read 0"),fe.read(0)}a(er,"g$"),ke.prototype.resume=function(){let fe=this._readableState;return fe.flowing||(te("resume"),fe.flowing=!fe.readableListening,Ar(this,fe)),fe[Be]=!1,this};function Ar(fe,ye){ye.resumeScheduled||(ye.resumeScheduled=!0,k.nextTick(Ir,fe,ye))}a(Ar,"Eq");function Ir(fe,ye){te("resume",ye.reading),!ye.reading&&fe.read(0),ye.resumeScheduled=!1,fe.emit("resume"),pr(fe),ye.flowing&&!ye.reading&&fe.read(0)}a(Ir,"b$"),ke.prototype.pause=function(){return te("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(te("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Be]=!0,this};function pr(fe){let ye=fe._readableState;for(te("flow",ye.flowing);ye.flowing&&fe.read()!==null;);}a(pr,"R$"),ke.prototype.wrap=function(fe){let ye=!1;fe.on("data",wt=>{!this.push(wt)&&fe.pause&&(ye=!0,fe.pause())}),fe.on("end",()=>{this.push(null)}),fe.on("error",wt=>{ge(this,wt)}),fe.on("close",()=>{this.destroy()}),fe.on("destroy",()=>{this.destroy()}),this._read=()=>{ye&&fe.resume&&(ye=!1,fe.resume())};let ht=B(fe);for(let wt=1;wt<ht.length;wt++){let At=ht[wt];this[At]===void 0&&typeof fe[At]=="function"&&(this[At]=fe[At].bind(fe))}return this},ke.prototype[ne]=function(){return Sr(this)},ke.prototype.iterator=function(fe){return fe!==void 0&&Ee(fe,"options"),Sr(this,fe)};function Sr(fe,ye){typeof fe.read!="function"&&(fe=ke.wrap(fe,{objectMode:!0}));let ht=or(fe,ye);return ht.stream=fe,ht}a(Sr,"Aq");async function*or(fe,ye){let ht=Ge;function wt(oi){this===fe?(ht(),ht=Ge):ht=oi}a(wt,"O$"),fe.on("readable",wt);let At,dn=J(fe,{writable:!1},oi=>{At=oi?Y(At,oi):null,ht(),ht=Ge});try{for(;;){let oi=fe.destroyed?null:fe.read();if(oi!==null)yield oi;else{if(At)throw At;if(At===null)return;await new $(wt)}}}catch(oi){throw At=Y(At,oi),At}finally{(At||ye?.destroyOnReturn!==!1)&&(At===void 0||fe._readableState.autoDestroy)?be.destroyer(fe,null):(fe.off("readable",wt),dn())}}a(or,"y$"),U(ke.prototype,{readable:{__proto__:null,get(){let fe=this._readableState;return!!fe&&fe.readable!==!1&&!fe.destroyed&&!fe.errorEmitted&&!fe.endEmitted},set(fe){this._readableState&&(this._readableState.readable=!!fe)}},readableDidRead:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:a(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(fe){this._readableState&&(this._readableState.flowing=fe)},"set")},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(fe){this._readableState&&(this._readableState.destroyed=fe)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),U(et.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Be]!==!1},set(fe){this[Be]=!!fe}}}),ke._fromList=mr;function mr(fe,ye){if(ye.length===0)return null;let ht;return ye.objectMode?ht=ye.buffer.shift():!fe||fe>=ye.length?(ye.decoder?ht=ye.buffer.join(""):ye.buffer.length===1?ht=ye.buffer.first():ht=ye.buffer.concat(ye.length),ye.buffer.clear()):ht=ye.buffer.consume(fe,ye.decoder),ht}a(mr,"I$");function kr(fe){let ye=fe._readableState;te("endReadable",ye.endEmitted),!ye.endEmitted&&(ye.ended=!0,k.nextTick(Cr,ye,fe))}a(kr,"Hq");function Cr(fe,ye){if(te("endReadableNT",fe.endEmitted,fe.length),!fe.errored&&!fe.closeEmitted&&!fe.endEmitted&&fe.length===0){if(fe.endEmitted=!0,ye.emit("end"),ye.writable&&ye.allowHalfOpen===!1)k.nextTick(Mr,ye);else if(fe.autoDestroy){let ht=ye._writableState;(!ht||ht.autoDestroy&&(ht.finished||ht.writable===!1))&&ye.destroy()}}}a(Cr,"u$");function Mr(fe){fe.writable&&!fe.writableEnded&&!fe.destroyed&&fe.end()}a(Mr,"x$"),ke.from=function(fe,ye){return xe(ke,fe,ye)};var Or;function zo(){return Or===void 0&&(Or={}),Or}a(zo,"h$"),ke.fromWeb=function(fe,ye){return zo().newStreamReadableFromReadableStream(fe,ye)},ke.toWeb=function(fe,ye){return zo().newReadableStreamFromStreamReadable(fe,ye)},ke.wrap=function(fe,ye){var ht,wt;return new ke({objectMode:(ht=(wt=fe.readableObjectMode)!==null&&wt!==void 0?wt:fe.objectMode)!==null&&ht!==void 0?ht:!0,...ye,destroy(At,dn){be.destroyer(fe,At),dn(At)}}).wrap(fe)}}),j=r((N,T)=>{var k=d(),{ArrayPrototypeSlice:p,Error:S,FunctionPrototypeSymbolHasInstance:I,ObjectDefineProperty:M,ObjectDefineProperties:U,ObjectSetPrototypeOf:B,StringPrototypeToLowerCase:H,Symbol:$,SymbolHasInstance:ae}=n();T.exports=Ee,Ee.WritableState=re;var{EventEmitter:ie}=(Wd(),qt(Lu)),ne=w().Stream,{Buffer:Ne}=(ln(),qt(qr)),ve=m(),{addAbortSignal:he}=E(),{getHighWaterMark:Se,getDefaultHighWaterMark:Q}=C(),{ERR_INVALID_ARG_TYPE:se,ERR_METHOD_NOT_IMPLEMENTED:J,ERR_MULTIPLE_CALLBACK:te,ERR_STREAM_CANNOT_PIPE:de,ERR_STREAM_DESTROYED:be,ERR_STREAM_ALREADY_FINISHED:Ae,ERR_STREAM_NULL_VALUES:oe,ERR_STREAM_WRITE_AFTER_END:Y,ERR_UNKNOWN_ENCODING:ee}=s().codes,{errorOrDestroy:X}=ve;B(Ee.prototype,ne.prototype),B(Ee,ne);function W(){}a(W,"J");var q=$("kOnFinished");function re(ue,me,He){typeof He!="boolean"&&(He=me instanceof Z()),this.objectMode=!!(ue&&ue.objectMode),He&&(this.objectMode=this.objectMode||!!(ue&&ue.writableObjectMode)),this.highWaterMark=ue?Se(this,ue,"writableHighWaterMark",He):Q(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let Ie=!!(ue&&ue.decodeStrings===!1);this.decodeStrings=!Ie,this.defaultEncoding=ue&&ue.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ge.bind(void 0,me),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Oe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ue||ue.emitClose!==!1,this.autoDestroy=!ue||ue.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}a(re,"H");function Oe(ue){ue.buffered=[],ue.bufferedIndex=0,ue.allBuffers=!0,ue.allNoop=!0}a(Oe,"f"),re.prototype.getBuffer=function(){return p(this.buffered,this.bufferedIndex)},M(re.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Ee(ue){let me=this instanceof Z();if(!me&&!I(Ee,this))return new Ee(ue);this._writableState=new re(ue,this,me),ue&&(typeof ue.write=="function"&&(this._write=ue.write),typeof ue.writev=="function"&&(this._writev=ue.writev),typeof ue.destroy=="function"&&(this._destroy=ue.destroy),typeof ue.final=="function"&&(this._final=ue.final),typeof ue.construct=="function"&&(this._construct=ue.construct),ue.signal&&he(ue.signal,this)),ne.call(this,ue),ve.construct(this,()=>{let He=this._writableState;He.writing||Pe(this,He),Te(this,He)})}a(Ee,"V"),M(Ee,ae,{__proto__:null,value:a(function(ue){return I(this,ue)?!0:this!==Ee?!1:ue&&ue._writableState instanceof re},"value")}),Ee.prototype.pipe=function(){X(this,new de)};function Be(ue,me,He,Ie){let je=ue._writableState;if(typeof He=="function")Ie=He,He=je.defaultEncoding;else{if(!He)He=je.defaultEncoding;else if(He!=="buffer"&&!Ne.isEncoding(He))throw new ee(He);typeof Ie!="function"&&(Ie=W)}if(me===null)throw new oe;if(!je.objectMode)if(typeof me=="string")je.decodeStrings!==!1&&(me=Ne.from(me,He),He="buffer");else if(me instanceof Ne)He="buffer";else if(ne._isUint8Array(me))me=ne._uint8ArrayToBuffer(me),He="buffer";else throw new se("chunk",["string","Buffer","Uint8Array"],me);let rt;return je.ending?rt=new Y:je.destroyed&&(rt=new be("write")),rt?(k.nextTick(Ie,rt),X(ue,rt,!0),rt):(je.pendingcb++,pt(ue,je,me,He,Ie))}a(Be,"S"),Ee.prototype.write=function(ue,me,He){return Be(this,ue,me,He)===!0},Ee.prototype.cork=function(){this._writableState.corked++},Ee.prototype.uncork=function(){let ue=this._writableState;ue.corked&&(ue.corked--,!ue.writing&&Pe(this,ue))},Ee.prototype.setDefaultEncoding=function(ue){if(typeof ue=="string"&&(ue=H(ue)),!Ne.isEncoding(ue))throw new ee(ue);return this._writableState.defaultEncoding=ue,this};function pt(ue,me,He,Ie,je){let rt=me.objectMode?1:He.length;me.length+=rt;let ce=me.length<me.highWaterMark;return ce||(me.needDrain=!0),me.writing||me.corked||me.errored||!me.constructed?(me.buffered.push({chunk:He,encoding:Ie,callback:je}),me.allBuffers&&Ie!=="buffer"&&(me.allBuffers=!1),me.allNoop&&je!==W&&(me.allNoop=!1)):(me.writelen=rt,me.writecb=je,me.writing=!0,me.sync=!0,ue._write(He,Ie,me.onwrite),me.sync=!1),ce&&!me.errored&&!me.destroyed}a(pt,"A");function xe(ue,me,He,Ie,je,rt,ce){me.writelen=Ie,me.writecb=ce,me.writing=!0,me.sync=!0,me.destroyed?me.onwrite(new be("write")):He?ue._writev(je,me.onwrite):ue._write(je,rt,me.onwrite),me.sync=!1}a(xe,"z");function Ge(ue,me,He,Ie){--me.pendingcb,Ie(He),ze(me),X(ue,He)}a(Ge,"G");function ge(ue,me){let He=ue._writableState,Ie=He.sync,je=He.writecb;if(typeof je!="function"){X(ue,new te);return}He.writing=!1,He.writecb=null,He.length-=He.writelen,He.writelen=0,me?(me.stack,!He.errored&&(He.errored=me),ue._readableState&&!ue._readableState.errored&&(ue._readableState.errored=me),Ie?k.nextTick(Ge,ue,He,me,je):Ge(ue,He,me,je)):(He.buffered.length>He.bufferedIndex&&Pe(ue,He),Ie?He.afterWriteTickInfo!==null&&He.afterWriteTickInfo.cb===je?He.afterWriteTickInfo.count++:(He.afterWriteTickInfo={count:1,cb:je,stream:ue,state:He},k.nextTick(_e,He.afterWriteTickInfo)):Re(ue,He,1,je))}a(ge,"I");function _e({stream:ue,state:me,count:He,cb:Ie}){return me.afterWriteTickInfo=null,Re(ue,me,He,Ie)}a(_e,"C");function Re(ue,me,He,Ie){for(!me.ending&&!ue.destroyed&&me.length===0&&me.needDrain&&(me.needDrain=!1,ue.emit("drain"));He-- >0;)me.pendingcb--,Ie();me.destroyed&&ze(me),Te(ue,me)}a(Re,"g");function ze(ue){if(ue.writing)return;for(let je=ue.bufferedIndex;je<ue.buffered.length;++je){var me;let{chunk:rt,callback:ce}=ue.buffered[je],Ce=ue.objectMode?1:rt.length;ue.length-=Ce,ce((me=ue.errored)!==null&&me!==void 0?me:new be("write"))}let He=ue[q].splice(0);for(let je=0;je<He.length;je++){var Ie;He[je]((Ie=ue.errored)!==null&&Ie!==void 0?Ie:new be("end"))}Oe(ue)}a(ze,"x");function Pe(ue,me){if(me.corked||me.bufferProcessing||me.destroyed||!me.constructed)return;let{buffered:He,bufferedIndex:Ie,objectMode:je}=me,rt=He.length-Ie;if(!rt)return;let ce=Ie;if(me.bufferProcessing=!0,rt>1&&ue._writev){me.pendingcb-=rt-1;let Ce=me.allNoop?W:ke=>{for(let tt=ce;tt<He.length;++tt)He[tt].callback(ke)},et=me.allNoop&&ce===0?He:p(He,ce);et.allBuffers=me.allBuffers,xe(ue,me,!0,me.length,et,"",Ce),Oe(me)}else{do{let{chunk:Ce,encoding:et,callback:ke}=He[ce];He[ce++]=null;let tt=je?1:Ce.length;xe(ue,me,!1,tt,Ce,et,ke)}while(ce<He.length&&!me.writing);ce===He.length?Oe(me):ce>256?(He.splice(0,ce),me.bufferedIndex=0):me.bufferedIndex=ce}me.bufferProcessing=!1}a(Pe,"l"),Ee.prototype._write=function(ue,me,He){if(this._writev)this._writev([{chunk:ue,encoding:me}],He);else throw new J("_write()")},Ee.prototype._writev=null,Ee.prototype.end=function(ue,me,He){let Ie=this._writableState;typeof ue=="function"?(He=ue,ue=null,me=null):typeof me=="function"&&(He=me,me=null);let je;if(ue!=null){let rt=Be(this,ue,me);rt instanceof S&&(je=rt)}return Ie.corked&&(Ie.corked=1,this.uncork()),je||(!Ie.errored&&!Ie.ending?(Ie.ending=!0,Te(this,Ie,!0),Ie.ended=!0):Ie.finished?je=new Ae("end"):Ie.destroyed&&(je=new be("end"))),typeof He=="function"&&(je||Ie.finished?k.nextTick(He,je):Ie[q].push(He)),this};function We(ue){return ue.ending&&!ue.destroyed&&ue.constructed&&ue.length===0&&!ue.errored&&ue.buffered.length===0&&!ue.finished&&!ue.writing&&!ue.errorEmitted&&!ue.closeEmitted}a(We,"o");function xt(ue,me){let He=!1;function Ie(je){if(He){X(ue,je??te());return}if(He=!0,me.pendingcb--,je){let rt=me[q].splice(0);for(let ce=0;ce<rt.length;ce++)rt[ce](je);X(ue,je,me.sync)}else We(me)&&(me.prefinished=!0,ue.emit("prefinish"),me.pendingcb++,k.nextTick(Ye,ue,me))}a(Ie,"q$"),me.sync=!0,me.pendingcb++;try{ue._final(Ie)}catch(je){Ie(je)}me.sync=!1}a(xt,"T$");function Ve(ue,me){!me.prefinished&&!me.finalCalled&&(typeof ue._final=="function"&&!me.destroyed?(me.finalCalled=!0,xt(ue,me)):(me.prefinished=!0,ue.emit("prefinish")))}a(Ve,"e");function Te(ue,me,He){We(me)&&(Ve(ue,me),me.pendingcb===0&&(He?(me.pendingcb++,k.nextTick((Ie,je)=>{We(je)?Ye(Ie,je):je.pendingcb--},ue,me)):We(me)&&(me.pendingcb++,Ye(ue,me))))}a(Te,"n");function Ye(ue,me){me.pendingcb--,me.finished=!0;let He=me[q].splice(0);for(let Ie=0;Ie<He.length;Ie++)He[Ie]();if(ue.emit("finish"),me.autoDestroy){let Ie=ue._readableState;(!Ie||Ie.autoDestroy&&(Ie.endEmitted||Ie.readable===!1))&&ue.destroy()}}a(Ye,"j$"),U(Ee.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ue){this._writableState&&(this._writableState.destroyed=ue)}},writable:{__proto__:null,get(){let ue=this._writableState;return!!ue&&ue.writable!==!1&&!ue.destroyed&&!ue.errored&&!ue.ending&&!ue.ended},set(ue){this._writableState&&(this._writableState.writable=!!ue)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let ue=this._writableState;return ue?!ue.destroyed&&!ue.ending&&ue.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:a(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var Me=ve.destroy;Ee.prototype.destroy=function(ue,me){let He=this._writableState;return!He.destroyed&&(He.bufferedIndex<He.buffered.length||He[q].length)&&k.nextTick(ze,He),Me.call(this,ue,me),this},Ee.prototype._undestroy=ve.undestroy,Ee.prototype._destroy=function(ue,me){me(ue)},Ee.prototype[ie.captureRejectionSymbol]=function(ue){this.destroy(ue)};var $e;function mt(){return $e===void 0&&($e={}),$e}a(mt,"n$"),Ee.fromWeb=function(ue,me){return mt().newStreamWritableFromWritableStream(ue,me)},Ee.toWeb=function(ue){return mt().newWritableStreamFromStreamWritable(ue)}}),G=r((N,T)=>{var k=d(),p=(ln(),qt(qr)),{isReadable:S,isWritable:I,isIterable:M,isNodeStream:U,isReadableNodeStream:B,isWritableNodeStream:H,isDuplexNodeStream:$,isReadableStream:ae,isWritableStream:ie}=f(),ne=g(),{AbortError:Ne,codes:{ERR_INVALID_ARG_TYPE:ve,ERR_INVALID_RETURN_VALUE:he}}=s(),{destroyer:Se}=m(),Q=Z(),se=L(),J=j(),{createDeferredPromise:te}=u(),de=P(),be=globalThis.Blob||p.Blob,Ae=typeof be<"u"?function(q){return q instanceof be}:function(q){return!1},oe=globalThis.AbortController||l().AbortController,{FunctionPrototypeCall:Y}=n();class ee extends Q{static{a(this,"a")}constructor(re){super(re),re?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),re?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}T.exports=a(function q(re,Oe){if($(re))return re;if(B(re))return W({readable:re});if(H(re))return W({writable:re});if(U(re))return W({writable:!1,readable:!1});if(ae(re))return W({readable:se.fromWeb(re)});if(ie(re))return W({writable:J.fromWeb(re)});if(typeof re=="function"){let{value:Be,write:pt,final:xe,destroy:Ge}=X(re);if(M(Be))return de(ee,Be,{objectMode:!0,write:pt,final:xe,destroy:Ge});let ge=Be?.then;if(typeof ge=="function"){let _e,Re=Y(ge,Be,ze=>{if(ze!=null)throw new he("nully","body",ze)},ze=>{Se(_e,ze)});return _e=new ee({objectMode:!0,readable:!1,write:pt,final(ze){xe(async()=>{try{await Re,k.nextTick(ze,null)}catch(Pe){k.nextTick(ze,Pe)}})},destroy:Ge})}throw new he("Iterable, AsyncIterable or AsyncFunction",Oe,Be)}if(Ae(re))return q(re.arrayBuffer());if(M(re))return de(ee,re,{objectMode:!0,writable:!1});if(ae(re?.readable)&&ie(re?.writable))return ee.fromWeb(re);if(typeof re?.writable=="object"||typeof re?.readable=="object"){let Be=re!=null&&re.readable?B(re?.readable)?re?.readable:q(re.readable):void 0,pt=re!=null&&re.writable?H(re?.writable)?re?.writable:q(re.writable):void 0;return W({readable:Be,writable:pt})}let Ee=re?.then;if(typeof Ee=="function"){let Be;return Y(Ee,re,pt=>{pt!=null&&Be.push(pt),Be.push(null)},pt=>{Se(Be,pt)}),Be=new ee({objectMode:!0,writable:!1,read(){}})}throw new ve(Oe,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],re)},"X");function X(q){let{promise:re,resolve:Oe}=te(),Ee=new oe,Be=Ee.signal;return{value:q((async function*(){for(;;){let pt=re;re=null;let{chunk:xe,done:Ge,cb:ge}=await pt;if(k.nextTick(ge),Ge)return;if(Be.aborted)throw new Ne(void 0,{cause:Be.reason});({promise:re,resolve:Oe}=te()),yield xe}})(),{signal:Be}),write(pt,xe,Ge){let ge=Oe;Oe=null,ge({chunk:pt,done:!1,cb:Ge})},final(pt){let xe=Oe;Oe=null,xe({done:!0,cb:pt})},destroy(pt,xe){Ee.abort(),xe(pt)}}}a(X,"j");function W(q){let re=q.readable&&typeof q.readable.read!="function"?se.wrap(q.readable):q.readable,Oe=q.writable,Ee=!!S(re),Be=!!I(Oe),pt,xe,Ge,ge,_e;function Re(ze){let Pe=ge;ge=null,Pe?Pe(ze):ze&&_e.destroy(ze)}return a(Re,"g"),_e=new ee({readableObjectMode:!!(re!=null&&re.readableObjectMode),writableObjectMode:!!(Oe!=null&&Oe.writableObjectMode),readable:Ee,writable:Be}),Be&&(ne(Oe,ze=>{Be=!1,ze&&Se(re,ze),Re(ze)}),_e._write=function(ze,Pe,We){Oe.write(ze,Pe)?We():pt=We},_e._final=function(ze){Oe.end(),xe=ze},Oe.on("drain",function(){if(pt){let ze=pt;pt=null,ze()}}),Oe.on("finish",function(){if(xe){let ze=xe;xe=null,ze()}})),Ee&&(ne(re,ze=>{Ee=!1,ze&&Se(re,ze),Re(ze)}),re.on("readable",function(){if(Ge){let ze=Ge;Ge=null,ze()}}),re.on("end",function(){_e.push(null)}),_e._read=function(){for(;;){let ze=re.read();if(ze===null){Ge=_e._read;return}if(!_e.push(ze))return}}),_e._destroy=function(ze,Pe){!ze&&ge!==null&&(ze=new Ne),Ge=null,pt=null,xe=null,ge===null?Pe(ze):(ge=Pe,Se(Oe,ze),Se(re,ze))},_e}a(W,"J")}),Z=r((N,T)=>{var{ObjectDefineProperties:k,ObjectGetOwnPropertyDescriptor:p,ObjectKeys:S,ObjectSetPrototypeOf:I}=n();T.exports=B;var M=L(),U=j();I(B.prototype,M.prototype),I(B,M);{let ie=S(U.prototype);for(let ne=0;ne<ie.length;ne++){let Ne=ie[ne];B.prototype[Ne]||(B.prototype[Ne]=U.prototype[Ne])}}function B(ie){if(!(this instanceof B))return new B(ie);M.call(this,ie),U.call(this,ie),ie?(this.allowHalfOpen=ie.allowHalfOpen!==!1,ie.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),ie.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}a(B,"W"),k(B.prototype,{writable:{__proto__:null,...p(U.prototype,"writable")},writableHighWaterMark:{__proto__:null,...p(U.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...p(U.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...p(U.prototype,"writableBuffer")},writableLength:{__proto__:null,...p(U.prototype,"writableLength")},writableFinished:{__proto__:null,...p(U.prototype,"writableFinished")},writableCorked:{__proto__:null,...p(U.prototype,"writableCorked")},writableEnded:{__proto__:null,...p(U.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...p(U.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(ie){this._readableState&&this._writableState&&(this._readableState.destroyed=ie,this._writableState.destroyed=ie)}}});var H;function $(){return H===void 0&&(H={}),H}a($,"Z"),B.fromWeb=function(ie,ne){return $().newStreamDuplexFromReadableWritablePair(ie,ne)},B.toWeb=function(ie){return $().newReadableWritablePairFromDuplex(ie)};var ae;B.from=function(ie){return ae||(ae=G()),ae(ie,"body")}}),K=r((N,T)=>{var{ObjectSetPrototypeOf:k,Symbol:p}=n();T.exports=B;var{ERR_METHOD_NOT_IMPLEMENTED:S}=s().codes,I=Z(),{getHighWaterMark:M}=C();k(B.prototype,I.prototype),k(B,I);var U=p("kCallback");function B(ae){if(!(this instanceof B))return new B(ae);let ie=ae?M(this,ae,"readableHighWaterMark",!0):null;ie===0&&(ae={...ae,highWaterMark:null,readableHighWaterMark:ie,writableHighWaterMark:ae.writableHighWaterMark||0}),I.call(this,ae),this._readableState.sync=!1,this[U]=null,ae&&(typeof ae.transform=="function"&&(this._transform=ae.transform),typeof ae.flush=="function"&&(this._flush=ae.flush)),this.on("prefinish",$)}a(B,"W");function H(ae){typeof this._flush=="function"&&!this.destroyed?this._flush((ie,ne)=>{if(ie){ae?ae(ie):this.destroy(ie);return}ne!=null&&this.push(ne),this.push(null),ae&&ae()}):(this.push(null),ae&&ae())}a(H,"T");function $(){this._final!==H&&H.call(this)}a($,"Z"),B.prototype._final=H,B.prototype._transform=function(ae,ie,ne){throw new S("_transform()")},B.prototype._write=function(ae,ie,ne){let Ne=this._readableState,ve=this._writableState,he=Ne.length;this._transform(ae,ie,(Se,Q)=>{if(Se){ne(Se);return}Q!=null&&this.push(Q),ve.ended||he===Ne.length||Ne.length<Ne.highWaterMark?ne():this[U]=ne})},B.prototype._read=function(){if(this[U]){let ae=this[U];this[U]=null,ae()}}}),z=r((N,T)=>{var{ObjectSetPrototypeOf:k}=n();T.exports=S;var p=K();k(S.prototype,p.prototype),k(S,p);function S(I){if(!(this instanceof S))return new S(I);p.call(this,I)}a(S,"K"),S.prototype._transform=function(I,M,U){U(null,I)}}),V=r((N,T)=>{var k=d(),{ArrayIsArray:p,Promise:S,SymbolAsyncIterator:I,SymbolDispose:M}=n(),U=g(),{once:B}=u(),H=m(),$=Z(),{aggregateTwoErrors:ae,codes:{ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_RETURN_VALUE:ne,ERR_MISSING_ARGS:Ne,ERR_STREAM_DESTROYED:ve,ERR_STREAM_PREMATURE_CLOSE:he},AbortError:Se}=s(),{validateFunction:Q,validateAbortSignal:se}=c(),{isIterable:J,isReadable:te,isReadableNodeStream:de,isNodeStream:be,isTransformStream:Ae,isWebStream:oe,isReadableStream:Y,isReadableFinished:ee}=f(),X=globalThis.AbortController||l().AbortController,W,q,re;function Oe(ze,Pe,We){let xt=!1;ze.on("close",()=>{xt=!0});let Ve=U(ze,{readable:Pe,writable:We},Te=>{xt=!Te});return{destroy:a(Te=>{xt||(xt=!0,H.destroyer(ze,Te||new ve("pipe")))},"destroy"),cleanup:Ve}}a(Oe,"f");function Ee(ze){return Q(ze[ze.length-1],"streams[stream.length - 1]"),ze.pop()}a(Ee,"V");function Be(ze){if(J(ze))return ze;if(de(ze))return pt(ze);throw new ie("val",["Readable","Iterable","AsyncIterable"],ze)}a(Be,"S");async function*pt(ze){q||(q=L()),yield*q.prototype[I].call(ze)}a(pt,"A");async function xe(ze,Pe,We,{end:xt}){let Ve,Te=null,Ye=a(mt=>{if(mt&&(Ve=mt),Te){let ue=Te;Te=null,ue()}},"j$"),Me=a(()=>new S((mt,ue)=>{Ve?ue(Ve):Te=a(()=>{Ve?ue(Ve):mt()},"n")}),"s");Pe.on("drain",Ye);let $e=U(Pe,{readable:!1},Ye);try{Pe.writableNeedDrain&&await Me();for await(let mt of ze)Pe.write(mt)||await Me();xt&&(Pe.end(),await Me()),We()}catch(mt){We(Ve!==mt?ae(Ve,mt):mt)}finally{$e(),Pe.off("drain",Ye)}}a(xe,"z");async function Ge(ze,Pe,We,{end:xt}){Ae(Pe)&&(Pe=Pe.writable);let Ve=Pe.getWriter();try{for await(let Te of ze)await Ve.ready,Ve.write(Te).catch(()=>{});await Ve.ready,xt&&await Ve.close(),We()}catch(Te){try{await Ve.abort(Te),We(Te)}catch(Ye){We(Ye)}}}a(Ge,"G");function ge(...ze){return _e(ze,B(Ee(ze)))}a(ge,"I");function _e(ze,Pe,We){if(ze.length===1&&p(ze[0])&&(ze=ze[0]),ze.length<2)throw new Ne("streams");let xt=new X,Ve=xt.signal,Te=We?.signal,Ye=[];se(Te,"options.signal");function Me(){je(new Se)}a(Me,"s"),re=re||u().addAbortListener;let $e;Te&&($e=re(Te,Me));let mt,ue,me=[],He=0;function Ie(et){je(et,--He===0)}a(Ie,"q$");function je(et,ke){var tt;if(et&&(!mt||mt.code==="ERR_STREAM_PREMATURE_CLOSE")&&(mt=et),!(!mt&&!ke)){for(;me.length;)me.shift()(mt);(tt=$e)===null||tt===void 0||tt[M](),xt.abort(),ke&&(mt||Ye.forEach(Tt=>Tt()),k.nextTick(Pe,mt,ue))}}a(je,"_$");let rt;for(let et=0;et<ze.length;et++){let ke=ze[et],tt=et<ze.length-1,Tt=et>0,Ke=tt||We?.end!==!1,st=et===ze.length-1;if(be(ke)){let Ze=a(function(Je){Je&&Je.name!=="AbortError"&&Je.code!=="ERR_STREAM_PREMATURE_CLOSE"&&Ie(Je)},"X$");if(Ke){let{destroy:Je,cleanup:Et}=Oe(ke,tt,Tt);me.push(Je),te(ke)&&st&&Ye.push(Et)}ke.on("error",Ze),te(ke)&&st&&Ye.push(()=>{ke.removeListener("error",Ze)})}if(et===0)if(typeof ke=="function"){if(rt=ke({signal:Ve}),!J(rt))throw new ne("Iterable, AsyncIterable or Stream","source",rt)}else J(ke)||de(ke)||Ae(ke)?rt=ke:rt=$.from(ke);else if(typeof ke=="function"){if(Ae(rt)){var ce;rt=Be((ce=rt)===null||ce===void 0?void 0:ce.readable)}else rt=Be(rt);if(rt=ke(rt,{signal:Ve}),tt){if(!J(rt,!0))throw new ne("AsyncIterable",`transform[${et-1}]`,rt)}else{var Ce;W||(W=z());let Ze=new W({objectMode:!0}),Je=(Ce=rt)===null||Ce===void 0?void 0:Ce.then;if(typeof Je=="function")He++,Je.call(rt,Ot=>{ue=Ot,Ot!=null&&Ze.write(Ot),Ke&&Ze.end(),k.nextTick(Ie)},Ot=>{Ze.destroy(Ot),k.nextTick(Ie,Ot)});else if(J(rt,!0))He++,xe(rt,Ze,Ie,{end:Ke});else if(Y(rt)||Ae(rt)){let Ot=rt.readable||rt;He++,xe(Ot,Ze,Ie,{end:Ke})}else throw new ne("AsyncIterable or Promise","destination",rt);rt=Ze;let{destroy:Et,cleanup:Ft}=Oe(rt,!1,!0);me.push(Et),st&&Ye.push(Ft)}}else if(be(ke)){if(de(rt)){He+=2;let Ze=Re(rt,ke,Ie,{end:Ke});te(ke)&&st&&Ye.push(Ze)}else if(Ae(rt)||Y(rt)){let Ze=rt.readable||rt;He++,xe(Ze,ke,Ie,{end:Ke})}else if(J(rt))He++,xe(rt,ke,Ie,{end:Ke});else throw new ie("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],rt);rt=ke}else if(oe(ke)){if(de(rt))He++,Ge(Be(rt),ke,Ie,{end:Ke});else if(Y(rt)||J(rt))He++,Ge(rt,ke,Ie,{end:Ke});else if(Ae(rt))He++,Ge(rt.readable,ke,Ie,{end:Ke});else throw new ie("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],rt);rt=ke}else rt=$.from(ke)}return(Ve!=null&&Ve.aborted||Te!=null&&Te.aborted)&&k.nextTick(Me),rt}a(_e,"C");function Re(ze,Pe,We,{end:xt}){let Ve=!1;if(Pe.on("close",()=>{Ve||We(new he)}),ze.pipe(Pe,{end:!1}),xt){let Te=a(function(){Ve=!0,Pe.end()},"j$");ee(ze)?k.nextTick(Te):ze.once("end",Te)}else We();return U(ze,{readable:!0,writable:!1},Te=>{let Ye=ze._readableState;Te&&Te.code==="ERR_STREAM_PREMATURE_CLOSE"&&Ye&&Ye.ended&&!Ye.errored&&!Ye.errorEmitted?ze.once("end",We).once("error",We):We(Te)}),U(Pe,{readable:!1,writable:!0},We)}a(Re,"g"),T.exports={pipelineImpl:_e,pipeline:ge}}),h=r((N,T)=>{var{pipeline:k}=V(),p=Z(),{destroyer:S}=m(),{isNodeStream:I,isReadable:M,isWritable:U,isWebStream:B,isTransformStream:H,isWritableStream:$,isReadableStream:ae}=f(),{AbortError:ie,codes:{ERR_INVALID_ARG_VALUE:ne,ERR_MISSING_ARGS:Ne}}=s(),ve=g();T.exports=function(...he){if(he.length===0)throw new Ne("streams");if(he.length===1)return p.from(he[0]);let Se=[...he];if(typeof he[0]=="function"&&(he[0]=p.from(he[0])),typeof he[he.length-1]=="function"){let X=he.length-1;he[X]=p.from(he[X])}for(let X=0;X<he.length;++X)if(!(!I(he[X])&&!B(he[X]))){if(X<he.length-1&&!(M(he[X])||ae(he[X])||H(he[X])))throw new ne(`streams[${X}]`,Se[X],"must be readable");if(X>0&&!(U(he[X])||$(he[X])||H(he[X])))throw new ne(`streams[${X}]`,Se[X],"must be writable")}let Q,se,J,te,de;function be(X){let W=te;te=null,W?W(X):X?de.destroy(X):!ee&&!Y&&de.destroy()}a(be,"i");let Ae=he[0],oe=k(he,be),Y=!!(U(Ae)||$(Ae)||H(Ae)),ee=!!(M(oe)||ae(oe)||H(oe));if(de=new p({writableObjectMode:!!(Ae!=null&&Ae.writableObjectMode),readableObjectMode:!!(oe!=null&&oe.readableObjectMode),writable:Y,readable:ee}),Y){if(I(Ae))de._write=function(W,q,re){Ae.write(W,q)?re():Q=re},de._final=function(W){Ae.end(),se=W},Ae.on("drain",function(){if(Q){let W=Q;Q=null,W()}});else if(B(Ae)){let W=(H(Ae)?Ae.writable:Ae).getWriter();de._write=async function(q,re,Oe){try{await W.ready,W.write(q).catch(()=>{}),Oe()}catch(Ee){Oe(Ee)}},de._final=async function(q){try{await W.ready,W.close().catch(()=>{}),se=q}catch(re){q(re)}}}let X=H(oe)?oe.readable:oe;ve(X,()=>{if(se){let W=se;se=null,W()}})}if(ee){if(I(oe))oe.on("readable",function(){if(J){let X=J;J=null,X()}}),oe.on("end",function(){de.push(null)}),de._read=function(){for(;;){let X=oe.read();if(X===null){J=de._read;return}if(!de.push(X))return}};else if(B(oe)){let X=(H(oe)?oe.readable:oe).getReader();de._read=async function(){for(;;)try{let{value:W,done:q}=await X.read();if(!de.push(W))return;if(q){de.push(null);return}}catch{return}}}}return de._destroy=function(X,W){!X&&te!==null&&(X=new ie),J=null,Q=null,se=null,te===null?W(X):(te=W,I(oe)&&S(oe,X))},de}}),y=r((N,T)=>{var k=globalThis.AbortController||l().AbortController,{codes:{ERR_INVALID_ARG_VALUE:p,ERR_INVALID_ARG_TYPE:S,ERR_MISSING_ARGS:I,ERR_OUT_OF_RANGE:M},AbortError:U}=s(),{validateAbortSignal:B,validateInteger:H,validateObject:$}=c(),ae=n().Symbol("kWeak"),ie=n().Symbol("kResistStopPropagation"),{finished:ne}=g(),Ne=h(),{addAbortSignalNoValidate:ve}=E(),{isWritable:he,isNodeStream:Se}=f(),{deprecate:Q}=u(),{ArrayPrototypePush:se,Boolean:J,MathFloor:te,Number:de,NumberIsNaN:be,Promise:Ae,PromiseReject:oe,PromiseResolve:Y,PromisePrototypeThen:ee,Symbol:X}=n(),W=X("kEmpty"),q=X("kEof");function re(Te,Ye){if(Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Se(Te)&&!he(Te))throw new p("stream",Te,"must be writable");let Me=Ne(this,Te);return Ye!=null&&Ye.signal&&ve(Ye.signal,Me),Me}a(re,"H");function Oe(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal");let Me=1;Ye?.concurrency!=null&&(Me=te(Ye.concurrency));let $e=Me-1;return Ye?.highWaterMark!=null&&($e=te(Ye.highWaterMark)),H(Me,"options.concurrency",1),H($e,"options.highWaterMark",0),$e+=Me,async function*(){let mt=u().AbortSignalAny([Ye?.signal].filter(J)),ue=this,me=[],He={signal:mt},Ie,je,rt=!1,ce=0;function Ce(){rt=!0,et()}a(Ce,"B");function et(){ce-=1,ke()}a(et,"H$");function ke(){je&&!rt&&ce<Me&&me.length<$e&&(je(),je=null)}a(ke,"t");async function tt(){try{for await(let Tt of ue){if(rt)return;if(mt.aborted)throw new U;try{if(Tt=Te(Tt,He),Tt===W)continue;Tt=Y(Tt)}catch(Ke){Tt=oe(Ke)}ce+=1,ee(Tt,et,Ce),me.push(Tt),Ie&&(Ie(),Ie=null),!rt&&(me.length>=$e||ce>=Me)&&await new Ae(Ke=>{je=Ke})}me.push(q)}catch(Tt){let Ke=oe(Tt);ee(Ke,et,Ce),me.push(Ke)}finally{rt=!0,Ie&&(Ie(),Ie=null)}}a(tt,"F"),tt();try{for(;;){for(;me.length>0;){let Tt=await me[0];if(Tt===q)return;if(mt.aborted)throw new U;Tt!==W&&(yield Tt),me.shift(),ke()}await new Ae(Tt=>{Ie=Tt})}}finally{rt=!0,je&&(je(),je=null)}}.call(this)}a(Oe,"f");function Ee(Te=void 0){return Te!=null&&$(Te,"options"),Te?.signal!=null&&B(Te.signal,"options.signal"),async function*(){let Ye=0;for await(let $e of this){var Me;if(Te!=null&&(Me=Te.signal)!==null&&Me!==void 0&&Me.aborted)throw new U({cause:Te.signal.reason});yield[Ye++,$e]}}.call(this)}a(Ee,"V");async function Be(Te,Ye=void 0){for await(let Me of ge.call(this,Te,Ye))return!0;return!1}a(Be,"S");async function pt(Te,Ye=void 0){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);return!await Be.call(this,async(...Me)=>!await Te(...Me),Ye)}a(pt,"A");async function xe(Te,Ye){for await(let Me of ge.call(this,Te,Ye))return Me}a(xe,"z");async function Ge(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);async function Me($e,mt){return await Te($e,mt),W}a(Me,"s");for await(let $e of Oe.call(this,Me,Ye));}a(Ge,"G");function ge(Te,Ye){if(typeof Te!="function")throw new S("fn",["Function","AsyncFunction"],Te);async function Me($e,mt){return await Te($e,mt)?$e:W}return a(Me,"s"),Oe.call(this,Me,Ye)}a(ge,"I");class _e extends I{static{a(this,"C")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Re(Te,Ye,Me){var $e;if(typeof Te!="function")throw new S("reducer",["Function","AsyncFunction"],Te);Me!=null&&$(Me,"options"),Me?.signal!=null&&B(Me.signal,"options.signal");let mt=arguments.length>1;if(Me!=null&&($e=Me.signal)!==null&&$e!==void 0&&$e.aborted){let je=new U(void 0,{cause:Me.signal.reason});throw this.once("error",()=>{}),await ne(this.destroy(je)),je}let ue=new k,me=ue.signal;if(Me!=null&&Me.signal){let je={once:!0,[ae]:this,[ie]:!0};Me.signal.addEventListener("abort",()=>ue.abort(),je)}let He=!1;try{for await(let je of this){var Ie;if(He=!0,Me!=null&&(Ie=Me.signal)!==null&&Ie!==void 0&&Ie.aborted)throw new U;mt?Ye=await Te(Ye,je,{signal:me}):(Ye=je,mt=!0)}if(!He&&!mt)throw new _e}finally{ue.abort()}return Ye}a(Re,"g");async function ze(Te){Te!=null&&$(Te,"options"),Te?.signal!=null&&B(Te.signal,"options.signal");let Ye=[];for await(let $e of this){var Me;if(Te!=null&&(Me=Te.signal)!==null&&Me!==void 0&&Me.aborted)throw new U(void 0,{cause:Te.signal.reason});se(Ye,$e)}return Ye}a(ze,"x");function Pe(Te,Ye){let Me=Oe.call(this,Te,Ye);return async function*(){for await(let $e of Me)yield*$e}.call(this)}a(Pe,"l");function We(Te){if(Te=de(Te),be(Te))return 0;if(Te<0)throw new M("number",">= 0",Te);return Te}a(We,"o");function xt(Te,Ye=void 0){return Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Te=We(Te),async function*(){var Me;if(Ye!=null&&(Me=Ye.signal)!==null&&Me!==void 0&&Me.aborted)throw new U;for await(let mt of this){var $e;if(Ye!=null&&($e=Ye.signal)!==null&&$e!==void 0&&$e.aborted)throw new U;Te--<=0&&(yield mt)}}.call(this)}a(xt,"T$");function Ve(Te,Ye=void 0){return Ye!=null&&$(Ye,"options"),Ye?.signal!=null&&B(Ye.signal,"options.signal"),Te=We(Te),async function*(){var Me;if(Ye!=null&&(Me=Ye.signal)!==null&&Me!==void 0&&Me.aborted)throw new U;for await(let mt of this){var $e;if(Ye!=null&&($e=Ye.signal)!==null&&$e!==void 0&&$e.aborted)throw new U;if(Te-- >0&&(yield mt),Te<=0)return}}.call(this)}a(Ve,"e"),T.exports.streamReturningOperators={asIndexedPairs:Q(Ee,"readable.asIndexedPairs will be removed in a future version."),drop:xt,filter:ge,flatMap:Pe,map:Oe,take:Ve,compose:re},T.exports.promiseReturningOperators={every:pt,forEach:Ge,reduce:Re,toArray:ze,some:Be,find:xe}}),b=r((N,T)=>{var{ArrayPrototypePop:k,Promise:p}=n(),{isIterable:S,isNodeStream:I,isWebStream:M}=f(),{pipelineImpl:U}=V(),{finished:B}=g();x();function H(...$){return new p((ae,ie)=>{let ne,Ne,ve=$[$.length-1];if(ve&&typeof ve=="object"&&!I(ve)&&!S(ve)&&!M(ve)){let he=k($);ne=he.signal,Ne=he.end}U($,(he,Se)=>{he?ie(he):ae(Se)},{signal:ne,end:Ne})})}a(H,"T"),T.exports={finished:B,pipeline:H}}),x=r((N,T)=>{var{Buffer:k}=(ln(),qt(qr)),{ObjectDefineProperty:p,ObjectKeys:S,ReflectApply:I}=n(),{promisify:{custom:M}}=u(),{streamReturningOperators:U,promiseReturningOperators:B}=y(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=s(),$=h(),{setDefaultHighWaterMark:ae,getDefaultHighWaterMark:ie}=C(),{pipeline:ne}=V(),{destroyer:Ne}=m(),ve=g(),he=b(),Se=f(),Q=T.exports=w().Stream;Q.isDestroyed=Se.isDestroyed,Q.isDisturbed=Se.isDisturbed,Q.isErrored=Se.isErrored,Q.isReadable=Se.isReadable,Q.isWritable=Se.isWritable,Q.Readable=L();for(let J of S(U)){let te=a(function(...be){if(new.target)throw H();return Q.Readable.from(I(de,this,be))},"y"),de=U[J];p(te,"name",{__proto__:null,value:de.name}),p(te,"length",{__proto__:null,value:de.length}),p(Q.Readable.prototype,J,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}for(let J of S(B)){let te=a(function(...be){if(new.target)throw H();return I(de,this,be)},"y"),de=B[J];p(te,"name",{__proto__:null,value:de.name}),p(te,"length",{__proto__:null,value:de.length}),p(Q.Readable.prototype,J,{__proto__:null,value:te,enumerable:!1,configurable:!0,writable:!0})}Q.Writable=j(),Q.Duplex=Z(),Q.Transform=K(),Q.PassThrough=z(),Q.pipeline=ne;var{addAbortSignal:se}=E();Q.addAbortSignal=se,Q.finished=ve,Q.destroy=Ne,Q.compose=$,Q.setDefaultHighWaterMark=ae,Q.getDefaultHighWaterMark=ie,p(Q,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return he}}),p(ne,M,{__proto__:null,enumerable:!0,get(){return he.pipeline}}),p(ve,M,{__proto__:null,enumerable:!0,get(){return he.finished}}),Q.Stream=Q,Q._isUint8Array=function(J){return J instanceof Uint8Array},Q._uint8ArrayToBuffer=function(J){return k.from(J.buffer,J.byteOffset,J.byteLength)}}),_=r((N,T)=>{rI();{let k=x(),p=b(),S=k.Readable.destroy;T.exports=k.Readable,T.exports._uint8ArrayToBuffer=k._uint8ArrayToBuffer,T.exports._isUint8Array=k._isUint8Array,T.exports.isDisturbed=k.isDisturbed,T.exports.isErrored=k.isErrored,T.exports.isReadable=k.isReadable,T.exports.Readable=k.Readable,T.exports.Writable=k.Writable,T.exports.Duplex=k.Duplex,T.exports.Transform=k.Transform,T.exports.PassThrough=k.PassThrough,T.exports.addAbortSignal=k.addAbortSignal,T.exports.finished=k.finished,T.exports.destroy=k.destroy,T.exports.destroy=S,T.exports.pipeline=k.pipeline,T.exports.compose=k.compose,Object.defineProperty(k,"promises",{configurable:!0,enumerable:!0,get(){return p}}),T.exports.Stream=k.Stream}T.exports.default=T.exports});t.exports=_()}),Ln={};vn(Ln,{webcrypto:a(()=>YI,"webcrypto"),rng:a(()=>uI,"rng"),randomUUID:a(()=>yZ,"randomUUID"),randomFillSync:a(()=>ZI,"randomFillSync"),randomFill:a(()=>HI,"randomFill"),randomBytes:a(()=>cI,"randomBytes"),publicEncrypt:a(()=>UI,"publicEncrypt"),publicDecrypt:a(()=>zI,"publicDecrypt"),pseudoRandomBytes:a(()=>lI,"pseudoRandomBytes"),prng:a(()=>oI,"prng"),privateEncrypt:a(()=>BI,"privateEncrypt"),privateDecrypt:a(()=>FI,"privateDecrypt"),pbkdf2Sync:a(()=>bI,"pbkdf2Sync"),pbkdf2:a(()=>gI,"pbkdf2"),listCiphers:a(()=>TI,"listCiphers"),getRandomValues:a(()=>vZ,"getRandomValues"),getHashes:a(()=>mI,"getHashes"),getDiffieHellman:a(()=>CI,"getDiffieHellman"),getCurves:a(()=>mZ,"getCurves"),getCiphers:a(()=>AI,"getCiphers"),default:a(()=>QI,"default"),createVerify:a(()=>LI,"createVerify"),createSign:a(()=>RI,"createSign"),createHmac:a(()=>pI,"createHmac"),createHash:a(()=>fI,"createHash"),createECDH:a(()=>jI,"createECDH"),createDiffieHellmanGroup:a(()=>II,"createDiffieHellmanGroup"),createDiffieHellman:a(()=>MI,"createDiffieHellman"),createDecipheriv:a(()=>kI,"createDecipheriv"),createDecipher:a(()=>EI,"createDecipher"),createCredentials:a(()=>GI,"createCredentials"),createCipheriv:a(()=>xI,"createCipheriv"),createCipher:a(()=>yI,"createCipher"),constants:a(()=>VI,"constants"),Verify:a(()=>DI,"Verify"),Sign:a(()=>PI,"Sign"),Hmac:a(()=>hI,"Hmac"),Hash:a(()=>dI,"Hash"),DiffieHellmanGroup:a(()=>NI,"DiffieHellmanGroup"),DiffieHellman:a(()=>OI,"DiffieHellman"),Decipheriv:a(()=>SI,"Decipheriv"),Decipher:a(()=>_I,"Decipher"),DEFAULT_ENCODING:a(()=>bZ,"DEFAULT_ENCODING"),Cipheriv:a(()=>wI,"Cipheriv"),Cipher:a(()=>vI,"Cipher")});function mZ(){return WI}a(mZ,"$F");var nI,iI,Iv,aI,sI,gZ=a((e,t,r)=>{r=e!=null?nI(iI(e)):{};let n=t||!e||!e.__esModule?Iv(r,"default",{value:e,enumerable:!0}):r;for(let i of aI(e))sI.call(n,i)||Iv(n,i,{get:a(()=>e[i],"get"),enumerable:!0});return n},"bB"),Qe=a((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),"Z$"),Jl,Kl,N0,R1,Yd,Qd,fn,P1,Zo,I0,L1,D1,j1,U1,C0,B1,z1,F1,H1,Z1,G1,V1,W1,Y1,Q1,Go,ql,M0,$1,O0,R0,X1,Vo,$d,Xd,J1,P0,Jd,K1,L0,q1,D0,j0,eE,tE,rE,nE,iE,aE,sE,oE,lE,uE,cE,dE,fE,hE,Kd,U0,pE,B0,mE,gE,bE,vE,qi,ka,z0,Vn,F0,eu,yE,Mn,wE,xE,_E,H0,wi,Wo,Z0,EE,G0,SE,V0,kE,AE,TE,NE,qd,IE,ef,CE,ME,OE,RE,PE,LE,DE,jE,UE,BE,zE,FE,HE,ZE,W0,GE,Yo,VE,Y0,Q0,WE,YE,$0,QE,$E,Qo,XE,JE,KE,qE,e6,t6,X0,r6,J0,K0,q0,tf,eg,n6,tg,i6,a6,rf,s6,o6,l6,u6,Vt,oI,lI,uI,cI,dI,fI,hI,pI,mI,gI,bI,vI,yI,wI,xI,_I,EI,SI,kI,AI,TI,NI,II,CI,MI,OI,RI,PI,LI,DI,jI,UI,BI,zI,FI,HI,ZI,GI,VI,bZ="buffer",vZ=a(e=>crypto.getRandomValues(e),"at"),yZ=a(()=>crypto.randomUUID(),"et"),WI,YI,QI,Qn=$c(()=>{nI=Object.create,{getPrototypeOf:iI,defineProperty:Iv,getOwnPropertyNames:aI}=Object,sI=Object.prototype.hasOwnProperty,Jl=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).randomBytes}),Kl=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).createHash}),N0=Qe((e,t)=>{t.exports=(Qn(),qt(Ln)).createHmac}),R1=Qe((e,t)=>{t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),Yd=Qe((e,t)=>{var r=isFinite,n=Math.pow(2,30)-1;t.exports=function(i,s){if(typeof i!="number")throw TypeError("Iterations not a number");if(i<0||!r(i))throw TypeError("Bad iterations");if(typeof s!="number")throw TypeError("Key length not a number");if(s<0||s>n||s!==s)throw TypeError("Bad key length")}}),Qd=Qe((e,t)=>{var r;globalThis.process&&globalThis.process.browser?r="utf-8":globalThis.process&&globalThis.process.version?(n=parseInt(process.version.split(".")[0].slice(1),10),r=n>=6?"utf-8":"binary"):r="utf-8";var n;t.exports=r}),fn=Qe((e,t)=>{var r=(ln(),qt(qr)),n=r.Buffer;function i(o,l){for(var u in o)l[u]=o[u]}a(i,"K"),n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,l,u){return n(o,l,u)}a(s,"O"),s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,l,u){if(typeof o=="number")throw TypeError("Argument must not be a number");return n(o,l,u)},s.alloc=function(o,l,u){if(typeof o!="number")throw TypeError("Argument must be a number");var c=n(o);return l!==void 0?typeof u=="string"?c.fill(l,u):c.fill(l):c.fill(0),c},s.allocUnsafe=function(o){if(typeof o!="number")throw TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw TypeError("Argument must be a number");return r.SlowBuffer(o)}}),P1=Qe((e,t)=>{var r={}.toString;t.exports=Array.isArray||function(n){return r.call(n)=="[object Array]"}}),Zo=Qe((e,t)=>{t.exports=TypeError}),I0=Qe((e,t)=>{t.exports=Object}),L1=Qe((e,t)=>{t.exports=Error}),D1=Qe((e,t)=>{t.exports=EvalError}),j1=Qe((e,t)=>{t.exports=RangeError}),U1=Qe((e,t)=>{t.exports=ReferenceError}),C0=Qe((e,t)=>{t.exports=SyntaxError}),B1=Qe((e,t)=>{t.exports=URIError}),z1=Qe((e,t)=>{t.exports=Math.abs}),F1=Qe((e,t)=>{t.exports=Math.floor}),H1=Qe((e,t)=>{t.exports=Math.max}),Z1=Qe((e,t)=>{t.exports=Math.min}),G1=Qe((e,t)=>{t.exports=Math.pow}),V1=Qe((e,t)=>{t.exports=Math.round}),W1=Qe((e,t)=>{t.exports=Number.isNaN||function(r){return r!==r}}),Y1=Qe((e,t)=>{var r=W1();t.exports=function(n){return r(n)||n===0?n:n<0?-1:1}}),Q1=Qe((e,t)=>{t.exports=Object.getOwnPropertyDescriptor}),Go=Qe((e,t)=>{var r=Q1();if(r)try{r([],"length")}catch{r=null}t.exports=r}),ql=Qe((e,t)=>{var r=Object.defineProperty||!1;if(r)try{r({},"a",{value:1})}catch{r=!1}t.exports=r}),M0=Qe((e,t)=>{t.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},n=Symbol("test"),i=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var s=42;r[n]=s;for(var o in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var l=Object.getOwnPropertySymbols(r);if(l.length!==1||l[0]!==n||!Object.prototype.propertyIsEnumerable.call(r,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var u=Object.getOwnPropertyDescriptor(r,n);if(u.value!==s||u.enumerable!==!0)return!1}return!0}}),$1=Qe((e,t)=>{var r=typeof Symbol<"u"&&Symbol,n=M0();t.exports=function(){return typeof r!="function"||typeof Symbol!="function"||typeof r("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()}}),O0=Qe((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),R0=Qe((e,t)=>{var r=I0();t.exports=r.getPrototypeOf||null}),X1=Qe((e,t)=>{var r="Function.prototype.bind called on incompatible ",n=Object.prototype.toString,i=Math.max,s="[object Function]",o=a(function(c,d){for(var f=[],g=0;g<c.length;g+=1)f[g]=c[g];for(var m=0;m<d.length;m+=1)f[m+c.length]=d[m];return f},"Y"),l=a(function(c,d){for(var f=[],g=d,m=0;g<c.length;g+=1,m+=1)f[m]=c[g];return f},"v"),u=a(function(c,d){for(var f="",g=0;g<c.length;g+=1)f+=c[g],g+1<c.length&&(f+=d);return f},"W");t.exports=function(c){var d=this;if(typeof d!="function"||n.apply(d)!==s)throw TypeError(r+d);for(var f=l(arguments,1),g,m=a(function(){if(this instanceof g){var O=d.apply(this,o(f,arguments));return Object(O)===O?O:this}return d.apply(c,o(f,arguments))},"M"),w=i(0,d.length-f.length),E=[],A=0;A<w;A++)E[A]="$"+A;if(g=Function("binder","return function ("+u(E,",")+"){ return binder.apply(this,arguments); }")(m),d.prototype){var C=a(function(){},"D");C.prototype=d.prototype,g.prototype=new C,C.prototype=null}return g}}),Vo=Qe((e,t)=>{var r=X1();t.exports=Function.prototype.bind||r}),$d=Qe((e,t)=>{t.exports=Function.prototype.call}),Xd=Qe((e,t)=>{t.exports=Function.prototype.apply}),J1=Qe((e,t)=>{t.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),P0=Qe((e,t)=>{var r=Vo(),n=Xd(),i=$d(),s=J1();t.exports=s||r.call(i,n)}),Jd=Qe((e,t)=>{var r=Vo(),n=Zo(),i=$d(),s=P0();t.exports=function(o){if(o.length<1||typeof o[0]!="function")throw new n("a function is required");return s(r,i,o)}}),K1=Qe((e,t)=>{var r=Jd(),n=Go(),i;try{i=[].__proto__===Array.prototype}catch(u){if(!u||typeof u!="object"||!("code"in u)||u.code!=="ERR_PROTO_ACCESS")throw u}var s=!!i&&n&&n(Object.prototype,"__proto__"),o=Object,l=o.getPrototypeOf;t.exports=s&&typeof s.get=="function"?r([s.get]):typeof l=="function"?function(u){return l(u==null?u:o(u))}:!1}),L0=Qe((e,t)=>{var r=O0(),n=R0(),i=K1();t.exports=r?function(s){return r(s)}:n?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw TypeError("getProto: not an object");return n(s)}:i?function(s){return i(s)}:null}),q1=Qe((e,t)=>{var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=Vo();t.exports=i.call(r,n)}),D0=Qe((e,t)=>{var r,n=I0(),i=L1(),s=D1(),o=j1(),l=U1(),u=C0(),c=Zo(),d=B1(),f=z1(),g=F1(),m=H1(),w=Z1(),E=G1(),A=V1(),C=Y1(),O=Function,R=a(function(Ne){try{return O('"use strict"; return ('+Ne+").constructor;")()}catch{}},"L"),P=Go(),L=ql(),j=a(function(){throw new c},"p"),G=P?(function(){try{return arguments.callee,j}catch{try{return P(arguments,"callee").get}catch{return j}}})():j,Z=$1()(),K=L0(),z=R0(),V=O0(),h=Xd(),y=$d(),b={},x=typeof Uint8Array>"u"||!K?r:K(Uint8Array),_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?r:ArrayBuffer,"%ArrayIteratorPrototype%":Z&&K?K([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":b,"%AsyncGenerator%":b,"%AsyncGeneratorFunction%":b,"%AsyncIteratorPrototype%":b,"%Atomics%":typeof Atomics>"u"?r:Atomics,"%BigInt%":typeof BigInt>"u"?r:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?r:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":s,"%Float16Array%":typeof Float16Array>"u"?r:Float16Array,"%Float32Array%":typeof Float32Array>"u"?r:Float32Array,"%Float64Array%":typeof Float64Array>"u"?r:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?r:FinalizationRegistry,"%Function%":O,"%GeneratorFunction%":b,"%Int8Array%":typeof Int8Array>"u"?r:Int8Array,"%Int16Array%":typeof Int16Array>"u"?r:Int16Array,"%Int32Array%":typeof Int32Array>"u"?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Z&&K?K(K([][Symbol.iterator]())):r,"%JSON%":typeof JSON=="object"?JSON:r,"%Map%":typeof Map>"u"?r:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Z||!K?r:K(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?r:Promise,"%Proxy%":typeof Proxy>"u"?r:Proxy,"%RangeError%":o,"%ReferenceError%":l,"%Reflect%":typeof Reflect>"u"?r:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?r:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Z||!K?r:K(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Z&&K?K(""[Symbol.iterator]()):r,"%Symbol%":Z?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":G,"%TypedArray%":x,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?r:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?r:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?r:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?r:Uint32Array,"%URIError%":d,"%WeakMap%":typeof WeakMap>"u"?r:WeakMap,"%WeakRef%":typeof WeakRef>"u"?r:WeakRef,"%WeakSet%":typeof WeakSet>"u"?r:WeakSet,"%Function.prototype.call%":y,"%Function.prototype.apply%":h,"%Object.defineProperty%":L,"%Object.getPrototypeOf%":z,"%Math.abs%":f,"%Math.floor%":g,"%Math.max%":m,"%Math.min%":w,"%Math.pow%":E,"%Math.round%":A,"%Math.sign%":C,"%Reflect.getPrototypeOf%":V};if(K)try{null.error}catch(Ne){N=K(K(Ne)),_["%Error.prototype%"]=N}var N,T=a(function Ne(ve){var he;if(ve==="%AsyncFunction%")he=R("async function () {}");else if(ve==="%GeneratorFunction%")he=R("function* () {}");else if(ve==="%AsyncGeneratorFunction%")he=R("async function* () {}");else if(ve==="%AsyncGenerator%"){var Se=Ne("%AsyncGeneratorFunction%");Se&&(he=Se.prototype)}else if(ve==="%AsyncIteratorPrototype%"){var Q=Ne("%AsyncGenerator%");Q&&K&&(he=K(Q.prototype))}return _[ve]=he,he},"j$"),k={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},p=Vo(),S=q1(),I=p.call(y,Array.prototype.concat),M=p.call(h,Array.prototype.splice),U=p.call(y,String.prototype.replace),B=p.call(y,String.prototype.slice),H=p.call(y,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ae=/\\(\\)?/g,ie=a(function(Ne){var ve=B(Ne,0,1),he=B(Ne,-1);if(ve==="%"&&he!=="%")throw new u("invalid intrinsic syntax, expected closing `%`");if(he==="%"&&ve!=="%")throw new u("invalid intrinsic syntax, expected opening `%`");var Se=[];return U(Ne,$,function(Q,se,J,te){Se[Se.length]=J?U(te,ae,"$1"):se||Q}),Se},"e"),ne=a(function(Ne,ve){var he=Ne,Se;if(S(k,he)&&(Se=k[he],he="%"+Se[0]+"%"),S(_,he)){var Q=_[he];if(Q===b&&(Q=T(he)),typeof Q>"u"&&!ve)throw new c("intrinsic "+Ne+" exists, but is not available. Please file an issue!");return{alias:Se,name:he,value:Q}}throw new u("intrinsic "+Ne+" does not exist!")},"n");t.exports=function(Ne,ve){if(typeof Ne!="string"||Ne.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ve!="boolean")throw new c('"allowMissing" argument must be a boolean');if(H(/^%?[^%]*%?$/,Ne)===null)throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var he=ie(Ne),Se=he.length>0?he[0]:"",Q=ne("%"+Se+"%",ve),se=Q.name,J=Q.value,te=!1,de=Q.alias;de&&(Se=de[0],M(he,I([0,1],de)));for(var be=1,Ae=!0;be<he.length;be+=1){var oe=he[be],Y=B(oe,0,1),ee=B(oe,-1);if((Y==='"'||Y==="'"||Y==="`"||ee==='"'||ee==="'"||ee==="`")&&Y!==ee)throw new u("property names with quotes must have matching quotes");if((oe==="constructor"||!Ae)&&(te=!0),Se+="."+oe,se="%"+Se+"%",S(_,se))J=_[se];else if(J!=null){if(!(oe in J)){if(!ve)throw new c("base intrinsic for "+Ne+" exists, but the property is not available.");return}if(P&&be+1>=he.length){var X=P(J,oe);Ae=!!X,Ae&&"get"in X&&!("originalValue"in X.get)?J=X.get:J=J[oe]}else Ae=S(J,oe),J=J[oe];Ae&&!te&&(_[se]=J)}}return J}}),j0=Qe((e,t)=>{var r=D0(),n=Jd(),i=n([r("%String.prototype.indexOf%")]);t.exports=function(s,o){var l=r(s,!!o);return typeof l=="function"&&i(s,".prototype.")>-1?n([l]):l}}),eE=Qe((e,t)=>{var r=Function.prototype.toString,n=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,i,s;if(typeof n=="function"&&typeof Object.defineProperty=="function")try{i=Object.defineProperty({},"length",{get:a(function(){throw s},"get")}),s={},n(function(){throw 42},null,i)}catch(P){P!==s&&(n=null)}else n=null;var o=/^\s*class\b/,l=a(function(P){try{var L=r.call(P);return o.test(L)}catch{return!1}},"v"),u=a(function(P){try{return l(P)?!1:(r.call(P),!0)}catch{return!1}},"W"),c=Object.prototype.toString,d="[object Object]",f="[object Function]",g="[object GeneratorFunction]",m="[object HTMLAllCollection]",w="[object HTML document.all class]",E="[object HTMLCollection]",A=typeof Symbol=="function"&&!!Symbol.toStringTag,C=!(0 in[,]),O=a(function(){return!1},"h");typeof document=="object"&&(R=document.all,c.call(R)===c.call(document.all)&&(O=a(function(P){if((C||!P)&&(typeof P>"u"||typeof P=="object"))try{var L=c.call(P);return(L===m||L===w||L===E||L===d)&&P("")==null}catch{}return!1},"h")));var R;t.exports=n?function(P){if(O(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;try{n(P,null,i)}catch(L){if(L!==s)return!1}return!l(P)&&u(P)}:function(P){if(O(P))return!0;if(!P||typeof P!="function"&&typeof P!="object")return!1;if(A)return u(P);if(l(P))return!1;var L=c.call(P);return L!==f&&L!==g&&!/^\[object HTML/.test(L)?!1:u(P)}}),tE=Qe((e,t)=>{var r=eE(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty,s=a(function(c,d,f){for(var g=0,m=c.length;g<m;g++)i.call(c,g)&&(f==null?d(c[g],g,c):d.call(f,c[g],g,c))},"O"),o=a(function(c,d,f){for(var g=0,m=c.length;g<m;g++)f==null?d(c.charAt(g),g,c):d.call(f,c.charAt(g),g,c)},"Y"),l=a(function(c,d,f){for(var g in c)i.call(c,g)&&(f==null?d(c[g],g,c):d.call(f,c[g],g,c))},"v");function u(c){return n.call(c)==="[object Array]"}a(u,"W"),t.exports=function(c,d,f){if(!r(d))throw TypeError("iterator must be a function");var g;arguments.length>=3&&(g=f),u(c)?s(c,d,g):typeof c=="string"?o(c,d,g):l(c,d,g)}}),rE=Qe((e,t)=>{t.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),nE=Qe((e,t)=>{var r=rE(),n=globalThis;t.exports=function(){for(var i=[],s=0;s<r.length;s++)typeof n[r[s]]=="function"&&(i[i.length]=r[s]);return i}}),iE=Qe((e,t)=>{var r=ql(),n=C0(),i=Zo(),s=Go();t.exports=function(o,l,u){if(!o||typeof o!="object"&&typeof o!="function")throw new i("`obj` must be an object or a function`");if(typeof l!="string"&&typeof l!="symbol")throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new i("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,g=arguments.length>6?arguments[6]:!1,m=!!s&&s(o,l);if(r)r(o,l,{configurable:f===null&&m?m.configurable:!f,enumerable:c===null&&m?m.enumerable:!c,value:u,writable:d===null&&m?m.writable:!d});else if(g||!c&&!d&&!f)o[l]=u;else throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),aE=Qe((e,t)=>{var r=ql(),n=a(function(){return!!r},"P");n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return r([],"length",{value:1}).length!==1}catch{return!0}},t.exports=n}),sE=Qe((e,t)=>{var r=D0(),n=iE(),i=aE()(),s=Go(),o=Zo(),l=r("%Math.floor%");t.exports=function(u,c){if(typeof u!="function")throw new o("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||l(c)!==c)throw new o("`length` must be a positive 32-bit integer");var d=arguments.length>2&&!!arguments[2],f=!0,g=!0;if("length"in u&&s){var m=s(u,"length");m&&!m.configurable&&(f=!1),m&&!m.writable&&(g=!1)}return(f||g||!d)&&(i?n(u,"length",c,!0,!0):n(u,"length",c)),u}}),oE=Qe((e,t)=>{var r=Vo(),n=Xd(),i=P0();t.exports=function(){return i(r,n,arguments)}}),lE=Qe((e,t)=>{var r=sE(),n=ql(),i=Jd(),s=oE();t.exports=function(o){var l=i(arguments),u=o.length-(arguments.length-1);return r(l,1+(u>0?u:0),!0)},n?n(t.exports,"apply",{value:s}):t.exports.apply=s}),uE=Qe((e,t)=>{var r=M0();t.exports=function(){return r()&&!!Symbol.toStringTag}}),cE=Qe((e,t)=>{var r=tE(),n=nE(),i=lE(),s=j0(),o=Go(),l=L0(),u=s("Object.prototype.toString"),c=uE()(),d=globalThis,f=n(),g=s("String.prototype.slice"),m=s("Array.prototype.indexOf",!0)||function(C,O){for(var R=0;R<C.length;R+=1)if(C[R]===O)return R;return-1},w={__proto__:null};c&&o&&l?r(f,function(C){var O=new d[C];if(Symbol.toStringTag in O&&l){var R=l(O),P=o(R,Symbol.toStringTag);if(!P&&R){var L=l(R);P=o(L,Symbol.toStringTag)}w["$"+C]=i(P.get)}}):r(f,function(C){var O=new d[C],R=O.slice||O.set;R&&(w["$"+C]=i(R))});var E=a(function(C){var O=!1;return r(w,function(R,P){if(!O)try{"$"+R(C)===P&&(O=g(P,1))}catch{}}),O},"R"),A=a(function(C){var O=!1;return r(w,function(R,P){if(!O)try{R(C),O=g(P,1)}catch{}}),O},"E");t.exports=function(C){if(!C||typeof C!="object")return!1;if(!c){var O=g(u(C),8,-1);return m(f,O)>-1?O:O!=="Object"?!1:A(C)}return o?E(C):null}}),dE=Qe((e,t)=>{var r=cE();t.exports=function(n){return!!r(n)}}),fE=Qe((e,t)=>{var r=Zo(),n=j0(),i=n("TypedArray.prototype.buffer",!0),s=dE();t.exports=i||function(o){if(!s(o))throw new r("Not a Typed Array");return o.buffer}}),hE=Qe((e,t)=>{var r=fn().Buffer,n=P1(),i=fE(),s=ArrayBuffer.isView||function(c){try{return i(c),!0}catch{return!1}},o=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u=l&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);t.exports=function(c,d){if(r.isBuffer(c))return c.constructor&&!("isBuffer"in c)?r.from(c):c;if(typeof c=="string")return r.from(c,d);if(l&&s(c)){if(c.byteLength===0)return r.alloc(0);if(u){var f=r.from(c.buffer,c.byteOffset,c.byteLength);if(f.byteLength===c.byteLength)return f}var g=c instanceof Uint8Array?c:new Uint8Array(c.buffer,c.byteOffset,c.byteLength),m=r.from(g);if(m.length===c.byteLength)return m}if(o&&c instanceof Uint8Array)return r.from(c);var w=n(c);if(w)for(var E=0;E<c.length;E+=1){var A=c[E];if(typeof A!="number"||A<0||A>255||~~A!==A)throw RangeError("Array items must be numbers in the range 0-255.")}if(w||r.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return r.from(c);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),Kd=Qe((e,t)=>{var r=fn().Buffer,n=hE(),i=typeof Uint8Array<"u",s=i&&typeof ArrayBuffer<"u",o=s&&ArrayBuffer.isView;t.exports=function(l,u,c){if(typeof l=="string"||r.isBuffer(l)||i&&l instanceof Uint8Array||o&&o(l))return n(l,u);throw TypeError(c+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),U0=Qe((e,t)=>{var r={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},n={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},i=N0(),s=fn().Buffer,o=Yd(),l=Qd(),u=Kd();function c(d,f,g,m,w){o(g,m),d=u(d,l,"Password"),f=u(f,l,"Salt");var E=(w||"sha1").toLowerCase(),A=n[E]||E,C=r[A];if(typeof C!="number"||!C)throw TypeError("Digest algorithm not supported: "+w);var O=s.allocUnsafe(m),R=s.allocUnsafe(f.length+4);f.copy(R,0,0,f.length);for(var P=0,L=C,j=Math.ceil(m/L),G=1;G<=j;G++){R.writeUInt32BE(G,f.length);for(var Z=i(A,d).update(R).digest(),K=Z,z=1;z<g;z++){K=i(A,d).update(K).digest();for(var V=0;V<L;V++)Z[V]^=K[V]}Z.copy(O,P),P+=L}return O}a(c,"T"),t.exports=c}),pE=Qe((e,t)=>{var r=fn().Buffer,n=Yd(),i=Qd(),s=U0(),o=Kd(),l,u=globalThis.crypto&&globalThis.crypto.subtle,c={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[],f;function g(){return f||(globalThis.process&&globalThis.process.nextTick?f=globalThis.process.nextTick:globalThis.queueMicrotask?f=globalThis.queueMicrotask:globalThis.setImmediate?f=globalThis.setImmediate:f=globalThis.setTimeout,f)}a(g,"k");function m(A,C,O,R,P){return u.importKey("raw",A,{name:"PBKDF2"},!1,["deriveBits"]).then(function(L){return u.deriveBits({name:"PBKDF2",salt:C,iterations:O,hash:{name:P}},L,R<<3)}).then(function(L){return r.from(L)})}a(m,"M");function w(A){if(globalThis.process&&!globalThis.process.browser||!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(d[A]!==void 0)return d[A];l=l||r.alloc(8);var C=m(l,l,10,128,A).then(function(){return!0},function(){return!1});return d[A]=C,C}a(w,"N");function E(A,C){A.then(function(O){g()(function(){C(null,O)})},function(O){g()(function(){C(O)})})}a(E,"R"),t.exports=function(A,C,O,R,P,L){if(typeof P=="function"&&(L=P,P=void 0),n(O,R),A=o(A,i,"Password"),C=o(C,i,"Salt"),typeof L!="function")throw Error("No callback provided to pbkdf2");P=P||"sha1";var j=c[P.toLowerCase()];if(!j||typeof globalThis.Promise!="function"){g()(function(){var G;try{G=s(A,C,O,R,P)}catch(Z){L(Z);return}L(null,G)});return}E(w(j).then(function(G){return G?m(A,C,O,R,j):s(A,C,O,R,P)}),L)}}),B0=Qe(e=>{var t=(Qn(),qt(Ln)),r=Yd(),n=Qd(),i=Kd();function s(l,u,c,d,f,g){if(r(c,d),l=i(l,n,"Password"),u=i(u,n,"Salt"),typeof f=="function"&&(g=f,f="sha1"),typeof g!="function")throw Error("No callback provided to pbkdf2");return t.pbkdf2(l,u,c,d,f,g)}a(s,"O");function o(l,u,c,d,f){return r(c,d),l=i(l,n,"Password"),u=i(u,n,"Salt"),f=f||"sha1",t.pbkdf2Sync(l,u,c,d,f)}a(o,"Y"),!t.pbkdf2Sync||t.pbkdf2Sync.toString().indexOf("keylen, digest")===-1?(e.pbkdf2Sync=U0(),e.pbkdf2=pE()):(e.pbkdf2Sync=o,e.pbkdf2=s)}),mE=Qe(e=>{var t=(Qn(),qt(Ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),gE=Qe(e=>{var t=(Qn(),qt(Ln));e.DiffieHellmanGroup=t.DiffieHellmanGroup,e.createDiffieHellmanGroup=t.createDiffieHellmanGroup,e.getDiffieHellman=t.getDiffieHellman,e.createDiffieHellman=t.createDiffieHellman,e.DiffieHellman=t.DiffieHellman}),bE=Qe(e=>{var t=(Qn(),qt(Ln));e.createSign=t.createSign,e.Sign=t.Sign,e.createVerify=t.createVerify,e.Verify=t.Verify}),vE=Qe((e,t)=>{t.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),qi=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,xt=_[3]|0,Ve=xt&8191,Te=xt>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var Et=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=Et,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),ka=Qe((e,t)=>{t.exports=r;function r(n,i){if(!n)throw Error(i||"Assertion failed")}a(r,"_"),r.equal=function(n,i,s){if(n!=i)throw Error(s||"Assertion failed: "+n+" != "+i)}}),z0=Qe(e=>{var t=e;function r(s,o){if(Array.isArray(s))return s.slice();if(!s)return[];var l=[];if(typeof s!="string"){for(var u=0;u<s.length;u++)l[u]=s[u]|0;return l}if(o==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var u=0;u<s.length;u+=2)l.push(parseInt(s[u]+s[u+1],16))}else for(var u=0;u<s.length;u++){var c=s.charCodeAt(u),d=c>>8,f=c&255;d?l.push(d,f):l.push(f)}return l}a(r,"_"),t.toArray=r;function n(s){return s.length===1?"0"+s:s}a(n,"P"),t.zero2=n;function i(s){for(var o="",l=0;l<s.length;l++)o+=n(s[l].toString(16));return o}a(i,"K"),t.toHex=i,t.encode=function(s,o){return o==="hex"?i(s):s}}),Vn=Qe(e=>{var t=e,r=qi(),n=ka(),i=z0();t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode;function s(d,f,g){var m=Array(Math.max(d.bitLength(),g)+1),w;for(w=0;w<m.length;w+=1)m[w]=0;var E=1<<f+1,A=d.clone();for(w=0;w<m.length;w++){var C,O=A.andln(E-1);A.isOdd()?(O>(E>>1)-1?C=(E>>1)-O:C=O,A.isubn(C)):C=0,m[w]=C,A.iushrn(1)}return m}a(s,"O"),t.getNAF=s;function o(d,f){var g=[[],[]];d=d.clone(),f=f.clone();for(var m=0,w=0,E;d.cmpn(-m)>0||f.cmpn(-w)>0;){var A=d.andln(3)+m&3,C=f.andln(3)+w&3;A===3&&(A=-1),C===3&&(C=-1);var O;(A&1)===0?O=0:(E=d.andln(7)+m&7,(E===3||E===5)&&C===2?O=-A:O=A),g[0].push(O);var R;(C&1)===0?R=0:(E=f.andln(7)+w&7,(E===3||E===5)&&A===2?R=-C:R=C),g[1].push(R),2*m===O+1&&(m=1-m),2*w===R+1&&(w=1-w),d.iushrn(1),f.iushrn(1)}return g}a(o,"Y"),t.getJSF=o;function l(d,f,g){var m="_"+f;d.prototype[f]=function(){return this[m]!==void 0?this[m]:this[m]=g.call(this)}}a(l,"v"),t.cachedProperty=l;function u(d){return typeof d=="string"?t.toArray(d,"hex"):d}a(u,"W"),t.parseBytes=u;function c(d){return new r(d,"hex","le")}a(c,"T"),t.intFromLE=c}),F0=Qe((e,t)=>{var r;t.exports=function(s){return r||(r=new n(null)),r.generate(s)};function n(s){this.rand=s}if(a(n,"P"),t.exports.Rand=n,n.prototype.generate=function(s){return this._rand(s)},n.prototype._rand=function(s){if(this.rand.getBytes)return this.rand.getBytes(s);for(var o=new Uint8Array(s),l=0;l<o.length;l++)o[l]=this.rand.getByte();return o},typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(s){var o=new Uint8Array(s);return self.crypto.getRandomValues(o),o}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(s){var o=new Uint8Array(s);return self.msCrypto.getRandomValues(o),o}:typeof window=="object"&&(n.prototype._rand=function(){throw Error("Not implemented yet")});else try{if(i=(Qn(),qt(Ln)),typeof i.randomBytes!="function")throw Error("Not supported");n.prototype._rand=function(s){return i.randomBytes(s)}}catch{}var i}),eu=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.getNAF,s=n.getJSF,o=n.assert;function l(c,d){this.type=c,this.p=new r(d.p,16),this.red=d.prime?r.red(d.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=d.n&&new r(d.n,16),this.g=d.g&&this.pointFromJSON(d.g,d.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var f=this.n&&this.p.div(this.n);!f||f.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}a(l,"v"),t.exports=l,l.prototype.point=function(){throw Error("Not implemented")},l.prototype.validate=function(){throw Error("Not implemented")},l.prototype._fixedNafMul=function(c,d){o(c.precomputed);var f=c._getDoubles(),g=i(d,1,this._bitLength),m=(1<<f.step+1)-(f.step%2===0?2:1);m/=3;var w=[],E,A;for(E=0;E<g.length;E+=f.step){A=0;for(var C=E+f.step-1;C>=E;C--)A=(A<<1)+g[C];w.push(A)}for(var O=this.jpoint(null,null,null),R=this.jpoint(null,null,null),P=m;P>0;P--){for(E=0;E<w.length;E++)A=w[E],A===P?R=R.mixedAdd(f.points[E]):A===-P&&(R=R.mixedAdd(f.points[E].neg()));O=O.add(R)}return O.toP()},l.prototype._wnafMul=function(c,d){var f=4,g=c._getNAFPoints(f);f=g.wnd;for(var m=g.points,w=i(d,f,this._bitLength),E=this.jpoint(null,null,null),A=w.length-1;A>=0;A--){for(var C=0;A>=0&&w[A]===0;A--)C++;if(A>=0&&C++,E=E.dblp(C),A<0)break;var O=w[A];o(O!==0),c.type==="affine"?O>0?E=E.mixedAdd(m[O-1>>1]):E=E.mixedAdd(m[-O-1>>1].neg()):O>0?E=E.add(m[O-1>>1]):E=E.add(m[-O-1>>1].neg())}return c.type==="affine"?E.toP():E},l.prototype._wnafMulAdd=function(c,d,f,g,m){var w=this._wnafT1,E=this._wnafT2,A=this._wnafT3,C=0,O,R,P;for(O=0;O<g;O++){P=d[O];var L=P._getNAFPoints(c);w[O]=L.wnd,E[O]=L.points}for(O=g-1;O>=1;O-=2){var j=O-1,G=O;if(w[j]!==1||w[G]!==1){A[j]=i(f[j],w[j],this._bitLength),A[G]=i(f[G],w[G],this._bitLength),C=Math.max(A[j].length,C),C=Math.max(A[G].length,C);continue}var Z=[d[j],null,null,d[G]];d[j].y.cmp(d[G].y)===0?(Z[1]=d[j].add(d[G]),Z[2]=d[j].toJ().mixedAdd(d[G].neg())):d[j].y.cmp(d[G].y.redNeg())===0?(Z[1]=d[j].toJ().mixedAdd(d[G]),Z[2]=d[j].add(d[G].neg())):(Z[1]=d[j].toJ().mixedAdd(d[G]),Z[2]=d[j].toJ().mixedAdd(d[G].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],z=s(f[j],f[G]);for(C=Math.max(z[0].length,C),A[j]=Array(C),A[G]=Array(C),R=0;R<C;R++){var V=z[0][R]|0,h=z[1][R]|0;A[j][R]=K[(V+1)*3+(h+1)],A[G][R]=0,E[j]=Z}}var y=this.jpoint(null,null,null),b=this._wnafT4;for(O=C;O>=0;O--){for(var x=0;O>=0;){var _=!0;for(R=0;R<g;R++)b[R]=A[R][O]|0,b[R]!==0&&(_=!1);if(!_)break;x++,O--}if(O>=0&&x++,y=y.dblp(x),O<0)break;for(R=0;R<g;R++){var N=b[R];N!==0&&(N>0?P=E[R][N-1>>1]:N<0&&(P=E[R][-N-1>>1].neg()),P.type==="affine"?y=y.mixedAdd(P):y=y.add(P))}}for(O=0;O<g;O++)E[O]=null;return m?y:y.toP()};function u(c,d){this.curve=c,this.type=d,this.precomputed=null}a(u,"W"),l.BasePoint=u,u.prototype.eq=function(){throw Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},l.prototype.decodePoint=function(c,d){c=n.toArray(c,d);var f=this.p.byteLength();if((c[0]===4||c[0]===6||c[0]===7)&&c.length-1===2*f){c[0]===6?o(c[c.length-1]%2===0):c[0]===7&&o(c[c.length-1]%2===1);var g=this.point(c.slice(1,1+f),c.slice(1+f,1+2*f));return g}else if((c[0]===2||c[0]===3)&&c.length-1===f)return this.pointFromX(c.slice(1,1+f),c[0]===3);throw Error("Unknown point format")},u.prototype.encodeCompressed=function(c){return this.encode(c,!0)},u.prototype._encode=function(c){var d=this.curve.p.byteLength(),f=this.getX().toArray("be",d);return c?[this.getY().isEven()?2:3].concat(f):[4].concat(f,this.getY().toArray("be",d))},u.prototype.encode=function(c,d){return n.encode(this._encode(d),c)},u.prototype.precompute=function(c){if(this.precomputed)return this;var d={doubles:null,naf:null,beta:null};return d.naf=this._getNAFPoints(8),d.doubles=this._getDoubles(4,c),d.beta=this._getBeta(),this.precomputed=d,this},u.prototype._hasDoubles=function(c){if(!this.precomputed)return!1;var d=this.precomputed.doubles;return d?d.points.length>=Math.ceil((c.bitLength()+1)/d.step):!1},u.prototype._getDoubles=function(c,d){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var f=[this],g=this,m=0;m<d;m+=c){for(var w=0;w<c;w++)g=g.dbl();f.push(g)}return{step:c,points:f}},u.prototype._getNAFPoints=function(c){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var d=[this],f=(1<<c)-1,g=f===1?null:this.dbl(),m=1;m<f;m++)d[m]=d[m-1].add(g);return{wnd:c,points:d}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(c){for(var d=this,f=0;f<c;f++)d=d.dbl();return d}}),yE=Qe((e,t)=>{typeof Object.create=="function"?t.exports=function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,n){if(n){r.super_=n;var i=a(function(){},"K");i.prototype=n.prototype,r.prototype=new i,r.prototype.constructor=r}}}),Mn=Qe((e,t)=>{try{if(r=(lZ(),qt(DN)),typeof r.inherits!="function")throw"";t.exports=r.inherits}catch{t.exports=yE()}var r}),wE=Qe((e,t)=>{var r=Vn(),n=qi(),i=Mn(),s=eu(),o=r.assert;function l(d){s.call(this,"short",d),this.a=new n(d.a,16).toRed(this.red),this.b=new n(d.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(d),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}a(l,"v"),i(l,s),t.exports=l,l.prototype._getEndomorphism=function(d){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var f,g;if(d.beta)f=new n(d.beta,16).toRed(this.red);else{var m=this._getEndoRoots(this.p);f=m[0].cmp(m[1])<0?m[0]:m[1],f=f.toRed(this.red)}if(d.lambda)g=new n(d.lambda,16);else{var w=this._getEndoRoots(this.n);this.g.mul(w[0]).x.cmp(this.g.x.redMul(f))===0?g=w[0]:(g=w[1],o(this.g.mul(g).x.cmp(this.g.x.redMul(f))===0))}var E;return d.basis?E=d.basis.map(function(A){return{a:new n(A.a,16),b:new n(A.b,16)}}):E=this._getEndoBasis(g),{beta:f,lambda:g,basis:E}}},l.prototype._getEndoRoots=function(d){var f=d===this.p?this.red:n.mont(d),g=new n(2).toRed(f).redInvm(),m=g.redNeg(),w=new n(3).toRed(f).redNeg().redSqrt().redMul(g),E=m.redAdd(w).fromRed(),A=m.redSub(w).fromRed();return[E,A]},l.prototype._getEndoBasis=function(d){for(var f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),g=d,m=this.n.clone(),w=new n(1),E=new n(0),A=new n(0),C=new n(1),O,R,P,L,j,G,Z,K=0,z,V;g.cmpn(0)!==0;){var h=m.div(g);z=m.sub(h.mul(g)),V=A.sub(h.mul(w));var y=C.sub(h.mul(E));if(!P&&z.cmp(f)<0)O=Z.neg(),R=w,P=z.neg(),L=V;else if(P&&++K===2)break;Z=z,m=g,g=z,A=w,w=V,C=E,E=y}j=z.neg(),G=V;var b=P.sqr().add(L.sqr()),x=j.sqr().add(G.sqr());return x.cmp(b)>=0&&(j=O,G=R),P.negative&&(P=P.neg(),L=L.neg()),j.negative&&(j=j.neg(),G=G.neg()),[{a:P,b:L},{a:j,b:G}]},l.prototype._endoSplit=function(d){var f=this.endo.basis,g=f[0],m=f[1],w=m.b.mul(d).divRound(this.n),E=g.b.neg().mul(d).divRound(this.n),A=w.mul(g.a),C=E.mul(m.a),O=w.mul(g.b),R=E.mul(m.b),P=d.sub(A).sub(C),L=O.add(R).neg();return{k1:P,k2:L}},l.prototype.pointFromX=function(d,f){d=new n(d,16),!d.red&&(d=d.toRed(this.red));var g=d.redSqr().redMul(d).redIAdd(d.redMul(this.a)).redIAdd(this.b),m=g.redSqrt();if(m.redSqr().redSub(g).cmp(this.zero)!==0)throw Error("invalid point");var w=m.fromRed().isOdd();return(f&&!w||!f&&w)&&(m=m.redNeg()),this.point(d,m)},l.prototype.validate=function(d){if(d.inf)return!0;var{x:f,y:g}=d,m=this.a.redMul(f),w=f.redSqr().redMul(f).redIAdd(m).redIAdd(this.b);return g.redSqr().redISub(w).cmpn(0)===0},l.prototype._endoWnafMulAdd=function(d,f,g){for(var m=this._endoWnafT1,w=this._endoWnafT2,E=0;E<d.length;E++){var A=this._endoSplit(f[E]),C=d[E],O=C._getBeta();A.k1.negative&&(A.k1.ineg(),C=C.neg(!0)),A.k2.negative&&(A.k2.ineg(),O=O.neg(!0)),m[E*2]=C,m[E*2+1]=O,w[E*2]=A.k1,w[E*2+1]=A.k2}for(var R=this._wnafMulAdd(1,m,w,E*2,g),P=0;P<E*2;P++)m[P]=null,w[P]=null;return R};function u(d,f,g,m){s.BasePoint.call(this,d,"affine"),f===null&&g===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(f,16),this.y=new n(g,16),m&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}a(u,"W"),i(u,s.BasePoint),l.prototype.point=function(d,f,g){return new u(this,d,f,g)},l.prototype.pointFromJSON=function(d,f){return u.fromJSON(this,d,f)},u.prototype._getBeta=function(){if(this.curve.endo){var d=this.precomputed;if(d&&d.beta)return d.beta;var f=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(d){var g=this.curve,m=a(function(w){return g.point(w.x.redMul(g.endo.beta),w.y)},"M");d.beta=f,f.precomputed={beta:null,naf:d.naf&&{wnd:d.naf.wnd,points:d.naf.points.map(m)},doubles:d.doubles&&{step:d.doubles.step,points:d.doubles.points.map(m)}}}return f}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(d,f,g){typeof f=="string"&&(f=JSON.parse(f));var m=d.point(f[0],f[1],g);if(!f[2])return m;function w(A){return d.point(A[0],A[1],g)}a(w,"N");var E=f[2];return m.precomputed={beta:null,doubles:E.doubles&&{step:E.doubles.step,points:[m].concat(E.doubles.points.map(w))},naf:E.naf&&{wnd:E.naf.wnd,points:[m].concat(E.naf.points.map(w))}},m},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(d){if(this.inf)return d;if(d.inf)return this;if(this.eq(d))return this.dbl();if(this.neg().eq(d))return this.curve.point(null,null);if(this.x.cmp(d.x)===0)return this.curve.point(null,null);var f=this.y.redSub(d.y);f.cmpn(0)!==0&&(f=f.redMul(this.x.redSub(d.x).redInvm()));var g=f.redSqr().redISub(this.x).redISub(d.x),m=f.redMul(this.x.redSub(g)).redISub(this.y);return this.curve.point(g,m)},u.prototype.dbl=function(){if(this.inf)return this;var d=this.y.redAdd(this.y);if(d.cmpn(0)===0)return this.curve.point(null,null);var f=this.curve.a,g=this.x.redSqr(),m=d.redInvm(),w=g.redAdd(g).redIAdd(g).redIAdd(f).redMul(m),E=w.redSqr().redISub(this.x.redAdd(this.x)),A=w.redMul(this.x.redSub(E)).redISub(this.y);return this.curve.point(E,A)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(d){return d=new n(d,16),this.isInfinity()?this:this._hasDoubles(d)?this.curve._fixedNafMul(this,d):this.curve.endo?this.curve._endoWnafMulAdd([this],[d]):this.curve._wnafMul(this,d)},u.prototype.mulAdd=function(d,f,g){var m=[this,f],w=[d,g];return this.curve.endo?this.curve._endoWnafMulAdd(m,w):this.curve._wnafMulAdd(1,m,w,2)},u.prototype.jmulAdd=function(d,f,g){var m=[this,f],w=[d,g];return this.curve.endo?this.curve._endoWnafMulAdd(m,w,!0):this.curve._wnafMulAdd(1,m,w,2,!0)},u.prototype.eq=function(d){return this===d||this.inf===d.inf&&(this.inf||this.x.cmp(d.x)===0&&this.y.cmp(d.y)===0)},u.prototype.neg=function(d){if(this.inf)return this;var f=this.curve.point(this.x,this.y.redNeg());if(d&&this.precomputed){var g=this.precomputed,m=a(function(w){return w.neg()},"M");f.precomputed={naf:g.naf&&{wnd:g.naf.wnd,points:g.naf.points.map(m)},doubles:g.doubles&&{step:g.doubles.step,points:g.doubles.points.map(m)}}}return f},u.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var d=this.curve.jpoint(this.x,this.y,this.curve.one);return d};function c(d,f,g,m){s.BasePoint.call(this,d,"jacobian"),f===null&&g===null&&m===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(f,16),this.y=new n(g,16),this.z=new n(m,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}a(c,"T"),i(c,s.BasePoint),l.prototype.jpoint=function(d,f,g){return new c(this,d,f,g)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var d=this.z.redInvm(),f=d.redSqr(),g=this.x.redMul(f),m=this.y.redMul(f).redMul(d);return this.curve.point(g,m)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(d){if(this.isInfinity())return d;if(d.isInfinity())return this;var f=d.z.redSqr(),g=this.z.redSqr(),m=this.x.redMul(f),w=d.x.redMul(g),E=this.y.redMul(f.redMul(d.z)),A=d.y.redMul(g.redMul(this.z)),C=m.redSub(w),O=E.redSub(A);if(C.cmpn(0)===0)return O.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var R=C.redSqr(),P=R.redMul(C),L=m.redMul(R),j=O.redSqr().redIAdd(P).redISub(L).redISub(L),G=O.redMul(L.redISub(j)).redISub(E.redMul(P)),Z=this.z.redMul(d.z).redMul(C);return this.curve.jpoint(j,G,Z)},c.prototype.mixedAdd=function(d){if(this.isInfinity())return d.toJ();if(d.isInfinity())return this;var f=this.z.redSqr(),g=this.x,m=d.x.redMul(f),w=this.y,E=d.y.redMul(f).redMul(this.z),A=g.redSub(m),C=w.redSub(E);if(A.cmpn(0)===0)return C.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var O=A.redSqr(),R=O.redMul(A),P=g.redMul(O),L=C.redSqr().redIAdd(R).redISub(P).redISub(P),j=C.redMul(P.redISub(L)).redISub(w.redMul(R)),G=this.z.redMul(A);return this.curve.jpoint(L,j,G)},c.prototype.dblp=function(d){if(d===0)return this;if(this.isInfinity())return this;if(!d)return this.dbl();var f;if(this.curve.zeroA||this.curve.threeA){var g=this;for(f=0;f<d;f++)g=g.dbl();return g}var m=this.curve.a,w=this.curve.tinv,E=this.x,A=this.y,C=this.z,O=C.redSqr().redSqr(),R=A.redAdd(A);for(f=0;f<d;f++){var P=E.redSqr(),L=R.redSqr(),j=L.redSqr(),G=P.redAdd(P).redIAdd(P).redIAdd(m.redMul(O)),Z=E.redMul(L),K=G.redSqr().redISub(Z.redAdd(Z)),z=Z.redISub(K),V=G.redMul(z);V=V.redIAdd(V).redISub(j);var h=R.redMul(C);f+1<d&&(O=O.redMul(j)),E=K,C=h,R=V}return this.curve.jpoint(E,R.redMul(w),C)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var d,f,g;if(this.zOne){var m=this.x.redSqr(),w=this.y.redSqr(),E=w.redSqr(),A=this.x.redAdd(w).redSqr().redISub(m).redISub(E);A=A.redIAdd(A);var C=m.redAdd(m).redIAdd(m),O=C.redSqr().redISub(A).redISub(A),R=E.redIAdd(E);R=R.redIAdd(R),R=R.redIAdd(R),d=O,f=C.redMul(A.redISub(O)).redISub(R),g=this.y.redAdd(this.y)}else{var P=this.x.redSqr(),L=this.y.redSqr(),j=L.redSqr(),G=this.x.redAdd(L).redSqr().redISub(P).redISub(j);G=G.redIAdd(G);var Z=P.redAdd(P).redIAdd(P),K=Z.redSqr(),z=j.redIAdd(j);z=z.redIAdd(z),z=z.redIAdd(z),d=K.redISub(G).redISub(G),f=Z.redMul(G.redISub(d)).redISub(z),g=this.y.redMul(this.z),g=g.redIAdd(g)}return this.curve.jpoint(d,f,g)},c.prototype._threeDbl=function(){var d,f,g;if(this.zOne){var m=this.x.redSqr(),w=this.y.redSqr(),E=w.redSqr(),A=this.x.redAdd(w).redSqr().redISub(m).redISub(E);A=A.redIAdd(A);var C=m.redAdd(m).redIAdd(m).redIAdd(this.curve.a),O=C.redSqr().redISub(A).redISub(A);d=O;var R=E.redIAdd(E);R=R.redIAdd(R),R=R.redIAdd(R),f=C.redMul(A.redISub(O)).redISub(R),g=this.y.redAdd(this.y)}else{var P=this.z.redSqr(),L=this.y.redSqr(),j=this.x.redMul(L),G=this.x.redSub(P).redMul(this.x.redAdd(P));G=G.redAdd(G).redIAdd(G);var Z=j.redIAdd(j);Z=Z.redIAdd(Z);var K=Z.redAdd(Z);d=G.redSqr().redISub(K),g=this.y.redAdd(this.z).redSqr().redISub(L).redISub(P);var z=L.redSqr();z=z.redIAdd(z),z=z.redIAdd(z),z=z.redIAdd(z),f=G.redMul(Z.redISub(d)).redISub(z)}return this.curve.jpoint(d,f,g)},c.prototype._dbl=function(){var d=this.curve.a,f=this.x,g=this.y,m=this.z,w=m.redSqr().redSqr(),E=f.redSqr(),A=g.redSqr(),C=E.redAdd(E).redIAdd(E).redIAdd(d.redMul(w)),O=f.redAdd(f);O=O.redIAdd(O);var R=O.redMul(A),P=C.redSqr().redISub(R.redAdd(R)),L=R.redISub(P),j=A.redSqr();j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var G=C.redMul(L).redISub(j),Z=g.redAdd(g).redMul(m);return this.curve.jpoint(P,G,Z)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var d=this.x.redSqr(),f=this.y.redSqr(),g=this.z.redSqr(),m=f.redSqr(),w=d.redAdd(d).redIAdd(d),E=w.redSqr(),A=this.x.redAdd(f).redSqr().redISub(d).redISub(m);A=A.redIAdd(A),A=A.redAdd(A).redIAdd(A),A=A.redISub(E);var C=A.redSqr(),O=m.redIAdd(m);O=O.redIAdd(O),O=O.redIAdd(O),O=O.redIAdd(O);var R=w.redIAdd(A).redSqr().redISub(E).redISub(C).redISub(O),P=f.redMul(R);P=P.redIAdd(P),P=P.redIAdd(P);var L=this.x.redMul(C).redISub(P);L=L.redIAdd(L),L=L.redIAdd(L);var j=this.y.redMul(R.redMul(O.redISub(R)).redISub(A.redMul(C)));j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var G=this.z.redAdd(A).redSqr().redISub(g).redISub(C);return this.curve.jpoint(L,j,G)},c.prototype.mul=function(d,f){return d=new n(d,f),this.curve._wnafMul(this,d)},c.prototype.eq=function(d){if(d.type==="affine")return this.eq(d.toJ());if(this===d)return!0;var f=this.z.redSqr(),g=d.z.redSqr();if(this.x.redMul(g).redISub(d.x.redMul(f)).cmpn(0)!==0)return!1;var m=f.redMul(this.z),w=g.redMul(d.z);return this.y.redMul(w).redISub(d.y.redMul(m)).cmpn(0)===0},c.prototype.eqXToP=function(d){var f=this.z.redSqr(),g=d.toRed(this.curve.red).redMul(f);if(this.x.cmp(g)===0)return!0;for(var m=d.clone(),w=this.curve.redN.redMul(f);;){if(m.iadd(this.curve.n),m.cmp(this.curve.p)>=0)return!1;if(g.redIAdd(w),this.x.cmp(g)===0)return!0}},c.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),xE=Qe((e,t)=>{var r=qi(),n=Mn(),i=eu(),s=Vn();function o(u){i.call(this,"mont",u),this.a=new r(u.a,16).toRed(this.red),this.b=new r(u.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(o,"Y"),n(o,i),t.exports=o,o.prototype.validate=function(u){var c=u.normalize().x,d=c.redSqr(),f=d.redMul(c).redAdd(d.redMul(this.a)).redAdd(c),g=f.redSqrt();return g.redSqr().cmp(f)===0};function l(u,c,d){i.BasePoint.call(this,u,"projective"),c===null&&d===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(c,16),this.z=new r(d,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(l,"v"),n(l,i.BasePoint),o.prototype.decodePoint=function(u,c){return this.point(s.toArray(u,c),1)},o.prototype.point=function(u,c){return new l(this,u,c)},o.prototype.pointFromJSON=function(u){return l.fromJSON(this,u)},l.prototype.precompute=function(){},l.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},l.fromJSON=function(u,c){return new l(u,c[0],c[1]||u.one)},l.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},l.prototype.isInfinity=function(){return this.z.cmpn(0)===0},l.prototype.dbl=function(){var u=this.x.redAdd(this.z),c=u.redSqr(),d=this.x.redSub(this.z),f=d.redSqr(),g=c.redSub(f),m=c.redMul(f),w=g.redMul(f.redAdd(this.curve.a24.redMul(g)));return this.curve.point(m,w)},l.prototype.add=function(){throw Error("Not supported on Montgomery curve")},l.prototype.diffAdd=function(u,c){var d=this.x.redAdd(this.z),f=this.x.redSub(this.z),g=u.x.redAdd(u.z),m=u.x.redSub(u.z),w=m.redMul(d),E=g.redMul(f),A=c.z.redMul(w.redAdd(E).redSqr()),C=c.x.redMul(w.redISub(E).redSqr());return this.curve.point(A,C)},l.prototype.mul=function(u){for(var c=u.clone(),d=this,f=this.curve.point(null,null),g=this,m=[];c.cmpn(0)!==0;c.iushrn(1))m.push(c.andln(1));for(var w=m.length-1;w>=0;w--)m[w]===0?(d=d.diffAdd(f,g),f=f.dbl()):(f=d.diffAdd(f,g),d=d.dbl());return f},l.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},l.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},l.prototype.eq=function(u){return this.getX().cmp(u.getX())===0},l.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),_E=Qe((e,t)=>{var r=Vn(),n=qi(),i=Mn(),s=eu(),o=r.assert;function l(c){this.twisted=(c.a|0)!==1,this.mOneA=this.twisted&&(c.a|0)===-1,this.extended=this.mOneA,s.call(this,"edwards",c),this.a=new n(c.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(c.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(c.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(c.c|0)===1}a(l,"v"),i(l,s),t.exports=l,l.prototype._mulA=function(c){return this.mOneA?c.redNeg():this.a.redMul(c)},l.prototype._mulC=function(c){return this.oneC?c:this.c.redMul(c)},l.prototype.jpoint=function(c,d,f,g){return this.point(c,d,f,g)},l.prototype.pointFromX=function(c,d){c=new n(c,16),!c.red&&(c=c.toRed(this.red));var f=c.redSqr(),g=this.c2.redSub(this.a.redMul(f)),m=this.one.redSub(this.c2.redMul(this.d).redMul(f)),w=g.redMul(m.redInvm()),E=w.redSqrt();if(E.redSqr().redSub(w).cmp(this.zero)!==0)throw Error("invalid point");var A=E.fromRed().isOdd();return(d&&!A||!d&&A)&&(E=E.redNeg()),this.point(c,E)},l.prototype.pointFromY=function(c,d){c=new n(c,16),!c.red&&(c=c.toRed(this.red));var f=c.redSqr(),g=f.redSub(this.c2),m=f.redMul(this.d).redMul(this.c2).redSub(this.a),w=g.redMul(m.redInvm());if(w.cmp(this.zero)===0){if(d)throw Error("invalid point");return this.point(this.zero,c)}var E=w.redSqrt();if(E.redSqr().redSub(w).cmp(this.zero)!==0)throw Error("invalid point");return E.fromRed().isOdd()!==d&&(E=E.redNeg()),this.point(E,c)},l.prototype.validate=function(c){if(c.isInfinity())return!0;c.normalize();var d=c.x.redSqr(),f=c.y.redSqr(),g=d.redMul(this.a).redAdd(f),m=this.c2.redMul(this.one.redAdd(this.d.redMul(d).redMul(f)));return g.cmp(m)===0};function u(c,d,f,g,m){s.BasePoint.call(this,c,"projective"),d===null&&f===null&&g===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(d,16),this.y=new n(f,16),this.z=g?new n(g,16):this.curve.one,this.t=m&&new n(m,16),!this.x.red&&(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),!this.zOne&&(this.t=this.t.redMul(this.z.redInvm()))))}a(u,"W"),i(u,s.BasePoint),l.prototype.pointFromJSON=function(c){return u.fromJSON(this,c)},l.prototype.point=function(c,d,f,g){return new u(this,c,d,f,g)},u.fromJSON=function(c,d){return new u(c,d[0],d[1],d[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},u.prototype._extDbl=function(){var c=this.x.redSqr(),d=this.y.redSqr(),f=this.z.redSqr();f=f.redIAdd(f);var g=this.curve._mulA(c),m=this.x.redAdd(this.y).redSqr().redISub(c).redISub(d),w=g.redAdd(d),E=w.redSub(f),A=g.redSub(d),C=m.redMul(E),O=w.redMul(A),R=m.redMul(A),P=E.redMul(w);return this.curve.point(C,O,P,R)},u.prototype._projDbl=function(){var c=this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),f=this.y.redSqr(),g,m,w,E,A,C;if(this.curve.twisted){E=this.curve._mulA(d);var O=E.redAdd(f);this.zOne?(g=c.redSub(d).redSub(f).redMul(O.redSub(this.curve.two)),m=O.redMul(E.redSub(f)),w=O.redSqr().redSub(O).redSub(O)):(A=this.z.redSqr(),C=O.redSub(A).redISub(A),g=c.redSub(d).redISub(f).redMul(C),m=O.redMul(E.redSub(f)),w=O.redMul(C))}else E=d.redAdd(f),A=this.curve._mulC(this.z).redSqr(),C=E.redSub(A).redSub(A),g=this.curve._mulC(c.redISub(E)).redMul(C),m=this.curve._mulC(E).redMul(d.redISub(f)),w=E.redMul(C);return this.curve.point(g,m,w)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(c){var d=this.y.redSub(this.x).redMul(c.y.redSub(c.x)),f=this.y.redAdd(this.x).redMul(c.y.redAdd(c.x)),g=this.t.redMul(this.curve.dd).redMul(c.t),m=this.z.redMul(c.z.redAdd(c.z)),w=f.redSub(d),E=m.redSub(g),A=m.redAdd(g),C=f.redAdd(d),O=w.redMul(E),R=A.redMul(C),P=w.redMul(C),L=E.redMul(A);return this.curve.point(O,R,L,P)},u.prototype._projAdd=function(c){var d=this.z.redMul(c.z),f=d.redSqr(),g=this.x.redMul(c.x),m=this.y.redMul(c.y),w=this.curve.d.redMul(g).redMul(m),E=f.redSub(w),A=f.redAdd(w),C=this.x.redAdd(this.y).redMul(c.x.redAdd(c.y)).redISub(g).redISub(m),O=d.redMul(E).redMul(C),R,P;return this.curve.twisted?(R=d.redMul(A).redMul(m.redSub(this.curve._mulA(g))),P=E.redMul(A)):(R=d.redMul(A).redMul(m.redSub(g)),P=this.curve._mulC(E).redMul(A)),this.curve.point(O,R,P)},u.prototype.add=function(c){return this.isInfinity()?c:c.isInfinity()?this:this.curve.extended?this._extAdd(c):this._projAdd(c)},u.prototype.mul=function(c){return this._hasDoubles(c)?this.curve._fixedNafMul(this,c):this.curve._wnafMul(this,c)},u.prototype.mulAdd=function(c,d,f){return this.curve._wnafMulAdd(1,[this,d],[c,f],2,!1)},u.prototype.jmulAdd=function(c,d,f){return this.curve._wnafMulAdd(1,[this,d],[c,f],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var c=this.z.redInvm();return this.x=this.x.redMul(c),this.y=this.y.redMul(c),this.t&&(this.t=this.t.redMul(c)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(c){return this===c||this.getX().cmp(c.getX())===0&&this.getY().cmp(c.getY())===0},u.prototype.eqXToP=function(c){var d=c.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(d)===0)return!0;for(var f=c.clone(),g=this.curve.redN.redMul(this.z);;){if(f.iadd(this.curve.n),f.cmp(this.curve.p)>=0)return!1;if(d.redIAdd(g),this.x.cmp(d)===0)return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add}),H0=Qe(e=>{var t=e;t.base=eu(),t.short=wE(),t.mont=xE(),t.edwards=_E()}),wi=Qe(e=>{var t=ka(),r=Mn();e.inherits=r;function n(y,b){return(y.charCodeAt(b)&64512)!==55296||b<0||b+1>=y.length?!1:(y.charCodeAt(b+1)&64512)===56320}a(n,"P");function i(y,b){if(Array.isArray(y))return y.slice();if(!y)return[];var x=[];if(typeof y=="string")if(b){if(b==="hex")for(y=y.replace(/[^a-z0-9]+/ig,""),y.length%2!==0&&(y="0"+y),N=0;N<y.length;N+=2)x.push(parseInt(y[N]+y[N+1],16))}else for(var _=0,N=0;N<y.length;N++){var T=y.charCodeAt(N);T<128?x[_++]=T:T<2048?(x[_++]=T>>6|192,x[_++]=T&63|128):n(y,N)?(T=65536+((T&1023)<<10)+(y.charCodeAt(++N)&1023),x[_++]=T>>18|240,x[_++]=T>>12&63|128,x[_++]=T>>6&63|128,x[_++]=T&63|128):(x[_++]=T>>12|224,x[_++]=T>>6&63|128,x[_++]=T&63|128)}else for(N=0;N<y.length;N++)x[N]=y[N]|0;return x}a(i,"K"),e.toArray=i;function s(y){for(var b="",x=0;x<y.length;x++)b+=u(y[x].toString(16));return b}a(s,"O"),e.toHex=s;function o(y){var b=y>>>24|y>>>8&65280|y<<8&16711680|(y&255)<<24;return b>>>0}a(o,"Y"),e.htonl=o;function l(y,b){for(var x="",_=0;_<y.length;_++){var N=y[_];b==="little"&&(N=o(N)),x+=c(N.toString(16))}return x}a(l,"v"),e.toHex32=l;function u(y){return y.length===1?"0"+y:y}a(u,"W"),e.zero2=u;function c(y){return y.length===7?"0"+y:y.length===6?"00"+y:y.length===5?"000"+y:y.length===4?"0000"+y:y.length===3?"00000"+y:y.length===2?"000000"+y:y.length===1?"0000000"+y:y}a(c,"T"),e.zero8=c;function d(y,b,x,_){var N=x-b;t(N%4===0);for(var T=Array(N/4),k=0,p=b;k<T.length;k++,p+=4){var S;_==="big"?S=y[p]<<24|y[p+1]<<16|y[p+2]<<8|y[p+3]:S=y[p+3]<<24|y[p+2]<<16|y[p+1]<<8|y[p],T[k]=S>>>0}return T}a(d,"Z"),e.join32=d;function f(y,b){for(var x=Array(y.length*4),_=0,N=0;_<y.length;_++,N+=4){var T=y[_];b==="big"?(x[N]=T>>>24,x[N+1]=T>>>16&255,x[N+2]=T>>>8&255,x[N+3]=T&255):(x[N+3]=T>>>24,x[N+2]=T>>>16&255,x[N+1]=T>>>8&255,x[N]=T&255)}return x}a(f,"w"),e.split32=f;function g(y,b){return y>>>b|y<<32-b}a(g,"k"),e.rotr32=g;function m(y,b){return y<<b|y>>>32-b}a(m,"M"),e.rotl32=m;function w(y,b){return y+b>>>0}a(w,"N"),e.sum32=w;function E(y,b,x){return y+b+x>>>0}a(E,"R"),e.sum32_3=E;function A(y,b,x,_){return y+b+x+_>>>0}a(A,"E"),e.sum32_4=A;function C(y,b,x,_,N){return y+b+x+_+N>>>0}a(C,"D"),e.sum32_5=C;function O(y,b,x,_){var N=y[b],T=y[b+1],k=_+T>>>0,p=(k<_?1:0)+x+N;y[b]=p>>>0,y[b+1]=k}a(O,"h"),e.sum64=O;function R(y,b,x,_){var N=b+_>>>0,T=(N<b?1:0)+y+x;return T>>>0}a(R,"L"),e.sum64_hi=R;function P(y,b,x,_){var N=b+_;return N>>>0}a(P,"b"),e.sum64_lo=P;function L(y,b,x,_,N,T,k,p){var S=0,I=b;I=I+_>>>0,S+=I<b?1:0,I=I+T>>>0,S+=I<T?1:0,I=I+p>>>0,S+=I<p?1:0;var M=y+x+N+k+S;return M>>>0}a(L,"y"),e.sum64_4_hi=L;function j(y,b,x,_,N,T,k,p){var S=b+_+T+p;return S>>>0}a(j,"p"),e.sum64_4_lo=j;function G(y,b,x,_,N,T,k,p,S,I){var M=0,U=b;U=U+_>>>0,M+=U<b?1:0,U=U+T>>>0,M+=U<T?1:0,U=U+p>>>0,M+=U<p?1:0,U=U+I>>>0,M+=U<I?1:0;var B=y+x+N+k+S+M;return B>>>0}a(G,"i"),e.sum64_5_hi=G;function Z(y,b,x,_,N,T,k,p,S,I){var M=b+_+T+p+I;return M>>>0}a(Z,"$$"),e.sum64_5_lo=Z;function K(y,b,x){var _=b<<32-x|y>>>x;return _>>>0}a(K,"Q"),e.rotr64_hi=K;function z(y,b,x){var _=y<<32-x|b>>>x;return _>>>0}a(z,"c"),e.rotr64_lo=z;function V(y,b,x){return y>>>x}a(V,"a"),e.shr64_hi=V;function h(y,b,x){var _=y<<32-x|b>>>x;return _>>>0}a(h,"j"),e.shr64_lo=h}),Wo=Qe(e=>{var t=wi(),r=ka();function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}a(n,"P"),e.BlockHash=n,n.prototype.update=function(i,s){if(i=t.toArray(i,s),this.pending?this.pending=this.pending.concat(i):this.pending=i,this.pendingTotal+=i.length,this.pending.length>=this._delta8){i=this.pending;var o=i.length%this._delta8;this.pending=i.slice(i.length-o,i.length),this.pending.length===0&&(this.pending=null),i=t.join32(i,0,i.length-o,this.endian);for(var l=0;l<i.length;l+=this._delta32)this._update(i,l,l+this._delta32)}return this},n.prototype.digest=function(i){return this.update(this._pad()),r(this.pending===null),this._digest(i)},n.prototype._pad=function(){var i=this.pendingTotal,s=this._delta8,o=s-(i+this.padLength)%s,l=Array(o+this.padLength);l[0]=128;for(var u=1;u<o;u++)l[u]=0;if(i<<=3,this.endian==="big"){for(var c=8;c<this.padLength;c++)l[u++]=0;l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=i>>>24&255,l[u++]=i>>>16&255,l[u++]=i>>>8&255,l[u++]=i&255}else for(l[u++]=i&255,l[u++]=i>>>8&255,l[u++]=i>>>16&255,l[u++]=i>>>24&255,l[u++]=0,l[u++]=0,l[u++]=0,l[u++]=0,c=8;c<this.padLength;c++)l[u++]=0;return l}}),Z0=Qe(e=>{var t=wi(),r=t.rotr32;function n(f,g,m,w){if(f===0)return i(g,m,w);if(f===1||f===3)return o(g,m,w);if(f===2)return s(g,m,w)}a(n,"P"),e.ft_1=n;function i(f,g,m){return f&g^~f&m}a(i,"K"),e.ch32=i;function s(f,g,m){return f&g^f&m^g&m}a(s,"O"),e.maj32=s;function o(f,g,m){return f^g^m}a(o,"Y"),e.p32=o;function l(f){return r(f,2)^r(f,13)^r(f,22)}a(l,"v"),e.s0_256=l;function u(f){return r(f,6)^r(f,11)^r(f,25)}a(u,"W"),e.s1_256=u;function c(f){return r(f,7)^r(f,18)^f>>>3}a(c,"T"),e.g0_256=c;function d(f){return r(f,17)^r(f,19)^f>>>10}a(d,"Z"),e.g1_256=d}),EE=Qe((e,t)=>{var r=wi(),n=Wo(),i=Z0(),s=r.rotl32,o=r.sum32,l=r.sum32_5,u=i.ft_1,c=n.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}a(f,"w"),r.inherits(f,c),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(g,m){for(var w=this.W,E=0;E<16;E++)w[E]=g[m+E];for(;E<w.length;E++)w[E]=s(w[E-3]^w[E-8]^w[E-14]^w[E-16],1);var A=this.h[0],C=this.h[1],O=this.h[2],R=this.h[3],P=this.h[4];for(E=0;E<w.length;E++){var L=~~(E/20),j=l(s(A,5),u(L,C,O,R),P,w[E],d[L]);P=R,R=O,O=s(C,30),C=A,A=j}this.h[0]=o(this.h[0],A),this.h[1]=o(this.h[1],C),this.h[2]=o(this.h[2],O),this.h[3]=o(this.h[3],R),this.h[4]=o(this.h[4],P)},f.prototype._digest=function(g){return g==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")}}),G0=Qe((e,t)=>{var r=wi(),n=Wo(),i=Z0(),s=ka(),o=r.sum32,l=r.sum32_4,u=r.sum32_5,c=i.ch32,d=i.maj32,f=i.s0_256,g=i.s1_256,m=i.g0_256,w=i.g1_256,E=n.BlockHash,A=[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];function C(){if(!(this instanceof C))return new C;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=A,this.W=Array(64)}a(C,"D"),r.inherits(C,E),t.exports=C,C.blockSize=512,C.outSize=256,C.hmacStrength=192,C.padLength=64,C.prototype._update=function(O,R){for(var P=this.W,L=0;L<16;L++)P[L]=O[R+L];for(;L<P.length;L++)P[L]=l(w(P[L-2]),P[L-7],m(P[L-15]),P[L-16]);var j=this.h[0],G=this.h[1],Z=this.h[2],K=this.h[3],z=this.h[4],V=this.h[5],h=this.h[6],y=this.h[7];for(s(this.k.length===P.length),L=0;L<P.length;L++){var b=u(y,g(z),c(z,V,h),this.k[L],P[L]),x=o(f(j),d(j,G,Z));y=h,h=V,V=z,z=o(K,b),K=Z,Z=G,G=j,j=o(b,x)}this.h[0]=o(this.h[0],j),this.h[1]=o(this.h[1],G),this.h[2]=o(this.h[2],Z),this.h[3]=o(this.h[3],K),this.h[4]=o(this.h[4],z),this.h[5]=o(this.h[5],V),this.h[6]=o(this.h[6],h),this.h[7]=o(this.h[7],y)},C.prototype._digest=function(O){return O==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")}}),SE=Qe((e,t)=>{var r=wi(),n=G0();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}a(i,"K"),r.inherits(i,n),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}}),V0=Qe((e,t)=>{var r=wi(),n=Wo(),i=ka(),s=r.rotr64_hi,o=r.rotr64_lo,l=r.shr64_hi,u=r.shr64_lo,c=r.sum64,d=r.sum64_hi,f=r.sum64_lo,g=r.sum64_4_hi,m=r.sum64_4_lo,w=r.sum64_5_hi,E=r.sum64_5_lo,A=n.BlockHash,C=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function O(){if(!(this instanceof O))return new O;A.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=C,this.W=Array(160)}a(O,"h"),r.inherits(O,A),t.exports=O,O.blockSize=1024,O.outSize=512,O.hmacStrength=192,O.padLength=128,O.prototype._prepareBlock=function(x,_){for(var N=this.W,T=0;T<32;T++)N[T]=x[_+T];for(;T<N.length;T+=2){var k=y(N[T-4],N[T-3]),p=b(N[T-4],N[T-3]),S=N[T-14],I=N[T-13],M=V(N[T-30],N[T-29]),U=h(N[T-30],N[T-29]),B=N[T-32],H=N[T-31];N[T]=g(k,p,S,I,M,U,B,H),N[T+1]=m(k,p,S,I,M,U,B,H)}},O.prototype._update=function(x,_){this._prepareBlock(x,_);var N=this.W,T=this.h[0],k=this.h[1],p=this.h[2],S=this.h[3],I=this.h[4],M=this.h[5],U=this.h[6],B=this.h[7],H=this.h[8],$=this.h[9],ae=this.h[10],ie=this.h[11],ne=this.h[12],Ne=this.h[13],ve=this.h[14],he=this.h[15];i(this.k.length===N.length);for(var Se=0;Se<N.length;Se+=2){var Q=ve,se=he,J=K(H,$),te=z(H,$),de=R(H,$,ae,ie,ne),be=P(H,$,ae,ie,ne,Ne),Ae=this.k[Se],oe=this.k[Se+1],Y=N[Se],ee=N[Se+1],X=w(Q,se,J,te,de,be,Ae,oe,Y,ee),W=E(Q,se,J,te,de,be,Ae,oe,Y,ee);Q=G(T,k),se=Z(T,k),J=L(T,k,p,S,I),te=j(T,k,p,S,I,M);var q=d(Q,se,J,te),re=f(Q,se,J,te);ve=ne,he=Ne,ne=ae,Ne=ie,ae=H,ie=$,H=d(U,B,X,W),$=f(B,B,X,W),U=I,B=M,I=p,M=S,p=T,S=k,T=d(X,W,q,re),k=f(X,W,q,re)}c(this.h,0,T,k),c(this.h,2,p,S),c(this.h,4,I,M),c(this.h,6,U,B),c(this.h,8,H,$),c(this.h,10,ae,ie),c(this.h,12,ne,Ne),c(this.h,14,ve,he)},O.prototype._digest=function(x){return x==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")};function R(x,_,N,T,k){var p=x&N^~x&k;return p<0&&(p+=4294967296),p}a(R,"L");function P(x,_,N,T,k,p){var S=_&T^~_&p;return S<0&&(S+=4294967296),S}a(P,"b");function L(x,_,N,T,k){var p=x&N^x&k^N&k;return p<0&&(p+=4294967296),p}a(L,"y");function j(x,_,N,T,k,p){var S=_&T^_&p^T&p;return S<0&&(S+=4294967296),S}a(j,"p");function G(x,_){var N=s(x,_,28),T=s(_,x,2),k=s(_,x,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(G,"i");function Z(x,_){var N=o(x,_,28),T=o(_,x,2),k=o(_,x,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(Z,"$$");function K(x,_){var N=s(x,_,14),T=s(x,_,18),k=s(_,x,9),p=N^T^k;return p<0&&(p+=4294967296),p}a(K,"Q");function z(x,_){var N=o(x,_,14),T=o(x,_,18),k=o(_,x,9),p=N^T^k;return p<0&&(p+=4294967296),p}a(z,"c");function V(x,_){var N=s(x,_,1),T=s(x,_,8),k=l(x,_,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(V,"a");function h(x,_){var N=o(x,_,1),T=o(x,_,8),k=u(x,_,7),p=N^T^k;return p<0&&(p+=4294967296),p}a(h,"j");function y(x,_){var N=s(x,_,19),T=s(_,x,29),k=l(x,_,6),p=N^T^k;return p<0&&(p+=4294967296),p}a(y,"J");function b(x,_){var N=o(x,_,19),T=o(_,x,29),k=u(x,_,6),p=N^T^k;return p<0&&(p+=4294967296),p}a(b,"X")}),kE=Qe((e,t)=>{var r=wi(),n=V0();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}a(i,"K"),r.inherits(i,n),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(s){return s==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}}),AE=Qe(e=>{e.sha1=EE(),e.sha224=SE(),e.sha256=G0(),e.sha384=kE(),e.sha512=V0()}),TE=Qe(e=>{var t=wi(),r=Wo(),n=t.rotl32,i=t.sum32,s=t.sum32_3,o=t.sum32_4,l=r.BlockHash;function u(){if(!(this instanceof u))return new u;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}a(u,"W"),t.inherits(u,l),e.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(A,C){for(var O=this.h[0],R=this.h[1],P=this.h[2],L=this.h[3],j=this.h[4],G=O,Z=R,K=P,z=L,V=j,h=0;h<80;h++){var y=i(n(o(O,c(h,R,P,L),A[g[h]+C],d(h)),w[h]),j);O=j,j=L,L=n(P,10),P=R,R=y,y=i(n(o(G,c(79-h,Z,K,z),A[m[h]+C],f(h)),E[h]),V),G=V,V=z,z=n(K,10),K=Z,Z=y}y=s(this.h[1],P,z),this.h[1]=s(this.h[2],L,V),this.h[2]=s(this.h[3],j,G),this.h[3]=s(this.h[4],O,Z),this.h[4]=s(this.h[0],R,K),this.h[0]=y},u.prototype._digest=function(A){return A==="hex"?t.toHex32(this.h,"little"):t.split32(this.h,"little")};function c(A,C,O,R){return A<=15?C^O^R:A<=31?C&O|~C&R:A<=47?(C|~O)^R:A<=63?C&R|O&~R:C^(O|~R)}a(c,"T");function d(A){return A<=15?0:A<=31?1518500249:A<=47?1859775393:A<=63?2400959708:2840853838}a(d,"Z");function f(A){return A<=15?1352829926:A<=31?1548603684:A<=47?1836072691:A<=63?2053994217:0}a(f,"w");var g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],m=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],w=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],E=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),NE=Qe((e,t)=>{var r=wi(),n=ka();function i(s,o,l){if(!(this instanceof i))return new i(s,o,l);this.Hash=s,this.blockSize=s.blockSize/8,this.outSize=s.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(o,l))}a(i,"K"),t.exports=i,i.prototype._init=function(s){s.length>this.blockSize&&(s=new this.Hash().update(s).digest()),n(s.length<=this.blockSize);for(var o=s.length;o<this.blockSize;o++)s.push(0);for(o=0;o<s.length;o++)s[o]^=54;for(this.inner=new this.Hash().update(s),o=0;o<s.length;o++)s[o]^=106;this.outer=new this.Hash().update(s)},i.prototype.update=function(s,o){return this.inner.update(s,o),this},i.prototype.digest=function(s){return this.outer.update(this.inner.digest()),this.outer.digest(s)}}),qd=Qe(e=>{var t=e;t.utils=wi(),t.common=Wo(),t.sha=AE(),t.ripemd=TE(),t.hmac=NE(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}),IE=Qe((e,t)=>{t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),ef=Qe(e=>{var t=e,r=qd(),n=H0(),i=Vn(),s=i.assert;function o(c){c.type==="short"?this.curve=new n.short(c):c.type==="edwards"?this.curve=new n.edwards(c):this.curve=new n.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}a(o,"Y"),t.PresetCurve=o;function l(c,d){Object.defineProperty(t,c,{configurable:!0,enumerable:!0,get:a(function(){var f=new o(d);return Object.defineProperty(t,c,{configurable:!0,enumerable:!0,value:f}),f},"get")})}a(l,"v"),l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var u;try{u=IE()}catch{u=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",u]})}),CE=Qe((e,t)=>{var r=qd(),n=z0(),i=ka();function s(o){if(!(this instanceof s))return new s(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var l=n.toArray(o.entropy,o.entropyEnc||"hex"),u=n.toArray(o.nonce,o.nonceEnc||"hex"),c=n.toArray(o.pers,o.persEnc||"hex");i(l.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(l,u,c)}a(s,"O"),t.exports=s,s.prototype._init=function(o,l,u){var c=o.concat(l).concat(u);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var d=0;d<this.V.length;d++)this.K[d]=0,this.V[d]=1;this._update(c),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new r.hmac(this.hash,this.K)},s.prototype._update=function(o){var l=this._hmac().update(this.V).update([0]);o&&(l=l.update(o)),this.K=l.digest(),this.V=this._hmac().update(this.V).digest(),o&&(this.K=this._hmac().update(this.V).update([1]).update(o).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(o,l,u,c){typeof l!="string"&&(c=u,u=l,l=null),o=n.toArray(o,l),u=n.toArray(u,c),i(o.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(o.concat(u||[])),this._reseed=1},s.prototype.generate=function(o,l,u,c){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");typeof l!="string"&&(c=u,u=l,l=null),u&&(u=n.toArray(u,c||"hex"),this._update(u));for(var d=[];d.length<o;)this.V=this._hmac().update(this.V).digest(),d=d.concat(this.V);var f=d.slice(0,o);return this._update(u),this._reseed++,n.encode(f,l)}}),ME=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert;function s(o,l){this.ec=o,this.priv=null,this.pub=null,l.priv&&this._importPrivate(l.priv,l.privEnc),l.pub&&this._importPublic(l.pub,l.pubEnc)}a(s,"O"),t.exports=s,s.fromPublic=function(o,l,u){return l instanceof s?l:new s(o,{pub:l,pubEnc:u})},s.fromPrivate=function(o,l,u){return l instanceof s?l:new s(o,{priv:l,privEnc:u})},s.prototype.validate=function(){var o=this.getPublic();return o.isInfinity()?{result:!1,reason:"Invalid public key"}:o.validate()?o.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(o,l){return typeof o=="string"&&(l=o,o=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),l?this.pub.encode(l,o):this.pub},s.prototype.getPrivate=function(o){return o==="hex"?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(o,l){this.priv=new r(o,l||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(o,l){if(o.x||o.y){this.ec.curve.type==="mont"?i(o.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&i(o.x&&o.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(o.x,o.y);return}this.pub=this.ec.curve.decodePoint(o,l)},s.prototype.derive=function(o){return o.validate()||i(o.validate(),"public point not validated"),o.mul(this.priv).getX()},s.prototype.sign=function(o,l,u){return this.ec.sign(o,this,l,u)},s.prototype.verify=function(o,l,u){return this.ec.verify(o,l,this,void 0,u)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),OE=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert;function s(d,f){if(d instanceof s)return d;this._importDER(d,f)||(i(d.r&&d.s,"Signature without r or s"),this.r=new r(d.r,16),this.s=new r(d.s,16),d.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=d.recoveryParam)}a(s,"O"),t.exports=s;function o(){this.place=0}a(o,"Y");function l(d,f){var g=d[f.place++];if(!(g&128))return g;var m=g&15;if(m===0||m>4||d[f.place]===0)return!1;for(var w=0,E=0,A=f.place;E<m;E++,A++)w<<=8,w|=d[A],w>>>=0;return w<=127?!1:(f.place=A,w)}a(l,"v");function u(d){for(var f=0,g=d.length-1;!d[f]&&!(d[f+1]&128)&&f<g;)f++;return f===0?d:d.slice(f)}a(u,"W"),s.prototype._importDER=function(d,f){d=n.toArray(d,f);var g=new o;if(d[g.place++]!==48)return!1;var m=l(d,g);if(m===!1||m+g.place!==d.length||d[g.place++]!==2)return!1;var w=l(d,g);if(w===!1||(d[g.place]&128)!==0)return!1;var E=d.slice(g.place,w+g.place);if(g.place+=w,d[g.place++]!==2)return!1;var A=l(d,g);if(A===!1||d.length!==A+g.place||(d[g.place]&128)!==0)return!1;var C=d.slice(g.place,A+g.place);if(E[0]===0)if(E[1]&128)E=E.slice(1);else return!1;if(C[0]===0)if(C[1]&128)C=C.slice(1);else return!1;return this.r=new r(E),this.s=new r(C),this.recoveryParam=null,!0};function c(d,f){if(f<128){d.push(f);return}var g=1+(Math.log(f)/Math.LN2>>>3);for(d.push(g|128);--g;)d.push(f>>>(g<<3)&255);d.push(f)}a(c,"T"),s.prototype.toDER=function(d){var f=this.r.toArray(),g=this.s.toArray();for(f[0]&128&&(f=[0].concat(f)),g[0]&128&&(g=[0].concat(g)),f=u(f),g=u(g);!g[0]&&!(g[1]&128);)g=g.slice(1);var m=[2];c(m,f.length),m=m.concat(f),m.push(2),c(m,g.length);var w=m.concat(g),E=[48];return c(E,w.length),E=E.concat(w),n.encode(E,d)}}),RE=Qe((e,t)=>{var r=qi(),n=CE(),i=Vn(),s=ef(),o=F0(),l=i.assert,u=ME(),c=OE();function d(f){if(!(this instanceof d))return new d(f);typeof f=="string"&&(l(Object.prototype.hasOwnProperty.call(s,f),"Unknown curve "+f),f=s[f]),f instanceof s.PresetCurve&&(f={curve:f}),this.curve=f.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=f.curve.g,this.g.precompute(f.curve.n.bitLength()+1),this.hash=f.hash||f.curve.hash}a(d,"Z"),t.exports=d,d.prototype.keyPair=function(f){return new u(this,f)},d.prototype.keyFromPrivate=function(f,g){return u.fromPrivate(this,f,g)},d.prototype.keyFromPublic=function(f,g){return u.fromPublic(this,f,g)},d.prototype.genKeyPair=function(f){f||(f={});for(var g=new n({hash:this.hash,pers:f.pers,persEnc:f.persEnc||"utf8",entropy:f.entropy||o(this.hash.hmacStrength),entropyEnc:f.entropy&&f.entropyEnc||"utf8",nonce:this.n.toArray()}),m=this.n.byteLength(),w=this.n.sub(new r(2));;){var E=new r(g.generate(m));if(!(E.cmp(w)>0))return E.iaddn(1),this.keyFromPrivate(E)}},d.prototype._truncateToN=function(f,g,m){var w;if(r.isBN(f)||typeof f=="number")f=new r(f,16),w=f.byteLength();else if(typeof f=="object")w=f.length,f=new r(f,16);else{var E=f.toString();w=E.length+1>>>1,f=new r(E,16)}typeof m!="number"&&(m=w*8);var A=m-this.n.bitLength();return A>0&&(f=f.ushrn(A)),!g&&f.cmp(this.n)>=0?f.sub(this.n):f},d.prototype.sign=function(f,g,m,w){if(typeof m=="object"&&(w=m,m=null),w||(w={}),typeof f!="string"&&typeof f!="number"&&!r.isBN(f)){l(typeof f=="object"&&f&&typeof f.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),l(f.length>>>0===f.length);for(var E=0;E<f.length;E++)l((f[E]&255)===f[E])}g=this.keyFromPrivate(g,m),f=this._truncateToN(f,!1,w.msgBitLength),l(!f.isNeg(),"Can not sign a negative message");var A=this.n.byteLength(),C=g.getPrivate().toArray("be",A),O=f.toArray("be",A);l(new r(O).eq(f),"Can not sign message");for(var R=new n({hash:this.hash,entropy:C,nonce:O,pers:w.pers,persEnc:w.persEnc||"utf8"}),P=this.n.sub(new r(1)),L=0;;L++){var j=w.k?w.k(L):new r(R.generate(this.n.byteLength()));if(j=this._truncateToN(j,!0),!(j.cmpn(1)<=0||j.cmp(P)>=0)){var G=this.g.mul(j);if(!G.isInfinity()){var Z=G.getX(),K=Z.umod(this.n);if(K.cmpn(0)!==0){var z=j.invm(this.n).mul(K.mul(g.getPrivate()).iadd(f));if(z=z.umod(this.n),z.cmpn(0)!==0){var V=(G.getY().isOdd()?1:0)|(Z.cmp(K)!==0?2:0);return w.canonical&&z.cmp(this.nh)>0&&(z=this.n.sub(z),V^=1),new c({r:K,s:z,recoveryParam:V})}}}}}},d.prototype.verify=function(f,g,m,w,E){E||(E={}),f=this._truncateToN(f,!1,E.msgBitLength),m=this.keyFromPublic(m,w),g=new c(g,"hex");var{r:A,s:C}=g;if(A.cmpn(1)<0||A.cmp(this.n)>=0||C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;var O=C.invm(this.n),R=O.mul(f).umod(this.n),P=O.mul(A).umod(this.n),L;return this.curve._maxwellTrick?(L=this.g.jmulAdd(R,m.getPublic(),P),L.isInfinity()?!1:L.eqXToP(A)):(L=this.g.mulAdd(R,m.getPublic(),P),L.isInfinity()?!1:L.getX().umod(this.n).cmp(A)===0)},d.prototype.recoverPubKey=function(f,g,m,w){l((3&m)===m,"The recovery param is more than two bits"),g=new c(g,w);var E=this.n,A=new r(f),C=g.r,O=g.s,R=m&1,P=m>>1;if(C.cmp(this.curve.p.umod(this.curve.n))>=0&&P)throw Error("Unable to find sencond key candinate");P?C=this.curve.pointFromX(C.add(this.curve.n),R):C=this.curve.pointFromX(C,R);var L=g.r.invm(E),j=E.sub(A).mul(L).umod(E),G=O.mul(L).umod(E);return this.g.mulAdd(j,C,G)},d.prototype.getKeyRecoveryParam=function(f,g,m,w){if(g=new c(g,w),g.recoveryParam!==null)return g.recoveryParam;for(var E=0;E<4;E++){var A;try{A=this.recoverPubKey(f,g,E)}catch{continue}if(A.eq(m))return E}throw Error("Unable to find valid recovery factor")}}),PE=Qe((e,t)=>{var r=Vn(),n=r.assert,i=r.parseBytes,s=r.cachedProperty;function o(l,u){this.eddsa=l,this._secret=i(u.secret),l.isPoint(u.pub)?this._pub=u.pub:this._pubBytes=i(u.pub)}a(o,"Y"),o.fromPublic=function(l,u){return u instanceof o?u:new o(l,{pub:u})},o.fromSecret=function(l,u){return u instanceof o?u:new o(l,{secret:u})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(o,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(o,"privBytes",function(){var l=this.eddsa,u=this.hash(),c=l.encodingLength-1,d=u.slice(0,l.encodingLength);return d[0]&=248,d[c]&=127,d[c]|=64,d}),s(o,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(o,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(o,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),o.prototype.sign=function(l){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(l,this)},o.prototype.verify=function(l,u){return this.eddsa.verify(l,u,this)},o.prototype.getSecret=function(l){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),l)},o.prototype.getPublic=function(l){return r.encode(this.pubBytes(),l)},t.exports=o}),LE=Qe((e,t)=>{var r=qi(),n=Vn(),i=n.assert,s=n.cachedProperty,o=n.parseBytes;function l(u,c){this.eddsa=u,typeof c!="object"&&(c=o(c)),Array.isArray(c)&&(i(c.length===u.encodingLength*2,"Signature has invalid size"),c={R:c.slice(0,u.encodingLength),S:c.slice(u.encodingLength)}),i(c.R&&c.S,"Signature without R or S"),u.isPoint(c.R)&&(this._R=c.R),c.S instanceof r&&(this._S=c.S),this._Rencoded=Array.isArray(c.R)?c.R:c.Rencoded,this._Sencoded=Array.isArray(c.S)?c.S:c.Sencoded}a(l,"v"),s(l,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(l,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(l,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(l,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),l.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},l.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},t.exports=l}),DE=Qe((e,t)=>{var r=qd(),n=ef(),i=Vn(),s=i.assert,o=i.parseBytes,l=PE(),u=LE();function c(d){if(s(d==="ed25519","only tested with ed25519 so far"),!(this instanceof c))return new c(d);d=n[d].curve,this.curve=d,this.g=d.g,this.g.precompute(d.n.bitLength()+1),this.pointClass=d.point().constructor,this.encodingLength=Math.ceil(d.n.bitLength()/8),this.hash=r.sha512}a(c,"T"),t.exports=c,c.prototype.sign=function(d,f){d=o(d);var g=this.keyFromSecret(f),m=this.hashInt(g.messagePrefix(),d),w=this.g.mul(m),E=this.encodePoint(w),A=this.hashInt(E,g.pubBytes(),d).mul(g.priv()),C=m.add(A).umod(this.curve.n);return this.makeSignature({R:w,S:C,Rencoded:E})},c.prototype.verify=function(d,f,g){if(d=o(d),f=this.makeSignature(f),f.S().gte(f.eddsa.curve.n)||f.S().isNeg())return!1;var m=this.keyFromPublic(g),w=this.hashInt(f.Rencoded(),m.pubBytes(),d),E=this.g.mul(f.S()),A=f.R().add(m.pub().mul(w));return A.eq(E)},c.prototype.hashInt=function(){for(var d=this.hash(),f=0;f<arguments.length;f++)d.update(arguments[f]);return i.intFromLE(d.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(d){return l.fromPublic(this,d)},c.prototype.keyFromSecret=function(d){return l.fromSecret(this,d)},c.prototype.makeSignature=function(d){return d instanceof u?d:new u(this,d)},c.prototype.encodePoint=function(d){var f=d.getY().toArray("le",this.encodingLength);return f[this.encodingLength-1]|=d.getX().isOdd()?128:0,f},c.prototype.decodePoint=function(d){d=i.parseBytes(d);var f=d.length-1,g=d.slice(0,f).concat(d[f]&-129),m=(d[f]&128)!==0,w=i.intFromLE(g);return this.curve.pointFromY(w,m)},c.prototype.encodeInt=function(d){return d.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(d){return i.intFromLE(d)},c.prototype.isPoint=function(d){return d instanceof this.pointClass}}),jE=Qe(e=>{var t=e;t.version=vE().version,t.utils=Vn(),t.rand=F0(),t.curve=H0(),t.curves=ef(),t.ec=RE(),t.eddsa=DE()}),UE=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,xt=_[3]|0,Ve=xt&8191,Te=xt>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var Et=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=Et,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),BE=Qe((e,t)=>{var r=jE(),n=UE();t.exports=function(l){return new s(l)};var i={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};i.p224=i.secp224r1,i.p256=i.secp256r1=i.prime256v1,i.p192=i.secp192r1=i.prime192v1,i.p384=i.secp384r1,i.p521=i.secp521r1;function s(l){this.curveType=i[l],!this.curveType&&(this.curveType={name:l}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}a(s,"O"),s.prototype.generateKeys=function(l,u){return this.keys=this.curve.genKeyPair(),this.getPublicKey(l,u)},s.prototype.computeSecret=function(l,u,c){u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u));var d=this.curve.keyFromPublic(l).getPublic(),f=d.mul(this.keys.getPrivate()).getX();return o(f,c,this.curveType.byteLength)},s.prototype.getPublicKey=function(l,u){var c=this.keys.getPublic(u==="compressed",!0);return u==="hybrid"&&(c[c.length-1]%2?c[0]=7:c[0]=6),o(c,l)},s.prototype.getPrivateKey=function(l){return o(this.keys.getPrivate(),l)},s.prototype.setPublicKey=function(l,u){return u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u)),this.keys._importPublic(l),this},s.prototype.setPrivateKey=function(l,u){u=u||"utf8",!Buffer.isBuffer(l)&&(l=new Buffer(l,u));var c=new n(l);return c=c.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(c),this};function o(l,u,c){Array.isArray(l)||(l=l.toArray());var d=new Buffer(l);if(c&&d.length<c){var f=new Buffer(c-d.length);f.fill(0),d=Buffer.concat([f,d])}return u?d.toString(u):d}a(o,"Y")}),zE=Qe((e,t)=>{var r=(Qn(),qt(Ln)).createECDH;t.exports=r||BE()}),FE=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,xt=_[3]|0,Ve=xt&8191,Te=xt>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var Et=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=Et,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),HE=Qe(e=>{var t=Qo(),r=Mn(),n=e;n.define=function(s,o){return new i(s,o)};function i(s,o){this.name=s,this.body=o,this.decoders={},this.encoders={}}a(i,"K"),i.prototype._createNamed=function(s){var o;try{o=(()=>{throw new Error("Cannot require module vm")})().runInThisContext("(function "+this.name+`(entity) {
36
36
  this._initNamed(entity);
37
37
  })`)}catch{o=a(function(u){this._initNamed(u)},"Y")}return r(o,s),o.prototype._initNamed=function(l){s.call(this,l)},new o(this)},i.prototype._getDecoder=function(s){return s=s||"der",!this.decoders.hasOwnProperty(s)&&(this.decoders[s]=this._createNamed(t.decoders[s])),this.decoders[s]},i.prototype.decode=function(s,o,l){return this._getDecoder(o).decode(s,l)},i.prototype._getEncoder=function(s){return s=s||"der",!this.encoders.hasOwnProperty(s)&&(this.encoders[s]=this._createNamed(t.encoders[s])),this.encoders[s]},i.prototype.encode=function(s,o,l){return this._getEncoder(o).encode(s,l)}}),ZE=Qe(e=>{var t=Mn();function r(i){this._reporterState={obj:null,path:[],options:i||{},errors:[]}}a(r,"_"),e.Reporter=r,r.prototype.isError=function(i){return i instanceof n},r.prototype.save=function(){var i=this._reporterState;return{obj:i.obj,pathLen:i.path.length}},r.prototype.restore=function(i){var s=this._reporterState;s.obj=i.obj,s.path=s.path.slice(0,i.pathLen)},r.prototype.enterKey=function(i){return this._reporterState.path.push(i)},r.prototype.exitKey=function(i){var s=this._reporterState;s.path=s.path.slice(0,i-1)},r.prototype.leaveKey=function(i,s,o){var l=this._reporterState;this.exitKey(i),l.obj!==null&&(l.obj[s]=o)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var i=this._reporterState,s=i.obj;return i.obj={},s},r.prototype.leaveObject=function(i){var s=this._reporterState,o=s.obj;return s.obj=i,o},r.prototype.error=function(i){var s,o=this._reporterState,l=i instanceof n;if(l?s=i:s=new n(o.path.map(function(u){return"["+JSON.stringify(u)+"]"}).join(""),i.message||i,i.stack),!o.options.partial)throw s;return l||o.errors.push(s),s},r.prototype.wrapResult=function(i){var s=this._reporterState;return s.options.partial?{result:this.isError(i)?null:i,errors:s.errors}:i};function n(i,s){this.path=i,this.rethrow(s)}a(n,"P"),t(n,Error),n.prototype.rethrow=function(i){if(this.message=i+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,n),!this.stack)try{throw Error(this.message)}catch(s){this.stack=s.stack}return this}}),W0=Qe(e=>{var t=Mn(),r=Yo().Reporter,n=(ln(),qt(qr)).Buffer;function i(o,l){if(r.call(this,l),!n.isBuffer(o)){this.error("Input not Buffer");return}this.base=o,this.offset=0,this.length=o.length}a(i,"K"),t(i,r),e.DecoderBuffer=i,i.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},i.prototype.restore=function(o){var l=new i(this.base);return l.offset=o.offset,l.length=this.offset,this.offset=o.offset,r.prototype.restore.call(this,o.reporter),l},i.prototype.isEmpty=function(){return this.offset===this.length},i.prototype.readUInt8=function(o){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(o||"DecoderBuffer overrun")},i.prototype.skip=function(o,l){if(!(this.offset+o<=this.length))return this.error(l||"DecoderBuffer overrun");var u=new i(this.base);return u._reporterState=this._reporterState,u.offset=this.offset,u.length=this.offset+o,this.offset+=o,u},i.prototype.raw=function(o){return this.base.slice(o?o.offset:this.offset,this.length)};function s(o,l){if(Array.isArray(o))this.length=0,this.value=o.map(function(u){return u instanceof s||(u=new s(u,l)),this.length+=u.length,u},this);else if(typeof o=="number"){if(!(0<=o&&o<=255))return l.error("non-byte EncoderBuffer value");this.value=o,this.length=1}else if(typeof o=="string")this.value=o,this.length=n.byteLength(o);else if(n.isBuffer(o))this.value=o,this.length=o.length;else return l.error("Unsupported type: "+typeof o)}a(s,"O"),e.EncoderBuffer=s,s.prototype.join=function(o,l){return o||(o=new n(this.length)),l||(l=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(u){u.join(o,l),l+=u.length}):(typeof this.value=="number"?o[l]=this.value:typeof this.value=="string"?o.write(this.value,l):n.isBuffer(this.value)&&this.value.copy(o,l),l+=this.length)),o}}),GE=Qe((e,t)=>{var r=Yo().Reporter,n=Yo().EncoderBuffer,i=Yo().DecoderBuffer,s=ka(),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],l=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o),u=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function c(f,g){var m={};this._baseState=m,m.enc=f,m.parent=g||null,m.children=null,m.tag=null,m.args=null,m.reverseArgs=null,m.choice=null,m.optional=!1,m.any=!1,m.obj=!1,m.use=null,m.useDecoder=null,m.key=null,m.default=null,m.explicit=null,m.implicit=null,m.contains=null,!m.parent&&(m.children=[],this._wrap())}a(c,"T"),t.exports=c;var d=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var f=this._baseState,g={};d.forEach(function(w){g[w]=f[w]});var m=new this.constructor(g.parent);return m._baseState=g,m},c.prototype._wrap=function(){var f=this._baseState;l.forEach(function(g){this[g]=function(){var m=new this.constructor(this);return f.children.push(m),m[g].apply(m,arguments)}},this)},c.prototype._init=function(f){var g=this._baseState;s(g.parent===null),f.call(this),g.children=g.children.filter(function(m){return m._baseState.parent===this},this),s.equal(g.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(f){var g=this._baseState,m=f.filter(function(w){return w instanceof this.constructor},this);f=f.filter(function(w){return!(w instanceof this.constructor)},this),m.length!==0&&(s(g.children===null),g.children=m,m.forEach(function(w){w._baseState.parent=this},this)),f.length!==0&&(s(g.args===null),g.args=f,g.reverseArgs=f.map(function(w){if(typeof w!="object"||w.constructor!==Object)return w;var E={};return Object.keys(w).forEach(function(A){A==(A|0)&&(A|=0);var C=w[A];E[C]=A}),E}))},u.forEach(function(f){c.prototype[f]=function(){var g=this._baseState;throw Error(f+" not implemented for encoding: "+g.enc)}}),o.forEach(function(f){c.prototype[f]=function(){var g=this._baseState,m=Array.prototype.slice.call(arguments);return s(g.tag===null),g.tag=f,this._useArgs(m),this}}),c.prototype.use=function(f){s(f);var g=this._baseState;return s(g.use===null),g.use=f,this},c.prototype.optional=function(){var f=this._baseState;return f.optional=!0,this},c.prototype.def=function(f){var g=this._baseState;return s(g.default===null),g.default=f,g.optional=!0,this},c.prototype.explicit=function(f){var g=this._baseState;return s(g.explicit===null&&g.implicit===null),g.explicit=f,this},c.prototype.implicit=function(f){var g=this._baseState;return s(g.explicit===null&&g.implicit===null),g.implicit=f,this},c.prototype.obj=function(){var f=this._baseState,g=Array.prototype.slice.call(arguments);return f.obj=!0,g.length!==0&&this._useArgs(g),this},c.prototype.key=function(f){var g=this._baseState;return s(g.key===null),g.key=f,this},c.prototype.any=function(){var f=this._baseState;return f.any=!0,this},c.prototype.choice=function(f){var g=this._baseState;return s(g.choice===null),g.choice=f,this._useArgs(Object.keys(f).map(function(m){return f[m]})),this},c.prototype.contains=function(f){var g=this._baseState;return s(g.use===null),g.contains=f,this},c.prototype._decode=function(f,g){var m=this._baseState;if(m.parent===null)return f.wrapResult(m.children[0]._decode(f,g));var w=m.default,E=!0,A=null;if(m.key!==null&&(A=f.enterKey(m.key)),m.optional){var C=null;if(m.explicit!==null?C=m.explicit:m.implicit!==null?C=m.implicit:m.tag!==null&&(C=m.tag),C===null&&!m.any){var O=f.save();try{m.choice===null?this._decodeGeneric(m.tag,f,g):this._decodeChoice(f,g),E=!0}catch{E=!1}f.restore(O)}else if(E=this._peekTag(f,C,m.any),f.isError(E))return E}var R;if(m.obj&&E&&(R=f.enterObject()),E){if(m.explicit!==null){var P=this._decodeTag(f,m.explicit);if(f.isError(P))return P;f=P}var L=f.offset;if(m.use===null&&m.choice===null){if(m.any)var O=f.save();var j=this._decodeTag(f,m.implicit!==null?m.implicit:m.tag,m.any);if(f.isError(j))return j;m.any?w=f.raw(O):f=j}if(g&&g.track&&m.tag!==null&&g.track(f.path(),L,f.length,"tagged"),g&&g.track&&m.tag!==null&&g.track(f.path(),f.offset,f.length,"content"),m.any?w=w:m.choice===null?w=this._decodeGeneric(m.tag,f,g):w=this._decodeChoice(f,g),f.isError(w))return w;if(!m.any&&m.choice===null&&m.children!==null&&m.children.forEach(function(Z){Z._decode(f,g)}),m.contains&&(m.tag==="octstr"||m.tag==="bitstr")){var G=new i(w);w=this._getUse(m.contains,f._reporterState.obj)._decode(G,g)}}return m.obj&&E&&(w=f.leaveObject(R)),m.key!==null&&(w!==null||E===!0)?f.leaveKey(A,m.key,w):A!==null&&f.exitKey(A),w},c.prototype._decodeGeneric=function(f,g,m){var w=this._baseState;return f==="seq"||f==="set"?null:f==="seqof"||f==="setof"?this._decodeList(g,f,w.args[0],m):/str$/.test(f)?this._decodeStr(g,f,m):f==="objid"&&w.args?this._decodeObjid(g,w.args[0],w.args[1],m):f==="objid"?this._decodeObjid(g,null,null,m):f==="gentime"||f==="utctime"?this._decodeTime(g,f,m):f==="null_"?this._decodeNull(g,m):f==="bool"?this._decodeBool(g,m):f==="objDesc"?this._decodeStr(g,f,m):f==="int"||f==="enum"?this._decodeInt(g,w.args&&w.args[0],m):w.use!==null?this._getUse(w.use,g._reporterState.obj)._decode(g,m):g.error("unknown tag: "+f)},c.prototype._getUse=function(f,g){var m=this._baseState;return m.useDecoder=this._use(f,g),s(m.useDecoder._baseState.parent===null),m.useDecoder=m.useDecoder._baseState.children[0],m.implicit!==m.useDecoder._baseState.implicit&&(m.useDecoder=m.useDecoder.clone(),m.useDecoder._baseState.implicit=m.implicit),m.useDecoder},c.prototype._decodeChoice=function(f,g){var m=this._baseState,w=null,E=!1;return Object.keys(m.choice).some(function(A){var C=f.save(),O=m.choice[A];try{var R=O._decode(f,g);if(f.isError(R))return!1;w={type:A,value:R},E=!0}catch{return f.restore(C),!1}return!0},this),E?w:f.error("Choice not matched")},c.prototype._createEncoderBuffer=function(f){return new n(f,this.reporter)},c.prototype._encode=function(f,g,m){var w=this._baseState;if(!(w.default!==null&&w.default===f)){var E=this._encodeValue(f,g,m);if(E!==void 0&&!this._skipDefault(E,g,m))return E}},c.prototype._encodeValue=function(f,g,m){var w=this._baseState;if(w.parent===null)return w.children[0]._encode(f,g||new r);var O=null;if(this.reporter=g,w.optional&&f===void 0)if(w.default!==null)f=w.default;else return;var E=null,A=!1;if(w.any)O=this._createEncoderBuffer(f);else if(w.choice)O=this._encodeChoice(f,g);else if(w.contains)E=this._getUse(w.contains,m)._encode(f,g),A=!0;else if(w.children)E=w.children.map(function(L){if(L._baseState.tag==="null_")return L._encode(null,g,f);if(L._baseState.key===null)return g.error("Child should have a key");var j=g.enterKey(L._baseState.key);if(typeof f!="object")return g.error("Child expected, but input is not object");var G=L._encode(f[L._baseState.key],g,f);return g.leaveKey(j),G},this).filter(function(L){return L}),E=this._createEncoderBuffer(E);else if(w.tag==="seqof"||w.tag==="setof"){if(!(w.args&&w.args.length===1))return g.error("Too many args for : "+w.tag);if(!Array.isArray(f))return g.error("seqof/setof, but data is not Array");var C=this.clone();C._baseState.implicit=null,E=this._createEncoderBuffer(f.map(function(L){var j=this._baseState;return this._getUse(j.args[0],f)._encode(L,g)},C))}else w.use!==null?O=this._getUse(w.use,m)._encode(f,g):(E=this._encodePrimitive(w.tag,f),A=!0);var O;if(!w.any&&w.choice===null){var R=w.implicit!==null?w.implicit:w.tag,P=w.implicit===null?"universal":"context";R===null?w.use===null&&g.error("Tag could be omitted only for .use()"):w.use===null&&(O=this._encodeComposite(R,A,P,E))}return w.explicit!==null&&(O=this._encodeComposite(w.explicit,!1,"context",O)),O},c.prototype._encodeChoice=function(f,g){var m=this._baseState,w=m.choice[f.type];return w||s(!1,f.type+" not found in "+JSON.stringify(Object.keys(m.choice))),w._encode(f.value,g)},c.prototype._encodePrimitive=function(f,g){var m=this._baseState;if(/str$/.test(f))return this._encodeStr(g,f);if(f==="objid"&&m.args)return this._encodeObjid(g,m.reverseArgs[0],m.args[1]);if(f==="objid")return this._encodeObjid(g,null,null);if(f==="gentime"||f==="utctime")return this._encodeTime(g,f);if(f==="null_")return this._encodeNull();if(f==="int"||f==="enum")return this._encodeInt(g,m.args&&m.reverseArgs[0]);if(f==="bool")return this._encodeBool(g);if(f==="objDesc")return this._encodeStr(g,f);throw Error("Unsupported tag: "+f)},c.prototype._isNumstr=function(f){return/^[0-9 ]*$/.test(f)},c.prototype._isPrintstr=function(f){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(f)}}),Yo=Qe(e=>{var t=e;t.Reporter=ZE().Reporter,t.DecoderBuffer=W0().DecoderBuffer,t.EncoderBuffer=W0().EncoderBuffer,t.Node=GE()}),VE=Qe(e=>{var t=Y0();e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=t._reverse(e.tag)}),Y0=Qe(e=>{var t=e;t._reverse=function(r){var n={};return Object.keys(r).forEach(function(i){(i|0)==i&&(i=i|0);var s=r[i];n[s]=i}),n},t.der=VE()}),Q0=Qe((e,t)=>{var r=Mn(),n=Qo(),i=n.base,s=n.bignum,o=n.constants.der;function l(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new u,this.tree._init(f.body)}a(l,"v"),t.exports=l,l.prototype.decode=function(f,g){return f instanceof i.DecoderBuffer||(f=new i.DecoderBuffer(f,g)),this.tree._decode(f,g)};function u(f){i.Node.call(this,"der",f)}a(u,"W"),r(u,i.Node),u.prototype._peekTag=function(f,g,m){if(f.isEmpty())return!1;var w=f.save(),E=c(f,'Failed to peek tag: "'+g+'"');return f.isError(E)?E:(f.restore(w),E.tag===g||E.tagStr===g||E.tagStr+"of"===g||m)},u.prototype._decodeTag=function(f,g,m){var w=c(f,'Failed to decode tag of "'+g+'"');if(f.isError(w))return w;var E=d(f,w.primitive,'Failed to get length of "'+g+'"');if(f.isError(E))return E;if(!m&&w.tag!==g&&w.tagStr!==g&&w.tagStr+"of"!==g)return f.error('Failed to match tag: "'+g+'"');if(w.primitive||E!==null)return f.skip(E,'Failed to match body of: "'+g+'"');var A=f.save(),C=this._skipUntilEnd(f,'Failed to skip indefinite length body: "'+this.tag+'"');return f.isError(C)?C:(E=f.offset-A.offset,f.restore(A),f.skip(E,'Failed to match body of: "'+g+'"'))},u.prototype._skipUntilEnd=function(f,g){for(;;){var m=c(f,g);if(f.isError(m))return m;var w=d(f,m.primitive,g);if(f.isError(w))return w;var E;if(m.primitive||w!==null?E=f.skip(w):E=this._skipUntilEnd(f,g),f.isError(E))return E;if(m.tagStr==="end")break}},u.prototype._decodeList=function(f,g,m,w){for(var E=[];!f.isEmpty();){var A=this._peekTag(f,"end");if(f.isError(A))return A;var C=m.decode(f,"der",w);if(f.isError(C)&&A)break;E.push(C)}return E},u.prototype._decodeStr=function(f,g){if(g==="bitstr"){var m=f.readUInt8();return f.isError(m)?m:{unused:m,data:f.raw()}}else if(g==="bmpstr"){var w=f.raw();if(w.length%2===1)return f.error("Decoding of string type: bmpstr length mismatch");for(var E="",A=0;A<w.length/2;A++)E+=String.fromCharCode(w.readUInt16BE(A*2));return E}else if(g==="numstr"){var C=f.raw().toString("ascii");return this._isNumstr(C)?C:f.error("Decoding of string type: numstr unsupported characters")}else{if(g==="octstr")return f.raw();if(g==="objDesc")return f.raw();if(g==="printstr"){var O=f.raw().toString("ascii");return this._isPrintstr(O)?O:f.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(g)?f.raw().toString():f.error("Decoding of string type: "+g+" unsupported")}},u.prototype._decodeObjid=function(f,g,m){for(var w,E=[],A=0;!f.isEmpty();){var C=f.readUInt8();A<<=7,A|=C&127,(C&128)===0&&(E.push(A),A=0)}C&128&&E.push(A);var O=E[0]/40|0,R=E[0]%40;if(m?w=E:w=[O,R].concat(E.slice(1)),g){var P=g[w.join(" ")];P===void 0&&(P=g[w.join(".")]),P!==void 0&&(w=P)}return w},u.prototype._decodeTime=function(f,g){var m=f.raw().toString();if(g==="gentime")var w=m.slice(0,4)|0,E=m.slice(4,6)|0,A=m.slice(6,8)|0,C=m.slice(8,10)|0,O=m.slice(10,12)|0,R=m.slice(12,14)|0;else if(g==="utctime"){var w=m.slice(0,2)|0,E=m.slice(2,4)|0,A=m.slice(4,6)|0,C=m.slice(6,8)|0,O=m.slice(8,10)|0,R=m.slice(10,12)|0;w<70?w=2e3+w:w=1900+w}else return f.error("Decoding "+g+" time is not supported yet");return Date.UTC(w,E-1,A,C,O,R,0)},u.prototype._decodeNull=function(f){return null},u.prototype._decodeBool=function(f){var g=f.readUInt8();return f.isError(g)?g:g!==0},u.prototype._decodeInt=function(f,g){var m=f.raw(),w=new s(m);return g&&(w=g[w.toString(10)]||w),w},u.prototype._use=function(f,g){return typeof f=="function"&&(f=f(g)),f._getDecoder("der").tree};function c(f,g){var m=f.readUInt8(g);if(f.isError(m))return m;var w=o.tagClass[m>>6],E=(m&32)===0;if((m&31)===31){var A=m;for(m=0;(A&128)===128;){if(A=f.readUInt8(g),f.isError(A))return A;m<<=7,m|=A&127}}else m&=31;var C=o.tag[m];return{cls:w,primitive:E,tag:m,tagStr:C}}a(c,"T");function d(f,g,m){var w=f.readUInt8(m);if(f.isError(w))return w;if(!g&&w===128)return null;if((w&128)===0)return w;var E=w&127;if(E>4)return f.error("length octect is too long");w=0;for(var A=0;A<E;A++){w<<=8;var C=f.readUInt8(m);if(f.isError(C))return C;w|=C}return w}a(d,"Z")}),WE=Qe((e,t)=>{var r=Mn(),n=(ln(),qt(qr)).Buffer,i=Q0();function s(o){i.call(this,o),this.enc="pem"}a(s,"O"),r(s,i),t.exports=s,s.prototype.decode=function(o,l){for(var u=o.toString().split(/[\r\n]+/g),c=l.label.toUpperCase(),d=/^-----(BEGIN|END) ([^-]+)-----$/,f=-1,g=-1,m=0;m<u.length;m++){var w=u[m].match(d);if(w!==null&&w[2]===c)if(f===-1){if(w[1]!=="BEGIN")break;f=m}else{if(w[1]!=="END")break;g=m;break}}if(f===-1||g===-1)throw Error("PEM section not found for: "+c);var E=u.slice(f+1,g).join("");E.replace(/[^a-z0-9\+\/=]+/gi,"");var A=new n(E,"base64");return i.prototype.decode.call(this,A,l)}}),YE=Qe(e=>{var t=e;t.der=Q0(),t.pem=WE()}),$0=Qe((e,t)=>{var r=Mn(),n=(ln(),qt(qr)).Buffer,i=Qo(),s=i.base,o=i.constants.der;function l(f){this.enc="der",this.name=f.name,this.entity=f,this.tree=new u,this.tree._init(f.body)}a(l,"v"),t.exports=l,l.prototype.encode=function(f,g){return this.tree._encode(f,g).join()};function u(f){s.Node.call(this,"der",f)}a(u,"W"),r(u,s.Node),u.prototype._encodeComposite=function(f,g,m,w){var E=d(f,g,m,this.reporter);if(w.length<128){var O=new n(2);return O[0]=E,O[1]=w.length,this._createEncoderBuffer([O,w])}for(var A=1,C=w.length;C>=256;C>>=8)A++;var O=new n(2+A);O[0]=E,O[1]=128|A;for(var C=1+A,R=w.length;R>0;C--,R>>=8)O[C]=R&255;return this._createEncoderBuffer([O,w])},u.prototype._encodeStr=function(f,g){if(g==="bitstr")return this._createEncoderBuffer([f.unused|0,f.data]);if(g==="bmpstr"){for(var m=new n(f.length*2),w=0;w<f.length;w++)m.writeUInt16BE(f.charCodeAt(w),w*2);return this._createEncoderBuffer(m)}else return g==="numstr"?this._isNumstr(f)?this._createEncoderBuffer(f):this.reporter.error("Encoding of string type: numstr supports only digits and space"):g==="printstr"?this._isPrintstr(f)?this._createEncoderBuffer(f):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(g)?this._createEncoderBuffer(f):g==="objDesc"?this._createEncoderBuffer(f):this.reporter.error("Encoding of string type: "+g+" unsupported")},u.prototype._encodeObjid=function(f,g,m){if(typeof f=="string"){if(!g)return this.reporter.error("string objid given, but no values map found");if(!g.hasOwnProperty(f))return this.reporter.error("objid not found in values map");f=g[f].split(/[\s\.]+/g);for(var w=0;w<f.length;w++)f[w]|=0}else if(Array.isArray(f)){f=f.slice();for(var w=0;w<f.length;w++)f[w]|=0}if(!Array.isArray(f))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(f));if(!m){if(f[1]>=40)return this.reporter.error("Second objid identifier OOB");f.splice(0,2,f[0]*40+f[1])}for(var E=0,w=0;w<f.length;w++){var A=f[w];for(E++;A>=128;A>>=7)E++}for(var C=new n(E),O=C.length-1,w=f.length-1;w>=0;w--){var A=f[w];for(C[O--]=A&127;(A>>=7)>0;)C[O--]=128|A&127}return this._createEncoderBuffer(C)};function c(f){return f<10?"0"+f:f}a(c,"T"),u.prototype._encodeTime=function(f,g){var m,w=new Date(f);return g==="gentime"?m=[c(w.getFullYear()),c(w.getUTCMonth()+1),c(w.getUTCDate()),c(w.getUTCHours()),c(w.getUTCMinutes()),c(w.getUTCSeconds()),"Z"].join(""):g==="utctime"?m=[c(w.getFullYear()%100),c(w.getUTCMonth()+1),c(w.getUTCDate()),c(w.getUTCHours()),c(w.getUTCMinutes()),c(w.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+g+" time is not supported yet"),this._encodeStr(m,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(f,g){if(typeof f=="string"){if(!g)return this.reporter.error("String int or enum given, but no values map");if(!g.hasOwnProperty(f))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(f));f=g[f]}if(typeof f!="number"&&!n.isBuffer(f)){var m=f.toArray();!f.sign&&m[0]&128&&m.unshift(0),f=new n(m)}if(n.isBuffer(f)){var w=f.length;f.length===0&&w++;var A=new n(w);return f.copy(A),f.length===0&&(A[0]=0),this._createEncoderBuffer(A)}if(f<128)return this._createEncoderBuffer(f);if(f<256)return this._createEncoderBuffer([0,f]);for(var w=1,E=f;E>=256;E>>=8)w++;for(var A=Array(w),E=A.length-1;E>=0;E--)A[E]=f&255,f>>=8;return A[0]&128&&A.unshift(0),this._createEncoderBuffer(new n(A))},u.prototype._encodeBool=function(f){return this._createEncoderBuffer(f?255:0)},u.prototype._use=function(f,g){return typeof f=="function"&&(f=f(g)),f._getEncoder("der").tree},u.prototype._skipDefault=function(f,g,m){var w=this._baseState,E;if(w.default===null)return!1;var A=f.join();if(w.defaultBuffer===void 0&&(w.defaultBuffer=this._encodeValue(w.default,g,m).join()),A.length!==w.defaultBuffer.length)return!1;for(E=0;E<A.length;E++)if(A[E]!==w.defaultBuffer[E])return!1;return!0};function d(f,g,m,w){var E;if(f==="seqof"?f="seq":f==="setof"&&(f="set"),o.tagByName.hasOwnProperty(f))E=o.tagByName[f];else if(typeof f=="number"&&(f|0)===f)E=f;else return w.error("Unknown tag: "+f);return E>=31?w.error("Multi-octet tag encoding unsupported"):(g||(E|=32),E|=o.tagClassByName[m||"universal"]<<6,E)}a(d,"Z")}),QE=Qe((e,t)=>{var r=Mn(),n=$0();function i(s){n.call(this,s),this.enc="pem"}a(i,"K"),r(i,n),t.exports=i,i.prototype.encode=function(s,o){for(var l=n.prototype.encode.call(this,s),u=l.toString("base64"),c=["-----BEGIN "+o.label+"-----"],d=0;d<u.length;d+=64)c.push(u.slice(d,d+64));return c.push("-----END "+o.label+"-----"),c.join(`
38
- `)}}),$E=Qe(e=>{var t=e;t.der=$0(),t.pem=QE()}),Qo=Qe(e=>{var t=e;t.bignum=FE(),t.define=HE().define,t.base=Yo(),t.constants=Y0(),t.decoders=YE(),t.encoders=$E()}),XE=Qe((e,t)=>{var r=Qo(),n=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),s=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),o=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}),l=r.define("RelativeDistinguishedName",function(){this.setof(i)}),u=r.define("RDNSequence",function(){this.seqof(l)}),c=r.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),d=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),f=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),g=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(c),this.key("validity").use(d),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(o),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),m=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(g),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())});t.exports=m}),JE=Qe(e=>{var t=Qo();e.certificate=XE();var r=t.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});e.RSAPrivateKey=r;var n=t.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});e.RSAPublicKey=n;var i=t.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),s=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())});e.PublicKey=s;var o=t.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())});e.PrivateKey=o;var l=t.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});e.EncryptedPrivateKey=l;var u=t.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});e.DSAPrivateKey=u,e.DSAparam=t.define("DSAparam",function(){this.int()});var c=t.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),d=t.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(c),this.key("publicKey").optional().explicit(1).bitstr())});e.ECPrivateKey=d,e.signature=t.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),KE=Qe((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),qE=Qe((e,t)=>{var r=fn().Buffer,n=rI().Transform,i=Mn();function s(c){n.call(this),this._block=r.allocUnsafe(c),this._blockSize=c,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}a(s,"O"),i(s,n),s.prototype._transform=function(c,d,f){var g=null;try{this.update(c,d)}catch(m){g=m}f(g)},s.prototype._flush=function(c){var d=null;try{this.push(this.digest())}catch(f){d=f}c(d)};var o=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function u(c,d){if(c instanceof r)return c;if(typeof c=="string")return r.from(c,d);if(l&&ArrayBuffer.isView(c)){if(c.byteLength===0)return r.alloc(0);var f=r.from(c.buffer,c.byteOffset,c.byteLength);if(f.byteLength===c.byteLength)return f}if(o&&c instanceof Uint8Array||r.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return r.from(c);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}a(u,"W"),s.prototype.update=function(c,d){if(this._finalized)throw Error("Digest already called");c=u(c,d);for(var f=this._block,g=0;this._blockOffset+c.length-g>=this._blockSize;){for(var m=this._blockOffset;m<this._blockSize;)f[m++]=c[g++];this._update(),this._blockOffset=0}for(;g<c.length;)f[this._blockOffset++]=c[g++];for(var w=0,E=c.length*8;E>0;++w)this._length[w]+=E,E=this._length[w]/4294967296|0,E>0&&(this._length[w]-=4294967296*E);return this},s.prototype._update=function(){throw Error("_update is not implemented")},s.prototype.digest=function(c){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var d=this._digest();c!==void 0&&(d=d.toString(c)),this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return d},s.prototype._digest=function(){throw Error("_digest is not implemented")},t.exports=s}),e6=Qe((e,t)=>{var r=Mn(),n=qE(),i=fn().Buffer,s=Array(16);function o(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}a(o,"Y"),r(o,n),o.prototype._update=function(){for(var g=s,m=0;m<16;++m)g[m]=this._block.readInt32LE(m*4);var w=this._a,E=this._b,A=this._c,C=this._d;w=u(w,E,A,C,g[0],3614090360,7),C=u(C,w,E,A,g[1],3905402710,12),A=u(A,C,w,E,g[2],606105819,17),E=u(E,A,C,w,g[3],3250441966,22),w=u(w,E,A,C,g[4],4118548399,7),C=u(C,w,E,A,g[5],1200080426,12),A=u(A,C,w,E,g[6],2821735955,17),E=u(E,A,C,w,g[7],4249261313,22),w=u(w,E,A,C,g[8],1770035416,7),C=u(C,w,E,A,g[9],2336552879,12),A=u(A,C,w,E,g[10],4294925233,17),E=u(E,A,C,w,g[11],2304563134,22),w=u(w,E,A,C,g[12],1804603682,7),C=u(C,w,E,A,g[13],4254626195,12),A=u(A,C,w,E,g[14],2792965006,17),E=u(E,A,C,w,g[15],1236535329,22),w=c(w,E,A,C,g[1],4129170786,5),C=c(C,w,E,A,g[6],3225465664,9),A=c(A,C,w,E,g[11],643717713,14),E=c(E,A,C,w,g[0],3921069994,20),w=c(w,E,A,C,g[5],3593408605,5),C=c(C,w,E,A,g[10],38016083,9),A=c(A,C,w,E,g[15],3634488961,14),E=c(E,A,C,w,g[4],3889429448,20),w=c(w,E,A,C,g[9],568446438,5),C=c(C,w,E,A,g[14],3275163606,9),A=c(A,C,w,E,g[3],4107603335,14),E=c(E,A,C,w,g[8],1163531501,20),w=c(w,E,A,C,g[13],2850285829,5),C=c(C,w,E,A,g[2],4243563512,9),A=c(A,C,w,E,g[7],1735328473,14),E=c(E,A,C,w,g[12],2368359562,20),w=d(w,E,A,C,g[5],4294588738,4),C=d(C,w,E,A,g[8],2272392833,11),A=d(A,C,w,E,g[11],1839030562,16),E=d(E,A,C,w,g[14],4259657740,23),w=d(w,E,A,C,g[1],2763975236,4),C=d(C,w,E,A,g[4],1272893353,11),A=d(A,C,w,E,g[7],4139469664,16),E=d(E,A,C,w,g[10],3200236656,23),w=d(w,E,A,C,g[13],681279174,4),C=d(C,w,E,A,g[0],3936430074,11),A=d(A,C,w,E,g[3],3572445317,16),E=d(E,A,C,w,g[6],76029189,23),w=d(w,E,A,C,g[9],3654602809,4),C=d(C,w,E,A,g[12],3873151461,11),A=d(A,C,w,E,g[15],530742520,16),E=d(E,A,C,w,g[2],3299628645,23),w=f(w,E,A,C,g[0],4096336452,6),C=f(C,w,E,A,g[7],1126891415,10),A=f(A,C,w,E,g[14],2878612391,15),E=f(E,A,C,w,g[5],4237533241,21),w=f(w,E,A,C,g[12],1700485571,6),C=f(C,w,E,A,g[3],2399980690,10),A=f(A,C,w,E,g[10],4293915773,15),E=f(E,A,C,w,g[1],2240044497,21),w=f(w,E,A,C,g[8],1873313359,6),C=f(C,w,E,A,g[15],4264355552,10),A=f(A,C,w,E,g[6],2734768916,15),E=f(E,A,C,w,g[13],1309151649,21),w=f(w,E,A,C,g[4],4149444226,6),C=f(C,w,E,A,g[11],3174756917,10),A=f(A,C,w,E,g[2],718787259,15),E=f(E,A,C,w,g[9],3951481745,21),this._a=this._a+w|0,this._b=this._b+E|0,this._c=this._c+A|0,this._d=this._d+C|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var g=i.allocUnsafe(16);return g.writeInt32LE(this._a,0),g.writeInt32LE(this._b,4),g.writeInt32LE(this._c,8),g.writeInt32LE(this._d,12),g};function l(g,m){return g<<m|g>>>32-m}a(l,"v");function u(g,m,w,E,A,C,O){return l(g+(m&w|~m&E)+A+C|0,O)+m|0}a(u,"W");function c(g,m,w,E,A,C,O){return l(g+(m&E|w&~E)+A+C|0,O)+m|0}a(c,"T");function d(g,m,w,E,A,C,O){return l(g+(m^w^E)+A+C|0,O)+m|0}a(d,"Z");function f(g,m,w,E,A,C,O){return l(g+(w^(m|~E))+A+C|0,O)+m|0}a(f,"w"),t.exports=o}),t6=Qe((e,t)=>{var r=fn().Buffer,n=e6();function i(s,o,l,u){if(r.isBuffer(s)||(s=r.from(s,"binary")),o&&(r.isBuffer(o)||(o=r.from(o,"binary")),o.length!==8))throw RangeError("salt should be Buffer with 8 byte length");for(var c=l/8,d=r.alloc(c),f=r.alloc(u||0),g=r.alloc(0);c>0||u>0;){var m=new n;m.update(g),m.update(s),o&&m.update(o),g=m.digest();var w=0;if(c>0){var E=d.length-c;w=Math.min(c,g.length),g.copy(d,E,0,w),c-=w}if(w<g.length&&u>0){var A=f.length-u,C=Math.min(u,g.length-w);g.copy(f,A,w,w+C),u-=C}}return g.fill(0),{key:d,iv:f}}a(i,"K"),t.exports=i}),X0=Qe(e=>{var t=(Qn(),qt(Ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),r6=Qe((e,t)=>{var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=t6(),o=X0(),l=fn().Buffer;t.exports=function(u,c){var d=u.toString(),f=d.match(r),g;if(f){var w="aes"+f[1],E=l.from(f[2],"hex"),A=l.from(f[3].replace(/[\r\n]/g,""),"base64"),C=s(c,E.slice(0,8),parseInt(f[1],10)).key,O=[],R=o.createDecipheriv(w,C,E);O.push(R.update(A)),O.push(R.final()),g=l.concat(O)}else{var m=d.match(i);g=l.from(m[2].replace(/[\r\n]/g,""),"base64")}var P=d.match(n)[1];return{tag:P,data:g}}}),J0=Qe((e,t)=>{var r=JE(),n=KE(),i=r6(),s=X0(),o=B0().pbkdf2Sync,l=fn().Buffer;function u(d,f){var g=d.algorithm.decrypt.kde.kdeparams.salt,m=parseInt(d.algorithm.decrypt.kde.kdeparams.iters.toString(),10),w=n[d.algorithm.decrypt.cipher.algo.join(".")],E=d.algorithm.decrypt.cipher.iv,A=d.subjectPrivateKey,C=parseInt(w.split("-")[1],10)/8,O=o(f,g,m,C,"sha1"),R=s.createDecipheriv(w,O,E),P=[];return P.push(R.update(A)),P.push(R.final()),l.concat(P)}a(u,"W");function c(d){var f;typeof d=="object"&&!l.isBuffer(d)&&(f=d.passphrase,d=d.key),typeof d=="string"&&(d=l.from(d));var g=i(d,f),m=g.tag,w=g.data,E,A;switch(m){case"CERTIFICATE":A=r.certificate.decode(w,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=r.PublicKey.decode(w,"der")),E=A.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=r.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":w=r.EncryptedPrivateKey.decode(w,"der"),w=u(w,f);case"PRIVATE KEY":switch(A=r.PrivateKey.decode(w,"der"),E=A.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:r.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=r.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw Error("unknown key id "+E)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(w,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(w,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(w,"der")};case"EC PRIVATE KEY":return w=r.ECPrivateKey.decode(w,"der"),{curve:w.parameters.value,privateKey:w.privateKey};default:throw Error("unknown key type "+m)}}a(c,"T"),c.signature=r.signature,t.exports=c}),K0=Qe((e,t)=>{var r=Kl(),n=fn().Buffer;t.exports=function(s,o){for(var l=n.alloc(0),u=0,c;l.length<o;)c=i(u++),l=n.concat([l,r("sha1").update(s).update(c).digest()]);return l.slice(0,o)};function i(s){var o=n.allocUnsafe(4);return o.writeUInt32BE(s,0),o}a(i,"K")}),q0=Qe((e,t)=>{t.exports=function(r,n){for(var i=r.length,s=-1;++s<i;)r[s]^=n[s];return r}}),tf=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,_t=_[3]|0,Ve=_t&8191,Te=_t>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var xt=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(xt>>>26)|0,xt&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=xt,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),eg=Qe((e,t)=>{var r=tf(),n=fn().Buffer;function i(s,o){return n.from(s.toRed(r.mont(o.modulus)).redPow(new r(o.publicExponent)).fromRed().toArray())}a(i,"K"),t.exports=i}),n6=Qe((e,t)=>{(function(r,n){function i(b,x){if(!b)throw Error(x||"Assertion failed")}a(i,"K");function s(b,x){b.super_=x;var _=a(function(){},"V");_.prototype=x.prototype,b.prototype=new _,b.prototype.constructor=b}a(s,"O");function o(b,x,_){if(o.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((x==="le"||x==="be")&&(_=x,x=10),this._init(b||0,x||10,_||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(b){return b instanceof o?!0:b!==null&&typeof b=="object"&&b.constructor.wordSize===o.wordSize&&Array.isArray(b.words)},o.max=function(b,x){return b.cmp(x)>0?b:x},o.min=function(b,x){return b.cmp(x)<0?b:x},o.prototype._init=function(b,x,_){if(typeof b=="number")return this._initNumber(b,x,_);if(typeof b=="object")return this._initArray(b,x,_);x==="hex"&&(x=16),i(x===(x|0)&&x>=2&&x<=36),b=b.toString().replace(/\s+/g,"");var N=0;b[0]==="-"&&(N++,this.negative=1),N<b.length&&(x===16?this._parseHex(b,N,_):(this._parseBase(b,x,N),_==="le"&&this._initArray(this.toArray(),x,_)))},o.prototype._initNumber=function(b,x,_){b<0&&(this.negative=1,b=-b),b<67108864?(this.words=[b&67108863],this.length=1):b<4503599627370496?(this.words=[b&67108863,b/67108864&67108863],this.length=2):(i(b<9007199254740992),this.words=[b&67108863,b/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),x,_)},o.prototype._initArray=function(b,x,_){if(i(typeof b.length=="number"),b.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(b.length/3),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var T,k,p=0;if(_==="be")for(N=b.length-1,T=0;N>=0;N-=3)k=b[N]|b[N-1]<<8|b[N-2]<<16,this.words[T]|=k<<p&67108863,this.words[T+1]=k>>>26-p&67108863,p+=24,p>=26&&(p-=26,T++);else if(_==="le")for(N=0,T=0;N<b.length;N+=3)k=b[N]|b[N+1]<<8|b[N+2]<<16,this.words[T]|=k<<p&67108863,this.words[T+1]=k>>>26-p&67108863,p+=24,p>=26&&(p-=26,T++);return this._strip()};function u(b,x){var _=b.charCodeAt(x);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;i(!1,"Invalid character in "+b)}a(u,"W");function c(b,x,_){var N=u(b,_);return _-1>=x&&(N|=u(b,_-1)<<4),N}a(c,"T"),o.prototype._parseHex=function(b,x,_){this.length=Math.ceil((b.length-x)/6),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var T=0,k=0,p;if(_==="be")for(N=b.length-1;N>=x;N-=2)p=c(b,x,N)<<T,this.words[k]|=p&67108863,T>=18?(T-=18,k+=1,this.words[k]|=p>>>26):T+=8;else{var S=b.length-x;for(N=S%2===0?x+1:x;N<b.length;N+=2)p=c(b,x,N)<<T,this.words[k]|=p&67108863,T>=18?(T-=18,k+=1,this.words[k]|=p>>>26):T+=8}this._strip()};function d(b,x,_,N){for(var T=0,k=0,p=Math.min(b.length,_),S=x;S<p;S++){var I=b.charCodeAt(S)-48;T*=N,I>=49?k=I-49+10:I>=17?k=I-17+10:k=I,i(I>=0&&k<N,"Invalid character"),T+=k}return T}a(d,"Z"),o.prototype._parseBase=function(b,x,_){this.words=[0],this.length=1;for(var N=0,T=1;T<=67108863;T*=x)N++;N--,T=T/x|0;for(var k=b.length-_,p=k%N,S=Math.min(k,k-p)+_,I=0,M=_;M<S;M+=N)I=d(b,M,M+N,x),this.imuln(T),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I);if(p!==0){var U=1;for(I=d(b,M,b.length,x),M=0;M<p;M++)U*=x;this.imuln(U),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I)}this._strip()},o.prototype.copy=function(b){b.words=Array(this.length);for(var x=0;x<this.length;x++)b.words[x]=this.words[x];b.length=this.length,b.negative=this.negative,b.red=this.red};function f(b,x){b.words=x.words,b.length=x.length,b.negative=x.negative,b.red=x.red}if(a(f,"w"),o.prototype._move=function(b){f(b,this)},o.prototype.clone=function(){var b=new o(null);return this.copy(b),b},o.prototype._expand=function(b){for(;this.length<b;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{o.prototype.inspect=g}else o.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}a(g,"k");var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(b,x){b=b||10,x=x|0||1;var _;if(b===16||b==="hex"){_="";for(var N=0,T=0,k=0;k<this.length;k++){var p=this.words[k],S=((p<<N|T)&16777215).toString(16);T=p>>>24-N&16777215,N+=2,N>=26&&(N-=26,k--),T!==0||k!==this.length-1?_=m[6-S.length]+S+_:_=S+_}for(T!==0&&(_=T.toString(16)+_);_.length%x!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(b===(b|0)&&b>=2&&b<=36){var I=w[b],M=E[b];_="";var U=this.clone();for(U.negative=0;!U.isZero();){var B=U.modrn(M).toString(b);U=U.idivn(M),U.isZero()?_=B+_:_=m[I-B.length]+B+_}for(this.isZero()&&(_="0"+_);_.length%x!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},o.prototype.toJSON=function(){return this.toString(16,2)},l&&(o.prototype.toBuffer=function(b,x){return this.toArrayLike(l,b,x)}),o.prototype.toArray=function(b,x){return this.toArrayLike(Array,b,x)};var A=a(function(b,x){return b.allocUnsafe?b.allocUnsafe(x):new b(x)},"E");o.prototype.toArrayLike=function(b,x,_){this._strip();var N=this.byteLength(),T=_||Math.max(1,N);i(N<=T,"byte array longer than desired length"),i(T>0,"Requested array length <= 0");var k=A(b,T),p=x==="le"?"LE":"BE";return this["_toArrayLike"+p](k,N),k},o.prototype._toArrayLikeLE=function(b,x){for(var _=0,N=0,T=0,k=0;T<this.length;T++){var p=this.words[T]<<k|N;b[_++]=p&255,_<b.length&&(b[_++]=p>>8&255),_<b.length&&(b[_++]=p>>16&255),k===6?(_<b.length&&(b[_++]=p>>24&255),N=0,k=0):(N=p>>>24,k+=2)}if(_<b.length)for(b[_++]=N;_<b.length;)b[_++]=0},o.prototype._toArrayLikeBE=function(b,x){for(var _=b.length-1,N=0,T=0,k=0;T<this.length;T++){var p=this.words[T]<<k|N;b[_--]=p&255,_>=0&&(b[_--]=p>>8&255),_>=0&&(b[_--]=p>>16&255),k===6?(_>=0&&(b[_--]=p>>24&255),N=0,k=0):(N=p>>>24,k+=2)}if(_>=0)for(b[_--]=N;_>=0;)b[_--]=0},Math.clz32?o.prototype._countBits=function(b){return 32-Math.clz32(b)}:o.prototype._countBits=function(b){var x=b,_=0;return x>=4096&&(_+=13,x>>>=13),x>=64&&(_+=7,x>>>=7),x>=8&&(_+=4,x>>>=4),x>=2&&(_+=2,x>>>=2),_+x},o.prototype._zeroBits=function(b){if(b===0)return 26;var x=b,_=0;return(x&8191)===0&&(_+=13,x>>>=13),(x&127)===0&&(_+=7,x>>>=7),(x&15)===0&&(_+=4,x>>>=4),(x&3)===0&&(_+=2,x>>>=2),(x&1)===0&&_++,_},o.prototype.bitLength=function(){var b=this.words[this.length-1],x=this._countBits(b);return(this.length-1)*26+x};function C(b){for(var x=Array(b.bitLength()),_=0;_<x.length;_++){var N=_/26|0,T=_%26;x[_]=b.words[N]>>>T&1}return x}a(C,"D"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,x=0;x<this.length;x++){var _=this._zeroBits(this.words[x]);if(b+=_,_!==26)break}return b},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(b){return this.negative!==0?this.abs().inotn(b).iaddn(1):this.clone()},o.prototype.fromTwos=function(b){return this.testn(b-1)?this.notn(b).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(b){for(;this.length<b.length;)this.words[this.length++]=0;for(var x=0;x<b.length;x++)this.words[x]=this.words[x]|b.words[x];return this._strip()},o.prototype.ior=function(b){return i((this.negative|b.negative)===0),this.iuor(b)},o.prototype.or=function(b){return this.length>b.length?this.clone().ior(b):b.clone().ior(this)},o.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},o.prototype.iuand=function(b){var x;this.length>b.length?x=b:x=this;for(var _=0;_<x.length;_++)this.words[_]=this.words[_]&b.words[_];return this.length=x.length,this._strip()},o.prototype.iand=function(b){return i((this.negative|b.negative)===0),this.iuand(b)},o.prototype.and=function(b){return this.length>b.length?this.clone().iand(b):b.clone().iand(this)},o.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},o.prototype.iuxor=function(b){var x,_;this.length>b.length?(x=this,_=b):(x=b,_=this);for(var N=0;N<_.length;N++)this.words[N]=x.words[N]^_.words[N];if(this!==x)for(;N<x.length;N++)this.words[N]=x.words[N];return this.length=x.length,this._strip()},o.prototype.ixor=function(b){return i((this.negative|b.negative)===0),this.iuxor(b)},o.prototype.xor=function(b){return this.length>b.length?this.clone().ixor(b):b.clone().ixor(this)},o.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},o.prototype.inotn=function(b){i(typeof b=="number"&&b>=0);var x=Math.ceil(b/26)|0,_=b%26;this._expand(x),_>0&&x--;for(var N=0;N<x;N++)this.words[N]=~this.words[N]&67108863;return _>0&&(this.words[N]=~this.words[N]&67108863>>26-_),this._strip()},o.prototype.notn=function(b){return this.clone().inotn(b)},o.prototype.setn=function(b,x){i(typeof b=="number"&&b>=0);var _=b/26|0,N=b%26;return this._expand(_+1),x?this.words[_]=this.words[_]|1<<N:this.words[_]=this.words[_]&~(1<<N),this._strip()},o.prototype.iadd=function(b){var x;if(this.negative!==0&&b.negative===0)return this.negative=0,x=this.isub(b),this.negative^=1,this._normSign();if(this.negative===0&&b.negative!==0)return b.negative=0,x=this.isub(b),b.negative=1,x._normSign();var _,N;this.length>b.length?(_=this,N=b):(_=b,N=this);for(var T=0,k=0;k<N.length;k++)x=(_.words[k]|0)+(N.words[k]|0)+T,this.words[k]=x&67108863,T=x>>>26;for(;T!==0&&k<_.length;k++)x=(_.words[k]|0)+T,this.words[k]=x&67108863,T=x>>>26;if(this.length=_.length,T!==0)this.words[this.length]=T,this.length++;else if(_!==this)for(;k<_.length;k++)this.words[k]=_.words[k];return this},o.prototype.add=function(b){var x;return b.negative!==0&&this.negative===0?(b.negative=0,x=this.sub(b),b.negative^=1,x):b.negative===0&&this.negative!==0?(this.negative=0,x=b.sub(this),this.negative=1,x):this.length>b.length?this.clone().iadd(b):b.clone().iadd(this)},o.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var x=this.iadd(b);return b.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var _=this.cmp(b);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,T;_>0?(N=this,T=b):(N=b,T=this);for(var k=0,p=0;p<T.length;p++)x=(N.words[p]|0)-(T.words[p]|0)+k,k=x>>26,this.words[p]=x&67108863;for(;k!==0&&p<N.length;p++)x=(N.words[p]|0)+k,k=x>>26,this.words[p]=x&67108863;if(k===0&&p<N.length&&N!==this)for(;p<N.length;p++)this.words[p]=N.words[p];return this.length=Math.max(this.length,p),N!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(b){return this.clone().isub(b)};function O(b,x,_){_.negative=x.negative^b.negative;var N=b.length+x.length|0;_.length=N,N=N-1|0;var T=b.words[0]|0,k=x.words[0]|0,p=T*k,S=p&67108863,I=p/67108864|0;_.words[0]=S;for(var M=1;M<N;M++){for(var U=I>>>26,B=I&67108863,H=Math.min(M,x.length-1),$=Math.max(0,M-b.length+1);$<=H;$++){var ae=M-$|0;T=b.words[ae]|0,k=x.words[$]|0,p=T*k+B,U+=p/67108864|0,B=p&67108863}_.words[M]=B|0,I=U|0}return I!==0?_.words[M]=I|0:_.length--,_._strip()}a(O,"h");var R=a(function(b,x,_){var N=b.words,T=x.words,k=_.words,p=0,S,I,M,U=N[0]|0,B=U&8191,H=U>>>13,$=N[1]|0,ae=$&8191,ie=$>>>13,ne=N[2]|0,Ne=ne&8191,ve=ne>>>13,he=N[3]|0,Se=he&8191,Q=he>>>13,se=N[4]|0,J=se&8191,te=se>>>13,de=N[5]|0,be=de&8191,Ae=de>>>13,oe=N[6]|0,Y=oe&8191,ee=oe>>>13,X=N[7]|0,W=X&8191,q=X>>>13,re=N[8]|0,Oe=re&8191,Ee=re>>>13,Be=N[9]|0,pt=Be&8191,xe=Be>>>13,Ge=T[0]|0,ge=Ge&8191,_e=Ge>>>13,Re=T[1]|0,ze=Re&8191,Pe=Re>>>13,We=T[2]|0,_t=We&8191,Ve=We>>>13,Te=T[3]|0,Ye=Te&8191,Me=Te>>>13,$e=T[4]|0,mt=$e&8191,ue=$e>>>13,me=T[5]|0,He=me&8191,Ie=me>>>13,je=T[6]|0,rt=je&8191,ce=je>>>13,Ce=T[7]|0,et=Ce&8191,ke=Ce>>>13,tt=T[8]|0,Tt=tt&8191,Ke=tt>>>13,st=T[9]|0,Ze=st&8191,Je=st>>>13;_.negative=b.negative^x.negative,_.length=19,S=Math.imul(B,ge),I=Math.imul(B,_e),I=I+Math.imul(H,ge)|0,M=Math.imul(H,_e);var xt=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(xt>>>26)|0,xt&=67108863,S=Math.imul(ae,ge),I=Math.imul(ae,_e),I=I+Math.imul(ie,ge)|0,M=Math.imul(ie,_e),S=S+Math.imul(B,ze)|0,I=I+Math.imul(B,Pe)|0,I=I+Math.imul(H,ze)|0,M=M+Math.imul(H,Pe)|0;var Ft=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,S=Math.imul(Ne,ge),I=Math.imul(Ne,_e),I=I+Math.imul(ve,ge)|0,M=Math.imul(ve,_e),S=S+Math.imul(ae,ze)|0,I=I+Math.imul(ae,Pe)|0,I=I+Math.imul(ie,ze)|0,M=M+Math.imul(ie,Pe)|0,S=S+Math.imul(B,_t)|0,I=I+Math.imul(B,Ve)|0,I=I+Math.imul(H,_t)|0,M=M+Math.imul(H,Ve)|0;var Ot=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,S=Math.imul(Se,ge),I=Math.imul(Se,_e),I=I+Math.imul(Q,ge)|0,M=Math.imul(Q,_e),S=S+Math.imul(Ne,ze)|0,I=I+Math.imul(Ne,Pe)|0,I=I+Math.imul(ve,ze)|0,M=M+Math.imul(ve,Pe)|0,S=S+Math.imul(ae,_t)|0,I=I+Math.imul(ae,Ve)|0,I=I+Math.imul(ie,_t)|0,M=M+Math.imul(ie,Ve)|0,S=S+Math.imul(B,Ye)|0,I=I+Math.imul(B,Me)|0,I=I+Math.imul(H,Ye)|0,M=M+Math.imul(H,Me)|0;var nr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(nr>>>26)|0,nr&=67108863,S=Math.imul(J,ge),I=Math.imul(J,_e),I=I+Math.imul(te,ge)|0,M=Math.imul(te,_e),S=S+Math.imul(Se,ze)|0,I=I+Math.imul(Se,Pe)|0,I=I+Math.imul(Q,ze)|0,M=M+Math.imul(Q,Pe)|0,S=S+Math.imul(Ne,_t)|0,I=I+Math.imul(Ne,Ve)|0,I=I+Math.imul(ve,_t)|0,M=M+Math.imul(ve,Ve)|0,S=S+Math.imul(ae,Ye)|0,I=I+Math.imul(ae,Me)|0,I=I+Math.imul(ie,Ye)|0,M=M+Math.imul(ie,Me)|0,S=S+Math.imul(B,mt)|0,I=I+Math.imul(B,ue)|0,I=I+Math.imul(H,mt)|0,M=M+Math.imul(H,ue)|0;var wr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(wr>>>26)|0,wr&=67108863,S=Math.imul(be,ge),I=Math.imul(be,_e),I=I+Math.imul(Ae,ge)|0,M=Math.imul(Ae,_e),S=S+Math.imul(J,ze)|0,I=I+Math.imul(J,Pe)|0,I=I+Math.imul(te,ze)|0,M=M+Math.imul(te,Pe)|0,S=S+Math.imul(Se,_t)|0,I=I+Math.imul(Se,Ve)|0,I=I+Math.imul(Q,_t)|0,M=M+Math.imul(Q,Ve)|0,S=S+Math.imul(Ne,Ye)|0,I=I+Math.imul(Ne,Me)|0,I=I+Math.imul(ve,Ye)|0,M=M+Math.imul(ve,Me)|0,S=S+Math.imul(ae,mt)|0,I=I+Math.imul(ae,ue)|0,I=I+Math.imul(ie,mt)|0,M=M+Math.imul(ie,ue)|0,S=S+Math.imul(B,He)|0,I=I+Math.imul(B,Ie)|0,I=I+Math.imul(H,He)|0,M=M+Math.imul(H,Ie)|0;var ir=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(ir>>>26)|0,ir&=67108863,S=Math.imul(Y,ge),I=Math.imul(Y,_e),I=I+Math.imul(ee,ge)|0,M=Math.imul(ee,_e),S=S+Math.imul(be,ze)|0,I=I+Math.imul(be,Pe)|0,I=I+Math.imul(Ae,ze)|0,M=M+Math.imul(Ae,Pe)|0,S=S+Math.imul(J,_t)|0,I=I+Math.imul(J,Ve)|0,I=I+Math.imul(te,_t)|0,M=M+Math.imul(te,Ve)|0,S=S+Math.imul(Se,Ye)|0,I=I+Math.imul(Se,Me)|0,I=I+Math.imul(Q,Ye)|0,M=M+Math.imul(Q,Me)|0,S=S+Math.imul(Ne,mt)|0,I=I+Math.imul(Ne,ue)|0,I=I+Math.imul(ve,mt)|0,M=M+Math.imul(ve,ue)|0,S=S+Math.imul(ae,He)|0,I=I+Math.imul(ae,Ie)|0,I=I+Math.imul(ie,He)|0,M=M+Math.imul(ie,Ie)|0,S=S+Math.imul(B,rt)|0,I=I+Math.imul(B,ce)|0,I=I+Math.imul(H,rt)|0,M=M+Math.imul(H,ce)|0;var er=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(er>>>26)|0,er&=67108863,S=Math.imul(W,ge),I=Math.imul(W,_e),I=I+Math.imul(q,ge)|0,M=Math.imul(q,_e),S=S+Math.imul(Y,ze)|0,I=I+Math.imul(Y,Pe)|0,I=I+Math.imul(ee,ze)|0,M=M+Math.imul(ee,Pe)|0,S=S+Math.imul(be,_t)|0,I=I+Math.imul(be,Ve)|0,I=I+Math.imul(Ae,_t)|0,M=M+Math.imul(Ae,Ve)|0,S=S+Math.imul(J,Ye)|0,I=I+Math.imul(J,Me)|0,I=I+Math.imul(te,Ye)|0,M=M+Math.imul(te,Me)|0,S=S+Math.imul(Se,mt)|0,I=I+Math.imul(Se,ue)|0,I=I+Math.imul(Q,mt)|0,M=M+Math.imul(Q,ue)|0,S=S+Math.imul(Ne,He)|0,I=I+Math.imul(Ne,Ie)|0,I=I+Math.imul(ve,He)|0,M=M+Math.imul(ve,Ie)|0,S=S+Math.imul(ae,rt)|0,I=I+Math.imul(ae,ce)|0,I=I+Math.imul(ie,rt)|0,M=M+Math.imul(ie,ce)|0,S=S+Math.imul(B,et)|0,I=I+Math.imul(B,ke)|0,I=I+Math.imul(H,et)|0,M=M+Math.imul(H,ke)|0;var Ar=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,S=Math.imul(Oe,ge),I=Math.imul(Oe,_e),I=I+Math.imul(Ee,ge)|0,M=Math.imul(Ee,_e),S=S+Math.imul(W,ze)|0,I=I+Math.imul(W,Pe)|0,I=I+Math.imul(q,ze)|0,M=M+Math.imul(q,Pe)|0,S=S+Math.imul(Y,_t)|0,I=I+Math.imul(Y,Ve)|0,I=I+Math.imul(ee,_t)|0,M=M+Math.imul(ee,Ve)|0,S=S+Math.imul(be,Ye)|0,I=I+Math.imul(be,Me)|0,I=I+Math.imul(Ae,Ye)|0,M=M+Math.imul(Ae,Me)|0,S=S+Math.imul(J,mt)|0,I=I+Math.imul(J,ue)|0,I=I+Math.imul(te,mt)|0,M=M+Math.imul(te,ue)|0,S=S+Math.imul(Se,He)|0,I=I+Math.imul(Se,Ie)|0,I=I+Math.imul(Q,He)|0,M=M+Math.imul(Q,Ie)|0,S=S+Math.imul(Ne,rt)|0,I=I+Math.imul(Ne,ce)|0,I=I+Math.imul(ve,rt)|0,M=M+Math.imul(ve,ce)|0,S=S+Math.imul(ae,et)|0,I=I+Math.imul(ae,ke)|0,I=I+Math.imul(ie,et)|0,M=M+Math.imul(ie,ke)|0,S=S+Math.imul(B,Tt)|0,I=I+Math.imul(B,Ke)|0,I=I+Math.imul(H,Tt)|0,M=M+Math.imul(H,Ke)|0;var Ir=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,S=Math.imul(pt,ge),I=Math.imul(pt,_e),I=I+Math.imul(xe,ge)|0,M=Math.imul(xe,_e),S=S+Math.imul(Oe,ze)|0,I=I+Math.imul(Oe,Pe)|0,I=I+Math.imul(Ee,ze)|0,M=M+Math.imul(Ee,Pe)|0,S=S+Math.imul(W,_t)|0,I=I+Math.imul(W,Ve)|0,I=I+Math.imul(q,_t)|0,M=M+Math.imul(q,Ve)|0,S=S+Math.imul(Y,Ye)|0,I=I+Math.imul(Y,Me)|0,I=I+Math.imul(ee,Ye)|0,M=M+Math.imul(ee,Me)|0,S=S+Math.imul(be,mt)|0,I=I+Math.imul(be,ue)|0,I=I+Math.imul(Ae,mt)|0,M=M+Math.imul(Ae,ue)|0,S=S+Math.imul(J,He)|0,I=I+Math.imul(J,Ie)|0,I=I+Math.imul(te,He)|0,M=M+Math.imul(te,Ie)|0,S=S+Math.imul(Se,rt)|0,I=I+Math.imul(Se,ce)|0,I=I+Math.imul(Q,rt)|0,M=M+Math.imul(Q,ce)|0,S=S+Math.imul(Ne,et)|0,I=I+Math.imul(Ne,ke)|0,I=I+Math.imul(ve,et)|0,M=M+Math.imul(ve,ke)|0,S=S+Math.imul(ae,Tt)|0,I=I+Math.imul(ae,Ke)|0,I=I+Math.imul(ie,Tt)|0,M=M+Math.imul(ie,Ke)|0,S=S+Math.imul(B,Ze)|0,I=I+Math.imul(B,Je)|0,I=I+Math.imul(H,Ze)|0,M=M+Math.imul(H,Je)|0;var pr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(pr>>>26)|0,pr&=67108863,S=Math.imul(pt,ze),I=Math.imul(pt,Pe),I=I+Math.imul(xe,ze)|0,M=Math.imul(xe,Pe),S=S+Math.imul(Oe,_t)|0,I=I+Math.imul(Oe,Ve)|0,I=I+Math.imul(Ee,_t)|0,M=M+Math.imul(Ee,Ve)|0,S=S+Math.imul(W,Ye)|0,I=I+Math.imul(W,Me)|0,I=I+Math.imul(q,Ye)|0,M=M+Math.imul(q,Me)|0,S=S+Math.imul(Y,mt)|0,I=I+Math.imul(Y,ue)|0,I=I+Math.imul(ee,mt)|0,M=M+Math.imul(ee,ue)|0,S=S+Math.imul(be,He)|0,I=I+Math.imul(be,Ie)|0,I=I+Math.imul(Ae,He)|0,M=M+Math.imul(Ae,Ie)|0,S=S+Math.imul(J,rt)|0,I=I+Math.imul(J,ce)|0,I=I+Math.imul(te,rt)|0,M=M+Math.imul(te,ce)|0,S=S+Math.imul(Se,et)|0,I=I+Math.imul(Se,ke)|0,I=I+Math.imul(Q,et)|0,M=M+Math.imul(Q,ke)|0,S=S+Math.imul(Ne,Tt)|0,I=I+Math.imul(Ne,Ke)|0,I=I+Math.imul(ve,Tt)|0,M=M+Math.imul(ve,Ke)|0,S=S+Math.imul(ae,Ze)|0,I=I+Math.imul(ae,Je)|0,I=I+Math.imul(ie,Ze)|0,M=M+Math.imul(ie,Je)|0;var Sr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,S=Math.imul(pt,_t),I=Math.imul(pt,Ve),I=I+Math.imul(xe,_t)|0,M=Math.imul(xe,Ve),S=S+Math.imul(Oe,Ye)|0,I=I+Math.imul(Oe,Me)|0,I=I+Math.imul(Ee,Ye)|0,M=M+Math.imul(Ee,Me)|0,S=S+Math.imul(W,mt)|0,I=I+Math.imul(W,ue)|0,I=I+Math.imul(q,mt)|0,M=M+Math.imul(q,ue)|0,S=S+Math.imul(Y,He)|0,I=I+Math.imul(Y,Ie)|0,I=I+Math.imul(ee,He)|0,M=M+Math.imul(ee,Ie)|0,S=S+Math.imul(be,rt)|0,I=I+Math.imul(be,ce)|0,I=I+Math.imul(Ae,rt)|0,M=M+Math.imul(Ae,ce)|0,S=S+Math.imul(J,et)|0,I=I+Math.imul(J,ke)|0,I=I+Math.imul(te,et)|0,M=M+Math.imul(te,ke)|0,S=S+Math.imul(Se,Tt)|0,I=I+Math.imul(Se,Ke)|0,I=I+Math.imul(Q,Tt)|0,M=M+Math.imul(Q,Ke)|0,S=S+Math.imul(Ne,Ze)|0,I=I+Math.imul(Ne,Je)|0,I=I+Math.imul(ve,Ze)|0,M=M+Math.imul(ve,Je)|0;var or=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(or>>>26)|0,or&=67108863,S=Math.imul(pt,Ye),I=Math.imul(pt,Me),I=I+Math.imul(xe,Ye)|0,M=Math.imul(xe,Me),S=S+Math.imul(Oe,mt)|0,I=I+Math.imul(Oe,ue)|0,I=I+Math.imul(Ee,mt)|0,M=M+Math.imul(Ee,ue)|0,S=S+Math.imul(W,He)|0,I=I+Math.imul(W,Ie)|0,I=I+Math.imul(q,He)|0,M=M+Math.imul(q,Ie)|0,S=S+Math.imul(Y,rt)|0,I=I+Math.imul(Y,ce)|0,I=I+Math.imul(ee,rt)|0,M=M+Math.imul(ee,ce)|0,S=S+Math.imul(be,et)|0,I=I+Math.imul(be,ke)|0,I=I+Math.imul(Ae,et)|0,M=M+Math.imul(Ae,ke)|0,S=S+Math.imul(J,Tt)|0,I=I+Math.imul(J,Ke)|0,I=I+Math.imul(te,Tt)|0,M=M+Math.imul(te,Ke)|0,S=S+Math.imul(Se,Ze)|0,I=I+Math.imul(Se,Je)|0,I=I+Math.imul(Q,Ze)|0,M=M+Math.imul(Q,Je)|0;var mr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(mr>>>26)|0,mr&=67108863,S=Math.imul(pt,mt),I=Math.imul(pt,ue),I=I+Math.imul(xe,mt)|0,M=Math.imul(xe,ue),S=S+Math.imul(Oe,He)|0,I=I+Math.imul(Oe,Ie)|0,I=I+Math.imul(Ee,He)|0,M=M+Math.imul(Ee,Ie)|0,S=S+Math.imul(W,rt)|0,I=I+Math.imul(W,ce)|0,I=I+Math.imul(q,rt)|0,M=M+Math.imul(q,ce)|0,S=S+Math.imul(Y,et)|0,I=I+Math.imul(Y,ke)|0,I=I+Math.imul(ee,et)|0,M=M+Math.imul(ee,ke)|0,S=S+Math.imul(be,Tt)|0,I=I+Math.imul(be,Ke)|0,I=I+Math.imul(Ae,Tt)|0,M=M+Math.imul(Ae,Ke)|0,S=S+Math.imul(J,Ze)|0,I=I+Math.imul(J,Je)|0,I=I+Math.imul(te,Ze)|0,M=M+Math.imul(te,Je)|0;var kr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(kr>>>26)|0,kr&=67108863,S=Math.imul(pt,He),I=Math.imul(pt,Ie),I=I+Math.imul(xe,He)|0,M=Math.imul(xe,Ie),S=S+Math.imul(Oe,rt)|0,I=I+Math.imul(Oe,ce)|0,I=I+Math.imul(Ee,rt)|0,M=M+Math.imul(Ee,ce)|0,S=S+Math.imul(W,et)|0,I=I+Math.imul(W,ke)|0,I=I+Math.imul(q,et)|0,M=M+Math.imul(q,ke)|0,S=S+Math.imul(Y,Tt)|0,I=I+Math.imul(Y,Ke)|0,I=I+Math.imul(ee,Tt)|0,M=M+Math.imul(ee,Ke)|0,S=S+Math.imul(be,Ze)|0,I=I+Math.imul(be,Je)|0,I=I+Math.imul(Ae,Ze)|0,M=M+Math.imul(Ae,Je)|0;var Cr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,S=Math.imul(pt,rt),I=Math.imul(pt,ce),I=I+Math.imul(xe,rt)|0,M=Math.imul(xe,ce),S=S+Math.imul(Oe,et)|0,I=I+Math.imul(Oe,ke)|0,I=I+Math.imul(Ee,et)|0,M=M+Math.imul(Ee,ke)|0,S=S+Math.imul(W,Tt)|0,I=I+Math.imul(W,Ke)|0,I=I+Math.imul(q,Tt)|0,M=M+Math.imul(q,Ke)|0,S=S+Math.imul(Y,Ze)|0,I=I+Math.imul(Y,Je)|0,I=I+Math.imul(ee,Ze)|0,M=M+Math.imul(ee,Je)|0;var Mr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,S=Math.imul(pt,et),I=Math.imul(pt,ke),I=I+Math.imul(xe,et)|0,M=Math.imul(xe,ke),S=S+Math.imul(Oe,Tt)|0,I=I+Math.imul(Oe,Ke)|0,I=I+Math.imul(Ee,Tt)|0,M=M+Math.imul(Ee,Ke)|0,S=S+Math.imul(W,Ze)|0,I=I+Math.imul(W,Je)|0,I=I+Math.imul(q,Ze)|0,M=M+Math.imul(q,Je)|0;var Or=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Or>>>26)|0,Or&=67108863,S=Math.imul(pt,Tt),I=Math.imul(pt,Ke),I=I+Math.imul(xe,Tt)|0,M=Math.imul(xe,Ke),S=S+Math.imul(Oe,Ze)|0,I=I+Math.imul(Oe,Je)|0,I=I+Math.imul(Ee,Ze)|0,M=M+Math.imul(Ee,Je)|0;var zo=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(zo>>>26)|0,zo&=67108863,S=Math.imul(pt,Ze),I=Math.imul(pt,Je),I=I+Math.imul(xe,Ze)|0,M=Math.imul(xe,Je);var fe=(p+S|0)+((I&8191)<<13)|0;return p=(M+(I>>>13)|0)+(fe>>>26)|0,fe&=67108863,k[0]=xt,k[1]=Ft,k[2]=Ot,k[3]=nr,k[4]=wr,k[5]=ir,k[6]=er,k[7]=Ar,k[8]=Ir,k[9]=pr,k[10]=Sr,k[11]=or,k[12]=mr,k[13]=kr,k[14]=Cr,k[15]=Mr,k[16]=Or,k[17]=zo,k[18]=fe,p!==0&&(k[19]=p,_.length++),_},"L");Math.imul||(R=O);function P(b,x,_){_.negative=x.negative^b.negative,_.length=b.length+x.length;for(var N=0,T=0,k=0;k<_.length-1;k++){var p=T;T=0;for(var S=N&67108863,I=Math.min(k,x.length-1),M=Math.max(0,k-b.length+1);M<=I;M++){var U=k-M,B=b.words[U]|0,H=x.words[M]|0,$=B*H,ae=$&67108863;p=p+($/67108864|0)|0,ae=ae+S|0,S=ae&67108863,p=p+(ae>>>26)|0,T+=p>>>26,p&=67108863}_.words[k]=S,N=p,p=T}return N!==0?_.words[k]=N:_.length--,_._strip()}a(P,"b");function L(b,x,_){return P(b,x,_)}a(L,"y"),o.prototype.mulTo=function(b,x){var _,N=this.length+b.length;return this.length===10&&b.length===10?_=R(this,b,x):N<63?_=O(this,b,x):N<1024?_=P(this,b,x):_=L(this,b,x),_},o.prototype.mul=function(b){var x=new o(null);return x.words=Array(this.length+b.length),this.mulTo(b,x)},o.prototype.mulf=function(b){var x=new o(null);return x.words=Array(this.length+b.length),L(this,b,x)},o.prototype.imul=function(b){return this.clone().mulTo(b,this)},o.prototype.imuln=function(b){var x=b<0;x&&(b=-b),i(typeof b=="number"),i(b<67108864);for(var _=0,N=0;N<this.length;N++){var T=(this.words[N]|0)*b,k=(T&67108863)+(_&67108863);_>>=26,_+=T/67108864|0,_+=k>>>26,this.words[N]=k&67108863}return _!==0&&(this.words[N]=_,this.length++),this.length=b===0?1:this.length,x?this.ineg():this},o.prototype.muln=function(b){return this.clone().imuln(b)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(b){var x=C(b);if(x.length===0)return new o(1);for(var _=this,N=0;N<x.length&&x[N]===0;N++,_=_.sqr());if(++N<x.length)for(var T=_.sqr();N<x.length;N++,T=T.sqr())x[N]!==0&&(_=_.mul(T));return _},o.prototype.iushln=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26,N=67108863>>>26-x<<26-x,T;if(x!==0){var k=0;for(T=0;T<this.length;T++){var p=this.words[T]&N,S=(this.words[T]|0)-p<<x;this.words[T]=S|k,k=p>>>26-x}k&&(this.words[T]=k,this.length++)}if(_!==0){for(T=this.length-1;T>=0;T--)this.words[T+_]=this.words[T];for(T=0;T<_;T++)this.words[T]=0;this.length+=_}return this._strip()},o.prototype.ishln=function(b){return i(this.negative===0),this.iushln(b)},o.prototype.iushrn=function(b,x,_){i(typeof b=="number"&&b>=0);var N;x?N=(x-x%26)/26:N=0;var T=b%26,k=Math.min((b-T)/26,this.length),p=67108863^67108863>>>T<<T,S=_;if(N-=k,N=Math.max(0,N),S){for(var I=0;I<k;I++)S.words[I]=this.words[I];S.length=k}if(k!==0)if(this.length>k)for(this.length-=k,I=0;I<this.length;I++)this.words[I]=this.words[I+k];else this.words[0]=0,this.length=1;var M=0;for(I=this.length-1;I>=0&&(M!==0||I>=N);I--){var U=this.words[I]|0;this.words[I]=M<<26-T|U>>>T,M=U&p}return S&&M!==0&&(S.words[S.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(b,x,_){return i(this.negative===0),this.iushrn(b,x,_)},o.prototype.shln=function(b){return this.clone().ishln(b)},o.prototype.ushln=function(b){return this.clone().iushln(b)},o.prototype.shrn=function(b){return this.clone().ishrn(b)},o.prototype.ushrn=function(b){return this.clone().iushrn(b)},o.prototype.testn=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26,N=1<<x;if(this.length<=_)return!1;var T=this.words[_];return!!(T&N)},o.prototype.imaskn=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(x!==0&&_++,this.length=Math.min(_,this.length),x!==0){var N=67108863^67108863>>>x<<x;this.words[this.length-1]&=N}return this._strip()},o.prototype.maskn=function(b){return this.clone().imaskn(b)},o.prototype.iaddn=function(b){return i(typeof b=="number"),i(b<67108864),b<0?this.isubn(-b):this.negative!==0?this.length===1&&(this.words[0]|0)<=b?(this.words[0]=b-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(b),this.negative=1,this):this._iaddn(b)},o.prototype._iaddn=function(b){this.words[0]+=b;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},o.prototype.isubn=function(b){if(i(typeof b=="number"),i(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this._strip()},o.prototype.addn=function(b){return this.clone().iaddn(b)},o.prototype.subn=function(b){return this.clone().isubn(b)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(b,x,_){var N=b.length+_,T;this._expand(N);var k,p=0;for(T=0;T<b.length;T++){k=(this.words[T+_]|0)+p;var S=(b.words[T]|0)*x;k-=S&67108863,p=(k>>26)-(S/67108864|0),this.words[T+_]=k&67108863}for(;T<this.length-_;T++)k=(this.words[T+_]|0)+p,p=k>>26,this.words[T+_]=k&67108863;if(p===0)return this._strip();for(i(p===-1),p=0,T=0;T<this.length;T++)k=-(this.words[T]|0)+p,p=k>>26,this.words[T]=k&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(b,x){var _=this.length-b.length,N=this.clone(),T=b,k=T.words[T.length-1]|0,p=this._countBits(k);_=26-p,_!==0&&(T=T.ushln(_),N.iushln(_),k=T.words[T.length-1]|0);var S=N.length-T.length,I;if(x!=="mod"){I=new o(null),I.length=S+1,I.words=Array(I.length);for(var M=0;M<I.length;M++)I.words[M]=0}var U=N.clone()._ishlnsubmul(T,1,S);U.negative===0&&(N=U,I&&(I.words[S]=1));for(var B=S-1;B>=0;B--){var H=(N.words[T.length+B]|0)*67108864+(N.words[T.length+B-1]|0);for(H=Math.min(H/k|0,67108863),N._ishlnsubmul(T,H,B);N.negative!==0;)H--,N.negative=0,N._ishlnsubmul(T,1,B),!N.isZero()&&(N.negative^=1);I&&(I.words[B]=H)}return I&&I._strip(),N._strip(),x!=="div"&&_!==0&&N.iushrn(_),{div:I||null,mod:N}},o.prototype.divmod=function(b,x,_){if(i(!b.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var N,T,k;return this.negative!==0&&b.negative===0?(k=this.neg().divmod(b,x),x!=="mod"&&(N=k.div.neg()),x!=="div"&&(T=k.mod.neg(),_&&T.negative!==0&&T.iadd(b)),{div:N,mod:T}):this.negative===0&&b.negative!==0?(k=this.divmod(b.neg(),x),x!=="mod"&&(N=k.div.neg()),{div:N,mod:k.mod}):(this.negative&b.negative)!==0?(k=this.neg().divmod(b.neg(),x),x!=="div"&&(T=k.mod.neg(),_&&T.negative!==0&&T.isub(b)),{div:k.div,mod:T}):b.length>this.length||this.cmp(b)<0?{div:new o(0),mod:this}:b.length===1?x==="div"?{div:this.divn(b.words[0]),mod:null}:x==="mod"?{div:null,mod:new o(this.modrn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new o(this.modrn(b.words[0]))}:this._wordDiv(b,x)},o.prototype.div=function(b){return this.divmod(b,"div",!1).div},o.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},o.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},o.prototype.divRound=function(b){var x=this.divmod(b);if(x.mod.isZero())return x.div;var _=x.div.negative!==0?x.mod.isub(b):x.mod,N=b.ushrn(1),T=b.andln(1),k=_.cmp(N);return k<0||T===1&&k===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},o.prototype.modrn=function(b){var x=b<0;x&&(b=-b),i(b<=67108863);for(var _=67108864%b,N=0,T=this.length-1;T>=0;T--)N=(_*N+(this.words[T]|0))%b;return x?-N:N},o.prototype.modn=function(b){return this.modrn(b)},o.prototype.idivn=function(b){var x=b<0;x&&(b=-b),i(b<=67108863);for(var _=0,N=this.length-1;N>=0;N--){var T=(this.words[N]|0)+_*67108864;this.words[N]=T/b|0,_=T%b}return this._strip(),x?this.ineg():this},o.prototype.divn=function(b){return this.clone().idivn(b)},o.prototype.egcd=function(b){i(b.negative===0),i(!b.isZero());var x=this,_=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var N=new o(1),T=new o(0),k=new o(0),p=new o(1),S=0;x.isEven()&&_.isEven();)x.iushrn(1),_.iushrn(1),++S;for(var I=_.clone(),M=x.clone();!x.isZero();){for(var U=0,B=1;(x.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(x.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(I),T.isub(M)),N.iushrn(1),T.iushrn(1);for(var H=0,$=1;(_.words[0]&$)===0&&H<26;++H,$<<=1);if(H>0)for(_.iushrn(H);H-- >0;)(k.isOdd()||p.isOdd())&&(k.iadd(I),p.isub(M)),k.iushrn(1),p.iushrn(1);x.cmp(_)>=0?(x.isub(_),N.isub(k),T.isub(p)):(_.isub(x),k.isub(N),p.isub(T))}return{a:k,b:p,gcd:_.iushln(S)}},o.prototype._invmp=function(b){i(b.negative===0),i(!b.isZero());var x=this,_=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var N=new o(1),T=new o(0),k=_.clone();x.cmpn(1)>0&&_.cmpn(1)>0;){for(var p=0,S=1;(x.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(x.iushrn(p);p-- >0;)N.isOdd()&&N.iadd(k),N.iushrn(1);for(var I=0,M=1;(_.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(_.iushrn(I);I-- >0;)T.isOdd()&&T.iadd(k),T.iushrn(1);x.cmp(_)>=0?(x.isub(_),N.isub(T)):(_.isub(x),T.isub(N))}var U;return x.cmpn(1)===0?U=N:U=T,U.cmpn(0)<0&&U.iadd(b),U},o.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var x=this.clone(),_=b.clone();x.negative=0,_.negative=0;for(var N=0;x.isEven()&&_.isEven();N++)x.iushrn(1),_.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;_.isEven();)_.iushrn(1);var T=x.cmp(_);if(T<0){var k=x;x=_,_=k}else if(T===0||_.cmpn(1)===0)break;x.isub(_)}while(!0);return _.iushln(N)},o.prototype.invm=function(b){return this.egcd(b).a.umod(b)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(b){return this.words[0]&b},o.prototype.bincn=function(b){i(typeof b=="number");var x=b%26,_=(b-x)/26,N=1<<x;if(this.length<=_)return this._expand(_+1),this.words[_]|=N,this;for(var T=N,k=_;T!==0&&k<this.length;k++){var p=this.words[k]|0;p+=T,T=p>>>26,p&=67108863,this.words[k]=p}return T!==0&&(this.words[k]=T,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(b){var x=b<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this._strip();var _;if(this.length>1)_=1;else{x&&(b=-b),i(b<=67108863,"Number is too big");var N=this.words[0]|0;_=N===b?0:N<b?-1:1}return this.negative!==0?-_|0:_},o.prototype.cmp=function(b){if(this.negative!==0&&b.negative===0)return-1;if(this.negative===0&&b.negative!==0)return 1;var x=this.ucmp(b);return this.negative!==0?-x|0:x},o.prototype.ucmp=function(b){if(this.length>b.length)return 1;if(this.length<b.length)return-1;for(var x=0,_=this.length-1;_>=0;_--){var N=this.words[_]|0,T=b.words[_]|0;if(N!==T){N<T?x=-1:N>T&&(x=1);break}}return x},o.prototype.gtn=function(b){return this.cmpn(b)===1},o.prototype.gt=function(b){return this.cmp(b)===1},o.prototype.gten=function(b){return this.cmpn(b)>=0},o.prototype.gte=function(b){return this.cmp(b)>=0},o.prototype.ltn=function(b){return this.cmpn(b)===-1},o.prototype.lt=function(b){return this.cmp(b)===-1},o.prototype.lten=function(b){return this.cmpn(b)<=0},o.prototype.lte=function(b){return this.cmp(b)<=0},o.prototype.eqn=function(b){return this.cmpn(b)===0},o.prototype.eq=function(b){return this.cmp(b)===0},o.red=function(b){return new h(b)},o.prototype.toRed=function(b){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(b){return this.red=b,this},o.prototype.forceRed=function(b){return i(!this.red,"Already a number in reduction context"),this._forceRed(b)},o.prototype.redAdd=function(b){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},o.prototype.redIAdd=function(b){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},o.prototype.redSub=function(b){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},o.prototype.redISub=function(b){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},o.prototype.redShl=function(b){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},o.prototype.redMul=function(b){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},o.prototype.redIMul=function(b){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(b){return i(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var j={k256:null,p224:null,p192:null,p25519:null};function G(b,x){this.name=b,this.p=new o(x,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(G,"$$"),G.prototype._tmp=function(){var b=new o(null);return b.words=Array(Math.ceil(this.n/13)),b},G.prototype.ireduce=function(b){var x=b,_;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),_=x.bitLength();while(_>this.n);var N=_<this.n?-1:x.ucmp(this.p);return N===0?(x.words[0]=0,x.length=1):N>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},G.prototype.split=function(b,x){b.iushrn(this.n,0,x)},G.prototype.imulK=function(b){return b.imul(this.k)};function Z(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Z,"Q"),s(Z,G),Z.prototype.split=function(b,x){for(var _=4194303,N=Math.min(b.length,9),T=0;T<N;T++)x.words[T]=b.words[T];if(x.length=N,b.length<=9){b.words[0]=0,b.length=1;return}var k=b.words[9];for(x.words[x.length++]=k&_,T=10;T<b.length;T++){var p=b.words[T]|0;b.words[T-10]=(p&_)<<4|k>>>22,k=p}k>>>=22,b.words[T-10]=k,k===0&&b.length>10?b.length-=10:b.length-=9},Z.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var x=0,_=0;_<b.length;_++){var N=b.words[_]|0;x+=N*977,b.words[_]=x&67108863,x=N*64+(x/67108864|0)}return b.words[b.length-1]===0&&(b.length--,b.words[b.length-1]===0&&b.length--),b};function K(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(K,"c"),s(K,G);function z(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(z,"a"),s(z,G);function V(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(V,"j"),s(V,G),V.prototype.imulK=function(b){for(var x=0,_=0;_<b.length;_++){var N=(b.words[_]|0)*19+x,T=N&67108863;N>>>=26,b.words[_]=T,x=N}return x!==0&&(b.words[b.length++]=x),b},o._prime=function(b){if(j[b])return j[b];var x;if(b==="k256")x=new Z;else if(b==="p224")x=new K;else if(b==="p192")x=new z;else if(b==="p25519")x=new V;else throw Error("Unknown prime "+b);return j[b]=x,x};function h(b){if(typeof b=="string"){var x=o._prime(b);this.m=x.p,this.prime=x}else i(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}a(h,"J"),h.prototype._verify1=function(b){i(b.negative===0,"red works only with positives"),i(b.red,"red works only with red numbers")},h.prototype._verify2=function(b,x){i((b.negative|x.negative)===0,"red works only with positives"),i(b.red&&b.red===x.red,"red works only with red numbers")},h.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):(f(b,b.umod(this.m)._forceRed(this)),b)},h.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},h.prototype.add=function(b,x){this._verify2(b,x);var _=b.add(x);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},h.prototype.iadd=function(b,x){this._verify2(b,x);var _=b.iadd(x);return _.cmp(this.m)>=0&&_.isub(this.m),_},h.prototype.sub=function(b,x){this._verify2(b,x);var _=b.sub(x);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},h.prototype.isub=function(b,x){this._verify2(b,x);var _=b.isub(x);return _.cmpn(0)<0&&_.iadd(this.m),_},h.prototype.shl=function(b,x){return this._verify1(b),this.imod(b.ushln(x))},h.prototype.imul=function(b,x){return this._verify2(b,x),this.imod(b.imul(x))},h.prototype.mul=function(b,x){return this._verify2(b,x),this.imod(b.mul(x))},h.prototype.isqr=function(b){return this.imul(b,b.clone())},h.prototype.sqr=function(b){return this.mul(b,b)},h.prototype.sqrt=function(b){if(b.isZero())return b.clone();var x=this.m.andln(3);if(i(x%2===1),x===3){var _=this.m.add(new o(1)).iushrn(2);return this.pow(b,_)}for(var N=this.m.subn(1),T=0;!N.isZero()&&N.andln(1)===0;)T++,N.iushrn(1);i(!N.isZero());var k=new o(1).toRed(this),p=k.redNeg(),S=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new o(2*I*I).toRed(this);this.pow(I,S).cmp(p)!==0;)I.redIAdd(p);for(var M=this.pow(I,N),U=this.pow(b,N.addn(1).iushrn(1)),B=this.pow(b,N),H=T;B.cmp(k)!==0;){for(var $=B,ae=0;$.cmp(k)!==0;ae++)$=$.redSqr();i(ae<H);var ie=this.pow(M,new o(1).iushln(H-ae-1));U=U.redMul(ie),M=ie.redSqr(),B=B.redMul(M),H=ae}return U},h.prototype.invm=function(b){var x=b._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},h.prototype.pow=function(b,x){if(x.isZero())return new o(1).toRed(this);if(x.cmpn(1)===0)return b.clone();var _=4,N=Array(1<<_);N[0]=new o(1).toRed(this),N[1]=b;for(var T=2;T<N.length;T++)N[T]=this.mul(N[T-1],b);var k=N[0],p=0,S=0,I=x.bitLength()%26;for(I===0&&(I=26),T=x.length-1;T>=0;T--){for(var M=x.words[T],U=I-1;U>=0;U--){var B=M>>U&1;if(k!==N[0]&&(k=this.sqr(k)),B===0&&p===0){S=0;continue}p<<=1,p|=B,S++,!(S!==_&&(T!==0||U!==0))&&(k=this.mul(k,N[p]),S=0,p=0)}I=26}return k},h.prototype.convertTo=function(b){var x=b.umod(this.m);return x===b?x.clone():x},h.prototype.convertFrom=function(b){var x=b.clone();return x.red=null,x},o.mont=function(b){return new y(b)};function y(b){h.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(y,"X"),s(y,h),y.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},y.prototype.convertFrom=function(b){var x=this.imod(b.mul(this.rinv));return x.red=null,x},y.prototype.imul=function(b,x){if(b.isZero()||x.isZero())return b.words[0]=0,b.length=1,b;var _=b.imul(x),N=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=_.isub(N).iushrn(this.shift),k=T;return T.cmp(this.m)>=0?k=T.isub(this.m):T.cmpn(0)<0&&(k=T.iadd(this.m)),k._forceRed(this)},y.prototype.mul=function(b,x){if(b.isZero()||x.isZero())return new o(0)._forceRed(this);var _=b.mul(x),N=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=_.isub(N).iushrn(this.shift),k=T;return T.cmp(this.m)>=0?k=T.isub(this.m):T.cmpn(0)<0&&(k=T.iadd(this.m)),k._forceRed(this)},y.prototype.invm=function(b){var x=this.imod(b._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(typeof t>"u"||t,e)}),tg=Qe((e,t)=>{var r=n6(),n=Jl(),i=fn().Buffer;function s(u){var c=u.modulus.byteLength(),d;do d=new r(n(c));while(d.cmp(u.modulus)>=0||!d.umod(u.prime1)||!d.umod(u.prime2));return d}a(s,"O");function o(u){var c=s(u),d=c.toRed(r.mont(u.modulus)).redPow(new r(u.publicExponent)).fromRed();return{blinder:d,unblinder:c.invm(u.modulus)}}a(o,"Y");function l(u,c){var d=o(c),f=c.modulus.byteLength(),g=new r(u).mul(d.blinder).umod(c.modulus),m=g.toRed(r.mont(c.prime1)),w=g.toRed(r.mont(c.prime2)),E=c.coefficient,A=c.prime1,C=c.prime2,O=m.redPow(c.exponent1).fromRed(),R=w.redPow(c.exponent2).fromRed(),P=O.isub(R).imul(E).umod(A).imul(C);return R.iadd(P).imul(d.unblinder).umod(c.modulus).toArrayLike(i,"be",f)}a(l,"v"),l.getr=s,t.exports=l}),i6=Qe((e,t)=>{var r=J0(),n=Jl(),i=Kl(),s=K0(),o=q0(),l=tf(),u=eg(),c=tg(),d=fn().Buffer;t.exports=function(w,E,A){var C;w.padding?C=w.padding:A?C=1:C=4;var O=r(w),R;if(C===4)R=f(O,E);else if(C===1)R=g(O,E,A);else if(C===3){if(R=new l(E),R.cmp(O.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");return A?c(R,O):u(R,O)};function f(w,E){var A=w.modulus.byteLength(),C=E.length,O=i("sha1").update(d.alloc(0)).digest(),R=O.length,P=2*R;if(C>A-P-2)throw Error("message too long");var L=d.alloc(A-C-P-2),j=A-R-1,G=n(R),Z=o(d.concat([O,L,d.alloc(1,1),E],j),s(G,j)),K=o(G,s(Z,R));return new l(d.concat([d.alloc(1),K,Z],A))}a(f,"w");function g(w,E,A){var C=E.length,O=w.modulus.byteLength();if(C>O-11)throw Error("message too long");var R;return A?R=d.alloc(O-C-3,255):R=m(O-C-3),new l(d.concat([d.from([0,A?1:2]),R,d.alloc(1),E],O))}a(g,"k");function m(w){for(var E=d.allocUnsafe(w),A=0,C=n(w*2),O=0,R;A<w;)O===C.length&&(C=n(w*2),O=0),R=C[O++],R&&(E[A++]=R);return E}a(m,"M")}),a6=Qe((e,t)=>{var r=J0(),n=K0(),i=q0(),s=tf(),o=tg(),l=Kl(),u=eg(),c=fn().Buffer;t.exports=function(m,w,E){var A;m.padding?A=m.padding:E?A=1:A=4;var C=r(m),O=C.modulus.byteLength();if(w.length>O||new s(w).cmp(C.modulus)>=0)throw Error("decryption error");var R;E?R=u(new s(w),C):R=o(w,C);var P=c.alloc(O-R.length);if(R=c.concat([P,R],O),A===4)return d(C,R);if(A===1)return f(C,R,E);if(A===3)return R;throw Error("unknown padding")};function d(m,w){var E=m.modulus.byteLength(),A=l("sha1").update(c.alloc(0)).digest(),C=A.length;if(w[0]!==0)throw Error("decryption error");var O=w.slice(1,C+1),R=w.slice(C+1),P=i(O,n(R,C)),L=i(R,n(P,E-C-1));if(g(A,L.slice(0,C)))throw Error("decryption error");for(var j=C;L[j]===0;)j++;if(L[j++]!==1)throw Error("decryption error");return L.slice(j)}a(d,"Z");function f(m,w,E){for(var A=w.slice(0,2),C=2,O=0;w[C++]!==0;)if(C>=w.length){O++;break}var R=w.slice(2,C-1);if((A.toString("hex")!=="0002"&&!E||A.toString("hex")!=="0001"&&E)&&O++,R.length<8&&O++,O)throw Error("decryption error");return w.slice(C)}a(f,"w");function g(m,w){m=c.from(m),w=c.from(w);var E=0,A=m.length;m.length!==w.length&&(E++,A=Math.min(m.length,w.length));for(var C=-1;++C<A;)E+=m[C]^w[C];return E}a(g,"k")}),rf=Qe(e=>{e.publicEncrypt=i6(),e.privateDecrypt=a6(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}}),s6=Qe(e=>{var t=(Qn(),qt(Ln));typeof t.publicEncrypt!="function"&&(t=rf()),e.publicEncrypt=t.publicEncrypt,e.privateDecrypt=t.privateDecrypt,typeof t.privateEncrypt!="function"?e.privateEncrypt=rf().privateEncrypt:e.privateEncrypt=t.privateEncrypt,typeof t.publicDecrypt!="function"?e.publicDecrypt=rf().publicDecrypt:e.publicDecrypt=t.publicDecrypt}),o6=Qe(e=>{var t=fn(),r=Jl(),n=t.Buffer,i=t.kMaxLength,s=globalThis.crypto||globalThis.msCrypto,o=Math.pow(2,32)-1;function l(g,m){if(typeof g!="number"||g!==g)throw TypeError("offset must be a number");if(g>o||g<0)throw TypeError("offset must be a uint32");if(g>i||g>m)throw RangeError("offset out of range")}a(l,"v");function u(g,m,w){if(typeof g!="number"||g!==g)throw TypeError("size must be a number");if(g>o||g<0)throw TypeError("size must be a uint32");if(g+m>w||g>i)throw RangeError("buffer too small")}a(u,"W"),s&&s.getRandomValues,e.randomFill=c,e.randomFillSync=f;function c(g,m,w,E){if(!n.isBuffer(g)&&!(g instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")E=m,m=0,w=g.length;else if(typeof w=="function")E=w,w=g.length-m;else if(typeof E!="function")throw TypeError('"cb" argument must be a function');return l(m,g.length),u(w,m,g.length),d(g,m,w,E)}a(c,"T");function d(g,m,w,E){if(E){r(w,function(C,O){if(C)return E(C);O.copy(g,m),E(null,g)});return}var A=r(w);return A.copy(g,m),g}a(d,"Z");function f(g,m,w){if(typeof m>"u"&&(m=0),!n.isBuffer(g)&&!(g instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');return l(m,g.length),w===void 0&&(w=g.length-m),u(w,m,g.length),d(g,m,w)}a(f,"w")}),l6=Qe((e,t)=>{var r=(Qn(),qt(Ln));typeof r.randomFill=="function"&&typeof r.randomFillSync=="function"?(e.randomFill=r.randomFill,e.randomFillSync=r.randomFillSync):t.exports=o6()}),u6=Qe(e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=Jl(),e.createHash=e.Hash=Kl(),e.createHmac=e.Hmac=N0();var t=R1(),r=Object.keys(t),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);e.getHashes=function(){return n};var i=B0();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var s=mE();e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var o=gE();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var l=bE();e.createSign=l.createSign,e.Sign=l.Sign,e.createVerify=l.createVerify,e.Verify=l.Verify,e.createECDH=zE();var u=s6();e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var c=l6();e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
38
+ `)}}),$E=Qe(e=>{var t=e;t.der=$0(),t.pem=QE()}),Qo=Qe(e=>{var t=e;t.bignum=FE(),t.define=HE().define,t.base=Yo(),t.constants=Y0(),t.decoders=YE(),t.encoders=$E()}),XE=Qe((e,t)=>{var r=Qo(),n=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),i=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),s=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),o=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}),l=r.define("RelativeDistinguishedName",function(){this.setof(i)}),u=r.define("RDNSequence",function(){this.seqof(l)}),c=r.define("Name",function(){this.choice({rdnSequence:this.use(u)})}),d=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),f=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),g=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(c),this.key("validity").use(d),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(o),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())}),m=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(g),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())});t.exports=m}),JE=Qe(e=>{var t=Qo();e.certificate=XE();var r=t.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});e.RSAPrivateKey=r;var n=t.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});e.RSAPublicKey=n;var i=t.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),s=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(i),this.key("subjectPublicKey").bitstr())});e.PublicKey=s;var o=t.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(i),this.key("subjectPrivateKey").octstr())});e.PrivateKey=o;var l=t.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});e.EncryptedPrivateKey=l;var u=t.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});e.DSAPrivateKey=u,e.DSAparam=t.define("DSAparam",function(){this.int()});var c=t.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),d=t.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(c),this.key("publicKey").optional().explicit(1).bitstr())});e.ECPrivateKey=d,e.signature=t.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),KE=Qe((e,t)=>{t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),qE=Qe((e,t)=>{var r=fn().Buffer,n=rI().Transform,i=Mn();function s(c){n.call(this),this._block=r.allocUnsafe(c),this._blockSize=c,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}a(s,"O"),i(s,n),s.prototype._transform=function(c,d,f){var g=null;try{this.update(c,d)}catch(m){g=m}f(g)},s.prototype._flush=function(c){var d=null;try{this.push(this.digest())}catch(f){d=f}c(d)};var o=typeof Uint8Array<"u",l=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);function u(c,d){if(c instanceof r)return c;if(typeof c=="string")return r.from(c,d);if(l&&ArrayBuffer.isView(c)){if(c.byteLength===0)return r.alloc(0);var f=r.from(c.buffer,c.byteOffset,c.byteLength);if(f.byteLength===c.byteLength)return f}if(o&&c instanceof Uint8Array||r.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return r.from(c);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}a(u,"W"),s.prototype.update=function(c,d){if(this._finalized)throw Error("Digest already called");c=u(c,d);for(var f=this._block,g=0;this._blockOffset+c.length-g>=this._blockSize;){for(var m=this._blockOffset;m<this._blockSize;)f[m++]=c[g++];this._update(),this._blockOffset=0}for(;g<c.length;)f[this._blockOffset++]=c[g++];for(var w=0,E=c.length*8;E>0;++w)this._length[w]+=E,E=this._length[w]/4294967296|0,E>0&&(this._length[w]-=4294967296*E);return this},s.prototype._update=function(){throw Error("_update is not implemented")},s.prototype.digest=function(c){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var d=this._digest();c!==void 0&&(d=d.toString(c)),this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return d},s.prototype._digest=function(){throw Error("_digest is not implemented")},t.exports=s}),e6=Qe((e,t)=>{var r=Mn(),n=qE(),i=fn().Buffer,s=Array(16);function o(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}a(o,"Y"),r(o,n),o.prototype._update=function(){for(var g=s,m=0;m<16;++m)g[m]=this._block.readInt32LE(m*4);var w=this._a,E=this._b,A=this._c,C=this._d;w=u(w,E,A,C,g[0],3614090360,7),C=u(C,w,E,A,g[1],3905402710,12),A=u(A,C,w,E,g[2],606105819,17),E=u(E,A,C,w,g[3],3250441966,22),w=u(w,E,A,C,g[4],4118548399,7),C=u(C,w,E,A,g[5],1200080426,12),A=u(A,C,w,E,g[6],2821735955,17),E=u(E,A,C,w,g[7],4249261313,22),w=u(w,E,A,C,g[8],1770035416,7),C=u(C,w,E,A,g[9],2336552879,12),A=u(A,C,w,E,g[10],4294925233,17),E=u(E,A,C,w,g[11],2304563134,22),w=u(w,E,A,C,g[12],1804603682,7),C=u(C,w,E,A,g[13],4254626195,12),A=u(A,C,w,E,g[14],2792965006,17),E=u(E,A,C,w,g[15],1236535329,22),w=c(w,E,A,C,g[1],4129170786,5),C=c(C,w,E,A,g[6],3225465664,9),A=c(A,C,w,E,g[11],643717713,14),E=c(E,A,C,w,g[0],3921069994,20),w=c(w,E,A,C,g[5],3593408605,5),C=c(C,w,E,A,g[10],38016083,9),A=c(A,C,w,E,g[15],3634488961,14),E=c(E,A,C,w,g[4],3889429448,20),w=c(w,E,A,C,g[9],568446438,5),C=c(C,w,E,A,g[14],3275163606,9),A=c(A,C,w,E,g[3],4107603335,14),E=c(E,A,C,w,g[8],1163531501,20),w=c(w,E,A,C,g[13],2850285829,5),C=c(C,w,E,A,g[2],4243563512,9),A=c(A,C,w,E,g[7],1735328473,14),E=c(E,A,C,w,g[12],2368359562,20),w=d(w,E,A,C,g[5],4294588738,4),C=d(C,w,E,A,g[8],2272392833,11),A=d(A,C,w,E,g[11],1839030562,16),E=d(E,A,C,w,g[14],4259657740,23),w=d(w,E,A,C,g[1],2763975236,4),C=d(C,w,E,A,g[4],1272893353,11),A=d(A,C,w,E,g[7],4139469664,16),E=d(E,A,C,w,g[10],3200236656,23),w=d(w,E,A,C,g[13],681279174,4),C=d(C,w,E,A,g[0],3936430074,11),A=d(A,C,w,E,g[3],3572445317,16),E=d(E,A,C,w,g[6],76029189,23),w=d(w,E,A,C,g[9],3654602809,4),C=d(C,w,E,A,g[12],3873151461,11),A=d(A,C,w,E,g[15],530742520,16),E=d(E,A,C,w,g[2],3299628645,23),w=f(w,E,A,C,g[0],4096336452,6),C=f(C,w,E,A,g[7],1126891415,10),A=f(A,C,w,E,g[14],2878612391,15),E=f(E,A,C,w,g[5],4237533241,21),w=f(w,E,A,C,g[12],1700485571,6),C=f(C,w,E,A,g[3],2399980690,10),A=f(A,C,w,E,g[10],4293915773,15),E=f(E,A,C,w,g[1],2240044497,21),w=f(w,E,A,C,g[8],1873313359,6),C=f(C,w,E,A,g[15],4264355552,10),A=f(A,C,w,E,g[6],2734768916,15),E=f(E,A,C,w,g[13],1309151649,21),w=f(w,E,A,C,g[4],4149444226,6),C=f(C,w,E,A,g[11],3174756917,10),A=f(A,C,w,E,g[2],718787259,15),E=f(E,A,C,w,g[9],3951481745,21),this._a=this._a+w|0,this._b=this._b+E|0,this._c=this._c+A|0,this._d=this._d+C|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var g=i.allocUnsafe(16);return g.writeInt32LE(this._a,0),g.writeInt32LE(this._b,4),g.writeInt32LE(this._c,8),g.writeInt32LE(this._d,12),g};function l(g,m){return g<<m|g>>>32-m}a(l,"v");function u(g,m,w,E,A,C,O){return l(g+(m&w|~m&E)+A+C|0,O)+m|0}a(u,"W");function c(g,m,w,E,A,C,O){return l(g+(m&E|w&~E)+A+C|0,O)+m|0}a(c,"T");function d(g,m,w,E,A,C,O){return l(g+(m^w^E)+A+C|0,O)+m|0}a(d,"Z");function f(g,m,w,E,A,C,O){return l(g+(w^(m|~E))+A+C|0,O)+m|0}a(f,"w"),t.exports=o}),t6=Qe((e,t)=>{var r=fn().Buffer,n=e6();function i(s,o,l,u){if(r.isBuffer(s)||(s=r.from(s,"binary")),o&&(r.isBuffer(o)||(o=r.from(o,"binary")),o.length!==8))throw RangeError("salt should be Buffer with 8 byte length");for(var c=l/8,d=r.alloc(c),f=r.alloc(u||0),g=r.alloc(0);c>0||u>0;){var m=new n;m.update(g),m.update(s),o&&m.update(o),g=m.digest();var w=0;if(c>0){var E=d.length-c;w=Math.min(c,g.length),g.copy(d,E,0,w),c-=w}if(w<g.length&&u>0){var A=f.length-u,C=Math.min(u,g.length-w);g.copy(f,A,w,w+C),u-=C}}return g.fill(0),{key:d,iv:f}}a(i,"K"),t.exports=i}),X0=Qe(e=>{var t=(Qn(),qt(Ln));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),r6=Qe((e,t)=>{var r=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=t6(),o=X0(),l=fn().Buffer;t.exports=function(u,c){var d=u.toString(),f=d.match(r),g;if(f){var w="aes"+f[1],E=l.from(f[2],"hex"),A=l.from(f[3].replace(/[\r\n]/g,""),"base64"),C=s(c,E.slice(0,8),parseInt(f[1],10)).key,O=[],R=o.createDecipheriv(w,C,E);O.push(R.update(A)),O.push(R.final()),g=l.concat(O)}else{var m=d.match(i);g=l.from(m[2].replace(/[\r\n]/g,""),"base64")}var P=d.match(n)[1];return{tag:P,data:g}}}),J0=Qe((e,t)=>{var r=JE(),n=KE(),i=r6(),s=X0(),o=B0().pbkdf2Sync,l=fn().Buffer;function u(d,f){var g=d.algorithm.decrypt.kde.kdeparams.salt,m=parseInt(d.algorithm.decrypt.kde.kdeparams.iters.toString(),10),w=n[d.algorithm.decrypt.cipher.algo.join(".")],E=d.algorithm.decrypt.cipher.iv,A=d.subjectPrivateKey,C=parseInt(w.split("-")[1],10)/8,O=o(f,g,m,C,"sha1"),R=s.createDecipheriv(w,O,E),P=[];return P.push(R.update(A)),P.push(R.final()),l.concat(P)}a(u,"W");function c(d){var f;typeof d=="object"&&!l.isBuffer(d)&&(f=d.passphrase,d=d.key),typeof d=="string"&&(d=l.from(d));var g=i(d,f),m=g.tag,w=g.data,E,A;switch(m){case"CERTIFICATE":A=r.certificate.decode(w,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(A||(A=r.PublicKey.decode(w,"der")),E=A.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(A.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return A.subjectPrivateKey=A.subjectPublicKey,{type:"ec",data:A};case"1.2.840.10040.4.1":return A.algorithm.params.pub_key=r.DSAparam.decode(A.subjectPublicKey.data,"der"),{type:"dsa",data:A.algorithm.params};default:throw Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":w=r.EncryptedPrivateKey.decode(w,"der"),w=u(w,f);case"PRIVATE KEY":switch(A=r.PrivateKey.decode(w,"der"),E=A.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(A.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:A.algorithm.curve,privateKey:r.ECPrivateKey.decode(A.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return A.algorithm.params.priv_key=r.DSAparam.decode(A.subjectPrivateKey,"der"),{type:"dsa",params:A.algorithm.params};default:throw Error("unknown key id "+E)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(w,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(w,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(w,"der")};case"EC PRIVATE KEY":return w=r.ECPrivateKey.decode(w,"der"),{curve:w.parameters.value,privateKey:w.privateKey};default:throw Error("unknown key type "+m)}}a(c,"T"),c.signature=r.signature,t.exports=c}),K0=Qe((e,t)=>{var r=Kl(),n=fn().Buffer;t.exports=function(s,o){for(var l=n.alloc(0),u=0,c;l.length<o;)c=i(u++),l=n.concat([l,r("sha1").update(s).update(c).digest()]);return l.slice(0,o)};function i(s){var o=n.allocUnsafe(4);return o.writeUInt32BE(s,0),o}a(i,"K")}),q0=Qe((e,t)=>{t.exports=function(r,n){for(var i=r.length,s=-1;++s<i;)r[s]^=n[s];return r}}),tf=Qe((e,t)=>{(function(r,n){function i(h,y){if(!h)throw Error(y||"Assertion failed")}a(i,"K");function s(h,y){h.super_=y;var b=a(function(){},"X");b.prototype=y.prototype,h.prototype=new b,h.prototype.constructor=h}a(s,"O");function o(h,y,b){if(o.isBN(h))return h;this.negative=0,this.words=null,this.length=0,this.red=null,h!==null&&((y==="le"||y==="be")&&(b=y,y=10),this._init(h||0,y||10,b||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(h){return h instanceof o?!0:h!==null&&typeof h=="object"&&h.constructor.wordSize===o.wordSize&&Array.isArray(h.words)},o.max=function(h,y){return h.cmp(y)>0?h:y},o.min=function(h,y){return h.cmp(y)<0?h:y},o.prototype._init=function(h,y,b){if(typeof h=="number")return this._initNumber(h,y,b);if(typeof h=="object")return this._initArray(h,y,b);y==="hex"&&(y=16),i(y===(y|0)&&y>=2&&y<=36),h=h.toString().replace(/\s+/g,"");var x=0;h[0]==="-"&&(x++,this.negative=1),x<h.length&&(y===16?this._parseHex(h,x,b):(this._parseBase(h,y,x),b==="le"&&this._initArray(this.toArray(),y,b)))},o.prototype._initNumber=function(h,y,b){h<0&&(this.negative=1,h=-h),h<67108864?(this.words=[h&67108863],this.length=1):h<4503599627370496?(this.words=[h&67108863,h/67108864&67108863],this.length=2):(i(h<9007199254740992),this.words=[h&67108863,h/67108864&67108863,1],this.length=3),b==="le"&&this._initArray(this.toArray(),y,b)},o.prototype._initArray=function(h,y,b){if(i(typeof h.length=="number"),h.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(h.length/3),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _,N,T=0;if(b==="be")for(x=h.length-1,_=0;x>=0;x-=3)N=h[x]|h[x-1]<<8|h[x-2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);else if(b==="le")for(x=0,_=0;x<h.length;x+=3)N=h[x]|h[x+1]<<8|h[x+2]<<16,this.words[_]|=N<<T&67108863,this.words[_+1]=N>>>26-T&67108863,T+=24,T>=26&&(T-=26,_++);return this.strip()};function u(h,y){var b=h.charCodeAt(y);return b>=65&&b<=70?b-55:b>=97&&b<=102?b-87:b-48&15}a(u,"W");function c(h,y,b){var x=u(h,b);return b-1>=y&&(x|=u(h,b-1)<<4),x}a(c,"T"),o.prototype._parseHex=function(h,y,b){this.length=Math.ceil((h.length-y)/6),this.words=Array(this.length);for(var x=0;x<this.length;x++)this.words[x]=0;var _=0,N=0,T;if(b==="be")for(x=h.length-1;x>=y;x-=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8;else{var k=h.length-y;for(x=k%2===0?y+1:y;x<h.length;x+=2)T=c(h,y,x)<<_,this.words[N]|=T&67108863,_>=18?(_-=18,N+=1,this.words[N]|=T>>>26):_+=8}this.strip()};function d(h,y,b,x){for(var _=0,N=Math.min(h.length,b),T=y;T<N;T++){var k=h.charCodeAt(T)-48;_*=x,k>=49?_+=k-49+10:k>=17?_+=k-17+10:_+=k}return _}a(d,"Z"),o.prototype._parseBase=function(h,y,b){this.words=[0],this.length=1;for(var x=0,_=1;_<=67108863;_*=y)x++;x--,_=_/y|0;for(var N=h.length-b,T=N%x,k=Math.min(N,N-T)+b,p=0,S=b;S<k;S+=x)p=d(h,S,S+x,y),this.imuln(_),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p);if(T!==0){var I=1;for(p=d(h,S,h.length,y),S=0;S<T;S++)I*=y;this.imuln(I),this.words[0]+p<67108864?this.words[0]+=p:this._iaddn(p)}this.strip()},o.prototype.copy=function(h){h.words=Array(this.length);for(var y=0;y<this.length;y++)h.words[y]=this.words[y];h.length=this.length,h.negative=this.negative,h.red=this.red},o.prototype.clone=function(){var h=new o(null);return this.copy(h),h},o.prototype._expand=function(h){for(;this.length<h;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(h,y){h=h||10,y=y|0||1;var b;if(h===16||h==="hex"){b="";for(var x=0,_=0,N=0;N<this.length;N++){var T=this.words[N],k=((T<<x|_)&16777215).toString(16);_=T>>>24-x&16777215,x+=2,x>=26&&(x-=26,N--),_!==0||N!==this.length-1?b=f[6-k.length]+k+b:b=k+b}for(_!==0&&(b=_.toString(16)+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}if(h===(h|0)&&h>=2&&h<=36){var p=g[h],S=m[h];b="";var I=this.clone();for(I.negative=0;!I.isZero();){var M=I.modn(S).toString(h);I=I.idivn(S),I.isZero()?b=M+b:b=f[p-M.length]+M+b}for(this.isZero()&&(b="0"+b);b.length%y!==0;)b="0"+b;return this.negative!==0&&(b="-"+b),b}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var h=this.words[0];return this.length===2?h+=this.words[1]*67108864:this.length===3&&this.words[2]===1?h+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-h:h},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(h,y){return i(typeof l<"u"),this.toArrayLike(l,h,y)},o.prototype.toArray=function(h,y){return this.toArrayLike(Array,h,y)},o.prototype.toArrayLike=function(h,y,b){var x=this.byteLength(),_=b||Math.max(1,x);i(x<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var N=y==="le",T=new h(_),k,p,S=this.clone();if(N){for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[p]=k;for(;p<_;p++)T[p]=0}else{for(p=0;p<_-x;p++)T[p]=0;for(p=0;!S.isZero();p++)k=S.andln(255),S.iushrn(8),T[_-p-1]=k}return T},Math.clz32?o.prototype._countBits=function(h){return 32-Math.clz32(h)}:o.prototype._countBits=function(h){var y=h,b=0;return y>=4096&&(b+=13,y>>>=13),y>=64&&(b+=7,y>>>=7),y>=8&&(b+=4,y>>>=4),y>=2&&(b+=2,y>>>=2),b+y},o.prototype._zeroBits=function(h){if(h===0)return 26;var y=h,b=0;return(y&8191)===0&&(b+=13,y>>>=13),(y&127)===0&&(b+=7,y>>>=7),(y&15)===0&&(b+=4,y>>>=4),(y&3)===0&&(b+=2,y>>>=2),(y&1)===0&&b++,b},o.prototype.bitLength=function(){var h=this.words[this.length-1],y=this._countBits(h);return(this.length-1)*26+y};function w(h){for(var y=Array(h.bitLength()),b=0;b<y.length;b++){var x=b/26|0,_=b%26;y[b]=(h.words[x]&1<<_)>>>_}return y}a(w,"N"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var h=0,y=0;y<this.length;y++){var b=this._zeroBits(this.words[y]);if(h+=b,b!==26)break}return h},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(h){return this.negative!==0?this.abs().inotn(h).iaddn(1):this.clone()},o.prototype.fromTwos=function(h){return this.testn(h-1)?this.notn(h).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(h){for(;this.length<h.length;)this.words[this.length++]=0;for(var y=0;y<h.length;y++)this.words[y]=this.words[y]|h.words[y];return this.strip()},o.prototype.ior=function(h){return i((this.negative|h.negative)===0),this.iuor(h)},o.prototype.or=function(h){return this.length>h.length?this.clone().ior(h):h.clone().ior(this)},o.prototype.uor=function(h){return this.length>h.length?this.clone().iuor(h):h.clone().iuor(this)},o.prototype.iuand=function(h){var y;this.length>h.length?y=h:y=this;for(var b=0;b<y.length;b++)this.words[b]=this.words[b]&h.words[b];return this.length=y.length,this.strip()},o.prototype.iand=function(h){return i((this.negative|h.negative)===0),this.iuand(h)},o.prototype.and=function(h){return this.length>h.length?this.clone().iand(h):h.clone().iand(this)},o.prototype.uand=function(h){return this.length>h.length?this.clone().iuand(h):h.clone().iuand(this)},o.prototype.iuxor=function(h){var y,b;this.length>h.length?(y=this,b=h):(y=h,b=this);for(var x=0;x<b.length;x++)this.words[x]=y.words[x]^b.words[x];if(this!==y)for(;x<y.length;x++)this.words[x]=y.words[x];return this.length=y.length,this.strip()},o.prototype.ixor=function(h){return i((this.negative|h.negative)===0),this.iuxor(h)},o.prototype.xor=function(h){return this.length>h.length?this.clone().ixor(h):h.clone().ixor(this)},o.prototype.uxor=function(h){return this.length>h.length?this.clone().iuxor(h):h.clone().iuxor(this)},o.prototype.inotn=function(h){i(typeof h=="number"&&h>=0);var y=Math.ceil(h/26)|0,b=h%26;this._expand(y),b>0&&y--;for(var x=0;x<y;x++)this.words[x]=~this.words[x]&67108863;return b>0&&(this.words[x]=~this.words[x]&67108863>>26-b),this.strip()},o.prototype.notn=function(h){return this.clone().inotn(h)},o.prototype.setn=function(h,y){i(typeof h=="number"&&h>=0);var b=h/26|0,x=h%26;return this._expand(b+1),y?this.words[b]=this.words[b]|1<<x:this.words[b]=this.words[b]&~(1<<x),this.strip()},o.prototype.iadd=function(h){var y;if(this.negative!==0&&h.negative===0)return this.negative=0,y=this.isub(h),this.negative^=1,this._normSign();if(this.negative===0&&h.negative!==0)return h.negative=0,y=this.isub(h),h.negative=1,y._normSign();var b,x;this.length>h.length?(b=this,x=h):(b=h,x=this);for(var _=0,N=0;N<x.length;N++)y=(b.words[N]|0)+(x.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;for(;_!==0&&N<b.length;N++)y=(b.words[N]|0)+_,this.words[N]=y&67108863,_=y>>>26;if(this.length=b.length,_!==0)this.words[this.length]=_,this.length++;else if(b!==this)for(;N<b.length;N++)this.words[N]=b.words[N];return this},o.prototype.add=function(h){var y;return h.negative!==0&&this.negative===0?(h.negative=0,y=this.sub(h),h.negative^=1,y):h.negative===0&&this.negative!==0?(this.negative=0,y=h.sub(this),this.negative=1,y):this.length>h.length?this.clone().iadd(h):h.clone().iadd(this)},o.prototype.isub=function(h){if(h.negative!==0){h.negative=0;var y=this.iadd(h);return h.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(h),this.negative=1,this._normSign();var b=this.cmp(h);if(b===0)return this.negative=0,this.length=1,this.words[0]=0,this;var x,_;b>0?(x=this,_=h):(x=h,_=this);for(var N=0,T=0;T<_.length;T++)y=(x.words[T]|0)-(_.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;for(;N!==0&&T<x.length;T++)y=(x.words[T]|0)+N,N=y>>26,this.words[T]=y&67108863;if(N===0&&T<x.length&&x!==this)for(;T<x.length;T++)this.words[T]=x.words[T];return this.length=Math.max(this.length,T),x!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(h){return this.clone().isub(h)};function E(h,y,b){b.negative=y.negative^h.negative;var x=h.length+y.length|0;b.length=x,x=x-1|0;var _=h.words[0]|0,N=y.words[0]|0,T=_*N,k=T&67108863,p=T/67108864|0;b.words[0]=k;for(var S=1;S<x;S++){for(var I=p>>>26,M=p&67108863,U=Math.min(S,y.length-1),B=Math.max(0,S-h.length+1);B<=U;B++){var H=S-B|0;_=h.words[H]|0,N=y.words[B]|0,T=_*N+M,I+=T/67108864|0,M=T&67108863}b.words[S]=M|0,p=I|0}return p!==0?b.words[S]=p|0:b.length--,b.strip()}a(E,"R");var A=a(function(h,y,b){var x=h.words,_=y.words,N=b.words,T=0,k,p,S,I=x[0]|0,M=I&8191,U=I>>>13,B=x[1]|0,H=B&8191,$=B>>>13,ae=x[2]|0,ie=ae&8191,ne=ae>>>13,Ne=x[3]|0,ve=Ne&8191,he=Ne>>>13,Se=x[4]|0,Q=Se&8191,se=Se>>>13,J=x[5]|0,te=J&8191,de=J>>>13,be=x[6]|0,Ae=be&8191,oe=be>>>13,Y=x[7]|0,ee=Y&8191,X=Y>>>13,W=x[8]|0,q=W&8191,re=W>>>13,Oe=x[9]|0,Ee=Oe&8191,Be=Oe>>>13,pt=_[0]|0,xe=pt&8191,Ge=pt>>>13,ge=_[1]|0,_e=ge&8191,Re=ge>>>13,ze=_[2]|0,Pe=ze&8191,We=ze>>>13,xt=_[3]|0,Ve=xt&8191,Te=xt>>>13,Ye=_[4]|0,Me=Ye&8191,$e=Ye>>>13,mt=_[5]|0,ue=mt&8191,me=mt>>>13,He=_[6]|0,Ie=He&8191,je=He>>>13,rt=_[7]|0,ce=rt&8191,Ce=rt>>>13,et=_[8]|0,ke=et&8191,tt=et>>>13,Tt=_[9]|0,Ke=Tt&8191,st=Tt>>>13;b.negative=h.negative^y.negative,b.length=19,k=Math.imul(M,xe),p=Math.imul(M,Ge),p=p+Math.imul(U,xe)|0,S=Math.imul(U,Ge);var Ze=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ze>>>26)|0,Ze&=67108863,k=Math.imul(H,xe),p=Math.imul(H,Ge),p=p+Math.imul($,xe)|0,S=Math.imul($,Ge),k=k+Math.imul(M,_e)|0,p=p+Math.imul(M,Re)|0,p=p+Math.imul(U,_e)|0,S=S+Math.imul(U,Re)|0;var Je=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Je>>>26)|0,Je&=67108863,k=Math.imul(ie,xe),p=Math.imul(ie,Ge),p=p+Math.imul(ne,xe)|0,S=Math.imul(ne,Ge),k=k+Math.imul(H,_e)|0,p=p+Math.imul(H,Re)|0,p=p+Math.imul($,_e)|0,S=S+Math.imul($,Re)|0,k=k+Math.imul(M,Pe)|0,p=p+Math.imul(M,We)|0,p=p+Math.imul(U,Pe)|0,S=S+Math.imul(U,We)|0;var Et=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Et>>>26)|0,Et&=67108863,k=Math.imul(ve,xe),p=Math.imul(ve,Ge),p=p+Math.imul(he,xe)|0,S=Math.imul(he,Ge),k=k+Math.imul(ie,_e)|0,p=p+Math.imul(ie,Re)|0,p=p+Math.imul(ne,_e)|0,S=S+Math.imul(ne,Re)|0,k=k+Math.imul(H,Pe)|0,p=p+Math.imul(H,We)|0,p=p+Math.imul($,Pe)|0,S=S+Math.imul($,We)|0,k=k+Math.imul(M,Ve)|0,p=p+Math.imul(M,Te)|0,p=p+Math.imul(U,Ve)|0,S=S+Math.imul(U,Te)|0;var Ft=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,k=Math.imul(Q,xe),p=Math.imul(Q,Ge),p=p+Math.imul(se,xe)|0,S=Math.imul(se,Ge),k=k+Math.imul(ve,_e)|0,p=p+Math.imul(ve,Re)|0,p=p+Math.imul(he,_e)|0,S=S+Math.imul(he,Re)|0,k=k+Math.imul(ie,Pe)|0,p=p+Math.imul(ie,We)|0,p=p+Math.imul(ne,Pe)|0,S=S+Math.imul(ne,We)|0,k=k+Math.imul(H,Ve)|0,p=p+Math.imul(H,Te)|0,p=p+Math.imul($,Ve)|0,S=S+Math.imul($,Te)|0,k=k+Math.imul(M,Me)|0,p=p+Math.imul(M,$e)|0,p=p+Math.imul(U,Me)|0,S=S+Math.imul(U,$e)|0;var Ot=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,k=Math.imul(te,xe),p=Math.imul(te,Ge),p=p+Math.imul(de,xe)|0,S=Math.imul(de,Ge),k=k+Math.imul(Q,_e)|0,p=p+Math.imul(Q,Re)|0,p=p+Math.imul(se,_e)|0,S=S+Math.imul(se,Re)|0,k=k+Math.imul(ve,Pe)|0,p=p+Math.imul(ve,We)|0,p=p+Math.imul(he,Pe)|0,S=S+Math.imul(he,We)|0,k=k+Math.imul(ie,Ve)|0,p=p+Math.imul(ie,Te)|0,p=p+Math.imul(ne,Ve)|0,S=S+Math.imul(ne,Te)|0,k=k+Math.imul(H,Me)|0,p=p+Math.imul(H,$e)|0,p=p+Math.imul($,Me)|0,S=S+Math.imul($,$e)|0,k=k+Math.imul(M,ue)|0,p=p+Math.imul(M,me)|0,p=p+Math.imul(U,ue)|0,S=S+Math.imul(U,me)|0;var nr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(nr>>>26)|0,nr&=67108863,k=Math.imul(Ae,xe),p=Math.imul(Ae,Ge),p=p+Math.imul(oe,xe)|0,S=Math.imul(oe,Ge),k=k+Math.imul(te,_e)|0,p=p+Math.imul(te,Re)|0,p=p+Math.imul(de,_e)|0,S=S+Math.imul(de,Re)|0,k=k+Math.imul(Q,Pe)|0,p=p+Math.imul(Q,We)|0,p=p+Math.imul(se,Pe)|0,S=S+Math.imul(se,We)|0,k=k+Math.imul(ve,Ve)|0,p=p+Math.imul(ve,Te)|0,p=p+Math.imul(he,Ve)|0,S=S+Math.imul(he,Te)|0,k=k+Math.imul(ie,Me)|0,p=p+Math.imul(ie,$e)|0,p=p+Math.imul(ne,Me)|0,S=S+Math.imul(ne,$e)|0,k=k+Math.imul(H,ue)|0,p=p+Math.imul(H,me)|0,p=p+Math.imul($,ue)|0,S=S+Math.imul($,me)|0,k=k+Math.imul(M,Ie)|0,p=p+Math.imul(M,je)|0,p=p+Math.imul(U,Ie)|0,S=S+Math.imul(U,je)|0;var wr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(wr>>>26)|0,wr&=67108863,k=Math.imul(ee,xe),p=Math.imul(ee,Ge),p=p+Math.imul(X,xe)|0,S=Math.imul(X,Ge),k=k+Math.imul(Ae,_e)|0,p=p+Math.imul(Ae,Re)|0,p=p+Math.imul(oe,_e)|0,S=S+Math.imul(oe,Re)|0,k=k+Math.imul(te,Pe)|0,p=p+Math.imul(te,We)|0,p=p+Math.imul(de,Pe)|0,S=S+Math.imul(de,We)|0,k=k+Math.imul(Q,Ve)|0,p=p+Math.imul(Q,Te)|0,p=p+Math.imul(se,Ve)|0,S=S+Math.imul(se,Te)|0,k=k+Math.imul(ve,Me)|0,p=p+Math.imul(ve,$e)|0,p=p+Math.imul(he,Me)|0,S=S+Math.imul(he,$e)|0,k=k+Math.imul(ie,ue)|0,p=p+Math.imul(ie,me)|0,p=p+Math.imul(ne,ue)|0,S=S+Math.imul(ne,me)|0,k=k+Math.imul(H,Ie)|0,p=p+Math.imul(H,je)|0,p=p+Math.imul($,Ie)|0,S=S+Math.imul($,je)|0,k=k+Math.imul(M,ce)|0,p=p+Math.imul(M,Ce)|0,p=p+Math.imul(U,ce)|0,S=S+Math.imul(U,Ce)|0;var ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(ir>>>26)|0,ir&=67108863,k=Math.imul(q,xe),p=Math.imul(q,Ge),p=p+Math.imul(re,xe)|0,S=Math.imul(re,Ge),k=k+Math.imul(ee,_e)|0,p=p+Math.imul(ee,Re)|0,p=p+Math.imul(X,_e)|0,S=S+Math.imul(X,Re)|0,k=k+Math.imul(Ae,Pe)|0,p=p+Math.imul(Ae,We)|0,p=p+Math.imul(oe,Pe)|0,S=S+Math.imul(oe,We)|0,k=k+Math.imul(te,Ve)|0,p=p+Math.imul(te,Te)|0,p=p+Math.imul(de,Ve)|0,S=S+Math.imul(de,Te)|0,k=k+Math.imul(Q,Me)|0,p=p+Math.imul(Q,$e)|0,p=p+Math.imul(se,Me)|0,S=S+Math.imul(se,$e)|0,k=k+Math.imul(ve,ue)|0,p=p+Math.imul(ve,me)|0,p=p+Math.imul(he,ue)|0,S=S+Math.imul(he,me)|0,k=k+Math.imul(ie,Ie)|0,p=p+Math.imul(ie,je)|0,p=p+Math.imul(ne,Ie)|0,S=S+Math.imul(ne,je)|0,k=k+Math.imul(H,ce)|0,p=p+Math.imul(H,Ce)|0,p=p+Math.imul($,ce)|0,S=S+Math.imul($,Ce)|0,k=k+Math.imul(M,ke)|0,p=p+Math.imul(M,tt)|0,p=p+Math.imul(U,ke)|0,S=S+Math.imul(U,tt)|0;var er=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(er>>>26)|0,er&=67108863,k=Math.imul(Ee,xe),p=Math.imul(Ee,Ge),p=p+Math.imul(Be,xe)|0,S=Math.imul(Be,Ge),k=k+Math.imul(q,_e)|0,p=p+Math.imul(q,Re)|0,p=p+Math.imul(re,_e)|0,S=S+Math.imul(re,Re)|0,k=k+Math.imul(ee,Pe)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(X,Pe)|0,S=S+Math.imul(X,We)|0,k=k+Math.imul(Ae,Ve)|0,p=p+Math.imul(Ae,Te)|0,p=p+Math.imul(oe,Ve)|0,S=S+Math.imul(oe,Te)|0,k=k+Math.imul(te,Me)|0,p=p+Math.imul(te,$e)|0,p=p+Math.imul(de,Me)|0,S=S+Math.imul(de,$e)|0,k=k+Math.imul(Q,ue)|0,p=p+Math.imul(Q,me)|0,p=p+Math.imul(se,ue)|0,S=S+Math.imul(se,me)|0,k=k+Math.imul(ve,Ie)|0,p=p+Math.imul(ve,je)|0,p=p+Math.imul(he,Ie)|0,S=S+Math.imul(he,je)|0,k=k+Math.imul(ie,ce)|0,p=p+Math.imul(ie,Ce)|0,p=p+Math.imul(ne,ce)|0,S=S+Math.imul(ne,Ce)|0,k=k+Math.imul(H,ke)|0,p=p+Math.imul(H,tt)|0,p=p+Math.imul($,ke)|0,S=S+Math.imul($,tt)|0,k=k+Math.imul(M,Ke)|0,p=p+Math.imul(M,st)|0,p=p+Math.imul(U,Ke)|0,S=S+Math.imul(U,st)|0;var Ar=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,k=Math.imul(Ee,_e),p=Math.imul(Ee,Re),p=p+Math.imul(Be,_e)|0,S=Math.imul(Be,Re),k=k+Math.imul(q,Pe)|0,p=p+Math.imul(q,We)|0,p=p+Math.imul(re,Pe)|0,S=S+Math.imul(re,We)|0,k=k+Math.imul(ee,Ve)|0,p=p+Math.imul(ee,Te)|0,p=p+Math.imul(X,Ve)|0,S=S+Math.imul(X,Te)|0,k=k+Math.imul(Ae,Me)|0,p=p+Math.imul(Ae,$e)|0,p=p+Math.imul(oe,Me)|0,S=S+Math.imul(oe,$e)|0,k=k+Math.imul(te,ue)|0,p=p+Math.imul(te,me)|0,p=p+Math.imul(de,ue)|0,S=S+Math.imul(de,me)|0,k=k+Math.imul(Q,Ie)|0,p=p+Math.imul(Q,je)|0,p=p+Math.imul(se,Ie)|0,S=S+Math.imul(se,je)|0,k=k+Math.imul(ve,ce)|0,p=p+Math.imul(ve,Ce)|0,p=p+Math.imul(he,ce)|0,S=S+Math.imul(he,Ce)|0,k=k+Math.imul(ie,ke)|0,p=p+Math.imul(ie,tt)|0,p=p+Math.imul(ne,ke)|0,S=S+Math.imul(ne,tt)|0,k=k+Math.imul(H,Ke)|0,p=p+Math.imul(H,st)|0,p=p+Math.imul($,Ke)|0,S=S+Math.imul($,st)|0;var Ir=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,k=Math.imul(Ee,Pe),p=Math.imul(Ee,We),p=p+Math.imul(Be,Pe)|0,S=Math.imul(Be,We),k=k+Math.imul(q,Ve)|0,p=p+Math.imul(q,Te)|0,p=p+Math.imul(re,Ve)|0,S=S+Math.imul(re,Te)|0,k=k+Math.imul(ee,Me)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(X,Me)|0,S=S+Math.imul(X,$e)|0,k=k+Math.imul(Ae,ue)|0,p=p+Math.imul(Ae,me)|0,p=p+Math.imul(oe,ue)|0,S=S+Math.imul(oe,me)|0,k=k+Math.imul(te,Ie)|0,p=p+Math.imul(te,je)|0,p=p+Math.imul(de,Ie)|0,S=S+Math.imul(de,je)|0,k=k+Math.imul(Q,ce)|0,p=p+Math.imul(Q,Ce)|0,p=p+Math.imul(se,ce)|0,S=S+Math.imul(se,Ce)|0,k=k+Math.imul(ve,ke)|0,p=p+Math.imul(ve,tt)|0,p=p+Math.imul(he,ke)|0,S=S+Math.imul(he,tt)|0,k=k+Math.imul(ie,Ke)|0,p=p+Math.imul(ie,st)|0,p=p+Math.imul(ne,Ke)|0,S=S+Math.imul(ne,st)|0;var pr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(pr>>>26)|0,pr&=67108863,k=Math.imul(Ee,Ve),p=Math.imul(Ee,Te),p=p+Math.imul(Be,Ve)|0,S=Math.imul(Be,Te),k=k+Math.imul(q,Me)|0,p=p+Math.imul(q,$e)|0,p=p+Math.imul(re,Me)|0,S=S+Math.imul(re,$e)|0,k=k+Math.imul(ee,ue)|0,p=p+Math.imul(ee,me)|0,p=p+Math.imul(X,ue)|0,S=S+Math.imul(X,me)|0,k=k+Math.imul(Ae,Ie)|0,p=p+Math.imul(Ae,je)|0,p=p+Math.imul(oe,Ie)|0,S=S+Math.imul(oe,je)|0,k=k+Math.imul(te,ce)|0,p=p+Math.imul(te,Ce)|0,p=p+Math.imul(de,ce)|0,S=S+Math.imul(de,Ce)|0,k=k+Math.imul(Q,ke)|0,p=p+Math.imul(Q,tt)|0,p=p+Math.imul(se,ke)|0,S=S+Math.imul(se,tt)|0,k=k+Math.imul(ve,Ke)|0,p=p+Math.imul(ve,st)|0,p=p+Math.imul(he,Ke)|0,S=S+Math.imul(he,st)|0;var Sr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,k=Math.imul(Ee,Me),p=Math.imul(Ee,$e),p=p+Math.imul(Be,Me)|0,S=Math.imul(Be,$e),k=k+Math.imul(q,ue)|0,p=p+Math.imul(q,me)|0,p=p+Math.imul(re,ue)|0,S=S+Math.imul(re,me)|0,k=k+Math.imul(ee,Ie)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(X,Ie)|0,S=S+Math.imul(X,je)|0,k=k+Math.imul(Ae,ce)|0,p=p+Math.imul(Ae,Ce)|0,p=p+Math.imul(oe,ce)|0,S=S+Math.imul(oe,Ce)|0,k=k+Math.imul(te,ke)|0,p=p+Math.imul(te,tt)|0,p=p+Math.imul(de,ke)|0,S=S+Math.imul(de,tt)|0,k=k+Math.imul(Q,Ke)|0,p=p+Math.imul(Q,st)|0,p=p+Math.imul(se,Ke)|0,S=S+Math.imul(se,st)|0;var or=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(or>>>26)|0,or&=67108863,k=Math.imul(Ee,ue),p=Math.imul(Ee,me),p=p+Math.imul(Be,ue)|0,S=Math.imul(Be,me),k=k+Math.imul(q,Ie)|0,p=p+Math.imul(q,je)|0,p=p+Math.imul(re,Ie)|0,S=S+Math.imul(re,je)|0,k=k+Math.imul(ee,ce)|0,p=p+Math.imul(ee,Ce)|0,p=p+Math.imul(X,ce)|0,S=S+Math.imul(X,Ce)|0,k=k+Math.imul(Ae,ke)|0,p=p+Math.imul(Ae,tt)|0,p=p+Math.imul(oe,ke)|0,S=S+Math.imul(oe,tt)|0,k=k+Math.imul(te,Ke)|0,p=p+Math.imul(te,st)|0,p=p+Math.imul(de,Ke)|0,S=S+Math.imul(de,st)|0;var mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(mr>>>26)|0,mr&=67108863,k=Math.imul(Ee,Ie),p=Math.imul(Ee,je),p=p+Math.imul(Be,Ie)|0,S=Math.imul(Be,je),k=k+Math.imul(q,ce)|0,p=p+Math.imul(q,Ce)|0,p=p+Math.imul(re,ce)|0,S=S+Math.imul(re,Ce)|0,k=k+Math.imul(ee,ke)|0,p=p+Math.imul(ee,tt)|0,p=p+Math.imul(X,ke)|0,S=S+Math.imul(X,tt)|0,k=k+Math.imul(Ae,Ke)|0,p=p+Math.imul(Ae,st)|0,p=p+Math.imul(oe,Ke)|0,S=S+Math.imul(oe,st)|0;var kr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(kr>>>26)|0,kr&=67108863,k=Math.imul(Ee,ce),p=Math.imul(Ee,Ce),p=p+Math.imul(Be,ce)|0,S=Math.imul(Be,Ce),k=k+Math.imul(q,ke)|0,p=p+Math.imul(q,tt)|0,p=p+Math.imul(re,ke)|0,S=S+Math.imul(re,tt)|0,k=k+Math.imul(ee,Ke)|0,p=p+Math.imul(ee,st)|0,p=p+Math.imul(X,Ke)|0,S=S+Math.imul(X,st)|0;var Cr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,k=Math.imul(Ee,ke),p=Math.imul(Ee,tt),p=p+Math.imul(Be,ke)|0,S=Math.imul(Be,tt),k=k+Math.imul(q,Ke)|0,p=p+Math.imul(q,st)|0,p=p+Math.imul(re,Ke)|0,S=S+Math.imul(re,st)|0;var Mr=(T+k|0)+((p&8191)<<13)|0;T=(S+(p>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,k=Math.imul(Ee,Ke),p=Math.imul(Ee,st),p=p+Math.imul(Be,Ke)|0,S=Math.imul(Be,st);var Or=(T+k|0)+((p&8191)<<13)|0;return T=(S+(p>>>13)|0)+(Or>>>26)|0,Or&=67108863,N[0]=Ze,N[1]=Je,N[2]=Et,N[3]=Ft,N[4]=Ot,N[5]=nr,N[6]=wr,N[7]=ir,N[8]=er,N[9]=Ar,N[10]=Ir,N[11]=pr,N[12]=Sr,N[13]=or,N[14]=mr,N[15]=kr,N[16]=Cr,N[17]=Mr,N[18]=Or,T!==0&&(N[19]=T,b.length++),b},"E");Math.imul||(A=E);function C(h,y,b){b.negative=y.negative^h.negative,b.length=h.length+y.length;for(var x=0,_=0,N=0;N<b.length-1;N++){var T=_;_=0;for(var k=x&67108863,p=Math.min(N,y.length-1),S=Math.max(0,N-h.length+1);S<=p;S++){var I=N-S,M=h.words[I]|0,U=y.words[S]|0,B=M*U,H=B&67108863;T=T+(B/67108864|0)|0,H=H+k|0,k=H&67108863,T=T+(H>>>26)|0,_+=T>>>26,T&=67108863}b.words[N]=k,x=T,T=_}return x!==0?b.words[N]=x:b.length--,b.strip()}a(C,"D");function O(h,y,b){var x=new R;return x.mulp(h,y,b)}a(O,"h"),o.prototype.mulTo=function(h,y){var b,x=this.length+h.length;return this.length===10&&h.length===10?b=A(this,h,y):x<63?b=E(this,h,y):x<1024?b=C(this,h,y):b=O(this,h,y),b};function R(h,y){this.x=h,this.y=y}a(R,"L"),R.prototype.makeRBT=function(h){for(var y=Array(h),b=o.prototype._countBits(h)-1,x=0;x<h;x++)y[x]=this.revBin(x,b,h);return y},R.prototype.revBin=function(h,y,b){if(h===0||h===b-1)return h;for(var x=0,_=0;_<y;_++)x|=(h&1)<<y-_-1,h>>=1;return x},R.prototype.permute=function(h,y,b,x,_,N){for(var T=0;T<N;T++)x[T]=y[h[T]],_[T]=b[h[T]]},R.prototype.transform=function(h,y,b,x,_,N){this.permute(N,h,y,b,x,_);for(var T=1;T<_;T<<=1)for(var k=T<<1,p=Math.cos(2*Math.PI/k),S=Math.sin(2*Math.PI/k),I=0;I<_;I+=k)for(var M=p,U=S,B=0;B<T;B++){var H=b[I+B],$=x[I+B],ae=b[I+B+T],ie=x[I+B+T],ne=M*ae-U*ie;ie=M*ie+U*ae,ae=ne,b[I+B]=H+ae,x[I+B]=$+ie,b[I+B+T]=H-ae,x[I+B+T]=$-ie,B!==k&&(ne=p*M-S*U,U=p*U+S*M,M=ne)}},R.prototype.guessLen13b=function(h,y){var b=Math.max(y,h)|1,x=b&1,_=0;for(b=b/2|0;b;b=b>>>1)_++;return 1<<_+1+x},R.prototype.conjugate=function(h,y,b){if(!(b<=1))for(var x=0;x<b/2;x++){var _=h[x];h[x]=h[b-x-1],h[b-x-1]=_,_=y[x],y[x]=-y[b-x-1],y[b-x-1]=-_}},R.prototype.normalize13b=function(h,y){for(var b=0,x=0;x<y/2;x++){var _=Math.round(h[2*x+1]/y)*8192+Math.round(h[2*x]/y)+b;h[x]=_&67108863,_<67108864?b=0:b=_/67108864|0}return h},R.prototype.convert13b=function(h,y,b,x){for(var _=0,N=0;N<y;N++)_=_+(h[N]|0),b[2*N]=_&8191,_=_>>>13,b[2*N+1]=_&8191,_=_>>>13;for(N=2*y;N<x;++N)b[N]=0;i(_===0),i((_&-8192)===0)},R.prototype.stub=function(h){for(var y=Array(h),b=0;b<h;b++)y[b]=0;return y},R.prototype.mulp=function(h,y,b){var x=2*this.guessLen13b(h.length,y.length),_=this.makeRBT(x),N=this.stub(x),T=Array(x),k=Array(x),p=Array(x),S=Array(x),I=Array(x),M=Array(x),U=b.words;U.length=x,this.convert13b(h.words,h.length,T,x),this.convert13b(y.words,y.length,S,x),this.transform(T,N,k,p,x,_),this.transform(S,N,I,M,x,_);for(var B=0;B<x;B++){var H=k[B]*I[B]-p[B]*M[B];p[B]=k[B]*M[B]+p[B]*I[B],k[B]=H}return this.conjugate(k,p,x),this.transform(k,p,U,N,x,_),this.conjugate(U,N,x),this.normalize13b(U,x),b.negative=h.negative^y.negative,b.length=h.length+y.length,b.strip()},o.prototype.mul=function(h){var y=new o(null);return y.words=Array(this.length+h.length),this.mulTo(h,y)},o.prototype.mulf=function(h){var y=new o(null);return y.words=Array(this.length+h.length),O(this,h,y)},o.prototype.imul=function(h){return this.clone().mulTo(h,this)},o.prototype.imuln=function(h){i(typeof h=="number"),i(h<67108864);for(var y=0,b=0;b<this.length;b++){var x=(this.words[b]|0)*h,_=(x&67108863)+(y&67108863);y>>=26,y+=x/67108864|0,y+=_>>>26,this.words[b]=_&67108863}return y!==0&&(this.words[b]=y,this.length++),this.length=h===0?1:this.length,this},o.prototype.muln=function(h){return this.clone().imuln(h)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(h){var y=w(h);if(y.length===0)return new o(1);for(var b=this,x=0;x<y.length&&y[x]===0;x++,b=b.sqr());if(++x<y.length)for(var _=b.sqr();x<y.length;x++,_=_.sqr())y[x]!==0&&(b=b.mul(_));return b},o.prototype.iushln=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=67108863>>>26-y<<26-y,_;if(y!==0){var N=0;for(_=0;_<this.length;_++){var T=this.words[_]&x,k=(this.words[_]|0)-T<<y;this.words[_]=k|N,N=T>>>26-y}N&&(this.words[_]=N,this.length++)}if(b!==0){for(_=this.length-1;_>=0;_--)this.words[_+b]=this.words[_];for(_=0;_<b;_++)this.words[_]=0;this.length+=b}return this.strip()},o.prototype.ishln=function(h){return i(this.negative===0),this.iushln(h)},o.prototype.iushrn=function(h,y,b){i(typeof h=="number"&&h>=0);var x;y?x=(y-y%26)/26:x=0;var _=h%26,N=Math.min((h-_)/26,this.length),T=67108863^67108863>>>_<<_,k=b;if(x-=N,x=Math.max(0,x),k){for(var p=0;p<N;p++)k.words[p]=this.words[p];k.length=N}if(N!==0)if(this.length>N)for(this.length-=N,p=0;p<this.length;p++)this.words[p]=this.words[p+N];else this.words[0]=0,this.length=1;var S=0;for(p=this.length-1;p>=0&&(S!==0||p>=x);p--){var I=this.words[p]|0;this.words[p]=S<<26-_|I>>>_,S=I&T}return k&&S!==0&&(k.words[k.length++]=S),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(h,y,b){return i(this.negative===0),this.iushrn(h,y,b)},o.prototype.shln=function(h){return this.clone().ishln(h)},o.prototype.ushln=function(h){return this.clone().iushln(h)},o.prototype.shrn=function(h){return this.clone().ishrn(h)},o.prototype.ushrn=function(h){return this.clone().iushrn(h)},o.prototype.testn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return!1;var _=this.words[b];return!!(_&x)},o.prototype.imaskn=function(h){i(typeof h=="number"&&h>=0);var y=h%26,b=(h-y)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=b)return this;if(y!==0&&b++,this.length=Math.min(b,this.length),y!==0){var x=67108863^67108863>>>y<<y;this.words[this.length-1]&=x}return this.strip()},o.prototype.maskn=function(h){return this.clone().imaskn(h)},o.prototype.iaddn=function(h){return i(typeof h=="number"),i(h<67108864),h<0?this.isubn(-h):this.negative!==0?this.length===1&&(this.words[0]|0)<h?(this.words[0]=h-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(h),this.negative=1,this):this._iaddn(h)},o.prototype._iaddn=function(h){this.words[0]+=h;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(h){if(i(typeof h=="number"),i(h<67108864),h<0)return this.iaddn(-h);if(this.negative!==0)return this.negative=0,this.iaddn(h),this.negative=1,this;if(this.words[0]-=h,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this.strip()},o.prototype.addn=function(h){return this.clone().iaddn(h)},o.prototype.subn=function(h){return this.clone().isubn(h)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(h,y,b){var x=h.length+b,_;this._expand(x);var N,T=0;for(_=0;_<h.length;_++){N=(this.words[_+b]|0)+T;var k=(h.words[_]|0)*y;N-=k&67108863,T=(N>>26)-(k/67108864|0),this.words[_+b]=N&67108863}for(;_<this.length-b;_++)N=(this.words[_+b]|0)+T,T=N>>26,this.words[_+b]=N&67108863;if(T===0)return this.strip();for(i(T===-1),T=0,_=0;_<this.length;_++)N=-(this.words[_]|0)+T,T=N>>26,this.words[_]=N&67108863;return this.negative=1,this.strip()},o.prototype._wordDiv=function(h,y){var b=this.length-h.length,x=this.clone(),_=h,N=_.words[_.length-1]|0,T=this._countBits(N);b=26-T,b!==0&&(_=_.ushln(b),x.iushln(b),N=_.words[_.length-1]|0);var k=x.length-_.length,p;if(y!=="mod"){p=new o(null),p.length=k+1,p.words=Array(p.length);for(var S=0;S<p.length;S++)p.words[S]=0}var I=x.clone()._ishlnsubmul(_,1,k);I.negative===0&&(x=I,p&&(p.words[k]=1));for(var M=k-1;M>=0;M--){var U=(x.words[_.length+M]|0)*67108864+(x.words[_.length+M-1]|0);for(U=Math.min(U/N|0,67108863),x._ishlnsubmul(_,U,M);x.negative!==0;)U--,x.negative=0,x._ishlnsubmul(_,1,M),!x.isZero()&&(x.negative^=1);p&&(p.words[M]=U)}return p&&p.strip(),x.strip(),y!=="div"&&b!==0&&x.iushrn(b),{div:p||null,mod:x}},o.prototype.divmod=function(h,y,b){if(i(!h.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var x,_,N;return this.negative!==0&&h.negative===0?(N=this.neg().divmod(h,y),y!=="mod"&&(x=N.div.neg()),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.iadd(h)),{div:x,mod:_}):this.negative===0&&h.negative!==0?(N=this.divmod(h.neg(),y),y!=="mod"&&(x=N.div.neg()),{div:x,mod:N.mod}):(this.negative&h.negative)!==0?(N=this.neg().divmod(h.neg(),y),y!=="div"&&(_=N.mod.neg(),b&&_.negative!==0&&_.isub(h)),{div:N.div,mod:_}):h.length>this.length||this.cmp(h)<0?{div:new o(0),mod:this}:h.length===1?y==="div"?{div:this.divn(h.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modn(h.words[0]))}:{div:this.divn(h.words[0]),mod:new o(this.modn(h.words[0]))}:this._wordDiv(h,y)},o.prototype.div=function(h){return this.divmod(h,"div",!1).div},o.prototype.mod=function(h){return this.divmod(h,"mod",!1).mod},o.prototype.umod=function(h){return this.divmod(h,"mod",!0).mod},o.prototype.divRound=function(h){var y=this.divmod(h);if(y.mod.isZero())return y.div;var b=y.div.negative!==0?y.mod.isub(h):y.mod,x=h.ushrn(1),_=h.andln(1),N=b.cmp(x);return N<0||_===1&&N===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modn=function(h){i(h<=67108863);for(var y=67108864%h,b=0,x=this.length-1;x>=0;x--)b=(y*b+(this.words[x]|0))%h;return b},o.prototype.idivn=function(h){i(h<=67108863);for(var y=0,b=this.length-1;b>=0;b--){var x=(this.words[b]|0)+y*67108864;this.words[b]=x/h|0,y=x%h}return this.strip()},o.prototype.divn=function(h){return this.clone().idivn(h)},o.prototype.egcd=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=new o(0),T=new o(1),k=0;y.isEven()&&b.isEven();)y.iushrn(1),b.iushrn(1),++k;for(var p=b.clone(),S=y.clone();!y.isZero();){for(var I=0,M=1;(y.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(y.iushrn(I);I-- >0;)(x.isOdd()||_.isOdd())&&(x.iadd(p),_.isub(S)),x.iushrn(1),_.iushrn(1);for(var U=0,B=1;(b.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(b.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(p),T.isub(S)),N.iushrn(1),T.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(N),_.isub(T)):(b.isub(y),N.isub(x),T.isub(_))}return{a:N,b:T,gcd:b.iushln(k)}},o.prototype._invmp=function(h){i(h.negative===0),i(!h.isZero());var y=this,b=h.clone();y.negative!==0?y=y.umod(h):y=y.clone();for(var x=new o(1),_=new o(0),N=b.clone();y.cmpn(1)>0&&b.cmpn(1)>0;){for(var T=0,k=1;(y.words[0]&k)===0&&T<26;++T,k<<=1);if(T>0)for(y.iushrn(T);T-- >0;)x.isOdd()&&x.iadd(N),x.iushrn(1);for(var p=0,S=1;(b.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(b.iushrn(p);p-- >0;)_.isOdd()&&_.iadd(N),_.iushrn(1);y.cmp(b)>=0?(y.isub(b),x.isub(_)):(b.isub(y),_.isub(x))}var I;return y.cmpn(1)===0?I=x:I=_,I.cmpn(0)<0&&I.iadd(h),I},o.prototype.gcd=function(h){if(this.isZero())return h.abs();if(h.isZero())return this.abs();var y=this.clone(),b=h.clone();y.negative=0,b.negative=0;for(var x=0;y.isEven()&&b.isEven();x++)y.iushrn(1),b.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;b.isEven();)b.iushrn(1);var _=y.cmp(b);if(_<0){var N=y;y=b,b=N}else if(_===0||b.cmpn(1)===0)break;y.isub(b)}while(!0);return b.iushln(x)},o.prototype.invm=function(h){return this.egcd(h).a.umod(h)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(h){return this.words[0]&h},o.prototype.bincn=function(h){i(typeof h=="number");var y=h%26,b=(h-y)/26,x=1<<y;if(this.length<=b)return this._expand(b+1),this.words[b]|=x,this;for(var _=x,N=b;_!==0&&N<this.length;N++){var T=this.words[N]|0;T+=_,_=T>>>26,T&=67108863,this.words[N]=T}return _!==0&&(this.words[N]=_,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(h){var y=h<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this.strip();var b;if(this.length>1)b=1;else{y&&(h=-h),i(h<=67108863,"Number is too big");var x=this.words[0]|0;b=x===h?0:x<h?-1:1}return this.negative!==0?-b|0:b},o.prototype.cmp=function(h){if(this.negative!==0&&h.negative===0)return-1;if(this.negative===0&&h.negative!==0)return 1;var y=this.ucmp(h);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(h){if(this.length>h.length)return 1;if(this.length<h.length)return-1;for(var y=0,b=this.length-1;b>=0;b--){var x=this.words[b]|0,_=h.words[b]|0;if(x!==_){x<_?y=-1:x>_&&(y=1);break}}return y},o.prototype.gtn=function(h){return this.cmpn(h)===1},o.prototype.gt=function(h){return this.cmp(h)===1},o.prototype.gten=function(h){return this.cmpn(h)>=0},o.prototype.gte=function(h){return this.cmp(h)>=0},o.prototype.ltn=function(h){return this.cmpn(h)===-1},o.prototype.lt=function(h){return this.cmp(h)===-1},o.prototype.lten=function(h){return this.cmpn(h)<=0},o.prototype.lte=function(h){return this.cmp(h)<=0},o.prototype.eqn=function(h){return this.cmpn(h)===0},o.prototype.eq=function(h){return this.cmp(h)===0},o.red=function(h){return new z(h)},o.prototype.toRed=function(h){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),h.convertTo(this)._forceRed(h)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(h){return this.red=h,this},o.prototype.forceRed=function(h){return i(!this.red,"Already a number in reduction context"),this._forceRed(h)},o.prototype.redAdd=function(h){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,h)},o.prototype.redIAdd=function(h){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,h)},o.prototype.redSub=function(h){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,h)},o.prototype.redISub=function(h){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,h)},o.prototype.redShl=function(h){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,h)},o.prototype.redMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.mul(this,h)},o.prototype.redIMul=function(h){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,h),this.red.imul(this,h)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(h){return i(this.red&&!h.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,h)};var P={k256:null,p224:null,p192:null,p25519:null};function L(h,y){this.name=h,this.p=new o(y,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(L,"y"),L.prototype._tmp=function(){var h=new o(null);return h.words=Array(Math.ceil(this.n/13)),h},L.prototype.ireduce=function(h){var y=h,b;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),b=y.bitLength();while(b>this.n);var x=b<this.n?-1:y.ucmp(this.p);return x===0?(y.words[0]=0,y.length=1):x>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},L.prototype.split=function(h,y){h.iushrn(this.n,0,y)},L.prototype.imulK=function(h){return h.imul(this.k)};function j(){L.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(j,"p"),s(j,L),j.prototype.split=function(h,y){for(var b=4194303,x=Math.min(h.length,9),_=0;_<x;_++)y.words[_]=h.words[_];if(y.length=x,h.length<=9){h.words[0]=0,h.length=1;return}var N=h.words[9];for(y.words[y.length++]=N&b,_=10;_<h.length;_++){var T=h.words[_]|0;h.words[_-10]=(T&b)<<4|N>>>22,N=T}N>>>=22,h.words[_-10]=N,N===0&&h.length>10?h.length-=10:h.length-=9},j.prototype.imulK=function(h){h.words[h.length]=0,h.words[h.length+1]=0,h.length+=2;for(var y=0,b=0;b<h.length;b++){var x=h.words[b]|0;y+=x*977,h.words[b]=y&67108863,y=x*64+(y/67108864|0)}return h.words[h.length-1]===0&&(h.length--,h.words[h.length-1]===0&&h.length--),h};function G(){L.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(G,"i"),s(G,L);function Z(){L.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(Z,"$$"),s(Z,L);function K(){L.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(K,"Q"),s(K,L),K.prototype.imulK=function(h){for(var y=0,b=0;b<h.length;b++){var x=(h.words[b]|0)*19+y,_=x&67108863;x>>>=26,h.words[b]=_,y=x}return y!==0&&(h.words[h.length++]=y),h},o._prime=function(h){if(P[h])return P[h];var y;if(h==="k256")y=new j;else if(h==="p224")y=new G;else if(h==="p192")y=new Z;else if(h==="p25519")y=new K;else throw Error("Unknown prime "+h);return P[h]=y,y};function z(h){if(typeof h=="string"){var y=o._prime(h);this.m=y.p,this.prime=y}else i(h.gtn(1),"modulus must be greater than 1"),this.m=h,this.prime=null}a(z,"c"),z.prototype._verify1=function(h){i(h.negative===0,"red works only with positives"),i(h.red,"red works only with red numbers")},z.prototype._verify2=function(h,y){i((h.negative|y.negative)===0,"red works only with positives"),i(h.red&&h.red===y.red,"red works only with red numbers")},z.prototype.imod=function(h){return this.prime?this.prime.ireduce(h)._forceRed(this):h.umod(this.m)._forceRed(this)},z.prototype.neg=function(h){return h.isZero()?h.clone():this.m.sub(h)._forceRed(this)},z.prototype.add=function(h,y){this._verify2(h,y);var b=h.add(y);return b.cmp(this.m)>=0&&b.isub(this.m),b._forceRed(this)},z.prototype.iadd=function(h,y){this._verify2(h,y);var b=h.iadd(y);return b.cmp(this.m)>=0&&b.isub(this.m),b},z.prototype.sub=function(h,y){this._verify2(h,y);var b=h.sub(y);return b.cmpn(0)<0&&b.iadd(this.m),b._forceRed(this)},z.prototype.isub=function(h,y){this._verify2(h,y);var b=h.isub(y);return b.cmpn(0)<0&&b.iadd(this.m),b},z.prototype.shl=function(h,y){return this._verify1(h),this.imod(h.ushln(y))},z.prototype.imul=function(h,y){return this._verify2(h,y),this.imod(h.imul(y))},z.prototype.mul=function(h,y){return this._verify2(h,y),this.imod(h.mul(y))},z.prototype.isqr=function(h){return this.imul(h,h.clone())},z.prototype.sqr=function(h){return this.mul(h,h)},z.prototype.sqrt=function(h){if(h.isZero())return h.clone();var y=this.m.andln(3);if(i(y%2===1),y===3){var b=this.m.add(new o(1)).iushrn(2);return this.pow(h,b)}for(var x=this.m.subn(1),_=0;!x.isZero()&&x.andln(1)===0;)_++,x.iushrn(1);i(!x.isZero());var N=new o(1).toRed(this),T=N.redNeg(),k=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new o(2*p*p).toRed(this);this.pow(p,k).cmp(T)!==0;)p.redIAdd(T);for(var S=this.pow(p,x),I=this.pow(h,x.addn(1).iushrn(1)),M=this.pow(h,x),U=_;M.cmp(N)!==0;){for(var B=M,H=0;B.cmp(N)!==0;H++)B=B.redSqr();i(H<U);var $=this.pow(S,new o(1).iushln(U-H-1));I=I.redMul($),S=$.redSqr(),M=M.redMul(S),U=H}return I},z.prototype.invm=function(h){var y=h._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},z.prototype.pow=function(h,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return h.clone();var b=4,x=Array(1<<b);x[0]=new o(1).toRed(this),x[1]=h;for(var _=2;_<x.length;_++)x[_]=this.mul(x[_-1],h);var N=x[0],T=0,k=0,p=y.bitLength()%26;for(p===0&&(p=26),_=y.length-1;_>=0;_--){for(var S=y.words[_],I=p-1;I>=0;I--){var M=S>>I&1;if(N!==x[0]&&(N=this.sqr(N)),M===0&&T===0){k=0;continue}T<<=1,T|=M,k++,!(k!==b&&(_!==0||I!==0))&&(N=this.mul(N,x[T]),k=0,T=0)}p=26}return N},z.prototype.convertTo=function(h){var y=h.umod(this.m);return y===h?y.clone():y},z.prototype.convertFrom=function(h){var y=h.clone();return y.red=null,y},o.mont=function(h){return new V(h)};function V(h){z.call(this,h),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(V,"a"),s(V,z),V.prototype.convertTo=function(h){return this.imod(h.ushln(this.shift))},V.prototype.convertFrom=function(h){var y=this.imod(h.mul(this.rinv));return y.red=null,y},V.prototype.imul=function(h,y){if(h.isZero()||y.isZero())return h.words[0]=0,h.length=1,h;var b=h.imul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.mul=function(h,y){if(h.isZero()||y.isZero())return new o(0)._forceRed(this);var b=h.mul(y),x=b.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=b.isub(x).iushrn(this.shift),N=_;return _.cmp(this.m)>=0?N=_.isub(this.m):_.cmpn(0)<0&&(N=_.iadd(this.m)),N._forceRed(this)},V.prototype.invm=function(h){var y=this.imod(h._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(typeof t>"u"||t,e)}),eg=Qe((e,t)=>{var r=tf(),n=fn().Buffer;function i(s,o){return n.from(s.toRed(r.mont(o.modulus)).redPow(new r(o.publicExponent)).fromRed().toArray())}a(i,"K"),t.exports=i}),n6=Qe((e,t)=>{(function(r,n){function i(b,x){if(!b)throw Error(x||"Assertion failed")}a(i,"K");function s(b,x){b.super_=x;var _=a(function(){},"V");_.prototype=x.prototype,b.prototype=new _,b.prototype.constructor=b}a(s,"O");function o(b,x,_){if(o.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((x==="le"||x==="be")&&(_=x,x=10),this._init(b||0,x||10,_||"be"))}a(o,"Y"),typeof r=="object"?r.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=(ln(),qt(qr)).Buffer}catch{}o.isBN=function(b){return b instanceof o?!0:b!==null&&typeof b=="object"&&b.constructor.wordSize===o.wordSize&&Array.isArray(b.words)},o.max=function(b,x){return b.cmp(x)>0?b:x},o.min=function(b,x){return b.cmp(x)<0?b:x},o.prototype._init=function(b,x,_){if(typeof b=="number")return this._initNumber(b,x,_);if(typeof b=="object")return this._initArray(b,x,_);x==="hex"&&(x=16),i(x===(x|0)&&x>=2&&x<=36),b=b.toString().replace(/\s+/g,"");var N=0;b[0]==="-"&&(N++,this.negative=1),N<b.length&&(x===16?this._parseHex(b,N,_):(this._parseBase(b,x,N),_==="le"&&this._initArray(this.toArray(),x,_)))},o.prototype._initNumber=function(b,x,_){b<0&&(this.negative=1,b=-b),b<67108864?(this.words=[b&67108863],this.length=1):b<4503599627370496?(this.words=[b&67108863,b/67108864&67108863],this.length=2):(i(b<9007199254740992),this.words=[b&67108863,b/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),x,_)},o.prototype._initArray=function(b,x,_){if(i(typeof b.length=="number"),b.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(b.length/3),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var T,k,p=0;if(_==="be")for(N=b.length-1,T=0;N>=0;N-=3)k=b[N]|b[N-1]<<8|b[N-2]<<16,this.words[T]|=k<<p&67108863,this.words[T+1]=k>>>26-p&67108863,p+=24,p>=26&&(p-=26,T++);else if(_==="le")for(N=0,T=0;N<b.length;N+=3)k=b[N]|b[N+1]<<8|b[N+2]<<16,this.words[T]|=k<<p&67108863,this.words[T+1]=k>>>26-p&67108863,p+=24,p>=26&&(p-=26,T++);return this._strip()};function u(b,x){var _=b.charCodeAt(x);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;i(!1,"Invalid character in "+b)}a(u,"W");function c(b,x,_){var N=u(b,_);return _-1>=x&&(N|=u(b,_-1)<<4),N}a(c,"T"),o.prototype._parseHex=function(b,x,_){this.length=Math.ceil((b.length-x)/6),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var T=0,k=0,p;if(_==="be")for(N=b.length-1;N>=x;N-=2)p=c(b,x,N)<<T,this.words[k]|=p&67108863,T>=18?(T-=18,k+=1,this.words[k]|=p>>>26):T+=8;else{var S=b.length-x;for(N=S%2===0?x+1:x;N<b.length;N+=2)p=c(b,x,N)<<T,this.words[k]|=p&67108863,T>=18?(T-=18,k+=1,this.words[k]|=p>>>26):T+=8}this._strip()};function d(b,x,_,N){for(var T=0,k=0,p=Math.min(b.length,_),S=x;S<p;S++){var I=b.charCodeAt(S)-48;T*=N,I>=49?k=I-49+10:I>=17?k=I-17+10:k=I,i(I>=0&&k<N,"Invalid character"),T+=k}return T}a(d,"Z"),o.prototype._parseBase=function(b,x,_){this.words=[0],this.length=1;for(var N=0,T=1;T<=67108863;T*=x)N++;N--,T=T/x|0;for(var k=b.length-_,p=k%N,S=Math.min(k,k-p)+_,I=0,M=_;M<S;M+=N)I=d(b,M,M+N,x),this.imuln(T),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I);if(p!==0){var U=1;for(I=d(b,M,b.length,x),M=0;M<p;M++)U*=x;this.imuln(U),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I)}this._strip()},o.prototype.copy=function(b){b.words=Array(this.length);for(var x=0;x<this.length;x++)b.words[x]=this.words[x];b.length=this.length,b.negative=this.negative,b.red=this.red};function f(b,x){b.words=x.words,b.length=x.length,b.negative=x.negative,b.red=x.red}if(a(f,"w"),o.prototype._move=function(b){f(b,this)},o.prototype.clone=function(){var b=new o(null);return this.copy(b),b},o.prototype._expand=function(b){for(;this.length<b;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{o.prototype.inspect=g}else o.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}a(g,"k");var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(b,x){b=b||10,x=x|0||1;var _;if(b===16||b==="hex"){_="";for(var N=0,T=0,k=0;k<this.length;k++){var p=this.words[k],S=((p<<N|T)&16777215).toString(16);T=p>>>24-N&16777215,N+=2,N>=26&&(N-=26,k--),T!==0||k!==this.length-1?_=m[6-S.length]+S+_:_=S+_}for(T!==0&&(_=T.toString(16)+_);_.length%x!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(b===(b|0)&&b>=2&&b<=36){var I=w[b],M=E[b];_="";var U=this.clone();for(U.negative=0;!U.isZero();){var B=U.modrn(M).toString(b);U=U.idivn(M),U.isZero()?_=B+_:_=m[I-B.length]+B+_}for(this.isZero()&&(_="0"+_);_.length%x!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var b=this.words[0];return this.length===2?b+=this.words[1]*67108864:this.length===3&&this.words[2]===1?b+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-b:b},o.prototype.toJSON=function(){return this.toString(16,2)},l&&(o.prototype.toBuffer=function(b,x){return this.toArrayLike(l,b,x)}),o.prototype.toArray=function(b,x){return this.toArrayLike(Array,b,x)};var A=a(function(b,x){return b.allocUnsafe?b.allocUnsafe(x):new b(x)},"E");o.prototype.toArrayLike=function(b,x,_){this._strip();var N=this.byteLength(),T=_||Math.max(1,N);i(N<=T,"byte array longer than desired length"),i(T>0,"Requested array length <= 0");var k=A(b,T),p=x==="le"?"LE":"BE";return this["_toArrayLike"+p](k,N),k},o.prototype._toArrayLikeLE=function(b,x){for(var _=0,N=0,T=0,k=0;T<this.length;T++){var p=this.words[T]<<k|N;b[_++]=p&255,_<b.length&&(b[_++]=p>>8&255),_<b.length&&(b[_++]=p>>16&255),k===6?(_<b.length&&(b[_++]=p>>24&255),N=0,k=0):(N=p>>>24,k+=2)}if(_<b.length)for(b[_++]=N;_<b.length;)b[_++]=0},o.prototype._toArrayLikeBE=function(b,x){for(var _=b.length-1,N=0,T=0,k=0;T<this.length;T++){var p=this.words[T]<<k|N;b[_--]=p&255,_>=0&&(b[_--]=p>>8&255),_>=0&&(b[_--]=p>>16&255),k===6?(_>=0&&(b[_--]=p>>24&255),N=0,k=0):(N=p>>>24,k+=2)}if(_>=0)for(b[_--]=N;_>=0;)b[_--]=0},Math.clz32?o.prototype._countBits=function(b){return 32-Math.clz32(b)}:o.prototype._countBits=function(b){var x=b,_=0;return x>=4096&&(_+=13,x>>>=13),x>=64&&(_+=7,x>>>=7),x>=8&&(_+=4,x>>>=4),x>=2&&(_+=2,x>>>=2),_+x},o.prototype._zeroBits=function(b){if(b===0)return 26;var x=b,_=0;return(x&8191)===0&&(_+=13,x>>>=13),(x&127)===0&&(_+=7,x>>>=7),(x&15)===0&&(_+=4,x>>>=4),(x&3)===0&&(_+=2,x>>>=2),(x&1)===0&&_++,_},o.prototype.bitLength=function(){var b=this.words[this.length-1],x=this._countBits(b);return(this.length-1)*26+x};function C(b){for(var x=Array(b.bitLength()),_=0;_<x.length;_++){var N=_/26|0,T=_%26;x[_]=b.words[N]>>>T&1}return x}a(C,"D"),o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var b=0,x=0;x<this.length;x++){var _=this._zeroBits(this.words[x]);if(b+=_,_!==26)break}return b},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(b){return this.negative!==0?this.abs().inotn(b).iaddn(1):this.clone()},o.prototype.fromTwos=function(b){return this.testn(b-1)?this.notn(b).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(b){for(;this.length<b.length;)this.words[this.length++]=0;for(var x=0;x<b.length;x++)this.words[x]=this.words[x]|b.words[x];return this._strip()},o.prototype.ior=function(b){return i((this.negative|b.negative)===0),this.iuor(b)},o.prototype.or=function(b){return this.length>b.length?this.clone().ior(b):b.clone().ior(this)},o.prototype.uor=function(b){return this.length>b.length?this.clone().iuor(b):b.clone().iuor(this)},o.prototype.iuand=function(b){var x;this.length>b.length?x=b:x=this;for(var _=0;_<x.length;_++)this.words[_]=this.words[_]&b.words[_];return this.length=x.length,this._strip()},o.prototype.iand=function(b){return i((this.negative|b.negative)===0),this.iuand(b)},o.prototype.and=function(b){return this.length>b.length?this.clone().iand(b):b.clone().iand(this)},o.prototype.uand=function(b){return this.length>b.length?this.clone().iuand(b):b.clone().iuand(this)},o.prototype.iuxor=function(b){var x,_;this.length>b.length?(x=this,_=b):(x=b,_=this);for(var N=0;N<_.length;N++)this.words[N]=x.words[N]^_.words[N];if(this!==x)for(;N<x.length;N++)this.words[N]=x.words[N];return this.length=x.length,this._strip()},o.prototype.ixor=function(b){return i((this.negative|b.negative)===0),this.iuxor(b)},o.prototype.xor=function(b){return this.length>b.length?this.clone().ixor(b):b.clone().ixor(this)},o.prototype.uxor=function(b){return this.length>b.length?this.clone().iuxor(b):b.clone().iuxor(this)},o.prototype.inotn=function(b){i(typeof b=="number"&&b>=0);var x=Math.ceil(b/26)|0,_=b%26;this._expand(x),_>0&&x--;for(var N=0;N<x;N++)this.words[N]=~this.words[N]&67108863;return _>0&&(this.words[N]=~this.words[N]&67108863>>26-_),this._strip()},o.prototype.notn=function(b){return this.clone().inotn(b)},o.prototype.setn=function(b,x){i(typeof b=="number"&&b>=0);var _=b/26|0,N=b%26;return this._expand(_+1),x?this.words[_]=this.words[_]|1<<N:this.words[_]=this.words[_]&~(1<<N),this._strip()},o.prototype.iadd=function(b){var x;if(this.negative!==0&&b.negative===0)return this.negative=0,x=this.isub(b),this.negative^=1,this._normSign();if(this.negative===0&&b.negative!==0)return b.negative=0,x=this.isub(b),b.negative=1,x._normSign();var _,N;this.length>b.length?(_=this,N=b):(_=b,N=this);for(var T=0,k=0;k<N.length;k++)x=(_.words[k]|0)+(N.words[k]|0)+T,this.words[k]=x&67108863,T=x>>>26;for(;T!==0&&k<_.length;k++)x=(_.words[k]|0)+T,this.words[k]=x&67108863,T=x>>>26;if(this.length=_.length,T!==0)this.words[this.length]=T,this.length++;else if(_!==this)for(;k<_.length;k++)this.words[k]=_.words[k];return this},o.prototype.add=function(b){var x;return b.negative!==0&&this.negative===0?(b.negative=0,x=this.sub(b),b.negative^=1,x):b.negative===0&&this.negative!==0?(this.negative=0,x=b.sub(this),this.negative=1,x):this.length>b.length?this.clone().iadd(b):b.clone().iadd(this)},o.prototype.isub=function(b){if(b.negative!==0){b.negative=0;var x=this.iadd(b);return b.negative=1,x._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(b),this.negative=1,this._normSign();var _=this.cmp(b);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,T;_>0?(N=this,T=b):(N=b,T=this);for(var k=0,p=0;p<T.length;p++)x=(N.words[p]|0)-(T.words[p]|0)+k,k=x>>26,this.words[p]=x&67108863;for(;k!==0&&p<N.length;p++)x=(N.words[p]|0)+k,k=x>>26,this.words[p]=x&67108863;if(k===0&&p<N.length&&N!==this)for(;p<N.length;p++)this.words[p]=N.words[p];return this.length=Math.max(this.length,p),N!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(b){return this.clone().isub(b)};function O(b,x,_){_.negative=x.negative^b.negative;var N=b.length+x.length|0;_.length=N,N=N-1|0;var T=b.words[0]|0,k=x.words[0]|0,p=T*k,S=p&67108863,I=p/67108864|0;_.words[0]=S;for(var M=1;M<N;M++){for(var U=I>>>26,B=I&67108863,H=Math.min(M,x.length-1),$=Math.max(0,M-b.length+1);$<=H;$++){var ae=M-$|0;T=b.words[ae]|0,k=x.words[$]|0,p=T*k+B,U+=p/67108864|0,B=p&67108863}_.words[M]=B|0,I=U|0}return I!==0?_.words[M]=I|0:_.length--,_._strip()}a(O,"h");var R=a(function(b,x,_){var N=b.words,T=x.words,k=_.words,p=0,S,I,M,U=N[0]|0,B=U&8191,H=U>>>13,$=N[1]|0,ae=$&8191,ie=$>>>13,ne=N[2]|0,Ne=ne&8191,ve=ne>>>13,he=N[3]|0,Se=he&8191,Q=he>>>13,se=N[4]|0,J=se&8191,te=se>>>13,de=N[5]|0,be=de&8191,Ae=de>>>13,oe=N[6]|0,Y=oe&8191,ee=oe>>>13,X=N[7]|0,W=X&8191,q=X>>>13,re=N[8]|0,Oe=re&8191,Ee=re>>>13,Be=N[9]|0,pt=Be&8191,xe=Be>>>13,Ge=T[0]|0,ge=Ge&8191,_e=Ge>>>13,Re=T[1]|0,ze=Re&8191,Pe=Re>>>13,We=T[2]|0,xt=We&8191,Ve=We>>>13,Te=T[3]|0,Ye=Te&8191,Me=Te>>>13,$e=T[4]|0,mt=$e&8191,ue=$e>>>13,me=T[5]|0,He=me&8191,Ie=me>>>13,je=T[6]|0,rt=je&8191,ce=je>>>13,Ce=T[7]|0,et=Ce&8191,ke=Ce>>>13,tt=T[8]|0,Tt=tt&8191,Ke=tt>>>13,st=T[9]|0,Ze=st&8191,Je=st>>>13;_.negative=b.negative^x.negative,_.length=19,S=Math.imul(B,ge),I=Math.imul(B,_e),I=I+Math.imul(H,ge)|0,M=Math.imul(H,_e);var Et=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Et>>>26)|0,Et&=67108863,S=Math.imul(ae,ge),I=Math.imul(ae,_e),I=I+Math.imul(ie,ge)|0,M=Math.imul(ie,_e),S=S+Math.imul(B,ze)|0,I=I+Math.imul(B,Pe)|0,I=I+Math.imul(H,ze)|0,M=M+Math.imul(H,Pe)|0;var Ft=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,S=Math.imul(Ne,ge),I=Math.imul(Ne,_e),I=I+Math.imul(ve,ge)|0,M=Math.imul(ve,_e),S=S+Math.imul(ae,ze)|0,I=I+Math.imul(ae,Pe)|0,I=I+Math.imul(ie,ze)|0,M=M+Math.imul(ie,Pe)|0,S=S+Math.imul(B,xt)|0,I=I+Math.imul(B,Ve)|0,I=I+Math.imul(H,xt)|0,M=M+Math.imul(H,Ve)|0;var Ot=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,S=Math.imul(Se,ge),I=Math.imul(Se,_e),I=I+Math.imul(Q,ge)|0,M=Math.imul(Q,_e),S=S+Math.imul(Ne,ze)|0,I=I+Math.imul(Ne,Pe)|0,I=I+Math.imul(ve,ze)|0,M=M+Math.imul(ve,Pe)|0,S=S+Math.imul(ae,xt)|0,I=I+Math.imul(ae,Ve)|0,I=I+Math.imul(ie,xt)|0,M=M+Math.imul(ie,Ve)|0,S=S+Math.imul(B,Ye)|0,I=I+Math.imul(B,Me)|0,I=I+Math.imul(H,Ye)|0,M=M+Math.imul(H,Me)|0;var nr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(nr>>>26)|0,nr&=67108863,S=Math.imul(J,ge),I=Math.imul(J,_e),I=I+Math.imul(te,ge)|0,M=Math.imul(te,_e),S=S+Math.imul(Se,ze)|0,I=I+Math.imul(Se,Pe)|0,I=I+Math.imul(Q,ze)|0,M=M+Math.imul(Q,Pe)|0,S=S+Math.imul(Ne,xt)|0,I=I+Math.imul(Ne,Ve)|0,I=I+Math.imul(ve,xt)|0,M=M+Math.imul(ve,Ve)|0,S=S+Math.imul(ae,Ye)|0,I=I+Math.imul(ae,Me)|0,I=I+Math.imul(ie,Ye)|0,M=M+Math.imul(ie,Me)|0,S=S+Math.imul(B,mt)|0,I=I+Math.imul(B,ue)|0,I=I+Math.imul(H,mt)|0,M=M+Math.imul(H,ue)|0;var wr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(wr>>>26)|0,wr&=67108863,S=Math.imul(be,ge),I=Math.imul(be,_e),I=I+Math.imul(Ae,ge)|0,M=Math.imul(Ae,_e),S=S+Math.imul(J,ze)|0,I=I+Math.imul(J,Pe)|0,I=I+Math.imul(te,ze)|0,M=M+Math.imul(te,Pe)|0,S=S+Math.imul(Se,xt)|0,I=I+Math.imul(Se,Ve)|0,I=I+Math.imul(Q,xt)|0,M=M+Math.imul(Q,Ve)|0,S=S+Math.imul(Ne,Ye)|0,I=I+Math.imul(Ne,Me)|0,I=I+Math.imul(ve,Ye)|0,M=M+Math.imul(ve,Me)|0,S=S+Math.imul(ae,mt)|0,I=I+Math.imul(ae,ue)|0,I=I+Math.imul(ie,mt)|0,M=M+Math.imul(ie,ue)|0,S=S+Math.imul(B,He)|0,I=I+Math.imul(B,Ie)|0,I=I+Math.imul(H,He)|0,M=M+Math.imul(H,Ie)|0;var ir=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(ir>>>26)|0,ir&=67108863,S=Math.imul(Y,ge),I=Math.imul(Y,_e),I=I+Math.imul(ee,ge)|0,M=Math.imul(ee,_e),S=S+Math.imul(be,ze)|0,I=I+Math.imul(be,Pe)|0,I=I+Math.imul(Ae,ze)|0,M=M+Math.imul(Ae,Pe)|0,S=S+Math.imul(J,xt)|0,I=I+Math.imul(J,Ve)|0,I=I+Math.imul(te,xt)|0,M=M+Math.imul(te,Ve)|0,S=S+Math.imul(Se,Ye)|0,I=I+Math.imul(Se,Me)|0,I=I+Math.imul(Q,Ye)|0,M=M+Math.imul(Q,Me)|0,S=S+Math.imul(Ne,mt)|0,I=I+Math.imul(Ne,ue)|0,I=I+Math.imul(ve,mt)|0,M=M+Math.imul(ve,ue)|0,S=S+Math.imul(ae,He)|0,I=I+Math.imul(ae,Ie)|0,I=I+Math.imul(ie,He)|0,M=M+Math.imul(ie,Ie)|0,S=S+Math.imul(B,rt)|0,I=I+Math.imul(B,ce)|0,I=I+Math.imul(H,rt)|0,M=M+Math.imul(H,ce)|0;var er=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(er>>>26)|0,er&=67108863,S=Math.imul(W,ge),I=Math.imul(W,_e),I=I+Math.imul(q,ge)|0,M=Math.imul(q,_e),S=S+Math.imul(Y,ze)|0,I=I+Math.imul(Y,Pe)|0,I=I+Math.imul(ee,ze)|0,M=M+Math.imul(ee,Pe)|0,S=S+Math.imul(be,xt)|0,I=I+Math.imul(be,Ve)|0,I=I+Math.imul(Ae,xt)|0,M=M+Math.imul(Ae,Ve)|0,S=S+Math.imul(J,Ye)|0,I=I+Math.imul(J,Me)|0,I=I+Math.imul(te,Ye)|0,M=M+Math.imul(te,Me)|0,S=S+Math.imul(Se,mt)|0,I=I+Math.imul(Se,ue)|0,I=I+Math.imul(Q,mt)|0,M=M+Math.imul(Q,ue)|0,S=S+Math.imul(Ne,He)|0,I=I+Math.imul(Ne,Ie)|0,I=I+Math.imul(ve,He)|0,M=M+Math.imul(ve,Ie)|0,S=S+Math.imul(ae,rt)|0,I=I+Math.imul(ae,ce)|0,I=I+Math.imul(ie,rt)|0,M=M+Math.imul(ie,ce)|0,S=S+Math.imul(B,et)|0,I=I+Math.imul(B,ke)|0,I=I+Math.imul(H,et)|0,M=M+Math.imul(H,ke)|0;var Ar=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ar>>>26)|0,Ar&=67108863,S=Math.imul(Oe,ge),I=Math.imul(Oe,_e),I=I+Math.imul(Ee,ge)|0,M=Math.imul(Ee,_e),S=S+Math.imul(W,ze)|0,I=I+Math.imul(W,Pe)|0,I=I+Math.imul(q,ze)|0,M=M+Math.imul(q,Pe)|0,S=S+Math.imul(Y,xt)|0,I=I+Math.imul(Y,Ve)|0,I=I+Math.imul(ee,xt)|0,M=M+Math.imul(ee,Ve)|0,S=S+Math.imul(be,Ye)|0,I=I+Math.imul(be,Me)|0,I=I+Math.imul(Ae,Ye)|0,M=M+Math.imul(Ae,Me)|0,S=S+Math.imul(J,mt)|0,I=I+Math.imul(J,ue)|0,I=I+Math.imul(te,mt)|0,M=M+Math.imul(te,ue)|0,S=S+Math.imul(Se,He)|0,I=I+Math.imul(Se,Ie)|0,I=I+Math.imul(Q,He)|0,M=M+Math.imul(Q,Ie)|0,S=S+Math.imul(Ne,rt)|0,I=I+Math.imul(Ne,ce)|0,I=I+Math.imul(ve,rt)|0,M=M+Math.imul(ve,ce)|0,S=S+Math.imul(ae,et)|0,I=I+Math.imul(ae,ke)|0,I=I+Math.imul(ie,et)|0,M=M+Math.imul(ie,ke)|0,S=S+Math.imul(B,Tt)|0,I=I+Math.imul(B,Ke)|0,I=I+Math.imul(H,Tt)|0,M=M+Math.imul(H,Ke)|0;var Ir=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,S=Math.imul(pt,ge),I=Math.imul(pt,_e),I=I+Math.imul(xe,ge)|0,M=Math.imul(xe,_e),S=S+Math.imul(Oe,ze)|0,I=I+Math.imul(Oe,Pe)|0,I=I+Math.imul(Ee,ze)|0,M=M+Math.imul(Ee,Pe)|0,S=S+Math.imul(W,xt)|0,I=I+Math.imul(W,Ve)|0,I=I+Math.imul(q,xt)|0,M=M+Math.imul(q,Ve)|0,S=S+Math.imul(Y,Ye)|0,I=I+Math.imul(Y,Me)|0,I=I+Math.imul(ee,Ye)|0,M=M+Math.imul(ee,Me)|0,S=S+Math.imul(be,mt)|0,I=I+Math.imul(be,ue)|0,I=I+Math.imul(Ae,mt)|0,M=M+Math.imul(Ae,ue)|0,S=S+Math.imul(J,He)|0,I=I+Math.imul(J,Ie)|0,I=I+Math.imul(te,He)|0,M=M+Math.imul(te,Ie)|0,S=S+Math.imul(Se,rt)|0,I=I+Math.imul(Se,ce)|0,I=I+Math.imul(Q,rt)|0,M=M+Math.imul(Q,ce)|0,S=S+Math.imul(Ne,et)|0,I=I+Math.imul(Ne,ke)|0,I=I+Math.imul(ve,et)|0,M=M+Math.imul(ve,ke)|0,S=S+Math.imul(ae,Tt)|0,I=I+Math.imul(ae,Ke)|0,I=I+Math.imul(ie,Tt)|0,M=M+Math.imul(ie,Ke)|0,S=S+Math.imul(B,Ze)|0,I=I+Math.imul(B,Je)|0,I=I+Math.imul(H,Ze)|0,M=M+Math.imul(H,Je)|0;var pr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(pr>>>26)|0,pr&=67108863,S=Math.imul(pt,ze),I=Math.imul(pt,Pe),I=I+Math.imul(xe,ze)|0,M=Math.imul(xe,Pe),S=S+Math.imul(Oe,xt)|0,I=I+Math.imul(Oe,Ve)|0,I=I+Math.imul(Ee,xt)|0,M=M+Math.imul(Ee,Ve)|0,S=S+Math.imul(W,Ye)|0,I=I+Math.imul(W,Me)|0,I=I+Math.imul(q,Ye)|0,M=M+Math.imul(q,Me)|0,S=S+Math.imul(Y,mt)|0,I=I+Math.imul(Y,ue)|0,I=I+Math.imul(ee,mt)|0,M=M+Math.imul(ee,ue)|0,S=S+Math.imul(be,He)|0,I=I+Math.imul(be,Ie)|0,I=I+Math.imul(Ae,He)|0,M=M+Math.imul(Ae,Ie)|0,S=S+Math.imul(J,rt)|0,I=I+Math.imul(J,ce)|0,I=I+Math.imul(te,rt)|0,M=M+Math.imul(te,ce)|0,S=S+Math.imul(Se,et)|0,I=I+Math.imul(Se,ke)|0,I=I+Math.imul(Q,et)|0,M=M+Math.imul(Q,ke)|0,S=S+Math.imul(Ne,Tt)|0,I=I+Math.imul(Ne,Ke)|0,I=I+Math.imul(ve,Tt)|0,M=M+Math.imul(ve,Ke)|0,S=S+Math.imul(ae,Ze)|0,I=I+Math.imul(ae,Je)|0,I=I+Math.imul(ie,Ze)|0,M=M+Math.imul(ie,Je)|0;var Sr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,S=Math.imul(pt,xt),I=Math.imul(pt,Ve),I=I+Math.imul(xe,xt)|0,M=Math.imul(xe,Ve),S=S+Math.imul(Oe,Ye)|0,I=I+Math.imul(Oe,Me)|0,I=I+Math.imul(Ee,Ye)|0,M=M+Math.imul(Ee,Me)|0,S=S+Math.imul(W,mt)|0,I=I+Math.imul(W,ue)|0,I=I+Math.imul(q,mt)|0,M=M+Math.imul(q,ue)|0,S=S+Math.imul(Y,He)|0,I=I+Math.imul(Y,Ie)|0,I=I+Math.imul(ee,He)|0,M=M+Math.imul(ee,Ie)|0,S=S+Math.imul(be,rt)|0,I=I+Math.imul(be,ce)|0,I=I+Math.imul(Ae,rt)|0,M=M+Math.imul(Ae,ce)|0,S=S+Math.imul(J,et)|0,I=I+Math.imul(J,ke)|0,I=I+Math.imul(te,et)|0,M=M+Math.imul(te,ke)|0,S=S+Math.imul(Se,Tt)|0,I=I+Math.imul(Se,Ke)|0,I=I+Math.imul(Q,Tt)|0,M=M+Math.imul(Q,Ke)|0,S=S+Math.imul(Ne,Ze)|0,I=I+Math.imul(Ne,Je)|0,I=I+Math.imul(ve,Ze)|0,M=M+Math.imul(ve,Je)|0;var or=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(or>>>26)|0,or&=67108863,S=Math.imul(pt,Ye),I=Math.imul(pt,Me),I=I+Math.imul(xe,Ye)|0,M=Math.imul(xe,Me),S=S+Math.imul(Oe,mt)|0,I=I+Math.imul(Oe,ue)|0,I=I+Math.imul(Ee,mt)|0,M=M+Math.imul(Ee,ue)|0,S=S+Math.imul(W,He)|0,I=I+Math.imul(W,Ie)|0,I=I+Math.imul(q,He)|0,M=M+Math.imul(q,Ie)|0,S=S+Math.imul(Y,rt)|0,I=I+Math.imul(Y,ce)|0,I=I+Math.imul(ee,rt)|0,M=M+Math.imul(ee,ce)|0,S=S+Math.imul(be,et)|0,I=I+Math.imul(be,ke)|0,I=I+Math.imul(Ae,et)|0,M=M+Math.imul(Ae,ke)|0,S=S+Math.imul(J,Tt)|0,I=I+Math.imul(J,Ke)|0,I=I+Math.imul(te,Tt)|0,M=M+Math.imul(te,Ke)|0,S=S+Math.imul(Se,Ze)|0,I=I+Math.imul(Se,Je)|0,I=I+Math.imul(Q,Ze)|0,M=M+Math.imul(Q,Je)|0;var mr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(mr>>>26)|0,mr&=67108863,S=Math.imul(pt,mt),I=Math.imul(pt,ue),I=I+Math.imul(xe,mt)|0,M=Math.imul(xe,ue),S=S+Math.imul(Oe,He)|0,I=I+Math.imul(Oe,Ie)|0,I=I+Math.imul(Ee,He)|0,M=M+Math.imul(Ee,Ie)|0,S=S+Math.imul(W,rt)|0,I=I+Math.imul(W,ce)|0,I=I+Math.imul(q,rt)|0,M=M+Math.imul(q,ce)|0,S=S+Math.imul(Y,et)|0,I=I+Math.imul(Y,ke)|0,I=I+Math.imul(ee,et)|0,M=M+Math.imul(ee,ke)|0,S=S+Math.imul(be,Tt)|0,I=I+Math.imul(be,Ke)|0,I=I+Math.imul(Ae,Tt)|0,M=M+Math.imul(Ae,Ke)|0,S=S+Math.imul(J,Ze)|0,I=I+Math.imul(J,Je)|0,I=I+Math.imul(te,Ze)|0,M=M+Math.imul(te,Je)|0;var kr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(kr>>>26)|0,kr&=67108863,S=Math.imul(pt,He),I=Math.imul(pt,Ie),I=I+Math.imul(xe,He)|0,M=Math.imul(xe,Ie),S=S+Math.imul(Oe,rt)|0,I=I+Math.imul(Oe,ce)|0,I=I+Math.imul(Ee,rt)|0,M=M+Math.imul(Ee,ce)|0,S=S+Math.imul(W,et)|0,I=I+Math.imul(W,ke)|0,I=I+Math.imul(q,et)|0,M=M+Math.imul(q,ke)|0,S=S+Math.imul(Y,Tt)|0,I=I+Math.imul(Y,Ke)|0,I=I+Math.imul(ee,Tt)|0,M=M+Math.imul(ee,Ke)|0,S=S+Math.imul(be,Ze)|0,I=I+Math.imul(be,Je)|0,I=I+Math.imul(Ae,Ze)|0,M=M+Math.imul(Ae,Je)|0;var Cr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,S=Math.imul(pt,rt),I=Math.imul(pt,ce),I=I+Math.imul(xe,rt)|0,M=Math.imul(xe,ce),S=S+Math.imul(Oe,et)|0,I=I+Math.imul(Oe,ke)|0,I=I+Math.imul(Ee,et)|0,M=M+Math.imul(Ee,ke)|0,S=S+Math.imul(W,Tt)|0,I=I+Math.imul(W,Ke)|0,I=I+Math.imul(q,Tt)|0,M=M+Math.imul(q,Ke)|0,S=S+Math.imul(Y,Ze)|0,I=I+Math.imul(Y,Je)|0,I=I+Math.imul(ee,Ze)|0,M=M+Math.imul(ee,Je)|0;var Mr=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Mr>>>26)|0,Mr&=67108863,S=Math.imul(pt,et),I=Math.imul(pt,ke),I=I+Math.imul(xe,et)|0,M=Math.imul(xe,ke),S=S+Math.imul(Oe,Tt)|0,I=I+Math.imul(Oe,Ke)|0,I=I+Math.imul(Ee,Tt)|0,M=M+Math.imul(Ee,Ke)|0,S=S+Math.imul(W,Ze)|0,I=I+Math.imul(W,Je)|0,I=I+Math.imul(q,Ze)|0,M=M+Math.imul(q,Je)|0;var Or=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(Or>>>26)|0,Or&=67108863,S=Math.imul(pt,Tt),I=Math.imul(pt,Ke),I=I+Math.imul(xe,Tt)|0,M=Math.imul(xe,Ke),S=S+Math.imul(Oe,Ze)|0,I=I+Math.imul(Oe,Je)|0,I=I+Math.imul(Ee,Ze)|0,M=M+Math.imul(Ee,Je)|0;var zo=(p+S|0)+((I&8191)<<13)|0;p=(M+(I>>>13)|0)+(zo>>>26)|0,zo&=67108863,S=Math.imul(pt,Ze),I=Math.imul(pt,Je),I=I+Math.imul(xe,Ze)|0,M=Math.imul(xe,Je);var fe=(p+S|0)+((I&8191)<<13)|0;return p=(M+(I>>>13)|0)+(fe>>>26)|0,fe&=67108863,k[0]=Et,k[1]=Ft,k[2]=Ot,k[3]=nr,k[4]=wr,k[5]=ir,k[6]=er,k[7]=Ar,k[8]=Ir,k[9]=pr,k[10]=Sr,k[11]=or,k[12]=mr,k[13]=kr,k[14]=Cr,k[15]=Mr,k[16]=Or,k[17]=zo,k[18]=fe,p!==0&&(k[19]=p,_.length++),_},"L");Math.imul||(R=O);function P(b,x,_){_.negative=x.negative^b.negative,_.length=b.length+x.length;for(var N=0,T=0,k=0;k<_.length-1;k++){var p=T;T=0;for(var S=N&67108863,I=Math.min(k,x.length-1),M=Math.max(0,k-b.length+1);M<=I;M++){var U=k-M,B=b.words[U]|0,H=x.words[M]|0,$=B*H,ae=$&67108863;p=p+($/67108864|0)|0,ae=ae+S|0,S=ae&67108863,p=p+(ae>>>26)|0,T+=p>>>26,p&=67108863}_.words[k]=S,N=p,p=T}return N!==0?_.words[k]=N:_.length--,_._strip()}a(P,"b");function L(b,x,_){return P(b,x,_)}a(L,"y"),o.prototype.mulTo=function(b,x){var _,N=this.length+b.length;return this.length===10&&b.length===10?_=R(this,b,x):N<63?_=O(this,b,x):N<1024?_=P(this,b,x):_=L(this,b,x),_},o.prototype.mul=function(b){var x=new o(null);return x.words=Array(this.length+b.length),this.mulTo(b,x)},o.prototype.mulf=function(b){var x=new o(null);return x.words=Array(this.length+b.length),L(this,b,x)},o.prototype.imul=function(b){return this.clone().mulTo(b,this)},o.prototype.imuln=function(b){var x=b<0;x&&(b=-b),i(typeof b=="number"),i(b<67108864);for(var _=0,N=0;N<this.length;N++){var T=(this.words[N]|0)*b,k=(T&67108863)+(_&67108863);_>>=26,_+=T/67108864|0,_+=k>>>26,this.words[N]=k&67108863}return _!==0&&(this.words[N]=_,this.length++),this.length=b===0?1:this.length,x?this.ineg():this},o.prototype.muln=function(b){return this.clone().imuln(b)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(b){var x=C(b);if(x.length===0)return new o(1);for(var _=this,N=0;N<x.length&&x[N]===0;N++,_=_.sqr());if(++N<x.length)for(var T=_.sqr();N<x.length;N++,T=T.sqr())x[N]!==0&&(_=_.mul(T));return _},o.prototype.iushln=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26,N=67108863>>>26-x<<26-x,T;if(x!==0){var k=0;for(T=0;T<this.length;T++){var p=this.words[T]&N,S=(this.words[T]|0)-p<<x;this.words[T]=S|k,k=p>>>26-x}k&&(this.words[T]=k,this.length++)}if(_!==0){for(T=this.length-1;T>=0;T--)this.words[T+_]=this.words[T];for(T=0;T<_;T++)this.words[T]=0;this.length+=_}return this._strip()},o.prototype.ishln=function(b){return i(this.negative===0),this.iushln(b)},o.prototype.iushrn=function(b,x,_){i(typeof b=="number"&&b>=0);var N;x?N=(x-x%26)/26:N=0;var T=b%26,k=Math.min((b-T)/26,this.length),p=67108863^67108863>>>T<<T,S=_;if(N-=k,N=Math.max(0,N),S){for(var I=0;I<k;I++)S.words[I]=this.words[I];S.length=k}if(k!==0)if(this.length>k)for(this.length-=k,I=0;I<this.length;I++)this.words[I]=this.words[I+k];else this.words[0]=0,this.length=1;var M=0;for(I=this.length-1;I>=0&&(M!==0||I>=N);I--){var U=this.words[I]|0;this.words[I]=M<<26-T|U>>>T,M=U&p}return S&&M!==0&&(S.words[S.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(b,x,_){return i(this.negative===0),this.iushrn(b,x,_)},o.prototype.shln=function(b){return this.clone().ishln(b)},o.prototype.ushln=function(b){return this.clone().iushln(b)},o.prototype.shrn=function(b){return this.clone().ishrn(b)},o.prototype.ushrn=function(b){return this.clone().iushrn(b)},o.prototype.testn=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26,N=1<<x;if(this.length<=_)return!1;var T=this.words[_];return!!(T&N)},o.prototype.imaskn=function(b){i(typeof b=="number"&&b>=0);var x=b%26,_=(b-x)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(x!==0&&_++,this.length=Math.min(_,this.length),x!==0){var N=67108863^67108863>>>x<<x;this.words[this.length-1]&=N}return this._strip()},o.prototype.maskn=function(b){return this.clone().imaskn(b)},o.prototype.iaddn=function(b){return i(typeof b=="number"),i(b<67108864),b<0?this.isubn(-b):this.negative!==0?this.length===1&&(this.words[0]|0)<=b?(this.words[0]=b-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(b),this.negative=1,this):this._iaddn(b)},o.prototype._iaddn=function(b){this.words[0]+=b;for(var x=0;x<this.length&&this.words[x]>=67108864;x++)this.words[x]-=67108864,x===this.length-1?this.words[x+1]=1:this.words[x+1]++;return this.length=Math.max(this.length,x+1),this},o.prototype.isubn=function(b){if(i(typeof b=="number"),i(b<67108864),b<0)return this.iaddn(-b);if(this.negative!==0)return this.negative=0,this.iaddn(b),this.negative=1,this;if(this.words[0]-=b,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var x=0;x<this.length&&this.words[x]<0;x++)this.words[x]+=67108864,this.words[x+1]-=1;return this._strip()},o.prototype.addn=function(b){return this.clone().iaddn(b)},o.prototype.subn=function(b){return this.clone().isubn(b)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(b,x,_){var N=b.length+_,T;this._expand(N);var k,p=0;for(T=0;T<b.length;T++){k=(this.words[T+_]|0)+p;var S=(b.words[T]|0)*x;k-=S&67108863,p=(k>>26)-(S/67108864|0),this.words[T+_]=k&67108863}for(;T<this.length-_;T++)k=(this.words[T+_]|0)+p,p=k>>26,this.words[T+_]=k&67108863;if(p===0)return this._strip();for(i(p===-1),p=0,T=0;T<this.length;T++)k=-(this.words[T]|0)+p,p=k>>26,this.words[T]=k&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(b,x){var _=this.length-b.length,N=this.clone(),T=b,k=T.words[T.length-1]|0,p=this._countBits(k);_=26-p,_!==0&&(T=T.ushln(_),N.iushln(_),k=T.words[T.length-1]|0);var S=N.length-T.length,I;if(x!=="mod"){I=new o(null),I.length=S+1,I.words=Array(I.length);for(var M=0;M<I.length;M++)I.words[M]=0}var U=N.clone()._ishlnsubmul(T,1,S);U.negative===0&&(N=U,I&&(I.words[S]=1));for(var B=S-1;B>=0;B--){var H=(N.words[T.length+B]|0)*67108864+(N.words[T.length+B-1]|0);for(H=Math.min(H/k|0,67108863),N._ishlnsubmul(T,H,B);N.negative!==0;)H--,N.negative=0,N._ishlnsubmul(T,1,B),!N.isZero()&&(N.negative^=1);I&&(I.words[B]=H)}return I&&I._strip(),N._strip(),x!=="div"&&_!==0&&N.iushrn(_),{div:I||null,mod:N}},o.prototype.divmod=function(b,x,_){if(i(!b.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var N,T,k;return this.negative!==0&&b.negative===0?(k=this.neg().divmod(b,x),x!=="mod"&&(N=k.div.neg()),x!=="div"&&(T=k.mod.neg(),_&&T.negative!==0&&T.iadd(b)),{div:N,mod:T}):this.negative===0&&b.negative!==0?(k=this.divmod(b.neg(),x),x!=="mod"&&(N=k.div.neg()),{div:N,mod:k.mod}):(this.negative&b.negative)!==0?(k=this.neg().divmod(b.neg(),x),x!=="div"&&(T=k.mod.neg(),_&&T.negative!==0&&T.isub(b)),{div:k.div,mod:T}):b.length>this.length||this.cmp(b)<0?{div:new o(0),mod:this}:b.length===1?x==="div"?{div:this.divn(b.words[0]),mod:null}:x==="mod"?{div:null,mod:new o(this.modrn(b.words[0]))}:{div:this.divn(b.words[0]),mod:new o(this.modrn(b.words[0]))}:this._wordDiv(b,x)},o.prototype.div=function(b){return this.divmod(b,"div",!1).div},o.prototype.mod=function(b){return this.divmod(b,"mod",!1).mod},o.prototype.umod=function(b){return this.divmod(b,"mod",!0).mod},o.prototype.divRound=function(b){var x=this.divmod(b);if(x.mod.isZero())return x.div;var _=x.div.negative!==0?x.mod.isub(b):x.mod,N=b.ushrn(1),T=b.andln(1),k=_.cmp(N);return k<0||T===1&&k===0?x.div:x.div.negative!==0?x.div.isubn(1):x.div.iaddn(1)},o.prototype.modrn=function(b){var x=b<0;x&&(b=-b),i(b<=67108863);for(var _=67108864%b,N=0,T=this.length-1;T>=0;T--)N=(_*N+(this.words[T]|0))%b;return x?-N:N},o.prototype.modn=function(b){return this.modrn(b)},o.prototype.idivn=function(b){var x=b<0;x&&(b=-b),i(b<=67108863);for(var _=0,N=this.length-1;N>=0;N--){var T=(this.words[N]|0)+_*67108864;this.words[N]=T/b|0,_=T%b}return this._strip(),x?this.ineg():this},o.prototype.divn=function(b){return this.clone().idivn(b)},o.prototype.egcd=function(b){i(b.negative===0),i(!b.isZero());var x=this,_=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var N=new o(1),T=new o(0),k=new o(0),p=new o(1),S=0;x.isEven()&&_.isEven();)x.iushrn(1),_.iushrn(1),++S;for(var I=_.clone(),M=x.clone();!x.isZero();){for(var U=0,B=1;(x.words[0]&B)===0&&U<26;++U,B<<=1);if(U>0)for(x.iushrn(U);U-- >0;)(N.isOdd()||T.isOdd())&&(N.iadd(I),T.isub(M)),N.iushrn(1),T.iushrn(1);for(var H=0,$=1;(_.words[0]&$)===0&&H<26;++H,$<<=1);if(H>0)for(_.iushrn(H);H-- >0;)(k.isOdd()||p.isOdd())&&(k.iadd(I),p.isub(M)),k.iushrn(1),p.iushrn(1);x.cmp(_)>=0?(x.isub(_),N.isub(k),T.isub(p)):(_.isub(x),k.isub(N),p.isub(T))}return{a:k,b:p,gcd:_.iushln(S)}},o.prototype._invmp=function(b){i(b.negative===0),i(!b.isZero());var x=this,_=b.clone();x.negative!==0?x=x.umod(b):x=x.clone();for(var N=new o(1),T=new o(0),k=_.clone();x.cmpn(1)>0&&_.cmpn(1)>0;){for(var p=0,S=1;(x.words[0]&S)===0&&p<26;++p,S<<=1);if(p>0)for(x.iushrn(p);p-- >0;)N.isOdd()&&N.iadd(k),N.iushrn(1);for(var I=0,M=1;(_.words[0]&M)===0&&I<26;++I,M<<=1);if(I>0)for(_.iushrn(I);I-- >0;)T.isOdd()&&T.iadd(k),T.iushrn(1);x.cmp(_)>=0?(x.isub(_),N.isub(T)):(_.isub(x),T.isub(N))}var U;return x.cmpn(1)===0?U=N:U=T,U.cmpn(0)<0&&U.iadd(b),U},o.prototype.gcd=function(b){if(this.isZero())return b.abs();if(b.isZero())return this.abs();var x=this.clone(),_=b.clone();x.negative=0,_.negative=0;for(var N=0;x.isEven()&&_.isEven();N++)x.iushrn(1),_.iushrn(1);do{for(;x.isEven();)x.iushrn(1);for(;_.isEven();)_.iushrn(1);var T=x.cmp(_);if(T<0){var k=x;x=_,_=k}else if(T===0||_.cmpn(1)===0)break;x.isub(_)}while(!0);return _.iushln(N)},o.prototype.invm=function(b){return this.egcd(b).a.umod(b)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(b){return this.words[0]&b},o.prototype.bincn=function(b){i(typeof b=="number");var x=b%26,_=(b-x)/26,N=1<<x;if(this.length<=_)return this._expand(_+1),this.words[_]|=N,this;for(var T=N,k=_;T!==0&&k<this.length;k++){var p=this.words[k]|0;p+=T,T=p>>>26,p&=67108863,this.words[k]=p}return T!==0&&(this.words[k]=T,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(b){var x=b<0;if(this.negative!==0&&!x)return-1;if(this.negative===0&&x)return 1;this._strip();var _;if(this.length>1)_=1;else{x&&(b=-b),i(b<=67108863,"Number is too big");var N=this.words[0]|0;_=N===b?0:N<b?-1:1}return this.negative!==0?-_|0:_},o.prototype.cmp=function(b){if(this.negative!==0&&b.negative===0)return-1;if(this.negative===0&&b.negative!==0)return 1;var x=this.ucmp(b);return this.negative!==0?-x|0:x},o.prototype.ucmp=function(b){if(this.length>b.length)return 1;if(this.length<b.length)return-1;for(var x=0,_=this.length-1;_>=0;_--){var N=this.words[_]|0,T=b.words[_]|0;if(N!==T){N<T?x=-1:N>T&&(x=1);break}}return x},o.prototype.gtn=function(b){return this.cmpn(b)===1},o.prototype.gt=function(b){return this.cmp(b)===1},o.prototype.gten=function(b){return this.cmpn(b)>=0},o.prototype.gte=function(b){return this.cmp(b)>=0},o.prototype.ltn=function(b){return this.cmpn(b)===-1},o.prototype.lt=function(b){return this.cmp(b)===-1},o.prototype.lten=function(b){return this.cmpn(b)<=0},o.prototype.lte=function(b){return this.cmp(b)<=0},o.prototype.eqn=function(b){return this.cmpn(b)===0},o.prototype.eq=function(b){return this.cmp(b)===0},o.red=function(b){return new h(b)},o.prototype.toRed=function(b){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),b.convertTo(this)._forceRed(b)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(b){return this.red=b,this},o.prototype.forceRed=function(b){return i(!this.red,"Already a number in reduction context"),this._forceRed(b)},o.prototype.redAdd=function(b){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,b)},o.prototype.redIAdd=function(b){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,b)},o.prototype.redSub=function(b){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,b)},o.prototype.redISub=function(b){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,b)},o.prototype.redShl=function(b){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,b)},o.prototype.redMul=function(b){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.mul(this,b)},o.prototype.redIMul=function(b){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,b),this.red.imul(this,b)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(b){return i(this.red&&!b.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,b)};var j={k256:null,p224:null,p192:null,p25519:null};function G(b,x){this.name=b,this.p=new o(x,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}a(G,"$$"),G.prototype._tmp=function(){var b=new o(null);return b.words=Array(Math.ceil(this.n/13)),b},G.prototype.ireduce=function(b){var x=b,_;do this.split(x,this.tmp),x=this.imulK(x),x=x.iadd(this.tmp),_=x.bitLength();while(_>this.n);var N=_<this.n?-1:x.ucmp(this.p);return N===0?(x.words[0]=0,x.length=1):N>0?x.isub(this.p):x.strip!==void 0?x.strip():x._strip(),x},G.prototype.split=function(b,x){b.iushrn(this.n,0,x)},G.prototype.imulK=function(b){return b.imul(this.k)};function Z(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}a(Z,"Q"),s(Z,G),Z.prototype.split=function(b,x){for(var _=4194303,N=Math.min(b.length,9),T=0;T<N;T++)x.words[T]=b.words[T];if(x.length=N,b.length<=9){b.words[0]=0,b.length=1;return}var k=b.words[9];for(x.words[x.length++]=k&_,T=10;T<b.length;T++){var p=b.words[T]|0;b.words[T-10]=(p&_)<<4|k>>>22,k=p}k>>>=22,b.words[T-10]=k,k===0&&b.length>10?b.length-=10:b.length-=9},Z.prototype.imulK=function(b){b.words[b.length]=0,b.words[b.length+1]=0,b.length+=2;for(var x=0,_=0;_<b.length;_++){var N=b.words[_]|0;x+=N*977,b.words[_]=x&67108863,x=N*64+(x/67108864|0)}return b.words[b.length-1]===0&&(b.length--,b.words[b.length-1]===0&&b.length--),b};function K(){G.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}a(K,"c"),s(K,G);function z(){G.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}a(z,"a"),s(z,G);function V(){G.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}a(V,"j"),s(V,G),V.prototype.imulK=function(b){for(var x=0,_=0;_<b.length;_++){var N=(b.words[_]|0)*19+x,T=N&67108863;N>>>=26,b.words[_]=T,x=N}return x!==0&&(b.words[b.length++]=x),b},o._prime=function(b){if(j[b])return j[b];var x;if(b==="k256")x=new Z;else if(b==="p224")x=new K;else if(b==="p192")x=new z;else if(b==="p25519")x=new V;else throw Error("Unknown prime "+b);return j[b]=x,x};function h(b){if(typeof b=="string"){var x=o._prime(b);this.m=x.p,this.prime=x}else i(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}a(h,"J"),h.prototype._verify1=function(b){i(b.negative===0,"red works only with positives"),i(b.red,"red works only with red numbers")},h.prototype._verify2=function(b,x){i((b.negative|x.negative)===0,"red works only with positives"),i(b.red&&b.red===x.red,"red works only with red numbers")},h.prototype.imod=function(b){return this.prime?this.prime.ireduce(b)._forceRed(this):(f(b,b.umod(this.m)._forceRed(this)),b)},h.prototype.neg=function(b){return b.isZero()?b.clone():this.m.sub(b)._forceRed(this)},h.prototype.add=function(b,x){this._verify2(b,x);var _=b.add(x);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},h.prototype.iadd=function(b,x){this._verify2(b,x);var _=b.iadd(x);return _.cmp(this.m)>=0&&_.isub(this.m),_},h.prototype.sub=function(b,x){this._verify2(b,x);var _=b.sub(x);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},h.prototype.isub=function(b,x){this._verify2(b,x);var _=b.isub(x);return _.cmpn(0)<0&&_.iadd(this.m),_},h.prototype.shl=function(b,x){return this._verify1(b),this.imod(b.ushln(x))},h.prototype.imul=function(b,x){return this._verify2(b,x),this.imod(b.imul(x))},h.prototype.mul=function(b,x){return this._verify2(b,x),this.imod(b.mul(x))},h.prototype.isqr=function(b){return this.imul(b,b.clone())},h.prototype.sqr=function(b){return this.mul(b,b)},h.prototype.sqrt=function(b){if(b.isZero())return b.clone();var x=this.m.andln(3);if(i(x%2===1),x===3){var _=this.m.add(new o(1)).iushrn(2);return this.pow(b,_)}for(var N=this.m.subn(1),T=0;!N.isZero()&&N.andln(1)===0;)T++,N.iushrn(1);i(!N.isZero());var k=new o(1).toRed(this),p=k.redNeg(),S=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new o(2*I*I).toRed(this);this.pow(I,S).cmp(p)!==0;)I.redIAdd(p);for(var M=this.pow(I,N),U=this.pow(b,N.addn(1).iushrn(1)),B=this.pow(b,N),H=T;B.cmp(k)!==0;){for(var $=B,ae=0;$.cmp(k)!==0;ae++)$=$.redSqr();i(ae<H);var ie=this.pow(M,new o(1).iushln(H-ae-1));U=U.redMul(ie),M=ie.redSqr(),B=B.redMul(M),H=ae}return U},h.prototype.invm=function(b){var x=b._invmp(this.m);return x.negative!==0?(x.negative=0,this.imod(x).redNeg()):this.imod(x)},h.prototype.pow=function(b,x){if(x.isZero())return new o(1).toRed(this);if(x.cmpn(1)===0)return b.clone();var _=4,N=Array(1<<_);N[0]=new o(1).toRed(this),N[1]=b;for(var T=2;T<N.length;T++)N[T]=this.mul(N[T-1],b);var k=N[0],p=0,S=0,I=x.bitLength()%26;for(I===0&&(I=26),T=x.length-1;T>=0;T--){for(var M=x.words[T],U=I-1;U>=0;U--){var B=M>>U&1;if(k!==N[0]&&(k=this.sqr(k)),B===0&&p===0){S=0;continue}p<<=1,p|=B,S++,!(S!==_&&(T!==0||U!==0))&&(k=this.mul(k,N[p]),S=0,p=0)}I=26}return k},h.prototype.convertTo=function(b){var x=b.umod(this.m);return x===b?x.clone():x},h.prototype.convertFrom=function(b){var x=b.clone();return x.red=null,x},o.mont=function(b){return new y(b)};function y(b){h.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}a(y,"X"),s(y,h),y.prototype.convertTo=function(b){return this.imod(b.ushln(this.shift))},y.prototype.convertFrom=function(b){var x=this.imod(b.mul(this.rinv));return x.red=null,x},y.prototype.imul=function(b,x){if(b.isZero()||x.isZero())return b.words[0]=0,b.length=1,b;var _=b.imul(x),N=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=_.isub(N).iushrn(this.shift),k=T;return T.cmp(this.m)>=0?k=T.isub(this.m):T.cmpn(0)<0&&(k=T.iadd(this.m)),k._forceRed(this)},y.prototype.mul=function(b,x){if(b.isZero()||x.isZero())return new o(0)._forceRed(this);var _=b.mul(x),N=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=_.isub(N).iushrn(this.shift),k=T;return T.cmp(this.m)>=0?k=T.isub(this.m):T.cmpn(0)<0&&(k=T.iadd(this.m)),k._forceRed(this)},y.prototype.invm=function(b){var x=this.imod(b._invmp(this.m).mul(this.r2));return x._forceRed(this)}})(typeof t>"u"||t,e)}),tg=Qe((e,t)=>{var r=n6(),n=Jl(),i=fn().Buffer;function s(u){var c=u.modulus.byteLength(),d;do d=new r(n(c));while(d.cmp(u.modulus)>=0||!d.umod(u.prime1)||!d.umod(u.prime2));return d}a(s,"O");function o(u){var c=s(u),d=c.toRed(r.mont(u.modulus)).redPow(new r(u.publicExponent)).fromRed();return{blinder:d,unblinder:c.invm(u.modulus)}}a(o,"Y");function l(u,c){var d=o(c),f=c.modulus.byteLength(),g=new r(u).mul(d.blinder).umod(c.modulus),m=g.toRed(r.mont(c.prime1)),w=g.toRed(r.mont(c.prime2)),E=c.coefficient,A=c.prime1,C=c.prime2,O=m.redPow(c.exponent1).fromRed(),R=w.redPow(c.exponent2).fromRed(),P=O.isub(R).imul(E).umod(A).imul(C);return R.iadd(P).imul(d.unblinder).umod(c.modulus).toArrayLike(i,"be",f)}a(l,"v"),l.getr=s,t.exports=l}),i6=Qe((e,t)=>{var r=J0(),n=Jl(),i=Kl(),s=K0(),o=q0(),l=tf(),u=eg(),c=tg(),d=fn().Buffer;t.exports=function(w,E,A){var C;w.padding?C=w.padding:A?C=1:C=4;var O=r(w),R;if(C===4)R=f(O,E);else if(C===1)R=g(O,E,A);else if(C===3){if(R=new l(E),R.cmp(O.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");return A?c(R,O):u(R,O)};function f(w,E){var A=w.modulus.byteLength(),C=E.length,O=i("sha1").update(d.alloc(0)).digest(),R=O.length,P=2*R;if(C>A-P-2)throw Error("message too long");var L=d.alloc(A-C-P-2),j=A-R-1,G=n(R),Z=o(d.concat([O,L,d.alloc(1,1),E],j),s(G,j)),K=o(G,s(Z,R));return new l(d.concat([d.alloc(1),K,Z],A))}a(f,"w");function g(w,E,A){var C=E.length,O=w.modulus.byteLength();if(C>O-11)throw Error("message too long");var R;return A?R=d.alloc(O-C-3,255):R=m(O-C-3),new l(d.concat([d.from([0,A?1:2]),R,d.alloc(1),E],O))}a(g,"k");function m(w){for(var E=d.allocUnsafe(w),A=0,C=n(w*2),O=0,R;A<w;)O===C.length&&(C=n(w*2),O=0),R=C[O++],R&&(E[A++]=R);return E}a(m,"M")}),a6=Qe((e,t)=>{var r=J0(),n=K0(),i=q0(),s=tf(),o=tg(),l=Kl(),u=eg(),c=fn().Buffer;t.exports=function(m,w,E){var A;m.padding?A=m.padding:E?A=1:A=4;var C=r(m),O=C.modulus.byteLength();if(w.length>O||new s(w).cmp(C.modulus)>=0)throw Error("decryption error");var R;E?R=u(new s(w),C):R=o(w,C);var P=c.alloc(O-R.length);if(R=c.concat([P,R],O),A===4)return d(C,R);if(A===1)return f(C,R,E);if(A===3)return R;throw Error("unknown padding")};function d(m,w){var E=m.modulus.byteLength(),A=l("sha1").update(c.alloc(0)).digest(),C=A.length;if(w[0]!==0)throw Error("decryption error");var O=w.slice(1,C+1),R=w.slice(C+1),P=i(O,n(R,C)),L=i(R,n(P,E-C-1));if(g(A,L.slice(0,C)))throw Error("decryption error");for(var j=C;L[j]===0;)j++;if(L[j++]!==1)throw Error("decryption error");return L.slice(j)}a(d,"Z");function f(m,w,E){for(var A=w.slice(0,2),C=2,O=0;w[C++]!==0;)if(C>=w.length){O++;break}var R=w.slice(2,C-1);if((A.toString("hex")!=="0002"&&!E||A.toString("hex")!=="0001"&&E)&&O++,R.length<8&&O++,O)throw Error("decryption error");return w.slice(C)}a(f,"w");function g(m,w){m=c.from(m),w=c.from(w);var E=0,A=m.length;m.length!==w.length&&(E++,A=Math.min(m.length,w.length));for(var C=-1;++C<A;)E+=m[C]^w[C];return E}a(g,"k")}),rf=Qe(e=>{e.publicEncrypt=i6(),e.privateDecrypt=a6(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}}),s6=Qe(e=>{var t=(Qn(),qt(Ln));typeof t.publicEncrypt!="function"&&(t=rf()),e.publicEncrypt=t.publicEncrypt,e.privateDecrypt=t.privateDecrypt,typeof t.privateEncrypt!="function"?e.privateEncrypt=rf().privateEncrypt:e.privateEncrypt=t.privateEncrypt,typeof t.publicDecrypt!="function"?e.publicDecrypt=rf().publicDecrypt:e.publicDecrypt=t.publicDecrypt}),o6=Qe(e=>{var t=fn(),r=Jl(),n=t.Buffer,i=t.kMaxLength,s=globalThis.crypto||globalThis.msCrypto,o=Math.pow(2,32)-1;function l(g,m){if(typeof g!="number"||g!==g)throw TypeError("offset must be a number");if(g>o||g<0)throw TypeError("offset must be a uint32");if(g>i||g>m)throw RangeError("offset out of range")}a(l,"v");function u(g,m,w){if(typeof g!="number"||g!==g)throw TypeError("size must be a number");if(g>o||g<0)throw TypeError("size must be a uint32");if(g+m>w||g>i)throw RangeError("buffer too small")}a(u,"W"),s&&s.getRandomValues,e.randomFill=c,e.randomFillSync=f;function c(g,m,w,E){if(!n.isBuffer(g)&&!(g instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof m=="function")E=m,m=0,w=g.length;else if(typeof w=="function")E=w,w=g.length-m;else if(typeof E!="function")throw TypeError('"cb" argument must be a function');return l(m,g.length),u(w,m,g.length),d(g,m,w,E)}a(c,"T");function d(g,m,w,E){if(E){r(w,function(C,O){if(C)return E(C);O.copy(g,m),E(null,g)});return}var A=r(w);return A.copy(g,m),g}a(d,"Z");function f(g,m,w){if(typeof m>"u"&&(m=0),!n.isBuffer(g)&&!(g instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');return l(m,g.length),w===void 0&&(w=g.length-m),u(w,m,g.length),d(g,m,w)}a(f,"w")}),l6=Qe((e,t)=>{var r=(Qn(),qt(Ln));typeof r.randomFill=="function"&&typeof r.randomFillSync=="function"?(e.randomFill=r.randomFill,e.randomFillSync=r.randomFillSync):t.exports=o6()}),u6=Qe(e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=Jl(),e.createHash=e.Hash=Kl(),e.createHmac=e.Hmac=N0();var t=R1(),r=Object.keys(t),n=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);e.getHashes=function(){return n};var i=B0();e.pbkdf2=i.pbkdf2,e.pbkdf2Sync=i.pbkdf2Sync;var s=mE();e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var o=gE();e.DiffieHellmanGroup=o.DiffieHellmanGroup,e.createDiffieHellmanGroup=o.createDiffieHellmanGroup,e.getDiffieHellman=o.getDiffieHellman,e.createDiffieHellman=o.createDiffieHellman,e.DiffieHellman=o.DiffieHellman;var l=bE();e.createSign=l.createSign,e.Sign=l.Sign,e.createVerify=l.createVerify,e.Verify=l.Verify,e.createECDH=zE();var u=s6();e.publicEncrypt=u.publicEncrypt,e.privateEncrypt=u.privateEncrypt,e.publicDecrypt=u.publicDecrypt,e.privateDecrypt=u.privateDecrypt;var c=l6();e.randomFill=c.randomFill,e.randomFillSync=c.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
39
39
  we accept pull requests
40
40
  https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),Vt=gZ(u6(),1),oI=Vt.prng,lI=Vt.pseudoRandomBytes,uI=Vt.rng,cI=Vt.randomBytes,dI=Vt.Hash,fI=Vt.createHash,hI=Vt.Hmac,pI=Vt.createHmac,mI=Vt.getHashes,gI=Vt.pbkdf2,bI=Vt.pbkdf2Sync,vI=Vt.Cipher,yI=Vt.createCipher,wI=Vt.Cipheriv,xI=Vt.createCipheriv,_I=Vt.Decipher,EI=Vt.createDecipher,SI=Vt.Decipheriv,kI=Vt.createDecipheriv,AI=Vt.getCiphers,TI=Vt.listCiphers,NI=Vt.DiffieHellmanGroup,II=Vt.createDiffieHellmanGroup,CI=Vt.getDiffieHellman,MI=Vt.createDiffieHellman,OI=Vt.DiffieHellman,RI=Vt.createSign,PI=Vt.Sign,LI=Vt.createVerify,DI=Vt.Verify,jI=Vt.createECDH,UI=Vt.publicEncrypt,BI=Vt.privateEncrypt,zI=Vt.publicDecrypt,FI=Vt.privateDecrypt,HI=Vt.randomFill,ZI=Vt.randomFillSync,GI=Vt.createCredentials,VI=Vt.constants,WI=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"],YI=crypto,QI=crypto}),wZ=it((e,t)=>{var r=String,n=a(function(){return{isColorSupported:!1,reset:r,bold:r,dim:r,italic:r,underline:r,inverse:r,hidden:r,strikethrough:r,black:r,red:r,green:r,yellow:r,blue:r,magenta:r,cyan:r,white:r,gray:r,bgBlack:r,bgRed:r,bgGreen:r,bgYellow:r,bgBlue:r,bgMagenta:r,bgCyan:r,bgWhite:r,blackBright:r,redBright:r,greenBright:r,yellowBright:r,blueBright:r,magentaBright:r,cyanBright:r,whiteBright:r,bgBlackBright:r,bgRedBright:r,bgGreenBright:r,bgYellowBright:r,bgBlueBright:r,bgMagentaBright:r,bgCyanBright:r,bgWhiteBright:r}},"lE");t.exports=n(),t.exports.createColors=n}),xZ=it((e,t)=>{t.exports=r;function r(n={}){let{ERR_PATHS_MUST_BE_STRINGS:i=a(()=>"fast-redact - Paths must be (non-empty) strings","q"),ERR_INVALID_PATH:s=a(o=>`fast-redact – Invalid path (${o})`,"_")}=n;return function({paths:o}){o.forEach(l=>{if(typeof l!="string")throw Error(i());try{if(/〇/.test(l))throw Error();let u=(l[0]==="["?"":".")+l.replace(/^\*/,"〇").replace(/\.\*/g,".〇").replace(/\[\*\]/g,"[〇]");if(/\n|\r|;/.test(u)||/\/\*/.test(u))throw Error();Function(`
41
41
  'use strict'
@@ -211,7 +211,7 @@ graph TD;
211
211
  `}let C=g(Object.keys(d).filter(O=>O.startsWith(`${E}:`)&&O!==E&&O.split(":").length===E.split(":").length+1));for(let O of C)m(d[O],O);for(let O of w){let{source:R,target:P,data:L,conditional:j}=O,G="";if(L!==void 0){let Z=L,K=Z.split(" ");K.length>u&&(Z=Array.from({length:Math.ceil(K.length/u)},(z,V)=>K.slice(V*u,(V+1)*u).join(" ")).join("&nbsp;<br>&nbsp;")),G=j?` -. &nbsp;${Z}&nbsp; .-> `:` -- &nbsp;${Z}&nbsp; --> `}else G=j?" -.-> ":" --> ";c+=` ${yg(R)}${G}${yg(P)};
212
212
  `}E&&!A&&(c+=` end
213
213
  `)}a(m,"M"),m(d[""]??[],"");for(let w in d)!w.includes(":")&&w!==""&&m(d[w],w);return o&&(c+=SJ(s??{})),c}a(kJ,"CV");async function AJ(e,t){let r=t?.backgroundColor??"white",n=t?.imageType??"png",i=$Y(e);r!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(r)||(r=`!${r}`));let s=`https://mermaid.ink/img/${i}?bgColor=${r}&type=${n}`,o=await fetch(s);if(!o.ok)throw Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${o.status}`,`Status text: ${o.statusText}`].join(`
214
- `));return await o.blob()}a(AJ,"EV");var TJ=Symbol("Let zodToJsonSchema decide on which parser to use"),NJ={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},IJ=a(e=>({...NJ,...e}),"YW"),CJ=a(e=>{let t=IJ(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},"OW"),rR=a((e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},"o1");function ni(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?rR(t,e.currentPath):t.join("/")}}a(ni,"y6");function nR(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}a(nR,"P2");function ur(e,t,r,n,i){e[t]=r,nR(e,t,n,i)}a(ur,"S6");var bc={};vn(bc,{void:a(()=>pK,"void"),util:a(()=>tr,"util"),unknown:a(()=>fK,"unknown"),union:a(()=>vK,"union"),undefined:a(()=>uK,"undefined"),tuple:a(()=>xK,"tuple"),transformer:a(()=>w3,"transformer"),symbol:a(()=>lK,"symbol"),string:a(()=>cR,"string"),strictObject:a(()=>bK,"strictObject"),setErrorMap:a(()=>RJ,"setErrorMap"),set:a(()=>SK,"set"),record:a(()=>_K,"record"),quotelessJson:a(()=>MJ,"quotelessJson"),promise:a(()=>CK,"promise"),preprocess:a(()=>RK,"preprocess"),pipeline:a(()=>PK,"pipeline"),ostring:a(()=>LK,"ostring"),optional:a(()=>MK,"optional"),onumber:a(()=>DK,"onumber"),oboolean:a(()=>jK,"oboolean"),objectUtil:a(()=>Yv,"objectUtil"),object:a(()=>gK,"object"),number:a(()=>dR,"number"),nullable:a(()=>OK,"nullable"),null:a(()=>cK,"null"),never:a(()=>hK,"never"),nativeEnum:a(()=>IK,"nativeEnum"),nan:a(()=>aK,"nan"),map:a(()=>EK,"map"),makeIssue:a(()=>Nh,"makeIssue"),literal:a(()=>TK,"literal"),lazy:a(()=>AK,"lazy"),late:a(()=>nK,"late"),isValid:a(()=>vo,"isValid"),isDirty:a(()=>$v,"isDirty"),isAsync:a(()=>vc,"isAsync"),isAborted:a(()=>Qv,"isAborted"),intersection:a(()=>wK,"intersection"),instanceof:a(()=>iK,"instanceof"),getParsedType:a(()=>Ba,"getParsedType"),getErrorMap:a(()=>Th,"getErrorMap"),function:a(()=>kK,"function"),enum:a(()=>NK,"enum"),effect:a(()=>w3,"effect"),discriminatedUnion:a(()=>yK,"discriminatedUnion"),defaultErrorMap:a(()=>Sl,"defaultErrorMap"),datetimeRegex:a(()=>oR,"datetimeRegex"),date:a(()=>oK,"date"),custom:a(()=>uR,"custom"),coerce:a(()=>UK,"coerce"),boolean:a(()=>fR,"boolean"),bigint:a(()=>sK,"bigint"),array:a(()=>mK,"array"),any:a(()=>dK,"any"),addIssueToContext:a(()=>yt,"addIssueToContext"),ZodVoid:a(()=>Ch,"ZodVoid"),ZodUnknown:a(()=>oo,"ZodUnknown"),ZodUnion:a(()=>_c,"ZodUnion"),ZodUndefined:a(()=>wc,"ZodUndefined"),ZodType:a(()=>Yt,"ZodType"),ZodTuple:a(()=>ba,"ZodTuple"),ZodTransformer:a(()=>Hi,"ZodTransformer"),ZodSymbol:a(()=>Ih,"ZodSymbol"),ZodString:a(()=>Li,"ZodString"),ZodSet:a(()=>wo,"ZodSet"),ZodSchema:a(()=>Yt,"ZodSchema"),ZodRecord:a(()=>Sc,"ZodRecord"),ZodReadonly:a(()=>Cc,"ZodReadonly"),ZodPromise:a(()=>Al,"ZodPromise"),ZodPipeline:a(()=>hd,"ZodPipeline"),ZodParsedType:a(()=>Et,"ZodParsedType"),ZodOptional:a(()=>ua,"ZodOptional"),ZodObject:a(()=>Lr,"ZodObject"),ZodNumber:a(()=>Es,"ZodNumber"),ZodNullable:a(()=>As,"ZodNullable"),ZodNull:a(()=>xc,"ZodNull"),ZodNever:a(()=>Qa,"ZodNever"),ZodNativeEnum:a(()=>Tc,"ZodNativeEnum"),ZodNaN:a(()=>Oh,"ZodNaN"),ZodMap:a(()=>Mh,"ZodMap"),ZodLiteral:a(()=>Ac,"ZodLiteral"),ZodLazy:a(()=>kc,"ZodLazy"),ZodIssueCode:a(()=>lt,"ZodIssueCode"),ZodIntersection:a(()=>Ec,"ZodIntersection"),ZodFunction:a(()=>ul,"ZodFunction"),ZodFirstPartyTypeKind:a(()=>dt,"ZodFirstPartyTypeKind"),ZodError:a(()=>ti,"ZodError"),ZodEnum:a(()=>ks,"ZodEnum"),ZodEffects:a(()=>Hi,"ZodEffects"),ZodDiscriminatedUnion:a(()=>Gp,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Nc,"ZodDefault"),ZodDate:a(()=>yo,"ZodDate"),ZodCatch:a(()=>Ic,"ZodCatch"),ZodBranded:a(()=>kx,"ZodBranded"),ZodBoolean:a(()=>yc,"ZodBoolean"),ZodBigInt:a(()=>Ss,"ZodBigInt"),ZodArray:a(()=>Bi,"ZodArray"),ZodAny:a(()=>kl,"ZodAny"),Schema:a(()=>Yt,"Schema"),ParseStatus:a(()=>bn,"ParseStatus"),OK:a(()=>Tn,"OK"),NEVER:a(()=>BK,"NEVER"),INVALID:a(()=>Pt,"INVALID"),EMPTY_PATH:a(()=>PJ,"EMPTY_PATH"),DIRTY:a(()=>sl,"DIRTY"),BRAND:a(()=>rK,"BRAND")});var tr;(function(e){e.assertEqual=i=>{};function t(i){}a(t,"q"),e.assertIs=t;function r(i){throw Error()}a(r,"_"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),o={};for(let l of s)o[l]=i[l];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(let o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}a(n,"P"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(tr||(tr={}));var Yv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Yv||(Yv={}));var Et=tr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ba=a(e=>{switch(typeof e){case"undefined":return Et.undefined;case"string":return Et.string;case"number":return Number.isNaN(e)?Et.nan:Et.number;case"boolean":return Et.boolean;case"function":return Et.function;case"bigint":return Et.bigint;case"symbol":return Et.symbol;case"object":return Array.isArray(e)?Et.array:e===null?Et.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Et.promise:typeof Map<"u"&&e instanceof Map?Et.map:typeof Set<"u"&&e instanceof Set?Et.set:typeof Date<"u"&&e instanceof Date?Et.date:Et.object;default:return Et.unknown}},"__"),lt=tr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MJ=a(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"Cx");class ti extends Error{static{a(this,"q8")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=a(s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,u=0;for(;u<o.path.length;){let c=o.path[u];u!==o.path.length-1?l[c]=l[c]||{_errors:[]}:(l[c]=l[c]||{_errors:[]},l[c]._errors.push(r(o))),l=l[c],u++}}},"P");return i(this),n}static assert(t){if(!(t instanceof ti))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let s=i.path[0];r[s]=r[s]||[],r[s].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ti.create=e=>new ti(e);var OJ=a((e,t)=>{let r;switch(e.code){case lt.invalid_type:e.received===Et.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case lt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,tr.jsonStringifyReplacer)}`;break;case lt.unrecognized_keys:r=`Unrecognized key(s) in object: ${tr.joinValues(e.keys,", ")}`;break;case lt.invalid_union:r="Invalid input";break;case lt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${tr.joinValues(e.options)}`;break;case lt.invalid_enum_value:r=`Invalid enum value. Expected ${tr.joinValues(e.options)}, received '${e.received}'`;break;case lt.invalid_arguments:r="Invalid function arguments";break;case lt.invalid_return_type:r="Invalid function return type";break;case lt.invalid_date:r="Invalid date";break;case lt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:tr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case lt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case lt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case lt.custom:r="Invalid input";break;case lt.invalid_intersection_types:r="Intersection results could not be merged";break;case lt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case lt.not_finite:r="Number must be finite";break;default:r=t.defaultError,tr.assertNever(e)}return{message:r}},"Ex"),Sl=OJ,iR=Sl;function RJ(e){iR=e}a(RJ,"Rx");function Th(){return iR}a(Th,"d4");var Nh=a(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let l="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)l=c(o,{data:t,defaultError:l}).message;return{...i,path:s,message:l}},"n1"),PJ=[];function yt(e,t){let r=Th(),n=Nh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Sl?void 0:Sl].filter(i=>!!i)});e.common.issues.push(n)}a(yt,"F$");class bn{static{a(this,"Sq")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Pt;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,o=await i.value;n.push({key:s,value:o})}return bn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}var Pt=Object.freeze({status:"aborted"}),sl=a(e=>({status:"dirty",value:e}),"xK"),Tn=a(e=>({status:"valid",value:e}),"bq"),Qv=a(e=>e.status==="aborted","Y2"),$v=a(e=>e.status==="dirty","O2"),vo=a(e=>e.status==="valid","OK"),vc=a(e=>typeof Promise<"u"&&e instanceof Promise,"l4"),Nt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Nt||(Nt={}));class ga{static{a(this,"m8")}constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}var v3=a((e,t)=>{if(vo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ti(e.common.issues);return this._error=r,this._error}}},"IV");function Ht(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:a((s,o)=>{let{message:l}=e;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},"errorMap"),description:i}}a(Ht,"J6");class Yt{static{a(this,"f6")}get description(){return this._def.description}_getType(t){return Ba(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ba(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new bn,ctx:{common:t.parent.common,data:t.data,parsedType:Ba(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(vc(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},i=this._parseSync({data:t,path:n.path,parent:n});return v3(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return vo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>vo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(vc(i)?i:Promise.resolve(i));return v3(n,s)}refine(t,r){let n=a(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"_");return this._refinement((i,s)=>{let o=t(i),l=a(()=>s.addIssue({code:lt.custom,...n(i)}),"Y");return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Hi({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return ua.create(this,this._def)}nullable(){return As.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bi.create(this)}promise(){return Al.create(this,this._def)}or(t){return _c.create([this,t],this._def)}and(t){return Ec.create(this,t,this._def)}transform(t){return new Hi({...Ht(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Nc({...Ht(this._def),innerType:this,defaultValue:r,typeName:dt.ZodDefault})}brand(){return new kx({typeName:dt.ZodBranded,type:this,...Ht(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ic({...Ht(this._def),innerType:this,catchValue:r,typeName:dt.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return hd.create(this,t)}readonly(){return Cc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var LJ=/^c[^\s-]{8,}$/i,DJ=/^[0-9a-z]+$/,jJ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BJ=/^[a-z0-9_-]{21}$/i,zJ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wg,GJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,WJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,YJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,QJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$J=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",XJ=new RegExp(`^${aR}$`);function sR(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}a(sR,"LV");function JJ(e){return new RegExp(`^${sR(e)}$`)}a(JJ,"ix");function oR(e){let t=`${aR}T${sR(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}a(oR,"gV");function KJ(e,t){return!!((t==="v4"||!t)&&GJ.test(e)||(t==="v6"||!t)&&WJ.test(e))}a(KJ,"Bx");function qJ(e,t){if(!zJ.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}a(qJ,"Ux");function eK(e,t){return!!((t==="v4"||!t)&&VJ.test(e)||(t==="v6"||!t)&&YJ.test(e))}a(eK,"tx");class Li extends Yt{static{a(this,"x8")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Et.string){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:Et.string,received:i.parsedType}),Pt}let r=new bn,n;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,o=t.data.length<i.value;(s||o)&&(n=this._getOrReturnCtx(t,n),s?yt(n,{code:lt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&yt(n,{code:lt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")HJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"email",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")wg||(wg=new RegExp(ZJ,"u")),wg.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"emoji",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")UJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"uuid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")BJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"nanoid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")LJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cuid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")DJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cuid2",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")jJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"ulid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),yt(n,{validation:"url",code:lt.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,!i.regex.test(t.data)&&(n=this._getOrReturnCtx(t,n),yt(n,{validation:"regex",code:lt.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?oR(i).test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?XJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?JJ(i).test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?FJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"duration",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?KJ(t.data,i.version)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"ip",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?qJ(t.data,i.alg)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"jwt",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?eK(t.data,i.version)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cidr",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?QJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"base64",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?$J.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"base64url",code:lt.invalid_string,message:i.message}),r.dirty()):tr.assertNever(i);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:lt.invalid_string,...Nt.errToObj(n)})}_addCheck(t){return new Li({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Nt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Nt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Nt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Nt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Nt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Nt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Nt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Nt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Nt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Nt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Nt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Nt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Nt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Nt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Nt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Nt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Nt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Nt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Nt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Nt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Nt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Nt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Nt.errToObj(r)})}nonempty(t){return this.min(1,Nt.errToObj(t))}trim(){return new Li({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Li({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Li({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Li.create=e=>new Li({checks:[],typeName:dt.ZodString,coerce:e?.coerce??!1,...Ht(e)});function tK(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}a(tK,"Fx");class Es extends Yt{static{a(this,"vK")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Et.number){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:Et.number,received:i.parsedType}),Pt}let r,n=new bn;for(let i of this._def.checks)i.kind==="int"?tr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?tK(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_finite,message:i.message}),n.dirty()):tr.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Nt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Nt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Nt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Nt.toString(r))}setLimit(t,r,n,i){return new Es({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Nt.toString(i)}]})}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Nt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Nt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&tr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Es.create=e=>new Es({checks:[],typeName:dt.ZodNumber,coerce:e?.coerce||!1,...Ht(e)});class Ss extends Yt{static{a(this,"zK")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Et.bigint)return this._getInvalidInput(t);let r,n=new bn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):tr.assertNever(i);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.bigint,received:r.parsedType}),Pt}gte(t,r){return this.setLimit("min",t,!0,Nt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Nt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Nt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Nt.toString(r))}setLimit(t,r,n,i){return new Ss({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Nt.toString(i)}]})}_addCheck(t){return new Ss({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ss.create=e=>new Ss({checks:[],typeName:dt.ZodBigInt,coerce:e?.coerce??!1,...Ht(e)});class yc extends Yt{static{a(this,"n4")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Et.boolean){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.boolean,received:r.parsedType}),Pt}return Tn(t.data)}}yc.create=e=>new yc({typeName:dt.ZodBoolean,coerce:e?.coerce||!1,...Ht(e)});class yo extends Yt{static{a(this,"pK")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Et.date){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:Et.date,received:i.parsedType}),Pt}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_date}),Pt}let r=new bn,n;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):tr.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new yo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Nt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Nt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}yo.create=e=>new yo({checks:[],coerce:e?.coerce||!1,typeName:dt.ZodDate,...Ht(e)});class Ih extends Yt{static{a(this,"i1")}_parse(t){if(this._getType(t)!==Et.symbol){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.symbol,received:r.parsedType}),Pt}return Tn(t.data)}}Ih.create=e=>new Ih({typeName:dt.ZodSymbol,...Ht(e)});class wc extends Yt{static{a(this,"i4")}_parse(t){if(this._getType(t)!==Et.undefined){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.undefined,received:r.parsedType}),Pt}return Tn(t.data)}}wc.create=e=>new wc({typeName:dt.ZodUndefined,...Ht(e)});class xc extends Yt{static{a(this,"B4")}_parse(t){if(this._getType(t)!==Et.null){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.null,received:r.parsedType}),Pt}return Tn(t.data)}}xc.create=e=>new xc({typeName:dt.ZodNull,...Ht(e)});class kl extends Yt{static{a(this,"cK")}constructor(){super(...arguments),this._any=!0}_parse(t){return Tn(t.data)}}kl.create=e=>new kl({typeName:dt.ZodAny,...Ht(e)});class oo extends Yt{static{a(this,"jK")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tn(t.data)}}oo.create=e=>new oo({typeName:dt.ZodUnknown,...Ht(e)});class Qa extends Yt{static{a(this,"K_")}_parse(t){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.never,received:r.parsedType}),Pt}}Qa.create=e=>new Qa({typeName:dt.ZodNever,...Ht(e)});class Ch extends Yt{static{a(this,"B1")}_parse(t){if(this._getType(t)!==Et.undefined){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.void,received:r.parsedType}),Pt}return Tn(t.data)}}Ch.create=e=>new Ch({typeName:dt.ZodVoid,...Ht(e)});class Bi extends Yt{static{a(this,"p8")}_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==Et.array)return yt(r,{code:lt.invalid_type,expected:Et.array,received:r.parsedType}),Pt;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,l=r.data.length<i.exactLength.value;(o||l)&&(yt(r,{code:o?lt.too_big:lt.too_small,minimum:l?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(yt(r,{code:lt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(yt(r,{code:lt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>i.type._parseAsync(new ga(r,o,r.path,l)))).then(o=>bn.mergeArray(n,o));let s=[...r.data].map((o,l)=>i.type._parseSync(new ga(r,o,r.path,l)));return bn.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Bi({...this._def,minLength:{value:t,message:Nt.toString(r)}})}max(t,r){return new Bi({...this._def,maxLength:{value:t,message:Nt.toString(r)}})}length(t,r){return new Bi({...this._def,exactLength:{value:t,message:Nt.toString(r)}})}nonempty(t){return this.min(1,t)}}Bi.create=(e,t)=>new Bi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Ht(t)});function tl(e){if(e instanceof Lr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ua.create(tl(n))}return new Lr({...e._def,shape:a(()=>t,"shape")})}else return e instanceof Bi?new Bi({...e._def,type:tl(e.element)}):e instanceof ua?ua.create(tl(e.unwrap())):e instanceof As?As.create(tl(e.unwrap())):e instanceof ba?ba.create(e.items.map(t=>tl(t))):e}a(tl,"r4");class Lr extends Yt{static{a(this,"c6")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=tr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Et.object){let u=this._getOrReturnCtx(t);return yt(u,{code:lt.invalid_type,expected:Et.object,received:u.parsedType}),Pt}let{status:r,ctx:n}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Qa&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||o.push(u);let l=[];for(let u of s){let c=i[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ga(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Qa){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")o.length>0&&(yt(n,{code:lt.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of o){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ga(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>bn.mergeObjectSync(r,u)):bn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Nt.errToObj,new Lr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:a((r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Nt.errToObj(t).message??i}:{message:i}},"errorMap")}:{}})}strip(){return new Lr({...this._def,unknownKeys:"strip"})}passthrough(){return new Lr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lr({...this._def,shape:a(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new Lr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:a(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lr({...this._def,catchall:t})}pick(t){let r={};for(let n of tr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Lr({...this._def,shape:a(()=>r,"shape")})}omit(t){let r={};for(let n of tr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Lr({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return tl(this)}partial(t){let r={};for(let n of tr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new Lr({...this._def,shape:a(()=>r,"shape")})}required(t){let r={};for(let n of tr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ua;)i=i._def.innerType;r[n]=i}return new Lr({...this._def,shape:a(()=>r,"shape")})}keyof(){return lR(tr.objectKeys(this.shape))}}Lr.create=(e,t)=>new Lr({shape:a(()=>e,"shape"),unknownKeys:"strip",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});Lr.strictCreate=(e,t)=>new Lr({shape:a(()=>e,"shape"),unknownKeys:"strict",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});Lr.lazycreate=(e,t)=>new Lr({shape:e,unknownKeys:"strip",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});class _c extends Yt{static{a(this,"U4")}_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let o=s.map(l=>new ti(l.ctx.common.issues));return yt(r,{code:lt.invalid_union,unionErrors:o}),Pt}if(a(i,"P"),r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=o.map(u=>new ti(u));return yt(r,{code:lt.invalid_union,unionErrors:l}),Pt}}get options(){return this._def.options}}_c.create=(e,t)=>new _c({options:e,typeName:dt.ZodUnion,...Ht(t)});var Pa=a(e=>e instanceof kc?Pa(e.schema):e instanceof Hi?Pa(e.innerType()):e instanceof Ac?[e.value]:e instanceof ks?e.options:e instanceof Tc?tr.objectValues(e.enum):e instanceof Nc?Pa(e._def.innerType):e instanceof wc?[void 0]:e instanceof xc?[null]:e instanceof ua?[void 0,...Pa(e.unwrap())]:e instanceof As?[null,...Pa(e.unwrap())]:e instanceof kx||e instanceof Cc?Pa(e.unwrap()):e instanceof Ic?Pa(e._def.innerType):[],"N_");class Gp extends Yt{static{a(this,"j2")}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Et.object)return yt(r,{code:lt.invalid_type,expected:Et.object,received:r.parsedType}),Pt;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(yt(r,{code:lt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Pt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let o=Pa(s.shape[t]);if(!o.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of o){if(i.has(l))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);i.set(l,s)}}return new Gp({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Ht(n)})}}function Xv(e,t){let r=Ba(e),n=Ba(t);if(e===t)return{valid:!0,data:e};if(r===Et.object&&n===Et.object){let i=tr.objectKeys(t),s=tr.objectKeys(e).filter(l=>i.indexOf(l)!==-1),o={...e,...t};for(let l of s){let u=Xv(e[l],t[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(r===Et.array&&n===Et.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let o=e[s],l=t[s],u=Xv(o,l);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===Et.date&&n===Et.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}a(Xv,"zW");class Ec extends Yt{static{a(this,"t4")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=a((s,o)=>{if(Qv(s)||Qv(o))return Pt;let l=Xv(s.value,o.value);return l.valid?(($v(s)||$v(o))&&r.dirty(),{status:r.value,value:l.data}):(yt(n,{code:lt.invalid_intersection_types}),Pt)},"P");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ec.create=(e,t,r)=>new Ec({left:e,right:t,typeName:dt.ZodIntersection,...Ht(r)});class ba extends Yt{static{a(this,"P_")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Et.array)return yt(n,{code:lt.invalid_type,expected:Et.array,received:n.parsedType}),Pt;if(n.data.length<this._def.items.length)return yt(n,{code:lt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pt;!this._def.rest&&n.data.length>this._def.items.length&&(yt(n,{code:lt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new ga(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>bn.mergeArray(r,s)):bn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new ba({...this._def,rest:t})}}ba.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ba({items:e,typeName:dt.ZodTuple,rest:null,...Ht(t)})};class Sc extends Yt{static{a(this,"U1")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Et.object)return yt(n,{code:lt.invalid_type,expected:Et.object,received:n.parsedType}),Pt;let i=[],s=this._def.keyType,o=this._def.valueType;for(let l in n.data)i.push({key:s._parse(new ga(n,l,n.path,l)),value:o._parse(new ga(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?bn.mergeObjectAsync(r,i):bn.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Yt?new Sc({keyType:t,valueType:r,typeName:dt.ZodRecord,...Ht(n)}):new Sc({keyType:Li.create(),valueType:t,typeName:dt.ZodRecord,...Ht(r)})}}class Mh extends Yt{static{a(this,"t1")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Et.map)return yt(n,{code:lt.invalid_type,expected:Et.map,received:n.parsedType}),Pt;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([l,u],c)=>({key:i._parse(new ga(n,l,n.path,[c,"key"])),value:s._parse(new ga(n,u,n.path,[c,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return Pt;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(c.value,d.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of o){let{key:c,value:d}=u;if(c.status==="aborted"||d.status==="aborted")return Pt;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(c.value,d.value)}return{status:r.value,value:l}}}}Mh.create=(e,t,r)=>new Mh({valueType:t,keyType:e,typeName:dt.ZodMap,...Ht(r)});class wo extends Yt{static{a(this,"mK")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Et.set)return yt(n,{code:lt.invalid_type,expected:Et.set,received:n.parsedType}),Pt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(yt(n,{code:lt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(yt(n,{code:lt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let d of u){if(d.status==="aborted")return Pt;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}a(o,"O");let l=[...n.data.values()].map((u,c)=>s._parse(new ga(n,u,n.path,c)));return n.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(t,r){return new wo({...this._def,minSize:{value:t,message:Nt.toString(r)}})}max(t,r){return new wo({...this._def,maxSize:{value:t,message:Nt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}wo.create=(e,t)=>new wo({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...Ht(t)});class ul extends Yt{static{a(this,"o4")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Et.function)return yt(r,{code:lt.invalid_type,expected:Et.function,received:r.parsedType}),Pt;function n(l,u){return Nh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Th(),Sl].filter(c=>!!c),issueData:{code:lt.invalid_arguments,argumentsError:u}})}a(n,"_");function i(l,u){return Nh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Th(),Sl].filter(c=>!!c),issueData:{code:lt.invalid_return_type,returnTypeError:u}})}a(i,"P");let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Al){let l=this;return Tn(async function(...u){let c=new ti([]),d=await l._def.args.parseAsync(u,s).catch(g=>{throw c.addIssue(n(u,g)),c}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,s).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{let l=this;return Tn(function(...u){let c=l._def.args.safeParse(u,s);if(!c.success)throw new ti([n(u,c.error)]);let d=Reflect.apply(o,this,c.data),f=l._def.returns.safeParse(d,s);if(!f.success)throw new ti([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ul({...this._def,args:ba.create(t).rest(oo.create())})}returns(t){return new ul({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ul({args:t||ba.create([]).rest(oo.create()),returns:r||oo.create(),typeName:dt.ZodFunction,...Ht(n)})}}class kc extends Yt{static{a(this,"F4")}get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}kc.create=(e,t)=>new kc({getter:e,typeName:dt.ZodLazy,...Ht(t)});class Ac extends Yt{static{a(this,"Q4")}_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return yt(r,{received:r.data,code:lt.invalid_literal,expected:this._def.value}),Pt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ac.create=(e,t)=>new Ac({value:e,typeName:dt.ZodLiteral,...Ht(t)});function lR(e,t){return new ks({values:e,typeName:dt.ZodEnum,...Ht(t)})}a(lR,"bV");class ks extends Yt{static{a(this,"JK")}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return yt(r,{expected:tr.joinValues(n),received:r.parsedType,code:lt.invalid_type}),Pt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return yt(r,{received:r.data,code:lt.invalid_enum_value,options:n}),Pt}return Tn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ks.create(t,{...this._def,...r})}exclude(t,r=this._def){return ks.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ks.create=lR;class Tc extends Yt{static{a(this,"a4")}_parse(t){let r=tr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Et.string&&n.parsedType!==Et.number){let i=tr.objectValues(r);return yt(n,{expected:tr.joinValues(i),received:n.parsedType,code:lt.invalid_type}),Pt}if(this._cache||(this._cache=new Set(tr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=tr.objectValues(r);return yt(n,{received:n.data,code:lt.invalid_enum_value,options:i}),Pt}return Tn(t.data)}get enum(){return this._def.values}}Tc.create=(e,t)=>new Tc({values:e,typeName:dt.ZodNativeEnum,...Ht(t)});class Al extends Yt{static{a(this,"dK")}unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==Et.promise&&r.common.async===!1)return yt(r,{code:lt.invalid_type,expected:Et.promise,received:r.parsedType}),Pt;let n=r.parsedType===Et.promise?r.data:Promise.resolve(r.data);return Tn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Al.create=(e,t)=>new Al({type:e,typeName:dt.ZodPromise,...Ht(t)});class Hi extends Yt{static{a(this,"d8")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:a(o=>{yt(n,o),o.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return Pt;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?Pt:u.status==="dirty"||r.value==="dirty"?sl(u.value):u});{if(r.value==="aborted")return Pt;let l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?Pt:l.status==="dirty"||r.value==="dirty"?sl(l.value):l}}if(i.type==="refinement"){let o=a(l=>{let u=i.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"O");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Pt:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Pt:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vo(o))return Pt;let l=i.transform(o.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>vo(o)?Promise.resolve(i.transform(o.value,s)).then(l=>({status:r.value,value:l})):Pt);tr.assertNever(i)}}Hi.create=(e,t,r)=>new Hi({schema:e,typeName:dt.ZodEffects,effect:t,...Ht(r)});Hi.createWithPreprocess=(e,t,r)=>new Hi({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...Ht(r)});class ua extends Yt{static{a(this,"c8")}_parse(t){return this._getType(t)===Et.undefined?Tn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ua.create=(e,t)=>new ua({innerType:e,typeName:dt.ZodOptional,...Ht(t)});class As extends Yt{static{a(this,"C_")}_parse(t){return this._getType(t)===Et.null?Tn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}As.create=(e,t)=>new As({innerType:e,typeName:dt.ZodNullable,...Ht(t)});class Nc extends Yt{static{a(this,"e4")}_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===Et.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Nc.create=(e,t)=>new Nc({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ht(t)});class Ic extends Yt{static{a(this,"s4")}_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return vc(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ic.create=(e,t)=>new Ic({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ht(t)});class Oh extends Yt{static{a(this,"F1")}_parse(t){if(this._getType(t)!==Et.nan){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:Et.nan,received:r.parsedType}),Pt}return{status:"valid",value:t.data}}}Oh.create=e=>new Oh({typeName:dt.ZodNaN,...Ht(e)});var rK=Symbol("zod_brand");class kx extends Yt{static{a(this,"v2")}_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class hd extends Yt{static{a(this,"Q1")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Pt:i.status==="dirty"?(r.dirty(),sl(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Pt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new hd({in:t,out:r,typeName:dt.ZodPipeline})}}class Cc extends Yt{static{a(this,"$P")}_parse(t){let r=this._def.innerType._parse(t),n=a(i=>(vo(i)&&(i.value=Object.freeze(i.value)),i),"_");return vc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Cc.create=(e,t)=>new Cc({innerType:e,typeName:dt.ZodReadonly,...Ht(t)});function y3(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}a(y3,"hV");function uR(e,t={},r){return e?kl.create().superRefine((n,i)=>{let s=e(n);if(s instanceof Promise)return s.then(o=>{if(!o){let l=y3(t,n),u=l.fatal??r??!0;i.addIssue({code:"custom",...l,fatal:u})}});if(!s){let o=y3(t,n),l=o.fatal??r??!0;i.addIssue({code:"custom",...o,fatal:l})}}):kl.create()}a(uR,"yV");var nK={object:Lr.lazycreate},dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(dt||(dt={}));var iK=a((e,t={message:`Input not instance of ${e.name}`})=>uR(r=>r instanceof e,t),"ex"),cR=Li.create,dR=Es.create,aK=Oh.create,sK=Ss.create,fR=yc.create,oK=yo.create,lK=Ih.create,uK=wc.create,cK=xc.create,dK=kl.create,fK=oo.create,hK=Qa.create,pK=Ch.create,mK=Bi.create,gK=Lr.create,bK=Lr.strictCreate,vK=_c.create,yK=Gp.create,wK=Ec.create,xK=ba.create,_K=Sc.create,EK=Mh.create,SK=wo.create,kK=ul.create,AK=kc.create,TK=Ac.create,NK=ks.create,IK=Tc.create,CK=Al.create,w3=Hi.create,MK=ua.create,OK=As.create,RK=Hi.createWithPreprocess,PK=hd.create,LK=a(()=>cR().optional(),"Dp"),DK=a(()=>dR().optional(),"Lp"),jK=a(()=>fR().optional(),"gp"),UK={string:a(e=>Li.create({...e,coerce:!0}),"string"),number:a(e=>Es.create({...e,coerce:!0}),"number"),boolean:a(e=>yc.create({...e,coerce:!0}),"boolean"),bigint:a(e=>Ss.create({...e,coerce:!0}),"bigint"),date:a(e=>yo.create({...e,coerce:!0}),"date")},BK=Pt;function zK(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==dt.ZodAny&&(r.items=sr(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&ur(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&ur(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(ur(r,"minItems",e.exactLength.value,e.exactLength.message,t),ur(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}a(zK,"JW");function FK(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ur(r,"minimum",n.value,n.message,t):ur(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ur(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ur(r,"maximum",n.value,n.message,t):ur(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ur(r,"maximum",n.value,n.message,t));break;case"multipleOf":ur(r,"multipleOf",n.value,n.message,t);break}return r}a(FK,"WW");function HK(){return{type:"boolean"}}a(HK,"HW");function hR(e,t){return sr(e.type._def,t)}a(hR,"a1");var ZK=a((e,t)=>sr(e.innerType._def,t),"TW");function pR(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(i=>pR(e,t,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return GK(e,t)}}a(pR,"z2");var GK=a((e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":ur(r,"minimum",n.value,n.message,t);break;case"max":ur(r,"maximum",n.value,n.message,t);break}return r},"up");function VK(e,t){return{...sr(e.innerType._def,t),default:e.defaultValue()}}a(VK,"wW");function WK(e,t){return t.effectStrategy==="input"?sr(e.schema._def,t):ni(t)}a(WK,"ZW");function YK(e){return{type:"string",enum:Array.from(e.values)}}a(YK,"fW");var QK=a(e=>"type"in e&&e.type==="string"?!1:"allOf"in e,"xp");function $K(e,t){let r=[sr(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),sr(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(s=>{if(QK(s))i.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;o=u}else n=void 0;i.push(o)}}),i.length?{allOf:i,...n}:void 0}a($K,"XW");function XK(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}a(XK,"AW");var xg=void 0,Ei={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(xg===void 0&&(xg=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),xg),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function mR(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":ur(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":ur(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Si(r,"email",n.message,t);break;case"format:idn-email":Si(r,"idn-email",n.message,t);break;case"pattern:zod":_n(r,Ei.email,n.message,t);break}break;case"url":Si(r,"uri",n.message,t);break;case"uuid":Si(r,"uuid",n.message,t);break;case"regex":_n(r,n.regex,n.message,t);break;case"cuid":_n(r,Ei.cuid,n.message,t);break;case"cuid2":_n(r,Ei.cuid2,n.message,t);break;case"startsWith":_n(r,RegExp(`^${_g(n.value,t)}`),n.message,t);break;case"endsWith":_n(r,RegExp(`${_g(n.value,t)}$`),n.message,t);break;case"datetime":Si(r,"date-time",n.message,t);break;case"date":Si(r,"date",n.message,t);break;case"time":Si(r,"time",n.message,t);break;case"duration":Si(r,"duration",n.message,t);break;case"length":ur(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),ur(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":_n(r,RegExp(_g(n.value,t)),n.message,t);break;case"ip":n.version!=="v6"&&Si(r,"ipv4",n.message,t),n.version!=="v4"&&Si(r,"ipv6",n.message,t);break;case"base64url":_n(r,Ei.base64url,n.message,t);break;case"jwt":_n(r,Ei.jwt,n.message,t);break;case"cidr":n.version!=="v6"&&_n(r,Ei.ipv4Cidr,n.message,t),n.version!=="v4"&&_n(r,Ei.ipv6Cidr,n.message,t);break;case"emoji":_n(r,Ei.emoji(),n.message,t);break;case"ulid":_n(r,Ei.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Si(r,"binary",n.message,t);break;case"contentEncoding:base64":ur(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":_n(r,Ei.base64,n.message,t);break}break;case"nanoid":_n(r,Ei.nanoid,n.message,t);break}return r}a(mR,"e1");function _g(e,t){return t.patternStrategy==="escape"?KK(e):e}a(_g,"GW");var JK=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function KK(e){let t="";for(let r=0;r<e.length;r++)JK.has(e[r])||(t+="\\"),t+=e[r];return t}a(KK,"cp");function Si(e,t,r,n){e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):ur(e,"format",t,r,n)}a(Si,"l8");function _n(e,t,r,n){e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:x3(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ur(e,"pattern",x3(t,n),r,n)}a(_n,"rq");function x3(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,i="",s=!1,o=!1,l=!1;for(let u=0;u<n.length;u++){if(s){i+=n[u],s=!1;continue}if(r.i){if(o){if(n[u].match(/[a-z]/)){l?(i+=n[u],i+=`${n[u-2]}-${n[u]}`.toUpperCase(),l=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(i+=n[u],l=!0):i+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){i+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(r.m){if(n[u]==="^"){i+=`(^|(?<=[\r
214
+ `));return await o.blob()}a(AJ,"EV");var TJ=Symbol("Let zodToJsonSchema decide on which parser to use"),NJ={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},IJ=a(e=>({...NJ,...e}),"YW"),CJ=a(e=>{let t=IJ(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},"OW"),rR=a((e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},"o1");function ni(e){if(e.target!=="openAi")return{};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=!0,{$ref:e.$refStrategy==="relative"?rR(t,e.currentPath):t.join("/")}}a(ni,"y6");function nR(e,t,r,n){n?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}a(nR,"P2");function ur(e,t,r,n,i){e[t]=r,nR(e,t,n,i)}a(ur,"S6");var bc={};vn(bc,{void:a(()=>pK,"void"),util:a(()=>tr,"util"),unknown:a(()=>fK,"unknown"),union:a(()=>vK,"union"),undefined:a(()=>uK,"undefined"),tuple:a(()=>xK,"tuple"),transformer:a(()=>w3,"transformer"),symbol:a(()=>lK,"symbol"),string:a(()=>cR,"string"),strictObject:a(()=>bK,"strictObject"),setErrorMap:a(()=>RJ,"setErrorMap"),set:a(()=>SK,"set"),record:a(()=>_K,"record"),quotelessJson:a(()=>MJ,"quotelessJson"),promise:a(()=>CK,"promise"),preprocess:a(()=>RK,"preprocess"),pipeline:a(()=>PK,"pipeline"),ostring:a(()=>LK,"ostring"),optional:a(()=>MK,"optional"),onumber:a(()=>DK,"onumber"),oboolean:a(()=>jK,"oboolean"),objectUtil:a(()=>Yv,"objectUtil"),object:a(()=>gK,"object"),number:a(()=>dR,"number"),nullable:a(()=>OK,"nullable"),null:a(()=>cK,"null"),never:a(()=>hK,"never"),nativeEnum:a(()=>IK,"nativeEnum"),nan:a(()=>aK,"nan"),map:a(()=>EK,"map"),makeIssue:a(()=>Nh,"makeIssue"),literal:a(()=>TK,"literal"),lazy:a(()=>AK,"lazy"),late:a(()=>nK,"late"),isValid:a(()=>vo,"isValid"),isDirty:a(()=>$v,"isDirty"),isAsync:a(()=>vc,"isAsync"),isAborted:a(()=>Qv,"isAborted"),intersection:a(()=>wK,"intersection"),instanceof:a(()=>iK,"instanceof"),getParsedType:a(()=>Ba,"getParsedType"),getErrorMap:a(()=>Th,"getErrorMap"),function:a(()=>kK,"function"),enum:a(()=>NK,"enum"),effect:a(()=>w3,"effect"),discriminatedUnion:a(()=>yK,"discriminatedUnion"),defaultErrorMap:a(()=>Sl,"defaultErrorMap"),datetimeRegex:a(()=>oR,"datetimeRegex"),date:a(()=>oK,"date"),custom:a(()=>uR,"custom"),coerce:a(()=>UK,"coerce"),boolean:a(()=>fR,"boolean"),bigint:a(()=>sK,"bigint"),array:a(()=>mK,"array"),any:a(()=>dK,"any"),addIssueToContext:a(()=>yt,"addIssueToContext"),ZodVoid:a(()=>Ch,"ZodVoid"),ZodUnknown:a(()=>oo,"ZodUnknown"),ZodUnion:a(()=>_c,"ZodUnion"),ZodUndefined:a(()=>wc,"ZodUndefined"),ZodType:a(()=>Yt,"ZodType"),ZodTuple:a(()=>ba,"ZodTuple"),ZodTransformer:a(()=>Hi,"ZodTransformer"),ZodSymbol:a(()=>Ih,"ZodSymbol"),ZodString:a(()=>Li,"ZodString"),ZodSet:a(()=>wo,"ZodSet"),ZodSchema:a(()=>Yt,"ZodSchema"),ZodRecord:a(()=>Sc,"ZodRecord"),ZodReadonly:a(()=>Cc,"ZodReadonly"),ZodPromise:a(()=>Al,"ZodPromise"),ZodPipeline:a(()=>hd,"ZodPipeline"),ZodParsedType:a(()=>_t,"ZodParsedType"),ZodOptional:a(()=>ua,"ZodOptional"),ZodObject:a(()=>Lr,"ZodObject"),ZodNumber:a(()=>Es,"ZodNumber"),ZodNullable:a(()=>As,"ZodNullable"),ZodNull:a(()=>xc,"ZodNull"),ZodNever:a(()=>Qa,"ZodNever"),ZodNativeEnum:a(()=>Tc,"ZodNativeEnum"),ZodNaN:a(()=>Oh,"ZodNaN"),ZodMap:a(()=>Mh,"ZodMap"),ZodLiteral:a(()=>Ac,"ZodLiteral"),ZodLazy:a(()=>kc,"ZodLazy"),ZodIssueCode:a(()=>lt,"ZodIssueCode"),ZodIntersection:a(()=>Ec,"ZodIntersection"),ZodFunction:a(()=>ul,"ZodFunction"),ZodFirstPartyTypeKind:a(()=>dt,"ZodFirstPartyTypeKind"),ZodError:a(()=>ti,"ZodError"),ZodEnum:a(()=>ks,"ZodEnum"),ZodEffects:a(()=>Hi,"ZodEffects"),ZodDiscriminatedUnion:a(()=>Gp,"ZodDiscriminatedUnion"),ZodDefault:a(()=>Nc,"ZodDefault"),ZodDate:a(()=>yo,"ZodDate"),ZodCatch:a(()=>Ic,"ZodCatch"),ZodBranded:a(()=>kx,"ZodBranded"),ZodBoolean:a(()=>yc,"ZodBoolean"),ZodBigInt:a(()=>Ss,"ZodBigInt"),ZodArray:a(()=>Bi,"ZodArray"),ZodAny:a(()=>kl,"ZodAny"),Schema:a(()=>Yt,"Schema"),ParseStatus:a(()=>bn,"ParseStatus"),OK:a(()=>Tn,"OK"),NEVER:a(()=>BK,"NEVER"),INVALID:a(()=>Pt,"INVALID"),EMPTY_PATH:a(()=>PJ,"EMPTY_PATH"),DIRTY:a(()=>sl,"DIRTY"),BRAND:a(()=>rK,"BRAND")});var tr;(function(e){e.assertEqual=i=>{};function t(i){}a(t,"q"),e.assertIs=t;function r(i){throw Error()}a(r,"_"),e.assertNever=r,e.arrayToEnum=i=>{let s={};for(let o of i)s[o]=o;return s},e.getValidEnumValues=i=>{let s=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),o={};for(let l of s)o[l]=i[l];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let s=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(let o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}a(n,"P"),e.joinValues=n,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(tr||(tr={}));var Yv;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(Yv||(Yv={}));var _t=tr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ba=a(e=>{switch(typeof e){case"undefined":return _t.undefined;case"string":return _t.string;case"number":return Number.isNaN(e)?_t.nan:_t.number;case"boolean":return _t.boolean;case"function":return _t.function;case"bigint":return _t.bigint;case"symbol":return _t.symbol;case"object":return Array.isArray(e)?_t.array:e===null?_t.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?_t.promise:typeof Map<"u"&&e instanceof Map?_t.map:typeof Set<"u"&&e instanceof Set?_t.set:typeof Date<"u"&&e instanceof Date?_t.date:_t.object;default:return _t.unknown}},"__"),lt=tr.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),MJ=a(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"Cx");class ti extends Error{static{a(this,"q8")}get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(s){return s.message},n={_errors:[]},i=a(s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,u=0;for(;u<o.path.length;){let c=o.path[u];u!==o.path.length-1?l[c]=l[c]||{_errors:[]}:(l[c]=l[c]||{_errors:[]},l[c]._errors.push(r(o))),l=l[c],u++}}},"P");return i(this),n}static assert(t){if(!(t instanceof ti))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,tr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r=Object.create(null),n=[];for(let i of this.issues)if(i.path.length>0){let s=i.path[0];r[s]=r[s]||[],r[s].push(t(i))}else n.push(t(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}ti.create=e=>new ti(e);var OJ=a((e,t)=>{let r;switch(e.code){case lt.invalid_type:e.received===_t.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case lt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,tr.jsonStringifyReplacer)}`;break;case lt.unrecognized_keys:r=`Unrecognized key(s) in object: ${tr.joinValues(e.keys,", ")}`;break;case lt.invalid_union:r="Invalid input";break;case lt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${tr.joinValues(e.options)}`;break;case lt.invalid_enum_value:r=`Invalid enum value. Expected ${tr.joinValues(e.options)}, received '${e.received}'`;break;case lt.invalid_arguments:r="Invalid function arguments";break;case lt.invalid_return_type:r="Invalid function return type";break;case lt.invalid_date:r="Invalid date";break;case lt.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:tr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case lt.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case lt.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case lt.custom:r="Invalid input";break;case lt.invalid_intersection_types:r="Intersection results could not be merged";break;case lt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case lt.not_finite:r="Number must be finite";break;default:r=t.defaultError,tr.assertNever(e)}return{message:r}},"Ex"),Sl=OJ,iR=Sl;function RJ(e){iR=e}a(RJ,"Rx");function Th(){return iR}a(Th,"d4");var Nh=a(e=>{let{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let l="",u=n.filter(c=>!!c).slice().reverse();for(let c of u)l=c(o,{data:t,defaultError:l}).message;return{...i,path:s,message:l}},"n1"),PJ=[];function yt(e,t){let r=Th(),n=Nh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Sl?void 0:Sl].filter(i=>!!i)});e.common.issues.push(n)}a(yt,"F$");class bn{static{a(this,"Sq")}constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let i of r){if(i.status==="aborted")return Pt;i.status==="dirty"&&t.dirty(),n.push(i.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let i of r){let s=await i.key,o=await i.value;n.push({key:s,value:o})}return bn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let i of r){let{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(n[s.value]=o.value)}return{status:t.value,value:n}}}var Pt=Object.freeze({status:"aborted"}),sl=a(e=>({status:"dirty",value:e}),"xK"),Tn=a(e=>({status:"valid",value:e}),"bq"),Qv=a(e=>e.status==="aborted","Y2"),$v=a(e=>e.status==="dirty","O2"),vo=a(e=>e.status==="valid","OK"),vc=a(e=>typeof Promise<"u"&&e instanceof Promise,"l4"),Nt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Nt||(Nt={}));class ga{static{a(this,"m8")}constructor(t,r,n,i){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}var v3=a((e,t)=>{if(vo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ti(e.common.issues);return this._error=r,this._error}}},"IV");function Ht(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:a((s,o)=>{let{message:l}=e;return s.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},"errorMap"),description:i}}a(Ht,"J6");class Yt{static{a(this,"f6")}get description(){return this._def.description}_getType(t){return Ba(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ba(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new bn,ctx:{common:t.parent.common,data:t.data,parsedType:Ba(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(vc(r))throw Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},i=this._parseSync({data:t,path:n.path,parent:n});return v3(n,i)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return vo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>vo(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ba(t)},i=this._parse({data:t,path:n.path,parent:n}),s=await(vc(i)?i:Promise.resolve(i));return v3(n,s)}refine(t,r){let n=a(i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r,"_");return this._refinement((i,s)=>{let o=t(i),l=a(()=>s.addIssue({code:lt.custom,...n(i)}),"Y");return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,i)=>t(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(t){return new Hi({schema:this,typeName:dt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:a(r=>this["~validate"](r),"validate")}}optional(){return ua.create(this,this._def)}nullable(){return As.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Bi.create(this)}promise(){return Al.create(this,this._def)}or(t){return _c.create([this,t],this._def)}and(t){return Ec.create(this,t,this._def)}transform(t){return new Hi({...Ht(this._def),schema:this,typeName:dt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Nc({...Ht(this._def),innerType:this,defaultValue:r,typeName:dt.ZodDefault})}brand(){return new kx({typeName:dt.ZodBranded,type:this,...Ht(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ic({...Ht(this._def),innerType:this,catchValue:r,typeName:dt.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return hd.create(this,t)}readonly(){return Cc.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var LJ=/^c[^\s-]{8,}$/i,DJ=/^[0-9a-z]+$/,jJ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,UJ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,BJ=/^[a-z0-9_-]{21}$/i,zJ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,FJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,HJ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ZJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",wg,GJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,VJ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,WJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,YJ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,QJ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$J=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,aR="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",XJ=new RegExp(`^${aR}$`);function sR(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}a(sR,"LV");function JJ(e){return new RegExp(`^${sR(e)}$`)}a(JJ,"ix");function oR(e){let t=`${aR}T${sR(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}a(oR,"gV");function KJ(e,t){return!!((t==="v4"||!t)&&GJ.test(e)||(t==="v6"||!t)&&WJ.test(e))}a(KJ,"Bx");function qJ(e,t){if(!zJ.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}a(qJ,"Ux");function eK(e,t){return!!((t==="v4"||!t)&&VJ.test(e)||(t==="v6"||!t)&&YJ.test(e))}a(eK,"tx");class Li extends Yt{static{a(this,"x8")}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==_t.string){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:_t.string,received:i.parsedType}),Pt}let r=new bn,n;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let s=t.data.length>i.value,o=t.data.length<i.value;(s||o)&&(n=this._getOrReturnCtx(t,n),s?yt(n,{code:lt.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&yt(n,{code:lt.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")HJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"email",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")wg||(wg=new RegExp(ZJ,"u")),wg.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"emoji",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")UJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"uuid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")BJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"nanoid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")LJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cuid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")DJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cuid2",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")jJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"ulid",code:lt.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{n=this._getOrReturnCtx(t,n),yt(n,{validation:"url",code:lt.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,!i.regex.test(t.data)&&(n=this._getOrReturnCtx(t,n),yt(n,{validation:"regex",code:lt.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?oR(i).test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?XJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?JJ(i).test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?FJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"duration",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?KJ(t.data,i.version)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"ip",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?qJ(t.data,i.alg)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"jwt",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?eK(t.data,i.version)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"cidr",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?QJ.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"base64",code:lt.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?$J.test(t.data)||(n=this._getOrReturnCtx(t,n),yt(n,{validation:"base64url",code:lt.invalid_string,message:i.message}),r.dirty()):tr.assertNever(i);return{status:r.value,value:t.data}}_regex(t,r,n){return this.refinement(i=>t.test(i),{validation:r,code:lt.invalid_string,...Nt.errToObj(n)})}_addCheck(t){return new Li({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Nt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Nt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Nt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Nt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Nt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Nt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Nt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Nt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Nt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Nt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Nt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Nt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Nt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...Nt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Nt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Nt.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Nt.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Nt.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Nt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Nt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Nt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Nt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Nt.errToObj(r)})}nonempty(t){return this.min(1,Nt.errToObj(t))}trim(){return new Li({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Li({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Li({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Li.create=e=>new Li({checks:[],typeName:dt.ZodString,coerce:e?.coerce??!1,...Ht(e)});function tK(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,i=r>n?r:n,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}a(tK,"Fx");class Es extends Yt{static{a(this,"vK")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==_t.number){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:_t.number,received:i.parsedType}),Pt}let r,n=new bn;for(let i of this._def.checks)i.kind==="int"?tr.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?tK(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_finite,message:i.message}),n.dirty()):tr.assertNever(i);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Nt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Nt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Nt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Nt.toString(r))}setLimit(t,r,n,i){return new Es({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Nt.toString(i)}]})}_addCheck(t){return new Es({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Nt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Nt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Nt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Nt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Nt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&tr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Es.create=e=>new Es({checks:[],typeName:dt.ZodNumber,coerce:e?.coerce||!1,...Ht(e)});class Ss extends Yt{static{a(this,"zK")}constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==_t.bigint)return this._getInvalidInput(t);let r,n=new bn;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),yt(r,{code:lt.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):tr.assertNever(i);return{status:n.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.bigint,received:r.parsedType}),Pt}gte(t,r){return this.setLimit("min",t,!0,Nt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Nt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Nt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Nt.toString(r))}setLimit(t,r,n,i){return new Ss({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Nt.toString(i)}]})}_addCheck(t){return new Ss({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Nt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Nt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Nt.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Ss.create=e=>new Ss({checks:[],typeName:dt.ZodBigInt,coerce:e?.coerce??!1,...Ht(e)});class yc extends Yt{static{a(this,"n4")}_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==_t.boolean){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.boolean,received:r.parsedType}),Pt}return Tn(t.data)}}yc.create=e=>new yc({typeName:dt.ZodBoolean,coerce:e?.coerce||!1,...Ht(e)});class yo extends Yt{static{a(this,"pK")}_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==_t.date){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_type,expected:_t.date,received:i.parsedType}),Pt}if(Number.isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return yt(i,{code:lt.invalid_date}),Pt}let r=new bn,n;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(n=this._getOrReturnCtx(t,n),yt(n,{code:lt.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):tr.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new yo({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Nt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Nt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}yo.create=e=>new yo({checks:[],coerce:e?.coerce||!1,typeName:dt.ZodDate,...Ht(e)});class Ih extends Yt{static{a(this,"i1")}_parse(t){if(this._getType(t)!==_t.symbol){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.symbol,received:r.parsedType}),Pt}return Tn(t.data)}}Ih.create=e=>new Ih({typeName:dt.ZodSymbol,...Ht(e)});class wc extends Yt{static{a(this,"i4")}_parse(t){if(this._getType(t)!==_t.undefined){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.undefined,received:r.parsedType}),Pt}return Tn(t.data)}}wc.create=e=>new wc({typeName:dt.ZodUndefined,...Ht(e)});class xc extends Yt{static{a(this,"B4")}_parse(t){if(this._getType(t)!==_t.null){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.null,received:r.parsedType}),Pt}return Tn(t.data)}}xc.create=e=>new xc({typeName:dt.ZodNull,...Ht(e)});class kl extends Yt{static{a(this,"cK")}constructor(){super(...arguments),this._any=!0}_parse(t){return Tn(t.data)}}kl.create=e=>new kl({typeName:dt.ZodAny,...Ht(e)});class oo extends Yt{static{a(this,"jK")}constructor(){super(...arguments),this._unknown=!0}_parse(t){return Tn(t.data)}}oo.create=e=>new oo({typeName:dt.ZodUnknown,...Ht(e)});class Qa extends Yt{static{a(this,"K_")}_parse(t){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.never,received:r.parsedType}),Pt}}Qa.create=e=>new Qa({typeName:dt.ZodNever,...Ht(e)});class Ch extends Yt{static{a(this,"B1")}_parse(t){if(this._getType(t)!==_t.undefined){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.void,received:r.parsedType}),Pt}return Tn(t.data)}}Ch.create=e=>new Ch({typeName:dt.ZodVoid,...Ht(e)});class Bi extends Yt{static{a(this,"p8")}_parse(t){let{ctx:r,status:n}=this._processInputParams(t),i=this._def;if(r.parsedType!==_t.array)return yt(r,{code:lt.invalid_type,expected:_t.array,received:r.parsedType}),Pt;if(i.exactLength!==null){let o=r.data.length>i.exactLength.value,l=r.data.length<i.exactLength.value;(o||l)&&(yt(r,{code:o?lt.too_big:lt.too_small,minimum:l?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(yt(r,{code:lt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(yt(r,{code:lt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>i.type._parseAsync(new ga(r,o,r.path,l)))).then(o=>bn.mergeArray(n,o));let s=[...r.data].map((o,l)=>i.type._parseSync(new ga(r,o,r.path,l)));return bn.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Bi({...this._def,minLength:{value:t,message:Nt.toString(r)}})}max(t,r){return new Bi({...this._def,maxLength:{value:t,message:Nt.toString(r)}})}length(t,r){return new Bi({...this._def,exactLength:{value:t,message:Nt.toString(r)}})}nonempty(t){return this.min(1,t)}}Bi.create=(e,t)=>new Bi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:dt.ZodArray,...Ht(t)});function tl(e){if(e instanceof Lr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ua.create(tl(n))}return new Lr({...e._def,shape:a(()=>t,"shape")})}else return e instanceof Bi?new Bi({...e._def,type:tl(e.element)}):e instanceof ua?ua.create(tl(e.unwrap())):e instanceof As?As.create(tl(e.unwrap())):e instanceof ba?ba.create(e.items.map(t=>tl(t))):e}a(tl,"r4");class Lr extends Yt{static{a(this,"c6")}constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=tr.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==_t.object){let u=this._getOrReturnCtx(t);return yt(u,{code:lt.invalid_type,expected:_t.object,received:u.parsedType}),Pt}let{status:r,ctx:n}=this._processInputParams(t),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof Qa&&this._def.unknownKeys==="strip"))for(let u in n.data)s.includes(u)||o.push(u);let l=[];for(let u of s){let c=i[u],d=n.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ga(n,d,n.path,u)),alwaysSet:u in n.data})}if(this._def.catchall instanceof Qa){let u=this._def.unknownKeys;if(u==="passthrough")for(let c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:n.data[c]}});else if(u==="strict")o.length>0&&(yt(n,{code:lt.unrecognized_keys,keys:o}),r.dirty());else if(u!=="strip")throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let c of o){let d=n.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ga(n,d,n.path,c)),alwaysSet:c in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let u=[];for(let c of l){let d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>bn.mergeObjectSync(r,u)):bn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Nt.errToObj,new Lr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:a((r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Nt.errToObj(t).message??i}:{message:i}},"errorMap")}:{}})}strip(){return new Lr({...this._def,unknownKeys:"strip"})}passthrough(){return new Lr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Lr({...this._def,shape:a(()=>({...this._def.shape(),...t}),"shape")})}merge(t){return new Lr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:a(()=>({...this._def.shape(),...t._def.shape()}),"shape"),typeName:dt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Lr({...this._def,catchall:t})}pick(t){let r={};for(let n of tr.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Lr({...this._def,shape:a(()=>r,"shape")})}omit(t){let r={};for(let n of tr.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Lr({...this._def,shape:a(()=>r,"shape")})}deepPartial(){return tl(this)}partial(t){let r={};for(let n of tr.objectKeys(this.shape)){let i=this.shape[n];t&&!t[n]?r[n]=i:r[n]=i.optional()}return new Lr({...this._def,shape:a(()=>r,"shape")})}required(t){let r={};for(let n of tr.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ua;)i=i._def.innerType;r[n]=i}return new Lr({...this._def,shape:a(()=>r,"shape")})}keyof(){return lR(tr.objectKeys(this.shape))}}Lr.create=(e,t)=>new Lr({shape:a(()=>e,"shape"),unknownKeys:"strip",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});Lr.strictCreate=(e,t)=>new Lr({shape:a(()=>e,"shape"),unknownKeys:"strict",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});Lr.lazycreate=(e,t)=>new Lr({shape:e,unknownKeys:"strip",catchall:Qa.create(),typeName:dt.ZodObject,...Ht(t)});class _c extends Yt{static{a(this,"U4")}_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function i(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let o=s.map(l=>new ti(l.ctx.common.issues));return yt(r,{code:lt.invalid_union,unionErrors:o}),Pt}if(a(i,"P"),r.common.async)return Promise.all(n.map(async s=>{let o={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let s,o=[];for(let u of n){let c={...r,common:{...r.common,issues:[]},parent:null},d=u._parseSync({data:r.data,path:r.path,parent:c});if(d.status==="valid")return d;d.status==="dirty"&&!s&&(s={result:d,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=o.map(u=>new ti(u));return yt(r,{code:lt.invalid_union,unionErrors:l}),Pt}}get options(){return this._def.options}}_c.create=(e,t)=>new _c({options:e,typeName:dt.ZodUnion,...Ht(t)});var Pa=a(e=>e instanceof kc?Pa(e.schema):e instanceof Hi?Pa(e.innerType()):e instanceof Ac?[e.value]:e instanceof ks?e.options:e instanceof Tc?tr.objectValues(e.enum):e instanceof Nc?Pa(e._def.innerType):e instanceof wc?[void 0]:e instanceof xc?[null]:e instanceof ua?[void 0,...Pa(e.unwrap())]:e instanceof As?[null,...Pa(e.unwrap())]:e instanceof kx||e instanceof Cc?Pa(e.unwrap()):e instanceof Ic?Pa(e._def.innerType):[],"N_");class Gp extends Yt{static{a(this,"j2")}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_t.object)return yt(r,{code:lt.invalid_type,expected:_t.object,received:r.parsedType}),Pt;let n=this.discriminator,i=r.data[n],s=this.optionsMap.get(i);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(yt(r,{code:lt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Pt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let i=new Map;for(let s of r){let o=Pa(s.shape[t]);if(!o.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of o){if(i.has(l))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);i.set(l,s)}}return new Gp({typeName:dt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:i,...Ht(n)})}}function Xv(e,t){let r=Ba(e),n=Ba(t);if(e===t)return{valid:!0,data:e};if(r===_t.object&&n===_t.object){let i=tr.objectKeys(t),s=tr.objectKeys(e).filter(l=>i.indexOf(l)!==-1),o={...e,...t};for(let l of s){let u=Xv(e[l],t[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(r===_t.array&&n===_t.array){if(e.length!==t.length)return{valid:!1};let i=[];for(let s=0;s<e.length;s++){let o=e[s],l=t[s],u=Xv(o,l);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===_t.date&&n===_t.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}a(Xv,"zW");class Ec extends Yt{static{a(this,"t4")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=a((s,o)=>{if(Qv(s)||Qv(o))return Pt;let l=Xv(s.value,o.value);return l.valid?(($v(s)||$v(o))&&r.dirty(),{status:r.value,value:l.data}):(yt(n,{code:lt.invalid_intersection_types}),Pt)},"P");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ec.create=(e,t,r)=>new Ec({left:e,right:t,typeName:dt.ZodIntersection,...Ht(r)});class ba extends Yt{static{a(this,"P_")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_t.array)return yt(n,{code:lt.invalid_type,expected:_t.array,received:n.parsedType}),Pt;if(n.data.length<this._def.items.length)return yt(n,{code:lt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pt;!this._def.rest&&n.data.length>this._def.items.length&&(yt(n,{code:lt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((s,o)=>{let l=this._def.items[o]||this._def.rest;return l?l._parse(new ga(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>bn.mergeArray(r,s)):bn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new ba({...this._def,rest:t})}}ba.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new ba({items:e,typeName:dt.ZodTuple,rest:null,...Ht(t)})};class Sc extends Yt{static{a(this,"U1")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_t.object)return yt(n,{code:lt.invalid_type,expected:_t.object,received:n.parsedType}),Pt;let i=[],s=this._def.keyType,o=this._def.valueType;for(let l in n.data)i.push({key:s._parse(new ga(n,l,n.path,l)),value:o._parse(new ga(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?bn.mergeObjectAsync(r,i):bn.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Yt?new Sc({keyType:t,valueType:r,typeName:dt.ZodRecord,...Ht(n)}):new Sc({keyType:Li.create(),valueType:t,typeName:dt.ZodRecord,...Ht(r)})}}class Mh extends Yt{static{a(this,"t1")}get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_t.map)return yt(n,{code:lt.invalid_type,expected:_t.map,received:n.parsedType}),Pt;let i=this._def.keyType,s=this._def.valueType,o=[...n.data.entries()].map(([l,u],c)=>({key:i._parse(new ga(n,l,n.path,[c,"key"])),value:s._parse(new ga(n,u,n.path,[c,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let u of o){let c=await u.key,d=await u.value;if(c.status==="aborted"||d.status==="aborted")return Pt;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(c.value,d.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let u of o){let{key:c,value:d}=u;if(c.status==="aborted"||d.status==="aborted")return Pt;(c.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(c.value,d.value)}return{status:r.value,value:l}}}}Mh.create=(e,t,r)=>new Mh({valueType:t,keyType:e,typeName:dt.ZodMap,...Ht(r)});class wo extends Yt{static{a(this,"mK")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==_t.set)return yt(n,{code:lt.invalid_type,expected:_t.set,received:n.parsedType}),Pt;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(yt(n,{code:lt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(yt(n,{code:lt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let s=this._def.valueType;function o(u){let c=new Set;for(let d of u){if(d.status==="aborted")return Pt;d.status==="dirty"&&r.dirty(),c.add(d.value)}return{status:r.value,value:c}}a(o,"O");let l=[...n.data.values()].map((u,c)=>s._parse(new ga(n,u,n.path,c)));return n.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(t,r){return new wo({...this._def,minSize:{value:t,message:Nt.toString(r)}})}max(t,r){return new wo({...this._def,maxSize:{value:t,message:Nt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}wo.create=(e,t)=>new wo({valueType:e,minSize:null,maxSize:null,typeName:dt.ZodSet,...Ht(t)});class ul extends Yt{static{a(this,"o4")}constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_t.function)return yt(r,{code:lt.invalid_type,expected:_t.function,received:r.parsedType}),Pt;function n(l,u){return Nh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Th(),Sl].filter(c=>!!c),issueData:{code:lt.invalid_arguments,argumentsError:u}})}a(n,"_");function i(l,u){return Nh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Th(),Sl].filter(c=>!!c),issueData:{code:lt.invalid_return_type,returnTypeError:u}})}a(i,"P");let s={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof Al){let l=this;return Tn(async function(...u){let c=new ti([]),d=await l._def.args.parseAsync(u,s).catch(g=>{throw c.addIssue(n(u,g)),c}),f=await Reflect.apply(o,this,d);return await l._def.returns._def.type.parseAsync(f,s).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{let l=this;return Tn(function(...u){let c=l._def.args.safeParse(u,s);if(!c.success)throw new ti([n(u,c.error)]);let d=Reflect.apply(o,this,c.data),f=l._def.returns.safeParse(d,s);if(!f.success)throw new ti([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ul({...this._def,args:ba.create(t).rest(oo.create())})}returns(t){return new ul({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new ul({args:t||ba.create([]).rest(oo.create()),returns:r||oo.create(),typeName:dt.ZodFunction,...Ht(n)})}}class kc extends Yt{static{a(this,"F4")}get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}kc.create=(e,t)=>new kc({getter:e,typeName:dt.ZodLazy,...Ht(t)});class Ac extends Yt{static{a(this,"Q4")}_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return yt(r,{received:r.data,code:lt.invalid_literal,expected:this._def.value}),Pt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ac.create=(e,t)=>new Ac({value:e,typeName:dt.ZodLiteral,...Ht(t)});function lR(e,t){return new ks({values:e,typeName:dt.ZodEnum,...Ht(t)})}a(lR,"bV");class ks extends Yt{static{a(this,"JK")}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return yt(r,{expected:tr.joinValues(n),received:r.parsedType,code:lt.invalid_type}),Pt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return yt(r,{received:r.data,code:lt.invalid_enum_value,options:n}),Pt}return Tn(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ks.create(t,{...this._def,...r})}exclude(t,r=this._def){return ks.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ks.create=lR;class Tc extends Yt{static{a(this,"a4")}_parse(t){let r=tr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==_t.string&&n.parsedType!==_t.number){let i=tr.objectValues(r);return yt(n,{expected:tr.joinValues(i),received:n.parsedType,code:lt.invalid_type}),Pt}if(this._cache||(this._cache=new Set(tr.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let i=tr.objectValues(r);return yt(n,{received:n.data,code:lt.invalid_enum_value,options:i}),Pt}return Tn(t.data)}get enum(){return this._def.values}}Tc.create=(e,t)=>new Tc({values:e,typeName:dt.ZodNativeEnum,...Ht(t)});class Al extends Yt{static{a(this,"dK")}unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==_t.promise&&r.common.async===!1)return yt(r,{code:lt.invalid_type,expected:_t.promise,received:r.parsedType}),Pt;let n=r.parsedType===_t.promise?r.data:Promise.resolve(r.data);return Tn(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Al.create=(e,t)=>new Al({type:e,typeName:dt.ZodPromise,...Ht(t)});class Hi extends Yt{static{a(this,"d8")}innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===dt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:a(o=>{yt(n,o),o.fatal?r.abort():r.dirty()},"addIssue"),get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){let o=i.transform(n.data,s);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return Pt;let u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?Pt:u.status==="dirty"||r.value==="dirty"?sl(u.value):u});{if(r.value==="aborted")return Pt;let l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?Pt:l.status==="dirty"||r.value==="dirty"?sl(l.value):l}}if(i.type==="refinement"){let o=a(l=>{let u=i.refinement(l,s);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"O");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Pt:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Pt:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(i.type==="transform")if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!vo(o))return Pt;let l=i.transform(o.value,s);if(l instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>vo(o)?Promise.resolve(i.transform(o.value,s)).then(l=>({status:r.value,value:l})):Pt);tr.assertNever(i)}}Hi.create=(e,t,r)=>new Hi({schema:e,typeName:dt.ZodEffects,effect:t,...Ht(r)});Hi.createWithPreprocess=(e,t,r)=>new Hi({schema:t,effect:{type:"preprocess",transform:e},typeName:dt.ZodEffects,...Ht(r)});class ua extends Yt{static{a(this,"c8")}_parse(t){return this._getType(t)===_t.undefined?Tn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ua.create=(e,t)=>new ua({innerType:e,typeName:dt.ZodOptional,...Ht(t)});class As extends Yt{static{a(this,"C_")}_parse(t){return this._getType(t)===_t.null?Tn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}As.create=(e,t)=>new As({innerType:e,typeName:dt.ZodNullable,...Ht(t)});class Nc extends Yt{static{a(this,"e4")}_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===_t.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Nc.create=(e,t)=>new Nc({innerType:e,typeName:dt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ht(t)});class Ic extends Yt{static{a(this,"s4")}_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return vc(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ti(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ic.create=(e,t)=>new Ic({innerType:e,typeName:dt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ht(t)});class Oh extends Yt{static{a(this,"F1")}_parse(t){if(this._getType(t)!==_t.nan){let r=this._getOrReturnCtx(t);return yt(r,{code:lt.invalid_type,expected:_t.nan,received:r.parsedType}),Pt}return{status:"valid",value:t.data}}}Oh.create=e=>new Oh({typeName:dt.ZodNaN,...Ht(e)});var rK=Symbol("zod_brand");class kx extends Yt{static{a(this,"v2")}_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class hd extends Yt{static{a(this,"Q1")}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Pt:i.status==="dirty"?(r.dirty(),sl(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Pt:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(t,r){return new hd({in:t,out:r,typeName:dt.ZodPipeline})}}class Cc extends Yt{static{a(this,"$P")}_parse(t){let r=this._def.innerType._parse(t),n=a(i=>(vo(i)&&(i.value=Object.freeze(i.value)),i),"_");return vc(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}}Cc.create=(e,t)=>new Cc({innerType:e,typeName:dt.ZodReadonly,...Ht(t)});function y3(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}a(y3,"hV");function uR(e,t={},r){return e?kl.create().superRefine((n,i)=>{let s=e(n);if(s instanceof Promise)return s.then(o=>{if(!o){let l=y3(t,n),u=l.fatal??r??!0;i.addIssue({code:"custom",...l,fatal:u})}});if(!s){let o=y3(t,n),l=o.fatal??r??!0;i.addIssue({code:"custom",...o,fatal:l})}}):kl.create()}a(uR,"yV");var nK={object:Lr.lazycreate},dt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(dt||(dt={}));var iK=a((e,t={message:`Input not instance of ${e.name}`})=>uR(r=>r instanceof e,t),"ex"),cR=Li.create,dR=Es.create,aK=Oh.create,sK=Ss.create,fR=yc.create,oK=yo.create,lK=Ih.create,uK=wc.create,cK=xc.create,dK=kl.create,fK=oo.create,hK=Qa.create,pK=Ch.create,mK=Bi.create,gK=Lr.create,bK=Lr.strictCreate,vK=_c.create,yK=Gp.create,wK=Ec.create,xK=ba.create,_K=Sc.create,EK=Mh.create,SK=wo.create,kK=ul.create,AK=kc.create,TK=Ac.create,NK=ks.create,IK=Tc.create,CK=Al.create,w3=Hi.create,MK=ua.create,OK=As.create,RK=Hi.createWithPreprocess,PK=hd.create,LK=a(()=>cR().optional(),"Dp"),DK=a(()=>dR().optional(),"Lp"),jK=a(()=>fR().optional(),"gp"),UK={string:a(e=>Li.create({...e,coerce:!0}),"string"),number:a(e=>Es.create({...e,coerce:!0}),"number"),boolean:a(e=>yc.create({...e,coerce:!0}),"boolean"),bigint:a(e=>Ss.create({...e,coerce:!0}),"bigint"),date:a(e=>yo.create({...e,coerce:!0}),"date")},BK=Pt;function zK(e,t){let r={type:"array"};return e.type?._def&&e.type?._def?.typeName!==dt.ZodAny&&(r.items=sr(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&ur(r,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&ur(r,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(ur(r,"minItems",e.exactLength.value,e.exactLength.message,t),ur(r,"maxItems",e.exactLength.value,e.exactLength.message,t)),r}a(zK,"JW");function FK(e,t){let r={type:"integer",format:"int64"};if(!e.checks)return r;for(let n of e.checks)switch(n.kind){case"min":t.target==="jsonSchema7"?n.inclusive?ur(r,"minimum",n.value,n.message,t):ur(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),ur(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?ur(r,"maximum",n.value,n.message,t):ur(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),ur(r,"maximum",n.value,n.message,t));break;case"multipleOf":ur(r,"multipleOf",n.value,n.message,t);break}return r}a(FK,"WW");function HK(){return{type:"boolean"}}a(HK,"HW");function hR(e,t){return sr(e.type._def,t)}a(hR,"a1");var ZK=a((e,t)=>sr(e.innerType._def,t),"TW");function pR(e,t,r){let n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(i=>pR(e,t,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return GK(e,t)}}a(pR,"z2");var GK=a((e,t)=>{let r={type:"integer",format:"unix-time"};if(t.target==="openApi3")return r;for(let n of e.checks)switch(n.kind){case"min":ur(r,"minimum",n.value,n.message,t);break;case"max":ur(r,"maximum",n.value,n.message,t);break}return r},"up");function VK(e,t){return{...sr(e.innerType._def,t),default:e.defaultValue()}}a(VK,"wW");function WK(e,t){return t.effectStrategy==="input"?sr(e.schema._def,t):ni(t)}a(WK,"ZW");function YK(e){return{type:"string",enum:Array.from(e.values)}}a(YK,"fW");var QK=a(e=>"type"in e&&e.type==="string"?!1:"allOf"in e,"xp");function $K(e,t){let r=[sr(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),sr(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(s=>!!s),n=t.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,i=[];return r.forEach(s=>{if(QK(s))i.push(...s.allOf),s.unevaluatedProperties===void 0&&(n=void 0);else{let o=s;if("additionalProperties"in s&&s.additionalProperties===!1){let{additionalProperties:l,...u}=s;o=u}else n=void 0;i.push(o)}}),i.length?{allOf:i,...n}:void 0}a($K,"XW");function XK(e,t){let r=typeof e.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[e.value]}:{type:r==="bigint"?"integer":r,const:e.value}}a(XK,"AW");var xg=void 0,Ei={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:a(()=>(xg===void 0&&(xg=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),xg),"emoji"),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function mR(e,t){let r={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":ur(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t);break;case"max":ur(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"email":switch(t.emailStrategy){case"format:email":Si(r,"email",n.message,t);break;case"format:idn-email":Si(r,"idn-email",n.message,t);break;case"pattern:zod":_n(r,Ei.email,n.message,t);break}break;case"url":Si(r,"uri",n.message,t);break;case"uuid":Si(r,"uuid",n.message,t);break;case"regex":_n(r,n.regex,n.message,t);break;case"cuid":_n(r,Ei.cuid,n.message,t);break;case"cuid2":_n(r,Ei.cuid2,n.message,t);break;case"startsWith":_n(r,RegExp(`^${_g(n.value,t)}`),n.message,t);break;case"endsWith":_n(r,RegExp(`${_g(n.value,t)}$`),n.message,t);break;case"datetime":Si(r,"date-time",n.message,t);break;case"date":Si(r,"date",n.message,t);break;case"time":Si(r,"time",n.message,t);break;case"duration":Si(r,"duration",n.message,t);break;case"length":ur(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,t),ur(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,t);break;case"includes":_n(r,RegExp(_g(n.value,t)),n.message,t);break;case"ip":n.version!=="v6"&&Si(r,"ipv4",n.message,t),n.version!=="v4"&&Si(r,"ipv6",n.message,t);break;case"base64url":_n(r,Ei.base64url,n.message,t);break;case"jwt":_n(r,Ei.jwt,n.message,t);break;case"cidr":n.version!=="v6"&&_n(r,Ei.ipv4Cidr,n.message,t),n.version!=="v4"&&_n(r,Ei.ipv6Cidr,n.message,t);break;case"emoji":_n(r,Ei.emoji(),n.message,t);break;case"ulid":_n(r,Ei.ulid,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":Si(r,"binary",n.message,t);break;case"contentEncoding:base64":ur(r,"contentEncoding","base64",n.message,t);break;case"pattern:zod":_n(r,Ei.base64,n.message,t);break}break;case"nanoid":_n(r,Ei.nanoid,n.message,t);break}return r}a(mR,"e1");function _g(e,t){return t.patternStrategy==="escape"?KK(e):e}a(_g,"GW");var JK=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function KK(e){let t="";for(let r=0;r<e.length;r++)JK.has(e[r])||(t+="\\"),t+=e[r];return t}a(KK,"cp");function Si(e,t,r,n){e.format||e.anyOf?.some(i=>i.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&n.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):ur(e,"format",t,r,n)}a(Si,"l8");function _n(e,t,r,n){e.pattern||e.allOf?.some(i=>i.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&n.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:x3(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):ur(e,"pattern",x3(t,n),r,n)}a(_n,"rq");function x3(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},n=r.i?e.source.toLowerCase():e.source,i="",s=!1,o=!1,l=!1;for(let u=0;u<n.length;u++){if(s){i+=n[u],s=!1;continue}if(r.i){if(o){if(n[u].match(/[a-z]/)){l?(i+=n[u],i+=`${n[u-2]}-${n[u]}`.toUpperCase(),l=!1):n[u+1]==="-"&&n[u+2]?.match(/[a-z]/)?(i+=n[u],l=!0):i+=`${n[u]}${n[u].toUpperCase()}`;continue}}else if(n[u].match(/[a-z]/)){i+=`[${n[u]}${n[u].toUpperCase()}]`;continue}}if(r.m){if(n[u]==="^"){i+=`(^|(?<=[\r
215
215
  ]))`;continue}else if(n[u]==="$"){i+=`($|(?=[\r
216
216
  ]))`;continue}}if(r.s&&n[u]==="."){i+=o?`${n[u]}\r
217
217
  `:`[${n[u]}\r
@@ -362,7 +362,7 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
362
362
  `||d==="\r"){u=!0;break}if(!u)return l;let c=[];for(let d of l)d===" "?c.push("\\t"):d===`
363
363
  `?c.push("\\n"):d==="\r"?c.push("\\r"):c.push(d);return c.join("")},"n"),i=t.length>0?r.length+1:r.length,s=new Array(i),o=0;t.length>0&&(s[o]=t.map(n).join(" "),o+=1);for(let l of r)s[o]=l.map(n).join(" "),o+=1;return s.join(`
364
364
  `)},"nt"),Jb=a(e=>{let t=!1;for(let n of e)if(n==="\\"||n==="|"){t=!0;break}if(!t)return e;let r=[];for(let n of e)n==="\\"?r.push("\\\\"):n==="|"?r.push("\\|"):r.push(n);return r.join("")},"Me"),eve=a(e=>{let{headers:t,rows:r}=e;if(t.length===0)return"";let n=new Array(r.length+2),i=0,s=t.map(l=>Jb(l));n[i]=`| ${s.join(" | ")} |`,i+=1;let o=new Array(t.length);for(let l=0;l<t.length;l+=1)o[l]="---";n[i]=`| ${o.join(" | ")} |`,i+=1;for(let l of r)if(l.length<t.length){let u=new Array(t.length);for(let c=0;c<t.length;c+=1)u[c]=c<l.length?Jb(l[c]):"";n[i]=`| ${u.join(" | ")} |`,i+=1}else{let u=l.map(c=>Jb(c));n[i]=`| ${u.join(" | ")} |`,i+=1}return n.join(`
365
- `)},"rt"),tve=a(({children:e,className:t,onCopy:r,onError:n,timeout:i=2e3})=>{let[s,o]=F.useState(!1),[l,u]=F.useState(!1),c=F.useRef(null),d=F.useRef(0),{isAnimating:f}=F.useContext(vi),g=a(async w=>{var E,A;if(typeof window>"u"||!((E=navigator?.clipboard)!=null&&E.write)){n?.(new Error("Clipboard API not available"));return}try{let C=(A=c.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),O=C?.querySelector("table");if(!O){n?.(new Error("Table not found"));return}let R=nU(O),P=w==="csv"?iU(R):qbe(R),L=new ClipboardItem({"text/plain":new Blob([P],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([L]),u(!0),o(!1),r?.(w),d.current=window.setTimeout(()=>u(!1),i)}catch(C){n?.(C)}},"p");F.useEffect(()=>{let w=a(E=>{let A=E.composedPath();c.current&&!A.includes(c.current)&&o(!1)},"a");return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w),window.clearTimeout(d.current)}},[]);let m=l?Y2:Q2;return v.jsxs("div",{className:"relative",ref:c,children:[v.jsx("button",{className:Ut("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:a(()=>o(!s),"onClick"),title:"Copy table",type:"button",children:e??v.jsx(m,{size:14})}),s?v.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>g("csv"),"onClick"),title:"Copy table as CSV",type:"button",children:"CSV"}),v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>g("tsv"),"onClick"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},"lt"),rve=a(({children:e,className:t,onDownload:r,onError:n})=>{let[i,s]=F.useState(!1),o=F.useRef(null),{isAnimating:l}=F.useContext(vi),u=a(c=>{var d;try{let f=(d=o.current)==null?void 0:d.closest('[data-streamdown="table-wrapper"]'),g=f?.querySelector("table");if(!g){n?.(new Error("Table not found"));return}let m=nU(g),w=c==="csv"?iU(m):eve(m);pl(`table.${c==="csv"?"csv":"md"}`,w,c==="csv"?"text/csv":"text/markdown"),s(!1),r?.(c)}catch(f){n?.(f)}},"r");return F.useEffect(()=>{let c=a(d=>{let f=d.composedPath();o.current&&!f.includes(o.current)&&s(!1)},"l");return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),v.jsxs("div",{className:"relative",ref:o,children:[v.jsx("button",{className:Ut("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:a(()=>s(!i),"onClick"),title:"Download table",type:"button",children:e??v.jsx(c0,{size:14})}),i?v.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>u("csv"),"onClick"),title:"Download table as CSV",type:"button",children:"CSV"}),v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>u("markdown"),"onClick"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},"dt"),nve=a(({children:e,className:t,showControls:r,...n})=>v.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[r?v.jsxs("div",{className:"flex items-center justify-end gap-1",children:[v.jsx(tve,{}),v.jsx(rve,{})]}):null,v.jsx("div",{className:"overflow-x-auto",children:v.jsx("table",{className:Ut("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),"pt"),ive=F.lazy(()=>CT(()=>import("./code-block-37QAKDTI-BPeGsEwm.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.CodeBlock}))),ave=F.lazy(()=>CT(()=>Promise.resolve().then(()=>Cwe),void 0).then(e=>({default:e.Mermaid}))),sve=/language-([^\s]+)/;function d0(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let r=e.position.start,n=t.position.start,i=e.position.end,s=t.position.end;return r?.line===n?.line&&r?.column===n?.column&&i?.line===s?.line&&i?.column===s?.column}a(d0,"ge");function Ur(e,t){return e.className===t.className&&d0(e.node,t.node)}a(Ur,"T");var Dy=a((e,t)=>typeof e=="boolean"?e:e[t]!==!1,"Ne"),Rf=a((e,t)=>{if(typeof e=="boolean")return e;let r=e.mermaid;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},"ue"),X2=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("ol",{className:Ut("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Ur(e,t));X2.displayName="MarkdownOl";var aU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("li",{className:Ut("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&d0(e.node,t.node));aU.displayName="MarkdownLi";var sU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("ul",{className:Ut("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Ur(e,t));sU.displayName="MarkdownUl";var oU=F.memo(({className:e,node:t,...r})=>v.jsx("hr",{className:Ut("my-6 border-border",e),"data-streamdown":"horizontal-rule",...r}),(e,t)=>Ur(e,t));oU.displayName="MarkdownHr";var lU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("span",{className:Ut("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Ur(e,t));lU.displayName="MarkdownStrong";var ove=a(({children:e,className:t,href:r,node:n,...i})=>{let{linkSafety:s}=F.useContext(vi),[o,l]=F.useState(!1),u=r==="streamdown:incomplete-link",c=F.useCallback(async m=>{if(!(!(s!=null&&s.enabled&&r)||u)){if(m.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(r)){window.open(r,"_blank","noreferrer");return}l(!0)}},[s,r,u]),d=F.useCallback(()=>{r&&window.open(r,"_blank","noreferrer")},[r]),f=F.useCallback(()=>{l(!1)},[]),g={url:r??"",isOpen:o,onClose:f,onConfirm:d};return s!=null&&s.enabled&&r?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:Ut("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:c,type:"button",children:e}),s.renderModal?s.renderModal(g):v.jsx(Ybe,{...g})]}):v.jsx("a",{className:Ut("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:r,rel:"noreferrer",target:"_blank",...i,children:e})},"zo"),uU=F.memo(ove,(e,t)=>Ur(e,t)&&e.href===t.href);uU.displayName="MarkdownA";var cU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h1",{className:Ut("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Ur(e,t));cU.displayName="MarkdownH1";var dU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h2",{className:Ut("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Ur(e,t));dU.displayName="MarkdownH2";var fU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h3",{className:Ut("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Ur(e,t));fU.displayName="MarkdownH3";var hU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h4",{className:Ut("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Ur(e,t));hU.displayName="MarkdownH4";var pU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h5",{className:Ut("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Ur(e,t));pU.displayName="MarkdownH5";var mU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h6",{className:Ut("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Ur(e,t));mU.displayName="MarkdownH6";var gU=F.memo(({children:e,className:t,node:r,...n})=>{let{controls:i}=F.useContext(vi),s=Dy(i,"table");return v.jsx(nve,{className:t,showControls:s,...n,children:e})},(e,t)=>Ur(e,t));gU.displayName="MarkdownTable";var bU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("thead",{className:Ut("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Ur(e,t));bU.displayName="MarkdownThead";var vU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("tbody",{className:Ut("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Ur(e,t));vU.displayName="MarkdownTbody";var yU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("tr",{className:Ut("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Ur(e,t));yU.displayName="MarkdownTr";var wU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("th",{className:Ut("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Ur(e,t));wU.displayName="MarkdownTh";var xU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("td",{className:Ut("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Ur(e,t));xU.displayName="MarkdownTd";var _U=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("blockquote",{className:Ut("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Ur(e,t));_U.displayName="MarkdownBlockquote";var EU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("sup",{className:Ut("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Ur(e,t));EU.displayName="MarkdownSup";var SU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("sub",{className:Ut("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Ur(e,t));SU.displayName="MarkdownSub";var kU=F.memo(({children:e,className:t,node:r,...n})=>{if("data-footnotes"in n){let i=a(o=>{var l,u;if(!F.isValidElement(o))return!1;let c=Array.isArray(o.props.children)?o.props.children:[o.props.children],d=!1,f=!1;for(let g of c)if(g){if(typeof g=="string")g.trim()!==""&&(d=!0);else if(F.isValidElement(g))if(((l=g.props)==null?void 0:l["data-footnote-backref"])!==void 0)f=!0;else{let m=Array.isArray(g.props.children)?g.props.children:[g.props.children];for(let w of m){if(typeof w=="string"&&w.trim()!==""){d=!0;break}if(F.isValidElement(w)&&((u=w.props)==null?void 0:u["data-footnote-backref"])===void 0){d=!0;break}}}}return f&&!d},"s"),s=Array.isArray(e)?e.map(o=>{if(!F.isValidElement(o))return o;if(o.type===X2){let l=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(u=>!i(u));return l.length===0?null:{...o,props:{...o.props,children:l}}}return o}):e;return(Array.isArray(s)?s.some(o=>o!==null):s!==null)?v.jsx("section",{className:t,...n,children:s}):null}return v.jsx("section",{className:t,...n,children:e})},(e,t)=>Ur(e,t));kU.displayName="MarkdownSection";var lve=a(({node:e,className:t,children:r,...n})=>{var i,s,o;let l=((i=e?.position)==null?void 0:i.start.line)===((s=e?.position)==null?void 0:s.end.line),{mermaid:u,controls:c}=F.useContext(vi),d=$2();if(l)return v.jsx("code",{className:Ut("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:r});let f=t?.match(sve),g=(o=f?.at(1))!=null?o:"",m="";if(F.isValidElement(r)&&r.props&&typeof r.props=="object"&&"children"in r.props&&typeof r.props.children=="string"?m=r.props.children:typeof r=="string"&&(m=r),g==="mermaid"&&d){let E=Dy(c,"mermaid"),A=Rf(c,"download"),C=Rf(c,"copy"),O=Rf(c,"fullscreen"),R=Rf(c,"panZoom"),P=E&&(A||C||O);return v.jsx(F.Suspense,{fallback:v.jsx(dA,{}),children:v.jsxs("div",{className:Ut("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[P?v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[A?v.jsx($be,{chart:m,config:u?.config}):null,C?v.jsx(uA,{code:m}):null,O?v.jsx(Kbe,{chart:m,config:u?.config}):null]}):null,v.jsx(ave,{chart:m,config:u?.config,showControls:R})]})})}let w=Dy(c,"code");return v.jsx(F.Suspense,{fallback:v.jsx(dA,{}),children:v.jsx(ive,{className:Ut("overflow-x-auto border-border border-t",t),code:m,language:g,children:w?v.jsxs(v.Fragment,{children:[v.jsx(Hbe,{code:m,language:g}),v.jsx(uA,{})]}):null})})},"$o"),AU=F.memo(lve,(e,t)=>e.className===t.className&&d0(e.node,t.node));AU.displayName="MarkdownCode";var TU=F.memo(Gbe,(e,t)=>e.className===t.className&&d0(e.node,t.node));TU.displayName="MarkdownImg";var NU=F.memo(({children:e,className:t,node:r,...n})=>{var i,s;let o=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(o.length===1&&F.isValidElement(o[0])){let l=o[0].props.node,u=l?.tagName;if(u==="img")return v.jsx(v.Fragment,{children:e});if(u==="code"&&((i=l?.position)==null?void 0:i.start.line)!==((s=l?.position)==null?void 0:s.end.line))return v.jsx(v.Fragment,{children:e})}return v.jsx("p",{className:t,...n,children:e})},(e,t)=>Ur(e,t));NU.displayName="MarkdownParagraph";var uve={ol:X2,li:aU,ul:sU,hr:oU,strong:lU,a:uU,h1:cU,h2:dU,h3:fU,h4:hU,h5:pU,h6:mU,table:gU,thead:bU,tbody:vU,tr:yU,th:wU,td:xU,blockquote:_U,code:AU,img:TU,pre:a(({children:e})=>e,"pre"),sup:EU,sub:SU,p:NU,section:kU},fA=[],hA={allowDangerousHtml:!0},Pf=new WeakMap,cve=class{static{a(this,"Re")}constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let r=e.rehypePlugins,n=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(r||n||i)){let d="default";return this.keyCache.set(e,d),d}let s=a(d=>{if(!d||d.length===0)return"";let f="";for(let g=0;g<d.length;g+=1){let m=d[g];if(g>0&&(f+=","),Array.isArray(m)){let[w,E]=m;if(typeof w=="function"){let A=Pf.get(w);A||(A=w.name,Pf.set(w,A)),f+=A}else f+=String(w);f+=":",f+=JSON.stringify(E)}else if(typeof m=="function"){let w=Pf.get(m);w||(w=m.name,Pf.set(m,w)),f+=w}else f+=String(m)}return f},"m"),o=s(r),l=s(n),u=i?JSON.stringify(i):"",c=`${l}::${o}::${u}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(e,t){let r=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(r,t)}clear(){this.cache.clear()}},pA=new cve,IU=a(e=>{let t=dve(e),r=e.children||"";return hve(t.runSync(t.parse(r),r),e)},"Ie"),dve=a(e=>{let t=pA.get(e);if(t)return t;let r=fve(e);return pA.set(e,r),r},"Ko"),fve=a(e=>{let t=e.rehypePlugins||fA,r=e.remarkPlugins||fA,n=e.remarkRehypeOptions?{...hA,...e.remarkRehypeOptions}:hA;return Vge().use(G0e).use(r).use(Age,n).use(t)},"Go"),hve=a((e,t)=>Kme(e,{Fragment:v.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0}),"Yo"),pve=/\[\^[^\]\s]{1,200}\](?!:)/,mve=/\[\^[^\]\s]{1,200}\]:/,gve=/<\/(\w+)>/,bve=/<(\w+)[\s>]/,Kb=a(e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
365
+ `)},"rt"),tve=a(({children:e,className:t,onCopy:r,onError:n,timeout:i=2e3})=>{let[s,o]=F.useState(!1),[l,u]=F.useState(!1),c=F.useRef(null),d=F.useRef(0),{isAnimating:f}=F.useContext(vi),g=a(async w=>{var E,A;if(typeof window>"u"||!((E=navigator?.clipboard)!=null&&E.write)){n?.(new Error("Clipboard API not available"));return}try{let C=(A=c.current)==null?void 0:A.closest('[data-streamdown="table-wrapper"]'),O=C?.querySelector("table");if(!O){n?.(new Error("Table not found"));return}let R=nU(O),P=w==="csv"?iU(R):qbe(R),L=new ClipboardItem({"text/plain":new Blob([P],{type:"text/plain"}),"text/html":new Blob([O.outerHTML],{type:"text/html"})});await navigator.clipboard.write([L]),u(!0),o(!1),r?.(w),d.current=window.setTimeout(()=>u(!1),i)}catch(C){n?.(C)}},"p");F.useEffect(()=>{let w=a(E=>{let A=E.composedPath();c.current&&!A.includes(c.current)&&o(!1)},"a");return document.addEventListener("mousedown",w),()=>{document.removeEventListener("mousedown",w),window.clearTimeout(d.current)}},[]);let m=l?Y2:Q2;return v.jsxs("div",{className:"relative",ref:c,children:[v.jsx("button",{className:Ut("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:f,onClick:a(()=>o(!s),"onClick"),title:"Copy table",type:"button",children:e??v.jsx(m,{size:14})}),s?v.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>g("csv"),"onClick"),title:"Copy table as CSV",type:"button",children:"CSV"}),v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>g("tsv"),"onClick"),title:"Copy table as TSV",type:"button",children:"TSV"})]}):null]})},"lt"),rve=a(({children:e,className:t,onDownload:r,onError:n})=>{let[i,s]=F.useState(!1),o=F.useRef(null),{isAnimating:l}=F.useContext(vi),u=a(c=>{var d;try{let f=(d=o.current)==null?void 0:d.closest('[data-streamdown="table-wrapper"]'),g=f?.querySelector("table");if(!g){n?.(new Error("Table not found"));return}let m=nU(g),w=c==="csv"?iU(m):eve(m);pl(`table.${c==="csv"?"csv":"md"}`,w,c==="csv"?"text/csv":"text/markdown"),s(!1),r?.(c)}catch(f){n?.(f)}},"r");return F.useEffect(()=>{let c=a(d=>{let f=d.composedPath();o.current&&!f.includes(o.current)&&s(!1)},"l");return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),v.jsxs("div",{className:"relative",ref:o,children:[v.jsx("button",{className:Ut("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:l,onClick:a(()=>s(!i),"onClick"),title:"Download table",type:"button",children:e??v.jsx(c0,{size:14})}),i?v.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] overflow-hidden rounded-md border border-border bg-background shadow-lg",children:[v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>u("csv"),"onClick"),title:"Download table as CSV",type:"button",children:"CSV"}),v.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:a(()=>u("markdown"),"onClick"),title:"Download table as Markdown",type:"button",children:"Markdown"})]}):null]})},"dt"),nve=a(({children:e,className:t,showControls:r,...n})=>v.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[r?v.jsxs("div",{className:"flex items-center justify-end gap-1",children:[v.jsx(tve,{}),v.jsx(rve,{})]}):null,v.jsx("div",{className:"overflow-x-auto",children:v.jsx("table",{className:Ut("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]}),"pt"),ive=F.lazy(()=>CT(()=>import("./code-block-37QAKDTI-OOURJEjm.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.CodeBlock}))),ave=F.lazy(()=>CT(()=>Promise.resolve().then(()=>Cwe),void 0).then(e=>({default:e.Mermaid}))),sve=/language-([^\s]+)/;function d0(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let r=e.position.start,n=t.position.start,i=e.position.end,s=t.position.end;return r?.line===n?.line&&r?.column===n?.column&&i?.line===s?.line&&i?.column===s?.column}a(d0,"ge");function Ur(e,t){return e.className===t.className&&d0(e.node,t.node)}a(Ur,"T");var Dy=a((e,t)=>typeof e=="boolean"?e:e[t]!==!1,"Ne"),Rf=a((e,t)=>{if(typeof e=="boolean")return e;let r=e.mermaid;return r===!1?!1:r===!0||r===void 0?!0:r[t]!==!1},"ue"),X2=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("ol",{className:Ut("list-inside list-decimal whitespace-normal [li_&]:pl-6",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Ur(e,t));X2.displayName="MarkdownOl";var aU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("li",{className:Ut("py-1 [&>p]:inline",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&d0(e.node,t.node));aU.displayName="MarkdownLi";var sU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("ul",{className:Ut("list-inside list-disc whitespace-normal [li_&]:pl-6",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Ur(e,t));sU.displayName="MarkdownUl";var oU=F.memo(({className:e,node:t,...r})=>v.jsx("hr",{className:Ut("my-6 border-border",e),"data-streamdown":"horizontal-rule",...r}),(e,t)=>Ur(e,t));oU.displayName="MarkdownHr";var lU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("span",{className:Ut("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Ur(e,t));lU.displayName="MarkdownStrong";var ove=a(({children:e,className:t,href:r,node:n,...i})=>{let{linkSafety:s}=F.useContext(vi),[o,l]=F.useState(!1),u=r==="streamdown:incomplete-link",c=F.useCallback(async m=>{if(!(!(s!=null&&s.enabled&&r)||u)){if(m.preventDefault(),s.onLinkCheck&&await s.onLinkCheck(r)){window.open(r,"_blank","noreferrer");return}l(!0)}},[s,r,u]),d=F.useCallback(()=>{r&&window.open(r,"_blank","noreferrer")},[r]),f=F.useCallback(()=>{l(!1)},[]),g={url:r??"",isOpen:o,onClose:f,onConfirm:d};return s!=null&&s.enabled&&r?v.jsxs(v.Fragment,{children:[v.jsx("button",{className:Ut("wrap-anywhere appearance-none text-left font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",onClick:c,type:"button",children:e}),s.renderModal?s.renderModal(g):v.jsx(Ybe,{...g})]}):v.jsx("a",{className:Ut("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":u,"data-streamdown":"link",href:r,rel:"noreferrer",target:"_blank",...i,children:e})},"zo"),uU=F.memo(ove,(e,t)=>Ur(e,t)&&e.href===t.href);uU.displayName="MarkdownA";var cU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h1",{className:Ut("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Ur(e,t));cU.displayName="MarkdownH1";var dU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h2",{className:Ut("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Ur(e,t));dU.displayName="MarkdownH2";var fU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h3",{className:Ut("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Ur(e,t));fU.displayName="MarkdownH3";var hU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h4",{className:Ut("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Ur(e,t));hU.displayName="MarkdownH4";var pU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h5",{className:Ut("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Ur(e,t));pU.displayName="MarkdownH5";var mU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("h6",{className:Ut("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Ur(e,t));mU.displayName="MarkdownH6";var gU=F.memo(({children:e,className:t,node:r,...n})=>{let{controls:i}=F.useContext(vi),s=Dy(i,"table");return v.jsx(nve,{className:t,showControls:s,...n,children:e})},(e,t)=>Ur(e,t));gU.displayName="MarkdownTable";var bU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("thead",{className:Ut("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Ur(e,t));bU.displayName="MarkdownThead";var vU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("tbody",{className:Ut("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Ur(e,t));vU.displayName="MarkdownTbody";var yU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("tr",{className:Ut("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Ur(e,t));yU.displayName="MarkdownTr";var wU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("th",{className:Ut("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Ur(e,t));wU.displayName="MarkdownTh";var xU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("td",{className:Ut("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Ur(e,t));xU.displayName="MarkdownTd";var _U=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("blockquote",{className:Ut("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Ur(e,t));_U.displayName="MarkdownBlockquote";var EU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("sup",{className:Ut("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Ur(e,t));EU.displayName="MarkdownSup";var SU=F.memo(({children:e,className:t,node:r,...n})=>v.jsx("sub",{className:Ut("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Ur(e,t));SU.displayName="MarkdownSub";var kU=F.memo(({children:e,className:t,node:r,...n})=>{if("data-footnotes"in n){let i=a(o=>{var l,u;if(!F.isValidElement(o))return!1;let c=Array.isArray(o.props.children)?o.props.children:[o.props.children],d=!1,f=!1;for(let g of c)if(g){if(typeof g=="string")g.trim()!==""&&(d=!0);else if(F.isValidElement(g))if(((l=g.props)==null?void 0:l["data-footnote-backref"])!==void 0)f=!0;else{let m=Array.isArray(g.props.children)?g.props.children:[g.props.children];for(let w of m){if(typeof w=="string"&&w.trim()!==""){d=!0;break}if(F.isValidElement(w)&&((u=w.props)==null?void 0:u["data-footnote-backref"])===void 0){d=!0;break}}}}return f&&!d},"s"),s=Array.isArray(e)?e.map(o=>{if(!F.isValidElement(o))return o;if(o.type===X2){let l=(Array.isArray(o.props.children)?o.props.children:[o.props.children]).filter(u=>!i(u));return l.length===0?null:{...o,props:{...o.props,children:l}}}return o}):e;return(Array.isArray(s)?s.some(o=>o!==null):s!==null)?v.jsx("section",{className:t,...n,children:s}):null}return v.jsx("section",{className:t,...n,children:e})},(e,t)=>Ur(e,t));kU.displayName="MarkdownSection";var lve=a(({node:e,className:t,children:r,...n})=>{var i,s,o;let l=((i=e?.position)==null?void 0:i.start.line)===((s=e?.position)==null?void 0:s.end.line),{mermaid:u,controls:c}=F.useContext(vi),d=$2();if(l)return v.jsx("code",{className:Ut("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:r});let f=t?.match(sve),g=(o=f?.at(1))!=null?o:"",m="";if(F.isValidElement(r)&&r.props&&typeof r.props=="object"&&"children"in r.props&&typeof r.props.children=="string"?m=r.props.children:typeof r=="string"&&(m=r),g==="mermaid"&&d){let E=Dy(c,"mermaid"),A=Rf(c,"download"),C=Rf(c,"copy"),O=Rf(c,"fullscreen"),R=Rf(c,"panZoom"),P=E&&(A||C||O);return v.jsx(F.Suspense,{fallback:v.jsx(dA,{}),children:v.jsxs("div",{className:Ut("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[P?v.jsxs("div",{className:"flex items-center justify-end gap-2",children:[A?v.jsx($be,{chart:m,config:u?.config}):null,C?v.jsx(uA,{code:m}):null,O?v.jsx(Kbe,{chart:m,config:u?.config}):null]}):null,v.jsx(ave,{chart:m,config:u?.config,showControls:R})]})})}let w=Dy(c,"code");return v.jsx(F.Suspense,{fallback:v.jsx(dA,{}),children:v.jsx(ive,{className:Ut("overflow-x-auto border-border border-t",t),code:m,language:g,children:w?v.jsxs(v.Fragment,{children:[v.jsx(Hbe,{code:m,language:g}),v.jsx(uA,{})]}):null})})},"$o"),AU=F.memo(lve,(e,t)=>e.className===t.className&&d0(e.node,t.node));AU.displayName="MarkdownCode";var TU=F.memo(Gbe,(e,t)=>e.className===t.className&&d0(e.node,t.node));TU.displayName="MarkdownImg";var NU=F.memo(({children:e,className:t,node:r,...n})=>{var i,s;let o=(Array.isArray(e)?e:[e]).filter(l=>l!=null&&l!=="");if(o.length===1&&F.isValidElement(o[0])){let l=o[0].props.node,u=l?.tagName;if(u==="img")return v.jsx(v.Fragment,{children:e});if(u==="code"&&((i=l?.position)==null?void 0:i.start.line)!==((s=l?.position)==null?void 0:s.end.line))return v.jsx(v.Fragment,{children:e})}return v.jsx("p",{className:t,...n,children:e})},(e,t)=>Ur(e,t));NU.displayName="MarkdownParagraph";var uve={ol:X2,li:aU,ul:sU,hr:oU,strong:lU,a:uU,h1:cU,h2:dU,h3:fU,h4:hU,h5:pU,h6:mU,table:gU,thead:bU,tbody:vU,tr:yU,th:wU,td:xU,blockquote:_U,code:AU,img:TU,pre:a(({children:e})=>e,"pre"),sup:EU,sub:SU,p:NU,section:kU},fA=[],hA={allowDangerousHtml:!0},Pf=new WeakMap,cve=class{static{a(this,"Re")}constructor(){this.cache=new Map,this.keyCache=new WeakMap,this.maxSize=100}generateCacheKey(e){let t=this.keyCache.get(e);if(t)return t;let r=e.rehypePlugins,n=e.remarkPlugins,i=e.remarkRehypeOptions;if(!(r||n||i)){let d="default";return this.keyCache.set(e,d),d}let s=a(d=>{if(!d||d.length===0)return"";let f="";for(let g=0;g<d.length;g+=1){let m=d[g];if(g>0&&(f+=","),Array.isArray(m)){let[w,E]=m;if(typeof w=="function"){let A=Pf.get(w);A||(A=w.name,Pf.set(w,A)),f+=A}else f+=String(w);f+=":",f+=JSON.stringify(E)}else if(typeof m=="function"){let w=Pf.get(m);w||(w=m.name,Pf.set(m,w)),f+=w}else f+=String(m)}return f},"m"),o=s(r),l=s(n),u=i?JSON.stringify(i):"",c=`${l}::${o}::${u}`;return this.keyCache.set(e,c),c}get(e){let t=this.generateCacheKey(e),r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(e,t){let r=this.generateCacheKey(e);if(this.cache.size>=this.maxSize){let n=this.cache.keys().next().value;n&&this.cache.delete(n)}this.cache.set(r,t)}clear(){this.cache.clear()}},pA=new cve,IU=a(e=>{let t=dve(e),r=e.children||"";return hve(t.runSync(t.parse(r),r),e)},"Ie"),dve=a(e=>{let t=pA.get(e);if(t)return t;let r=fve(e);return pA.set(e,r),r},"Ko"),fve=a(e=>{let t=e.rehypePlugins||fA,r=e.remarkPlugins||fA,n=e.remarkRehypeOptions?{...hA,...e.remarkRehypeOptions}:hA;return Vge().use(G0e).use(r).use(Age,n).use(t)},"Go"),hve=a((e,t)=>Kme(e,{Fragment:v.Fragment,components:t.components,ignoreInvalidStyle:!0,jsx:v.jsx,jsxs:v.jsxs,passKeys:!0,passNode:!0}),"Yo"),pve=/\[\^[^\]\s]{1,200}\](?!:)/,mve=/\[\^[^\]\s]{1,200}\]:/,gve=/<\/(\w+)>/,bve=/<(\w+)[\s>]/,Kb=a(e=>{let t=0;for(;t<e.length&&(e[t]===" "||e[t]===" "||e[t]===`
366
366
  `||e[t]==="\r");)t+=1;return t+1<e.length&&e[t]==="$"&&e[t+1]==="$"},"He"),vve=a(e=>{let t=e.length-1;for(;t>=0&&(e[t]===" "||e[t]===" "||e[t]===`
367
367
  `||e[t]==="\r");)t-=1;return t>=1&&e[t]==="$"&&e[t-1]==="$"},"rn"),qb=a(e=>{let t=0;for(let r=0;r<e.length-1;r+=1)e[r]==="$"&&e[r+1]==="$"&&(t+=1,r+=1);return t},"Ee"),yve=a(e=>{let t=pve.test(e),r=mve.test(e);if(t||r)return[e];let n=hi.lex(e,{gfm:!0}),i=[],s=[];for(let o of n){let l=o.raw,u=i.length;if(s.length>0){if(i[u-1]+=l,o.type==="html"){let c=l.match(gve);if(c){let d=c[1];s.at(-1)===d&&s.pop()}}continue}if(o.type==="html"&&o.block){let c=l.match(bve);if(c){let d=c[1];l.includes(`</${d}>`)||s.push(d)}}if(l.trim()==="$$"&&u>0){let c=i[u-1],d=Kb(c),f=qb(c);if(d&&f%2===1){i[u-1]=c+l;continue}}if(u>0&&vve(l)){let c=i[u-1],d=Kb(c),f=qb(c),g=qb(l);if(d&&f%2===1&&!Kb(l)&&g===1){i[u-1]=c+l;continue}}i.push(l)}return i},"De"),wve={raw:Hce,sanitize:[Kce,{}],harden:[moe,{allowedImagePrefixes:["*"],allowedLinkPrefixes:["*"],allowedProtocols:["*"],defaultOrigin:void 0,allowDataImages:!0}]},xve={gfm:[Ope,{}]},_ve=Object.values(wve),Eve=Object.values(xve),Sve={block:" ▋",circle:" ●"},kve={shikiTheme:["github-light","github-dark"],controls:!0,isAnimating:!1,mode:"streaming",mermaid:void 0,linkSafety:{enabled:!0}},vi=F.createContext(kve),CU=F.memo(({content:e,shouldParseIncompleteMarkdown:t,index:r,...n})=>v.jsx(IU,{...n,children:e}),(e,t)=>{if(e.content!==t.content||e.index!==t.index)return!1;if(e.components!==t.components){let r=Object.keys(e.components||{}),n=Object.keys(t.components||{});if(r.length!==n.length||r.some(i=>{var s,o;return((s=e.components)==null?void 0:s[i])!==((o=t.components)==null?void 0:o[i])}))return!1}return!(e.rehypePlugins!==t.rehypePlugins||e.remarkPlugins!==t.remarkPlugins)});CU.displayName="Block";var Ave=["github-light","github-dark"],MU=F.memo(({children:e,mode:t="streaming",parseIncompleteMarkdown:r=!0,components:n,rehypePlugins:i=_ve,remarkPlugins:s=Eve,className:o,shikiTheme:l=Ave,mermaid:u,controls:c=!0,isAnimating:d=!1,BlockComponent:f=CU,parseMarkdownIntoBlocksFn:g=yve,caret:m,plugins:w,remend:E,linkSafety:A={enabled:!0},...C})=>{let O=F.useId(),[R,P]=F.useTransition(),L=F.useMemo(()=>typeof e!="string"?"":t==="streaming"&&r?Dme(e,E):e,[e,t,r,E]),j=F.useMemo(()=>g(L),[L,g]),[G,Z]=F.useState(j);F.useEffect(()=>{t==="streaming"?P(()=>{Z(j)}):Z(j)},[j,t]);let K=t==="streaming"?G:j,z=F.useMemo(()=>K.map((_,N)=>`${O}-${N}`),[K.length,O]),V=F.useMemo(()=>{var _,N;return{shikiTheme:(N=(_=w?.code)==null?void 0:_.getThemes())!=null?N:l,controls:c,isAnimating:d,mode:t,mermaid:u,linkSafety:A}},[l,c,d,t,u,A,w?.code]),h=F.useMemo(()=>({...uve,...n}),[n]),y=F.useMemo(()=>{let _=[];return w!=null&&w.cjk&&(_=[..._,...w.cjk.remarkPluginsBefore]),_=[..._,...s],w!=null&&w.cjk&&(_=[..._,...w.cjk.remarkPluginsAfter]),w!=null&&w.math&&(_=[..._,w.math.remarkPlugin]),_},[s,w?.math,w?.cjk]),b=F.useMemo(()=>w!=null&&w.math?[...i,w.math.rehypePlugin]:i,[i,w?.math]),x=F.useMemo(()=>m&&d?{"--streamdown-caret":`"${Sve[m]}"`}:void 0,[m,d]);return t==="static"?v.jsx(Ly.Provider,{value:w??null,children:v.jsx(vi.Provider,{value:V,children:v.jsx("div",{className:Ut("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",o),children:v.jsx(IU,{components:h,rehypePlugins:b,remarkPlugins:y,...C,children:e})})})}):v.jsx(Ly.Provider,{value:w??null,children:v.jsx(vi.Provider,{value:V,children:v.jsxs("div",{className:Ut("space-y-4 whitespace-normal *:first:mt-0 *:last:mb-0",m?"*:last:after:inline *:last:after:align-baseline *:last:after:content-(--streamdown-caret)":null,o),style:x,children:[K.length===0&&m&&d&&v.jsx("span",{}),K.map((_,N)=>v.jsx(f,{components:h,content:_,index:N,rehypePlugins:b,remarkPlugins:y,shouldParseIncompleteMarkdown:r,...C},z[N]))]})})})},(e,t)=>e.children===t.children&&e.shikiTheme===t.shikiTheme&&e.isAnimating===t.isAnimating&&e.mode===t.mode&&e.plugins===t.plugins&&e.className===t.className&&e.linkSafety===t.linkSafety);MU.displayName="Streamdown";var Tve=a(({children:e,className:t,minZoom:r=.5,maxZoom:n=3,zoomStep:i=.1,showControls:s=!0,initialZoom:o=1,fullscreen:l=!1})=>{let u=F.useRef(null),c=F.useRef(null),[d,f]=F.useState(o),[g,m]=F.useState({x:0,y:0}),[w,E]=F.useState(!1),[A,C]=F.useState({x:0,y:0}),[O,R]=F.useState({x:0,y:0}),P=F.useCallback(h=>{f(y=>Math.max(r,Math.min(n,y+h)))},[r,n]),L=F.useCallback(()=>{P(i)},[P,i]),j=F.useCallback(()=>{P(-i)},[P,i]),G=F.useCallback(()=>{f(o),m({x:0,y:0})},[o]),Z=F.useCallback(h=>{h.preventDefault();let y=h.deltaY>0?-i:i;P(y)},[P,i]),K=F.useCallback(h=>{if(h.button!==0||h.isPrimary===!1)return;E(!0),C({x:h.clientX,y:h.clientY}),R(g);let y=h.currentTarget;y instanceof HTMLElement&&y.setPointerCapture(h.pointerId)},[g]),z=F.useCallback(h=>{if(!w)return;h.preventDefault();let y=h.clientX-A.x,b=h.clientY-A.y;m({x:O.x+y,y:O.y+b})},[w,A,O]),V=F.useCallback(h=>{E(!1);let y=h.currentTarget;y instanceof HTMLElement&&y.releasePointerCapture(h.pointerId)},[]);return F.useEffect(()=>{let h=u.current;if(h)return h.addEventListener("wheel",Z,{passive:!1}),()=>{h.removeEventListener("wheel",Z)}},[Z]),F.useEffect(()=>{let h=c.current;if(h&&w)return document.body.style.userSelect="none",h.addEventListener("pointermove",z,{passive:!1}),h.addEventListener("pointerup",V),h.addEventListener("pointercancel",V),()=>{document.body.style.userSelect="",h.removeEventListener("pointermove",z),h.removeEventListener("pointerup",V),h.removeEventListener("pointercancel",V)}},[w,z,V]),v.jsxs("div",{className:Ut("relative flex flex-col",l?"h-full w-full":"min-h-28 w-full",t),ref:u,style:{cursor:w?"grabbing":"grab"},children:[s?v.jsxs("div",{className:Ut("absolute z-10 flex flex-col gap-1 rounded-md border border-border bg-background/90 p-1 shadow-sm backdrop-blur-sm",l?"bottom-4 left-4":"bottom-2 left-2"),children:[v.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d>=n,onClick:L,title:"Zoom in",type:"button",children:v.jsx(Bbe,{size:16})}),v.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",disabled:d<=r,onClick:j,title:"Zoom out",type:"button",children:v.jsx(zbe,{size:16})}),v.jsx("button",{className:"flex items-center justify-center rounded p-1.5 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",onClick:G,title:"Reset zoom and pan",type:"button",children:v.jsx(Ube,{size:16})})]}):null,v.jsx("div",{className:Ut("flex-1 origin-center transition-transform duration-150 ease-out",l?"flex h-full w-full items-center justify-center":"flex w-full items-center justify-center"),onPointerDown:K,ref:c,role:"application",style:{transform:`translate(${g.x}px, ${g.y}px) scale(${d})`,transformOrigin:"center center",touchAction:"none",willChange:"transform"},children:e})]})},"Ft"),OU=a(({chart:e,className:t,config:r,fullscreen:n=!1,showControls:i=!0})=>{let[s,o]=F.useState(null),[l,u]=F.useState(!1),[c,d]=F.useState(""),[f,g]=F.useState(""),[m,w]=F.useState(0),{mermaid:E}=F.useContext(vi),A=$2(),C=E?.errorComponent,{shouldRender:O,containerRef:R}=Lbe({immediate:n});if(F.useEffect(()=>{if(O){if(!A){o("Mermaid plugin not available. Please add the mermaid plugin to enable diagram rendering.");return}(async()=>{try{o(null),u(!0);let L=A.getMermaid(r),j=e.split("").reduce((K,z)=>(K<<5)-K+z.charCodeAt(0)|0,0),G=`mermaid-${Math.abs(j)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:Z}=await L.render(G,e);d(Z),g(Z)}catch(L){if(!(f||c)){let j=L instanceof Error?L.message:"Failed to render Mermaid chart";o(j)}}finally{u(!1)}})()}},[e,r,m,O,A]),!(O||c||f))return v.jsx("div",{className:Ut("my-4 min-h-[200px]",t),ref:R});if(l&&!c&&!f)return v.jsx("div",{className:Ut("my-4 flex justify-center p-4",t),ref:R,children:v.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[v.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),v.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(s&&!c&&!f){let L=a(()=>w(j=>j+1),"E");return C?v.jsx("div",{ref:R,children:v.jsx(C,{chart:e,error:s,retry:L})}):v.jsxs("div",{className:Ut("rounded-lg border border-red-200 bg-red-50 p-4",t),ref:R,children:[v.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",s]}),v.jsxs("details",{className:"mt-2",children:[v.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),v.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]})}let P=c||f;return v.jsx("div",{className:Ut("size-full",t),"data-streamdown":"mermaid",ref:R,children:v.jsx(Tve,{className:Ut(n?"size-full overflow-hidden":"my-4 overflow-hidden",t),fullscreen:n,maxZoom:3,minZoom:.5,showControls:i,zoomStep:.1,children:v.jsx("div",{"aria-label":"Mermaid chart",className:Ut("flex justify-center",n?"size-full items-center":null),dangerouslySetInnerHTML:{__html:P},role:"img"})})})},"tt");const RU=F.memo(({className:e,shikiTheme:t=["github-dark","github-dark"],...r})=>v.jsx(MU,{className:Ue("!space-y-0 size-full markdown-content",e),shikiTheme:t,...r}),(e,t)=>e.children===t.children&&e.className===t.className&&e.isAnimating===t.isAnimating&&JSON.stringify(e.shikiTheme)===JSON.stringify(t.shikiTheme));RU.displayName="Response";const Nve={damping:.7,stiffness:.05,mass:1.25},Ive=70,Cve=1e3/60,Mve=350;let f0=!1;globalThis.document?.addEventListener("mousedown",()=>{f0=!0});globalThis.document?.addEventListener("mouseup",()=>{f0=!1});globalThis.document?.addEventListener("click",()=>{f0=!1});const Ove=a((e={})=>{const[t,r]=F.useState(!1),[n,i]=F.useState(e.initial!==!1),[s,o]=F.useState(!1),l=F.useRef(null);l.current=e;const u=F.useCallback(()=>{if(!f0)return!1;const O=window.getSelection();if(!O||!O.rangeCount)return!1;const R=O.getRangeAt(0);return R.commonAncestorContainer.contains(A.current)||A.current?.contains(R.commonAncestorContainer)},[]),c=F.useCallback(O=>{f.isAtBottom=O,i(O)},[]),d=F.useCallback(O=>{f.escapedFromLock=O,r(O)},[]),f=F.useMemo(()=>{let O;return{escapedFromLock:t,isAtBottom:n,resizeDifference:0,accumulated:0,velocity:0,listeners:new Set,get scrollTop(){return A.current?.scrollTop??0},set scrollTop(R){A.current&&(A.current.scrollTop=R,f.ignoreScrollToTop=A.current.scrollTop)},get targetScrollTop(){return!A.current||!C.current?0:A.current.scrollHeight-1-A.current.clientHeight},get calculatedTargetScrollTop(){if(!A.current||!C.current)return 0;const{targetScrollTop:R}=this;if(!e.targetScrollTop)return R;if(O?.targetScrollTop===R)return O.calculatedScrollTop;const P=Math.max(Math.min(e.targetScrollTop(R,{scrollElement:A.current,contentElement:C.current}),R),0);return O={targetScrollTop:R,calculatedScrollTop:P},requestAnimationFrame(()=>{O=void 0}),P},get scrollDifference(){return this.calculatedTargetScrollTop-this.scrollTop},get isNearBottom(){return this.scrollDifference<=Ive}}},[]),g=F.useCallback((O={})=>{typeof O=="string"&&(O={animation:O}),O.preserveScrollPosition||c(!0);const R=Date.now()+(Number(O.wait)||0),P=tv(l.current,O.animation),{ignoreEscapes:L=!1}=O;let j,G=f.calculatedTargetScrollTop;O.duration instanceof Promise?O.duration.finally(()=>{j=Date.now()}):j=R+(O.duration??0);const Z=a(async()=>{const K=new Promise(requestAnimationFrame).then(()=>{if(!f.isAtBottom)return f.animation=void 0,!1;const{scrollTop:z}=f,V=performance.now(),h=(V-(f.lastTick??V))/Cve;if(f.animation||(f.animation={behavior:P,promise:K,ignoreEscapes:L}),f.animation.behavior===P&&(f.lastTick=V),u()||R>Date.now())return Z();if(z<Math.min(G,f.calculatedTargetScrollTop)){if(f.animation?.behavior===P){if(P==="instant")return f.scrollTop=f.calculatedTargetScrollTop,Z();f.velocity=(P.damping*f.velocity+P.stiffness*f.scrollDifference)/P.mass,f.accumulated+=f.velocity*h,f.scrollTop+=f.accumulated,f.scrollTop!==z&&(f.accumulated=0)}return Z()}return j>Date.now()?(G=f.calculatedTargetScrollTop,Z()):(f.animation=void 0,f.scrollTop<f.calculatedTargetScrollTop?g({animation:tv(l.current,l.current.resize),ignoreEscapes:L,duration:Math.max(0,j-Date.now())||void 0}):f.isAtBottom)});return K.then(z=>(requestAnimationFrame(()=>{f.animation||(f.lastTick=void 0,f.velocity=0)}),z))},"next");return O.wait!==!0&&(f.animation=void 0),f.animation?.behavior===P?f.animation.promise:Z()},[c,u,f]),m=F.useCallback(()=>{d(!0),c(!1)},[d,c]),w=F.useCallback(({target:O})=>{if(O!==A.current)return;const{scrollTop:R,ignoreScrollToTop:P}=f;let{lastScrollTop:L=R}=f;f.lastScrollTop=R,f.ignoreScrollToTop=void 0,P&&P>R&&(L=P),o(f.isNearBottom),setTimeout(()=>{if(f.resizeDifference||R===P)return;if(u()){d(!0),c(!1);return}const j=R>L,G=R<L;if(f.animation?.ignoreEscapes){f.scrollTop=L;return}G&&(d(!0),c(!1)),j&&d(!1),!f.escapedFromLock&&f.isNearBottom&&c(!0)},1)},[d,c,u,f]),E=F.useCallback(({target:O,deltaY:R})=>{let P=O;for(;!["scroll","auto"].includes(getComputedStyle(P).overflow);){if(!P.parentElement)return;P=P.parentElement}P===A.current&&R<0&&A.current.scrollHeight>A.current.clientHeight&&!f.animation?.ignoreEscapes&&(d(!0),c(!1))},[d,c,f]),A=mA(O=>{A.current?.removeEventListener("scroll",w),A.current?.removeEventListener("wheel",E),O?.addEventListener("scroll",w,{passive:!0}),O?.addEventListener("wheel",E,{passive:!0})},[]),C=mA(O=>{if(f.resizeObserver?.disconnect(),!O)return;let R;f.resizeObserver=new ResizeObserver(([P])=>{const{height:L}=P.contentRect,j=L-(R??L);if(f.resizeDifference=j,f.scrollTop>f.targetScrollTop&&(f.scrollTop=f.targetScrollTop),o(f.isNearBottom),j>=0){const G=tv(l.current,R?l.current.resize:l.current.initial);g({animation:G,wait:!0,preserveScrollPosition:!0,duration:G==="instant"?void 0:Mve})}else f.isNearBottom&&(d(!1),c(!0));R=L,requestAnimationFrame(()=>{setTimeout(()=>{f.resizeDifference===j&&(f.resizeDifference=0)},1)})}),f.resizeObserver?.observe(O)},[]);return{contentRef:C,scrollRef:A,scrollToBottom:g,stopScroll:m,isAtBottom:n||s,isNearBottom:s,escapedFromLock:t,state:f}},"useStickToBottom");function mA(e,t){const r=F.useCallback(n=>(r.current=n,e(n)),t);return r}a(mA,"useRefCallback");const ev=new Map;function tv(...e){const t={...Nve};let r=!1;for(const i of e){if(i==="instant"){r=!0;continue}typeof i=="object"&&(r=!1,t.damping=i.damping??t.damping,t.stiffness=i.stiffness??t.stiffness,t.mass=i.mass??t.mass)}const n=JSON.stringify(t);return ev.has(n)||ev.set(n,Object.freeze(t)),r?"instant":ev.get(n)}a(tv,"mergeAnimations");function Rve(e={}){const{smooth:t=!1}=e,r=F.useRef(!1),n=Ove({initial:t?"smooth":"instant",resize:t?"smooth":"instant"}),[i,s]=F.useState({isAtBottom:!0,autoScrollEnabled:!0});F.useEffect(()=>{n.isAtBottom?(r.current=!1,s({isAtBottom:!0,autoScrollEnabled:!0})):s(c=>({...c,isAtBottom:!1,autoScrollEnabled:r.current?!1:c.autoScrollEnabled}))},[n.isAtBottom]);const o=F.useCallback(u=>{const c=u?"instant":t?"smooth":"instant";n.scrollToBottom({animation:c,preserveScrollPosition:!1}),s({isAtBottom:!0,autoScrollEnabled:!0}),r.current=!1},[n.scrollToBottom,t]),l=F.useCallback(()=>{n.isAtBottom||(r.current=!0,n.stopScroll(),s(u=>({...u,autoScrollEnabled:!1})))},[n.isAtBottom,n.stopScroll]);return{scrollRef:n.scrollRef,contentRef:n.contentRef,isAtBottom:i.isAtBottom,autoScrollEnabled:i.autoScrollEnabled,scrollToBottom:a(()=>o(!1),"scrollToBottom"),disableAutoScroll:l,_stickToBottom:n}}a(Rve,"useAutoScroll");const Pve=a(({className:e,...t})=>v.jsx(rz,{className:Ue("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),"ResizablePanelGroup"),gA=tz,Lve=a(({withHandle:e,className:t,...r})=>v.jsx(nz,{className:Ue("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...r,children:e&&v.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:v.jsx(iz,{className:"h-2.5 w-2.5"})})}),"ResizableHandle"),jy=F.forwardRef(({mainAction:e,actions:t,variant:r="default",size:n="default",disabled:i,className:s,mainButtonClassName:o,dropdownButtonClassName:l},u)=>{const c=F.useRef(null),[d,f]=F.useState();return F.useImperativeHandle(u,()=>c.current,[]),F.useLayoutEffect(()=>{c.current&&f(c.current.offsetWidth)},[t.length,e.label]),v.jsxs("div",{ref:c,className:Ue("flex w-full",s),children:[v.jsxs(nt,{type:"button",variant:r,size:n,onClick:e.onClick,disabled:i||e.disabled,className:Ue("rounded-r-none flex-1",r==="destructive"?"border-r border-red-700":"border-r-0",o),children:[e.icon&&v.jsx("span",{className:"mr-2",children:e.icon}),e.label]}),v.jsxs(Bc,{children:[v.jsx(zc,{asChild:!0,children:v.jsxs(nt,{type:"button",variant:r,size:n,disabled:i,className:Ue("rounded-l-none px-2 flex-shrink-0",l),children:[v.jsx(ha,{className:"h-4 w-4"}),v.jsx("span",{className:"sr-only",children:"More options"})]})}),v.jsx(Fc,{align:"end",style:{width:d},children:t.map((g,m)=>v.jsxs(F.Fragment,{children:[v.jsxs(la,{onClick:g.onClick,disabled:g.disabled,className:Ue(g.variant==="destructive"&&"text-destructive focus:text-destructive hover:bg-red-50 dark:hover:bg-red-950/50"),children:[g.icon,g.label]}),m<t.length-1&&v.jsx(Vh,{})]},m))})]})]})});jy.displayName="SplitButton";const Dve=Vy,jve=az,Uve=sz,Bve=a(({toolPart:e,defaultOpen:t=!1,className:r})=>{const[n,i]=F.useState(t),{state:s,input:o,output:l,toolCallId:u}=e,c=a(()=>{switch(s){case"input-streaming":return v.jsx(cn,{className:"h-4 w-4 animate-spin text-blue-500"});case"input-available":return v.jsx(ho,{className:"h-4 w-4 text-orange-500"});case"output-available":return v.jsx(dT,{className:"h-4 w-4 text-green-500"});case"output-error":return v.jsx(oz,{className:"h-4 w-4 text-red-500"});default:return v.jsx(ho,{className:"text-muted-foreground h-4 w-4"})}},"getStateIcon"),d=a(()=>{const g="px-2 py-1 rounded-full text-xs font-medium";switch(s){case"input-streaming":return v.jsx("span",{className:Ue(g,"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"),children:"Processing"});case"input-available":return v.jsx("span",{className:Ue(g,"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400"),children:"Ready"});case"output-available":return v.jsx("span",{className:Ue(g,"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400"),children:"Completed"});case"output-error":return v.jsx("span",{className:Ue(g,"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400"),children:"Error"});default:return v.jsx("span",{className:Ue(g,"bg-gray-100 text-gray-700 dark:bg-gray-900/30 dark:text-gray-400"),children:"Pending"})}},"getStateBadge"),f=a(g=>g===null?"null":g===void 0?"undefined":typeof g=="string"?g:typeof g=="object"?JSON.stringify(g,null,2):String(g),"formatValue");return v.jsx("div",{className:Ue("border-border mt-3 overflow-hidden rounded-lg border",r),children:v.jsxs(Dve,{open:n,onOpenChange:i,children:[v.jsx(jve,{asChild:!0,children:v.jsxs(nt,{variant:"ghost",className:"bg-background h-auto w-full justify-between rounded-b-none px-3 py-2 font-normal",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[c(),v.jsx("span",{className:"font-mono text-sm font-medium",children:e.type}),d()]}),v.jsx(ha,{className:Ue("h-4 w-4",n&&"rotate-180")})]})}),v.jsx(Uve,{className:Ue("border-border border-t","data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down overflow-hidden"),children:v.jsxs("div",{className:"bg-background space-y-3 p-3",children:[o&&Object.keys(o).length>0&&v.jsxs("div",{children:[v.jsx("h4",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"Input"}),v.jsx("div",{className:"bg-background rounded border p-2 font-mono text-sm",children:Object.entries(o).map(([g,m])=>v.jsxs("div",{className:"mb-1",children:[v.jsxs("span",{className:"text-muted-foreground",children:[g,":"]})," ",v.jsx("span",{children:f(m)})]},g))})]}),l&&v.jsxs("div",{children:[v.jsx("h4",{className:"text-muted-foreground mb-2 text-sm font-medium",children:"Output"}),v.jsx("div",{className:"bg-background max-h-60 overflow-auto rounded border p-2 font-mono text-sm",children:v.jsx("pre",{className:"whitespace-pre-wrap",children:f(l)})})]}),s==="output-error"&&e.errorText&&v.jsxs("div",{children:[v.jsx("h4",{className:"mb-2 text-sm font-medium text-red-500",children:"Error"}),v.jsx("div",{className:"bg-background rounded border border-red-200 p-2 text-sm dark:border-red-950 dark:bg-red-900/20",children:e.errorText})]}),s==="input-streaming"&&v.jsx("div",{className:"text-muted-foreground text-sm",children:"Processing tool call..."}),u&&v.jsx("div",{className:"text-muted-foreground border-t border-blue-200 pt-2 text-xs",children:v.jsxs("span",{className:"font-mono",children:["Call ID: ",u]})})]})})]})})},"Tool");function zve({agentId:e,channelId:t,chatType:r}){const[n,i]=F.useState([]),s=F.useRef(new Set),{toast:o}=Er(),l=dr();F.useEffect(()=>()=>{s.current.forEach(w=>URL.revokeObjectURL(w)),s.current.clear()},[]);const u=F.useCallback(w=>{const O=Array.from(w.target.files||[]).filter(R=>R.type.startsWith("image/")||R.type.startsWith("video/")||R.type.startsWith("audio/")||R.type==="application/pdf"||R.type==="application/msword"||R.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document"||R.type==="application/vnd.ms-excel"||R.type==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"||R.type==="application/vnd.ms-powerpoint"||R.type==="application/vnd.openxmlformats-officedocument.presentationml.presentation"||R.type.startsWith("text/")).filter(R=>!n.some(P=>P.file.name===R.name&&P.file.size===R.size&&P.file.lastModified===R.lastModified)).map(R=>({file:R,id:Bn(),isUploading:!1}));i(R=>{const P=[...R,...O];return Array.from(new Map(P.map(L=>[`${L.file.name}-${L.file.size}`,L])).values())}),w.target&&(w.target.value="")},[n]),c=F.useCallback(w=>{i(E=>{const A=E.find(C=>C.id===w);return A?.blobUrl&&(URL.revokeObjectURL(A.blobUrl),s.current.delete(A.blobUrl)),E.filter(C=>C.id!==w)})},[]),d=F.useCallback(w=>w.map(A=>{const C=URL.createObjectURL(A.file);return s.current.add(C),A.blobUrl=C,{id:A.id,url:C,title:A.file.name,contentType:Eg(A.file.type),isUploading:!0}}).filter(A=>A.contentType!==void 0),[]),f=F.useCallback(async w=>{if(!w.length)return{uploaded:[],failed:[],blobUrls:[]};const E=w.map(async P=>{try{const L=r===It.DM&&e?await l.media.uploadAgentMedia(e,{file:P.file,filename:P.file.name}):await l.media.uploadChannelMedia(t,P.file);return{success:!0,media:{id:P.id,url:L.url,title:P.file.name,source:"file_upload",contentType:Eg(P.file.type)}}}catch(L){return De.error(`Failed to upload ${P.file.name}:`,L),o({title:`Upload Failed: ${P.file.name}`,description:L instanceof Error?L.message:"Upload failed",variant:"destructive"}),{success:!1,file:P,error:L instanceof Error?L.message:"Upload failed"}}}),A=await Promise.allSettled(E),C=[],O=[],R=[];return A.forEach((P,L)=>{P.status==="fulfilled"?P.value.success&&"media"in P.value?C.push(P.value.media):"file"in P.value&&O.push(P.value):O.push({file:w[L],error:P.reason?.message||"Upload failed"})}),w.forEach(P=>{P.blobUrl&&R.push(P.blobUrl)}),{uploaded:C,failed:O,blobUrls:R}},[r,e,t,o]),g=F.useCallback(w=>{w.forEach(E=>{URL.revokeObjectURL(E),s.current.delete(E)})},[]),m=F.useCallback(()=>{n.forEach(w=>{w.blobUrl&&(URL.revokeObjectURL(w.blobUrl),s.current.delete(w.blobUrl))}),i([])},[n]);return{selectedFiles:n,setSelectedFiles:i,handleFileChange:u,removeFile:c,createBlobUrls:d,uploadFiles:f,cleanupBlobUrls:g,clearFiles:m,getContentTypeFromMimeType:Eg}}a(zve,"useFileUpload");const Fve=3e4;function Hve({channelId:e,currentUserId:t,contextId:r,chatType:n,allAgents:i,messages:s,onAddMessage:o,onUpdateMessage:l,onDeleteMessage:u,onClearMessages:c,onInputDisabledChange:d}){const f=qn.getInstance(),{getApiKey:g}=bse(),m=F.useRef(null),w=F.useRef(new Map),E=F.useRef(new Map),A=F.useRef(new Set),C=F.useCallback(async(O,R,P,L,j,G,Z)=>{const K=Z||e;if(!K){De.error("[useSocketChat] Cannot send message: no channel ID available");return}const z={...G,channelType:n,...n===It.DM&&{isDm:!0,targetUserId:r}};await f.sendMessage(O,K,R,P,L,j,z)},[e,f,n,r]);return F.useEffect(()=>{if(!e||!t){m.current&&(De.info(`[useSocketChat] useEffect: channelId is now null/undefined, resetting joinedChannelRef from ${m.current}`),m.current=null);return}const O=g();f.initialize(t,O??void 0),e!==m.current?(De.info(`[useSocketChat] useEffect: Joining channel ${e}. Previous joinedChannelRef: ${m.current}`),f.joinChannel(e),m.current=e):De.info(`[useSocketChat] useEffect: Channel ${e} already marked as joined by this instance. Skipping joinChannel call.`);const R=a(T=>{if(De.info("[useSocketChat] Received raw messageBroadcast data:",JSON.stringify(T)),(T.channelId||T.roomId)!==e)return;const p=T.senderId===t,S=n===It.DM?T.senderId===r:i.some(M=>M.id===T.senderId);!p&&S&&d(!1);const I="clientMessageId"in T?T.clientMessageId:void 0;if(I&&p)l(I,{id:T.id||Bn(),isLoading:!1,createdAt:typeof T.createdAt=="number"?T.createdAt:Date.parse(T.createdAt),text:T.text,attachments:T.attachments,isAgent:!1});else{const M=w.current;if(T.id&&M.has(T.id)){De.info("[useSocketChat] Completing streamed message by ID:",T.id),M.delete(T.id);const ae=E.current,ie=ae.get(T.id);ie&&(clearTimeout(ie),ae.delete(T.id)),l(T.id,{text:T.text,thought:T.thought,actions:T.actions,attachments:T.attachments,isStreaming:!1,prompt:T.prompt,rawMessage:T.rawMessage});return}const U=T.id||Bn(),B={id:U,text:T.text,name:T.senderName,senderId:T.senderId,isAgent:S,createdAt:typeof T.createdAt=="number"?T.createdAt:Date.parse(T.createdAt),channelId:T.channelId||T.roomId,serverId:T.serverId,source:T.source,attachments:T.attachments,thought:T.thought,actions:T.actions,isLoading:!1,prompt:T.prompt,rawMessage:T.rawMessage},H=A.current,$=H.has(U);De.info("[useSocketChat] Processing message:",U,"alreadySeen:",$,"source:",T.source),T.source==="agent_action"&&T.id?$?(De.info("[useSocketChat] Updating action message:",T.id,"actionStatus:",T.rawMessage?.actionStatus),l(T.id,{text:T.text,thought:T.thought,actions:T.actions,attachments:T.attachments,rawMessage:T.rawMessage})):(De.info("[useSocketChat] Adding new action message:",T.id),H.add(U),o(B)):$||(De.info("[useSocketChat] Adding new message:",U),H.add(U),o(B))}},"handleMessageBroadcasting"),P=a(T=>{(T.channelId||T.roomId)===e&&d(!1)},"handleMessageComplete"),L=a(T=>{(T.channelId||T.roomId)===e&&(T.action==="disable_input"?d(!0):T.action==="enable_input"&&d(!1))},"handleControlMessage"),j=a(T=>{(T.channelId||T.roomId)===e&&T.messageId&&u(T.messageId)},"handleMessageDeleted"),G=a(T=>{(T.channelId||T.roomId)===e&&c()},"handleChannelCleared"),Z=a(T=>{(T.channelId||T.roomId)===e&&c()},"handleChannelDeleted"),K=a(T=>{if(T.channelId!==e)return;const{messageId:k,chunk:p,agentId:S}=T,I=w.current,M=E.current,U=M.get(k);U&&clearTimeout(U);const B=setTimeout(()=>{De.warn(`[useSocketChat] Stream timeout for message ${k}`),I.delete(k),M.delete(k),l(k,{isStreaming:!1})},Fve);M.set(k,B);const H=I.get(k);if(H===void 0){const $=i.find(ie=>ie.id===S),ae={id:k,text:p,name:$?.name||"Agent",senderId:S,isAgent:!0,createdAt:Date.now(),channelId:e,source:"streaming",isLoading:!1,isStreaming:!0};I.set(k,p),o(ae)}else{const $=H+p;I.set(k,$),l(k,{text:$})}},"handleStreamChunk"),z=f.evtMessageBroadcast.attach(T=>(T.channelId||T.roomId)===e,R),V=f.evtMessageComplete.attach(T=>(T.channelId||T.roomId)===e,P),h=f.evtControlMessage.attach(T=>(T.channelId||T.roomId)===e,L),y=f.evtMessageDeleted.attach(T=>(T.channelId||T.roomId)===e,j),b=f.evtChannelCleared.attach(T=>(T.channelId||T.roomId)===e,G),x=f.evtChannelDeleted.attach(T=>(T.channelId||T.roomId)===e,Z),_=f.evtMessageStreamChunk.attach(T=>T.channelId===e,K);return()=>{e&&(De.info(`[useSocketChat] useEffect cleanup: Leaving channel ${e}. Current joinedChannelRef: ${m.current}`),f.leaveChannel(e),e===m.current&&(m.current=null,De.info(`[useSocketChat] useEffect cleanup: Reset joinedChannelRef for ${e}`)),w.current.clear(),E.current.forEach(T=>clearTimeout(T)),E.current.clear(),A.current.clear()),N([z,V,h,y,b,x,_])};function N(T){T.forEach(k=>k?.detach())}},[e,t,f]),{sendMessage:C}}a(Hve,"useSocketChat");function Zve({sessionId:e,agentId:t,serverId:r,channelId:n,onAddMessage:i,onUpdateMessage:s}){const[o,l]=F.useState(!1),[u,c]=F.useState(!1),d=F.useRef(null),f=bi();F.useEffect(()=>()=>{d.current?.abort()},[]);const g=F.useCallback(async(w,E)=>{if(!e||!n||!t||!w.trim())return;const A=Bn();c(!0);const C={id:A,text:w,name:Fa,senderId:f,isAgent:!1,createdAt:Date.now(),channelId:n,serverId:r,isLoading:!0,attachments:E};i(C);try{const O=YP(),R=O.baseUrl;d.current?.abort(),d.current=new AbortController;const P=await fetch(`${R}/api/messaging/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...O.apiKey&&{Authorization:`Bearer ${O.apiKey}`}},body:JSON.stringify({content:w,transport:"sse",attachments:E?.map(V=>({type:NP(V.contentType),url:V.url,name:V.title}))}),signal:d.current.signal});if(!P.ok)throw new Error(`HTTP ${P.status}: ${P.statusText}`);s(A,{isLoading:!1});const L=P.body?.getReader();if(!L)throw new Error("No response body");l(!0);const j=Bn(),G={id:j,text:"",name:"Agent",senderId:t,isAgent:!0,createdAt:Date.now(),channelId:n,serverId:r,isStreaming:!0,isLoading:!0};i(G);const Z=new TextDecoder;let K="",z="";for(;;){const{done:V,value:h}=await L.read();if(V)break;K+=Z.decode(h,{stream:!0});const y=K.split(`
368
368
  `);K=y.pop()||"";for(const b of y)if(b.startsWith("data: ")){const x=b.slice(6);if(x==="[DONE]"){s(j,{text:z,isStreaming:!1,isLoading:!1}),l(!1);continue}try{const _=JSON.parse(x);if(_.type==="chunk"&&_.text)z+=_.text,s(j,{text:z,isStreaming:!0});else if(_.type==="complete")s(j,{text:_.text||z,isStreaming:!1,isLoading:!1}),l(!1);else if(_.type==="error")throw new Error(_.error||"Stream error")}catch(_){De.debug("[useSSEChat] Non-JSON SSE data, treating as text chunk",{data:x,parseError:_}),z+=x,s(j,{text:z,isStreaming:!0})}}}s(j,{text:z,isStreaming:!1,isLoading:!1})}catch(O){if(O.name==="AbortError")return;De.error("[useSSEChat] Error sending message:",O),s(A,{isLoading:!1,text:`${w} (Failed to send)`})}finally{l(!1),c(!1)}},[e,t,r,n,f,i,s]),m=F.useCallback(()=>{d.current?.abort(),l(!1)},[]);return{sendMessage:g,stopStreaming:m,isStreaming:o,inputDisabled:u}}a(Zve,"useSSEChat");function Gve({sessionId:e,agentId:t,serverId:r,channelId:n,onAddMessage:i,onUpdateMessage:s}){const[o,l]=F.useState(!1),[u,c]=F.useState(!1),d=bi();return{sendMessage:F.useCallback(async(g,m)=>{if(!e||!n||!t||!g.trim())return;const w=Bn();c(!0),l(!0);const E={id:w,text:g,name:Fa,senderId:d,isAgent:!1,createdAt:Date.now(),channelId:n,serverId:r,isLoading:!0,attachments:m};i(E);try{const C=await dr().sessions.sendMessage(e,{content:g,transport:"http",attachments:m?.map(O=>({type:NP(O.contentType),url:O.url,name:O.title}))});if(s(w,{isLoading:!1}),C.agentResponse){const O={id:Bn(),text:C.agentResponse.text,name:"Agent",senderId:t,isAgent:!0,createdAt:Date.now(),channelId:n,serverId:r,isLoading:!1,thought:C.agentResponse.thought,actions:C.agentResponse.actions};i(O)}}catch(A){De.error("[useHTTPChat] Error sending message:",A),s(w,{isLoading:!1,text:`${g} (Failed to send)`})}finally{l(!1),c(!1)}},[e,t,r,n,d,i,s]),isLoading:o,inputDisabled:u}}a(Gve,"useHTTPChat");function Vve({channelId:e,serverId:t,agentId:r,chatType:n=It.DM,transport:i="websocket",sessionId:s,onMessageAdded:o,onMessageUpdated:l,onMessageDeleted:u,onMessagesCleared:c,onInputDisabledChange:d,onError:f}){const g=bi(),[m,w]=F.useState(!1),E=Fm(),A=F.useMemo(()=>E.data?.data?.agents??[],[E.data]),{data:C=[],isLoading:O,isError:R,error:P,fetchNextPage:L,hasNextPage:j,isFetchingNextPage:G,addMessage:Z,updateMessage:K,removeMessage:z,clearMessages:V}=kL(e,t),h=F.useCallback(ne=>{Z(ne),o?.(ne)},[Z,o]),y=F.useCallback((ne,Ne)=>{K(ne,Ne),l?.(ne,Ne)},[K,l]),b=F.useCallback(ne=>{z(ne),u?.(ne)},[z,u]),x=F.useCallback(()=>{V(),c?.()},[V,c]),_=F.useCallback(ne=>{w(ne),d?.(ne)},[d]),N=F.useMemo(()=>C.some(ne=>ne.isStreaming),[C]),T=r??e,{sendMessage:k}=Hve({channelId:e,currentUserId:g,contextId:T,chatType:n,allAgents:A,messages:C,onAddMessage:h,onUpdateMessage:a((ne,Ne)=>y(ne,Ne),"onUpdateMessage"),onDeleteMessage:a(ne=>b(ne),"onDeleteMessage"),onClearMessages:x,onInputDisabledChange:_}),{sendMessage:p,isStreaming:S,inputDisabled:I,stopStreaming:M}=Zve({sessionId:s,agentId:r,serverId:t,channelId:e,onAddMessage:h,onUpdateMessage:a((ne,Ne)=>y(ne,Ne),"onUpdateMessage")}),{sendMessage:U,isLoading:B,inputDisabled:H}=Gve({sessionId:s,agentId:r,serverId:t,channelId:e,onAddMessage:h,onUpdateMessage:a((ne,Ne)=>y(ne,Ne),"onUpdateMessage")}),$=F.useCallback(async(ne,Ne)=>{if(!ne.trim()&&!Ne?.attachments?.length)return;const{attachments:ve,messageId:he,source:Se="client",skipOptimisticUpdate:Q=!1,overrideChannelId:se}=Ne||{};try{if(i==="sse"){if(!s)throw new Error("sessionId is required for SSE transport");await p(ne,ve)}else if(i==="http"){if(!s)throw new Error("sessionId is required for HTTP transport");await U(ne,ve)}else{const J=se??e;if(!J)return;const te=he??Bn();if(!Q&&!he){const de={id:te,text:ne,name:Fa,senderId:g,isAgent:!1,createdAt:Date.now(),channelId:J,serverId:t,isLoading:!0,attachments:ve};h(de)}await k(ne,t,Se,ve,te,void 0,J)}}catch(J){De.error("[useElizaChat] Error sending message:",J),f?.(J instanceof Error?J:new Error(String(J)))}},[i,s,e,t,g,k,p,U,h,f]);return{messages:C,isLoading:O,isTyping:i==="sse"?S:i==="http"?B:N,isError:R,inputDisabled:i==="sse"?I:i==="http"?H:m,hasMore:j,isFetchingMore:G,error:P,sendMessage:$,fetchMore:L,clearMessages:x,addMessage:h,updateMessage:y,removeMessage:b,stopStreaming:i==="sse"?M:void 0}}a(Vve,"useElizaChat");const Wve=new Set(["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","avif"]),Yve=new Set(["mp4","webm","mov","avi","mkv","flv","wmv","m4v","ogv"]),Qve={youtube:{patterns:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9_-]{11})/,/(?:https?:\/\/)?(?:www\.)?youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/],getEmbedUrl:a(e=>`https://www.youtube.com/embed/${e}`,"getEmbedUrl")},vimeo:{patterns:[/(?:https?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/],getEmbedUrl:a(e=>`https://player.vimeo.com/video/${e}`,"getEmbedUrl")}};function PU(e){try{return new URL(e).pathname.split(".").pop()?.toLowerCase()||""}catch{return""}}a(PU,"getFileExtension");function $ve(e){const t=PU(e);return Wve.has(t)}a($ve,"isImageUrl");function Xve(e){const t=PU(e);return Yve.has(t)}a(Xve,"isVideoFileUrl");function LU(e){for(const[t,r]of Object.entries(Qve))for(const n of r.patterns){const i=e.match(n);if(i&&i[1])return{platform:t,id:i[1],embedUrl:r.getEmbedUrl(i[1])}}return null}a(LU,"getVideoPlatformInfo");function DU(e){if(!e)return[];const t=/(https?:\/\/[^\s]+)/g;return(e.match(t)||[]).map(n=>{const i=n.replace(/[.,!?;)]*$/,"");if($ve(i))return{url:i,type:"image",isEmbed:!1};if(Xve(i))return{url:i,type:"video",isEmbed:!1};const s=LU(i);return s?{url:s.embedUrl,type:"video",isEmbed:!0}:{url:i,type:"unknown",isEmbed:!1}}).filter(n=>n.type!=="unknown")}a(DU,"parseMediaFromText");function Jve(e,t){let r=e;return t.forEach(n=>{if(n.isEmbed){const i=/(https?:\/\/[^\s]+)/g,s=e.match(i)||[];for(const o of s){const l=o.replace(/[.,!?;)]*$/,""),u=LU(l);if(u&&u.embedUrl===n.url){r=r.replace(o,"").trim();break}}}else r=r.replace(n.url,"").trim()}),r}a(Jve,"removeMediaUrlsFromText");const Lf=15;function jU(e){return(e.includes("TEXT")||e.includes("OBJECT")||e.includes("REASONING"))&&!e.includes("EMBEDDING")&&!e.includes("TRANSCRIPTION")?"LLM":e.includes("EMBEDDING")?"Embedding":e.includes("TRANSCRIPTION")?"Transcription":e.includes("IMAGE")?"Image":"Other"}a(jU,"getModelUsageType");function Kve(e){if(!e)return"Unknown date";const t=new Date(e),r=new Date,n=(r.getTime()-t.getTime())/(1e3*60*60);return n<1?`${Math.floor((r.getTime()-t.getTime())/6e4)}m ago`:n<24?`${Math.floor(n)}h ago`:n<168?t.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}a(Kve,"formatDate");function qve(e=""){return e==="ACTION"?Wy:e.includes("TEXT_EMBEDDING")?lh:e.includes("TRANSCRIPTION")?ro:e.includes("TEXT")||e.includes("OBJECT")?Yy:e.includes("IMAGE")?lz:ET}a(qve,"getModelIcon");function eye(e){if(!e)return null;const{prompt_tokens:t,completion_tokens:r,total_tokens:n}=e;return n?{prompt:t||0,completion:r||0,total:n}:null}a(eye,"formatTokenUsage");function bA(e,t=100){return e.length<=t?e:e.substring(0,t)+"..."}a(bA,"truncateText");function Df(e){navigator.clipboard.writeText(e).catch(console.error)}a(Df,"copyToClipboard");function tye(e){const t={};for(const r of e){const n=r.createdAt||r.timestamp||0,s=new Date(n).toLocaleDateString();t[s]||(t[s]=[]),t[s].push(r)}return t}a(tye,"groupActionsByDate");function rye({action:e,onDelete:t}){const[r,n]=F.useState(!1),[i,s]=F.useState(!1),[o,l]=F.useState(!1),u=e.body?.modelType||"",c=e.body?.modelKey||"",d=e.type||"",f=d==="action",g=e.body?.action||"",m=qve(f?"ACTION":u||d),w=f?"Action":jU(u),E=typeof e.body?.response=="object"?e.body.response:void 0,A=eye(E?.usage||e.body?.usage),C=e.body?.prompts,O=a(()=>{const L=e.body?.params;if(!L&&!C)return null;if(u.includes("TRANSCRIPTION")&&Array.isArray(L))return v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx(ro,{className:"h-3 w-3"}),v.jsx("span",{children:"Audio input data"})]});const{prompt:j,...G}=L||{};return v.jsxs("div",{className:"space-y-4",children:[C&&Array.isArray(C)&&C.length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("div",{className:"flex items-center justify-between",children:v.jsxs("span",{className:"text-xs font-medium text-muted-foreground",children:["Prompts (",C.length,")"]})}),v.jsx("div",{className:"space-y-3",children:C.map((Z,K)=>v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsxs("span",{className:"text-xs text-muted-foreground",children:[Z.modelType||"Prompt"," #",K+1]}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>Df(Z.prompt||""),"onClick"),className:"h-5 px-1 text-xs",title:"Copy prompt",children:v.jsx(aa,{className:"h-3 w-3"})})]}),v.jsx("div",{className:"bg-muted/30 rounded-md p-2",children:v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto",children:Z.prompt})})]},K))})]}),!C&&j&&v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Prompt"}),v.jsxs(nt,{variant:"ghost",size:"sm",onClick:a(()=>Df(j),"onClick"),className:"h-6 px-2 text-xs",title:"Copy prompt",children:[v.jsx(aa,{className:"h-3 w-3 mr-1"}),"Copy"]})]}),v.jsx("div",{className:"bg-muted/30 rounded-md p-3 relative",children:v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto",children:typeof j=="string"?j:JSON.stringify(j,null,2)})})]}),Object.keys(G).length>0&&v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Other Parameters"}),JSON.stringify(G,null,2).length>200?v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>s(!i),"onClick"),className:"h-6 px-2 text-xs",children:i?"Show less":"Show more"}):null]}),v.jsxs("div",{className:"bg-muted/30 rounded-md p-3 relative group",children:[v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto",children:(()=>{const Z=JSON.stringify(G,null,2),K=Z.length>200;return i||!K?Z:bA(Z,200)})()}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>Df(JSON.stringify(G,null,2)),"onClick"),className:"absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy parameters",children:v.jsx(aa,{className:"h-3 w-3"})})]})]})]})},"renderParams"),R=a(()=>{const L=e.body?.response;if(!L)return null;if(L==="[array]")return v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx(vs,{className:"h-3 w-3"}),v.jsx("span",{children:"Array response data"})]});const j=typeof L=="object"?JSON.stringify(L,null,2):String(L),G=j.length>300;return v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Response"}),G&&v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>l(!o),"onClick"),className:"h-6 px-2 text-xs",children:o?"Show less":"Show more"})]}),v.jsxs("div",{className:"bg-muted/30 rounded-md p-3 relative group max-h-64 overflow-y-auto",children:[v.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap overflow-x-auto",children:o||!G?j:bA(j,300)}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>Df(j),"onClick"),className:"absolute top-1 right-1 h-6 w-6 p-0 opacity-0 group-hover:opacity-100 transition-opacity",title:"Copy response",children:v.jsx(aa,{className:"h-3 w-3"})})]})]})},"renderResponse"),P=e.body?.params||e.body?.response||e.message||e.details;return v.jsxs("div",{className:"border rounded-lg bg-card hover:shadow-sm transition-all duration-200 group",children:[v.jsx("div",{className:"p-4 pb-3",children:v.jsxs("div",{className:"flex items-start justify-between",children:[v.jsxs("div",{className:"flex items-start gap-3 flex-1",children:[v.jsx("div",{className:"p-2 rounded-lg bg-muted",children:v.jsx(m,{className:"h-4 w-4 text-muted-foreground"})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx("h4",{className:"font-semibold text-sm",children:f?g:w}),v.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:f?"Action":u||d}),e.body?.promptCount&&e.body.promptCount>1&&v.jsxs(Ri,{variant:"secondary",className:"text-xs px-1.5",children:[e.body.promptCount," prompts"]})]}),v.jsxs("div",{className:"space-y-1",children:[(c||f)&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx(Wy,{className:"h-3 w-3"}),v.jsx("code",{className:"font-mono",children:f?`Action ID: ${e.body?.actionId?.slice(-8)||"N/A"}`:c})]}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx(hp,{className:"h-3 w-3"}),v.jsx("span",{children:Kve(e.createdAt||e.timestamp)}),e.id&&v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"•"}),v.jsx("code",{className:"text-[10px] bg-muted px-1 rounded",children:e.id.slice(-8)})]})]})]}),A&&v.jsxs("div",{className:"flex items-center gap-4 mt-2 text-xs",children:[v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),v.jsx("span",{className:"font-mono",children:A.total.toLocaleString()})]}),A.prompt>0&&v.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[v.jsx("span",{children:"In:"}),v.jsx("span",{className:"font-mono",children:A.prompt.toLocaleString()})]}),A.completion>0&&v.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[v.jsx("span",{children:"Out:"}),v.jsx("span",{className:"font-mono",children:A.completion.toLocaleString()})]})]})]})]}),v.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[P&&v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>n(!r),"onClick"),className:"h-8 w-8 p-0",title:r?"Collapse details":"Expand details",children:r?v.jsx(XA,{className:"h-3 w-3"}):v.jsx(ha,{className:"h-3 w-3"})}),e.id&&t&&v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>{typeof e.id=="string"&&t(e.id)},"onClick"),className:"h-8 w-8 p-0 text-destructive hover:text-destructive",title:"Delete log entry",children:v.jsx(fo,{className:"h-3 w-3"})})]})]})}),r&&P&&v.jsxs(v.Fragment,{children:[v.jsx(ii,{}),v.jsxs("div",{className:"p-4 pt-3 space-y-4",children:[O(),R(),(e.message||e.details)&&v.jsxs("div",{className:"space-y-2",children:[v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Additional Info"}),v.jsxs("div",{className:"bg-muted/30 rounded-md p-3",children:[e.message&&v.jsxs("div",{className:"text-xs mb-2",children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:"Message: "}),v.jsx("span",{children:e.message})]}),e.details&&v.jsxs("div",{className:"text-xs",children:[v.jsx("span",{className:"font-medium text-muted-foreground",children:"Details: "}),v.jsx("span",{children:e.details})]})]})]})]})]}),!r&&P&&v.jsxs(v.Fragment,{children:[v.jsx(ii,{}),v.jsx("div",{className:"p-4 pt-3",children:v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[v.jsx(pi,{className:"h-3 w-3"}),v.jsx("span",{children:(()=>{const L=[];return e.body?.promptCount&&e.body.promptCount>0&&L.push(`${e.body.promptCount} prompt${e.body.promptCount>1?"s":""}`),e.body?.params&&L.push("parameters"),e.body?.response&&L.push("response data"),L.length>0?`Contains ${L.join(" and ")}`:"Contains additional data"})()}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>n(!0),"onClick"),className:"h-5 px-2 text-xs ml-auto",children:"View details"})]})})]})]})}a(rye,"ActionCard");function nye({loadingMore:e,onLoadMore:t}){return v.jsx("div",{className:"flex justify-center py-6",children:e?v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx(ic,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"text-sm",children:"Loading more actions..."})]}):v.jsx(nt,{variant:"outline",onClick:t,className:"px-8",children:"Load More"})})}a(nye,"LoadingIndicator");function iye({selectedType:e,searchQuery:t}){return v.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center p-8",children:[v.jsx(vs,{className:"h-16 w-16 text-muted-foreground/30 mb-4"}),v.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Actions Found"}),v.jsx("p",{className:"text-muted-foreground max-w-md mb-4",children:t?`No actions match "${t}". Try adjusting your search or filter.`:e==="all"?"Actions will appear here once the agent has performed operations.":`No ${e} actions found.`}),t&&v.jsx(nt,{variant:"outline",onClick:a(()=>{},"onClick"),children:"Clear Search"})]})}a(iye,"EmptyState");function aye({agentId:e,roomId:t}){const[r,n]=F.useState("all"),[i,s]=F.useState(""),[o,l]=F.useState(Lf),[u,c]=F.useState(!1),d=F.useRef(null),f=["embedding","text_embedding"],{data:g=[],isLoading:m,error:w}=jae(e,t,f),{mutate:E}=Uae(),{confirm:A,isOpen:C,onOpenChange:O,onConfirm:R,options:P}=Po(),L=g.filter(h=>{if(r!=="all"){const y=h.body?.modelType||"",b=jU(y),x=h.type==="action";switch(r){case"llm":if(b!=="LLM")return!1;break;case"embedding":if(b!=="Embedding")return!1;break;case"transcription":if(b!=="Transcription")return!1;break;case"image":if(b!=="Image")return!1;break;case"other":if(b!=="Other"&&b!=="Unknown"&&!x)return!1;break}}if(i.trim()){const y=i.toLowerCase();return[h.body?.modelType,h.body?.modelKey,h.id,h.message,JSON.stringify(h.body?.params),JSON.stringify(h.body?.response)].filter(Boolean).join(" ").toLowerCase().includes(y)}return!0}),j=F.useCallback(()=>{if(!d.current||u||o>=L.length)return;const{scrollTop:h,scrollHeight:y,clientHeight:b}=d.current;h+b>=y-200&&(c(!0),setTimeout(()=>{l(_=>Math.min(_+Lf,L.length)),c(!1)},500))},[u,o,L.length]);F.useEffect(()=>{l(Lf)},[r,i]),F.useEffect(()=>{const h=d.current;if(h)return h.addEventListener("scroll",j),()=>h.removeEventListener("scroll",j)},[j]);const G=L.slice(0,o),Z=o<L.length,K=tye(G),z=a(h=>{A({title:"Delete Log Entry",description:"Are you sure you want to permanently delete this log entry? This action cannot be undone.",confirmText:"Delete",variant:"destructive"},()=>{E({agentId:e,logId:h})})},"handleDelete"),V=a(()=>{l(h=>h+Lf)},"handleLoadMore");return m&&g.length===0?v.jsx("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:v.jsx("div",{className:"flex items-center justify-center flex-1",children:v.jsxs("div",{className:"flex flex-col items-center gap-4",children:[v.jsx(ic,{className:"h-8 w-8 animate-spin text-muted-foreground"}),v.jsxs("div",{className:"text-center",children:[v.jsx("h3",{className:"font-medium",children:"Loading Actions"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Fetching agent action history..."})]})]})})}):w?v.jsx("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:v.jsx("div",{className:"flex items-center justify-center flex-1",children:v.jsxs("div",{className:"text-center",children:[v.jsx(vs,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),v.jsx("h3",{className:"font-medium text-destructive",children:"Failed to Load Actions"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"There was an error loading the agent actions."})]})})}):v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:[v.jsxs("div",{className:"flex justify-between items-center mb-4 px-4 pt-4 flex-none border-b pb-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h3",{className:"text-lg font-medium",children:" Actions"}),!m&&v.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded bg-muted text-muted-foreground",children:L.length})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(Qc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),v.jsx(Vr,{placeholder:"Search actions...",value:i,onChange:a(h=>s(h.target.value),"onChange"),className:"pl-10 w-64"})]}),v.jsxs(Za,{value:r,onValueChange:a(h=>n(h),"onValueChange"),children:[v.jsx(ca,{className:"w-40",children:v.jsx(Ga,{placeholder:"Filter actions"})}),v.jsxs(da,{children:[v.jsx(lr,{value:"all",children:"All Actions"}),v.jsx(lr,{value:"llm",children:"LLM Calls"}),v.jsx(lr,{value:"embedding",children:"Embeddings"}),v.jsx(lr,{value:"transcription",children:"Transcriptions"}),v.jsx(lr,{value:"image",children:"Image Operations"}),v.jsx(lr,{value:"other",children:"Other"})]})]})]})]}),v.jsx("div",{ref:d,className:"flex-1 overflow-y-auto px-4",children:L.length===0?v.jsx(iye,{selectedType:r,searchQuery:i}):v.jsxs("div",{className:"space-y-4",children:[Object.entries(K).map(([h,y])=>v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center gap-3 py-2",children:[v.jsx(ii,{className:"flex-1"}),v.jsx("span",{className:"text-sm font-medium text-muted-foreground px-2",children:h}),v.jsx(ii,{className:"flex-1"})]}),v.jsx("div",{className:"space-y-3",children:y.map((b,x)=>v.jsx(rye,{action:b,onDelete:z},b.id||x))})]},h)),Z&&v.jsx(nye,{loadingMore:u,onLoadMore:V})]})})]}),v.jsx(Ro,{open:C,onOpenChange:O,title:P?.title||"",description:P?.description||"",confirmText:P?.confirmText,cancelText:P?.cancelText,variant:P?.variant,onConfirm:R})]})}a(aye,"AgentActionViewer");function sye({isOpen:e,onClose:t,memory:r,agentId:n}){const{toast:i}=Er(),{mutate:s,isPending:o}=zae(),{mutate:l,isPending:u}=Bae(),[c,d]=F.useState(""),[f,g]=F.useState(!0),[m,w]=F.useState(!1),[E,A]=F.useState(!1),C=F.useRef(null),O=o||u,R=JSON.stringify(r.content,null,2),{confirm:P,isOpen:L,onOpenChange:j,onConfirm:G,options:Z}=Po();F.useEffect(()=>{e&&(d(R),g(!0),A(!1),w(!1),setTimeout(()=>{C.current?.focus()},100))},[e,R]),F.useEffect(()=>{A(c!==R)},[c,R]),F.useEffect(()=>{if(!c.trim()){g(!1);return}try{JSON.parse(c),g(!0)}catch{g(!1)}},[c]),F.useEffect(()=>{const _=a(N=>{N.key==="Escape"&&e&&(E?P({title:"Discard Unsaved Changes?",description:"You have unsaved changes. Are you sure you want to close without saving?",confirmText:"Discard",variant:"destructive"},()=>{t()}):t())},"handleEscape");return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[e,E,t]);const K=F.useCallback(()=>{if(!c.trim()){i({title:"Error",description:"Memory content cannot be empty",variant:"destructive"});return}if(!f){i({title:"Invalid JSON",description:"Please fix JSON syntax errors before saving",variant:"destructive"});return}try{const _=JSON.parse(c);s({agentId:n,memoryId:r.id,memoryData:{content:_}},{onSuccess:a(()=>{t(),i({title:"Memory Updated",description:"The memory content has been successfully updated"})},"onSuccess"),onError:a(N=>{i({title:"Update Failed",description:N.message||"Failed to update memory",variant:"destructive"})},"onError")})}catch{i({title:"Invalid JSON",description:"Please enter valid JSON format",variant:"destructive"})}},[c,f,s,n,r.id,t,i]),z=F.useCallback(()=>{P({title:"Delete Memory",description:"Are you sure you want to delete this memory? This action cannot be undone.",confirmText:"Delete",variant:"destructive"},()=>{l({agentId:n,memoryId:r.id},{onSuccess:a(()=>{t(),i({title:"Memory Deleted",description:"The memory has been successfully removed"})},"onSuccess"),onError:a(_=>{i({title:"Delete Failed",description:_.message||"Failed to delete memory",variant:"destructive"})},"onError")})})},[l,n,r.id,t,i]),V=F.useCallback(()=>{try{const _=JSON.parse(c);d(JSON.stringify(_,null,2)),i({title:"Formatted",description:"JSON has been formatted"})}catch{i({title:"Format Error",description:"Cannot format invalid JSON",variant:"destructive"})}},[c,i]),h=F.useCallback(()=>{P({title:"Reset Changes",description:"Reset to original content? All unsaved changes will be lost.",confirmText:"Reset",variant:"destructive"},()=>{d(R)})},[R]),y=F.useCallback(async()=>{try{await navigator.clipboard.writeText(c),i({title:"Copied",description:"Content copied to clipboard"})}catch{i({title:"Copy Failed",description:"Failed to copy to clipboard",variant:"destructive"})}},[c,i]),b=a(_=>new Date(_).toLocaleString(),"formatTimestamp"),x=a(_=>{_.target===_.currentTarget&&(E?P({title:"Discard Unsaved Changes?",description:"You have unsaved changes. Are you sure you want to close without saving?",confirmText:"Discard",variant:"destructive"},()=>{t()}):t())},"handleOverlayClick");return e?v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 bg-black/80 flex items-center justify-center z-50 p-4",onClick:x,role:"dialog","aria-modal":"true","aria-labelledby":"memory-edit-title",children:v.jsxs(ya,{className:"w-full max-w-4xl h-[85vh] max-h-[800px] flex flex-col",onClick:a(_=>_.stopPropagation(),"onClick"),children:[v.jsxs(Hm,{className:"flex flex-row items-center justify-between space-y-0 pb-2 flex-shrink-0",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(u2,{id:"memory-edit-title",className:"text-xl font-semibold",children:"Edit Memory Content"}),E&&v.jsx("span",{className:"text-xs px-2 py-1 rounded bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",children:"Unsaved changes"})]}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Close dialog",children:v.jsx(Hn,{className:"h-4 w-4"})})]}),v.jsx(ii,{}),v.jsxs(Lo,{className:"pt-4 flex-1 overflow-hidden flex flex-col",children:[v.jsxs("div",{className:"mb-4 flex items-start bg-amber-50 dark:bg-amber-950/50 border border-amber-200 dark:border-amber-800 rounded-md p-3",children:[v.jsx(uv,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 mr-2 mt-0.5 flex-shrink-0"}),v.jsxs("div",{className:"text-sm text-amber-800 dark:text-amber-200",children:[v.jsx("p",{className:"font-medium mb-1",children:"Editing Raw Memory Content"}),v.jsx("p",{children:"Changes may affect agent behavior. Ensure JSON format is valid before saving."})]})]}),v.jsxs("div",{className:"mb-4 grid grid-cols-1 md:grid-cols-2 gap-2 text-sm",children:[v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-muted-foreground",children:"ID:"}),v.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:r.id})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-muted-foreground",children:"Created:"}),v.jsx("span",{children:b(r.createdAt||0)})]})]}),v.jsxs("div",{className:"space-y-1",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-muted-foreground",children:"Room:"}),v.jsx("code",{className:"text-xs bg-muted px-1 rounded",children:r.roomId})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"text-muted-foreground",children:"Type:"}),v.jsx("span",{className:`text-xs px-2 py-1 rounded-full ${r.entityId===n?"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200":"bg-white-100 text-white dark:bg-white-800 dark:text-white"}`,children:r.entityId===n?"Agent Message":"User Message"})]})]})]}),v.jsxs("div",{className:"flex items-center justify-between mb-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("label",{htmlFor:"memory-content",className:"text-sm font-medium",children:"Memory Content"}),v.jsxs("div",{className:"flex items-center gap-1",children:[f?v.jsx(Va,{className:"h-3 w-3 text-green-500"}):v.jsx(uv,{className:"h-3 w-3 text-red-500"}),v.jsx("span",{className:`text-xs ${f?"text-green-600":"text-red-600"}`,children:f?"Valid JSON":"Invalid JSON"})]})]}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(nt,{variant:"outline",size:"sm",onClick:a(()=>w(!m),"onClick"),disabled:O,title:m?"Switch to edit mode":"Switch to preview mode",children:m?v.jsx(ja,{className:"h-3 w-3"}):v.jsx(na,{className:"h-3 w-3"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:y,disabled:O,title:"Copy to clipboard",children:v.jsx(aa,{className:"h-3 w-3"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:V,disabled:O||!f,title:"Format JSON",children:"Format"}),v.jsx(nt,{variant:"outline",size:"sm",onClick:h,disabled:O||!E,title:"Reset to original",children:v.jsx(oT,{className:"h-3 w-3"})})]})]}),v.jsxs("div",{className:"flex-1 min-h-0 flex flex-col",children:[m?v.jsx("div",{className:"flex-1 border rounded-md p-3 bg-muted/50 overflow-auto",children:v.jsx("pre",{className:"text-sm whitespace-pre-wrap",children:f?JSON.stringify(JSON.parse(c),null,2):c})}):v.jsx(kd,{ref:C,id:"memory-content",value:c,onChange:a(_=>d(_.target.value),"onChange"),className:`flex-1 resize-none font-mono text-sm min-h-[300px] ${f?"":"border-red-300 focus:border-red-500"}`,placeholder:"Memory content in JSON format...",disabled:O,"aria-describedby":"json-help"}),v.jsx("p",{id:"json-help",className:"text-xs text-muted-foreground mt-2 flex-shrink-0",children:"Edit the JSON directly. Use Ctrl+A to select all, Ctrl+Z to undo."})]})]}),v.jsxs(Zm,{className:"flex justify-between flex-shrink-0",children:[v.jsxs(nt,{variant:"destructive",onClick:z,disabled:O,children:[v.jsx(Yc,{className:"mr-2 h-4 w-4"}),"Delete Memory"]}),v.jsxs("div",{className:"flex gap-2",children:[v.jsx(nt,{variant:"outline",onClick:t,disabled:O,children:"Cancel"}),v.jsxs(nt,{onClick:K,disabled:O||!f||!E,children:[v.jsx(lT,{className:"mr-2 h-4 w-4"}),o?"Saving...":"Save Changes"]})]})]})]})}),v.jsx(Ro,{open:L,onOpenChange:j,title:Z?.title||"",description:Z?.description||"",confirmText:Z?.confirmText,cancelText:Z?.cancelText,variant:Z?.variant,onConfirm:G})]}):null}a(sye,"MemoryEditOverlay");const jf=15;function oye({agentId:e,agentName:t,channelId:r}){const[n,i]=F.useState("all"),[s,o]=F.useState(""),[l,u]=F.useState(null),[c,d]=F.useState(jf),[f,g]=F.useState(!1),m=F.useRef(null),{data:w}=Fm(),E=n==="facts"?void 0:"messages",A=n==="facts"||n==="all"?"facts":void 0,C=n==="currentChat"&&r?r:void 0,{data:O=[],isLoading:R,error:P}=GS(e,E,C),{data:L=[],isLoading:j,error:G}=GS(e,A,C),Z=[...O,...L],K=R||j,z=P||G,V=Z.filter(I=>{if(n!=="all"&&n!=="currentChat"){if(n==="facts")return!0;if(n==="messagesSent"&&I.entityId!==I.agentId||n==="messagesReceived"&&I.entityId===I.agentId)return!1}if(s.trim()){const M=s.toLowerCase(),U=I.content;return[U?.text,U?.thought,I.id,I.metadata].filter(Boolean).join(" ").toLowerCase().includes(M)}return!0}),h=F.useCallback(()=>{if(!m.current||f||c>=V.length)return;const{scrollTop:I,scrollHeight:M,clientHeight:U}=m.current;I+U>=M-200&&(g(!0),setTimeout(()=>{d(H=>Math.min(H+jf,V.length)),g(!1)},500))},[f,c,V.length]);F.useEffect(()=>{d(jf)},[n,s]),F.useEffect(()=>{const I=m.current;if(I)return I.addEventListener("scroll",h),()=>I.removeEventListener("scroll",h)},[h]);const y=a(I=>{const M=new Date(I),B=(new Date().getTime()-M.getTime())/(1e3*60*60);return B<24?M.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):B<168?M.toLocaleDateString([],{weekday:"short",hour:"2-digit",minute:"2-digit"}):M.toLocaleDateString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},"formatDate"),b=a((I,M)=>M?.thought?lh:I.entityId===I.agentId?Yy:ST,"getMemoryIcon"),x=a(async I=>{try{await navigator.clipboard.writeText(I)}catch(M){console.error("Failed to copy:",M)}},"copyToClipboard"),_=a(I=>{const M={};for(const U of I){const H=new Date(U.createdAt||0).toLocaleDateString();M[H]||(M[H]=[]),M[H].push(U)}return M},"groupMessagesByDate"),N=V.slice(0,c),T=c<V.length,k=_(N);if(K&&Z.length===0)return v.jsx("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:v.jsx("div",{className:"flex items-center justify-center flex-1",children:v.jsxs("div",{className:"flex flex-col items-center gap-4",children:[v.jsx(ic,{className:"h-8 w-8 animate-spin text-muted-foreground"}),v.jsxs("div",{className:"text-center",children:[v.jsx("h3",{className:"font-medium",children:"Loading Memories"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"Fetching agent conversation history..."})]})]})})});if(z)return v.jsx("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:v.jsx("div",{className:"flex items-center justify-center flex-1",children:v.jsxs("div",{className:"text-center",children:[v.jsx(vs,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),v.jsx("h3",{className:"font-medium text-destructive",children:"Failed to Load Memories"}),v.jsx("p",{className:"text-sm text-muted-foreground",children:"There was an error loading the agent memories."})]})})});const p=a(()=>v.jsxs("div",{className:"flex flex-col items-center justify-center flex-1 text-center p-8",children:[v.jsx(vs,{className:"h-16 w-16 text-muted-foreground/30 mb-4"}),v.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Memories Found"}),v.jsx("p",{className:"text-muted-foreground max-w-md mb-4",children:s?`No memories match "${s}". Try adjusting your search or filter.`:"This agent hasn't created any memories yet. Memories will appear here as the agent interacts."}),s&&v.jsx(nt,{variant:"outline",onClick:a(()=>o(""),"onClick"),children:"Clear Search"})]}),"EmptyState"),S=a(({memory:I})=>{const M=I.content,U=b(I,M),B=I.entityId===I.agentId,$=a(()=>{if(B)return w?.data?.agents?.find(ie=>ie.id===I.entityId)?.name||t;{const ae=I.metadata;return ae?.raw?.senderName||ae?.source||"User"}},"getEntityName")();return v.jsxs("div",{className:"border rounded-lg p-4 bg-card hover:bg-accent/5 transition-colors group",children:[v.jsxs("div",{className:"flex items-start justify-between mb-3",children:[v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx("div",{className:"p-2 rounded-md bg-muted",children:v.jsx(U,{className:"h-4 w-4"})}),v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("span",{className:"font-medium text-sm",children:$}),v.jsx("span",{className:"text-xs px-2 py-0.5 rounded bg-muted text-muted-foreground",children:M?.thought?"Thought":B?"Agent":"User"})]}),v.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mt-1",children:[v.jsx(hp,{className:"h-3 w-3"}),v.jsx("span",{children:y(I.createdAt||0)}),I.id&&v.jsxs(v.Fragment,{children:[v.jsx("span",{children:"•"}),v.jsx("code",{className:"text-[10px] bg-muted px-1 rounded",children:I.id.slice(-8)})]})]})]})]}),v.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[M?.text&&v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>x(M.text||""),"onClick"),className:"h-8 w-8 p-0",title:"Copy text",children:v.jsx(aa,{className:"h-3 w-3"})}),I.id&&v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>u(I),"onClick"),className:"h-8 w-8 p-0",title:"Edit memory",children:v.jsx(uz,{className:"h-3 w-3"})})]})]}),v.jsxs("div",{className:"space-y-3",children:[M?.text&&v.jsx("div",{className:"bg-muted/50 rounded-md p-3",children:v.jsx("p",{className:"text-sm leading-relaxed whitespace-pre-wrap",children:M.text})}),M?.thought&&v.jsxs("div",{className:"border-l-2 border-muted pl-3",children:[v.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[v.jsx(lh,{className:"h-3 w-3 text-muted-foreground"}),v.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:"Thought Process"})]}),v.jsx("p",{className:"text-xs text-muted-foreground italic leading-relaxed",children:String(M.thought)})]}),(M?.actions||M?.providers||M?.source)&&v.jsxs("div",{className:"flex flex-wrap gap-1",children:[M.actions?.map(ae=>v.jsx("span",{className:"text-xs px-2 py-1 bg-muted rounded text-muted-foreground",title:"Action",children:ae},ae)),M.providers?.map(ae=>v.jsx("span",{className:"text-xs px-2 py-1 bg-muted rounded text-muted-foreground",title:"Provider",children:ae},ae)),M.source&&v.jsx("span",{className:"text-xs px-2 py-1 bg-muted rounded text-muted-foreground",children:M.source})]}),I.metadata&&Object.keys(I.metadata).length>0&&v.jsxs("details",{className:"text-xs",children:[v.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground",children:"View metadata"}),v.jsx("div",{className:"mt-2 p-2 bg-muted/30 rounded text-[10px] font-mono overflow-x-auto",children:v.jsx("pre",{children:JSON.stringify(I.metadata,null,2)})})]})]})]})},"MemoryCard");return v.jsxs("div",{className:"flex flex-col h-[calc(100vh-100px)] min-h-[400px] w-full",children:[v.jsxs("div",{className:"flex justify-between items-center mb-4 px-4 pt-4 flex-none border-b pb-3",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h3",{className:"text-lg font-medium",children:"Memories"}),!K&&v.jsx("span",{className:"ml-2 text-xs px-2 py-1 rounded bg-muted text-muted-foreground",children:V.length})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("div",{className:"relative",children:[v.jsx(Qc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),v.jsx(Vr,{placeholder:"Search memories...",value:s,onChange:a(I=>o(I.target.value),"onChange"),className:"pl-10 w-full min-w-0 max-w-64"})]}),v.jsxs(Za,{value:n,onValueChange:a(I=>i(I),"onValueChange"),children:[v.jsx(ca,{className:"w-40",children:v.jsx(Ga,{placeholder:"Filter memories"})}),v.jsxs(da,{children:[v.jsx(lr,{value:"all",children:"All Messages"}),r&&v.jsx(lr,{value:"currentChat",children:"Current Chat"}),v.jsx(lr,{value:"messagesSent",children:"Agent Messages"}),v.jsx(lr,{value:"messagesReceived",children:"User Messages"}),v.jsx(lr,{value:"facts",children:"Facts"})]})]})]})]}),v.jsx("div",{ref:m,className:"flex-1 overflow-y-auto px-4",children:V.length===0?v.jsx(p,{}):v.jsxs("div",{className:"space-y-4",children:[Object.entries(k).map(([I,M])=>v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex items-center gap-3 py-2",children:[v.jsx(ii,{className:"flex-1"}),v.jsx("span",{className:"text-sm font-medium text-muted-foreground px-2",children:I}),v.jsx(ii,{className:"flex-1"})]}),v.jsx("div",{className:"space-y-3",children:M.map(U=>v.jsx(S,{memory:U},U.id||U.createdAt))})]},I)),T&&v.jsx("div",{className:"flex justify-center py-6",children:f?v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx(ic,{className:"h-4 w-4 animate-spin"}),v.jsx("span",{className:"text-sm",children:"Loading more memories..."})]}):v.jsx(nt,{variant:"outline",onClick:a(()=>d(I=>I+jf),"onClick"),className:"px-8",children:"Load More"})})]})}),l&&v.jsx(sye,{isOpen:!!l,onClose:a(()=>u(null),"onClose"),memory:l,agentId:e})]})}a(oye,"AgentMemoryViewer");function UU(e){const[t,r]=F.useState(!1),{toast:n}=Er(),i=mn(),s=an();return{handleDelete:F.useCallback(async()=>{r(!0),n({title:"Deleting...",description:`Deleting agent "${e.name}"`});let l=!1,u=null;try{u=setTimeout(()=>{l||(s.invalidateQueries({queryKey:["agents"]}),i("/"),n({title:"Note",description:"Deletion is still processing in the background."}))},8e3);const c=dr();if(!e.id)throw new Error("Agent ID is required for deletion");const d=await c.agents.deleteAgent(e.id);l=!0,u&&clearTimeout(u),!1||n({title:"Success",description:"Agent deleted successfully"}),s.invalidateQueries({queryKey:["agents"]}),i("/")}catch(c){l=!0,u&&clearTimeout(u);const d=c instanceof Error?c.message:"Failed to delete agent",f=c&&typeof c=="object"?c:null,g=f?.statusCode||f?.response?.status;g===409||d.includes("409")||d.includes("Conflict")||d.includes("foreign key constraint")||d.includes("active references")?n({title:"Cannot Delete",description:"This agent cannot be deleted because it has active references. Try stopping the agent first.",variant:"destructive"}):g===408||g===504||d.includes("408")||d.includes("504")||d.includes("timeout")||d.includes("timed out")?(n({title:"Operation Timeout",description:"The deletion is taking longer than expected and will continue in the background.",variant:"destructive"}),s.invalidateQueries({queryKey:["agents"]}),i("/")):n({title:"Error",description:d,variant:"destructive"})}finally{r(!1)}},[e,n,i,s]),isDeleting:t}}a(UU,"useDeleteAgent");function BU({agent:e,agentId:t,onSaveComplete:r}){const{toast:n}=Er(),i=mn(),s=an(),{confirm:o,isOpen:l,onOpenChange:u,onConfirm:c,options:d}=Po(),f=e?.status===zn.ACTIVE,g=F.useRef(null),[m,w]=F.useState({}),{handleDelete:E,isDeleting:A}=UU(e),C=eL(e),{stopAgent:O,isAgentStopping:R}=Md(),P=a(async()=>{try{await O(e),n({title:"Success",description:"Agent stopped successfully"})}catch(G){n({title:"Error",description:G instanceof Error?G.message:"Failed to stop agent",variant:"destructive"})}},"handleStopAgent"),L=a(async()=>{if(!t){n({title:"Error",description:"Agent ID is missing",variant:"destructive"});return}const G=a(async()=>{try{const Z=dr(),K=Object.keys(m).length>0?m:g.current?.getSecrets()||{},z=C.getChangedFields();if(K&&Object.keys(K).length>0){z.settings||(z.settings={});const h=Object.entries(K).filter(([y,b])=>b!==null).reduce((y,[b,x])=>({...y,[b]:x}),{});z.settings.secrets=h}if(Object.keys(z).length===0){const h=C.agent?.settings?.secrets;if(h&&Object.keys(h).length>0){const y={id:t,settings:{secrets:h}};await Z.agents.updateAgent(t,y),s.invalidateQueries({queryKey:["agent",t]}),s.invalidateQueries({queryKey:["agents"]}),n({title:"Success",description:"Agent secrets updated successfully"}),r?r():i("/");return}n({title:"No Changes",description:"No changes were made to the agent"}),r?r():i("/");return}const V={id:t,...z};await Z.agents.updateAgent(t,V),s.invalidateQueries({queryKey:["agent",t]}),s.invalidateQueries({queryKey:["agents"]}),n({title:"Success",description:"Agent updated successfully"}),r?r():i("/")}catch(Z){throw n({title:"Error",description:Z instanceof Error?Z.message:"Failed to update agent",variant:"destructive"}),Z}},"performSave");if(g?.current){const Z=g.current.validateSecrets();if(!Z.isValid){o({title:"Missing Required Secrets",description:`The following required secrets are missing: ${Z.missingSecrets.join(", ")}. Do you want to save anyway?`,confirmText:"Save Anyway",cancelText:"Cancel",variant:"destructive"},G);return}}await G()},"handleSubmit"),j=a(()=>{A||o({title:"Delete Agent",description:`Are you sure you want to delete the agent "${e.name}"? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},E)},"handleDelete");return v.jsxs(v.Fragment,{children:[v.jsx(QP,{characterValue:C.agent,setCharacterValue:C,title:"Agent Settings",description:"Configure your AI agent's behaviour and capabilities.",onSubmit:L,onReset:C.reset,onDelete:j,onStopAgent:f?P:void 0,isAgent:!0,isDeleting:A,isStopping:R(t),customComponents:[{name:"Plugins",component:v.jsx(JP,{characterValue:C.agent,setCharacterValue:C,initialPlugins:e.plugins})},{name:"Secret",component:v.jsx(Q_,{characterValue:C.agent,ref:g,onChange:a(G=>{w(G),C.updateSettings({secrets:G})},"onChange")})},{name:"Avatar",component:v.jsx($P,{characterValue:C.agent,setCharacterValue:C})}]}),v.jsx(Ro,{open:l,onOpenChange:u,title:d?.title||"",description:d?.description||"",confirmText:d?.confirmText,cancelText:d?.cancelText,variant:d?.variant,onConfirm:c})]})}a(BU,"AgentSettings");const vA="eliza-agent-tab-states";function lye(e){const[t,r]=F.useState("details"),n=F.useCallback(()=>{try{const o=localStorage.getItem(vA);return o?JSON.parse(o):{}}catch(o){return De.error("Error reading agent tab states from localStorage:",o),{}}},[]),i=F.useCallback(o=>{try{localStorage.setItem(vA,JSON.stringify(o))}catch(l){De.error("Error saving agent tab states to localStorage:",l)}},[]);F.useEffect(()=>{if(!e){r("details");return}const l=n()[e]||"details";r(l)},[e,n]);const s=F.useCallback(o=>{if(r(o),e){const u={...n(),[e]:o};i(u)}},[e,n,i]);return{currentTab:t,setTab:s}}a(lye,"useAgentTabState");class uye{static{a(this,"ElizaSpanAdapter")}convertRunDetailToTraceSpans(t){const r=t.events;if(!r||r.length===0)return[];const n=[...r].sort((l,u)=>l.timestamp-u.timestamp),i=new Map,s=new Map,o=[];return n.forEach((l,u)=>{switch(l.type){case"RUN_STARTED":{const c=this.createRunSpan(t,l);o.push(c);break}case"ACTION_STARTED":{const c=l.data.actionName||l.data.actionId||`Action ${u}`,d=l.data.actionId||c;let f=i.get(d);f||(f={id:`action-${d}`,title:c,type:"agent_invocation",status:"pending",startTime:new Date(l.timestamp),endTime:new Date(l.timestamp),duration:0,raw:JSON.stringify(l,null,2),attributes:this.convertEventDataToAttributes(l.data),children:[]},i.set(d,f),o.push(f));const g=(f.children?.length||0)+1,m={id:`attempt-${d}-${g}`,title:`Attempt ${g}`,type:"span",status:"pending",startTime:new Date(l.timestamp),endTime:new Date(l.timestamp),duration:0,raw:JSON.stringify(l,null,2),attributes:this.convertEventDataToAttributes(l.data),children:[]};f.children=[...f.children||[],m],s.set(d,m);break}case"ACTION_COMPLETED":{const c=l.data.actionName||l.data.actionId||`Action ${u}`,d=l.data.actionId||c,f=i.get(d),g=s.get(d),m=this.extractPrompt(l.data),w=this.extractResponse(l.data);if(g){const E=l.data.success!==!1;g.status=E?"success":"error",g.endTime=new Date(l.timestamp),g.duration=l.timestamp-g.startTime.getTime(),m&&(g.input=m),w&&(g.output=w),s.delete(d)}if(f){const E=l.data.success!==!1;f.status=E?"success":"error",f.endTime=new Date(l.timestamp),f.duration=l.timestamp-f.startTime.getTime(),m&&!f.input&&(f.input=m),w&&!f.output&&(f.output=w)}break}case"MODEL_USED":{const c=l.data.modelType||"Model Call",d=this.extractPrompt(l.data),f=this.extractResponse(l.data),g={id:`model-${u}`,title:c,type:"llm_call",status:"success",startTime:new Date(l.timestamp),endTime:new Date(l.timestamp+(l.data.executionTime||0)),duration:l.data.executionTime||0,raw:JSON.stringify(l,null,2),attributes:this.convertEventDataToAttributes(l.data),input:d,output:f,tokensCount:this.extractTokensCount(l.data),cost:this.extractCost(l.data)},w=l.data.actionContext||void 0||Array.from(s.keys()).pop();if(w){const E=s.get(w);if(E)E.children=[...E.children||[],g];else{const A=i.get(w);if(A&&A.children&&A.children.length>0){const C=A.children[A.children.length-1];C.children=[...C.children||[],g]}}}else o.push(g);break}case"EVALUATOR_COMPLETED":{const c=l.data.evaluatorName||`Evaluator ${u}`,d={id:`evaluator-${u}`,title:c,type:"chain_operation",status:"success",startTime:new Date(l.timestamp),endTime:new Date(l.timestamp),duration:0,raw:JSON.stringify(l,null,2),attributes:this.convertEventDataToAttributes(l.data)};o.push(d);break}case"EMBEDDING_EVENT":{const c=l.data.status||"completed",d={id:`embedding-${u}`,title:`Embedding ${c}`,type:"embedding",status:c==="failed"?"error":"success",startTime:new Date(l.timestamp),endTime:new Date(l.timestamp+(l.data.durationMs||0)),duration:l.data.durationMs||0,raw:JSON.stringify(l,null,2),attributes:this.convertEventDataToAttributes(l.data)},f=Array.from(s.keys()).pop();if(f){const g=s.get(f);g&&(g.children=[...g.children||[],d])}else o.push(d);break}}}),o}createRunSpan(t,r){const n=t.summary,i=n.durationMs||0,s=new Date(r.timestamp),o=new Date(r.timestamp+i);return{id:n.runId,title:`Run ${new Date(n.startedAt||Date.now()).toLocaleTimeString()}`,type:"agent_invocation",status:this.convertRunStatus(n.status),startTime:s,endTime:o,duration:i,raw:JSON.stringify(t,null,2),attributes:[{key:"run.id",value:{stringValue:n.runId}},{key:"run.status",value:{stringValue:n.status}},...n.messageId?[{key:"message.id",value:{stringValue:n.messageId}}]:[],...n.roomId?[{key:"room.id",value:{stringValue:n.roomId}}]:[]],children:[]}}convertRunStatus(t){switch(t){case"completed":return"success";case"error":return"error";case"timeout":return"warning";case"started":return"pending";default:return"pending"}}convertEventDataToAttributes(t){return Object.entries(t).map(([r,n])=>({key:r,value:this.convertValueToAttributeValue(n)}))}convertValueToAttributeValue(t){return typeof t=="string"?{stringValue:t}:typeof t=="number"?{intValue:t.toString()}:typeof t=="boolean"?{boolValue:t}:{stringValue:JSON.stringify(t)}}coerceToNumber(t){if(typeof t=="number")return Number.isFinite(t)?t:void 0;if(typeof t=="string"){const r=Number(t);return Number.isFinite(r)?r:void 0}}extractTokensCount(t){const r=Object.prototype.hasOwnProperty.call(t,"inputTokens"),n=Object.prototype.hasOwnProperty.call(t,"outputTokens");if(r||n){const o=this.coerceToNumber(t.inputTokens)??0,l=this.coerceToNumber(t.outputTokens)??0;return o+l}const i=a(o=>{if(!o||typeof o!="object")return;const l=o,u=this.coerceToNumber(l.total_tokens);if(u!==void 0)return u;const c=Object.prototype.hasOwnProperty.call(l,"prompt_tokens"),d=Object.prototype.hasOwnProperty.call(l,"completion_tokens");if(c||d){const f=this.coerceToNumber(l.prompt_tokens)??0,g=this.coerceToNumber(l.completion_tokens)??0;return f+g}},"extractFromUsage");if(t.response&&typeof t.response=="object"){const o=t.response,l=i(o.usage);if(l!==void 0)return l}const s=i(t.usage);if(s!==void 0)return s}extractCost(t){if(t.cost&&typeof t.cost=="number")return t.cost;if(t.response&&typeof t.response=="object"){const r=t.response;if(r.cost&&typeof r.cost=="number")return r.cost}}extractPrompt(t){if(t.prompts&&Array.isArray(t.prompts)){const r=t.prompts;if(r.length>0)return r.map((n,i)=>(r.length>1?`[Prompt ${i+1}${n.modelType?` - ${n.modelType}`:""}]
@@ -379,9 +379,9 @@ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error
379
379
  text-muted-foreground hover:text-foreground data-[state=active]:text-foreground
380
380
  dark:hover:text-gray-200 dark:data-[state=active]:text-gray-200
381
381
  hover:bg-accent data-[state=active]:bg-card data-[state=active]:shadow-sm
382
- dark:hover:bg-gray-700 dark:data-[state=active]:bg-gray-600 dark:data-[state=active]:shadow-none`}},$U=a(({items:e,defaultValue:t,value:r,onValueChange:n,theme:i="underline",className:s="",tabsListClassName:o="",triggerClassName:l="",dir:u,...c})=>{const d=t||e[0]?.value,f=bye[i];return v.jsx(HA,{className:s,defaultValue:r?void 0:d,value:r,onValueChange:n,dir:u,...c,children:v.jsx(By,{className:Ue(f.list,o),"aria-label":"Navigation tabs",children:e.map(g=>v.jsxs(zy,{value:g.value,disabled:g.disabled,className:Ue("flex items-center overflow-hidden",f.trigger,l),children:[g.icon&&v.jsx("span",{className:"mr-2 text-muted-foreground group-data-[state=active]:text-current ",children:g.icon}),v.jsx("span",{className:"truncate",children:g.label})]},g.value))})})},"Tabs"),XU=a(({title:e,rightContent:t,children:r,defaultOpen:n=!1,className:i="",triggerClassName:s="",contentClassName:o="",onOpenChange:l})=>{const[u,c]=F.useState(n),d=F.useCallback(g=>{c(g),l?.(g)},[l]),f=F.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(!u))},[d,u]);return v.jsxs(Vy,{open:u,onOpenChange:d,className:Ue("rounded-lg",i),children:[v.jsx(kT,{asChild:!0,children:v.jsxs("div",{tabIndex:0,role:"button",className:Ue("mb-1 flex w-full items-center justify-between gap-2 rounded-lg px-1 py-3 text-left text-sm font-medium text-foreground",s),onKeyDown:f,"aria-expanded":u,"aria-label":`${u?"Collapse":"Expand"} content of "${e}" section`,children:[v.jsxs("div",{className:"flex w-full items-center gap-2",children:[v.jsx(ha,{className:Ue("h-3 w-3 text-muted-foreground transition-transform duration-200",u&&"rotate-180")}),v.jsx("span",{className:"truncate",children:e})]}),t]})}),v.jsx(AT,{className:Ue("data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown",o),children:r})]})},"CollapsibleSection"),EA="absolute top-1/2 -translate-y-1/2 flex items-center justify-center text-foreground",JU=a(({className:e,onChange:t,onValueChange:r,startIcon:n,onClear:i,ref:s,inputClassName:o,label:l,hideLabel:u=!1,id:c,...d})=>{const f=F.useRef(null),g=a(w=>{t?.(w),r?.(w.target.value)},"handleChange"),m=a(()=>{if(i?.(),s){s.current?.focus();return}f.current?.focus()},"handleClear");return v.jsxs("div",{className:Ue("w-full",e),children:[l&&v.jsx("label",{htmlFor:c,className:Ue("block text-sm font-medium text-foreground ",u&&"sr-only"),children:l}),v.jsxs("div",{className:Ue("relative flex w-full items-center justify-center",l&&!u&&"mt-1"),children:[v.jsx("input",{id:c,ref:s||f,onChange:g,className:Ue(o,"flex h-7 items-center truncate","w-full px-2",!!n&&"pl-8",!!i&&"pr-8","rounded border border-border bg-transparent ","text-foreground placeholder:text-muted-foreground ","hover:border-border dark:hover:border-gray-700"),...d}),n&&v.jsx("div",{className:Ue(EA,"left-2"),"aria-hidden":!0,children:n}),i&&d.value&&v.jsx("button",{className:Ue(EA,"right-2"),"aria-label":"Clear input value",onClick:m,type:"button",children:v.jsx(Hn,{className:"size-4"})})]})]})},"TextInput"),vye=a(({data:e})=>v.jsxs("div",{className:"space-y-6",children:[(!e.attributes||e.attributes.length===0)&&v.jsx("div",{className:"p-6 text-center",children:v.jsx("p",{className:"text-muted-foreground ",children:"No attributes available for this span."})}),(e.attributes||[]).map((t,r)=>{const n=t.value.stringValue||t.value.intValue||t.value.boolValue?.toString()||"N/A";return v.jsx(XU,{title:t.key,defaultOpen:!0,children:v.jsx(JU,{id:`${e.id}-attribute-${r}`,value:n,disabled:!0,readOnly:!0,inputClassName:"font-mono text-xs",className:"w-full"})},`${t.key}-${r}`)})]}),"DetailsViewAttributesTab"),yye={4:"size-4 text-xs",6:"size-6 text-xs",8:"size-8 text-xs",9:"size-9 text-sm",10:"size-10 text-base",11:"size-11 text-lg",12:"size-12 text-xl",16:"size-16 text-2xl"},wye={4:"size-3",6:"size-4",8:"size-6",9:"size-7",10:"size-8",11:"size-9",12:"size-10",16:"size-12"},xye={4:"text-xs",6:"text-xs",8:"text-xs",9:"text-sm",10:"text-base",11:"text-lg",12:"text-xl",16:"text-2xl"},_ye={gray:"bg-muted-foreground",red:"bg-destructive",orange:"bg-chart-1",yellow:"bg-chart-5",teal:"bg-chart-2",indigo:"bg-primary",purple:"bg-primary",sky:"bg-chart-4",cyan:"bg-chart-3",emerald:"bg-accent"},q2=a(({src:e,alt:t="Avatar",size:r="10",rounded:n="full",bgColor:i="gray",textColor:s="white",letter:o,className:l="",...u})=>{const[c,d]=F.useState(!1),f=o?o.charAt(0):t.charAt(0).toUpperCase(),g=s==="white"?"text-white":"text-black";return v.jsx("div",{className:Ue("flex items-center justify-center overflow-hidden","bg-muted",c&&"border border-border",yye[r],xye[r],GU[n],l),...u,children:c?v.jsx(ST,{className:Ue(wye[r],"text-muted-foreground")}):v.jsx(v.Fragment,{children:e?v.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:a(()=>d(!0),"onError")}):v.jsx("div",{className:Ue("flex h-full w-full items-center justify-center",_ye[i],g,"font-medium"),children:f})})})},"Avatar"),Eye={success:"bg-green-500 dark:bg-green-500",error:"bg-red-500 dark:bg-red-500",pending:"bg-violet-500 dark:bg-violet-500",warning:"bg-yellow-500 dark:bg-yellow-500"},Sye={success:"bg-green-100 dark:bg-green-950 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-950 text-red-600 dark:text-red-400",pending:"bg-violet-100 dark:bg-violet-950 text-violet-600 dark:text-violet-400",warning:"bg-yellow-100 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-400"},Uy=a(({status:e,variant:t="dot",...r})=>{const n=`Status: ${e}`;return v.jsx("div",{className:"flex size-4 items-center justify-center",...r,children:t==="dot"?v.jsx(kye,{status:e,title:n}):v.jsx(Aye,{status:e,title:n})})},"SpanStatus"),kye=a(({status:e,title:t})=>v.jsx("span",{className:Ue("block size-1.5 rounded-full",Eye[e]),"aria-label":t,title:t}),"SpanStatusDot"),Aye=a(({status:e,title:t})=>v.jsxs("span",{className:Ue("inline-flex items-center justify-center","h-3.5 w-4 rounded",Sye[e]),"aria-label":t,title:t,children:[e==="success"&&v.jsx(Va,{className:"size-2.5","aria-hidden":!0}),e==="error"&&v.jsx(uv,{className:"size-2.5","aria-hidden":!0}),e==="warning"&&v.jsx(Hy,{className:"size-2.5","aria-hidden":!0}),e==="pending"&&v.jsx(Gy,{className:"size-2.5","aria-hidden":!0})]}),"SpanStatusBadge"),Tye=a(({data:e,avatar:t,copyButton:r,actions:n,className:i="mb-4 flex flex-wrap items-center gap-4"})=>{const[s,o]=F.useState(!1),l=a(()=>{r?.onCopy&&(r.onCopy(e),o(!0),setTimeout(()=>o(!1),2e3))},"handleCopy");return v.jsxs("div",{className:i,children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&v.jsx(q2,{size:"4",...t}),v.jsx("span",{className:"text-base tracking-wide text-foreground ",children:e.title}),v.jsx("div",{className:"flex size-5 items-center justify-center",children:v.jsx(Uy,{status:e.status})}),r&&v.jsx(h0,{"aria-label":r.isEnabled?"Copy span details":"Copy disabled",variant:"ghost",onClick:l,children:s?v.jsx(Va,{className:"size-3 text-muted-foreground"}):v.jsx(aa,{className:"size-3 text-muted-foreground"})})]}),n]})},"DetailsViewHeader"),Nye=a(({data:e})=>{const t=!!e.input,r=!!e.output;if(!t&&!r)return v.jsx("div",{className:"p-6 text-center",children:v.jsx("p",{className:"text-muted-foreground ",children:"No input or output data available for this span."})});let n=null,i=null;if(typeof e.input=="string")try{n=JSON.parse(e.input)}catch{n=null}if(typeof e.output=="string")try{i=JSON.parse(e.output)}catch{i=null}return v.jsxs("div",{className:"space-y-3",children:[typeof e.input=="string"&&v.jsx(SA,{section:"Input",content:e.input,parsedContent:n}),typeof e.output=="string"&&v.jsx(SA,{section:"Output",content:e.output,parsedContent:i})]})},"DetailsViewInputOutputTab"),SA=a(({section:e,content:t,parsedContent:r})=>{const[n,i]=F.useState("plain"),[s,o]=F.useState(!0),l=[{value:"json",label:"JSON",disabled:!r},{value:"plain",label:"Plain"}];return v.jsx(XU,{title:e,defaultOpen:!0,onOpenChange:o,rightContent:s?v.jsx($U,{items:l,defaultValue:"plain",value:n,onValueChange:i,theme:"pill",onClick:a(u=>u.stopPropagation(),"onClick")}):null,triggerClassName:"min-h-16",children:v.jsx(Iye,{content:t,section:e,tab:n,parsedContent:r})})},"IOSection"),Iye=a(({tab:e,content:t,section:r,parsedContent:n})=>t?v.jsxs("div",{className:"relative rounded-lg border border-border ",children:[v.jsx(Cye,{section:r,content:t}),e==="json"&&v.jsx(v.Fragment,{children:n?v.jsx(TT,{booleanStyle:"color: hsl(var(--primary));",className:"overflow-x-auto rounded-xl p-4 text-left",data:n,id:`json-pretty-${r}`,keyStyle:"color: hsl(var(--primary));",mainStyle:"color: hsl(var(--muted-foreground)); font-size: 12px;",stringStyle:"color: hsl(var(--chart-2));",valueStyle:"color: hsl(var(--chart-1));"}):v.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Invalid JSON format"})}),e==="plain"&&v.jsx("div",{className:"rounded-lg bg-muted/50 p-4",children:v.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-left font-mono text-xs text-foreground",children:t})})]}):v.jsx("p",{className:"p-3 text-sm italic text-muted-foreground ",children:"No data available"}),"IOContent"),Cye=a(({section:e,content:t})=>{const[r,n]=F.useState(!1),i=a(()=>{navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)},"onClick");return v.jsx(h0,{onClick:i,"aria-label":r?`${e} Data Copied`:`Copy ${e} Data`,variant:"ghost",className:"absolute right-1.5 top-1.5",children:r?v.jsx(Va,{className:"size-3"}):v.jsx(aa,{className:"size-3"})})},"CopyButton"),Mye={4:"px-1 gap-1 h-4",5:"px-1.5 gap-1 h-5",6:"px-2 gap-1.5 h-6",7:"px-2.5 gap-2 h-7"},Oye={4:"text-xs font-normal leading-3",5:"text-xs font-medium",6:"text-sm font-medium",7:"text-sm font-medium"},un=a(({label:e,theme:t="gray",variant:r="solid",size:n="4",iconStart:i,iconEnd:s,className:o="",...l})=>{const{bg:u,darkBg:c,text:d,darkText:f}=dye[t],g=r==="outline"?`border ${d} ${f} bg-transparent dark:bg-transparent border-current`:`${u} ${d} ${c} ${f}`;return v.jsxs("span",{className:Ue("inline-flex min-w-0 items-center overflow-hidden rounded font-medium",g,Mye[n],o),...l,children:[i&&v.jsx("span",{className:"shrink-0",children:i}),v.jsx("span",{className:Ue(Oye[n],"min-w-0 max-w-full flex-shrink-0 truncate tracking-normal"),children:e}),s&&v.jsx("span",{className:"shrink-0",children:s})]})},"Badge"),KU=a(({timestamp:e,size:t,...r})=>v.jsx(un,{variant:"outline",theme:"gray",size:t,...r,label:Rye(e)}),"TimestampBadge");function Rye(e){return new Date(e).toLocaleString()}a(Rye,"formatTimestamp");const Pye=a(({data:e})=>{const t=WU(e.type),r=zU(e);return v.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-start gap-1",children:[v.jsx(un,{iconStart:v.jsx(t,{className:"size-2.5"}),theme:K2(e.type),size:"4",label:VU(e.type)}),typeof e.tokensCount=="number"&&v.jsx(un,{iconStart:v.jsx(NT,{className:"size-2.5"}),theme:"gray",size:"4",label:e.tokensCount}),typeof e.cost=="number"&&v.jsx(un,{theme:"gray",size:"4",label:`$ ${e.cost.toFixed(4)}`}),v.jsxs("span",{className:"text-xs text-muted-foreground",children:["LATENCY: ",ml(r)]}),typeof e.startTime=="number"&&v.jsx(KU,{timestamp:e.startTime})]})},"DetailsViewMetrics"),Lye=a(({data:e})=>v.jsx("div",{className:"pt-4",children:v.jsx("div",{className:"rounded border border-border bg-transparent ",children:v.jsx(TT,{booleanStyle:"color: hsl(var(--primary));",className:"overflow-x-auto rounded-xl p-4 text-left",data:e.raw,id:`json-pretty-${e.id||"span-details"}`,keyStyle:"color: hsl(var(--primary));",mainStyle:"color: hsl(var(--muted-foreground)); font-size: 12px;",stringStyle:"color: hsl(var(--chart-2));",valueStyle:"color: hsl(var(--chart-1));"})})}),"DetailsViewRawDataTab"),qU=a(({data:e,avatar:t,defaultTab:r,className:n,copyButton:i,headerActions:s,customHeader:o,onTabChange:l})=>{const[u,c]=F.useState(r||"input-output"),d=[{value:"input-output",label:"In/Out",icon:v.jsx(yz,{className:"size-4"})},{value:"attributes",label:"Attributes",icon:v.jsx(wz,{className:"size-4"})},{value:"raw",label:"RAW",icon:v.jsx(xz,{className:"size-4"})}];function f(w){c(w),l?.(w)}a(f,"handleTabChange");const g=typeof s=="function"?s(e):s,m=o?typeof o=="function"?o({data:e}):o:v.jsx(Tye,{data:e,avatar:t,copyButton:i,actions:g});return v.jsxs("div",{className:Ue("min-w-0 rounded-lg border border-border bg-card p-4 shadow-sm",n),children:[m,v.jsx(Pye,{data:e}),v.jsx($U,{items:d,value:u,onValueChange:f,theme:"underline",defaultValue:r}),u==="input-output"&&v.jsx(Nye,{data:e}),u==="attributes"&&v.jsx(vye,{data:e}),u==="raw"&&v.jsx(Lye,{data:e})]})},"DetailsView"),eB=a(({...e})=>v.jsx(JU,{startIcon:v.jsx(Qc,{className:"size-4"}),placeholder:"Filter...",...e}),"SearchInput"),tB=a(({cost:e,size:t,...r})=>v.jsx(un,{theme:"gray",size:t,...r,label:`$ ${e}`}),"PriceBadge"),rB=a(({tokensCount:e,size:t,...r})=>v.jsx(un,{iconStart:v.jsx(NT,{className:"size-2.5"}),theme:"gray",size:t,...r,label:e}),"TokensBadge"),nB=a(({trace:e,avatar:t})=>v.jsxs("header",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 overflow-hidden",children:[t&&v.jsx(q2,{size:"4",...t}),v.jsx("h3",{className:"font-medium max-w-full truncate text-sm text-foreground",children:e.name})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(un,{size:"5",theme:"gray",variant:"outline",label:e.spansCount===1?"1 span":`${e.spansCount} spans`}),v.jsx(un,{size:"5",theme:"gray",variant:"outline",label:ml(e.durationMs)})]})]}),"TraceListItemHeader"),Dye=a(({trace:e,avatar:t,onClick:r,badges:n,isSelected:i})=>{const s=F.useCallback(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r?.())},[r]),{name:o,agentDescription:l,totalCost:u,totalTokens:c,startTime:d}=e;return v.jsxs("div",{className:Ue("group w-full","flex flex-col gap-2.5 p-4","cursor-pointer",i?"bg-muted":"bg-card"),role:"button",tabIndex:0,onClick:r,onKeyDown:s,"aria-label":`Select trace ${o}`,children:[v.jsx(nB,{trace:e,avatar:t}),v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"mr-4 max-w-full truncate text-sm text-muted-foreground ",children:l}),typeof u=="number"&&v.jsx(tB,{cost:u}),typeof c=="number"&&v.jsx(rB,{tokensCount:c}),n?.map((f,g)=>v.jsx(un,{theme:f.theme,size:"4",label:f.label},g)),typeof d=="number"&&v.jsx(KU,{timestamp:d})]})]})},"TraceListItem"),jye=a(({traces:e,expanded:t,onExpandStateChange:r,className:n,onTraceSelect:i,selectedTrace:s})=>v.jsxs("div",{className:Ue("w-full min-w-0","flex flex-col gap-3",t?"w-full":"w-fit",n),children:[v.jsx("header",{className:"flex min-h-6 items-center justify-between gap-2",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:Ue("font-semibold text-lg text-foreground",!t&&"hidden"),children:"Traces"}),v.jsx(un,{size:"5",theme:"teal","aria-label":`Total number of traces: ${e.length}`,label:e.length})]})}),t&&v.jsx("ul",{className:"flex flex-col items-center overflow-hidden rounded border border-border ",children:e.map(o=>v.jsx("li",{className:"w-full list-none border-b-border [&:not(:last-child)]:border-b",children:v.jsx(Dye,{trace:o,onClick:a(()=>i?.(o),"onClick"),isSelected:s?.id===o.id,badges:o.badges})},o.id))})]}),"TraceList"),Uye=a(({data:e})=>{const t=WU(e.type);return v.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1",children:[v.jsx(un,{iconStart:v.jsx(t,{className:"size-2.5"}),theme:K2(e.type),size:"4",label:VU(e.type)}),typeof e.tokensCount=="number"&&v.jsx(rB,{tokensCount:e.tokensCount}),typeof e.cost=="number"&&v.jsx(tB,{cost:e.cost})]})},"SpanCardBadges"),kA=a(({type:e})=>e==="empty"?v.jsx("div",{className:"w-5 shrink-0 grow"}):v.jsxs("div",{className:"relative w-5 shrink-0 grow",children:[(e==="vertical"||e==="t-right")&&v.jsx("div",{className:"absolute bottom-0 left-1/2 top-0 w-0.5 -translate-x-1/2 bg-muted"}),e==="t-right"&&v.jsx("div",{className:"absolute left-2.5 top-2.5 h-0.5 w-2.5 -translate-y-[3px] bg-muted"}),e==="corner-top-right"&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute left-1/2 top-2 size-0.5 -translate-x-1/2 -translate-y-px bg-muted"}),v.jsx("div",{className:"absolute left-1/2 top-2.5 h-0.5 w-2.5 -translate-y-[3px] bg-muted"}),v.jsx("div",{className:"absolute left-1/2 top-0 h-[7px] w-0.5 -translate-x-px bg-muted"})]})]}),"SpanCardConnector"),Bye={purple:"bg-primary",indigo:"bg-primary",orange:"bg-chart-1",teal:"bg-chart-2",cyan:"bg-chart-3",sky:"bg-chart-4",yellow:"bg-chart-5",emerald:"bg-accent",red:"bg-destructive",gray:"bg-muted-foreground"},zye=a(({spanCard:e,theme:t,minStart:r,maxEnd:n,className:i})=>{const{startPercent:s,widthPercent:o}=FU({spanCard:e,minStart:r,maxEnd:n});return v.jsx("span",{className:Ue("relative flex h-4 min-w-20 flex-1 rounded bg-muted",i),children:v.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-1/2 h-1.5 -translate-y-1/2",children:v.jsx("span",{className:`absolute h-full rounded-sm ${Bye[t]}`,style:{left:`${s}%`,width:`${o}%`}})})})},"SpanCardTimeline"),AA=a(({isExpanded:e,title:t,onToggleClick:r})=>v.jsx(kT,{asChild:!0,children:v.jsx("button",{className:"flex h-4 w-5 shrink-0 items-center justify-center",onClick:r,onKeyDown:r,"aria-label":`${e?"Collapse":"Expand"} ${t} children`,"aria-expanded":e,type:"button",children:e?v.jsx(ha,{"aria-hidden":"true",className:"size-3 text-muted-foreground"}):v.jsx(iT,{"aria-hidden":"true",className:"size-3 text-muted-foreground"})})}),"SpanCardToggle"),to={CONNECTOR_WIDTH:20,CONTENT_BASE_WIDTH:320},sh={withStatus:!0,expandButton:"inside"},Fye=a(({level:e,hasExpandButton:t,contentPadding:r,expandButton:n})=>{let i=to.CONTENT_BASE_WIDTH-e*to.CONNECTOR_WIDTH;return t&&n==="inside"&&(i-=to.CONNECTOR_WIDTH),n==="outside"&&e===0&&(i-=to.CONNECTOR_WIDTH),i-r},"getContentWidth"),Hye=a(({connectorsColumnWidth:e,expandButton:t})=>t==="inside"?`${e}px 1fr`:`${e}px 1fr ${to.CONNECTOR_WIDTH}px`,"getGridTemplateColumns"),Zye=a(({level:e,hasExpandButton:t})=>e===0?0:t?4:8,"getContentPadding"),Gye=a(({level:e,hasExpandButton:t,isLastChild:r,prevConnectors:n,expandButton:i})=>{const s=[];if(e===0)return{connectors:i==="inside"?[]:["vertical"],connectorsColumnWidth:20};for(let l=0;l<e-1;l++)s.push("vertical");r||s.push("t-right"),r&&s.push("corner-top-right");let o=s.length*to.CONNECTOR_WIDTH;t&&(o+=to.CONNECTOR_WIDTH);for(let l=0;l<n.length;l++)(n[l]==="empty"||n[l]==="corner-top-right")&&(s[l]="empty");return{connectors:s,connectorsColumnWidth:o}},"getConnectorsLayout"),Vye=a((e,t)=>{const r=F.useCallback(()=>{t?.(e)},[e,t]),n=F.useCallback(s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},[r]),i=F.useCallback(s=>{s.stopPropagation()},[]);return{handleCardClick:r,handleKeyDown:n,handleToggleClick:i}},"useSpanCardEventHandlers"),Wye=a(({data:e,level:t,selectedSpan:r,onSpanSelect:n,minStart:i,maxEnd:s,prevLevelConnectors:o,expandedSpansIds:l,onExpandSpansIdsChange:u,viewOptions:c=sh})=>e.children?.length?v.jsx("div",{className:"relative",children:v.jsx(AT,{children:v.jsx("ul",{role:"group",children:e.children.map((d,f)=>v.jsx(iB,{viewOptions:c,data:d,minStart:i,maxEnd:s,level:t+1,selectedSpan:r,onSpanSelect:n,isLastChild:f===(e.children||[]).length-1,prevLevelConnectors:o,expandedSpansIds:l,onExpandSpansIdsChange:u},d.id))})})}):null,"SpanCardChildren"),iB=a(({data:e,level:t=0,selectedSpan:r,onSpanSelect:n,viewOptions:i=sh,avatar:s,minStart:o,maxEnd:l,isLastChild:u,prevLevelConnectors:c=[],expandedSpansIds:d,onExpandSpansIdsChange:f})=>{const g=d.includes(e.id),m=i.withStatus??sh.withStatus,w=i.expandButton||sh.expandButton,E=F.useCallback(K=>{const z=d.includes(e.id);z&&!K&&f(d.filter(V=>V!==e.id)),!z&&K&&f([...d,e.id])},[g,d,e.id,f]),A={isExpanded:g,hasChildren:!!e.children?.length,isSelected:r?.id===e.id},C=Vye(e,n),{durationMs:O}=FU({spanCard:e,minStart:o,maxEnd:l}),R=w==="inside"&&A.hasChildren,P=Zye({level:t,hasExpandButton:R}),L=Fye({level:t,hasExpandButton:R,contentPadding:P,expandButton:w}),{connectors:j,connectorsColumnWidth:G}=Gye({level:t,hasExpandButton:R,isLastChild:u,prevConnectors:c,expandButton:w}),Z=Hye({connectorsColumnWidth:G,expandButton:w});return v.jsx("li",{role:"treeitem","aria-expanded":A.hasChildren?A.isExpanded:void 0,className:"list-none",children:v.jsxs(Vy,{open:A.isExpanded,onOpenChange:E,children:[v.jsxs("div",{className:Ue("relative grid w-full rounded-md transition-colors",A.isSelected?"bg-accent/50 border border-accent":"hover:bg-muted/30"),style:{gridTemplateColumns:Z},onClick:C.handleCardClick,onKeyDown:C.handleKeyDown,tabIndex:0,role:"button","aria-pressed":A.isSelected,"aria-describedby":`span-card-desc-${e.id}`,"aria-expanded":A.hasChildren?A.isExpanded:void 0,"aria-label":`${A.isSelected?"Selected":"Not selected"} span card for ${e.title} at level ${t}`,children:[v.jsxs("div",{className:"flex flex-nowrap",children:[j.map((K,z)=>v.jsx(kA,{type:K},`${K}-${z}`)),R&&v.jsxs("div",{className:"flex w-5 flex-col items-center",children:[v.jsx(AA,{isExpanded:A.isExpanded,title:e.title,onToggleClick:C.handleToggleClick}),A.isExpanded&&v.jsx(kA,{type:"vertical"})]})]}),v.jsxs("div",{className:Ue("flex flex-nowrap items-center align-middle gap-x-3 gap py-3 px-2","min-h-5 w-full cursor-pointer",t!==0&&!R&&"pl-2",t!==0&&R&&"pl-1"),children:[v.jsxs("div",{className:"relative flex min-h-4 flex-shrink-0 flex-grow-0 flex-wrap items-start gap-1",style:{width:`min(${L}px, 100%)`,minWidth:140},children:[s&&v.jsx(q2,{size:"4",...s}),v.jsx("h3",{className:"mr-1 h-4 max-w-32 truncate text-sm leading-[14px] text-foreground ",title:e.title,children:e.title}),v.jsx(Uye,{data:e})]}),v.jsxs("div",{className:"flex flex-shrink flex-grow flex-nowrap items-center justify-end gap-1 min-w-0",children:[w==="outside"&&m&&v.jsx("div",{className:"flex-shrink-0",children:v.jsx(Uy,{status:e.status})}),v.jsx(zye,{theme:K2(e.type),minStart:o,maxEnd:l,spanCard:e,className:"max-w-48 flex-shrink"}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[v.jsx("span",{className:"inline-block w-14 whitespace-nowrap px-1 text-right text-xs text-foreground",children:ml(O)}),w==="inside"&&m&&v.jsx("div",{children:v.jsx(Uy,{status:e.status})})]})]})]}),w==="outside"&&(A.hasChildren?v.jsx(AA,{isExpanded:A.isExpanded,title:e.title,onToggleClick:C.handleToggleClick}):v.jsx("div",{}))]}),v.jsx(Wye,{minStart:o,maxEnd:l,viewOptions:i,data:e,level:t,selectedSpan:r,onSpanSelect:n,prevLevelConnectors:j,expandedSpansIds:d,onExpandSpansIdsChange:f})]})})},"SpanCard"),aB=a(({spans:e,onSpanSelect:t,className:r="",selectedSpan:n,expandedSpansIds:i,onExpandSpansIdsChange:s,spanCardViewOptions:o})=>{const l=HU(e),{minStart:u,maxEnd:c}=cye(l);return v.jsx("div",{className:"w-full min-w-0 p-4",children:v.jsx("ul",{className:Ue(r,"overflow-x-auto space-y-1"),role:"tree","aria-label":"Hierarchical card list",children:e.map((d,f)=>v.jsx(iB,{data:d,level:0,selectedSpan:n,onSpanSelect:t,minStart:u,maxEnd:c,isLastChild:f===e.length-1,expandedSpansIds:i,onExpandSpansIdsChange:s,viewOptions:o},d.id))})})},"TreeView"),Yye=a(({data:e})=>{const[t,r]=F.useState(e[0]?.traceRecord),[n,i]=F.useState(e[0]?.spans??[]),[s,o]=F.useState(e[0]?.spans?.[0]?.children?.[0]),[l,u]=F.useState(""),[c,d]=F.useState(!0),f=F.useMemo(()=>e.map(P=>({...P.traceRecord,badges:P.badges,spanCardViewOptions:P.spanCardViewOptions})),[e]),g=F.useMemo(()=>l.trim()?ZU(n,l):n,[n,l]),m=F.useMemo(()=>HU(n).map(P=>P.id),[n]),[w,E]=F.useState(m);F.useEffect(()=>{E(m)},[m]);const A=F.useCallback(()=>{E(m)},[m]),C=F.useCallback(()=>{E([])},[]);F.useEffect(()=>{o(n[0])},[n]);const O=F.useCallback(P=>{r(P),i(e.find(L=>L.traceRecord.id===P.id)?.spans??[])},[e]),R={traceRecords:f,traceListExpanded:c,setTraceListExpanded:d,selectedTrace:t,setSelectedTrace:r,selectedTraceSpans:n,setSelectedTraceSpans:i,selectedSpan:s,setSelectedSpan:o,searchValue:l,setSearchValue:u,filteredSpans:g,expandedSpansIds:w,setExpandedSpansIds:E,handleExpandAll:A,handleCollapseAll:C,handleTraceSelect:O};return v.jsxs("div",{className:"h-full w-full p-4 lg:p-8",children:[v.jsx("div",{className:"hidden lg:block",children:v.jsx(Qye,{...R})}),v.jsx("div",{className:"lg:hidden",children:v.jsx($ye,{...R})})]})},"TraceViewer"),Qye=a(({traceRecords:e,traceListExpanded:t,setTraceListExpanded:r,selectedTrace:n,selectedSpan:i,setSelectedSpan:s,searchValue:o,setSearchValue:l,filteredSpans:u,expandedSpansIds:c,setExpandedSpansIds:d,handleExpandAll:f,handleCollapseAll:g,handleTraceSelect:m})=>v.jsx("div",{className:"flex flex-col gap-4",children:n?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(Za,{value:n.id,onValueChange:a(w=>{const E=e.find(A=>A.id===w);E&&m(E)},"onValueChange"),children:[v.jsx(ca,{className:"w-full h-auto py-3",children:v.jsx(Ga,{children:v.jsxs("div",{className:"flex items-center gap-4 w-full",children:[v.jsx("span",{className:"font-semibold text-base",children:n.name}),v.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[typeof n.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(n.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${n.spansCount} span${n.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(n.durationMs)})]})]})})}),v.jsx(da,{className:"w-full max-w-2xl max-h-[400px]",children:e.map(w=>v.jsx(lr,{value:w.id,className:"py-2.5 px-4 cursor-pointer",children:v.jsxs("div",{className:"flex items-center justify-between gap-4 w-full pr-6",children:[v.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[v.jsx("span",{className:"font-semibold text-base text-foreground",children:w.name}),w.agentDescription&&v.jsx("span",{className:"text-xs text-muted-foreground",children:w.agentDescription})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[typeof w.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(w.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${w.spansCount} span${w.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(w.durationMs)})]})]})},w.id))})]}),v.jsxs("div",{className:"rounded-lg border border-border bg-card shadow-sm",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border p-4",children:[v.jsx(eB,{id:"span-search-desktop",name:"search",onClear:a(()=>l(""),"onClear"),value:o,onValueChange:l,className:"max-w-60 grow"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[v.jsx(YU,{onExpandAll:f}),v.jsx(QU,{onCollapseAll:g})]})})]}),u.length===0?v.jsx("div",{className:"p-3 text-center text-muted-foreground",children:"No spans found"}):v.jsx(aB,{spans:u,onSpanSelect:s,selectedSpan:i,expandedSpansIds:c,onExpandSpansIdsChange:d,spanCardViewOptions:n.spanCardViewOptions})]}),i?v.jsx(qU,{data:i}):v.jsx(TA,{title:"Select a span to see the details"})]}):v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(Za,{value:"",onValueChange:a(w=>{const E=e.find(A=>A.id===w);E&&m(E)},"onValueChange"),children:[v.jsx(ca,{className:"w-full",children:v.jsx(Ga,{placeholder:"Select a trace to view details..."})}),v.jsx(da,{className:"w-full max-w-2xl max-h-[400px]",children:e.map(w=>v.jsx(lr,{value:w.id,className:"py-2.5 px-4 cursor-pointer",children:v.jsxs("div",{className:"flex items-center justify-between gap-4 w-full pr-6",children:[v.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[v.jsx("span",{className:"font-semibold text-base text-foreground",children:w.name}),w.agentDescription&&v.jsx("span",{className:"text-xs text-muted-foreground",children:w.agentDescription})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[typeof w.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(w.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${w.spansCount} span${w.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(w.durationMs)})]})]})},w.id))})]}),v.jsx(TA,{title:"Select a trace to see the details"})]})}),"DesktopLayout"),$ye=a(({traceRecords:e,traceListExpanded:t,setTraceListExpanded:r,selectedTrace:n,setSelectedTrace:i,selectedTraceSpans:s,setSelectedTraceSpans:o,selectedSpan:l,setSelectedSpan:u,searchValue:c,setSearchValue:d,filteredSpans:f,expandedSpansIds:g,setExpandedSpansIds:m,handleExpandAll:w,handleCollapseAll:E,handleTraceSelect:A})=>n?n&&s.length&&!l?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(xA,{onClick:a(()=>{i(void 0),o([])},"onClick"),iconStart:v.jsx(cv,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Traces list"}),v.jsx(nB,{trace:n}),v.jsxs("div",{className:"rounded border border-border bg-card",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border p-3",children:[v.jsx(eB,{id:"span-search-mobile",name:"search",onClear:a(()=>d(""),"onClear"),value:c,onValueChange:d,className:"max-w-60 grow"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[v.jsx(YU,{onExpandAll:w}),v.jsx(QU,{onCollapseAll:E})]})})]}),f.length===0?v.jsx("div",{className:"p-3 text-center text-muted-foreground",children:"No spans found"}):v.jsx(aB,{spans:f,spanCardViewOptions:n.spanCardViewOptions,onSpanSelect:u,selectedSpan:l,expandedSpansIds:g,onExpandSpansIdsChange:m})]})]}):n&&s.length&&l?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(xA,{onClick:a(()=>{u(void 0)},"onClick"),iconStart:v.jsx(cv,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Tree View"}),v.jsx(qU,{data:l})]}):null:v.jsx(jye,{traces:e,expanded:t,onExpandStateChange:r,onTraceSelect:A,selectedTrace:n}),"MobileLayout"),TA=a(({title:e})=>v.jsx("p",{className:"hidden items-center justify-center rounded-lg bg-muted p-4 text-center text-muted-foreground lg:flex",children:e}),"Placeholder"),Xye=dr(),Jye=a(({agentId:e})=>{const t=Dae(e),r=t.data?.runs??[],n=mT({queries:r.map(c=>({queryKey:["agent",e,"runs","detail",c.runId,null],queryFn:a(async()=>Xye.runs.getRun(e,c.runId),"queryFn"),enabled:!!(e&&c.runId),staleTime:3e4}))}),i=F.useMemo(()=>r.map((c,d)=>{const f=n[d];return f?.data?{traceRecord:yA.convertRunSummaryToTraceRecord(c),spans:yA.convertRunDetailToTraceSpans(f.data)}:null}).filter(c=>c!==null),[r,...n.map(c=>c.data)]),s=t.isLoading,o=t.error?t.error.message:void 0,l=r.length>0,u=i.length>0;return s?v.jsx("div",{className:"flex items-center justify-center h-32",children:v.jsx(cn,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):o?v.jsxs("div",{className:"px-4 py-3 text-sm text-destructive",children:["Failed to load runs: ",o]}):l?u?v.jsx("div",{className:"h-full w-full",children:v.jsx(Yye,{data:i})}):v.jsxs("div",{className:"flex items-center justify-center h-32",children:[v.jsx(cn,{className:"h-5 w-5 animate-spin text-muted-foreground"}),v.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading run details..."})]}):v.jsx("div",{className:"px-4 py-8 text-sm text-center text-muted-foreground",children:"No agent runs yet. Runs will appear here after the agent processes messages."})},"AgentRunTimeline");function NA({agentId:e,agentName:t,channelId:r}){const{currentTab:n,setTab:i}=lye(e),{data:s,isLoading:o}=Fae(e,{enabled:!!e}),{agent:l,isLoading:u,error:c}=Gm(e),d=F.useMemo(()=>s?.data||[],[s]),f=F.useMemo(()=>{const g=[{value:"details",label:"Details",icon:v.jsx(Hy,{className:"h-4 w-4"})},{value:"timeline",label:"Timeline",icon:v.jsx(ET,{className:"h-4 w-4"})},{value:"actions",label:"Model Calls",icon:v.jsx(na,{className:"h-4 w-4"})},{value:"memories",label:"Memories",icon:v.jsx(vs,{className:"h-4 w-4"})},{value:"logs",label:"Logs",icon:v.jsx(Ez,{className:"h-4 w-4"})}],m=d.map(w=>({value:w.name,label:w.name,icon:v.jsx(_z,{className:"h-4 w-4"})}));return[...g,...m]},[d]);return v.jsxs(B_,{defaultValue:"details",value:n,onValueChange:i,className:"flex flex-col h-screen w-full max-w-full",children:[v.jsxs(Sm,{className:"flex w-full max-w-full overflow-x-auto flex-shrink-0",children:[f.map(g=>v.jsxs(Uc,{value:g.value,className:"flex items-center gap-1.5 flex-shrink-0",children:[g.icon,v.jsx("span",{className:"truncate",children:g.label})]},g.value)),o&&v.jsx(v.Fragment,{children:[...Array(2)].map((g,m)=>v.jsx(jc,{className:"h-9 w-full rounded-md flex-shrink-0"},`skel-tab-${m}`))})]}),v.jsxs(Ci,{value:"details",className:"overflow-y-auto overflow-x-hidden flex-1 p-4 w-full max-w-full min-h-0",children:[n==="details"&&e&&v.jsxs(v.Fragment,{children:[u&&v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(cn,{className:"h-6 w-6 animate-spin text-primary"})}),c&&v.jsxs("div",{className:"text-red-500 break-words",children:["Error loading agent details: ",c.message]}),!u&&!c&&l&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(BU,{agent:l,agentId:e,onSaveComplete:a(()=>{},"onSaveComplete")})}),!u&&!c&&!l&&!o&&v.jsx("div",{className:"text-muted-foreground",children:"Agent details not found."})]}),n==="details"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their details."})]}),v.jsxs(Ci,{value:"timeline",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0 p-0",children:[n==="timeline"&&e&&v.jsx("div",{className:"w-full max-w-full h-full",children:v.jsx(Jye,{agentId:e})}),n==="timeline"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see run activity."})]}),v.jsxs(Ci,{value:"actions",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="actions"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(aye,{agentId:e})}),n==="actions"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their actions."})]}),v.jsxs(Ci,{value:"logs",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="logs"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(CL,{agentName:t,level:"all"})}),n==="logs"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their logs."})]}),v.jsxs(Ci,{value:"memories",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="memories"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(oye,{agentId:e,agentName:t,channelId:r})}),n==="memories"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their memories."})]}),d.map(g=>v.jsx(Ci,{value:g.name,className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:n===g.name&&e&&v.jsx("iframe",{src:g.url,title:g.name,className:"w-full h-full border-0 flex-1 max-w-full"})},g.name))]})}a(NA,"AgentSidebar");const Kye=160,sB=F.forwardRef(({className:e,...t},r)=>{const n=F.useRef(null),i=a(o=>{typeof r=="function"?r(o):r&&(r.current=o),n.current=o},"combinedRef"),s=a(()=>{const o=n.current;o&&(o.style.height="auto",o.style.height=Math.min(o.scrollHeight,Kye)+"px")},"resizeTextarea");return F.useEffect(()=>{s()},[t.value]),v.jsx(kd,{autoComplete:"off",ref:i,name:"message",className:Ue("px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",e),...t})});sB.displayName="ChatInput";let Cu,Mu=[],Uf;const IA=a((e,t)=>String(e).padStart(t,"0"),"padWithLeadingZeros"),qye=a(({className:e,timerClassName:t,agentId:r,onChange:n})=>{const{toast:i}=Er(),[s,o]=F.useState(!1),[l,u]=F.useState(!1),[c,d]=F.useState(0),[f,g]=F.useState({id:-1,name:"",file:null}),m=Math.floor(c%3600/60),w=c%60,[E,A]=F.useMemo(()=>IA(m,2).split(""),[m]),[C,O]=F.useMemo(()=>IA(w,2).split(""),[w]),R=F.useRef({stream:null,analyser:null,mediaRecorder:null,audioContext:null}),P=dr(),L=ei({mutationKey:["whisper"],mutationFn:a(z=>P.audio.transcribe(r,{audio:z}),"mutationFn"),onSuccess:a(z=>{z?.text&&n(z.text)},"onSuccess"),onError:a(z=>{i({variant:"destructive",title:"Unable to start recording",description:z.message}),console.log(z)},"onError")});function j(){navigator.mediaDevices?.getUserMedia&&navigator.mediaDevices.getUserMedia({audio:!0}).then(z=>{o(!0);const V=window.AudioContext,h=new V,y=h.createAnalyser();h.createMediaStreamSource(z).connect(y),R.current={stream:z,analyser:y,mediaRecorder:null,audioContext:h};const _={mimeType:MediaRecorder.isTypeSupported("audio/mpeg")?"audio/mpeg":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/wav"};R.current.mediaRecorder=new MediaRecorder(z,_),R.current.mediaRecorder.start(),Mu=[],Cu=new MediaRecorder(z),Cu.start(),Cu.ondataavailable=N=>{Mu.push(N.data)}}).catch(z=>{i({variant:"destructive",title:"Unable to start recording",description:z.message}),console.log(z)})}a(j,"startRecording");function G(){Cu.onstop=()=>{const z=new Blob(Mu,{type:"audio/wav"});L.mutate(z),g({...f,file:window.URL.createObjectURL(z)}),Mu=[]},Cu.stop(),o(!1),u(!0),d(0),clearTimeout(Uf)}a(G,"stopRecording");function Z(){const{mediaRecorder:z,stream:V,analyser:h,audioContext:y}=R.current;if(z&&(z.onstop=()=>{Mu=[]},z.stop()),h&&h.disconnect(),V)for(const b of V.getTracks())b.stop();y&&y.close(),o(!1),u(!0),d(0),clearTimeout(Uf)}a(Z,"resetRecording");const K=a(()=>{G()},"handleSubmit");return F.useEffect(()=>(s&&(Uf=setTimeout(()=>{d(c+1)},1e3)),()=>clearTimeout(Uf)),[s,c]),L?.isPending?v.jsx(nt,{variant:"ghost",disabled:!0,size:"icon",children:v.jsx(Gy,{className:"size-4"})}):v.jsxs("div",{className:Ue("flex items-center justify-center gap-2 border-l border-l-transparent border-opacity-0 transition-all duration-300",{"border-opacity-100 border-l-border pl-2":s},e),children:[s?v.jsxs("div",{className:"flex gap-1 items-center",children:[v.jsx("div",{className:"bg-red-500 rounded-full h-2.5 w-2.5 animate-pulse"}),v.jsx(oB,{minuteLeft:E,minuteRight:A,secondLeft:C,secondRight:O,timerClassName:t})]}):null,v.jsxs("div",{className:"flex items-center gap-2",children:[s?v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx(nt,{onClick:Z,size:"icon",variant:"ghost",children:v.jsx(Yc,{className:"size-4"})})}),v.jsx(jr,{className:"m-2",children:v.jsx("span",{children:" Reset recording"})})]}):null,v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:s?v.jsx(nt,{onClick:K,variant:"ghost",size:"icon",children:v.jsx(IT,{className:"size-4"})}):v.jsxs(nt,{variant:"ghost",size:"icon",onClick:a(()=>j(),"onClick"),children:[v.jsx(Sz,{className:"size-4"}),v.jsx("span",{className:"sr-only",children:"Use Microphone"})]})}),v.jsx(jr,{side:"right",children:v.jsxs("span",{children:[s?"Send":"Start"," "]})})]})]})]})},"AudioRecorder"),oB=pp.memo(({minuteLeft:e,minuteRight:t,secondLeft:r,secondRight:n,timerClassName:i})=>v.jsx("div",{className:Ue("text-sm animate-in duration-1000 fade-in-0 select-none",i),children:v.jsxs("p",{children:[e,t,":",r,n]})}));oB.displayName="Timer";const CA=a(({input:e,setInput:t,inputDisabled:r,selectedFiles:n,removeFile:i,handleFileChange:s,handleSendMessage:o,handleKeyDown:l,chatType:u,targetAgentData:c,formRef:d,inputRef:f,fileInputRef:g})=>v.jsxs("div",{className:"px-2 sm:px-4 pb-2 sm:pb-4 mt-auto flex-shrink-0","data-testid":"chat-container",children:[r&&v.jsxs("div",{className:"px-2 pb-2 text-sm text-muted-foreground flex items-center gap-2",children:[v.jsxs("div",{className:"flex gap-0.5 items-center justify-center",children:[v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0s]"}),v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.2s]"}),v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.4s]"})]}),v.jsx("span",{className:"text-xs sm:text-sm",children:u===It.DM&&c?`${c.name} is thinking`:"Agent is thinking"}),v.jsxs("div",{className:"flex",children:[v.jsx("span",{className:"animate-pulse [animation-delay:0ms]",children:"."}),v.jsx("span",{className:"animate-pulse [animation-delay:200ms]",children:"."}),v.jsx("span",{className:"animate-pulse [animation-delay:400ms]",children:"."})]})]}),v.jsxs("form",{ref:d,onSubmit:o,className:"relative rounded-md border bg-card p-2 sm:p-3",children:[n.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 sm:gap-3 p-2 sm:p-3 pb-0 max-h-32 sm:max-h-40 overflow-y-auto",children:n.map(m=>{const w=m.blobUrl||URL.createObjectURL(m.file);return v.jsxs("div",{className:"relative p-1 sm:p-2",children:[v.jsxs("div",{className:"relative w-12 h-12 sm:w-16 sm:h-16 rounded-lg overflow-hidden border bg-muted",children:[m.isUploading&&v.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center z-10",children:v.jsx(cn,{className:"h-3 w-3 sm:h-4 sm:w-4 animate-spin text-white"})}),m.file.type.startsWith("image/")?v.jsx("img",{alt:"Selected file",src:w,className:"w-full h-full object-cover"}):m.file.type.startsWith("video/")?v.jsx("video",{src:w,className:"w-full h-full object-cover",muted:!0}):v.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:v.jsx(ro,{className:"h-4 w-4 sm:h-8 sm:w-8 text-muted-foreground"})}),m.error&&v.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs p-1 text-center",children:"Error"})]}),v.jsx(nt,{onClick:a(()=>i(m.id),"onClick"),className:"absolute -right-1 -top-1 size-[16px] sm:size-[20px] ring-2 ring-background z-20",variant:"outline",size:"icon",disabled:m.isUploading,children:v.jsx(Hn,{className:"h-2 w-2 sm:h-3 sm:w-3"})}),v.jsx("div",{className:"text-xs text-center mt-1 truncate w-12 sm:w-16",children:m.file.name})]},m.id)})}),v.jsx(sB,{ref:f,onKeyDown:l,value:e,onChange:a(({target:m})=>t(m.value),"onChange"),placeholder:r?u===It.DM&&c?`${c.name} is thinking...`:"Agent is processing...":u===It.DM?"Type your message here...":"Message group...",className:"min-h-12 resize-none rounded-none bg-card border-0 px-0 py-0 shadow-none focus-visible:ring-0 text-sm sm:text-base",disabled:r||u===It.DM&&c?.status==="inactive","data-testid":"chat-input"}),v.jsxs("div",{className:"flex items-center pt-0 gap-1",children:[v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsxs("div",{children:[v.jsxs(nt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",onClick:a(()=>{g.current&&g.current.click()},"onClick"),children:[v.jsx(kz,{className:"size-3 sm:size-4"}),v.jsx("span",{className:"sr-only",children:"Attach file"})]}),v.jsx("input",{type:"file",ref:g,onChange:s,accept:"image/*,video/*,audio/*,.pdf,.doc,.docx,.txt,.rtf,...",multiple:!0,className:"hidden"})]})}),v.jsx(jr,{side:"left",children:v.jsx("p",{children:"Attach files"})})]}),u===It.DM&&c?.id&&v.jsx(qye,{agentId:c.id,onChange:a(m=>t(m),"onChange")}),v.jsx(nt,{disabled:r||u===It.DM&&c?.status==="inactive"||n.some(m=>m.isUploading),type:"submit",size:"sm",className:"ml-auto gap-1.5 h-[26px] sm:h-[30px] px-2 sm:px-3","data-testid":"send-button",children:r||n.some(m=>m.isUploading)?v.jsxs("div",{className:"flex gap-0.5 items-center justify-center",children:[v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0s]"}),v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0.2s]"}),v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0.4s]"})]}):v.jsx(IT,{className:"size-3 sm:size-3.5"})})]})]})]}),"ChatInputArea"),lB=F.forwardRef(({className:e,children:t,scrollRef:r,contentRef:n,isAtBottom:i,scrollToBottom:s,disableAutoScroll:o,...l},u)=>v.jsxs("div",{className:"relative w-full h-full overflow-hidden",children:[v.jsx("div",{className:`flex flex-col w-full h-full p-2 overflow-y-auto ${e}`,ref:r,onWheel:o,onTouchMove:o,...l,children:v.jsx("div",{className:"flex flex-col gap-10",ref:n,children:t})}),!i&&v.jsx(nt,{onClick:a(()=>{s()},"onClick"),size:"icon",variant:"outline",className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 inline-flex rounded-full shadow-md",children:v.jsx(Az,{className:"h-4 w-4"})})]}));lB.displayName="ChatMessageList";const MA=a(({messages:e,isLoadingMessages:t,chatType:r,currentClientEntityId:n,targetAgentData:i,allAgents:s,scrollRef:o,contentRef:l,isAtBottom:u,scrollToBottom:c,disableAutoScroll:d,finalChannelId:f,getAgentInMessage:g,agentAvatarMap:m,onDeleteMessage:w,onRetryMessage:E,selectedGroupAgentId:A})=>{const C=pp.useMemo(()=>r===It.GROUP&&A?e.filter(O=>{const R=O.senderId===n,P=O.senderId===A;return R||P}):e,[e,r,A,n]);return v.jsxs(lB,{scrollRef:o,contentRef:l,isAtBottom:u,scrollToBottom:c,disableAutoScroll:d,className:"h-full w-full","data-testid":"chat-messages",children:[t&&C.length===0&&v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"Loading messages..."})}),!t&&C.length===0&&v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"No messages yet. Start the conversation!"})}),C.map(O=>{const R=O.senderId===n,P=O.isStreaming===!0,L=!R&&g?g(O.senderId):void 0;return v.jsx("div",{className:Ue("flex gap-1",R?"justify-end":"justify-start"),children:v.jsxs(ZL,{variant:R?"sent":"received",className:`flex flex-col gap-1 ${R?"flex-row-reverse":""}`,children:[!R&&r===It.GROUP&&v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx(Ts,{className:"size-5 border rounded-full select-none",children:v.jsx(So,{src:Dc(L||(m&&O.senderId&&s?s.find(j=>j.id===O.senderId):void 0))})}),v.jsx("div",{children:L?.name})]}),v.jsx(pwe,{message:O,agentForTts:r===It.DM?i:L,shouldAnimate:P,onDelete:w,onRetry:E,isUser:R,getAgentInMessage:r===It.GROUP?g:void 0,agentAvatarMap:r===It.GROUP?m:void 0,chatType:r})]})},`${O.id}-${O.createdAt}`)})]},f||"no-channel")},"ChatMessageListComponent");function ewe({options:e=[],className:t="",onSelect:r,initialSelected:n=[]}){const[i,s]=F.useState(n),[o,l]=F.useState(!1),u=F.useRef(null);F.useEffect(()=>{s(n)},[n]),F.useEffect(()=>{const m=a(w=>{u.current&&!u.current.contains(w.target)&&l(!1)},"handleClickOutside");return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const c=a(m=>i.some(w=>m.id&&w.id?w.id===m.id:w.label===m.label),"isOptionSelected"),d=a(m=>{console.log("[MultiSelectCombobox] toggleSelection called with:",m),s(w=>{const E=c(m);let A;return E?A=w.filter(C=>m.id&&C.id?C.id!==m.id:C.label!==m.label):A=[...w,m],console.log("[MultiSelectCombobox] New selection:",A),r&&r(A),A})},"toggleSelection"),f=a(m=>{s(w=>{const E=w.filter(A=>m.id&&A.id?A.id!==m.id:A.label!==m.label);return r&&r(E),E})},"removeSelection"),g=a(()=>{s(m=>{const w=m.slice(0,3);return r&&r(w),w})},"removeExtraSelections");return v.jsxs("div",{className:`relative w-80 ${t}`,ref:u,children:[v.jsxs("div",{className:`flex items-center gap-2 border p-2 bg-background rounded cursor-pointer ${o?"border-primary":"border-input"}`,onClick:a(()=>l(!o),"onClick"),children:[v.jsx("div",{className:"flex flex-wrap gap-1 w-full",children:i.length>0?v.jsxs(v.Fragment,{children:[i.slice(0,3).map((m,w)=>v.jsxs(Ri,{className:"flex items-center gap-1 px-2",children:[m.label,v.jsx(Hn,{size:12,className:"cursor-pointer",onClick:a(E=>{E.stopPropagation(),f(m)},"onClick")})]},m.id||m.label||w)),i.length>3&&v.jsxs(Ri,{className:"px-2 cursor-pointer",onClick:a(m=>{m.stopPropagation(),g()},"onClick"),children:["+",i.length-3," more"]})]}):v.jsx("span",{className:"text-muted-foreground",children:"Select agents..."})}),v.jsx(ha,{size:16})]}),o&&v.jsx(ya,{className:"absolute left-0 mt-2 w-full shadow-md border border-border rounded z-40 max-h-60 overflow-y-auto",children:e.length===0?v.jsx("div",{className:"p-2 text-muted-foreground text-sm",children:"No agents available"}):e.map((m,w)=>v.jsxs("div",{className:`flex items-center gap-2 p-2 cursor-pointer rounded hover:bg-muted ${c(m)?"bg-muted":"bg-card"}`,onClick:a(()=>d(m),"onClick"),children:[v.jsx("div",{className:"bg-gray-500 rounded-full w-4 h-4 flex justify-center items-center overflow-hidden text-xs",children:m.icon?v.jsx("img",{src:m.icon,alt:m.label,className:"w-full h-full object-cover"}):_o(m.label)}),m.label]},m.id||m.label||w))})]})}a(ewe,"MultiSelectCombobox");const twe="00000000-0000-0000-0000-000000000000";function rwe(e){return!!e.id&&!!Lc(e.id)&&typeof e.name=="string"&&e.name.trim()!==""}a(rwe,"isAgentSelectable");function p0({onClose:e,channelId:t}){const[r,n]=F.useState(""),[i,s]=F.useState([]),[o,l]=F.useState(""),[u,c]=F.useState([]),d=twe,f=F.useRef(!1),g=F.useRef(t),m=F.useRef(!1),{data:w}=s2(t?d:void 0,{enabled:!!t}),{data:E,isLoading:A,isError:C}=Id(),O=F.useMemo(()=>(E?.agents||[]).filter(rwe),[E]),R=an(),P=mn(),{toast:L}=Er(),{confirm:j,isOpen:G,onOpenChange:Z,onConfirm:K,options:z}=Po();F.useEffect(()=>{t&&(R.invalidateQueries({queryKey:["channelParticipants",t]}),R.refetchQueries({queryKey:["channelParticipants",t]}))},[t,R]);const V=ei({mutationFn:a(async({name:H,participantIds:$})=>{const ae=dr(),ie=bi(),ne=[...$,ie];return await ae.messaging.createGroupChannel({name:H,participantIds:ne,metadata:{type:It.GROUP,server_id:d,source:Ru}})},"mutationFn"),onSuccess:a(H=>{H&&(L({title:"Success",description:"Group created successfully."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),e(),setTimeout(()=>{P(`/group/${H.id}?messageServerId=${d}`)},100))},"onSuccess"),onError:a(H=>{De.error("Failed to create group",H);const $=H instanceof Error?H.message:"Failed to create group.";L({title:"Error",description:$,variant:"destructive"})},"onError")}),h=ei({mutationFn:a(async({name:H,participantIds:$})=>{if(!t)throw new Error("Channel ID is required for update");return await dr().messaging.updateChannel(t,{name:H,participantCentralUserIds:$})},"mutationFn"),onSuccess:a(()=>{L({title:"Group Updated",description:"Group details updated successfully."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),e(),setTimeout(()=>{P(`/group/${t}?messageServerId=${d}`)},100)},"onSuccess"),onError:a(H=>{De.error("Failed to update group",H),console.error("Group update error details:",H);const $=H instanceof Error?H.message:"Failed to update group.";L({title:"Error",description:$,variant:"destructive"})},"onError")}),y=ei({mutationFn:a(async()=>{if(!t)throw new Error("Channel ID is required for delete");return await dr().messaging.deleteChannel(t)},"mutationFn"),onSuccess:a(()=>{L({title:"Group Deleted",description:"The group has been successfully deleted."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),P("/"),e()},"onSuccess"),onError:a(H=>{De.error("Failed to delete channel",H);const $=H instanceof Error?H.message:"Could not delete group.";typeof H=="object"&&H!==null&&H.statusCode===404?L({title:"Error Deleting Group",description:"Delete operation not found on server.",variant:"destructive"}):L({title:"Error Deleting Group",description:$,variant:"destructive"})},"onError")}),{data:b,isLoading:x,isError:_,error:N}=nn({queryKey:["channelParticipants",t],queryFn:a(async()=>{if(!t)return{success:!0,data:[]};try{const $=await dr().messaging.getChannelParticipants(t);let ae=[];return $&&Array.isArray($.participants)?ae=$.participants.map(ie=>ie.userId):$&&Array.isArray($)&&(ae=$.map(ie=>ie.userId||ie.id||ie)),{success:!0,data:ae}}catch(H){return console.error("[GroupPanel] Error fetching channel participants:",H),{success:!1,error:{message:H instanceof Error?H.message:"Unknown error"}}}},"queryFn"),enabled:!!t,retry:!1,refetchOnMount:!0,refetchOnWindowFocus:!1,staleTime:0,gcTime:0});F.useEffect(()=>{if(t&&w?.data?.channels){const H=w.data.channels.find($=>$.id===t);if(!f.current||g.current!==t){const $=H?.name||"";n($),l($),f.current=!0,g.current=t,m.current=!1}}else t||(f.current=!1,n(""),s([]),l(""),c([]))},[t,w]),F.useEffect(()=>{if(!A&&!(t&&x)){if(!t){m.current=!1;return}if(!(m.current&&g.current===t)){if(_){L({title:"Error",description:`Could not load group participants: ${N?.message||"Unknown error"}`,variant:"destructive"}),s([]),c([]),m.current=!0;return}if(b?.success&&b.data){const H=b.data,$=O.filter(ae=>H.includes(ae.id));s($),c($.map(ae=>ae.id)),m.current=!0}else b&&!b.success?(L({title:"Error",description:`Could not load group participants: ${b.error?.message||"Server error"}`,variant:"destructive"}),s([]),c([]),m.current=!0):(s([]),c([]),m.current=!0)}}},[t,A,x,b,O,_,N,L]);const T=F.useMemo(()=>A||C?[]:O.map(H=>({id:H.id,label:`${H.name}${H.status===zn.INACTIVE?" (Inactive)":""}`,icon:typeof H.settings?.avatar=="string"?H.settings.avatar:""})),[O,A,C]),k=F.useMemo(()=>[],[]),p=F.useMemo(()=>A||!t||t&&!m.current?k:i.map($=>({id:$.id,label:`${$.name}${$.status===zn.INACTIVE?" (Inactive)":""}`,icon:typeof $.settings?.avatar=="string"?$.settings.avatar:""})),[t,i,A,k]),S=F.useCallback(H=>{const $=O.filter(ae=>H.some(ie=>ie.id===ae.id));s($)},[O]),I=F.useCallback(async()=>{if(!t)return;const H=w?.data?.channels.find($=>$.id===t);j({title:"Delete Group",description:`Are you sure you want to permanently delete the group chat "${H?.name||r||"this group"}"? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},()=>{y.mutate()})},[t,r,w,y]),M=F.useMemo(()=>{if(!t)return!0;const H=r.trim()!==o.trim(),$=i.map(ne=>ne.id).sort(),ae=u.sort(),ie=JSON.stringify($)!==JSON.stringify(ae);return H||ie},[t,r,o,i,u]),U=F.useCallback(async()=>{if(!t&&i.length===0){L({title:"Validation Error",description:"Please select at least one agent for the group.",variant:"destructive"});return}const H=a(()=>{const $=i.map(ie=>ie.id),ae=r.trim()||(i.length>0?i.map(ie=>ie.name).join(", "):"Empty Group");t?h.mutate({name:ae,participantIds:$}):V.mutate({name:ae,participantIds:$})},"proceed");if(t&&i.length===0){j({title:"Remove All Agents?",description:"Are you sure you want to remove all agents from this group? This will leave the group with no participants.",confirmText:"Remove All",variant:"destructive"},()=>{H()});return}H()},[t,r,i,V,h,L]),B=t?!M||V.isPending||h.isPending||y.isPending:i.length===0||V.isPending||h.isPending||y.isPending;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50",onClick:e,children:v.jsxs(ya,{className:"w-[80%] max-w-2xl",onClick:a(H=>H.stopPropagation(),"onClick"),children:[v.jsxs(Hm,{className:"flex flex-row items-center justify-between space-y-0",children:[v.jsx(u2,{className:"text-xl font-semibold",children:t?"Edit Group Chat":"Create Group Chat"}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:e,children:v.jsx(Hn,{className:"h-4 w-4"})})]}),v.jsx(ii,{}),v.jsx(Lo,{className:"pt-4",children:v.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[v.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v.jsx("label",{htmlFor:"chat-name",className:"text-sm font-medium",children:"Chat Name (Optional)"}),v.jsx(Vr,{id:"chat-name",value:r,onChange:a(H=>n(H.target.value),"onChange"),className:"w-full bg-background text-foreground",placeholder:"Leave blank to auto-generate from participants",disabled:V.isPending||h.isPending||y.isPending})]}),v.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v.jsxs("label",{htmlFor:"invite-agents",className:"text-sm font-medium",children:["Select Agents"," ",!t&&v.jsx("span",{className:"text-muted-foreground",children:"(Required)"})]}),A?v.jsxs("div",{className:"flex items-center justify-center p-4",children:[v.jsx(cn,{className:"h-6 w-6 animate-spin text-muted-foreground"}),v.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading agents..."})]}):C?v.jsx("div",{className:"flex items-center justify-center p-4 text-red-500",children:"Error loading agents. Please try again later."}):v.jsx(ewe,{options:T,onSelect:S,className:"w-full",initialSelected:p},`group-panel-combobox-${t||"create"}-${O.length}`),i.length>0&&v.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," agent",i.length>1?"s":""," selected"]}),t&&M&&v.jsx("div",{className:"text-sm text-blue-500 mt-1",children:"You have unsaved changes"})]})]})}),v.jsxs(Zm,{className:"flex justify-between pt-4",children:[t&&v.jsxs(nt,{variant:"destructive",onClick:I,disabled:y.isPending||V.isPending||h.isPending||A,children:[y.isPending?v.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}):v.jsx(Yc,{className:"mr-2 h-4 w-4"}),"Delete Group"]}),v.jsxs(nt,{variant:"default",className:t?"":"w-full",onClick:U,disabled:B,children:[(V.isPending||h.isPending)&&v.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}),t?"Update Group":"Create Group"]})]})]})}),v.jsx(Ro,{open:G,onOpenChange:Z,title:z?.title||"",description:z?.description||"",confirmText:z?.confirmText,cancelText:z?.cancelText,variant:z?.variant,onConfirm:K})]})}a(p0,"GroupPanel");function nwe(e,t="00000000-0000-0000-0000-000000000000"){const r=bi();return nn({queryKey:["dmChannels",e,r,t],queryFn:a(async()=>{if(!e)return[];De.info("[useDmChannelsForAgent] Fetching distinct DM channels for agent:",e);const l=((await dr().messaging.getMessageServerChannels(t)).channels||[]).map(n2).filter(u=>{const c=u.metadata||{},d=u.type===It.DM,f=c.isDm===!0,g=c.forAgent===e,m=c.user1===r&&c.user2===e||c.user1===e&&c.user2===r;if(d&&f&&g&&m)return!0;if(u.type===It.DM&&!c.isDm&&!c.forAgent){const w=u.name.toLowerCase(),E=`dm-${r}-${e}`.toLowerCase(),A=`dm-${e}-${r}`.toLowerCase();if(w===E||w===A)return De.warn("[useDmChannelsForAgent] Matched a canonical DM channel by name convention:",u.id,u.name),!0}return!1});return De.info("[useDmChannelsForAgent] Found distinct DM channels:",l.length,l.map(u=>({id:u.id,name:u.name,metadata:u.metadata}))),l.sort((u,c)=>{const d=new Date(u.updatedAt||u.createdAt).getTime();return new Date(c.updatedAt||c.createdAt).getTime()-d})},"queryFn"),enabled:!!e,staleTime:hr.FREQUENT,refetchInterval:hr.STANDARD})}a(nwe,"useDmChannelsForAgent");function iwe(){const e=an(),{toast:t}=Er(),r=bi();return ei({mutationFn:a(async({agentId:n,channelName:i,messageServerId:s="00000000-0000-0000-0000-000000000000"})=>{if(De.info("[useCreateDmChannel] Creating new distinct DM channel with agent:",{agentId:n,channelName:i,messageServerId:s}),!i||!i.trim())throw new Error("Channel name cannot be empty for a new DM conversation.");return await dr().messaging.createGroupChannel({name:i.trim(),participantIds:[r,n],metadata:{type:It.DM,message_server_id:s,isDm:!0,user1:r,user2:n,forAgent:n,createdAt:new Date().toISOString()}})},"mutationFn"),onSuccess:a((n,i)=>{De.info("[useCreateDmChannel] Distinct DM channel created successfully:",n),t({title:"New Chat Started",description:`Conversation "${n.name}" created.`}),e.invalidateQueries({queryKey:["dmChannels",i.agentId,r,i.messageServerId]}),e.invalidateQueries({queryKey:["channels"]})},"onSuccess"),onError:a(n=>{De.error("[useCreateDmChannel] Error creating distinct DM channel:",n),t({title:"Error Creating Chat",description:n instanceof Error?n.message:"Could not start new chat.",variant:"destructive"})},"onError")})}a(iwe,"useCreateDmChannel");function awe(){return nn({queryKey:["currentMessageServer"],queryFn:a(async()=>{De.info("[useCurrentMessageServer] Fetching current message server ID from backend");const t=await dr().messaging.getCurrentMessageServer();return De.info("[useCurrentServer] Current server ID:",t.messageServerId),t.messageServerId},"queryFn"),staleTime:hr.RARE,refetchOnWindowFocus:!0,retry:3})}a(awe,"useCurrentMessageServer");const OA="eliza-agent-sidebar-visible";function swe(){const[e,t]=F.useState(!1);F.useEffect(()=>{try{const i=localStorage.getItem(OA);if(i!==null){const s=JSON.parse(i);t(s)}}catch(i){De.error("Error reading sidebar state from localStorage:",i),t(!1)}},[]);const r=F.useCallback(i=>{t(i);try{localStorage.setItem(OA,JSON.stringify(i))}catch(s){De.error("Error saving sidebar state to localStorage:",s)}},[]),n=F.useCallback(()=>{r(!e)},[e,r]);return{isVisible:e,setSidebarVisible:r,toggleSidebar:n}}a(swe,"useSidebarState");const rv="eliza-main-panel-width",nv="eliza-sidebar-panel-width",iv="eliza-floating-threshold",av=70,sv=30,ov=1400;function owe(){const[e,t]=F.useState(av),[r,n]=F.useState(sv),[i,s]=F.useState(!1),[o,l]=F.useState(ov);F.useEffect(()=>{try{const m=localStorage.getItem(rv),w=localStorage.getItem(nv),E=localStorage.getItem(iv);if(m!==null){const A=parseFloat(m);!isNaN(A)&&A>0&&A<=100&&t(A)}if(w!==null){const A=parseFloat(w);!isNaN(A)&&A>0&&A<=100&&n(A)}if(E!==null){const A=parseFloat(E);!isNaN(A)&&A>0&&l(A)}}catch(m){De.error("Error reading panel sizes from localStorage:",m),t(av),n(sv),l(ov)}},[]),F.useEffect(()=>{const m=a(()=>{const w=window.innerWidth<o;s(w)},"checkFloatingMode");return m(),window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[o]);const u=F.useCallback(m=>{const w=Math.max(20,Math.min(80,m));t(w);try{localStorage.setItem(rv,w.toString())}catch(E){De.error("Error saving main panel size to localStorage:",E)}},[]),c=F.useCallback(m=>{const w=Math.max(20,Math.min(80,m));n(w);try{localStorage.setItem(nv,w.toString())}catch(E){De.error("Error saving sidebar panel size to localStorage:",E)}},[]),d=F.useCallback(m=>{const w=Math.max(320,Math.min(2560,m));l(w);try{localStorage.setItem(iv,w.toString())}catch(E){De.error("Error saving floating threshold to localStorage:",E)}},[]),f=F.useCallback(()=>{s(m=>!m)},[]),g=F.useCallback(()=>{t(av),n(sv),l(ov);try{localStorage.removeItem(rv),localStorage.removeItem(nv),localStorage.removeItem(iv)}catch(m){De.error("Error clearing panel sizes from localStorage:",m)}},[]);return{mainPanelSize:e,sidebarPanelSize:r,isFloatingMode:i,floatingThreshold:o,setMainPanelSize:u,setSidebarPanelSize:c,setFloatingThreshold:d,toggleFloatingMode:f,resetPanelSizes:g}}a(owe,"usePanelWidthState");var oh={exports:{}},lwe=oh.exports,RA;function uwe(){return RA||(RA=1,(function(e,t){(function(r,n){e.exports=n()})(lwe,(function(){return function(r,n,i){r=r||{};var s=n.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(c,d,f,g){return s.fromToBase(c,d,f,g)}a(l,"i"),i.en.relativeTime=o,s.fromToBase=function(c,d,f,g,m){for(var w,E,A,C=f.$locale().relativeTime||o,O=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],R=O.length,P=0;P<R;P+=1){var L=O[P];L.d&&(w=g?i(c).diff(f,L.d,!0):f.diff(c,L.d,!0));var j=(r.rounding||Math.round)(Math.abs(w));if(A=w>0,j<=L.r||!L.r){j<=1&&P>0&&(L=O[P-1]);var G=C[L.l];m&&(j=m(""+j)),E=typeof G=="string"?G.replace("%d",j):G(j,d,L.l,A);break}}if(d)return E;var Z=A?C.future:C.past;return typeof Z=="function"?Z(E):Z.replace("%s",E)},s.to=function(c,d){return l(c,d,this,!0)},s.from=function(c,d){return l(c,d,this)};var u=a(function(c){return c.$u?i.utc():i()},"d");s.toNow=function(c){return this.to(u(this),c)},s.fromNow=function(c){return this.from(u(this),c)}}}))})(oh)),oh.exports}a(uwe,"requireRelativeTime");var cwe=uwe();const dwe=Ol(cwe);lo.extend(dwe);const fwe="00000000-0000-0000-0000-000000000000",hwe=a(e=>{const t=e.rawMessage||{},r=a(d=>{switch(d){case"pending":case"executing":case"running":return"input-streaming";case"completed":case"success":return"output-available";case"failed":case"error":return"output-error";default:return"input-available"}},"mapActionStatusToState"),n=t.actions?.[0]||t.action||"ACTION",i=t.actionStatus||"completed",s=t.actionId,o={};t.actions&&(o.actions=t.actions),t.action&&(o.action=t.action),t.thought&&(o.thought=t.thought);const l={};t.text&&(l.result=t.text),l.status=i,t.thought&&(l.thought=t.thought),t.actionResult&&(l.actionResult=t.actionResult);const c=i==="failed"||i==="error"?t.text||"Action failed":void 0;return{type:n,state:r(i),toolCallId:s,input:Object.keys(o).length>0?o:void 0,output:Object.keys(l).length>0?l:void 0,errorText:c}},"convertActionMessageToToolPart"),pwe=pp.memo(mwe,(e,t)=>{const r=e.message.rawMessage?.actionStatus,n=t.message.rawMessage?.actionStatus;return e.message.id===t.message.id&&e.message.text===t.message.text&&e.message.isLoading===t.message.isLoading&&e.shouldAnimate===t.shouldAnimate&&e.isUser===t.isUser&&r===n});function mwe({message:e,agentForTts:t,shouldAnimate:r,onDelete:n,onRetry:i,isUser:s}){const o=e.type==="agent_action"||e.source==="agent_action";return v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsxs(GL,{isLoading:e.isLoading,...s?{variant:"sent"}:{},...!e.text&&!e.attachments?.length?{className:"bg-transparent"}:{},children:[o?v.jsx(Bve,{toolPart:hwe(e),defaultOpen:!1,className:"max-w-none"}):v.jsx("div",{children:(()=>{if(!e.text)return null;const l=DU(e.text),u=new Set(e.attachments?.map(f=>f.url).filter(Boolean)||[]),c=l.filter(f=>!u.has(f.url)),d=Jve(e.text,l);return v.jsxs("div",{className:"space-y-3",children:[d.trim()&&v.jsx("div",{children:s?v.jsx("div",{className:"whitespace-pre-wrap",children:d}):v.jsx(RU,{className:"max-w-none",isAnimating:r,children:d})}),c.length>0&&v.jsx("div",{className:"space-y-2",children:c.map((f,g)=>v.jsx("div",{children:v.jsx(B4,{url:f.url,title:"Shared media"})},`${f.url}-${g}`))})]})})()}),e.attachments?.filter(l=>l.url&&l.url.trim()!=="").map(l=>v.jsx(B4,{url:l.url,title:l.title||"Attachment"},`${l.url}-${l.title}`))]}),v.jsxs("div",{className:"flex items-center justify-between w-full py-1",children:[v.jsx("div",{children:!s&&(e.text||e.attachments?.length)&&e.createdAt&&v.jsx(soe,{className:"text-muted-foreground",timestamp:lo(e.createdAt).format("LT")})}),v.jsxs("div",{className:"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-500",children:[!s&&e.text&&!e.isLoading&&t?.id&&v.jsxs(v.Fragment,{children:[v.jsx(Wse,{text:e.text}),v.jsx(loe,{agentId:t.id,text:e.text})]}),s&&e.text&&!e.isLoading&&i&&v.jsx(Qse,{onClick:a(()=>i(e.text||""),"onClick")}),v.jsx(Yse,{onClick:a(()=>n(e.id),"onClick")})]})]})]})}a(mwe,"MessageContent");function uB({chatType:e,contextId:t,messageServerId:r,initialDmChannelId:n}){const{toast:i}=Er(),s=an(),{data:o,isLoading:l}=awe(),{isVisible:u,setSidebarVisible:c,toggleSidebar:d}=swe(),{mainPanelSize:f,sidebarPanelSize:g,isFloatingMode:m,setMainPanelSize:w,setSidebarPanelSize:E}=owe(),[A,C]=F.useState({showGroupEditPanel:!1,showProfileOverlay:!1,input:"",inputDisabled:!1,selectedGroupAgentId:null,currentDmChannelId:null,isCreatingDM:!1,isMobile:!1}),P=cp().state?.forceNew||!1;mn();const[L,j]=F.useState(P),G=m||A.isMobile,{confirm:Z,isOpen:K,onOpenChange:z,onConfirm:V,options:h}=Po(),{stopAgent:y,isAgentStopping:b}=Md(),x=F.useCallback(Ze=>{C(Je=>({...Je,...Ze}))},[]),_=bi(),N=F.useRef(null),T=F.useRef(null),k=F.useRef(null),p=F.useRef(!1),S=F.useRef(!1),I=F.useRef(""),{data:M,isLoading:U}=SL(e===It.DM?t:void 0,{enabled:e===It.DM}),B=M?.data,{handleDelete:H,isDeleting:$}=UU(B||{}),ae=F.useMemo(()=>r||o||fwe,[r,o]),{data:ie=[],isLoading:ne}=nwe(e===It.DM?t:void 0,ae),Ne=iwe(),{data:ve}=Hae(e===It.GROUP?t:void 0),{data:he}=o2(e===It.GROUP?t:void 0),Se=he?.data,{data:Q}=Id(),se=Q?.agents||[],J=ie[0],te=e===It.DM?A.currentDmChannelId||void 0:t||void 0,{data:de=[],isLoading:be}=kL(J?.id,ae),{messages:Ae,isLoading:oe,addMessage:Y,updateMessage:ee,removeMessage:X,sendMessage:W}=Vve({channelId:te,serverId:ae,agentId:e===It.DM?t:void 0,chatType:e,onMessageAdded:a(Ze=>{mt(),Ze.isAgent&&Re()},"onMessageAdded"),onMessageUpdated:a((Ze,Je)=>{!Je.isLoading&&Je.isLoading!==void 0&&Re()},"onMessageUpdated"),onInputDisabledChange:a(Ze=>x({inputDisabled:Ze}),"onInputDisabledChange")}),q=F.useMemo(()=>e!==It.GROUP||!Se?[]:Se.map(Ze=>se.find(Je=>Je.id===Ze)).filter(Boolean),[e,Se,se]),re=F.useMemo(()=>se.reduce((Ze,Je)=>(Je.id&&typeof Je.settings?.avatar=="string"&&(Ze[Je.id]=Je.settings.avatar),Ze),{}),[se]),Oe=F.useCallback(Ze=>se.find(Je=>Je.id===Ze),[se]),{scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,autoScrollEnabled:ge}=Rve({smooth:!0}),_e=F.useRef(0),Re=F.useCallback(()=>{Ee.current&&setTimeout(()=>xe(),0)},[xe,Ee]),ze=F.useRef(!1),Pe=F.useRef(null),We=F.useCallback(async Ze=>{if(!Ze||e!=="DM")return;if(J)try{const Ft=await dr().messaging.getChannelMessages(J.id,{limit:30}),Ot=$e(J.name),nr=(Ft?.messages?.length??0)===0;if(Ot&&nr){A.currentDmChannelId===J.id?i({title:"Already in a fresh chat",description:`You're already in a new chat with ${B?.name||"the agent"}.`}):(x({currentDmChannelId:J.id}),i({title:"Chat opened",description:`You can now start chatting with ${B?.name||"the agent"}.`})),x({currentDmChannelId:J.id});return}else De.info("[Chat] Latest DM channel has messages or customized name, proceeding to create a new one.")}catch(xt){De.error("[Chat] Failed to fetch latest DM channel messages:",xt)}const Je=`Chat - ${lo().format("MMM D, HH:mm:ss")}`;De.info(`[Chat] Creating new distinct DM channel with agent ${Ze}, name: "${Je}"`),x({isCreatingDM:!0});try{ze.current=!0,De.info("[Chat] About to create DM channel with messageServerId:",ae);const xt=await Ne.mutateAsync({agentId:Ze,channelName:Je,messageServerId:ae});x({currentDmChannelId:xt.id,input:""}),setTimeout(()=>Re(),150)}catch(xt){De.error("[Chat] Error creating new distinct DM channel:",xt),x({currentDmChannelId:null,input:""})}finally{x({isCreatingDM:!1}),i({title:"Chat opened",description:`You can now start chatting with ${B?.name||"the agent"}.`})}},[e,Ne,x,Re,J,ae,B,i]),_t=F.useCallback(Ze=>{const Je=ie.find(xt=>xt.id===Ze);Je&&(De.info(`[Chat] DM Channel selected: ${Je.name} (Channel ID: ${Je.id})`),x({currentDmChannelId:Je.id,input:""}),setTimeout(()=>Re(),150))},[ie,x,Re]),Ve=F.useCallback(()=>{if(e!==It.DM||!A.currentDmChannelId||!B?.id)return;const Ze=ie.find(Je=>Je.id===A.currentDmChannelId);Ze&&Z({title:"Delete Chat",description:`Are you sure you want to delete the chat "${Ze.name}" with ${B.name}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},async()=>{De.info(`[Chat] Deleting DM channel ${Ze.id}`);try{await dr().messaging.deleteChannel(Ze.id),s.setQueryData(["dmChannels",B.id,_],Ft=>Ft?.filter(Ot=>Ot.id!==Ze.id)),s.invalidateQueries({queryKey:["dmChannels",B.id,_]}),s.invalidateQueries({queryKey:["channels"]}),i({title:"Chat Deleted",description:`"${Ze.name}" was deleted.`});const xt=s.getQueryData(["dmChannels",B.id,_])||[];xt.length>0?(x({currentDmChannelId:xt[0].id}),De.info("[Chat] Switched to DM channel:",xt[0].id)):(De.info("[Chat] No DM channels left after deletion. Will create a fresh chat once."),x({currentDmChannelId:null}),ze.current=!1,await We(B.id))}catch(Je){De.error("[Chat] Error deleting DM channel:",Je),i({title:"Error",description:"Could not delete chat. The server might not support this action yet.",variant:"destructive"})}})},[e,A.currentDmChannelId,B,ie,Z,i,x,We,s,_]);F.useEffect(()=>{J&&!be&&de&&B?.id&&L&&(We(B.id),j(!1))},[L,j,We,B?.id,J,de,be]),F.useEffect(()=>{p.current=A.inputDisabled},[A.inputDisabled]),F.useEffect(()=>{const Ze=ie.find(Je=>Je.id===A.currentDmChannelId);Ze?.name&&(I.current=Ze.name)},[ie,A.currentDmChannelId]),F.useEffect(()=>{!ne&&ie.length>0&&(De.info("[Chat] Selecting first available DM channel:",ie[0].id),x({currentDmChannelId:ie[0].id}))},[ie,ne,x]);const Te=F.useCallback(Ze=>{if(e===It.DM&&t&&Ze&&typeof window<"u"){const Je=`/chat/${t}/${Ze}`;window.location.pathname!==Je&&window.history&&window.history.replaceState(null,"",Je)}},[e,t]);F.useEffect(()=>{A.currentDmChannelId&&Te(A.currentDmChannelId)},[A.currentDmChannelId,Te]),F.useEffect(()=>{if(De.info("[Chat] URL navigation effect triggered",{initialDmChannelId:n,agentDmChannelsLength:ie.length,isLoadingAgentDmChannels:ne,currentDmChannelId:A.currentDmChannelId}),n&&ie.length>0&&!ne&&!S.current){if(!Lc(n)){De.warn("[Chat] Invalid channel ID format from URL:",n),S.current=!0;return}ie.some(xt=>xt.id===n)?(De.info("[Chat] Switching to channel from URL:",n),x({currentDmChannelId:n}),S.current=!0):(De.warn("[Chat] Channel from URL not found, staying with current channel",{initialDmChannelId:n,availableChannels:ie.map(xt=>xt.id)}),S.current=!0)}},[n,ie,ne,x]),F.useEffect(()=>{if(e===It.DM&&B?.id){if(!(!A.currentDmChannelId||ie.some(Je=>Je.id===A.currentDmChannelId))&&!ne&&!A.isCreatingDM&&!Ne.isPending){De.info(`[Chat] Current DM channel ${A.currentDmChannelId} doesn't belong to agent ${B.id}, clearing it`),x({currentDmChannelId:null});return}!ne&&!l&&ie.length===0&&!n&&!ze.current&&!A.isCreatingDM&&!Ne.isPending&&(De.info("[Chat] No existing DM channels found; auto-creating a fresh one."),ze.current=!0,We(B.id))}else e!==It.DM&&A.currentDmChannelId!==null&&x({currentDmChannelId:null})},[e,B?.id,ie,ne,l,Ne.isPending,A.isCreatingDM,A.currentDmChannelId,n,x,We]),F.useEffect(()=>(ie.length>0&&Pe.current&&(clearTimeout(Pe.current),Pe.current=null),()=>{Pe.current&&(clearTimeout(Pe.current),Pe.current=null)}),[ie]),F.useEffect(()=>{e===It.GROUP&&q.length===1&&!A.selectedGroupAgentId&&(x({selectedGroupAgentId:q[0].id}),u||c(!0))},[e,q,A.selectedGroupAgentId,x,u,c]);const{mutate:Ye}=Zae(),{mutate:Me}=Gae();F.useEffect(()=>{const Ze=_e.current===0&&Ae.length>0,Je=Ae.length!==_e.current&&_e.current!==0;Ze?(De.debug("[chat] Initial messages loaded, scrolling to bottom.",{count:Ae.length}),Re()):Je&&(ge?(De.debug("[chat] New messages and autoScroll enabled, scrolling."),Re()):De.debug("[chat] New messages, but autoScroll is disabled (user scrolled up).")),_e.current=Ae.length},[Ae,ge,Re,te]);function $e(Ze){return!!Ze?.match(/^Chat - [A-Z][a-z]{2} \d{1,2}, \d{2}:\d{2}(:\d{2})?$/)}a($e,"isAutoGeneratedChatName");const mt=a(async()=>{if(!(!!I.current&&$e(I.current)&&e===It.DM))return;if(!te||!A.currentDmChannelId){De.warn("Cannot update chat title: missing channel ID");return}const Je=dr(),Ft=(await Je.messaging.generateChannelTitle(te,t))?.title,Ot=await Je.messaging.getChannelParticipants(A.currentDmChannelId);if(Ft&&Ot){let nr=[];Ot&&Array.isArray(Ot.participants)?nr=Ot.participants.map(ir=>ir.userId):Ot&&Array.isArray(Ot)&&(nr=Ot.map(ir=>ir.userId||ir.id||ir)),await Je.messaging.updateChannel(te,{name:Ft,participantCentralUserIds:nr});const wr=bi();s.invalidateQueries({queryKey:["dmChannels",t,wr]})}},"updateChatTitle"),{selectedFiles:ue,handleFileChange:me,removeFile:He,createBlobUrls:Ie,uploadFiles:je,cleanupBlobUrls:rt,clearFiles:ce}=zve({agentId:B?.id,channelId:te,chatType:e}),Ce=a(Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&!Ze.nativeEvent.isComposing&&(Ze.preventDefault(),et())},"handleKeyDown"),et=a(async Ze=>{Ze?.preventDefault();let Je=te;if(e===It.DM&&!Je&&B?.id){if(A.isCreatingDM||Ne.isPending){De.info("[Chat] DM channel creation already in progress; will wait for it to finish instead of creating another.");return}De.info("[Chat] No DM channel selected, creating one before sending message");try{ze.current=!0;const er=await Ne.mutateAsync({agentId:B.id,channelName:`Chat - ${lo().format("MMM D, HH:mm")}`,messageServerId:ae});x({currentDmChannelId:er.id}),Je=er.id,await new Promise(Ar=>setTimeout(Ar,100))}catch(er){De.error("[Chat] Failed to create DM channel before sending message:",er),i({title:"Error",description:"Failed to create chat channel. Please try again.",variant:"destructive"}),x({inputDisabled:!1});return}}if(!A.input.trim()&&ue.length===0||p.current||!Je||!ae||!_||e===It.DM&&!B?.id)return;const xt=Bn();let Ft=A.input.trim();const Ot=A.input;x({input:"",inputDisabled:!0});const nr=[...ue];ce(),k.current?.reset();const wr=Ie(nr),ir={id:xt,text:Ft,name:Fa,createdAt:Date.now(),senderId:_,isAgent:!1,isLoading:!0,channelId:Je,messageServerId:ae,source:e===It.DM?zd:Ru,attachments:wr};(Ft||nr.length>0)&&Y(ir),Re();try{let er=[];if(nr.length>0){const{uploaded:or,failed:mr,blobUrls:kr}=await je(nr);er=or,mr.length>0&&ee(xt,{attachments:ir.attachments?.filter(Cr=>!mr.some(Mr=>Mr.file.id===Cr.id))}),rt(kr),!Ft.trim()&&er.length>0&&(Ft=`Shared ${er.length} file(s).`)}const Ir=DU(Ot).map((or,mr)=>({id:`textmedia-${xt}-${mr}`,url:or.url,title:or.type==="image"?"Image":or.type==="video"?"Video":"Media Link",source:"user_input_url",contentType:or.type==="image"?fh.IMAGE:or.type==="video"?fh.VIDEO:void 0})),pr=[...er,...Ir],Sr=Ft||(pr.length>0?"Shared content.":"");if(!Sr.trim()&&pr.length===0){x({inputDisabled:!1}),X(xt);return}await W(Sr,{attachments:pr.length>0?pr:void 0,messageId:xt,source:e===It.DM?zd:Ru,skipOptimisticUpdate:!0,overrideChannelId:Je})}catch(er){De.error("Error sending message or uploading files:",er),i({title:"Error Sending Message",description:er instanceof Error?er.message:"Could not send message.",variant:"destructive"}),ee(xt,{isLoading:!1,text:`${ir.text||"Attachment(s)"} (Failed to send)`}),x({inputDisabled:!1})}finally{N.current?.focus()}},"handleSendMessage"),ke=a(Ze=>{if(!te||!Ze)return;const Je=Lc(Ze);Je&&(X(Ze),Ye({channelId:te,messageId:Je}))},"handleDeleteMessage"),tt=a(async Ze=>{if(p.current||!Ze.text?.trim()&&Ze.attachments?.length===0)return;x({inputDisabled:!0});const Je=Bn(),xt=Ze.text?.trim()||`Shared ${Ze.attachments?.length} file(s).`,Ft={id:Je,text:Ze.text,name:Fa,createdAt:Date.now(),senderId:_,isAgent:!1,isLoading:!0,channelId:Ze.channelId,messageServerId:ae,source:e===It.DM?zd:Ru,attachments:Ze.attachments};if(Y(Ft),Re(),!ae||!te){De.error("Cannot retry message: missing server or channel ID"),i({title:"Error Sending Message",description:"Missing required channel information.",variant:"destructive"}),x({inputDisabled:!1}),X(Je);return}try{await W(xt,{attachments:Ze.attachments,messageId:Je,source:e===It.DM?zd:Ru,skipOptimisticUpdate:!0,overrideChannelId:te})}catch(Ot){De.error("Error sending message or uploading files:",Ot),i({title:"Error Sending Message",description:Ot instanceof Error?Ot.message:"Could not send message.",variant:"destructive"}),ee(Je,{isLoading:!1,text:`${Ft.text||"Attachment(s)"} (Failed to send)`}),x({inputDisabled:!1})}},"handleRetryMessage"),Tt=a(()=>{if(!te)return;const Ze=e===It.DM?`Clear all messages in this chat with ${B?.name}?`:"Clear all messages in this group chat?";Z({title:"Clear Chat",description:`${Ze} This action cannot be undone.`,confirmText:"Clear",variant:"destructive"},()=>{Me(te)})},"handleClearChat");if(F.useEffect(()=>{const Ze=a(()=>{const Je=window.innerWidth<768;x({isMobile:Je})},"checkMobile");return Ze(),window.addEventListener("resize",Ze),()=>window.removeEventListener("resize",Ze)},[x]),e===It.DM&&(U||!B&&t||ne))return v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(cn,{className:"h-8 w-8 animate-spin text-primary"})});if(!te||!ae||e===It.DM&&!B)return v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"Loading chat context..."})});const Ke=a(()=>{$||Z({title:"Delete Agent",description:`Are you sure you want to delete the agent "${B?.name}"? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},H)},"onDeleteAgent"),st=a(()=>{if(e===It.DM&&B)return v.jsxs("div",{className:"flex items-center justify-between mb-4 p-3",children:[v.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:v.jsxs(Bc,{children:[v.jsx(zc,{asChild:!0,children:v.jsxs(nt,{variant:"ghost",size:"sm",className:"py-6 px-2 flex-shrink-0",children:[v.jsxs("div",{className:"relative flex-shrink-0",children:[v.jsx(Ts,{className:"size-4 sm:size-10 border rounded-full",children:v.jsx(So,{src:Dc(B)})}),B?.status===zn.ACTIVE?v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx("span",{className:"absolute bottom-0 right-0 size-2 sm:size-[10px] rounded-full border border-white bg-green-500"})}),v.jsx(jr,{side:"right",children:v.jsx("p",{children:"Agent is active"})})]}):v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx("span",{className:"absolute bottom-0 right-0 size-2 sm:size-[10px] rounded-full border border-white bg-muted-foreground"})}),v.jsx(jr,{side:"right",children:v.jsx("p",{children:"Agent is inactive"})})]})]}),v.jsx("div",{children:v.jsx("h2",{className:"font-semibold text-lg truncate max-w-[80px] sm:max-w-none",children:B?.name||"Agent"})}),v.jsx(ha,{className:"size-4"})]})}),v.jsxs(Fc,{align:"start",side:"bottom",className:"min-w-36 w-[var(--radix-dropdown-menu-trigger-width)]",children:[v.jsxs(la,{onClick:a(()=>{z_(B,i)},"onClick"),children:[v.jsx(sT,{className:"h-4 w-4 mr-2"}),"Export"]}),v.jsx(Vh,{}),v.jsxs(la,{onClick:a(()=>{B&&!b(B.id)&&y(B)},"onClick"),children:[v.jsx(Fy,{className:"h-4 w-4 mr-2"}),"Stop Agent"]}),v.jsxs(la,{onClick:a(()=>{B&&!$&&Ke()},"onClick"),className:"text-destructive focus:text-destructive hover:bg-red-50 dark:hover:bg-red-950/50",children:[v.jsx(Yc,{className:"h-4 w-4 mr-2"}),"Delete Agent"]})]})]})}),v.jsx("div",{className:"flex gap-1 sm:gap-2 items-center flex-shrink-0",children:e===It.DM&&v.jsxs("div",{className:"flex items-center gap-2",children:[ie.length>0&&v.jsxs(Bc,{children:[v.jsx(zc,{asChild:!0,children:v.jsxs(nt,{variant:"outline",size:"sm",className:"w-8 h-9 sm:max-w-[300px] sm:w-auto rounded-[12px]",children:[v.jsx(hp,{className:"size-4 flex-shrink-0 text-muted-foreground"}),v.jsx("span",{className:"hidden md:inline truncate text-xs sm:text-sm",children:ie.find(Ze=>Ze.id===A.currentDmChannelId)?.name||"Select Chat"}),v.jsx(ha,{className:"hidden md:inline-flex size-4 text-muted-foreground"})]})}),v.jsxs(Fc,{align:"end",className:"w-[280px] sm:w-[320px]",children:[v.jsxs(fne,{className:"font-medium",children:["Chat History with ",B.name]}),v.jsx(Vh,{}),v.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:ie.map(Ze=>v.jsx(la,{onClick:a(()=>_t(Ze.id),"onClick"),className:Ue("cursor-pointer",Ze.id===A.currentDmChannelId&&"bg-muted"),children:v.jsxs("div",{className:"flex items-center justify-between w-full",children:[v.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[v.jsx("span",{className:Ue("text-sm truncate",Ze.id===A.currentDmChannelId&&"font-medium"),children:Ze.name}),v.jsx("span",{className:"text-xs text-muted-foreground",children:lo((typeof Ze.metadata?.createdAt=="string"||typeof Ze.metadata?.createdAt=="number"?Ze.metadata.createdAt:null)||Ze.updatedAt||Ze.createdAt).fromNow()})]}),Ze.id===A.currentDmChannelId&&v.jsx(Ri,{variant:"default",className:"text-xs flex-shrink-0 ml-2",children:"Current"})]})},Ze.id))})]})]}),v.jsx(jy,{mainAction:{label:A.isCreatingDM?"Creating...":v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"sm:hidden",children:"New"}),v.jsx("span",{className:"hidden sm:inline",children:"New Chat"})]}),onClick:a(()=>We(B?.id),"onClick"),icon:A.isCreatingDM?v.jsx(cn,{className:"size-4 animate-spin"}):v.jsx(dp,{className:"size-4"}),disabled:A.isCreatingDM||ne},actions:[{label:"Clear Chat",onClick:Tt,icon:v.jsx(s1,{className:"size-4"}),disabled:!Ae||Ae.length===0},{label:"Delete Chat",onClick:Ve,icon:v.jsx(fo,{className:"size-4"}),disabled:!A.currentDmChannelId,variant:"destructive"}],variant:"outline",size:"sm",mainButtonClassName:"rounded-l-[12px] h-9",dropdownButtonClassName:"rounded-r-[12px] h-9"}),v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx(nt,{className:"w-9 h-9 rounded-[12px]",variant:"outline",onClick:d,children:u?v.jsx(y0,{className:"size-4"}):v.jsx(o1,{className:"size-4"})})}),v.jsx(jr,{side:"bottom",children:v.jsx("p",{children:u?"Close SidePanel":"Open SidePanel"})})]})]})})]});if(e===It.GROUP){const Ze=D_(ve?.data||void 0,q,_);return v.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-card rounded-lg border",children:[v.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:v.jsx("h2",{className:"font-semibold text-lg truncate",title:Ze,children:Ze})}),v.jsxs("div",{className:"flex gap-1 sm:gap-2 items-center flex-shrink-0",children:[v.jsx(jy,{mainAction:{label:"Edit Group",onClick:a(()=>x({showGroupEditPanel:!0}),"onClick"),icon:v.jsx(Tz,{className:"size-4"})},actions:[{label:"Clear Messages",onClick:Tt,icon:v.jsx(s1,{className:"size-4"}),disabled:!Ae||Ae.length===0},{label:"Delete Group",onClick:a(()=>{if(!te||!ae)return;const Je=te;Z({title:"Delete Group",description:"Are you sure you want to delete this group? This action cannot be undone.",confirmText:"Delete",variant:"destructive"},async()=>{try{await dr().messaging.deleteChannel(Je),i({title:"Group Deleted",description:"The group has been successfully deleted."}),window.location.href="/"}catch(xt){De.error("[Chat] Error deleting group:",xt),i({title:"Error",description:"Could not delete group.",variant:"destructive"})}})},"onClick"),icon:v.jsx(fo,{className:"size-4"}),disabled:!te||!ae,variant:"destructive"}],variant:"outline",size:"sm",className:"px-2 sm:px-3"}),v.jsx(nt,{variant:"ghost",size:"sm",className:"px-2 sm:px-3 h-8 w-8 sm:w-auto",onClick:d,children:u?v.jsx(y0,{className:"h-4 w-4"}):v.jsx(o1,{className:"h-4 w-4"})})]})]}),q.length>0&&v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-card rounded-lg border overflow-x-auto",children:[v.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap flex-shrink-0",children:"Agents:"}),v.jsxs("div",{className:"flex gap-2 min-w-0",children:[v.jsx(nt,{variant:A.selectedGroupAgentId?"ghost":"default",size:"sm",onClick:a(()=>x({selectedGroupAgentId:null}),"onClick"),className:"flex items-center gap-2 flex-shrink-0",children:v.jsx("span",{children:"All"})}),q.map(Je=>v.jsxs(nt,{variant:A.selectedGroupAgentId===Je?.id?"default":"ghost",size:"sm",onClick:a(()=>{x({selectedGroupAgentId:Je?.id||null}),Je?.id&&!u&&c(!0)},"onClick"),className:"flex items-center gap-2 flex-shrink-0",children:[v.jsx(Ts,{className:"size-5",children:v.jsx(So,{src:Dc(Je)})}),v.jsx("span",{className:"truncate max-w-[100px] sm:max-w-none",children:Je?.name})]},Je?.id))]})]})]})}return null},"renderChatHeader");return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"h-full flex flex-col relative overflow-hidden",children:[G?v.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[v.jsx("div",{className:"flex-shrink-0 p-2 sm:p-4 pb-0",children:st()}),v.jsxs("div",{className:Ue("flex flex-col transition-all duration-300 w-full flex-1 min-h-0 overflow-hidden p-2 sm:p-4 pt-0"),children:[v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden px-5 py-2",children:v.jsx(MA,{messages:Ae,isLoadingMessages:oe,chatType:e,currentClientEntityId:_,targetAgentData:B,allAgents:se,scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,finalChannelId:te,getAgentInMessage:Oe,agentAvatarMap:re,onDeleteMessage:ke,onRetryMessage:a(Ze=>{if(!te){i({title:"Error",description:"Cannot retry message: missing channel information.",variant:"destructive"});return}const Je={id:Bn(),text:Ze,name:Fa,senderId:_,isAgent:!1,createdAt:Date.now(),channelId:te,messageServerId:ae};tt(Je)},"onRetryMessage"),selectedGroupAgentId:A.selectedGroupAgentId})}),v.jsx("div",{className:"flex-shrink-0",children:v.jsx(CA,{input:A.input,setInput:a(Ze=>x({input:Ze}),"setInput"),inputDisabled:A.inputDisabled,selectedFiles:ue,removeFile:He,handleFileChange:me,handleSendMessage:et,handleKeyDown:Ce,chatType:e,targetAgentData:B,formRef:k,inputRef:N,fileInputRef:T})})]})]}):v.jsxs(Pve,{orientation:"horizontal",className:"h-full flex-1 overflow-hidden",onLayoutChange:a(Ze=>{const Je=Ze["main-panel"],xt=Ze["sidebar-panel"];Je!==void 0&&xt!==void 0&&u&&!A.isMobile&&(w(Je),E(xt))},"onLayoutChange"),children:[v.jsx(gA,{id:"main-panel",defaultSize:u&&!A.isMobile?f:100,minSize:A.isMobile?100:50,children:v.jsx("div",{className:"relative h-full overflow-hidden",children:v.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[v.jsx("div",{className:"flex-shrink-0 p-2 sm:p-4 pb-0",children:st()}),v.jsxs("div",{className:Ue("flex flex-col transition-all duration-300 w-full flex-1 min-h-0 overflow-hidden p-2 sm:p-4 pt-0"),children:[v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden px-5 py-2",children:v.jsx(MA,{messages:Ae,isLoadingMessages:oe,chatType:e,currentClientEntityId:_,targetAgentData:B,allAgents:se,scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,finalChannelId:te,getAgentInMessage:Oe,agentAvatarMap:re,onDeleteMessage:ke,onRetryMessage:a(Ze=>{if(!te){i({title:"Error",description:"Cannot retry message: missing channel information.",variant:"destructive"});return}const Je={id:Bn(),text:Ze,name:Fa,senderId:_,isAgent:!1,createdAt:Date.now(),channelId:te,messageServerId:ae};tt(Je)},"onRetryMessage"),selectedGroupAgentId:A.selectedGroupAgentId})}),v.jsx("div",{className:"flex-shrink-0",children:v.jsx(CA,{input:A.input,setInput:a(Ze=>x({input:Ze}),"setInput"),inputDisabled:A.inputDisabled,selectedFiles:ue,removeFile:He,handleFileChange:me,handleSendMessage:et,handleKeyDown:Ce,chatType:e,targetAgentData:B,formRef:k,inputRef:N,fileInputRef:T})})]})]})})}),(()=>{let Ze,Je="Agent",xt;return e===It.DM?(Ze=t,Je=B?.name||"Agent",xt=A.currentDmChannelId||void 0):e===It.GROUP&&A.selectedGroupAgentId?(Ze=A.selectedGroupAgentId,Je=se.find(Ot=>Ot.id===A.selectedGroupAgentId)?.name||"Group Member",xt=t):e===It.GROUP&&!A.selectedGroupAgentId&&(Je="Group",xt=t),u&&!A.isMobile&&v.jsxs(v.Fragment,{children:[v.jsx(Lve,{withHandle:!0}),v.jsx(gA,{id:"sidebar-panel",defaultSize:g,minSize:15,maxSize:85,children:v.jsx(NA,{agentId:Ze,agentName:Je,channelId:xt})})]})})()]}),(()=>{let Ze,Je="Agent",xt;return e===It.DM?(Ze=t,Je=B?.name||"Agent",xt=A.currentDmChannelId||void 0):e===It.GROUP&&A.selectedGroupAgentId?(Ze=A.selectedGroupAgentId,Je=se.find(Ot=>Ot.id===A.selectedGroupAgentId)?.name||"Group Member",xt=t):e===It.GROUP&&!A.selectedGroupAgentId&&(Je="Group",xt=t),u&&G&&v.jsx("div",{className:"absolute inset-0 z-50 bg-background/80 backdrop-blur-sm",children:v.jsx("div",{className:"absolute inset-0 bg-background shadow-lg",children:v.jsxs("div",{className:"h-full flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[v.jsx("h3",{className:"font-semibold text-lg",children:Je}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>c(!1),"onClick"),className:"h-8 w-8 p-0",children:v.jsx(y0,{className:"h-4 w-4"})})]}),v.jsx("div",{className:"flex-1 overflow-hidden",children:v.jsx(NA,{agentId:Ze,agentName:Je,channelId:xt})})]})})})})()]}),A.showGroupEditPanel&&e===It.GROUP&&v.jsx(p0,{onClose:a(()=>x({showGroupEditPanel:!1}),"onClose"),channelId:t}),A.showProfileOverlay&&e===It.DM&&B?.id&&v.jsx(HL,{isOpen:A.showProfileOverlay,onClose:a(()=>x({showProfileOverlay:!1}),"onClose"),agentId:B.id}),v.jsx(Ro,{open:K,onOpenChange:z,title:h?.title||"",description:h?.description||"",confirmText:h?.confirmText,cancelText:h?.cancelText,variant:h?.variant,onConfirm:V})]})}a(uB,"Chat");function gwe(){const{agentId:e,channelId:t}=Qy(),r=mn();F.useEffect(()=>(De.info("[AgentRoute] Component mounted/updated",{agentId:e,channelId:t}),()=>{De.info("[AgentRoute] Component unmounted",{agentId:e,channelId:t})}),[e,t]);const{agent:n,isLoading:i,isStarting:s,start:o}=Gm(e);if(!e)return v.jsx("div",{className:"p-4",children:"Agent ID not provided."});if(i||!n)return v.jsx("div",{className:"p-4 flex items-center justify-center h-full","data-testid":"loader",children:v.jsx(cn,{className:"h-8 w-8 animate-spin text-primary"})});const l=n.status===zn.ACTIVE,u=a(()=>{n&&o()},"handleStartAgent");return l?(De.info("[AgentRoute] Agent is active, rendering chat for DM",{agentName:n?.name,dmChannelIdFromRoute:t}),v.jsx(uB,{chatType:It.DM,contextId:e,initialDmChannelId:t},`${e}-${t||"no-dm-channel"}`)):(De.info("[AgentRoute] Agent is not active, rendering inactive state UI",{agentName:n?.name}),v.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8 text-center",children:[v.jsxs("h2",{className:"text-2xl font-semibold mb-4",children:[n.name," is not active."]}),v.jsx("p",{className:"text-muted-foreground mb-6",children:"Press the button below to start this agent."}),v.jsxs("div",{className:"flex gap-3",children:[v.jsx(nt,{onClick:a(()=>r(`/settings/${e}`),"onClick"),variant:"outline",size:"lg",children:v.jsx(ho,{className:"h-5 w-5"})}),v.jsxs(nt,{onClick:u,disabled:s,size:"lg",children:[s?v.jsx(cn,{className:"mr-2 h-5 w-5 animate-spin"}):v.jsx(Zy,{className:"mr-2 h-5 w-5"}),s?"Starting Agent...":"Start Agent"]})]})]}))}a(gwe,"AgentRouteContent");function PA(){return v.jsx(gwe,{})}a(PA,"AgentRoute");function bwe(){return v.jsx("div",{className:"h-full w-full overflow-y-auto",children:v.jsx("div",{className:"min-h-full flex w-full justify-center px-4 sm:px-6 py-4",children:v.jsx("div",{className:"w-full max-w-4xl min-w-0",children:v.jsx(tL,{})})})})}a(bwe,"AgentCreatorRoute");function vwe({className:e,...t}){return v.jsx(Nz,{"data-slot":"switch",className:Ue("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-4 w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",e),...t,children:v.jsx(Iz,{"data-slot":"switch-thumb",className:Ue("bg-background dark:data-[state=unchecked]:bg-primary-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block h-2.5 w-2.5 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%+10px)] data-[state=unchecked]:translate-x-0")})})}a(vwe,"Switch");const ywe=a(({agent:e,onChat:t})=>{const r=mn(),{startAgent:n,stopAgent:i,isAgentStarting:s,isAgentStopping:o}=Md();if(!e||!e.id)return De.error("[AgentCard] Agent data or ID is missing",{agent:e}),v.jsx(ya,{className:"p-4 min-h-[100px] flex items-center justify-center text-muted-foreground",children:"Agent data not available."});const l=e.id,u=e.name||"Unnamed Agent",c=Array.isArray(e.bio)?e.bio.filter(Boolean).join(" ").trim():typeof e.bio=="string"&&e.bio.trim()||"Engages with all types of questions and conversations",d=e.status===zn.ACTIVE,f=s(e.id),g=o(e.id),m={id:e.id,name:u,username:e.username||u,bio:e.bio||"",messageExamples:e.messageExamples||[],postExamples:e.postExamples||[],topics:e.topics||[],adjectives:e.adjectives||[],knowledge:e.knowledge||[],plugins:e.plugins||[],settings:e.settings||{},secrets:e.secrets||{},style:e.style||{},system:e.system||void 0,templates:e.templates||{},enabled:typeof e.enabled=="boolean"?e.enabled:!0,status:e.status||zn.INACTIVE,createdAt:typeof e.createdAt=="number"?e.createdAt:Date.now(),updatedAt:typeof e.updatedAt=="number"?e.updatedAt:Date.now()},w=a(()=>{n(m)},"handleStart"),E=a(()=>{i(m)},"handleStop"),A=a((R=!1)=>{t(R)},"handleNewChat"),C=a(()=>{r(`/settings/${l}`)},"handleSettings"),O=a(()=>{d?E():w()},"handleToggle");return v.jsx(ya,{className:Ue("w-full transition-all bg-card border border-border/50 rounded-sm hover:bg-card/50 cursor-pointer",d?"":"opacity-75"),"data-testid":"agent-card",onClick:a(R=>{R.stopPropagation(),A()},"onClick"),children:v.jsxs(Lo,{className:"p-0 relative h-full",children:[v.jsx("div",{className:"absolute top-3 right-3",children:v.jsx(vwe,{checked:d,onCheckedChange:a(R=>{R!==d&&O()},"onCheckedChange"),onClick:a(R=>R.stopPropagation(),"onClick"),"aria-label":`Toggle ${u}`,disabled:f||g,className:Ue(d?"data-[state=checked]:!bg-green-600":"data-[state=unchecked]:!bg-gray-500/80")})}),v.jsxs("div",{className:"flex flex-col justify-between h-full",children:[v.jsxs("div",{className:"flex items-center gap-4 p-2 h-[90%]",children:[v.jsxs(Ts,{className:"h-16 w-16 flex-shrink-0 rounded-sm",children:[v.jsx(So,{src:Dc(e),alt:u}),v.jsx(zm,{className:"text-lg font-medium rounded-sm",children:_o(u)})]}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("h3",{className:"font-semibold text-xl mb-1 truncate",title:u,children:u}),v.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:c})]})]}),v.jsx("div",{className:"border-t border-muted"}),v.jsxs("div",{className:"flex items-center justify-between py-1 px-2",children:[v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(R=>{R.stopPropagation(),C()},"onClick"),className:"h-8 w-8 p-0 hover:bg-muted/50 cursor-pointer",children:v.jsx(ho,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:a(R=>{R.stopPropagation(),A(!0)},"onClick"),className:"h-8 px-2 rounded-sm bg-muted hover:bg-muted/50 cursor-pointer",children:"New Chat"})]})]})]})})},"AgentCard"),wwe=a(({group:e})=>{const t=mn(),r=bi(),[n,i]=F.useState(!1);if(!e||!e.id)return v.jsx(ya,{className:"p-4 min-h-[180px] flex items-center justify-center text-muted-foreground",children:"Group data not available."});const s=D_(e,e.participants||[],r),o=a(()=>{t(`/group/${e.id}?messageServerId=${e.server_id}`)},"handleChatClick"),{data:l}=Id(),u=l?.agents||[],{data:c}=o2(e.id),d=c?.data,f=d&&Array.isArray(d)?d:[],g=f?u.filter(E=>E.id&&f.includes(E.id)):[],m=a(()=>{i(!0)},"handleSettings"),w=g.map(E=>E.name).filter(Boolean).join(", ")||"No members";return v.jsxs(v.Fragment,{children:[v.jsx(ya,{className:"w-full transition-all bg-card border border-border/50 rounded-sm","data-testid":"agent-card",children:v.jsx(Lo,{className:"p-0 relative h-full",children:v.jsxs("div",{className:"flex flex-col justify-between h-full",children:[v.jsxs("div",{className:"flex items-center gap-4 p-2 h-[90%]",children:[v.jsx(Ts,{className:"bg-[#282829] h-16 w-16 flex-shrink-0 rounded-[3px] relative overflow-hidden",children:g&&g.length>0?v.jsxs("div",{className:"grid grid-cols-2 grid-rows-2 gap-1 w-full h-full p-1",children:[g.slice(0,3).map(E=>{const A=typeof E.settings?.avatar=="string"?E.settings.avatar:null;return A?v.jsx("img",{src:A,alt:E.name,className:"object-cover w-full h-full rounded-[3px]"},E.id):v.jsx("div",{className:"flex items-center justify-center bg-[#3F3F3F] text-xs font-medium w-full h-full rounded-[3px]",children:_o(E.name)},E.id)}),g.length>3?v.jsxs("div",{className:"flex items-center justify-center bg-[#3F3F3F] text-xs font-medium w-full h-full rounded-[3px]",children:["+",g.length-3]}):Array.from({length:4-g.slice(0,3).length}).map((E,A)=>v.jsx("div",{className:"flex items-center justify-center bg-[#2D2D2D] text-xs font-medium w-full h-full rounded-[3px]"},`empty-${A}`))]}):v.jsx("div",{className:"flex items-center justify-center bg-muted text-lg font-medium w-full h-full",children:_o(s)})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("h3",{className:"font-semibold text-xl mb-1 truncate",title:s,children:s}),v.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:w})]})]}),v.jsx("div",{className:"border-t border-muted"}),v.jsxs("div",{className:"flex items-center justify-between py-1 px-2",children:[v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(E=>{E.stopPropagation(),m()},"onClick"),className:"h-8 w-8 p-0 hover:bg-muted/50 cursor-pointer",children:v.jsx(ho,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:a(E=>{E.stopPropagation(),o()},"onClick"),className:"h-8 px-2 rounded-sm bg-muted hover:bg-muted/50 cursor-pointer",children:"Chat"})]})]})})}),n&&v.jsx(p0,{onClose:a(()=>i(!1),"onClose"),channelId:e.id})]})},"GroupCard");function xwe(){const{agents:e,isLoading:t,error:r}=IL(),n=!!r,i=mn(),s=e.filter(L=>L.status===zn.ACTIVE).length,{data:o}=AL(),l=o?.data?.servers||[],[u,c]=F.useState(!1),[d,f]=F.useState(!1),[g,m]=F.useState(null),[w,E]=F.useState(null),[A,C]=F.useState("agents"),O=a(()=>{m(null),c(!1)},"closeOverlay"),R=a(async(L,j)=>{L.id&&(De.info(`[Home] Navigating to chat/${L.id}`),i(`/chat/${L.id}`,{state:{forceNew:j}}))},"handleNavigateToDm"),P=a(()=>{i("/group/new")},"handleCreateGroup");return F.useEffect(()=>{De.info("[Home] Component mounted/re-rendered. Key might have changed.")},[]),v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex-1 w-full overflow-y-auto bg-background",children:v.jsx("div",{className:"flex flex-col w-full h-full",children:v.jsxs(B_,{value:A,onValueChange:C,className:"w-full h-full flex flex-col",children:[v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"w-full md:max-w-4xl mx-auto px-6 pt-6 pb-2",children:[v.jsxs("div",{className:"flex justify-between items-center mb-3",children:[v.jsxs(Sm,{className:"h-auto p-0 bg-transparent border-0 border-b-0 gap-2 w-auto",children:[v.jsxs(Uc,{value:"agents",className:"relative rounded-full data-[state=active]:border-b-0 data-[state=active]:bg-white data-[state=active]:text-black data-[state=active]:font-bold cursor-pointer text-lg py-1",children:["Agents",v.jsx("span",{className:`
382
+ dark:hover:bg-gray-700 dark:data-[state=active]:bg-gray-600 dark:data-[state=active]:shadow-none`}},$U=a(({items:e,defaultValue:t,value:r,onValueChange:n,theme:i="underline",className:s="",tabsListClassName:o="",triggerClassName:l="",dir:u,...c})=>{const d=t||e[0]?.value,f=bye[i];return v.jsx(HA,{className:s,defaultValue:r?void 0:d,value:r,onValueChange:n,dir:u,...c,children:v.jsx(By,{className:Ue(f.list,o),"aria-label":"Navigation tabs",children:e.map(g=>v.jsxs(zy,{value:g.value,disabled:g.disabled,className:Ue("flex items-center overflow-hidden",f.trigger,l),children:[g.icon&&v.jsx("span",{className:"mr-2 text-muted-foreground group-data-[state=active]:text-current ",children:g.icon}),v.jsx("span",{className:"truncate",children:g.label})]},g.value))})})},"Tabs"),XU=a(({title:e,rightContent:t,children:r,defaultOpen:n=!1,className:i="",triggerClassName:s="",contentClassName:o="",onOpenChange:l})=>{const[u,c]=F.useState(n),d=F.useCallback(g=>{c(g),l?.(g)},[l]),f=F.useCallback(g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),d(!u))},[d,u]);return v.jsxs(Vy,{open:u,onOpenChange:d,className:Ue("rounded-lg",i),children:[v.jsx(kT,{asChild:!0,children:v.jsxs("div",{tabIndex:0,role:"button",className:Ue("mb-1 flex w-full items-center justify-between gap-2 rounded-lg px-1 py-3 text-left text-sm font-medium text-foreground",s),onKeyDown:f,"aria-expanded":u,"aria-label":`${u?"Collapse":"Expand"} content of "${e}" section`,children:[v.jsxs("div",{className:"flex w-full items-center gap-2",children:[v.jsx(ha,{className:Ue("h-3 w-3 text-muted-foreground transition-transform duration-200",u&&"rotate-180")}),v.jsx("span",{className:"truncate",children:e})]}),t]})}),v.jsx(AT,{className:Ue("data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown",o),children:r})]})},"CollapsibleSection"),EA="absolute top-1/2 -translate-y-1/2 flex items-center justify-center text-foreground",JU=a(({className:e,onChange:t,onValueChange:r,startIcon:n,onClear:i,ref:s,inputClassName:o,label:l,hideLabel:u=!1,id:c,...d})=>{const f=F.useRef(null),g=a(w=>{t?.(w),r?.(w.target.value)},"handleChange"),m=a(()=>{if(i?.(),s){s.current?.focus();return}f.current?.focus()},"handleClear");return v.jsxs("div",{className:Ue("w-full",e),children:[l&&v.jsx("label",{htmlFor:c,className:Ue("block text-sm font-medium text-foreground ",u&&"sr-only"),children:l}),v.jsxs("div",{className:Ue("relative flex w-full items-center justify-center",l&&!u&&"mt-1"),children:[v.jsx("input",{id:c,ref:s||f,onChange:g,className:Ue(o,"flex h-7 items-center truncate","w-full px-2",!!n&&"pl-8",!!i&&"pr-8","rounded border border-border bg-transparent ","text-foreground placeholder:text-muted-foreground ","hover:border-border dark:hover:border-gray-700"),...d}),n&&v.jsx("div",{className:Ue(EA,"left-2"),"aria-hidden":!0,children:n}),i&&d.value&&v.jsx("button",{className:Ue(EA,"right-2"),"aria-label":"Clear input value",onClick:m,type:"button",children:v.jsx(Hn,{className:"size-4"})})]})]})},"TextInput"),vye=a(({data:e})=>v.jsxs("div",{className:"space-y-6",children:[(!e.attributes||e.attributes.length===0)&&v.jsx("div",{className:"p-6 text-center",children:v.jsx("p",{className:"text-muted-foreground ",children:"No attributes available for this span."})}),(e.attributes||[]).map((t,r)=>{const n=t.value.stringValue||t.value.intValue||t.value.boolValue?.toString()||"N/A";return v.jsx(XU,{title:t.key,defaultOpen:!0,children:v.jsx(JU,{id:`${e.id}-attribute-${r}`,value:n,disabled:!0,readOnly:!0,inputClassName:"font-mono text-xs",className:"w-full"})},`${t.key}-${r}`)})]}),"DetailsViewAttributesTab"),yye={4:"size-4 text-xs",6:"size-6 text-xs",8:"size-8 text-xs",9:"size-9 text-sm",10:"size-10 text-base",11:"size-11 text-lg",12:"size-12 text-xl",16:"size-16 text-2xl"},wye={4:"size-3",6:"size-4",8:"size-6",9:"size-7",10:"size-8",11:"size-9",12:"size-10",16:"size-12"},xye={4:"text-xs",6:"text-xs",8:"text-xs",9:"text-sm",10:"text-base",11:"text-lg",12:"text-xl",16:"text-2xl"},_ye={gray:"bg-muted-foreground",red:"bg-destructive",orange:"bg-chart-1",yellow:"bg-chart-5",teal:"bg-chart-2",indigo:"bg-primary",purple:"bg-primary",sky:"bg-chart-4",cyan:"bg-chart-3",emerald:"bg-accent"},q2=a(({src:e,alt:t="Avatar",size:r="10",rounded:n="full",bgColor:i="gray",textColor:s="white",letter:o,className:l="",...u})=>{const[c,d]=F.useState(!1),f=o?o.charAt(0):t.charAt(0).toUpperCase(),g=s==="white"?"text-white":"text-black";return v.jsx("div",{className:Ue("flex items-center justify-center overflow-hidden","bg-muted",c&&"border border-border",yye[r],xye[r],GU[n],l),...u,children:c?v.jsx(ST,{className:Ue(wye[r],"text-muted-foreground")}):v.jsx(v.Fragment,{children:e?v.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:a(()=>d(!0),"onError")}):v.jsx("div",{className:Ue("flex h-full w-full items-center justify-center",_ye[i],g,"font-medium"),children:f})})})},"Avatar"),Eye={success:"bg-green-500 dark:bg-green-500",error:"bg-red-500 dark:bg-red-500",pending:"bg-violet-500 dark:bg-violet-500",warning:"bg-yellow-500 dark:bg-yellow-500"},Sye={success:"bg-green-100 dark:bg-green-950 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-950 text-red-600 dark:text-red-400",pending:"bg-violet-100 dark:bg-violet-950 text-violet-600 dark:text-violet-400",warning:"bg-yellow-100 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-400"},Uy=a(({status:e,variant:t="dot",...r})=>{const n=`Status: ${e}`;return v.jsx("div",{className:"flex size-4 items-center justify-center",...r,children:t==="dot"?v.jsx(kye,{status:e,title:n}):v.jsx(Aye,{status:e,title:n})})},"SpanStatus"),kye=a(({status:e,title:t})=>v.jsx("span",{className:Ue("block size-1.5 rounded-full",Eye[e]),"aria-label":t,title:t}),"SpanStatusDot"),Aye=a(({status:e,title:t})=>v.jsxs("span",{className:Ue("inline-flex items-center justify-center","h-3.5 w-4 rounded",Sye[e]),"aria-label":t,title:t,children:[e==="success"&&v.jsx(Va,{className:"size-2.5","aria-hidden":!0}),e==="error"&&v.jsx(uv,{className:"size-2.5","aria-hidden":!0}),e==="warning"&&v.jsx(Hy,{className:"size-2.5","aria-hidden":!0}),e==="pending"&&v.jsx(Gy,{className:"size-2.5","aria-hidden":!0})]}),"SpanStatusBadge"),Tye=a(({data:e,avatar:t,copyButton:r,actions:n,className:i="mb-4 flex flex-wrap items-center gap-4"})=>{const[s,o]=F.useState(!1),l=a(()=>{r?.onCopy&&(r.onCopy(e),o(!0),setTimeout(()=>o(!1),2e3))},"handleCopy");return v.jsxs("div",{className:i,children:[v.jsxs("div",{className:"flex items-center gap-1.5",children:[t&&v.jsx(q2,{size:"4",...t}),v.jsx("span",{className:"text-base tracking-wide text-foreground ",children:e.title}),v.jsx("div",{className:"flex size-5 items-center justify-center",children:v.jsx(Uy,{status:e.status})}),r&&v.jsx(h0,{"aria-label":r.isEnabled?"Copy span details":"Copy disabled",variant:"ghost",onClick:l,children:s?v.jsx(Va,{className:"size-3 text-muted-foreground"}):v.jsx(aa,{className:"size-3 text-muted-foreground"})})]}),n]})},"DetailsViewHeader"),Nye=a(({data:e})=>{const t=!!e.input,r=!!e.output;if(!t&&!r)return v.jsx("div",{className:"p-6 text-center",children:v.jsx("p",{className:"text-muted-foreground ",children:"No input or output data available for this span."})});let n=null,i=null;if(typeof e.input=="string")try{n=JSON.parse(e.input)}catch{n=null}if(typeof e.output=="string")try{i=JSON.parse(e.output)}catch{i=null}return v.jsxs("div",{className:"space-y-3",children:[typeof e.input=="string"&&v.jsx(SA,{section:"Input",content:e.input,parsedContent:n}),typeof e.output=="string"&&v.jsx(SA,{section:"Output",content:e.output,parsedContent:i})]})},"DetailsViewInputOutputTab"),SA=a(({section:e,content:t,parsedContent:r})=>{const[n,i]=F.useState("plain"),[s,o]=F.useState(!0),l=[{value:"json",label:"JSON",disabled:!r},{value:"plain",label:"Plain"}];return v.jsx(XU,{title:e,defaultOpen:!0,onOpenChange:o,rightContent:s?v.jsx($U,{items:l,defaultValue:"plain",value:n,onValueChange:i,theme:"pill",onClick:a(u=>u.stopPropagation(),"onClick")}):null,triggerClassName:"min-h-16",children:v.jsx(Iye,{content:t,section:e,tab:n,parsedContent:r})})},"IOSection"),Iye=a(({tab:e,content:t,section:r,parsedContent:n})=>t?v.jsxs("div",{className:"relative rounded-lg border border-border ",children:[v.jsx(Cye,{section:r,content:t}),e==="json"&&v.jsx(v.Fragment,{children:n?v.jsx(TT,{booleanStyle:"color: hsl(var(--primary));",className:"overflow-x-auto rounded-xl p-4 text-left",data:n,id:`json-pretty-${r}`,keyStyle:"color: hsl(var(--primary));",mainStyle:"color: hsl(var(--muted-foreground)); font-size: 12px;",stringStyle:"color: hsl(var(--chart-2));",valueStyle:"color: hsl(var(--chart-1));"}):v.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"Invalid JSON format"})}),e==="plain"&&v.jsx("div",{className:"rounded-lg bg-muted/50 p-4",children:v.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap text-left font-mono text-xs text-foreground",children:t})})]}):v.jsx("p",{className:"p-3 text-sm italic text-muted-foreground ",children:"No data available"}),"IOContent"),Cye=a(({section:e,content:t})=>{const[r,n]=F.useState(!1),i=a(()=>{navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),2e3)},"onClick");return v.jsx(h0,{onClick:i,"aria-label":r?`${e} Data Copied`:`Copy ${e} Data`,variant:"ghost",className:"absolute right-1.5 top-1.5",children:r?v.jsx(Va,{className:"size-3"}):v.jsx(aa,{className:"size-3"})})},"CopyButton"),Mye={4:"px-1 gap-1 h-4",5:"px-1.5 gap-1 h-5",6:"px-2 gap-1.5 h-6",7:"px-2.5 gap-2 h-7"},Oye={4:"text-xs font-normal leading-3",5:"text-xs font-medium",6:"text-sm font-medium",7:"text-sm font-medium"},un=a(({label:e,theme:t="gray",variant:r="solid",size:n="4",iconStart:i,iconEnd:s,className:o="",...l})=>{const{bg:u,darkBg:c,text:d,darkText:f}=dye[t],g=r==="outline"?`border ${d} ${f} bg-transparent dark:bg-transparent border-current`:`${u} ${d} ${c} ${f}`;return v.jsxs("span",{className:Ue("inline-flex min-w-0 items-center overflow-hidden rounded font-medium",g,Mye[n],o),...l,children:[i&&v.jsx("span",{className:"shrink-0",children:i}),v.jsx("span",{className:Ue(Oye[n],"min-w-0 max-w-full flex-shrink-0 truncate tracking-normal"),children:e}),s&&v.jsx("span",{className:"shrink-0",children:s})]})},"Badge"),KU=a(({timestamp:e,size:t,...r})=>v.jsx(un,{variant:"outline",theme:"gray",size:t,...r,label:Rye(e)}),"TimestampBadge");function Rye(e){return new Date(e).toLocaleString()}a(Rye,"formatTimestamp");const Pye=a(({data:e})=>{const t=WU(e.type),r=zU(e);return v.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-start gap-1",children:[v.jsx(un,{iconStart:v.jsx(t,{className:"size-2.5"}),theme:K2(e.type),size:"4",label:VU(e.type)}),typeof e.tokensCount=="number"&&v.jsx(un,{iconStart:v.jsx(NT,{className:"size-2.5"}),theme:"gray",size:"4",label:e.tokensCount}),typeof e.cost=="number"&&v.jsx(un,{theme:"gray",size:"4",label:`$ ${e.cost.toFixed(4)}`}),v.jsxs("span",{className:"text-xs text-muted-foreground",children:["LATENCY: ",ml(r)]}),typeof e.startTime=="number"&&v.jsx(KU,{timestamp:e.startTime})]})},"DetailsViewMetrics"),Lye=a(({data:e})=>v.jsx("div",{className:"pt-4",children:v.jsx("div",{className:"rounded border border-border bg-transparent ",children:v.jsx(TT,{booleanStyle:"color: hsl(var(--primary));",className:"overflow-x-auto rounded-xl p-4 text-left",data:e.raw,id:`json-pretty-${e.id||"span-details"}`,keyStyle:"color: hsl(var(--primary));",mainStyle:"color: hsl(var(--muted-foreground)); font-size: 12px;",stringStyle:"color: hsl(var(--chart-2));",valueStyle:"color: hsl(var(--chart-1));"})})}),"DetailsViewRawDataTab"),qU=a(({data:e,avatar:t,defaultTab:r,className:n,copyButton:i,headerActions:s,customHeader:o,onTabChange:l})=>{const[u,c]=F.useState(r||"input-output"),d=[{value:"input-output",label:"In/Out",icon:v.jsx(yz,{className:"size-4"})},{value:"attributes",label:"Attributes",icon:v.jsx(wz,{className:"size-4"})},{value:"raw",label:"RAW",icon:v.jsx(xz,{className:"size-4"})}];function f(w){c(w),l?.(w)}a(f,"handleTabChange");const g=typeof s=="function"?s(e):s,m=o?typeof o=="function"?o({data:e}):o:v.jsx(Tye,{data:e,avatar:t,copyButton:i,actions:g});return v.jsxs("div",{className:Ue("min-w-0 rounded-lg border border-border bg-card p-4 shadow-sm",n),children:[m,v.jsx(Pye,{data:e}),v.jsx($U,{items:d,value:u,onValueChange:f,theme:"underline",defaultValue:r}),u==="input-output"&&v.jsx(Nye,{data:e}),u==="attributes"&&v.jsx(vye,{data:e}),u==="raw"&&v.jsx(Lye,{data:e})]})},"DetailsView"),eB=a(({...e})=>v.jsx(JU,{startIcon:v.jsx(Qc,{className:"size-4"}),placeholder:"Filter...",...e}),"SearchInput"),tB=a(({cost:e,size:t,...r})=>v.jsx(un,{theme:"gray",size:t,...r,label:`$ ${e}`}),"PriceBadge"),rB=a(({tokensCount:e,size:t,...r})=>v.jsx(un,{iconStart:v.jsx(NT,{className:"size-2.5"}),theme:"gray",size:t,...r,label:e}),"TokensBadge"),nB=a(({trace:e,avatar:t})=>v.jsxs("header",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:[v.jsxs("div",{className:"flex min-w-0 items-center gap-1.5 overflow-hidden",children:[t&&v.jsx(q2,{size:"4",...t}),v.jsx("h3",{className:"font-medium max-w-full truncate text-sm text-foreground",children:e.name})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(un,{size:"5",theme:"gray",variant:"outline",label:e.spansCount===1?"1 span":`${e.spansCount} spans`}),v.jsx(un,{size:"5",theme:"gray",variant:"outline",label:ml(e.durationMs)})]})]}),"TraceListItemHeader"),Dye=a(({trace:e,avatar:t,onClick:r,badges:n,isSelected:i})=>{const s=F.useCallback(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r?.())},[r]),{name:o,agentDescription:l,totalCost:u,totalTokens:c,startTime:d}=e;return v.jsxs("div",{className:Ue("group w-full","flex flex-col gap-2.5 p-4","cursor-pointer",i?"bg-muted":"bg-card"),role:"button",tabIndex:0,onClick:r,onKeyDown:s,"aria-label":`Select trace ${o}`,children:[v.jsx(nB,{trace:e,avatar:t}),v.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[v.jsx("span",{className:"mr-4 max-w-full truncate text-sm text-muted-foreground ",children:l}),typeof u=="number"&&v.jsx(tB,{cost:u}),typeof c=="number"&&v.jsx(rB,{tokensCount:c}),n?.map((f,g)=>v.jsx(un,{theme:f.theme,size:"4",label:f.label},g)),typeof d=="number"&&v.jsx(KU,{timestamp:d})]})]})},"TraceListItem"),jye=a(({traces:e,expanded:t,onExpandStateChange:r,className:n,onTraceSelect:i,selectedTrace:s})=>v.jsxs("div",{className:Ue("w-full min-w-0","flex flex-col gap-3",t?"w-full":"w-fit",n),children:[v.jsx("header",{className:"flex min-h-6 items-center justify-between gap-2",children:v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h2",{className:Ue("font-semibold text-lg text-foreground",!t&&"hidden"),children:"Traces"}),v.jsx(un,{size:"5",theme:"teal","aria-label":`Total number of traces: ${e.length}`,label:e.length})]})}),t&&v.jsx("ul",{className:"flex flex-col items-center overflow-hidden rounded border border-border ",children:e.map(o=>v.jsx("li",{className:"w-full list-none border-b-border [&:not(:last-child)]:border-b",children:v.jsx(Dye,{trace:o,onClick:a(()=>i?.(o),"onClick"),isSelected:s?.id===o.id,badges:o.badges})},o.id))})]}),"TraceList"),Uye=a(({data:e})=>{const t=WU(e.type);return v.jsxs("div",{className:"flex flex-wrap items-center justify-start gap-1",children:[v.jsx(un,{iconStart:v.jsx(t,{className:"size-2.5"}),theme:K2(e.type),size:"4",label:VU(e.type)}),typeof e.tokensCount=="number"&&v.jsx(rB,{tokensCount:e.tokensCount}),typeof e.cost=="number"&&v.jsx(tB,{cost:e.cost})]})},"SpanCardBadges"),kA=a(({type:e})=>e==="empty"?v.jsx("div",{className:"w-5 shrink-0 grow"}):v.jsxs("div",{className:"relative w-5 shrink-0 grow",children:[(e==="vertical"||e==="t-right")&&v.jsx("div",{className:"absolute bottom-0 left-1/2 top-0 w-0.5 -translate-x-1/2 bg-muted"}),e==="t-right"&&v.jsx("div",{className:"absolute left-2.5 top-2.5 h-0.5 w-2.5 -translate-y-[3px] bg-muted"}),e==="corner-top-right"&&v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"absolute left-1/2 top-2 size-0.5 -translate-x-1/2 -translate-y-px bg-muted"}),v.jsx("div",{className:"absolute left-1/2 top-2.5 h-0.5 w-2.5 -translate-y-[3px] bg-muted"}),v.jsx("div",{className:"absolute left-1/2 top-0 h-[7px] w-0.5 -translate-x-px bg-muted"})]})]}),"SpanCardConnector"),Bye={purple:"bg-primary",indigo:"bg-primary",orange:"bg-chart-1",teal:"bg-chart-2",cyan:"bg-chart-3",sky:"bg-chart-4",yellow:"bg-chart-5",emerald:"bg-accent",red:"bg-destructive",gray:"bg-muted-foreground"},zye=a(({spanCard:e,theme:t,minStart:r,maxEnd:n,className:i})=>{const{startPercent:s,widthPercent:o}=FU({spanCard:e,minStart:r,maxEnd:n});return v.jsx("span",{className:Ue("relative flex h-4 min-w-20 flex-1 rounded bg-muted",i),children:v.jsx("span",{className:"pointer-events-none absolute inset-x-1 top-1/2 h-1.5 -translate-y-1/2",children:v.jsx("span",{className:`absolute h-full rounded-sm ${Bye[t]}`,style:{left:`${s}%`,width:`${o}%`}})})})},"SpanCardTimeline"),AA=a(({isExpanded:e,title:t,onToggleClick:r})=>v.jsx(kT,{asChild:!0,children:v.jsx("button",{className:"flex h-4 w-5 shrink-0 items-center justify-center",onClick:r,onKeyDown:r,"aria-label":`${e?"Collapse":"Expand"} ${t} children`,"aria-expanded":e,type:"button",children:e?v.jsx(ha,{"aria-hidden":"true",className:"size-3 text-muted-foreground"}):v.jsx(iT,{"aria-hidden":"true",className:"size-3 text-muted-foreground"})})}),"SpanCardToggle"),to={CONNECTOR_WIDTH:20,CONTENT_BASE_WIDTH:320},sh={withStatus:!0,expandButton:"inside"},Fye=a(({level:e,hasExpandButton:t,contentPadding:r,expandButton:n})=>{let i=to.CONTENT_BASE_WIDTH-e*to.CONNECTOR_WIDTH;return t&&n==="inside"&&(i-=to.CONNECTOR_WIDTH),n==="outside"&&e===0&&(i-=to.CONNECTOR_WIDTH),i-r},"getContentWidth"),Hye=a(({connectorsColumnWidth:e,expandButton:t})=>t==="inside"?`${e}px 1fr`:`${e}px 1fr ${to.CONNECTOR_WIDTH}px`,"getGridTemplateColumns"),Zye=a(({level:e,hasExpandButton:t})=>e===0?0:t?4:8,"getContentPadding"),Gye=a(({level:e,hasExpandButton:t,isLastChild:r,prevConnectors:n,expandButton:i})=>{const s=[];if(e===0)return{connectors:i==="inside"?[]:["vertical"],connectorsColumnWidth:20};for(let l=0;l<e-1;l++)s.push("vertical");r||s.push("t-right"),r&&s.push("corner-top-right");let o=s.length*to.CONNECTOR_WIDTH;t&&(o+=to.CONNECTOR_WIDTH);for(let l=0;l<n.length;l++)(n[l]==="empty"||n[l]==="corner-top-right")&&(s[l]="empty");return{connectors:s,connectorsColumnWidth:o}},"getConnectorsLayout"),Vye=a((e,t)=>{const r=F.useCallback(()=>{t?.(e)},[e,t]),n=F.useCallback(s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),r())},[r]),i=F.useCallback(s=>{s.stopPropagation()},[]);return{handleCardClick:r,handleKeyDown:n,handleToggleClick:i}},"useSpanCardEventHandlers"),Wye=a(({data:e,level:t,selectedSpan:r,onSpanSelect:n,minStart:i,maxEnd:s,prevLevelConnectors:o,expandedSpansIds:l,onExpandSpansIdsChange:u,viewOptions:c=sh})=>e.children?.length?v.jsx("div",{className:"relative",children:v.jsx(AT,{children:v.jsx("ul",{role:"group",children:e.children.map((d,f)=>v.jsx(iB,{viewOptions:c,data:d,minStart:i,maxEnd:s,level:t+1,selectedSpan:r,onSpanSelect:n,isLastChild:f===(e.children||[]).length-1,prevLevelConnectors:o,expandedSpansIds:l,onExpandSpansIdsChange:u},d.id))})})}):null,"SpanCardChildren"),iB=a(({data:e,level:t=0,selectedSpan:r,onSpanSelect:n,viewOptions:i=sh,avatar:s,minStart:o,maxEnd:l,isLastChild:u,prevLevelConnectors:c=[],expandedSpansIds:d,onExpandSpansIdsChange:f})=>{const g=d.includes(e.id),m=i.withStatus??sh.withStatus,w=i.expandButton||sh.expandButton,E=F.useCallback(K=>{const z=d.includes(e.id);z&&!K&&f(d.filter(V=>V!==e.id)),!z&&K&&f([...d,e.id])},[g,d,e.id,f]),A={isExpanded:g,hasChildren:!!e.children?.length,isSelected:r?.id===e.id},C=Vye(e,n),{durationMs:O}=FU({spanCard:e,minStart:o,maxEnd:l}),R=w==="inside"&&A.hasChildren,P=Zye({level:t,hasExpandButton:R}),L=Fye({level:t,hasExpandButton:R,contentPadding:P,expandButton:w}),{connectors:j,connectorsColumnWidth:G}=Gye({level:t,hasExpandButton:R,isLastChild:u,prevConnectors:c,expandButton:w}),Z=Hye({connectorsColumnWidth:G,expandButton:w});return v.jsx("li",{role:"treeitem","aria-expanded":A.hasChildren?A.isExpanded:void 0,className:"list-none",children:v.jsxs(Vy,{open:A.isExpanded,onOpenChange:E,children:[v.jsxs("div",{className:Ue("relative grid w-full rounded-md transition-colors",A.isSelected?"bg-accent/50 border border-accent":"hover:bg-muted/30"),style:{gridTemplateColumns:Z},onClick:C.handleCardClick,onKeyDown:C.handleKeyDown,tabIndex:0,role:"button","aria-pressed":A.isSelected,"aria-describedby":`span-card-desc-${e.id}`,"aria-expanded":A.hasChildren?A.isExpanded:void 0,"aria-label":`${A.isSelected?"Selected":"Not selected"} span card for ${e.title} at level ${t}`,children:[v.jsxs("div",{className:"flex flex-nowrap",children:[j.map((K,z)=>v.jsx(kA,{type:K},`${K}-${z}`)),R&&v.jsxs("div",{className:"flex w-5 flex-col items-center",children:[v.jsx(AA,{isExpanded:A.isExpanded,title:e.title,onToggleClick:C.handleToggleClick}),A.isExpanded&&v.jsx(kA,{type:"vertical"})]})]}),v.jsxs("div",{className:Ue("flex flex-nowrap items-center align-middle gap-x-3 gap py-3 px-2","min-h-5 w-full cursor-pointer",t!==0&&!R&&"pl-2",t!==0&&R&&"pl-1"),children:[v.jsxs("div",{className:"relative flex min-h-4 flex-shrink-0 flex-grow-0 flex-wrap items-start gap-1",style:{width:`min(${L}px, 100%)`,minWidth:140},children:[s&&v.jsx(q2,{size:"4",...s}),v.jsx("h3",{className:"mr-1 h-4 max-w-32 truncate text-sm leading-[14px] text-foreground ",title:e.title,children:e.title}),v.jsx(Uye,{data:e})]}),v.jsxs("div",{className:"flex flex-shrink flex-grow flex-nowrap items-center justify-end gap-1 min-w-0",children:[w==="outside"&&m&&v.jsx("div",{className:"flex-shrink-0",children:v.jsx(Uy,{status:e.status})}),v.jsx(zye,{theme:K2(e.type),minStart:o,maxEnd:l,spanCard:e,className:"max-w-48 flex-shrink"}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[v.jsx("span",{className:"inline-block w-14 whitespace-nowrap px-1 text-right text-xs text-foreground",children:ml(O)}),w==="inside"&&m&&v.jsx("div",{children:v.jsx(Uy,{status:e.status})})]})]})]}),w==="outside"&&(A.hasChildren?v.jsx(AA,{isExpanded:A.isExpanded,title:e.title,onToggleClick:C.handleToggleClick}):v.jsx("div",{}))]}),v.jsx(Wye,{minStart:o,maxEnd:l,viewOptions:i,data:e,level:t,selectedSpan:r,onSpanSelect:n,prevLevelConnectors:j,expandedSpansIds:d,onExpandSpansIdsChange:f})]})})},"SpanCard"),aB=a(({spans:e,onSpanSelect:t,className:r="",selectedSpan:n,expandedSpansIds:i,onExpandSpansIdsChange:s,spanCardViewOptions:o})=>{const l=HU(e),{minStart:u,maxEnd:c}=cye(l);return v.jsx("div",{className:"w-full min-w-0 p-4",children:v.jsx("ul",{className:Ue(r,"overflow-x-auto space-y-1"),role:"tree","aria-label":"Hierarchical card list",children:e.map((d,f)=>v.jsx(iB,{data:d,level:0,selectedSpan:n,onSpanSelect:t,minStart:u,maxEnd:c,isLastChild:f===e.length-1,expandedSpansIds:i,onExpandSpansIdsChange:s,viewOptions:o},d.id))})})},"TreeView"),Yye=a(({data:e})=>{const[t,r]=F.useState(e[0]?.traceRecord),[n,i]=F.useState(e[0]?.spans??[]),[s,o]=F.useState(e[0]?.spans?.[0]?.children?.[0]),[l,u]=F.useState(""),[c,d]=F.useState(!0),f=F.useMemo(()=>e.map(P=>({...P.traceRecord,badges:P.badges,spanCardViewOptions:P.spanCardViewOptions})),[e]),g=F.useMemo(()=>l.trim()?ZU(n,l):n,[n,l]),m=F.useMemo(()=>HU(n).map(P=>P.id),[n]),[w,E]=F.useState(m);F.useEffect(()=>{E(m)},[m]);const A=F.useCallback(()=>{E(m)},[m]),C=F.useCallback(()=>{E([])},[]);F.useEffect(()=>{o(n[0])},[n]);const O=F.useCallback(P=>{r(P),i(e.find(L=>L.traceRecord.id===P.id)?.spans??[])},[e]),R={traceRecords:f,traceListExpanded:c,setTraceListExpanded:d,selectedTrace:t,setSelectedTrace:r,selectedTraceSpans:n,setSelectedTraceSpans:i,selectedSpan:s,setSelectedSpan:o,searchValue:l,setSearchValue:u,filteredSpans:g,expandedSpansIds:w,setExpandedSpansIds:E,handleExpandAll:A,handleCollapseAll:C,handleTraceSelect:O};return v.jsxs("div",{className:"h-full w-full p-4 lg:p-8",children:[v.jsx("div",{className:"hidden lg:block",children:v.jsx(Qye,{...R})}),v.jsx("div",{className:"lg:hidden",children:v.jsx($ye,{...R})})]})},"TraceViewer"),Qye=a(({traceRecords:e,traceListExpanded:t,setTraceListExpanded:r,selectedTrace:n,selectedSpan:i,setSelectedSpan:s,searchValue:o,setSearchValue:l,filteredSpans:u,expandedSpansIds:c,setExpandedSpansIds:d,handleExpandAll:f,handleCollapseAll:g,handleTraceSelect:m})=>v.jsx("div",{className:"flex flex-col gap-4",children:n?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(Za,{value:n.id,onValueChange:a(w=>{const E=e.find(A=>A.id===w);E&&m(E)},"onValueChange"),children:[v.jsx(ca,{className:"w-full h-auto py-3",children:v.jsx(Ga,{children:v.jsxs("div",{className:"flex items-center gap-4 w-full",children:[v.jsx("span",{className:"font-semibold text-base",children:n.name}),v.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[typeof n.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(n.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${n.spansCount} span${n.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(n.durationMs)})]})]})})}),v.jsx(da,{className:"w-full max-w-2xl max-h-[400px]",children:e.map(w=>v.jsx(lr,{value:w.id,className:"py-2.5 px-4 cursor-pointer",children:v.jsxs("div",{className:"flex items-center justify-between gap-4 w-full pr-6",children:[v.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[v.jsx("span",{className:"font-semibold text-base text-foreground",children:w.name}),w.agentDescription&&v.jsx("span",{className:"text-xs text-muted-foreground",children:w.agentDescription})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[typeof w.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(w.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${w.spansCount} span${w.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(w.durationMs)})]})]})},w.id))})]}),v.jsxs("div",{className:"rounded-lg border border-border bg-card shadow-sm",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border p-4",children:[v.jsx(eB,{id:"span-search-desktop",name:"search",onClear:a(()=>l(""),"onClear"),value:o,onValueChange:l,className:"max-w-60 grow"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[v.jsx(YU,{onExpandAll:f}),v.jsx(QU,{onCollapseAll:g})]})})]}),u.length===0?v.jsx("div",{className:"p-3 text-center text-muted-foreground",children:"No spans found"}):v.jsx(aB,{spans:u,onSpanSelect:s,selectedSpan:i,expandedSpansIds:c,onExpandSpansIdsChange:d,spanCardViewOptions:n.spanCardViewOptions})]}),i?v.jsx(qU,{data:i}):v.jsx(TA,{title:"Select a span to see the details"})]}):v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsxs(Za,{value:"",onValueChange:a(w=>{const E=e.find(A=>A.id===w);E&&m(E)},"onValueChange"),children:[v.jsx(ca,{className:"w-full",children:v.jsx(Ga,{placeholder:"Select a trace to view details..."})}),v.jsx(da,{className:"w-full max-w-2xl max-h-[400px]",children:e.map(w=>v.jsx(lr,{value:w.id,className:"py-2.5 px-4 cursor-pointer",children:v.jsxs("div",{className:"flex items-center justify-between gap-4 w-full pr-6",children:[v.jsxs("div",{className:"flex flex-col gap-1 min-w-0",children:[v.jsx("span",{className:"font-semibold text-base text-foreground",children:w.name}),w.agentDescription&&v.jsx("span",{className:"text-xs text-muted-foreground",children:w.agentDescription})]}),v.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[typeof w.startTime=="number"&&v.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:new Date(w.startTime).toLocaleTimeString()}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:`${w.spansCount} span${w.spansCount===1?"":"s"}`}),v.jsx(un,{size:"4",theme:"gray",variant:"outline",label:ml(w.durationMs)})]})]})},w.id))})]}),v.jsx(TA,{title:"Select a trace to see the details"})]})}),"DesktopLayout"),$ye=a(({traceRecords:e,traceListExpanded:t,setTraceListExpanded:r,selectedTrace:n,setSelectedTrace:i,selectedTraceSpans:s,setSelectedTraceSpans:o,selectedSpan:l,setSelectedSpan:u,searchValue:c,setSearchValue:d,filteredSpans:f,expandedSpansIds:g,setExpandedSpansIds:m,handleExpandAll:w,handleCollapseAll:E,handleTraceSelect:A})=>n?n&&s.length&&!l?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(xA,{onClick:a(()=>{i(void 0),o([])},"onClick"),iconStart:v.jsx(cv,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Traces list"}),v.jsx(nB,{trace:n}),v.jsxs("div",{className:"rounded border border-border bg-card",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-border p-3",children:[v.jsx(eB,{id:"span-search-mobile",name:"search",onClear:a(()=>d(""),"onClear"),value:c,onValueChange:d,className:"max-w-60 grow"}),v.jsx("div",{className:"flex items-center gap-2",children:v.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[v.jsx(YU,{onExpandAll:w}),v.jsx(QU,{onCollapseAll:E})]})})]}),f.length===0?v.jsx("div",{className:"p-3 text-center text-muted-foreground",children:"No spans found"}):v.jsx(aB,{spans:f,spanCardViewOptions:n.spanCardViewOptions,onSpanSelect:u,selectedSpan:l,expandedSpansIds:g,onExpandSpansIdsChange:m})]})]}):n&&s.length&&l?v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx(xA,{onClick:a(()=>{u(void 0)},"onClick"),iconStart:v.jsx(cv,{className:"size-3"}),variant:"ghost",className:"self-start",children:"Tree View"}),v.jsx(qU,{data:l})]}):null:v.jsx(jye,{traces:e,expanded:t,onExpandStateChange:r,onTraceSelect:A,selectedTrace:n}),"MobileLayout"),TA=a(({title:e})=>v.jsx("p",{className:"hidden items-center justify-center rounded-lg bg-muted p-4 text-center text-muted-foreground lg:flex",children:e}),"Placeholder"),Xye=dr(),Jye=a(({agentId:e})=>{const t=Dae(e),r=t.data?.runs??[],n=mT({queries:r.map(c=>({queryKey:["agent",e,"runs","detail",c.runId,null],queryFn:a(async()=>Xye.runs.getRun(e,c.runId),"queryFn"),enabled:!!(e&&c.runId),staleTime:3e4}))}),i=F.useMemo(()=>r.map((c,d)=>{const f=n[d];return f?.data?{traceRecord:yA.convertRunSummaryToTraceRecord(c),spans:yA.convertRunDetailToTraceSpans(f.data)}:null}).filter(c=>c!==null),[r,...n.map(c=>c.data)]),s=t.isLoading,o=t.error?t.error.message:void 0,l=r.length>0,u=i.length>0;return s?v.jsx("div",{className:"flex items-center justify-center h-32",children:v.jsx(cn,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):o?v.jsxs("div",{className:"px-4 py-3 text-sm text-destructive",children:["Failed to load runs: ",o]}):l?u?v.jsx("div",{className:"h-full w-full",children:v.jsx(Yye,{data:i})}):v.jsxs("div",{className:"flex items-center justify-center h-32",children:[v.jsx(cn,{className:"h-5 w-5 animate-spin text-muted-foreground"}),v.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading run details..."})]}):v.jsx("div",{className:"px-4 py-8 text-sm text-center text-muted-foreground",children:"No agent runs yet. Runs will appear here after the agent processes messages."})},"AgentRunTimeline");function NA({agentId:e,agentName:t,channelId:r}){const{currentTab:n,setTab:i}=lye(e),{data:s,isLoading:o}=Fae(e,{enabled:!!e}),{agent:l,isLoading:u,error:c}=Gm(e),d=F.useMemo(()=>s?.data||[],[s]),f=F.useMemo(()=>{const g=[{value:"details",label:"Details",icon:v.jsx(Hy,{className:"h-4 w-4"})},{value:"timeline",label:"Timeline",icon:v.jsx(ET,{className:"h-4 w-4"})},{value:"actions",label:"Model Calls",icon:v.jsx(na,{className:"h-4 w-4"})},{value:"memories",label:"Memories",icon:v.jsx(vs,{className:"h-4 w-4"})},{value:"logs",label:"Logs",icon:v.jsx(Ez,{className:"h-4 w-4"})}],m=d.map(w=>({value:w.name,label:w.name,icon:v.jsx(_z,{className:"h-4 w-4"})}));return[...g,...m]},[d]);return v.jsxs(B_,{defaultValue:"details",value:n,onValueChange:i,className:"flex flex-col h-screen w-full max-w-full",children:[v.jsxs(Sm,{className:"flex w-full max-w-full overflow-x-auto flex-shrink-0",children:[f.map(g=>v.jsxs(Uc,{value:g.value,className:"flex items-center gap-1.5 flex-shrink-0",children:[g.icon,v.jsx("span",{className:"truncate",children:g.label})]},g.value)),o&&v.jsx(v.Fragment,{children:[...Array(2)].map((g,m)=>v.jsx(jc,{className:"h-9 w-full rounded-md flex-shrink-0"},`skel-tab-${m}`))})]}),v.jsxs(Ci,{value:"details",className:"overflow-y-auto overflow-x-hidden flex-1 p-4 w-full max-w-full min-h-0",children:[n==="details"&&e&&v.jsxs(v.Fragment,{children:[u&&v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(cn,{className:"h-6 w-6 animate-spin text-primary"})}),c&&v.jsxs("div",{className:"text-red-500 break-words",children:["Error loading agent details: ",c.message]}),!u&&!c&&l&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(BU,{agent:l,agentId:e,onSaveComplete:a(()=>{},"onSaveComplete")})}),!u&&!c&&!l&&!o&&v.jsx("div",{className:"text-muted-foreground",children:"Agent details not found."})]}),n==="details"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their details."})]}),v.jsxs(Ci,{value:"timeline",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0 p-0",children:[n==="timeline"&&e&&v.jsx("div",{className:"w-full max-w-full h-full",children:v.jsx(Jye,{agentId:e})}),n==="timeline"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see run activity."})]}),v.jsxs(Ci,{value:"actions",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="actions"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(aye,{agentId:e})}),n==="actions"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their actions."})]}),v.jsxs(Ci,{value:"logs",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="logs"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(CL,{agentName:t,level:"all"})}),n==="logs"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their logs."})]}),v.jsxs(Ci,{value:"memories",className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:[n==="memories"&&e&&v.jsx("div",{className:"w-full max-w-full",children:v.jsx(oye,{agentId:e,agentName:t,channelId:r})}),n==="memories"&&!e&&v.jsx("div",{className:"p-4 text-muted-foreground",children:"Select an agent to see their memories."})]}),d.map(g=>v.jsx(Ci,{value:g.name,className:"overflow-y-auto overflow-x-hidden flex-1 w-full max-w-full min-h-0",children:n===g.name&&e&&v.jsx("iframe",{src:g.url,title:g.name,className:"w-full h-full border-0 flex-1 max-w-full"})},g.name))]})}a(NA,"AgentSidebar");const Kye=160,sB=F.forwardRef(({className:e,...t},r)=>{const n=F.useRef(null),i=a(o=>{typeof r=="function"?r(o):r&&(r.current=o),n.current=o},"combinedRef"),s=a(()=>{const o=n.current;o&&(o.style.height="auto",o.style.height=Math.min(o.scrollHeight,Kye)+"px")},"resizeTextarea");return F.useEffect(()=>{s()},[t.value]),v.jsx(kd,{autoComplete:"off",ref:i,name:"message",className:Ue("px-4 py-3 bg-background text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring disabled:cursor-not-allowed disabled:opacity-50 w-full rounded-md flex items-center h-16 resize-none",e),...t})});sB.displayName="ChatInput";let Cu,Mu=[],Uf;const IA=a((e,t)=>String(e).padStart(t,"0"),"padWithLeadingZeros"),qye=a(({className:e,timerClassName:t,agentId:r,onChange:n})=>{const{toast:i}=Er(),[s,o]=F.useState(!1),[l,u]=F.useState(!1),[c,d]=F.useState(0),[f,g]=F.useState({id:-1,name:"",file:null}),m=Math.floor(c%3600/60),w=c%60,[E,A]=F.useMemo(()=>IA(m,2).split(""),[m]),[C,O]=F.useMemo(()=>IA(w,2).split(""),[w]),R=F.useRef({stream:null,analyser:null,mediaRecorder:null,audioContext:null}),P=dr(),L=ei({mutationKey:["whisper"],mutationFn:a(z=>P.audio.transcribe(r,{audio:z}),"mutationFn"),onSuccess:a(z=>{z?.text&&n(z.text)},"onSuccess"),onError:a(z=>{i({variant:"destructive",title:"Unable to start recording",description:z.message}),console.log(z)},"onError")});function j(){navigator.mediaDevices?.getUserMedia&&navigator.mediaDevices.getUserMedia({audio:!0}).then(z=>{o(!0);const V=window.AudioContext,h=new V,y=h.createAnalyser();h.createMediaStreamSource(z).connect(y),R.current={stream:z,analyser:y,mediaRecorder:null,audioContext:h};const _={mimeType:MediaRecorder.isTypeSupported("audio/mpeg")?"audio/mpeg":MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"audio/wav"};R.current.mediaRecorder=new MediaRecorder(z,_),R.current.mediaRecorder.start(),Mu=[],Cu=new MediaRecorder(z),Cu.start(),Cu.ondataavailable=N=>{Mu.push(N.data)}}).catch(z=>{i({variant:"destructive",title:"Unable to start recording",description:z.message}),console.log(z)})}a(j,"startRecording");function G(){Cu.onstop=()=>{const z=new Blob(Mu,{type:"audio/wav"});L.mutate(z),g({...f,file:window.URL.createObjectURL(z)}),Mu=[]},Cu.stop(),o(!1),u(!0),d(0),clearTimeout(Uf)}a(G,"stopRecording");function Z(){const{mediaRecorder:z,stream:V,analyser:h,audioContext:y}=R.current;if(z&&(z.onstop=()=>{Mu=[]},z.stop()),h&&h.disconnect(),V)for(const b of V.getTracks())b.stop();y&&y.close(),o(!1),u(!0),d(0),clearTimeout(Uf)}a(Z,"resetRecording");const K=a(()=>{G()},"handleSubmit");return F.useEffect(()=>(s&&(Uf=setTimeout(()=>{d(c+1)},1e3)),()=>clearTimeout(Uf)),[s,c]),L?.isPending?v.jsx(nt,{variant:"ghost",disabled:!0,size:"icon",children:v.jsx(Gy,{className:"size-4"})}):v.jsxs("div",{className:Ue("flex items-center justify-center gap-2 border-l border-l-transparent border-opacity-0 transition-all duration-300",{"border-opacity-100 border-l-border pl-2":s},e),children:[s?v.jsxs("div",{className:"flex gap-1 items-center",children:[v.jsx("div",{className:"bg-red-500 rounded-full h-2.5 w-2.5 animate-pulse"}),v.jsx(oB,{minuteLeft:E,minuteRight:A,secondLeft:C,secondRight:O,timerClassName:t})]}):null,v.jsxs("div",{className:"flex items-center gap-2",children:[s?v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx(nt,{onClick:Z,size:"icon",variant:"ghost",children:v.jsx(Yc,{className:"size-4"})})}),v.jsx(jr,{className:"m-2",children:v.jsx("span",{children:" Reset recording"})})]}):null,v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:s?v.jsx(nt,{onClick:K,variant:"ghost",size:"icon",children:v.jsx(IT,{className:"size-4"})}):v.jsxs(nt,{variant:"ghost",size:"icon",onClick:a(()=>j(),"onClick"),children:[v.jsx(Sz,{className:"size-4"}),v.jsx("span",{className:"sr-only",children:"Use Microphone"})]})}),v.jsx(jr,{side:"right",children:v.jsxs("span",{children:[s?"Send":"Start"," "]})})]})]})]})},"AudioRecorder"),oB=pp.memo(({minuteLeft:e,minuteRight:t,secondLeft:r,secondRight:n,timerClassName:i})=>v.jsx("div",{className:Ue("text-sm animate-in duration-1000 fade-in-0 select-none",i),children:v.jsxs("p",{children:[e,t,":",r,n]})}));oB.displayName="Timer";const CA=a(({input:e,setInput:t,inputDisabled:r,selectedFiles:n,removeFile:i,handleFileChange:s,handleSendMessage:o,handleKeyDown:l,chatType:u,targetAgentData:c,formRef:d,inputRef:f,fileInputRef:g})=>v.jsxs("div",{className:"px-2 sm:px-4 pb-2 sm:pb-4 mt-auto flex-shrink-0","data-testid":"chat-container",children:[r&&v.jsxs("div",{className:"px-2 pb-2 text-sm text-muted-foreground flex items-center gap-2",children:[v.jsxs("div",{className:"flex gap-0.5 items-center justify-center",children:[v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0s]"}),v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.2s]"}),v.jsx("span",{className:"w-[6px] h-[6px] bg-white rounded-full animate-bounce [animation-delay:0.4s]"})]}),v.jsx("span",{className:"text-xs sm:text-sm",children:u===It.DM&&c?`${c.name} is thinking`:"Agent is thinking"}),v.jsxs("div",{className:"flex",children:[v.jsx("span",{className:"animate-pulse [animation-delay:0ms]",children:"."}),v.jsx("span",{className:"animate-pulse [animation-delay:200ms]",children:"."}),v.jsx("span",{className:"animate-pulse [animation-delay:400ms]",children:"."})]})]}),v.jsxs("form",{ref:d,onSubmit:o,className:"relative rounded-md border bg-card p-2 sm:p-3",children:[n.length>0&&v.jsx("div",{className:"flex flex-wrap gap-2 sm:gap-3 p-2 sm:p-3 pb-0 max-h-32 sm:max-h-40 overflow-y-auto",children:n.map(m=>{const w=m.blobUrl||URL.createObjectURL(m.file);return v.jsxs("div",{className:"relative p-1 sm:p-2",children:[v.jsxs("div",{className:"relative w-12 h-12 sm:w-16 sm:h-16 rounded-lg overflow-hidden border bg-muted",children:[m.isUploading&&v.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center z-10",children:v.jsx(cn,{className:"h-3 w-3 sm:h-4 sm:w-4 animate-spin text-white"})}),m.file.type.startsWith("image/")?v.jsx("img",{alt:"Selected file",src:w,className:"w-full h-full object-cover"}):m.file.type.startsWith("video/")?v.jsx("video",{src:w,className:"w-full h-full object-cover",muted:!0}):v.jsx("div",{className:"w-full h-full flex items-center justify-center bg-muted",children:v.jsx(ro,{className:"h-4 w-4 sm:h-8 sm:w-8 text-muted-foreground"})}),m.error&&v.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-red-500 text-white text-xs p-1 text-center",children:"Error"})]}),v.jsx(nt,{onClick:a(()=>i(m.id),"onClick"),className:"absolute -right-1 -top-1 size-[16px] sm:size-[20px] ring-2 ring-background z-20",variant:"outline",size:"icon",disabled:m.isUploading,children:v.jsx(Hn,{className:"h-2 w-2 sm:h-3 sm:w-3"})}),v.jsx("div",{className:"text-xs text-center mt-1 truncate w-12 sm:w-16",children:m.file.name})]},m.id)})}),v.jsx(sB,{ref:f,onKeyDown:l,value:e,onChange:a(({target:m})=>t(m.value),"onChange"),placeholder:r?u===It.DM&&c?`${c.name} is thinking...`:"Agent is processing...":u===It.DM?"Type your message here...":"Message group...",className:"min-h-12 resize-none rounded-none bg-card border-0 px-0 py-0 shadow-none focus-visible:ring-0 text-sm sm:text-base",disabled:r||u===It.DM&&c?.status==="inactive","data-testid":"chat-input"}),v.jsxs("div",{className:"flex items-center pt-0 gap-1",children:[v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsxs("div",{children:[v.jsxs(nt,{variant:"ghost",size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",onClick:a(()=>{g.current&&g.current.click()},"onClick"),children:[v.jsx(kz,{className:"size-3 sm:size-4"}),v.jsx("span",{className:"sr-only",children:"Attach file"})]}),v.jsx("input",{type:"file",ref:g,onChange:s,accept:"image/*,video/*,audio/*,.pdf,.doc,.docx,.txt,.rtf,...",multiple:!0,className:"hidden"})]})}),v.jsx(jr,{side:"left",children:v.jsx("p",{children:"Attach files"})})]}),u===It.DM&&c?.id&&v.jsx(qye,{agentId:c.id,onChange:a(m=>t(m),"onChange")}),v.jsx(nt,{disabled:r||u===It.DM&&c?.status==="inactive"||n.some(m=>m.isUploading),type:"submit",size:"sm",className:"ml-auto gap-1.5 h-[26px] sm:h-[30px] px-2 sm:px-3","data-testid":"send-button",children:r||n.some(m=>m.isUploading)?v.jsxs("div",{className:"flex gap-0.5 items-center justify-center",children:[v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0s]"}),v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0.2s]"}),v.jsx("span",{className:"w-[4px] h-[4px] bg-gray-500 rounded-full animate-bounce [animation-delay:0.4s]"})]}):v.jsx(IT,{className:"size-3 sm:size-3.5"})})]})]})]}),"ChatInputArea"),lB=F.forwardRef(({className:e,children:t,scrollRef:r,contentRef:n,isAtBottom:i,scrollToBottom:s,disableAutoScroll:o,...l},u)=>v.jsxs("div",{className:"relative w-full h-full overflow-hidden",children:[v.jsx("div",{className:`flex flex-col w-full h-full p-2 overflow-y-auto ${e}`,ref:r,onWheel:o,onTouchMove:o,...l,children:v.jsx("div",{className:"flex flex-col gap-10",ref:n,children:t})}),!i&&v.jsx(nt,{onClick:a(()=>{s()},"onClick"),size:"icon",variant:"outline",className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 inline-flex rounded-full shadow-md",children:v.jsx(Az,{className:"h-4 w-4"})})]}));lB.displayName="ChatMessageList";const MA=a(({messages:e,isLoadingMessages:t,chatType:r,currentClientEntityId:n,targetAgentData:i,allAgents:s,scrollRef:o,contentRef:l,isAtBottom:u,scrollToBottom:c,disableAutoScroll:d,finalChannelId:f,getAgentInMessage:g,agentAvatarMap:m,onDeleteMessage:w,onRetryMessage:E,selectedGroupAgentId:A})=>{const C=pp.useMemo(()=>r===It.GROUP&&A?e.filter(O=>{const R=O.senderId===n,P=O.senderId===A;return R||P}):e,[e,r,A,n]);return v.jsxs(lB,{scrollRef:o,contentRef:l,isAtBottom:u,scrollToBottom:c,disableAutoScroll:d,className:"h-full w-full","data-testid":"chat-messages",children:[t&&C.length===0&&v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"Loading messages..."})}),!t&&C.length===0&&v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"No messages yet. Start the conversation!"})}),C.map(O=>{const R=O.senderId===n,P=O.isStreaming===!0,L=!R&&g?g(O.senderId):void 0;return v.jsx("div",{className:Ue("flex gap-1",R?"justify-end":"justify-start"),children:v.jsxs(ZL,{variant:R?"sent":"received",className:`flex flex-col gap-1 ${R?"flex-row-reverse":""}`,children:[!R&&r===It.GROUP&&v.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[v.jsx(Ts,{className:"size-5 border rounded-full select-none",children:v.jsx(So,{src:Dc(L||(m&&O.senderId&&s?s.find(j=>j.id===O.senderId):void 0))})}),v.jsx("div",{children:L?.name})]}),v.jsx(pwe,{message:O,agentForTts:r===It.DM?i:L,shouldAnimate:P,onDelete:w,onRetry:E,isUser:R,getAgentInMessage:r===It.GROUP?g:void 0,agentAvatarMap:r===It.GROUP?m:void 0,chatType:r})]})},`${O.id}-${O.createdAt}`)})]},f||"no-channel")},"ChatMessageListComponent");function ewe({options:e=[],className:t="",onSelect:r,initialSelected:n=[]}){const[i,s]=F.useState(n),[o,l]=F.useState(!1),u=F.useRef(null);F.useEffect(()=>{s(n)},[n]),F.useEffect(()=>{const m=a(w=>{u.current&&!u.current.contains(w.target)&&l(!1)},"handleClickOutside");return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const c=a(m=>i.some(w=>m.id&&w.id?w.id===m.id:w.label===m.label),"isOptionSelected"),d=a(m=>{console.log("[MultiSelectCombobox] toggleSelection called with:",m),s(w=>{const E=c(m);let A;return E?A=w.filter(C=>m.id&&C.id?C.id!==m.id:C.label!==m.label):A=[...w,m],console.log("[MultiSelectCombobox] New selection:",A),r&&r(A),A})},"toggleSelection"),f=a(m=>{s(w=>{const E=w.filter(A=>m.id&&A.id?A.id!==m.id:A.label!==m.label);return r&&r(E),E})},"removeSelection"),g=a(()=>{s(m=>{const w=m.slice(0,3);return r&&r(w),w})},"removeExtraSelections");return v.jsxs("div",{className:`relative w-80 ${t}`,ref:u,children:[v.jsxs("div",{className:`flex items-center gap-2 border p-2 bg-background rounded cursor-pointer ${o?"border-primary":"border-input"}`,onClick:a(()=>l(!o),"onClick"),children:[v.jsx("div",{className:"flex flex-wrap gap-1 w-full",children:i.length>0?v.jsxs(v.Fragment,{children:[i.slice(0,3).map((m,w)=>v.jsxs(Ri,{className:"flex items-center gap-1 px-2",children:[m.label,v.jsx(Hn,{size:12,className:"cursor-pointer",onClick:a(E=>{E.stopPropagation(),f(m)},"onClick")})]},m.id||m.label||w)),i.length>3&&v.jsxs(Ri,{className:"px-2 cursor-pointer",onClick:a(m=>{m.stopPropagation(),g()},"onClick"),children:["+",i.length-3," more"]})]}):v.jsx("span",{className:"text-muted-foreground",children:"Select agents..."})}),v.jsx(ha,{size:16})]}),o&&v.jsx(ya,{className:"absolute left-0 mt-2 w-full shadow-md border border-border rounded z-40 max-h-60 overflow-y-auto",children:e.length===0?v.jsx("div",{className:"p-2 text-muted-foreground text-sm",children:"No agents available"}):e.map((m,w)=>v.jsxs("div",{className:`flex items-center gap-2 p-2 cursor-pointer rounded hover:bg-muted ${c(m)?"bg-muted":"bg-card"}`,onClick:a(()=>d(m),"onClick"),children:[v.jsx("div",{className:"bg-gray-500 rounded-full w-4 h-4 flex justify-center items-center overflow-hidden text-xs",children:m.icon?v.jsx("img",{src:m.icon,alt:m.label,className:"w-full h-full object-cover"}):_o(m.label)}),m.label]},m.id||m.label||w))})]})}a(ewe,"MultiSelectCombobox");const twe="00000000-0000-0000-0000-000000000000";function rwe(e){return!!e.id&&!!Lc(e.id)&&typeof e.name=="string"&&e.name.trim()!==""}a(rwe,"isAgentSelectable");function p0({onClose:e,channelId:t}){const[r,n]=F.useState(""),[i,s]=F.useState([]),[o,l]=F.useState(""),[u,c]=F.useState([]),d=twe,f=F.useRef(!1),g=F.useRef(t),m=F.useRef(!1),{data:w}=s2(t?d:void 0,{enabled:!!t}),{data:E,isLoading:A,isError:C}=Id(),O=F.useMemo(()=>(E?.agents||[]).filter(rwe),[E]),R=an(),P=mn(),{toast:L}=Er(),{confirm:j,isOpen:G,onOpenChange:Z,onConfirm:K,options:z}=Po();F.useEffect(()=>{t&&(R.invalidateQueries({queryKey:["channelParticipants",t]}),R.refetchQueries({queryKey:["channelParticipants",t]}))},[t,R]);const V=ei({mutationFn:a(async({name:H,participantIds:$})=>{const ae=dr(),ie=bi(),ne=[...$,ie];return await ae.messaging.createGroupChannel({name:H,participantIds:ne,metadata:{type:It.GROUP,server_id:d,source:Ru}})},"mutationFn"),onSuccess:a(H=>{H&&(L({title:"Success",description:"Group created successfully."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),e(),setTimeout(()=>{P(`/group/${H.id}?messageServerId=${d}`)},100))},"onSuccess"),onError:a(H=>{De.error("Failed to create group",H);const $=H instanceof Error?H.message:"Failed to create group.";L({title:"Error",description:$,variant:"destructive"})},"onError")}),h=ei({mutationFn:a(async({name:H,participantIds:$})=>{if(!t)throw new Error("Channel ID is required for update");return await dr().messaging.updateChannel(t,{name:H,participantCentralUserIds:$})},"mutationFn"),onSuccess:a(()=>{L({title:"Group Updated",description:"Group details updated successfully."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),e(),setTimeout(()=>{P(`/group/${t}?messageServerId=${d}`)},100)},"onSuccess"),onError:a(H=>{De.error("Failed to update group",H),console.error("Group update error details:",H);const $=H instanceof Error?H.message:"Failed to update group.";L({title:"Error",description:$,variant:"destructive"})},"onError")}),y=ei({mutationFn:a(async()=>{if(!t)throw new Error("Channel ID is required for delete");return await dr().messaging.deleteChannel(t)},"mutationFn"),onSuccess:a(()=>{L({title:"Group Deleted",description:"The group has been successfully deleted."}),R.invalidateQueries({queryKey:["channels",d]}),R.invalidateQueries({queryKey:["channels"]}),P("/"),e()},"onSuccess"),onError:a(H=>{De.error("Failed to delete channel",H);const $=H instanceof Error?H.message:"Could not delete group.";typeof H=="object"&&H!==null&&H.statusCode===404?L({title:"Error Deleting Group",description:"Delete operation not found on server.",variant:"destructive"}):L({title:"Error Deleting Group",description:$,variant:"destructive"})},"onError")}),{data:b,isLoading:x,isError:_,error:N}=nn({queryKey:["channelParticipants",t],queryFn:a(async()=>{if(!t)return{success:!0,data:[]};try{const $=await dr().messaging.getChannelParticipants(t);let ae=[];return $&&Array.isArray($.participants)?ae=$.participants.map(ie=>ie.userId):$&&Array.isArray($)&&(ae=$.map(ie=>ie.userId||ie.id||ie)),{success:!0,data:ae}}catch(H){return console.error("[GroupPanel] Error fetching channel participants:",H),{success:!1,error:{message:H instanceof Error?H.message:"Unknown error"}}}},"queryFn"),enabled:!!t,retry:!1,refetchOnMount:!0,refetchOnWindowFocus:!1,staleTime:0,gcTime:0});F.useEffect(()=>{if(t&&w?.data?.channels){const H=w.data.channels.find($=>$.id===t);if(!f.current||g.current!==t){const $=H?.name||"";n($),l($),f.current=!0,g.current=t,m.current=!1}}else t||(f.current=!1,n(""),s([]),l(""),c([]))},[t,w]),F.useEffect(()=>{if(!A&&!(t&&x)){if(!t){m.current=!1;return}if(!(m.current&&g.current===t)){if(_){L({title:"Error",description:`Could not load group participants: ${N?.message||"Unknown error"}`,variant:"destructive"}),s([]),c([]),m.current=!0;return}if(b?.success&&b.data){const H=b.data,$=O.filter(ae=>H.includes(ae.id));s($),c($.map(ae=>ae.id)),m.current=!0}else b&&!b.success?(L({title:"Error",description:`Could not load group participants: ${b.error?.message||"Server error"}`,variant:"destructive"}),s([]),c([]),m.current=!0):(s([]),c([]),m.current=!0)}}},[t,A,x,b,O,_,N,L]);const T=F.useMemo(()=>A||C?[]:O.map(H=>({id:H.id,label:`${H.name}${H.status===zn.INACTIVE?" (Inactive)":""}`,icon:typeof H.settings?.avatar=="string"?H.settings.avatar:""})),[O,A,C]),k=F.useMemo(()=>[],[]),p=F.useMemo(()=>A||!t||t&&!m.current?k:i.map($=>({id:$.id,label:`${$.name}${$.status===zn.INACTIVE?" (Inactive)":""}`,icon:typeof $.settings?.avatar=="string"?$.settings.avatar:""})),[t,i,A,k]),S=F.useCallback(H=>{const $=O.filter(ae=>H.some(ie=>ie.id===ae.id));s($)},[O]),I=F.useCallback(async()=>{if(!t)return;const H=w?.data?.channels.find($=>$.id===t);j({title:"Delete Group",description:`Are you sure you want to permanently delete the group chat "${H?.name||r||"this group"}"? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},()=>{y.mutate()})},[t,r,w,y]),M=F.useMemo(()=>{if(!t)return!0;const H=r.trim()!==o.trim(),$=i.map(ne=>ne.id).sort(),ae=u.sort(),ie=JSON.stringify($)!==JSON.stringify(ae);return H||ie},[t,r,o,i,u]),U=F.useCallback(async()=>{if(!t&&i.length===0){L({title:"Validation Error",description:"Please select at least one agent for the group.",variant:"destructive"});return}const H=a(()=>{const $=i.map(ie=>ie.id),ae=r.trim()||(i.length>0?i.map(ie=>ie.name).join(", "):"Empty Group");t?h.mutate({name:ae,participantIds:$}):V.mutate({name:ae,participantIds:$})},"proceed");if(t&&i.length===0){j({title:"Remove All Agents?",description:"Are you sure you want to remove all agents from this group? This will leave the group with no participants.",confirmText:"Remove All",variant:"destructive"},()=>{H()});return}H()},[t,r,i,V,h,L]),B=t?!M||V.isPending||h.isPending||y.isPending:i.length===0||V.isPending||h.isPending||y.isPending;return v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-80 flex items-center justify-center z-50",onClick:e,children:v.jsxs(ya,{className:"w-[80%] max-w-2xl",onClick:a(H=>H.stopPropagation(),"onClick"),children:[v.jsxs(Hm,{className:"flex flex-row items-center justify-between space-y-0",children:[v.jsx(u2,{className:"text-xl font-semibold",children:t?"Edit Group Chat":"Create Group Chat"}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:e,children:v.jsx(Hn,{className:"h-4 w-4"})})]}),v.jsx(ii,{}),v.jsx(Lo,{className:"pt-4",children:v.jsxs("div",{className:"flex flex-col gap-4 w-full",children:[v.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v.jsx("label",{htmlFor:"chat-name",className:"text-sm font-medium",children:"Chat Name (Optional)"}),v.jsx(Vr,{id:"chat-name",value:r,onChange:a(H=>n(H.target.value),"onChange"),className:"w-full bg-background text-foreground",placeholder:"Leave blank to auto-generate from participants",disabled:V.isPending||h.isPending||y.isPending})]}),v.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[v.jsxs("label",{htmlFor:"invite-agents",className:"text-sm font-medium",children:["Select Agents"," ",!t&&v.jsx("span",{className:"text-muted-foreground",children:"(Required)"})]}),A?v.jsxs("div",{className:"flex items-center justify-center p-4",children:[v.jsx(cn,{className:"h-6 w-6 animate-spin text-muted-foreground"}),v.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading agents..."})]}):C?v.jsx("div",{className:"flex items-center justify-center p-4 text-red-500",children:"Error loading agents. Please try again later."}):v.jsx(ewe,{options:T,onSelect:S,className:"w-full",initialSelected:p},`group-panel-combobox-${t||"create"}-${O.length}`),i.length>0&&v.jsxs("p",{className:"text-sm text-muted-foreground",children:[i.length," agent",i.length>1?"s":""," selected"]}),t&&M&&v.jsx("div",{className:"text-sm text-blue-500 mt-1",children:"You have unsaved changes"})]})]})}),v.jsxs(Zm,{className:"flex justify-between pt-4",children:[t&&v.jsxs(nt,{variant:"destructive",onClick:I,disabled:y.isPending||V.isPending||h.isPending||A,children:[y.isPending?v.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}):v.jsx(Yc,{className:"mr-2 h-4 w-4"}),"Delete Group"]}),v.jsxs(nt,{variant:"default",className:t?"":"w-full",onClick:U,disabled:B,children:[(V.isPending||h.isPending)&&v.jsx(cn,{className:"mr-2 h-4 w-4 animate-spin"}),t?"Update Group":"Create Group"]})]})]})}),v.jsx(Ro,{open:G,onOpenChange:Z,title:z?.title||"",description:z?.description||"",confirmText:z?.confirmText,cancelText:z?.cancelText,variant:z?.variant,onConfirm:K})]})}a(p0,"GroupPanel");function nwe(e,t="00000000-0000-0000-0000-000000000000"){const r=bi();return nn({queryKey:["dmChannels",e,r,t],queryFn:a(async()=>{if(!e)return[];De.info("[useDmChannelsForAgent] Fetching distinct DM channels for agent:",e);const l=((await dr().messaging.getMessageServerChannels(t)).channels||[]).map(n2).filter(u=>{const c=u.metadata||{},d=u.type===It.DM,f=c.isDm===!0,g=c.forAgent===e,m=c.user1===r&&c.user2===e||c.user1===e&&c.user2===r;if(d&&f&&g&&m)return!0;if(u.type===It.DM&&!c.isDm&&!c.forAgent){const w=u.name.toLowerCase(),E=`dm-${r}-${e}`.toLowerCase(),A=`dm-${e}-${r}`.toLowerCase();if(w===E||w===A)return De.warn("[useDmChannelsForAgent] Matched a canonical DM channel by name convention:",u.id,u.name),!0}return!1});return De.info("[useDmChannelsForAgent] Found distinct DM channels:",l.length,l.map(u=>({id:u.id,name:u.name,metadata:u.metadata}))),l.sort((u,c)=>{const d=new Date(u.updatedAt||u.createdAt).getTime();return new Date(c.updatedAt||c.createdAt).getTime()-d})},"queryFn"),enabled:!!e,staleTime:hr.FREQUENT,refetchInterval:hr.STANDARD})}a(nwe,"useDmChannelsForAgent");function iwe(){const e=an(),{toast:t}=Er(),r=bi();return ei({mutationFn:a(async({agentId:n,channelName:i,messageServerId:s="00000000-0000-0000-0000-000000000000"})=>{if(De.info("[useCreateDmChannel] Creating new distinct DM channel with agent:",{agentId:n,channelName:i,messageServerId:s}),!i||!i.trim())throw new Error("Channel name cannot be empty for a new DM conversation.");return await dr().messaging.createGroupChannel({name:i.trim(),participantIds:[r,n],metadata:{type:It.DM,message_server_id:s,isDm:!0,user1:r,user2:n,forAgent:n,createdAt:new Date().toISOString()}})},"mutationFn"),onSuccess:a((n,i)=>{De.info("[useCreateDmChannel] Distinct DM channel created successfully:",n),t({title:"New Chat Started",description:`Conversation "${n.name}" created.`}),e.invalidateQueries({queryKey:["dmChannels",i.agentId,r,i.messageServerId]}),e.invalidateQueries({queryKey:["channels"]})},"onSuccess"),onError:a(n=>{De.error("[useCreateDmChannel] Error creating distinct DM channel:",n),t({title:"Error Creating Chat",description:n instanceof Error?n.message:"Could not start new chat.",variant:"destructive"})},"onError")})}a(iwe,"useCreateDmChannel");function awe(){return nn({queryKey:["currentMessageServer"],queryFn:a(async()=>{De.info("[useCurrentMessageServer] Fetching current message server ID from backend");const t=await dr().messaging.getCurrentMessageServer();return De.info("[useCurrentServer] Current server ID:",t.messageServerId),t.messageServerId},"queryFn"),staleTime:hr.RARE,refetchOnWindowFocus:!0,retry:3})}a(awe,"useCurrentMessageServer");const OA="eliza-agent-sidebar-visible";function swe(){const[e,t]=F.useState(!1);F.useEffect(()=>{try{const i=localStorage.getItem(OA);if(i!==null){const s=JSON.parse(i);t(s)}}catch(i){De.error("Error reading sidebar state from localStorage:",i),t(!1)}},[]);const r=F.useCallback(i=>{t(i);try{localStorage.setItem(OA,JSON.stringify(i))}catch(s){De.error("Error saving sidebar state to localStorage:",s)}},[]),n=F.useCallback(()=>{r(!e)},[e,r]);return{isVisible:e,setSidebarVisible:r,toggleSidebar:n}}a(swe,"useSidebarState");const rv="eliza-main-panel-width",nv="eliza-sidebar-panel-width",iv="eliza-floating-threshold",av=70,sv=30,ov=1400;function owe(){const[e,t]=F.useState(av),[r,n]=F.useState(sv),[i,s]=F.useState(!1),[o,l]=F.useState(ov);F.useEffect(()=>{try{const m=localStorage.getItem(rv),w=localStorage.getItem(nv),E=localStorage.getItem(iv);if(m!==null){const A=parseFloat(m);!isNaN(A)&&A>0&&A<=100&&t(A)}if(w!==null){const A=parseFloat(w);!isNaN(A)&&A>0&&A<=100&&n(A)}if(E!==null){const A=parseFloat(E);!isNaN(A)&&A>0&&l(A)}}catch(m){De.error("Error reading panel sizes from localStorage:",m),t(av),n(sv),l(ov)}},[]),F.useEffect(()=>{const m=a(()=>{const w=window.innerWidth<o;s(w)},"checkFloatingMode");return m(),window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}},[o]);const u=F.useCallback(m=>{const w=Math.max(20,Math.min(80,m));t(w);try{localStorage.setItem(rv,w.toString())}catch(E){De.error("Error saving main panel size to localStorage:",E)}},[]),c=F.useCallback(m=>{const w=Math.max(20,Math.min(80,m));n(w);try{localStorage.setItem(nv,w.toString())}catch(E){De.error("Error saving sidebar panel size to localStorage:",E)}},[]),d=F.useCallback(m=>{const w=Math.max(320,Math.min(2560,m));l(w);try{localStorage.setItem(iv,w.toString())}catch(E){De.error("Error saving floating threshold to localStorage:",E)}},[]),f=F.useCallback(()=>{s(m=>!m)},[]),g=F.useCallback(()=>{t(av),n(sv),l(ov);try{localStorage.removeItem(rv),localStorage.removeItem(nv),localStorage.removeItem(iv)}catch(m){De.error("Error clearing panel sizes from localStorage:",m)}},[]);return{mainPanelSize:e,sidebarPanelSize:r,isFloatingMode:i,floatingThreshold:o,setMainPanelSize:u,setSidebarPanelSize:c,setFloatingThreshold:d,toggleFloatingMode:f,resetPanelSizes:g}}a(owe,"usePanelWidthState");var oh={exports:{}},lwe=oh.exports,RA;function uwe(){return RA||(RA=1,(function(e,t){(function(r,n){e.exports=n()})(lwe,(function(){return function(r,n,i){r=r||{};var s=n.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(c,d,f,g){return s.fromToBase(c,d,f,g)}a(l,"i"),i.en.relativeTime=o,s.fromToBase=function(c,d,f,g,m){for(var w,E,A,C=f.$locale().relativeTime||o,O=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],R=O.length,P=0;P<R;P+=1){var L=O[P];L.d&&(w=g?i(c).diff(f,L.d,!0):f.diff(c,L.d,!0));var j=(r.rounding||Math.round)(Math.abs(w));if(A=w>0,j<=L.r||!L.r){j<=1&&P>0&&(L=O[P-1]);var G=C[L.l];m&&(j=m(""+j)),E=typeof G=="string"?G.replace("%d",j):G(j,d,L.l,A);break}}if(d)return E;var Z=A?C.future:C.past;return typeof Z=="function"?Z(E):Z.replace("%s",E)},s.to=function(c,d){return l(c,d,this,!0)},s.from=function(c,d){return l(c,d,this)};var u=a(function(c){return c.$u?i.utc():i()},"d");s.toNow=function(c){return this.to(u(this),c)},s.fromNow=function(c){return this.from(u(this),c)}}}))})(oh)),oh.exports}a(uwe,"requireRelativeTime");var cwe=uwe();const dwe=Ol(cwe);lo.extend(dwe);const fwe="00000000-0000-0000-0000-000000000000",hwe=a(e=>{const t=e.rawMessage||{},r=a(d=>{switch(d){case"pending":case"executing":case"running":return"input-streaming";case"completed":case"success":return"output-available";case"failed":case"error":return"output-error";default:return"input-available"}},"mapActionStatusToState"),n=t.actions?.[0]||t.action||"ACTION",i=t.actionStatus||"completed",s=t.actionId,o={};t.actions&&(o.actions=t.actions),t.action&&(o.action=t.action),t.thought&&(o.thought=t.thought);const l={};t.text&&(l.result=t.text),l.status=i,t.thought&&(l.thought=t.thought),t.actionResult&&(l.actionResult=t.actionResult);const c=i==="failed"||i==="error"?t.text||"Action failed":void 0;return{type:n,state:r(i),toolCallId:s,input:Object.keys(o).length>0?o:void 0,output:Object.keys(l).length>0?l:void 0,errorText:c}},"convertActionMessageToToolPart"),pwe=pp.memo(mwe,(e,t)=>{const r=e.message.rawMessage?.actionStatus,n=t.message.rawMessage?.actionStatus;return e.message.id===t.message.id&&e.message.text===t.message.text&&e.message.isLoading===t.message.isLoading&&e.shouldAnimate===t.shouldAnimate&&e.isUser===t.isUser&&r===n});function mwe({message:e,agentForTts:t,shouldAnimate:r,onDelete:n,onRetry:i,isUser:s}){const o=e.type==="agent_action"||e.source==="agent_action";return v.jsxs("div",{className:"flex flex-col w-full",children:[v.jsxs(GL,{isLoading:e.isLoading,...s?{variant:"sent"}:{},...!e.text&&!e.attachments?.length?{className:"bg-transparent"}:{},children:[o?v.jsx(Bve,{toolPart:hwe(e),defaultOpen:!1,className:"max-w-none"}):v.jsx("div",{children:(()=>{if(!e.text)return null;const l=DU(e.text),u=new Set(e.attachments?.map(f=>f.url).filter(Boolean)||[]),c=l.filter(f=>!u.has(f.url)),d=Jve(e.text,l);return v.jsxs("div",{className:"space-y-3",children:[d.trim()&&v.jsx("div",{children:s?v.jsx("div",{className:"whitespace-pre-wrap",children:d}):v.jsx(RU,{className:"max-w-none",isAnimating:r,children:d})}),c.length>0&&v.jsx("div",{className:"space-y-2",children:c.map((f,g)=>v.jsx("div",{children:v.jsx(B4,{url:f.url,title:"Shared media"})},`${f.url}-${g}`))})]})})()}),e.attachments?.filter(l=>l.url&&l.url.trim()!=="").map(l=>v.jsx(B4,{url:l.url,title:l.title||"Attachment"},`${l.url}-${l.title}`))]}),v.jsxs("div",{className:"flex items-center justify-between w-full py-1",children:[v.jsx("div",{children:!s&&(e.text||e.attachments?.length)&&e.createdAt&&v.jsx(soe,{className:"text-muted-foreground",timestamp:lo(e.createdAt).format("LT")})}),v.jsxs("div",{className:"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity duration-500",children:[!s&&e.text&&!e.isLoading&&t?.id&&v.jsxs(v.Fragment,{children:[v.jsx(Wse,{text:e.text}),v.jsx(loe,{agentId:t.id,text:e.text})]}),s&&e.text&&!e.isLoading&&i&&v.jsx(Qse,{onClick:a(()=>i(e.text||""),"onClick")}),v.jsx(Yse,{onClick:a(()=>n(e.id),"onClick")})]})]})]})}a(mwe,"MessageContent");function uB({chatType:e,contextId:t,messageServerId:r,initialDmChannelId:n}){const{toast:i}=Er(),s=an(),{data:o,isLoading:l}=awe(),{isVisible:u,setSidebarVisible:c,toggleSidebar:d}=swe(),{mainPanelSize:f,sidebarPanelSize:g,isFloatingMode:m,setMainPanelSize:w,setSidebarPanelSize:E}=owe(),[A,C]=F.useState({showGroupEditPanel:!1,showProfileOverlay:!1,input:"",inputDisabled:!1,selectedGroupAgentId:null,currentDmChannelId:null,isCreatingDM:!1,isMobile:!1}),P=cp().state?.forceNew||!1;mn();const[L,j]=F.useState(P),G=m||A.isMobile,{confirm:Z,isOpen:K,onOpenChange:z,onConfirm:V,options:h}=Po(),{stopAgent:y,isAgentStopping:b}=Md(),x=F.useCallback(Ze=>{C(Je=>({...Je,...Ze}))},[]),_=bi(),N=F.useRef(null),T=F.useRef(null),k=F.useRef(null),p=F.useRef(!1),S=F.useRef(!1),I=F.useRef(""),{data:M,isLoading:U}=SL(e===It.DM?t:void 0,{enabled:e===It.DM}),B=M?.data,{handleDelete:H,isDeleting:$}=UU(B||{}),ae=F.useMemo(()=>r||o||fwe,[r,o]),{data:ie=[],isLoading:ne}=nwe(e===It.DM?t:void 0,ae),Ne=iwe(),{data:ve}=Hae(e===It.GROUP?t:void 0),{data:he}=o2(e===It.GROUP?t:void 0),Se=he?.data,{data:Q}=Id(),se=Q?.agents||[],J=ie[0],te=e===It.DM?A.currentDmChannelId||void 0:t||void 0,{data:de=[],isLoading:be}=kL(J?.id,ae),{messages:Ae,isLoading:oe,addMessage:Y,updateMessage:ee,removeMessage:X,sendMessage:W}=Vve({channelId:te,serverId:ae,agentId:e===It.DM?t:void 0,chatType:e,onMessageAdded:a(Ze=>{mt(),Ze.isAgent&&Re()},"onMessageAdded"),onMessageUpdated:a((Ze,Je)=>{!Je.isLoading&&Je.isLoading!==void 0&&Re()},"onMessageUpdated"),onInputDisabledChange:a(Ze=>x({inputDisabled:Ze}),"onInputDisabledChange")}),q=F.useMemo(()=>e!==It.GROUP||!Se?[]:Se.map(Ze=>se.find(Je=>Je.id===Ze)).filter(Boolean),[e,Se,se]),re=F.useMemo(()=>se.reduce((Ze,Je)=>(Je.id&&typeof Je.settings?.avatar=="string"&&(Ze[Je.id]=Je.settings.avatar),Ze),{}),[se]),Oe=F.useCallback(Ze=>se.find(Je=>Je.id===Ze),[se]),{scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,autoScrollEnabled:ge}=Rve({smooth:!0}),_e=F.useRef(0),Re=F.useCallback(()=>{Ee.current&&setTimeout(()=>xe(),0)},[xe,Ee]),ze=F.useRef(!1),Pe=F.useRef(null),We=F.useCallback(async Ze=>{if(!Ze||e!=="DM")return;if(J)try{const Ft=await dr().messaging.getChannelMessages(J.id,{limit:30}),Ot=$e(J.name),nr=(Ft?.messages?.length??0)===0;if(Ot&&nr){A.currentDmChannelId===J.id?i({title:"Already in a fresh chat",description:`You're already in a new chat with ${B?.name||"the agent"}.`}):(x({currentDmChannelId:J.id}),i({title:"Chat opened",description:`You can now start chatting with ${B?.name||"the agent"}.`})),x({currentDmChannelId:J.id});return}else De.info("[Chat] Latest DM channel has messages or customized name, proceeding to create a new one.")}catch(Et){De.error("[Chat] Failed to fetch latest DM channel messages:",Et)}const Je=`Chat - ${lo().format("MMM D, HH:mm:ss")}`;De.info(`[Chat] Creating new distinct DM channel with agent ${Ze}, name: "${Je}"`),x({isCreatingDM:!0});try{ze.current=!0,De.info("[Chat] About to create DM channel with messageServerId:",ae);const Et=await Ne.mutateAsync({agentId:Ze,channelName:Je,messageServerId:ae});x({currentDmChannelId:Et.id,input:""}),setTimeout(()=>Re(),150)}catch(Et){De.error("[Chat] Error creating new distinct DM channel:",Et),x({currentDmChannelId:null,input:""})}finally{x({isCreatingDM:!1}),i({title:"Chat opened",description:`You can now start chatting with ${B?.name||"the agent"}.`})}},[e,Ne,x,Re,J,ae,B,i]),xt=F.useCallback(Ze=>{const Je=ie.find(Et=>Et.id===Ze);Je&&(De.info(`[Chat] DM Channel selected: ${Je.name} (Channel ID: ${Je.id})`),x({currentDmChannelId:Je.id,input:""}),setTimeout(()=>Re(),150))},[ie,x,Re]),Ve=F.useCallback(()=>{if(e!==It.DM||!A.currentDmChannelId||!B?.id)return;const Ze=ie.find(Je=>Je.id===A.currentDmChannelId);Ze&&Z({title:"Delete Chat",description:`Are you sure you want to delete the chat "${Ze.name}" with ${B.name}? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},async()=>{De.info(`[Chat] Deleting DM channel ${Ze.id}`);try{await dr().messaging.deleteChannel(Ze.id),s.setQueryData(["dmChannels",B.id,_],Ft=>Ft?.filter(Ot=>Ot.id!==Ze.id)),s.invalidateQueries({queryKey:["dmChannels",B.id,_]}),s.invalidateQueries({queryKey:["channels"]}),i({title:"Chat Deleted",description:`"${Ze.name}" was deleted.`});const Et=s.getQueryData(["dmChannels",B.id,_])||[];Et.length>0?(x({currentDmChannelId:Et[0].id}),De.info("[Chat] Switched to DM channel:",Et[0].id)):(De.info("[Chat] No DM channels left after deletion. Will create a fresh chat once."),x({currentDmChannelId:null}),ze.current=!1,await We(B.id))}catch(Je){De.error("[Chat] Error deleting DM channel:",Je),i({title:"Error",description:"Could not delete chat. The server might not support this action yet.",variant:"destructive"})}})},[e,A.currentDmChannelId,B,ie,Z,i,x,We,s,_]);F.useEffect(()=>{J&&!be&&de&&B?.id&&L&&(We(B.id),j(!1))},[L,j,We,B?.id,J,de,be]),F.useEffect(()=>{p.current=A.inputDisabled},[A.inputDisabled]),F.useEffect(()=>{const Ze=ie.find(Je=>Je.id===A.currentDmChannelId);Ze?.name&&(I.current=Ze.name)},[ie,A.currentDmChannelId]),F.useEffect(()=>{!ne&&ie.length>0&&(De.info("[Chat] Selecting first available DM channel:",ie[0].id),x({currentDmChannelId:ie[0].id}))},[ie,ne,x]);const Te=F.useCallback(Ze=>{if(e===It.DM&&t&&Ze&&typeof window<"u"){const Je=`/chat/${t}/${Ze}`;window.location.pathname!==Je&&window.history&&window.history.replaceState(null,"",Je)}},[e,t]);F.useEffect(()=>{A.currentDmChannelId&&Te(A.currentDmChannelId)},[A.currentDmChannelId,Te]),F.useEffect(()=>{if(De.info("[Chat] URL navigation effect triggered",{initialDmChannelId:n,agentDmChannelsLength:ie.length,isLoadingAgentDmChannels:ne,currentDmChannelId:A.currentDmChannelId}),n&&ie.length>0&&!ne&&!S.current){if(!Lc(n)){De.warn("[Chat] Invalid channel ID format from URL:",n),S.current=!0;return}ie.some(Et=>Et.id===n)?(De.info("[Chat] Switching to channel from URL:",n),x({currentDmChannelId:n}),S.current=!0):(De.warn("[Chat] Channel from URL not found, staying with current channel",{initialDmChannelId:n,availableChannels:ie.map(Et=>Et.id)}),S.current=!0)}},[n,ie,ne,x]),F.useEffect(()=>{if(e===It.DM&&B?.id){if(!(!A.currentDmChannelId||ie.some(Je=>Je.id===A.currentDmChannelId))&&!ne&&!A.isCreatingDM&&!Ne.isPending){De.info(`[Chat] Current DM channel ${A.currentDmChannelId} doesn't belong to agent ${B.id}, clearing it`),x({currentDmChannelId:null});return}!ne&&!l&&ie.length===0&&!n&&!ze.current&&!A.isCreatingDM&&!Ne.isPending&&(De.info("[Chat] No existing DM channels found; auto-creating a fresh one."),ze.current=!0,We(B.id))}else e!==It.DM&&A.currentDmChannelId!==null&&x({currentDmChannelId:null})},[e,B?.id,ie,ne,l,Ne.isPending,A.isCreatingDM,A.currentDmChannelId,n,x,We]),F.useEffect(()=>(ie.length>0&&Pe.current&&(clearTimeout(Pe.current),Pe.current=null),()=>{Pe.current&&(clearTimeout(Pe.current),Pe.current=null)}),[ie]),F.useEffect(()=>{e===It.GROUP&&q.length===1&&!A.selectedGroupAgentId&&(x({selectedGroupAgentId:q[0].id}),u||c(!0))},[e,q,A.selectedGroupAgentId,x,u,c]);const{mutate:Ye}=Zae(),{mutate:Me}=Gae();F.useEffect(()=>{const Ze=_e.current===0&&Ae.length>0,Je=Ae.length!==_e.current&&_e.current!==0;Ze?(De.debug("[chat] Initial messages loaded, scrolling to bottom.",{count:Ae.length}),Re()):Je&&(ge?(De.debug("[chat] New messages and autoScroll enabled, scrolling."),Re()):De.debug("[chat] New messages, but autoScroll is disabled (user scrolled up).")),_e.current=Ae.length},[Ae,ge,Re,te]);function $e(Ze){return!!Ze?.match(/^Chat - [A-Z][a-z]{2} \d{1,2}, \d{2}:\d{2}(:\d{2})?$/)}a($e,"isAutoGeneratedChatName");const mt=a(async()=>{if(!(!!I.current&&$e(I.current)&&e===It.DM))return;if(!te||!A.currentDmChannelId){De.warn("Cannot update chat title: missing channel ID");return}const Je=dr(),Ft=(await Je.messaging.generateChannelTitle(te,t))?.title,Ot=await Je.messaging.getChannelParticipants(A.currentDmChannelId);if(Ft&&Ot){let nr=[];Ot&&Array.isArray(Ot.participants)?nr=Ot.participants.map(ir=>ir.userId):Ot&&Array.isArray(Ot)&&(nr=Ot.map(ir=>ir.userId||ir.id||ir)),await Je.messaging.updateChannel(te,{name:Ft,participantCentralUserIds:nr});const wr=bi();s.invalidateQueries({queryKey:["dmChannels",t,wr]})}},"updateChatTitle"),{selectedFiles:ue,handleFileChange:me,removeFile:He,createBlobUrls:Ie,uploadFiles:je,cleanupBlobUrls:rt,clearFiles:ce}=zve({agentId:B?.id,channelId:te,chatType:e}),Ce=a(Ze=>{Ze.key==="Enter"&&!Ze.shiftKey&&!Ze.nativeEvent.isComposing&&(Ze.preventDefault(),et())},"handleKeyDown"),et=a(async Ze=>{Ze?.preventDefault();let Je=te;if(e===It.DM&&!Je&&B?.id){if(A.isCreatingDM||Ne.isPending){De.info("[Chat] DM channel creation already in progress; will wait for it to finish instead of creating another.");return}De.info("[Chat] No DM channel selected, creating one before sending message");try{ze.current=!0;const er=await Ne.mutateAsync({agentId:B.id,channelName:`Chat - ${lo().format("MMM D, HH:mm")}`,messageServerId:ae});x({currentDmChannelId:er.id}),Je=er.id,await new Promise(Ar=>setTimeout(Ar,100))}catch(er){De.error("[Chat] Failed to create DM channel before sending message:",er),i({title:"Error",description:"Failed to create chat channel. Please try again.",variant:"destructive"}),x({inputDisabled:!1});return}}if(!A.input.trim()&&ue.length===0||p.current||!Je||!ae||!_||e===It.DM&&!B?.id)return;const Et=Bn();let Ft=A.input.trim();const Ot=A.input;x({input:"",inputDisabled:!0});const nr=[...ue];ce(),k.current?.reset();const wr=Ie(nr),ir={id:Et,text:Ft,name:Fa,createdAt:Date.now(),senderId:_,isAgent:!1,isLoading:!0,channelId:Je,messageServerId:ae,source:e===It.DM?zd:Ru,attachments:wr};(Ft||nr.length>0)&&Y(ir),Re();try{let er=[];if(nr.length>0){const{uploaded:or,failed:mr,blobUrls:kr}=await je(nr);er=or,mr.length>0&&ee(Et,{attachments:ir.attachments?.filter(Cr=>!mr.some(Mr=>Mr.file.id===Cr.id))}),rt(kr),!Ft.trim()&&er.length>0&&(Ft=`Shared ${er.length} file(s).`)}const Ir=DU(Ot).map((or,mr)=>({id:`textmedia-${Et}-${mr}`,url:or.url,title:or.type==="image"?"Image":or.type==="video"?"Video":"Media Link",source:"user_input_url",contentType:or.type==="image"?fh.IMAGE:or.type==="video"?fh.VIDEO:void 0})),pr=[...er,...Ir],Sr=Ft||(pr.length>0?"Shared content.":"");if(!Sr.trim()&&pr.length===0){x({inputDisabled:!1}),X(Et);return}await W(Sr,{attachments:pr.length>0?pr:void 0,messageId:Et,source:e===It.DM?zd:Ru,skipOptimisticUpdate:!0,overrideChannelId:Je})}catch(er){De.error("Error sending message or uploading files:",er),i({title:"Error Sending Message",description:er instanceof Error?er.message:"Could not send message.",variant:"destructive"}),ee(Et,{isLoading:!1,text:`${ir.text||"Attachment(s)"} (Failed to send)`}),x({inputDisabled:!1})}finally{N.current?.focus()}},"handleSendMessage"),ke=a(Ze=>{if(!te||!Ze)return;const Je=Lc(Ze);Je&&(X(Ze),Ye({channelId:te,messageId:Je}))},"handleDeleteMessage"),tt=a(async Ze=>{if(p.current||!Ze.text?.trim()&&Ze.attachments?.length===0)return;x({inputDisabled:!0});const Je=Bn(),Et=Ze.text?.trim()||`Shared ${Ze.attachments?.length} file(s).`,Ft={id:Je,text:Ze.text,name:Fa,createdAt:Date.now(),senderId:_,isAgent:!1,isLoading:!0,channelId:Ze.channelId,messageServerId:ae,source:e===It.DM?zd:Ru,attachments:Ze.attachments};if(Y(Ft),Re(),!ae||!te){De.error("Cannot retry message: missing server or channel ID"),i({title:"Error Sending Message",description:"Missing required channel information.",variant:"destructive"}),x({inputDisabled:!1}),X(Je);return}try{await W(Et,{attachments:Ze.attachments,messageId:Je,source:e===It.DM?zd:Ru,skipOptimisticUpdate:!0,overrideChannelId:te})}catch(Ot){De.error("Error sending message or uploading files:",Ot),i({title:"Error Sending Message",description:Ot instanceof Error?Ot.message:"Could not send message.",variant:"destructive"}),ee(Je,{isLoading:!1,text:`${Ft.text||"Attachment(s)"} (Failed to send)`}),x({inputDisabled:!1})}},"handleRetryMessage"),Tt=a(()=>{if(!te)return;const Ze=e===It.DM?`Clear all messages in this chat with ${B?.name}?`:"Clear all messages in this group chat?";Z({title:"Clear Chat",description:`${Ze} This action cannot be undone.`,confirmText:"Clear",variant:"destructive"},()=>{Me(te)})},"handleClearChat");if(F.useEffect(()=>{const Ze=a(()=>{const Je=window.innerWidth<768;x({isMobile:Je})},"checkMobile");return Ze(),window.addEventListener("resize",Ze),()=>window.removeEventListener("resize",Ze)},[x]),e===It.DM&&(U||!B&&t||ne))return v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(cn,{className:"h-8 w-8 animate-spin text-primary"})});if(!te||!ae||e===It.DM&&!B)return v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"Loading chat context..."})});const Ke=a(()=>{$||Z({title:"Delete Agent",description:`Are you sure you want to delete the agent "${B?.name}"? This action cannot be undone.`,confirmText:"Delete",variant:"destructive"},H)},"onDeleteAgent"),st=a(()=>{if(e===It.DM&&B)return v.jsxs("div",{className:"flex items-center justify-between mb-4 p-3",children:[v.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:v.jsxs(Bc,{children:[v.jsx(zc,{asChild:!0,children:v.jsxs(nt,{variant:"ghost",size:"sm",className:"py-6 px-2 flex-shrink-0",children:[v.jsxs("div",{className:"relative flex-shrink-0",children:[v.jsx(Ts,{className:"size-4 sm:size-10 border rounded-full",children:v.jsx(So,{src:Dc(B)})}),B?.status===zn.ACTIVE?v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx("span",{className:"absolute bottom-0 right-0 size-2 sm:size-[10px] rounded-full border border-white bg-green-500"})}),v.jsx(jr,{side:"right",children:v.jsx("p",{children:"Agent is active"})})]}):v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx("span",{className:"absolute bottom-0 right-0 size-2 sm:size-[10px] rounded-full border border-white bg-muted-foreground"})}),v.jsx(jr,{side:"right",children:v.jsx("p",{children:"Agent is inactive"})})]})]}),v.jsx("div",{children:v.jsx("h2",{className:"font-semibold text-lg truncate max-w-[80px] sm:max-w-none",children:B?.name||"Agent"})}),v.jsx(ha,{className:"size-4"})]})}),v.jsxs(Fc,{align:"start",side:"bottom",className:"min-w-36 w-[var(--radix-dropdown-menu-trigger-width)]",children:[v.jsxs(la,{onClick:a(()=>{z_(B,i)},"onClick"),children:[v.jsx(sT,{className:"h-4 w-4 mr-2"}),"Export"]}),v.jsx(Vh,{}),v.jsxs(la,{onClick:a(()=>{B&&!b(B.id)&&y(B)},"onClick"),children:[v.jsx(Fy,{className:"h-4 w-4 mr-2"}),"Stop Agent"]}),v.jsxs(la,{onClick:a(()=>{B&&!$&&Ke()},"onClick"),className:"text-destructive focus:text-destructive hover:bg-red-50 dark:hover:bg-red-950/50",children:[v.jsx(Yc,{className:"h-4 w-4 mr-2"}),"Delete Agent"]})]})]})}),v.jsx("div",{className:"flex gap-1 sm:gap-2 items-center flex-shrink-0",children:e===It.DM&&v.jsxs("div",{className:"flex items-center gap-2",children:[ie.length>0&&v.jsxs(Bc,{children:[v.jsx(zc,{asChild:!0,children:v.jsxs(nt,{variant:"outline",size:"sm",className:"w-8 h-9 sm:max-w-[300px] sm:w-auto rounded-[12px]",children:[v.jsx(hp,{className:"size-4 flex-shrink-0 text-muted-foreground"}),v.jsx("span",{className:"hidden md:inline truncate text-xs sm:text-sm",children:ie.find(Ze=>Ze.id===A.currentDmChannelId)?.name||"Select Chat"}),v.jsx(ha,{className:"hidden md:inline-flex size-4 text-muted-foreground"})]})}),v.jsxs(Fc,{align:"end",className:"w-[280px] sm:w-[320px]",children:[v.jsxs(fne,{className:"font-medium",children:["Chat History with ",B.name]}),v.jsx(Vh,{}),v.jsx("div",{className:"max-h-[300px] overflow-y-auto",children:ie.map(Ze=>v.jsx(la,{onClick:a(()=>xt(Ze.id),"onClick"),className:Ue("cursor-pointer",Ze.id===A.currentDmChannelId&&"bg-muted"),children:v.jsxs("div",{className:"flex items-center justify-between w-full",children:[v.jsxs("div",{className:"flex flex-col min-w-0 flex-1",children:[v.jsx("span",{className:Ue("text-sm truncate",Ze.id===A.currentDmChannelId&&"font-medium"),children:Ze.name}),v.jsx("span",{className:"text-xs text-muted-foreground",children:lo((typeof Ze.metadata?.createdAt=="string"||typeof Ze.metadata?.createdAt=="number"?Ze.metadata.createdAt:null)||Ze.updatedAt||Ze.createdAt).fromNow()})]}),Ze.id===A.currentDmChannelId&&v.jsx(Ri,{variant:"default",className:"text-xs flex-shrink-0 ml-2",children:"Current"})]})},Ze.id))})]})]}),v.jsx(jy,{mainAction:{label:A.isCreatingDM?"Creating...":v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"sm:hidden",children:"New"}),v.jsx("span",{className:"hidden sm:inline",children:"New Chat"})]}),onClick:a(()=>We(B?.id),"onClick"),icon:A.isCreatingDM?v.jsx(cn,{className:"size-4 animate-spin"}):v.jsx(dp,{className:"size-4"}),disabled:A.isCreatingDM||ne},actions:[{label:"Clear Chat",onClick:Tt,icon:v.jsx(s1,{className:"size-4"}),disabled:!Ae||Ae.length===0},{label:"Delete Chat",onClick:Ve,icon:v.jsx(fo,{className:"size-4"}),disabled:!A.currentDmChannelId,variant:"destructive"}],variant:"outline",size:"sm",mainButtonClassName:"rounded-l-[12px] h-9",dropdownButtonClassName:"rounded-r-[12px] h-9"}),v.jsxs(Fr,{children:[v.jsx(Hr,{asChild:!0,children:v.jsx(nt,{className:"w-9 h-9 rounded-[12px]",variant:"outline",onClick:d,children:u?v.jsx(y0,{className:"size-4"}):v.jsx(o1,{className:"size-4"})})}),v.jsx(jr,{side:"bottom",children:v.jsx("p",{children:u?"Close SidePanel":"Open SidePanel"})})]})]})})]});if(e===It.GROUP){const Ze=D_(ve?.data||void 0,q,_);return v.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[v.jsxs("div",{className:"flex items-center justify-between p-3 bg-card rounded-lg border",children:[v.jsx("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:v.jsx("h2",{className:"font-semibold text-lg truncate",title:Ze,children:Ze})}),v.jsxs("div",{className:"flex gap-1 sm:gap-2 items-center flex-shrink-0",children:[v.jsx(jy,{mainAction:{label:"Edit Group",onClick:a(()=>x({showGroupEditPanel:!0}),"onClick"),icon:v.jsx(Tz,{className:"size-4"})},actions:[{label:"Clear Messages",onClick:Tt,icon:v.jsx(s1,{className:"size-4"}),disabled:!Ae||Ae.length===0},{label:"Delete Group",onClick:a(()=>{if(!te||!ae)return;const Je=te;Z({title:"Delete Group",description:"Are you sure you want to delete this group? This action cannot be undone.",confirmText:"Delete",variant:"destructive"},async()=>{try{await dr().messaging.deleteChannel(Je),i({title:"Group Deleted",description:"The group has been successfully deleted."}),window.location.href="/"}catch(Et){De.error("[Chat] Error deleting group:",Et),i({title:"Error",description:"Could not delete group.",variant:"destructive"})}})},"onClick"),icon:v.jsx(fo,{className:"size-4"}),disabled:!te||!ae,variant:"destructive"}],variant:"outline",size:"sm",className:"px-2 sm:px-3"}),v.jsx(nt,{variant:"ghost",size:"sm",className:"px-2 sm:px-3 h-8 w-8 sm:w-auto",onClick:d,children:u?v.jsx(y0,{className:"h-4 w-4"}):v.jsx(o1,{className:"h-4 w-4"})})]})]}),q.length>0&&v.jsxs("div",{className:"flex items-center gap-2 p-2 bg-card rounded-lg border overflow-x-auto",children:[v.jsx("span",{className:"text-sm text-muted-foreground whitespace-nowrap flex-shrink-0",children:"Agents:"}),v.jsxs("div",{className:"flex gap-2 min-w-0",children:[v.jsx(nt,{variant:A.selectedGroupAgentId?"ghost":"default",size:"sm",onClick:a(()=>x({selectedGroupAgentId:null}),"onClick"),className:"flex items-center gap-2 flex-shrink-0",children:v.jsx("span",{children:"All"})}),q.map(Je=>v.jsxs(nt,{variant:A.selectedGroupAgentId===Je?.id?"default":"ghost",size:"sm",onClick:a(()=>{x({selectedGroupAgentId:Je?.id||null}),Je?.id&&!u&&c(!0)},"onClick"),className:"flex items-center gap-2 flex-shrink-0",children:[v.jsx(Ts,{className:"size-5",children:v.jsx(So,{src:Dc(Je)})}),v.jsx("span",{className:"truncate max-w-[100px] sm:max-w-none",children:Je?.name})]},Je?.id))]})]})]})}return null},"renderChatHeader");return v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"h-full flex flex-col relative overflow-hidden",children:[G?v.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[v.jsx("div",{className:"flex-shrink-0 p-2 sm:p-4 pb-0",children:st()}),v.jsxs("div",{className:Ue("flex flex-col transition-all duration-300 w-full flex-1 min-h-0 overflow-hidden p-2 sm:p-4 pt-0"),children:[v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden px-5 py-2",children:v.jsx(MA,{messages:Ae,isLoadingMessages:oe,chatType:e,currentClientEntityId:_,targetAgentData:B,allAgents:se,scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,finalChannelId:te,getAgentInMessage:Oe,agentAvatarMap:re,onDeleteMessage:ke,onRetryMessage:a(Ze=>{if(!te){i({title:"Error",description:"Cannot retry message: missing channel information.",variant:"destructive"});return}const Je={id:Bn(),text:Ze,name:Fa,senderId:_,isAgent:!1,createdAt:Date.now(),channelId:te,messageServerId:ae};tt(Je)},"onRetryMessage"),selectedGroupAgentId:A.selectedGroupAgentId})}),v.jsx("div",{className:"flex-shrink-0",children:v.jsx(CA,{input:A.input,setInput:a(Ze=>x({input:Ze}),"setInput"),inputDisabled:A.inputDisabled,selectedFiles:ue,removeFile:He,handleFileChange:me,handleSendMessage:et,handleKeyDown:Ce,chatType:e,targetAgentData:B,formRef:k,inputRef:N,fileInputRef:T})})]})]}):v.jsxs(Pve,{direction:"horizontal",className:"h-full flex-1 overflow-hidden",onLayout:a(Ze=>{Ze.length>=2&&u&&!A.isMobile&&(w(Ze[0]),E(Ze[1]))},"onLayout"),children:[v.jsx(gA,{id:"main-panel",defaultSize:u&&!A.isMobile?f:100,minSize:A.isMobile?100:50,children:v.jsx("div",{className:"relative h-full overflow-hidden",children:v.jsxs("div",{className:"h-full flex flex-col overflow-hidden",children:[v.jsx("div",{className:"flex-shrink-0 p-2 sm:p-4 pb-0",children:st()}),v.jsxs("div",{className:Ue("flex flex-col transition-all duration-300 w-full flex-1 min-h-0 overflow-hidden p-2 sm:p-4 pt-0"),children:[v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden px-5 py-2",children:v.jsx(MA,{messages:Ae,isLoadingMessages:oe,chatType:e,currentClientEntityId:_,targetAgentData:B,allAgents:se,scrollRef:Ee,contentRef:Be,isAtBottom:pt,scrollToBottom:xe,disableAutoScroll:Ge,finalChannelId:te,getAgentInMessage:Oe,agentAvatarMap:re,onDeleteMessage:ke,onRetryMessage:a(Ze=>{if(!te){i({title:"Error",description:"Cannot retry message: missing channel information.",variant:"destructive"});return}const Je={id:Bn(),text:Ze,name:Fa,senderId:_,isAgent:!1,createdAt:Date.now(),channelId:te,messageServerId:ae};tt(Je)},"onRetryMessage"),selectedGroupAgentId:A.selectedGroupAgentId})}),v.jsx("div",{className:"flex-shrink-0",children:v.jsx(CA,{input:A.input,setInput:a(Ze=>x({input:Ze}),"setInput"),inputDisabled:A.inputDisabled,selectedFiles:ue,removeFile:He,handleFileChange:me,handleSendMessage:et,handleKeyDown:Ce,chatType:e,targetAgentData:B,formRef:k,inputRef:N,fileInputRef:T})})]})]})})}),(()=>{let Ze,Je="Agent",Et;return e===It.DM?(Ze=t,Je=B?.name||"Agent",Et=A.currentDmChannelId||void 0):e===It.GROUP&&A.selectedGroupAgentId?(Ze=A.selectedGroupAgentId,Je=se.find(Ot=>Ot.id===A.selectedGroupAgentId)?.name||"Group Member",Et=t):e===It.GROUP&&!A.selectedGroupAgentId&&(Je="Group",Et=t),u&&!A.isMobile&&v.jsxs(v.Fragment,{children:[v.jsx(Lve,{withHandle:!0}),v.jsx(gA,{id:"sidebar-panel",defaultSize:g,minSize:15,maxSize:85,children:v.jsx(NA,{agentId:Ze,agentName:Je,channelId:Et})})]})})()]}),(()=>{let Ze,Je="Agent",Et;return e===It.DM?(Ze=t,Je=B?.name||"Agent",Et=A.currentDmChannelId||void 0):e===It.GROUP&&A.selectedGroupAgentId?(Ze=A.selectedGroupAgentId,Je=se.find(Ot=>Ot.id===A.selectedGroupAgentId)?.name||"Group Member",Et=t):e===It.GROUP&&!A.selectedGroupAgentId&&(Je="Group",Et=t),u&&G&&v.jsx("div",{className:"absolute inset-0 z-50 bg-background/80 backdrop-blur-sm",children:v.jsx("div",{className:"absolute inset-0 bg-background shadow-lg",children:v.jsxs("div",{className:"h-full flex flex-col",children:[v.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[v.jsx("h3",{className:"font-semibold text-lg",children:Je}),v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(()=>c(!1),"onClick"),className:"h-8 w-8 p-0",children:v.jsx(y0,{className:"h-4 w-4"})})]}),v.jsx("div",{className:"flex-1 overflow-hidden",children:v.jsx(NA,{agentId:Ze,agentName:Je,channelId:Et})})]})})})})()]}),A.showGroupEditPanel&&e===It.GROUP&&v.jsx(p0,{onClose:a(()=>x({showGroupEditPanel:!1}),"onClose"),channelId:t}),A.showProfileOverlay&&e===It.DM&&B?.id&&v.jsx(HL,{isOpen:A.showProfileOverlay,onClose:a(()=>x({showProfileOverlay:!1}),"onClose"),agentId:B.id}),v.jsx(Ro,{open:K,onOpenChange:z,title:h?.title||"",description:h?.description||"",confirmText:h?.confirmText,cancelText:h?.cancelText,variant:h?.variant,onConfirm:V})]})}a(uB,"Chat");function gwe(){const{agentId:e,channelId:t}=Qy(),r=mn();F.useEffect(()=>(De.info("[AgentRoute] Component mounted/updated",{agentId:e,channelId:t}),()=>{De.info("[AgentRoute] Component unmounted",{agentId:e,channelId:t})}),[e,t]);const{agent:n,isLoading:i,isStarting:s,start:o}=Gm(e);if(!e)return v.jsx("div",{className:"p-4",children:"Agent ID not provided."});if(i||!n)return v.jsx("div",{className:"p-4 flex items-center justify-center h-full","data-testid":"loader",children:v.jsx(cn,{className:"h-8 w-8 animate-spin text-primary"})});const l=n.status===zn.ACTIVE,u=a(()=>{n&&o()},"handleStartAgent");return l?(De.info("[AgentRoute] Agent is active, rendering chat for DM",{agentName:n?.name,dmChannelIdFromRoute:t}),v.jsx(uB,{chatType:It.DM,contextId:e,initialDmChannelId:t},`${e}-${t||"no-dm-channel"}`)):(De.info("[AgentRoute] Agent is not active, rendering inactive state UI",{agentName:n?.name}),v.jsxs("div",{className:"flex flex-col items-center justify-center h-full w-full p-8 text-center",children:[v.jsxs("h2",{className:"text-2xl font-semibold mb-4",children:[n.name," is not active."]}),v.jsx("p",{className:"text-muted-foreground mb-6",children:"Press the button below to start this agent."}),v.jsxs("div",{className:"flex gap-3",children:[v.jsx(nt,{onClick:a(()=>r(`/settings/${e}`),"onClick"),variant:"outline",size:"lg",children:v.jsx(ho,{className:"h-5 w-5"})}),v.jsxs(nt,{onClick:u,disabled:s,size:"lg",children:[s?v.jsx(cn,{className:"mr-2 h-5 w-5 animate-spin"}):v.jsx(Zy,{className:"mr-2 h-5 w-5"}),s?"Starting Agent...":"Start Agent"]})]})]}))}a(gwe,"AgentRouteContent");function PA(){return v.jsx(gwe,{})}a(PA,"AgentRoute");function bwe(){return v.jsx("div",{className:"h-full w-full overflow-y-auto",children:v.jsx("div",{className:"min-h-full flex w-full justify-center px-4 sm:px-6 py-4",children:v.jsx("div",{className:"w-full max-w-4xl min-w-0",children:v.jsx(tL,{})})})})}a(bwe,"AgentCreatorRoute");function vwe({className:e,...t}){return v.jsx(Nz,{"data-slot":"switch",className:Ue("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-4 w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer",e),...t,children:v.jsx(Iz,{"data-slot":"switch-thumb",className:Ue("bg-background dark:data-[state=unchecked]:bg-primary-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block h-2.5 w-2.5 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%+10px)] data-[state=unchecked]:translate-x-0")})})}a(vwe,"Switch");const ywe=a(({agent:e,onChat:t})=>{const r=mn(),{startAgent:n,stopAgent:i,isAgentStarting:s,isAgentStopping:o}=Md();if(!e||!e.id)return De.error("[AgentCard] Agent data or ID is missing",{agent:e}),v.jsx(ya,{className:"p-4 min-h-[100px] flex items-center justify-center text-muted-foreground",children:"Agent data not available."});const l=e.id,u=e.name||"Unnamed Agent",c=Array.isArray(e.bio)?e.bio.filter(Boolean).join(" ").trim():typeof e.bio=="string"&&e.bio.trim()||"Engages with all types of questions and conversations",d=e.status===zn.ACTIVE,f=s(e.id),g=o(e.id),m={id:e.id,name:u,username:e.username||u,bio:e.bio||"",messageExamples:e.messageExamples||[],postExamples:e.postExamples||[],topics:e.topics||[],adjectives:e.adjectives||[],knowledge:e.knowledge||[],plugins:e.plugins||[],settings:e.settings||{},secrets:e.secrets||{},style:e.style||{},system:e.system||void 0,templates:e.templates||{},enabled:typeof e.enabled=="boolean"?e.enabled:!0,status:e.status||zn.INACTIVE,createdAt:typeof e.createdAt=="number"?e.createdAt:Date.now(),updatedAt:typeof e.updatedAt=="number"?e.updatedAt:Date.now()},w=a(()=>{n(m)},"handleStart"),E=a(()=>{i(m)},"handleStop"),A=a((R=!1)=>{t(R)},"handleNewChat"),C=a(()=>{r(`/settings/${l}`)},"handleSettings"),O=a(()=>{d?E():w()},"handleToggle");return v.jsx(ya,{className:Ue("w-full transition-all bg-card border border-border/50 rounded-sm hover:bg-card/50 cursor-pointer",d?"":"opacity-75"),"data-testid":"agent-card",onClick:a(R=>{R.stopPropagation(),A()},"onClick"),children:v.jsxs(Lo,{className:"p-0 relative h-full",children:[v.jsx("div",{className:"absolute top-3 right-3",children:v.jsx(vwe,{checked:d,onCheckedChange:a(R=>{R!==d&&O()},"onCheckedChange"),onClick:a(R=>R.stopPropagation(),"onClick"),"aria-label":`Toggle ${u}`,disabled:f||g,className:Ue(d?"data-[state=checked]:!bg-green-600":"data-[state=unchecked]:!bg-gray-500/80")})}),v.jsxs("div",{className:"flex flex-col justify-between h-full",children:[v.jsxs("div",{className:"flex items-center gap-4 p-2 h-[90%]",children:[v.jsxs(Ts,{className:"h-16 w-16 flex-shrink-0 rounded-sm",children:[v.jsx(So,{src:Dc(e),alt:u}),v.jsx(zm,{className:"text-lg font-medium rounded-sm",children:_o(u)})]}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("h3",{className:"font-semibold text-xl mb-1 truncate",title:u,children:u}),v.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:c})]})]}),v.jsx("div",{className:"border-t border-muted"}),v.jsxs("div",{className:"flex items-center justify-between py-1 px-2",children:[v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(R=>{R.stopPropagation(),C()},"onClick"),className:"h-8 w-8 p-0 hover:bg-muted/50 cursor-pointer",children:v.jsx(ho,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:a(R=>{R.stopPropagation(),A(!0)},"onClick"),className:"h-8 px-2 rounded-sm bg-muted hover:bg-muted/50 cursor-pointer",children:"New Chat"})]})]})]})})},"AgentCard"),wwe=a(({group:e})=>{const t=mn(),r=bi(),[n,i]=F.useState(!1);if(!e||!e.id)return v.jsx(ya,{className:"p-4 min-h-[180px] flex items-center justify-center text-muted-foreground",children:"Group data not available."});const s=D_(e,e.participants||[],r),o=a(()=>{t(`/group/${e.id}?messageServerId=${e.server_id}`)},"handleChatClick"),{data:l}=Id(),u=l?.agents||[],{data:c}=o2(e.id),d=c?.data,f=d&&Array.isArray(d)?d:[],g=f?u.filter(E=>E.id&&f.includes(E.id)):[],m=a(()=>{i(!0)},"handleSettings"),w=g.map(E=>E.name).filter(Boolean).join(", ")||"No members";return v.jsxs(v.Fragment,{children:[v.jsx(ya,{className:"w-full transition-all bg-card border border-border/50 rounded-sm","data-testid":"agent-card",children:v.jsx(Lo,{className:"p-0 relative h-full",children:v.jsxs("div",{className:"flex flex-col justify-between h-full",children:[v.jsxs("div",{className:"flex items-center gap-4 p-2 h-[90%]",children:[v.jsx(Ts,{className:"bg-[#282829] h-16 w-16 flex-shrink-0 rounded-[3px] relative overflow-hidden",children:g&&g.length>0?v.jsxs("div",{className:"grid grid-cols-2 grid-rows-2 gap-1 w-full h-full p-1",children:[g.slice(0,3).map(E=>{const A=typeof E.settings?.avatar=="string"?E.settings.avatar:null;return A?v.jsx("img",{src:A,alt:E.name,className:"object-cover w-full h-full rounded-[3px]"},E.id):v.jsx("div",{className:"flex items-center justify-center bg-[#3F3F3F] text-xs font-medium w-full h-full rounded-[3px]",children:_o(E.name)},E.id)}),g.length>3?v.jsxs("div",{className:"flex items-center justify-center bg-[#3F3F3F] text-xs font-medium w-full h-full rounded-[3px]",children:["+",g.length-3]}):Array.from({length:4-g.slice(0,3).length}).map((E,A)=>v.jsx("div",{className:"flex items-center justify-center bg-[#2D2D2D] text-xs font-medium w-full h-full rounded-[3px]"},`empty-${A}`))]}):v.jsx("div",{className:"flex items-center justify-center bg-muted text-lg font-medium w-full h-full",children:_o(s)})}),v.jsxs("div",{className:"flex-1 min-w-0",children:[v.jsx("h3",{className:"font-semibold text-xl mb-1 truncate",title:s,children:s}),v.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 leading-relaxed",children:w})]})]}),v.jsx("div",{className:"border-t border-muted"}),v.jsxs("div",{className:"flex items-center justify-between py-1 px-2",children:[v.jsx(nt,{variant:"ghost",size:"sm",onClick:a(E=>{E.stopPropagation(),m()},"onClick"),className:"h-8 w-8 p-0 hover:bg-muted/50 cursor-pointer",children:v.jsx(ho,{className:"h-4 w-4 text-muted-foreground"})}),v.jsx(nt,{variant:"outline",size:"sm",onClick:a(E=>{E.stopPropagation(),o()},"onClick"),className:"h-8 px-2 rounded-sm bg-muted hover:bg-muted/50 cursor-pointer",children:"Chat"})]})]})})}),n&&v.jsx(p0,{onClose:a(()=>i(!1),"onClose"),channelId:e.id})]})},"GroupCard");function xwe(){const{agents:e,isLoading:t,error:r}=IL(),n=!!r,i=mn(),s=e.filter(L=>L.status===zn.ACTIVE).length,{data:o}=AL(),l=o?.data?.servers||[],[u,c]=F.useState(!1),[d,f]=F.useState(!1),[g,m]=F.useState(null),[w,E]=F.useState(null),[A,C]=F.useState("agents"),O=a(()=>{m(null),c(!1)},"closeOverlay"),R=a(async(L,j)=>{L.id&&(De.info(`[Home] Navigating to chat/${L.id}`),i(`/chat/${L.id}`,{state:{forceNew:j}}))},"handleNavigateToDm"),P=a(()=>{i("/group/new")},"handleCreateGroup");return F.useEffect(()=>{De.info("[Home] Component mounted/re-rendered. Key might have changed.")},[]),v.jsxs(v.Fragment,{children:[v.jsx("div",{className:"flex-1 w-full overflow-y-auto bg-background",children:v.jsx("div",{className:"flex flex-col w-full h-full",children:v.jsxs(B_,{value:A,onValueChange:C,className:"w-full h-full flex flex-col",children:[v.jsx("div",{className:"w-full",children:v.jsxs("div",{className:"w-full md:max-w-4xl mx-auto px-6 pt-6 pb-2",children:[v.jsxs("div",{className:"flex justify-between items-center mb-3",children:[v.jsxs(Sm,{className:"h-auto p-0 bg-transparent border-0 border-b-0 gap-2 w-auto",children:[v.jsxs(Uc,{value:"agents",className:"relative rounded-full data-[state=active]:border-b-0 data-[state=active]:bg-white data-[state=active]:text-black data-[state=active]:font-bold cursor-pointer text-lg py-1",children:["Agents",v.jsx("span",{className:`
383
383
  absolute -top-2.5 right-0 inline-flex items-center justify-center h-5 w-5 rounded-full bg-blue-600 text-white text-[8px] font-semibold border border-black
384
384
  transition-all duration-300 ease-in-out
385
385
  ${A==="agents"&&s>0?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none"}
386
386
  `,children:s})]}),v.jsx(Uc,{value:"groups",className:"rounded-full data-[state=active]:border-b-0 data-[state=active]:bg-white data-[state=active]:text-black data-[state=active]:font-bold cursor-pointer text-lg py-1",children:"Groups"})]}),v.jsxs(nt,{variant:"ghost",onClick:a(()=>{A==="agents"?i("/create"):P()},"onClick"),className:"create-agent-button cursor-pointer gap-1",children:[v.jsx(dp,{className:"w-4 h-4"}),A==="agents"?"Create New Agent":"Create New Group"]})]}),v.jsx(ii,{})]})}),v.jsx(Ci,{value:"agents",className:"flex-1 mt-0 bg-background",children:v.jsxs("div",{className:"flex flex-col gap-6 w-full md:max-w-4xl mx-auto px-6 py-2",children:[t&&v.jsx("div",{className:"text-center py-8",children:"Loading agents..."}),n&&v.jsxs("div",{className:"text-center py-8",children:["Error loading agents: ",r instanceof Error?r.message:"Unknown error"]}),e.length===0&&!t&&v.jsx("div",{className:"text-center py-8 flex flex-col items-center gap-4",children:v.jsx("p",{className:"text-muted-foreground",children:"No agents currently running. Start a character to begin."})}),!t&&!n&&v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 gap-3 agents-section",children:e.sort((L,j)=>{const G=L.status===zn.ACTIVE?1:0;return(j.status===zn.ACTIVE?1:0)-G}).map(L=>v.jsx(ywe,{agent:L,onChat:a(j=>R(L,j),"onChat")},L.id))})]})}),v.jsx(Ci,{value:"groups",className:"flex-1 mt-0 bg-background",children:v.jsx("div",{className:"flex flex-col gap-6 w-full md:max-w-4xl mx-auto px-6 py-2",children:!t&&!n&&v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-2 gap-3 groups-section",children:l.map(L=>v.jsx(cB,{serverId:L.id},L.id))})})})]})})}),g?.id&&v.jsx(HL,{isOpen:u,onClose:O,agentId:g.id}),d&&v.jsx(p0,{onClose:a(()=>{E(null),f(!1)},"onClose"),channelId:w??void 0})]})}a(xwe,"Home");const cB=pp.memo(({serverId:e})=>{const{data:t,isLoading:r}=s2(e),n=F.useMemo(()=>t?.data?.channels?.filter(i=>i.type===It.GROUP)||[],[t]);return r?v.jsx("p",{children:"Loading channels for server..."}):!n||n.length===0?v.jsx("p",{className:"text-sm text-muted-foreground",children:"No group channels in this server."}):v.jsx(v.Fragment,{children:n.map(i=>v.jsx(wwe,{group:{...i,server_id:e}},i.id))})});cB.displayName="ServerChannels";function _we(){const t=cp().pathname,r=t.startsWith("/api/")||t.includes("/agents/")||t.includes("/memory/")||t.includes("/speech/");return v.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[70vh] px-4 text-center",children:[v.jsx("div",{className:"flex items-center justify-center mb-8",children:v.jsx("div",{className:"bg-red-900/20 h-24 w-24 rounded-full flex items-center justify-center",children:v.jsx(pi,{className:"h-14 w-14 text-red-500"})})}),v.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Page Not Found"}),v.jsxs("div",{className:"max-w-lg",children:[r?v.jsxs(v.Fragment,{children:[v.jsxs("p",{className:"text-lg mb-6 text-muted-foreground",children:["The endpoint ",v.jsx("span",{className:"font-mono text-red-400",children:t})," does not exist."]}),v.jsxs("div",{className:"bg-red-900/20 border border-red-800/30 rounded-md p-4 mb-8 text-left",children:[v.jsxs("h3",{className:"text-red-400 font-medium mb-2 flex items-center",children:[v.jsx(pi,{className:"h-4 w-4 mr-2"}),"Endpoint Not Found"]}),v.jsx("p",{className:"text-sm text-red-300/80 mb-2",children:"The requested API endpoint does not exist on this server. Please check that:"}),v.jsxs("ul",{className:"text-sm text-red-300/80 list-disc pl-5 space-y-1",children:[v.jsx("li",{children:"The URL is spelled correctly"}),v.jsx("li",{children:"You're using the correct version of the API"}),v.jsx("li",{children:"The endpoint is available in this version of Eliza"})]})]})]}):v.jsx("p",{className:"text-lg mb-6 text-muted-foreground",children:"Sorry, the page you're looking for doesn't exist or has been moved."}),v.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[v.jsx(nt,{asChild:!0,variant:"default",children:v.jsxs(Cz,{to:"/",children:[v.jsx(Mz,{className:"h-4 w-4 mr-2"}),"Go to Home"]})}),v.jsx(nt,{asChild:!0,variant:"outline",children:v.jsxs("a",{onClick:a(()=>window.history.back(),"onClick"),children:[v.jsx(cv,{className:"h-4 w-4 mr-2"}),"Go Back"]})})]})]})]})}a(_we,"NotFound");function Ewe(){const{channelId:e}=Qy(),[t]=Oz(),r=t.get("messageServerId"),n=Lc(e),i=Lc(r||"");return!n||!i?v.jsx("div",{className:"flex flex-1 justify-center items-center",children:v.jsx("p",{children:"Missing channel or server information."})}):v.jsx(uB,{chatType:It.GROUP,contextId:n,messageServerId:i},n)}a(Ewe,"GroupRouteContent");function Swe(){return v.jsx(Ewe,{})}a(Swe,"GroupRoute");function kwe(){const e=mn();return v.jsx("div",{className:"pt-4 md:pt-8",children:v.jsx(p0,{onClose:a(()=>e(-1),"onClose")})})}a(kwe,"GroupNew");function Awe(){const{agentId:e}=Qy(),t=mn(),{agent:r,isLoading:n}=Gm(e);if(n)return v.jsx("div",{className:"flex items-center justify-center h-full",children:v.jsx(cn,{className:"h-8 w-8 animate-spin"})});if(!r)return v.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",children:[v.jsx("p",{className:"text-muted-foreground",children:"Agent not found"}),v.jsx(nt,{onClick:a(()=>t("/"),"onClick"),children:"Back to Home"})]});const i={...r,createdAt:r.createdAt??Date.now(),bio:r.bio??[],topics:r.topics??[],adjectives:r.adjectives??[],style:r.style??{all:[],chat:[],post:[]},settings:r.settings??{secrets:{}}};return v.jsx("div",{className:"flex w-full justify-center px-4 sm:px-6 overflow-y-auto",children:v.jsx("div",{className:"w-full md:max-w-4xl py-6",children:v.jsx(BU,{agent:i,agentId:e,onSaveComplete:a(()=>{},"onSaveComplete")})})})}a(Awe,"AgentSettingsRoute");const dB=new Pz({defaultOptions:{queries:{staleTime:hr.STANDARD,refetchInterval:!1,retry:a((e,t)=>t?.response?.status===401||t?.response?.status===403?!1:e<3,"retry"),retryDelay:a(e=>Math.min(1e3*2**e,3e4),"retryDelay"),refetchOnWindowFocus:!0,refetchOnReconnect:!0},mutations:{retry:a((e,t)=>t?.response?.status===401||t?.response?.status===403?!1:e<3,"retry"),retryDelay:a(e=>Math.min(1e3*2**e,3e4),"retryDelay")}}}),Twe=a(async()=>{try{await dB.prefetchQuery({queryKey:["agents"],queryFn:a(async()=>({data:await dr().agents.listAgents()}),"queryFn"),staleTime:hr.FREQUENT})}catch(e){console.error("Error prefetching initial data:",e)}},"prefetchInitialData");function Nwe(){Vse();const{status:e}=Nd(),[t,r]=F.useState(!1),[n,i]=F.useState(Date.now()),s=an();F.useEffect(()=>{De.info("[AppContent] Mounted/Updated"),Twe()},[]);const o=a(()=>{De.info("[AppContent] refreshHomePage called. Current homeKey:",n);const l=Date.now();i(l),De.info("[AppContent] New homeKey set to:",l),De.info("[AppContent] Invalidating queries for Home page refresh."),s.invalidateQueries({queryKey:["agents"]}),s.invalidateQueries({queryKey:["servers"]})},"refreshHomePage");return v.jsxs(dl,{delayDuration:0,children:[v.jsxs(OP,{children:[v.jsx(VS,{refreshHomePage:o}),v.jsxs(PP,{className:"h-screen flex flex-col md:ml-72 overflow-hidden",children:[v.jsx("div",{className:"md:hidden absolute top-4 left-4 z-50",children:v.jsxs(IP,{open:t,onOpenChange:r,children:[v.jsx(Sre,{asChild:!0,children:v.jsxs(nt,{variant:"ghost",size:"icon","data-testid":"mobile-menu-button",children:[v.jsx(Dz,{className:"h-5 w-5"}),v.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),v.jsx(U_,{side:"left",className:"w-80 p-0 z-50",children:v.jsx(VS,{isMobile:!0,refreshHomePage:o})})]})}),v.jsx("div",{className:"flex w-full justify-center pt-16 md:pt-0 flex-shrink-0",children:v.jsx("div",{className:"w-full md:max-w-4xl",children:v.jsx(qae,{})})}),v.jsx("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:v.jsxs(jz,{children:[v.jsx(yi,{path:"/",element:v.jsx(xwe,{},n)}),v.jsx(yi,{path:"chat/:agentId/:channelId",element:v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:v.jsx(PA,{})})}),v.jsx(yi,{path:"chat/:agentId",element:v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:v.jsx(PA,{})})}),v.jsx(yi,{path:"settings/:agentId",element:v.jsx(Awe,{})}),v.jsx(yi,{path:"group/new",element:v.jsx(kwe,{})}),v.jsx(yi,{path:"agents/new",element:v.jsx(bwe,{})}),v.jsx(yi,{path:"/create",element:v.jsx("div",{className:"flex w-full justify-center px-4 sm:px-6 overflow-y-auto",children:v.jsx("div",{className:"w-full md:max-w-4xl",children:v.jsx(tL,{})})})}),v.jsx(yi,{path:"/logs",element:v.jsx("div",{className:"flex w-full justify-center",children:v.jsxs("div",{className:"w-full md:max-w-4xl",children:[v.jsx("div",{className:"flex items-center justify-between mb-4",children:v.jsx("h2",{className:"text-2xl p-4 font-bold",children:"System Logs"})}),v.jsx(CL,{})]})})}),v.jsx(yi,{path:"group/:channelId",element:v.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:v.jsx(Swe,{})})}),v.jsx(yi,{path:"settings/",element:v.jsx("div",{className:"flex w-full justify-center overflow-y-auto",children:v.jsx("div",{className:"w-full md:max-w-4xl",children:v.jsx(rse,{})})})}),v.jsx(yi,{path:"*",element:v.jsx(_we,{})})]})})]})]}),v.jsx(pse,{}),e!=="unauthorized"&&v.jsx(dse,{})]})}a(Nwe,"AppContent");function Iwe(){return v.jsx(Rz,{client:dB,children:v.jsx("div",{className:"dark antialiased font-sans",style:{colorScheme:"dark"},children:v.jsx(Lz,{children:v.jsx(gse,{children:v.jsx(Nae,{children:v.jsx(Nwe,{})})})})})})}a(Iwe,"App");const fB=document.getElementById("root");if(!fB)throw new Error("Root element not found");Uz.createRoot(fB).render(v.jsx(F.StrictMode,{children:v.jsx(Iwe,{})}));const Uwe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),Cwe=Object.freeze(Object.defineProperty({__proto__:null,Mermaid:OU},Symbol.toStringTag,{value:"Module"}));export{vi as N,Fbe as a,Ut as b,jwe as c,Uwe as m};
387
- //# sourceMappingURL=mermaid-4DMBBIKO-BQ49hQHG.js.map
387
+ //# sourceMappingURL=mermaid-4DMBBIKO-WBI514jR.js.map