@devvit/public-api 0.11.3-next-2024-11-18-d670f9ded.0 → 0.11.4-next-2024-11-18-ab991d9ed.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public-api.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var FS=Object.create;var Em=Object.defineProperty;var TS=Object.getOwnPropertyDescriptor;var AS=Object.getOwnPropertyNames;var ES=Object.getPrototypeOf,RS=Object.prototype.hasOwnProperty;var Rm=r=>{throw TypeError(r)};var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var OS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of AS(e))!RS.call(r,n)&&n!==t&&Em(r,n,{get:()=>e[n],enumerable:!(i=TS(e,n))||i.enumerable});return r};var Dn=(r,e,t)=>(t=r!=null?FS(ES(r)):{},OS(e||!r||!r.__esModule?Em(t,"default",{value:r,enumerable:!0}):t,r));var ll=(r,e,t)=>e.has(r)||Rm("Cannot "+t);var s=(r,e,t)=>(ll(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>e.has(r)?Rm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),d=(r,e,t,i)=>(ll(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),S=(r,e,t)=>(ll(r,e,"access private method"),t);var Om=(r,e,t,i)=>({set _(n){d(r,e,n,t)},get _(){return s(r,e,i)}});var le=h((lO,Bm)=>{Bm.exports=function(r){try{return!!r()}catch{return!0}}});var la=h((uO,Mm)=>{var BS=le();Mm.exports=!BS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Z=h((cO,Lm)=>{var Um=la(),Dm=Function.prototype,ul=Dm.call,MS=Um&&Dm.bind.bind(ul,ul);Lm.exports=Um?MS:function(r){return function(){return ul.apply(r,arguments)}}});var _m=h((mO,Nm)=>{var US=Math.ceil,DS=Math.floor;Nm.exports=Math.trunc||function(e){var t=+e;return(t>0?DS:US)(t)}});var ua=h((pO,Hm)=>{var LS=_m();Hm.exports=function(r){var e=+r;return e!==e||e===0?0:LS(e)}});var he=h((gO,qm)=>{var ca=function(r){return r&&r.Math==Math&&r};qm.exports=ca(typeof globalThis=="object"&&globalThis)||ca(typeof window=="object"&&window)||ca(typeof self=="object"&&self)||ca(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var Wr=h((hO,jm)=>{jm.exports=!1});var ma=h((fO,Gm)=>{var Wm=he(),NS=Object.defineProperty;Gm.exports=function(r,e){try{NS(Wm,r,{value:e,configurable:!0,writable:!0})}catch{Wm[r]=e}return e}});var pa=h((vO,zm)=>{var _S=he(),HS=ma(),Vm="__core-js_shared__",qS=_S[Vm]||HS(Vm,{});zm.exports=qS});var cl=h((yO,$m)=>{var jS=Wr(),Jm=pa();($m.exports=function(r,e){return Jm[r]||(Jm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:jS?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var ga=h((bO,Km)=>{Km.exports=function(r){return r==null}});var ha=h((kO,Xm)=>{var WS=ga(),GS=TypeError;Xm.exports=function(r){if(WS(r))throw GS("Can't call method on "+r);return r}});var Ln=h((SO,Zm)=>{var VS=ha(),zS=Object;Zm.exports=function(r){return zS(VS(r))}});var we=h((PO,Qm)=>{var JS=Z(),$S=Ln(),KS=JS({}.hasOwnProperty);Qm.exports=Object.hasOwn||function(e,t){return KS($S(e),t)}});var ml=h((CO,Ym)=>{var XS=Z(),ZS=0,QS=Math.random(),YS=XS(1 .toString);Ym.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+YS(++ZS+QS,36)}});var tp=h((wO,ep)=>{ep.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var dp=h((IO,ap)=>{var op=he(),pl=tp(),rp=op.process,ip=op.Deno,np=rp&&rp.versions||ip&&ip.version,sp=np&&np.v8,qe,fa;sp&&(qe=sp.split("."),fa=qe[0]>0&&qe[0]<4?1:+(qe[0]+qe[1]));!fa&&pl&&(qe=pl.match(/Edge\/(\d+)/),(!qe||qe[1]>=74)&&(qe=pl.match(/Chrome\/(\d+)/),qe&&(fa=+qe[1])));ap.exports=fa});var gl=h((xO,up)=>{var lp=dp(),eP=le();up.exports=!!Object.getOwnPropertySymbols&&!eP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&lp&&lp<41})});var hl=h((FO,cp)=>{var tP=gl();cp.exports=tP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ie=h((TO,pp)=>{var rP=he(),iP=cl(),mp=we(),nP=ml(),sP=gl(),oP=hl(),Gr=rP.Symbol,fl=iP("wks"),aP=oP?Gr.for||Gr:Gr&&Gr.withoutSetter||nP;pp.exports=function(r){return mp(fl,r)||(fl[r]=sP&&mp(Gr,r)?Gr[r]:aP("Symbol."+r)),fl[r]}});var fp=h((AO,hp)=>{var dP=Ie(),lP=dP("toStringTag"),gp={};gp[lP]="z";hp.exports=String(gp)==="[object z]"});var yl=h((EO,vp)=>{var vl=typeof document=="object"&&document.all,uP=typeof vl>"u"&&vl!==void 0;vp.exports={all:vl,IS_HTMLDDA:uP}});var Q=h((RO,bp)=>{var yp=yl(),cP=yp.all;bp.exports=yp.IS_HTMLDDA?function(r){return typeof r=="function"||r===cP}:function(r){return typeof r=="function"}});var va=h((OO,Sp)=>{var kp=Z(),mP=kp({}.toString),pP=kp("".slice);Sp.exports=function(r){return pP(mP(r),8,-1)}});var Nn=h((BO,Pp)=>{var gP=fp(),hP=Q(),ya=va(),fP=Ie(),vP=fP("toStringTag"),yP=Object,bP=ya(function(){return arguments}())=="Arguments",kP=function(r,e){try{return r[e]}catch{}};Pp.exports=gP?ya:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=kP(e=yP(r),vP))=="string"?t:bP?ya(e):(i=ya(e))=="Object"&&hP(e.callee)?"Arguments":i}});var _n=h((MO,Cp)=>{var SP=Nn(),PP=String;Cp.exports=function(r){if(SP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return PP(r)}});var kl=h((UO,xp)=>{var bl=Z(),CP=ua(),wP=_n(),IP=ha(),xP=bl("".charAt),wp=bl("".charCodeAt),FP=bl("".slice),Ip=function(r){return function(e,t){var i=wP(IP(e)),n=CP(t),o=i.length,a,c;return n<0||n>=o?r?"":void 0:(a=wp(i,n),a<55296||a>56319||n+1===o||(c=wp(i,n+1))<56320||c>57343?r?xP(i,n):a:r?FP(i,n,n+2):(a-55296<<10)+(c-56320)+65536)}};xp.exports={codeAt:Ip(!1),charAt:Ip(!0)}});var Ap=h((DO,Tp)=>{var TP=he(),AP=Q(),Fp=TP.WeakMap;Tp.exports=AP(Fp)&&/native code/.test(String(Fp))});var wt=h((LO,Op)=>{var Ep=Q(),Rp=yl(),EP=Rp.all;Op.exports=Rp.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Ep(r)||r===EP}:function(r){return typeof r=="object"?r!==null:Ep(r)}});var fe=h((NO,Bp)=>{var RP=le();Bp.exports=!RP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Pl=h((_O,Up)=>{var OP=he(),Mp=wt(),Sl=OP.document,BP=Mp(Sl)&&Mp(Sl.createElement);Up.exports=function(r){return BP?Sl.createElement(r):{}}});var Cl=h((HO,Dp)=>{var MP=fe(),UP=le(),DP=Pl();Dp.exports=!MP&&!UP(function(){return Object.defineProperty(DP("div"),"a",{get:function(){return 7}}).a!=7})});var wl=h((qO,Lp)=>{var LP=fe(),NP=le();Lp.exports=LP&&NP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Ze=h((jO,Np)=>{var _P=wt(),HP=String,qP=TypeError;Np.exports=function(r){if(_P(r))return r;throw qP(HP(r)+" is not an object")}});var je=h((WO,_p)=>{var jP=la(),ba=Function.prototype.call;_p.exports=jP?ba.bind(ba):function(){return ba.apply(ba,arguments)}});var Hn=h((GO,Hp)=>{var Il=he(),WP=Q(),GP=function(r){return WP(r)?r:void 0};Hp.exports=function(r,e){return arguments.length<2?GP(Il[r]):Il[r]&&Il[r][e]}});var xl=h((VO,qp)=>{var VP=Z();qp.exports=VP({}.isPrototypeOf)});var Fl=h((zO,jp)=>{var zP=Hn(),JP=Q(),$P=xl(),KP=hl(),XP=Object;jp.exports=KP?function(r){return typeof r=="symbol"}:function(r){var e=zP("Symbol");return JP(e)&&$P(e.prototype,XP(r))}});var Tl=h((JO,Wp)=>{var ZP=String;Wp.exports=function(r){try{return ZP(r)}catch{return"Object"}}});var ka=h(($O,Gp)=>{var QP=Q(),YP=Tl(),eC=TypeError;Gp.exports=function(r){if(QP(r))return r;throw eC(YP(r)+" is not a function")}});var Sa=h((KO,Vp)=>{var tC=ka(),rC=ga();Vp.exports=function(r,e){var t=r[e];return rC(t)?void 0:tC(t)}});var Jp=h((XO,zp)=>{var Al=je(),El=Q(),Rl=wt(),iC=TypeError;zp.exports=function(r,e){var t,i;if(e==="string"&&El(t=r.toString)&&!Rl(i=Al(t,r))||El(t=r.valueOf)&&!Rl(i=Al(t,r))||e!=="string"&&El(t=r.toString)&&!Rl(i=Al(t,r)))return i;throw iC("Can't convert object to primitive value")}});var Zp=h((ZO,Xp)=>{var nC=je(),$p=wt(),Kp=Fl(),sC=Sa(),oC=Jp(),aC=Ie(),dC=TypeError,lC=aC("toPrimitive");Xp.exports=function(r,e){if(!$p(r)||Kp(r))return r;var t=sC(r,lC),i;if(t){if(e===void 0&&(e="default"),i=nC(t,r,e),!$p(i)||Kp(i))return i;throw dC("Can't convert object to primitive value")}return e===void 0&&(e="number"),oC(r,e)}});var Pa=h((QO,Qp)=>{var uC=Zp(),cC=Fl();Qp.exports=function(r){var e=uC(r,"string");return cC(e)?e:e+""}});var Qe=h(eg=>{var mC=fe(),pC=Cl(),gC=wl(),Ca=Ze(),Yp=Pa(),hC=TypeError,Ol=Object.defineProperty,fC=Object.getOwnPropertyDescriptor,Bl="enumerable",Ml="configurable",Ul="writable";eg.f=mC?gC?function(e,t,i){if(Ca(e),t=Yp(t),Ca(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Ul in i&&!i[Ul]){var n=fC(e,t);n&&n[Ul]&&(e[t]=i.value,i={configurable:Ml in i?i[Ml]:n[Ml],enumerable:Bl in i?i[Bl]:n[Bl],writable:!1})}return Ol(e,t,i)}:Ol:function(e,t,i){if(Ca(e),t=Yp(t),Ca(i),pC)try{return Ol(e,t,i)}catch{}if("get"in i||"set"in i)throw hC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Vr=h((eB,tg)=>{tg.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var wa=h((tB,rg)=>{var vC=fe(),yC=Qe(),bC=Vr();rg.exports=vC?function(r,e,t){return yC.f(r,e,bC(1,t))}:function(r,e,t){return r[e]=t,r}});var Ia=h((rB,ng)=>{var kC=cl(),SC=ml(),ig=kC("keys");ng.exports=function(r){return ig[r]||(ig[r]=SC(r))}});var xa=h((iB,sg)=>{sg.exports={}});var zr=h((nB,dg)=>{var PC=Ap(),ag=he(),CC=wt(),wC=wa(),Dl=we(),Ll=pa(),IC=Ia(),xC=xa(),og="Object already initialized",Nl=ag.TypeError,FC=ag.WeakMap,Fa,qn,Ta,TC=function(r){return Ta(r)?qn(r):Fa(r,{})},AC=function(r){return function(e){var t;if(!CC(e)||(t=qn(e)).type!==r)throw Nl("Incompatible receiver, "+r+" required");return t}};PC||Ll.state?(We=Ll.state||(Ll.state=new FC),We.get=We.get,We.has=We.has,We.set=We.set,Fa=function(r,e){if(We.has(r))throw Nl(og);return e.facade=r,We.set(r,e),e},qn=function(r){return We.get(r)||{}},Ta=function(r){return We.has(r)}):(ar=IC("state"),xC[ar]=!0,Fa=function(r,e){if(Dl(r,ar))throw Nl(og);return e.facade=r,wC(r,ar,e),e},qn=function(r){return Dl(r,ar)?r[ar]:{}},Ta=function(r){return Dl(r,ar)});var We,ar;dg.exports={set:Fa,get:qn,has:Ta,enforce:TC,getterFor:AC}});var _l=h(cg=>{"use strict";var lg={}.propertyIsEnumerable,ug=Object.getOwnPropertyDescriptor,EC=ug&&!lg.call({1:2},1);cg.f=EC?function(e){var t=ug(this,e);return!!t&&t.enumerable}:lg});var ql=h((oB,mg)=>{var RC=Z(),OC=le(),BC=va(),Hl=Object,MC=RC("".split);mg.exports=OC(function(){return!Hl("z").propertyIsEnumerable(0)})?function(r){return BC(r)=="String"?MC(r,""):Hl(r)}:Hl});var Jr=h((aB,pg)=>{var UC=ql(),DC=ha();pg.exports=function(r){return UC(DC(r))}});var jl=h(hg=>{var LC=fe(),NC=je(),_C=_l(),HC=Vr(),qC=Jr(),jC=Pa(),WC=we(),GC=Cl(),gg=Object.getOwnPropertyDescriptor;hg.f=LC?gg:function(e,t){if(e=qC(e),t=jC(t),GC)try{return gg(e,t)}catch{}if(WC(e,t))return HC(!NC(_C.f,e,t),e[t])}});var Vl=h((lB,vg)=>{var Wl=fe(),VC=we(),fg=Function.prototype,zC=Wl&&Object.getOwnPropertyDescriptor,Gl=VC(fg,"name"),JC=Gl&&function(){}.name==="something",$C=Gl&&(!Wl||Wl&&zC(fg,"name").configurable);vg.exports={EXISTS:Gl,PROPER:JC,CONFIGURABLE:$C}});var Jl=h((uB,yg)=>{var KC=Z(),XC=Q(),zl=pa(),ZC=KC(Function.toString);XC(zl.inspectSource)||(zl.inspectSource=function(r){return ZC(r)});yg.exports=zl.inspectSource});var Xl=h((cB,Sg)=>{var Kl=Z(),QC=le(),YC=Q(),Aa=we(),$l=fe(),e0=Vl().CONFIGURABLE,t0=Jl(),kg=zr(),r0=kg.enforce,i0=kg.get,bg=String,Ea=Object.defineProperty,n0=Kl("".slice),s0=Kl("".replace),o0=Kl([].join),a0=$l&&!QC(function(){return Ea(function(){},"length",{value:8}).length!==8}),d0=String(String).split("String"),l0=Sg.exports=function(r,e,t){n0(bg(e),0,7)==="Symbol("&&(e="["+s0(bg(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Aa(r,"name")||e0&&r.name!==e)&&($l?Ea(r,"name",{value:e,configurable:!0}):r.name=e),a0&&t&&Aa(t,"arity")&&r.length!==t.arity&&Ea(r,"length",{value:t.arity});try{t&&Aa(t,"constructor")&&t.constructor?$l&&Ea(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=r0(r);return Aa(i,"source")||(i.source=o0(d0,typeof e=="string"?e:"")),r};Function.prototype.toString=l0(function(){return YC(this)&&i0(this).source||t0(this)},"toString")});var dr=h((mB,Pg)=>{var u0=Q(),c0=Qe(),m0=Xl(),p0=ma();Pg.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(u0(t)&&m0(t,o,i),i.global)n?r[e]=t:p0(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:c0.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var Zl=h((pB,Cg)=>{var g0=ua(),h0=Math.max,f0=Math.min;Cg.exports=function(r,e){var t=g0(r);return t<0?h0(t+e,0):f0(t,e)}});var Ig=h((gB,wg)=>{var v0=ua(),y0=Math.min;wg.exports=function(r){return r>0?y0(v0(r),9007199254740991):0}});var Ra=h((hB,xg)=>{var b0=Ig();xg.exports=function(r){return b0(r.length)}});var Ag=h((fB,Tg)=>{var k0=Jr(),S0=Zl(),P0=Ra(),Fg=function(r){return function(e,t,i){var n=k0(e),o=P0(n),a=S0(i,o),c;if(r&&t!=t){for(;o>a;)if(c=n[a++],c!=c)return!0}else for(;o>a;a++)if((r||a in n)&&n[a]===t)return r||a||0;return!r&&-1}};Tg.exports={includes:Fg(!0),indexOf:Fg(!1)}});var Yl=h((vB,Rg)=>{var C0=Z(),Ql=we(),w0=Jr(),I0=Ag().indexOf,x0=xa(),Eg=C0([].push);Rg.exports=function(r,e){var t=w0(r),i=0,n=[],o;for(o in t)!Ql(x0,o)&&Ql(t,o)&&Eg(n,o);for(;e.length>i;)Ql(t,o=e[i++])&&(~I0(n,o)||Eg(n,o));return n}});var Oa=h((yB,Og)=>{Og.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Mg=h(Bg=>{var F0=Yl(),T0=Oa(),A0=T0.concat("length","prototype");Bg.f=Object.getOwnPropertyNames||function(e){return F0(e,A0)}});var eu=h(Ug=>{Ug.f=Object.getOwnPropertySymbols});var Lg=h((SB,Dg)=>{var E0=Hn(),R0=Z(),O0=Mg(),B0=eu(),M0=Ze(),U0=R0([].concat);Dg.exports=E0("Reflect","ownKeys")||function(e){var t=O0.f(M0(e)),i=B0.f;return i?U0(t,i(e)):t}});var Hg=h((PB,_g)=>{var Ng=we(),D0=Lg(),L0=jl(),N0=Qe();_g.exports=function(r,e,t){for(var i=D0(e),n=N0.f,o=L0.f,a=0;a<i.length;a++){var c=i[a];!Ng(r,c)&&!(t&&Ng(t,c))&&n(r,c,o(e,c))}}});var jg=h((CB,qg)=>{var _0=le(),H0=Q(),q0=/#|\.prototype\./,jn=function(r,e){var t=W0[j0(r)];return t==V0?!0:t==G0?!1:H0(e)?_0(e):!!e},j0=jn.normalize=function(r){return String(r).replace(q0,".").toLowerCase()},W0=jn.data={},G0=jn.NATIVE="N",V0=jn.POLYFILL="P";qg.exports=jn});var Wn=h((wB,Wg)=>{var tu=he(),z0=jl().f,J0=wa(),$0=dr(),K0=ma(),X0=Hg(),Z0=jg();Wg.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,c,p,g,f;if(i?a=tu:n?a=tu[t]||K0(t,{}):a=(tu[t]||{}).prototype,a)for(c in e){if(g=e[c],r.dontCallGetSet?(f=z0(a,c),p=f&&f.value):p=a[c],o=Z0(i?c:t+(n?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof g==typeof p)continue;X0(g,p)}(r.sham||p&&p.sham)&&J0(g,"sham",!0),$0(a,c,g,r)}}});var ru=h((IB,Gg)=>{var Q0=Yl(),Y0=Oa();Gg.exports=Object.keys||function(e){return Q0(e,Y0)}});var zg=h(Vg=>{var ew=fe(),tw=wl(),rw=Qe(),iw=Ze(),nw=Jr(),sw=ru();Vg.f=ew&&!tw?Object.defineProperties:function(e,t){iw(e);for(var i=nw(t),n=sw(t),o=n.length,a=0,c;o>a;)rw.f(e,c=n[a++],i[c]);return e}});var $g=h((FB,Jg)=>{var ow=Hn();Jg.exports=ow("document","documentElement")});var Gn=h((TB,th)=>{var aw=Ze(),dw=zg(),Kg=Oa(),lw=xa(),uw=$g(),cw=Pl(),mw=Ia(),Xg=">",Zg="<",nu="prototype",su="script",Yg=mw("IE_PROTO"),iu=function(){},eh=function(r){return Zg+su+Xg+r+Zg+"/"+su+Xg},Qg=function(r){r.write(eh("")),r.close();var e=r.parentWindow.Object;return r=null,e},pw=function(){var r=cw("iframe"),e="java"+su+":",t;return r.style.display="none",uw.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(eh("document.F=Object")),t.close(),t.F},Ba,Ma=function(){try{Ba=new ActiveXObject("htmlfile")}catch{}Ma=typeof document<"u"?document.domain&&Ba?Qg(Ba):pw():Qg(Ba);for(var r=Kg.length;r--;)delete Ma[nu][Kg[r]];return Ma()};lw[Yg]=!0;th.exports=Object.create||function(e,t){var i;return e!==null?(iu[nu]=aw(e),i=new iu,iu[nu]=null,i[Yg]=e):i=Ma(),t===void 0?i:dw.f(i,t)}});var ih=h((AB,rh)=>{var gw=le();rh.exports=!gw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var au=h((EB,sh)=>{var hw=we(),fw=Q(),vw=Ln(),yw=Ia(),bw=ih(),nh=yw("IE_PROTO"),ou=Object,kw=ou.prototype;sh.exports=bw?ou.getPrototypeOf:function(r){var e=vw(r);if(hw(e,nh))return e[nh];var t=e.constructor;return fw(t)&&e instanceof t?t.prototype:e instanceof ou?kw:null}});var cu=h((RB,dh)=>{"use strict";var Sw=le(),Pw=Q(),Cw=wt(),ww=Gn(),oh=au(),Iw=dr(),xw=Ie(),Fw=Wr(),uu=xw("iterator"),ah=!1,lt,du,lu;[].keys&&(lu=[].keys(),"next"in lu?(du=oh(oh(lu)),du!==Object.prototype&&(lt=du)):ah=!0);var Tw=!Cw(lt)||Sw(function(){var r={};return lt[uu].call(r)!==r});Tw?lt={}:Fw&&(lt=ww(lt));Pw(lt[uu])||Iw(lt,uu,function(){return this});dh.exports={IteratorPrototype:lt,BUGGY_SAFARI_ITERATORS:ah}});var Vn=h((OB,uh)=>{var Aw=Qe().f,Ew=we(),Rw=Ie(),lh=Rw("toStringTag");uh.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Ew(r,lh)&&Aw(r,lh,{configurable:!0,value:e})}});var $r=h((BB,ch)=>{ch.exports={}});var mu=h((MB,mh)=>{"use strict";var Ow=cu().IteratorPrototype,Bw=Gn(),Mw=Vr(),Uw=Vn(),Dw=$r(),Lw=function(){return this};mh.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=Bw(Ow,{next:Mw(+!i,t)}),Uw(r,n,!1,!0),Dw[n]=Lw,r}});var gh=h((UB,ph)=>{var Nw=Q(),_w=String,Hw=TypeError;ph.exports=function(r){if(typeof r=="object"||Nw(r))return r;throw Hw("Can't set "+_w(r)+" as a prototype")}});var fh=h((DB,hh)=>{var qw=Z(),jw=Ze(),Ww=gh();hh.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=qw(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return jw(n),Ww(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var gu=h((LB,xh)=>{"use strict";var Gw=Wn(),Vw=je(),Ua=Wr(),wh=Vl(),zw=Q(),Jw=mu(),vh=au(),yh=fh(),$w=Vn(),Kw=wa(),pu=dr(),Xw=Ie(),bh=$r(),Ih=cu(),Zw=wh.PROPER,Qw=wh.CONFIGURABLE,kh=Ih.IteratorPrototype,Da=Ih.BUGGY_SAFARI_ITERATORS,zn=Xw("iterator"),Sh="keys",Jn="values",Ph="entries",Ch=function(){return this};xh.exports=function(r,e,t,i,n,o,a){Jw(t,e,i);var c=function(x){if(x===n&&b)return b;if(!Da&&x in f)return f[x];switch(x){case Sh:return function(){return new t(this,x)};case Jn:return function(){return new t(this,x)};case Ph:return function(){return new t(this,x)}}return function(){return new t(this)}},p=e+" Iterator",g=!1,f=r.prototype,m=f[zn]||f["@@iterator"]||n&&f[n],b=!Da&&m||c(n),v=e=="Array"&&f.entries||m,P,C,F;if(v&&(P=vh(v.call(new r)),P!==Object.prototype&&P.next&&(!Ua&&vh(P)!==kh&&(yh?yh(P,kh):zw(P[zn])||pu(P,zn,Ch)),$w(P,p,!0,!0),Ua&&(bh[p]=Ch))),Zw&&n==Jn&&m&&m.name!==Jn&&(!Ua&&Qw?Kw(f,"name",Jn):(g=!0,b=function(){return Vw(m,this)})),n)if(C={values:c(Jn),keys:o?b:c(Sh),entries:c(Ph)},a)for(F in C)(Da||g||!(F in f))&&pu(f,F,C[F]);else Gw({target:e,proto:!0,forced:Da||g},C);return(!Ua||a)&&f[zn]!==b&&pu(f,zn,b,{name:n}),bh[e]=b,C}});var hu=h((NB,Fh)=>{Fh.exports=function(r,e){return{value:r,done:e}}});var Rh=h(()=>{"use strict";var Yw=kl().charAt,eI=_n(),Ah=zr(),tI=gu(),Th=hu(),Eh="String Iterator",rI=Ah.set,iI=Ah.getterFor(Eh);tI(String,"String",function(r){rI(this,{type:Eh,string:eI(r),index:0})},function(){var e=iI(this),t=e.string,i=e.index,n;return i>=t.length?Th(void 0,!0):(n=Yw(t,i),e.index+=n.length,Th(n,!1))})});var fu=h((qB,Oh)=>{var nI=le(),sI=Ie(),oI=Wr(),aI=sI("iterator");Oh.exports=!nI(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,n){e.delete("b"),t+=n+i}),oI&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[aI]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var Mh=h((jB,Bh)=>{var dI=va(),lI=Z();Bh.exports=function(r){if(dI(r)==="Function")return lI(r)}});var La=h((WB,Dh)=>{var Uh=Mh(),uI=ka(),cI=la(),mI=Uh(Uh.bind);Dh.exports=function(r,e){return uI(r),e===void 0?r:cI?mI(r,e):function(){return r.apply(e,arguments)}}});var _h=h((GB,Nh)=>{var Lh=Xl(),pI=Qe();Nh.exports=function(r,e,t){return t.get&&Lh(t.get,e,{getter:!0}),t.set&&Lh(t.set,e,{setter:!0}),pI.f(r,e,t)}});var vu=h((VB,Hh)=>{var gI=xl(),hI=TypeError;Hh.exports=function(r,e){if(gI(e,r))return r;throw hI("Incorrect invocation")}});var Gh=h((zB,Wh)=>{"use strict";var qh=fe(),fI=Z(),vI=je(),yI=le(),yu=ru(),bI=eu(),kI=_l(),SI=Ln(),PI=ql(),Kr=Object.assign,jh=Object.defineProperty,CI=fI([].concat);Wh.exports=!Kr||yI(function(){if(qh&&Kr({b:1},Kr(jh({},"a",{enumerable:!0,get:function(){jh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(n){e[n]=n}),Kr({},r)[t]!=7||yu(Kr({},e)).join("")!=i})?function(e,t){for(var i=SI(e),n=arguments.length,o=1,a=bI.f,c=kI.f;n>o;)for(var p=PI(arguments[o++]),g=a?CI(yu(p),a(p)):yu(p),f=g.length,m=0,b;f>m;)b=g[m++],(!qh||vI(c,p,b))&&(i[b]=p[b]);return i}:Kr});var Jh=h((JB,zh)=>{var wI=je(),Vh=Ze(),II=Sa();zh.exports=function(r,e,t){var i,n;Vh(r);try{if(i=II(r,"return"),!i){if(e==="throw")throw t;return t}i=wI(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Vh(i),t}});var Kh=h(($B,$h)=>{var xI=Ze(),FI=Jh();$h.exports=function(r,e,t,i){try{return i?e(xI(t)[0],t[1]):e(t)}catch(n){FI(r,"throw",n)}}});var Zh=h((KB,Xh)=>{var TI=Ie(),AI=$r(),EI=TI("iterator"),RI=Array.prototype;Xh.exports=function(r){return r!==void 0&&(AI.Array===r||RI[EI]===r)}});var nf=h((XB,rf)=>{var OI=Z(),BI=le(),Qh=Q(),MI=Nn(),UI=Hn(),DI=Jl(),Yh=function(){},LI=[],ef=UI("Reflect","construct"),bu=/^\s*(?:class|function)\b/,NI=OI(bu.exec),_I=!bu.exec(Yh),$n=function(e){if(!Qh(e))return!1;try{return ef(Yh,LI,e),!0}catch{return!1}},tf=function(e){if(!Qh(e))return!1;switch(MI(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _I||!!NI(bu,DI(e))}catch{return!0}};tf.sham=!0;rf.exports=!ef||BI(function(){var r;return $n($n.call)||!$n(Object)||!$n(function(){r=!0})||r})?tf:$n});var ku=h((ZB,sf)=>{"use strict";var HI=Pa(),qI=Qe(),jI=Vr();sf.exports=function(r,e,t){var i=HI(e);i in r?qI.f(r,i,jI(0,t)):r[i]=t}});var Na=h((QB,af)=>{var WI=Nn(),of=Sa(),GI=ga(),VI=$r(),zI=Ie(),JI=zI("iterator");af.exports=function(r){if(!GI(r))return of(r,JI)||of(r,"@@iterator")||VI[WI(r)]}});var Su=h((YB,df)=>{var $I=je(),KI=ka(),XI=Ze(),ZI=Tl(),QI=Na(),YI=TypeError;df.exports=function(r,e){var t=arguments.length<2?QI(r):e;if(KI(t))return XI($I(t,r));throw YI(ZI(r)+" is not iterable")}});var mf=h((eM,cf)=>{"use strict";var ex=La(),tx=je(),rx=Ln(),ix=Kh(),nx=Zh(),sx=nf(),ox=Ra(),lf=ku(),ax=Su(),dx=Na(),uf=Array;cf.exports=function(e){var t=rx(e),i=sx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=ex(o,n>2?arguments[2]:void 0));var c=dx(t),p=0,g,f,m,b,v,P;if(c&&!(this===uf&&nx(c)))for(b=ax(t,c),v=b.next,f=i?new this:[];!(m=tx(v,b)).done;p++)P=a?ix(b,o,[m.value,p],!0):m.value,lf(f,p,P);else for(g=ox(t),f=i?new this(g):uf(g);g>p;p++)P=a?o(t[p],p):t[p],lf(f,p,P);return f.length=p,f}});var Pu=h((tM,gf)=>{var pf=Zl(),lx=Ra(),ux=ku(),cx=Array,mx=Math.max;gf.exports=function(r,e,t){for(var i=lx(r),n=pf(e,i),o=pf(t===void 0?i:t,i),a=cx(mx(o-n,0)),c=0;n<o;n++,c++)ux(a,c,r[n]);return a.length=c,a}});var Cf=h((rM,Pf)=>{var lr=Z(),Cu=2147483647,Kn=36,bf=1,xu=26,px=38,gx=700,hx=72,fx=128,vx="-",yx=/[^\0-\u007E]/,kf=/[.\u3002\uFF0E\uFF61]/g,hf="Overflow: input needs wider integers to process",wu=Kn-bf,ff=RangeError,bx=lr(kf.exec),Xr=Math.floor,Iu=String.fromCharCode,vf=lr("".charCodeAt),Sf=lr([].join),It=lr([].push),kx=lr("".replace),Sx=lr("".split),Px=lr("".toLowerCase),Cx=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=vf(r,t++);if(n>=55296&&n<=56319&&t<i){var o=vf(r,t++);(o&64512)==56320?It(e,((n&1023)<<10)+(o&1023)+65536):(It(e,n),t--)}else It(e,n)}return e},yf=function(r){return r+22+75*(r<26)},wx=function(r,e,t){var i=0;for(r=t?Xr(r/gx):r>>1,r+=Xr(r/e);r>wu*xu>>1;)r=Xr(r/wu),i+=Kn;return Xr(i+(wu+1)*r/(r+px))},Ix=function(r){var e=[];r=Cx(r);var t=r.length,i=fx,n=0,o=hx,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&It(e,Iu(c));var p=e.length,g=p;for(p&&It(e,vx);g<t;){var f=Cu;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<f&&(f=c);var m=g+1;if(f-i>Xr((Cu-n)/m))throw ff(hf);for(n+=(f-i)*m,i=f,a=0;a<r.length;a++){if(c=r[a],c<i&&++n>Cu)throw ff(hf);if(c==i){for(var b=n,v=Kn;;){var P=v<=o?bf:v>=o+xu?xu:v-o;if(b<P)break;var C=b-P,F=Kn-P;It(e,Iu(yf(P+C%F))),b=Xr(C/F),v+=Kn}It(e,Iu(yf(b))),o=wx(n,m,g==p),n=0,g++}}n++,i++}return Sf(e,"")};Pf.exports=function(r){var e=[],t=Sx(kx(Px(r),kf,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],It(e,bx(yx,n)?"xn--"+Ix(n):n);return Sf(e,".")}});var Fu=h((iM,wf)=>{var xx=TypeError;wf.exports=function(r,e){if(r<e)throw xx("Not enough arguments");return r}});var xf=h((nM,If)=>{var Fx=Ie(),Tx=Gn(),Ax=Qe().f,Tu=Fx("unscopables"),Au=Array.prototype;Au[Tu]==null&&Ax(Au,Tu,{configurable:!0,value:Tx(null)});If.exports=function(r){Au[Tu][r]=!0}});var Of=h((sM,Rf)=>{"use strict";var Ex=Jr(),Eu=xf(),Ff=$r(),Af=zr(),Rx=Qe().f,Ox=gu(),_a=hu(),Bx=Wr(),Mx=fe(),Ef="Array Iterator",Ux=Af.set,Dx=Af.getterFor(Ef);Rf.exports=Ox(Array,"Array",function(r,e){Ux(this,{type:Ef,target:Ex(r),index:0,kind:e})},function(){var r=Dx(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,_a(void 0,!0)):t=="keys"?_a(i,!1):t=="values"?_a(e[i],!1):_a([i,e[i]],!1)},"values");var Tf=Ff.Arguments=Ff.Array;Eu("keys");Eu("values");Eu("entries");if(!Bx&&Mx&&Tf.name!=="values")try{Rx(Tf,"name",{value:"values"})}catch{}});var Mf=h((oM,Bf)=>{var Lx=dr();Bf.exports=function(r,e,t){for(var i in e)Lx(r,i,e[i],t);return r}});var Lf=h((aM,Df)=>{var Uf=Pu(),Nx=Math.floor,Ru=function(r,e){var t=r.length,i=Nx(t/2);return t<8?_x(r,e):Hx(r,Ru(Uf(r,0,i),e),Ru(Uf(r,i),e),e)},_x=function(r,e){for(var t=r.length,i=1,n,o;i<t;){for(o=i,n=r[i];o&&e(r[o-1],n)>0;)r[o]=r[--o];o!==i++&&(r[o]=n)}return r},Hx=function(r,e,t,i){for(var n=e.length,o=t.length,a=0,c=0;a<n||c<o;)r[a+c]=a<n&&c<o?i(e[a],t[c])<=0?e[a++]:t[c++]:a<n?e[a++]:t[c++];return r};Df.exports=Ru});var qu=h((dM,iv)=>{"use strict";Of();var Du=Wn(),Qr=he(),Ha=je(),Ye=Z(),qx=fe(),Kf=fu(),Xf=dr(),jx=Mf(),Wx=Vn(),Gx=mu(),_u=zr(),Zf=vu(),Ou=Q(),Vx=we(),zx=La(),Jx=Nn(),$x=Ze(),Qf=wt(),ve=_n(),Kx=Gn(),Nf=Vr(),Lu=Su(),Xx=Na(),Zr=Fu(),Zx=Ie(),Qx=Lf(),Yx=Zx("iterator"),Qn="URLSearchParams",Yf=Qn+"Iterator",ev=_u.set,Ge=_u.getterFor(Qn),eF=_u.getterFor(Yf),tF=Object.getOwnPropertyDescriptor,Hu=function(r){if(!qx)return Qr[r];var e=tF(Qr,r);return e&&e.value},_f=Hu("fetch"),ja=Hu("Request"),Xn=Hu("Headers"),Bu=ja&&ja.prototype,Hf=Xn&&Xn.prototype,rF=Qr.RegExp,iF=Qr.TypeError,tv=Qr.decodeURIComponent,nF=Qr.encodeURIComponent,sF=Ye("".charAt),qf=Ye([].join),ur=Ye([].push),Nu=Ye("".replace),oF=Ye([].shift),jf=Ye([].splice),Wf=Ye("".split),aF=Ye("".slice),dF=/\+/g,Gf=Array(4),lF=function(r){return Gf[r-1]||(Gf[r-1]=rF("((?:%[\\da-f]{2}){"+r+"})","gi"))},uF=function(r){try{return tv(r)}catch{return r}},Vf=function(r){var e=Nu(r,dF," "),t=4;try{return tv(e)}catch{for(;t;)e=Nu(e,lF(t--),uF);return e}},cF=/[!'()~]|%20/g,mF={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pF=function(r){return mF[r]},zf=function(r){return Nu(nF(r),cF,pF)},Mu=Gx(function(e,t){ev(this,{type:Yf,iterator:Lu(Ge(e).entries),kind:t})},"Iterator",function(){var e=eF(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value=t==="keys"?n.key:t==="values"?n.value:[n.key,n.value]),i},!0),rv=function(r){this.entries=[],this.url=null,r!==void 0&&(Qf(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?sF(r,0)==="?"?aF(r,1):r:ve(r)))};rv.prototype={type:Qn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=Xx(r),t,i,n,o,a,c,p;if(e)for(t=Lu(r,e),i=t.next;!(n=Ha(i,t)).done;){if(o=Lu($x(n.value)),a=o.next,(c=Ha(a,o)).done||(p=Ha(a,o)).done||!Ha(a,o).done)throw iF("Expected sequence with length 2");ur(this.entries,{key:ve(c.value),value:ve(p.value)})}else for(var g in r)Vx(r,g)&&ur(this.entries,{key:g,value:ve(r[g])})},parseQuery:function(r){if(r)for(var e=Wf(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=Wf(i,"="),ur(this.entries,{key:Vf(oF(n)),value:Vf(qf(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],ur(e,zf(i.key)+"="+zf(i.value));return qf(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Wa=function(){Zf(this,Zn);var e=arguments.length>0?arguments[0]:void 0;ev(this,new rv(e))},Zn=Wa.prototype;jx(Zn,{append:function(e,t){Zr(arguments.length,2);var i=Ge(this);ur(i.entries,{key:ve(e),value:ve(t)}),i.updateURL()},delete:function(r){Zr(arguments.length,1);for(var e=Ge(this),t=e.entries,i=ve(r),n=0;n<t.length;)t[n].key===i?jf(t,n,1):n++;e.updateURL()},get:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=[],o=0;o<t.length;o++)t[o].key===i&&ur(n,t[o].value);return n},has:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Zr(arguments.length,1);for(var i=Ge(this),n=i.entries,o=!1,a=ve(e),c=ve(t),p=0,g;p<n.length;p++)g=n[p],g.key===a&&(o?jf(n,p--,1):(o=!0,g.value=c));o||ur(n,{key:a,value:c}),i.updateURL()},sort:function(){var e=Ge(this);Qx(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ge(this).entries,i=zx(e,arguments.length>1?arguments[1]:void 0),n=0,o;n<t.length;)o=t[n++],i(o.value,o.key,this)},keys:function(){return new Mu(this,"keys")},values:function(){return new Mu(this,"values")},entries:function(){return new Mu(this,"entries")}},{enumerable:!0});Xf(Zn,Yx,Zn.entries,{name:"entries"});Xf(Zn,"toString",function(){return Ge(this).serialize()},{enumerable:!0});Wx(Wa,Qn);Du({global:!0,constructor:!0,forced:!Kf},{URLSearchParams:Wa});!Kf&&Ou(Xn)&&(Jf=Ye(Hf.has),$f=Ye(Hf.set),Uu=function(r){if(Qf(r)){var e=r.body,t;if(Jx(e)===Qn)return t=r.headers?new Xn(r.headers):new Xn,Jf(t,"content-type")||$f(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Kx(r,{body:Nf(0,ve(e)),headers:Nf(0,t)})}return r},Ou(_f)&&Du({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return _f(e,arguments.length>1?Uu(arguments[1]):{})}}),Ou(ja)&&(qa=function(e){return Zf(this,Bu),new ja(e,arguments.length>1?Uu(arguments[1]):{})},Bu.constructor=qa,qa.prototype=Bu,Du({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:qa})));var Jf,$f,Uu,qa;iv.exports={URLSearchParams:Wa,getState:Ge}});var Pv=h(()=>{"use strict";Rh();var gF=Wn(),ic=fe(),hF=fu(),nc=he(),nv=La(),Ee=Z(),$a=dr(),xe=_h(),fF=vu(),ec=we(),sc=Gh(),Yr=mf(),Ve=Pu(),vF=kl().codeAt,yF=Cf(),ct=_n(),bF=Vn(),kF=Fu(),fv=qu(),vv=zr(),SF=vv.set,Ka=vv.getterFor("URL"),PF=fv.URLSearchParams,CF=fv.getState,Yn=nc.URL,tc=nc.TypeError,Xa=nc.parseInt,wF=Math.floor,sv=Math.pow,Ae=Ee("".charAt),ze=Ee(/./.exec),ts=Ee([].join),IF=Ee(1 .toString),xF=Ee([].pop),ti=Ee([].push),ov=Ee("".replace),FF=Ee([].shift),TF=Ee("".split),is=Ee("".slice),Za=Ee("".toLowerCase),AF=Ee([].unshift),EF="Invalid authority",ju="Invalid scheme",cr="Invalid host",av="Invalid port",yv=/[a-z]/i,RF=/[\d+-.a-z]/i,rc=/\d/,OF=/^0x/i,BF=/^[0-7]+$/,MF=/^\d+$/,bv=/^[\da-f]+$/i,UF=/[\0\t\n\r #%/:<>?@[\\\]^|]/,DF=/[\0\t\n\r #/:<>?@[\\\]^|]/,LF=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,NF=/[\t\n\r]/g,Fe,_F=function(r){var e=TF(r,"."),t,i,n,o,a,c,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],n=0;n<t;n++){if(o=e[n],o=="")return r;if(a=10,o.length>1&&Ae(o,0)=="0"&&(a=ze(OF,o)?16:8,o=is(o,a==8?1:2)),o==="")c=0;else{if(!ze(a==10?MF:a==8?BF:bv,o))return r;c=Xa(o,a)}ti(i,c)}for(n=0;n<t;n++)if(c=i[n],n==t-1){if(c>=sv(256,5-t))return null}else if(c>255)return null;for(p=xF(i),n=0;n<i.length;n++)p+=i[n]*sv(256,3-n);return p},HF=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,c,p,g,f,m,b=function(){return Ae(r,n)};if(b()==":"){if(Ae(r,1)!=":")return;n+=2,t++,i=t}for(;b();){if(t==8)return;if(b()==":"){if(i!==null)return;n++,t++,i=t;continue}for(o=a=0;a<4&&ze(bv,b());)o=o*16+Xa(b(),16),n++,a++;if(b()=="."){if(a==0||(n-=a,t>6))return;for(c=0;b();){if(p=null,c>0)if(b()=="."&&c<4)n++;else return;if(!ze(rc,b()))return;for(;ze(rc,b());){if(g=Xa(b(),10),p===null)p=g;else{if(p==0)return;p=p*10+g}if(p>255)return;n++}e[t]=e[t]*256+p,c++,(c==2||c==4)&&t++}if(c!=4)return;break}else if(b()==":"){if(n++,!b())return}else if(b())return;e[t++]=o}if(i!==null)for(f=t-i,t=7;t!=0&&f>0;)m=e[t],e[t--]=e[i+f-1],e[i+--f]=m;else if(t!=8)return;return e},qF=function(r){for(var e=null,t=1,i=null,n=0,o=0;o<8;o++)r[o]!==0?(n>t&&(e=i,t=n),i=null,n=0):(i===null&&(i=o),++n);return n>t&&(e=i,t=n),e},es=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)AF(e,r%256),r=wF(r/256);return ts(e,".")}else if(typeof r=="object"){for(e="",i=qF(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=IF(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},Ja={},kv=sc({},Ja,{" ":1,'"':1,"<":1,">":1,"`":1}),Sv=sc({},kv,{"#":1,"?":1,"{":1,"}":1}),Wu=sc({},Sv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),xt=function(r,e){var t=vF(r,0);return t>32&&t<127&&!ec(e,r)?r:encodeURIComponent(r)},Ga={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rs=function(r,e){var t;return r.length==2&&ze(yv,Ae(r,0))&&((t=Ae(r,1))==":"||!e&&t=="|")},dv=function(r){var e;return r.length>1&&rs(is(r,0,2))&&(r.length==2||(e=Ae(r,2))==="/"||e==="\\"||e==="?"||e==="#")},jF=function(r){return r==="."||Za(r)==="%2e"},WF=function(r){return r=Za(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Gu={},lv={},Vu={},uv={},cv={},zu={},mv={},pv={},Va={},za={},Ju={},$u={},Ku={},Xu={},gv={},Zu={},ei={},et={},hv={},mr={},ut={},oc=function(r,e,t){var i=ct(r),n,o,a;if(e){if(o=this.parse(i),o)throw tc(o);this.searchParams=null}else{if(t!==void 0&&(n=new oc(t,!0)),o=this.parse(i,null,n),o)throw tc(o);a=CF(new PF),a.bindURL(this),this.searchParams=a}};oc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Gu,o=0,a="",c=!1,p=!1,g=!1,f,m,b,v;for(r=ct(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=ov(r,LF,"")),r=ov(r,NF,""),f=Yr(r);o<=f.length;){switch(m=f[o],n){case Gu:if(m&&ze(yv,m))a+=Za(m),n=lv;else{if(e)return ju;n=Vu;continue}break;case lv:if(m&&(ze(RF,m)||m=="+"||m=="-"||m=="."))a+=Za(m);else if(m==":"){if(e&&(i.isSpecial()!=ec(Ga,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&Ga[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=Xu:i.isSpecial()&&t&&t.scheme==i.scheme?n=uv:i.isSpecial()?n=pv:f[o+1]=="/"?(n=cv,o++):(i.cannotBeABaseURL=!0,ti(i.path,""),n=hv)}else{if(e)return ju;a="",n=Vu,o=0;continue}break;case Vu:if(!t||t.cannotBeABaseURL&&m!="#")return ju;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=Ve(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=ut;break}n=t.scheme=="file"?Xu:zu;continue;case uv:if(m=="/"&&f[o+1]=="/")n=Va,o++;else{n=zu;continue}break;case cv:if(m=="/"){n=za;break}else{n=et;continue}case zu:if(i.scheme=t.scheme,m==Fe)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())n=mv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query="",n=mr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=ut;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.path.length--,n=et;continue}break;case mv:if(i.isSpecial()&&(m=="/"||m=="\\"))n=Va;else if(m=="/")n=za;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=et;continue}break;case pv:if(n=Va,m!="/"||Ae(a,o+1)!="/")continue;o++;break;case Va:if(m!="/"&&m!="\\"){n=za;continue}break;case za:if(m=="@"){c&&(a="%40"+a),c=!0,b=Yr(a);for(var P=0;P<b.length;P++){var C=b[P];if(C==":"&&!g){g=!0;continue}var F=xt(C,Wu);g?i.password+=F:i.username+=F}a=""}else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return EF;o-=Yr(a).length+1,a="",n=Ju}else a+=m;break;case Ju:case $u:if(e&&i.scheme=="file"){n=Zu;continue}else if(m==":"&&!p){if(a=="")return cr;if(v=i.parseHost(a),v)return v;if(a="",n=Ku,e==$u)return}else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return cr;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(v=i.parseHost(a),v)return v;if(a="",n=ei,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case Ku:if(ze(rc,m))a+=m;else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var x=Xa(a,10);if(x>65535)return av;i.port=i.isSpecial()&&x===Ga[i.scheme]?null:x,a=""}if(e)return;n=ei;continue}else return av;break;case Xu:if(i.scheme="file",m=="/"||m=="\\")n=gv;else if(t&&t.scheme=="file")if(m==Fe)i.host=t.host,i.path=Ve(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=Ve(t.path),i.query="",n=mr;else if(m=="#")i.host=t.host,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=ut;else{dv(ts(Ve(f,o),""))||(i.host=t.host,i.path=Ve(t.path),i.shortenPath()),n=et;continue}else{n=et;continue}break;case gv:if(m=="/"||m=="\\"){n=Zu;break}t&&t.scheme=="file"&&!dv(ts(Ve(f,o),""))&&(rs(t.path[0],!0)?ti(i.path,t.path[0]):i.host=t.host),n=et;continue;case Zu:if(m==Fe||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&rs(a))n=et;else if(a==""){if(i.host="",e)return;n=ei}else{if(v=i.parseHost(a),v)return v;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=ei}continue}else a+=m;break;case ei:if(i.isSpecial()){if(n=et,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",n=mr;else if(!e&&m=="#")i.fragment="",n=ut;else if(m!=Fe&&(n=et,m!="/"))continue;break;case et:if(m==Fe||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(WF(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&ti(i.path,"")):jF(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&ti(i.path,""):(i.scheme=="file"&&!i.path.length&&rs(a)&&(i.host&&(i.host=""),a=Ae(a,0)+":"),ti(i.path,a)),a="",i.scheme=="file"&&(m==Fe||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)FF(i.path);m=="?"?(i.query="",n=mr):m=="#"&&(i.fragment="",n=ut)}else a+=xt(m,Sv);break;case hv:m=="?"?(i.query="",n=mr):m=="#"?(i.fragment="",n=ut):m!=Fe&&(i.path[0]+=xt(m,Ja));break;case mr:!e&&m=="#"?(i.fragment="",n=ut):m!=Fe&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=xt(m,Ja));break;case ut:m!=Fe&&(i.fragment+=xt(m,kv));break}o++}},parseHost:function(r){var e,t,i;if(Ae(r,0)=="["){if(Ae(r,r.length-1)!="]"||(e=HF(is(r,1,-1)),!e))return cr;this.host=e}else if(this.isSpecial()){if(r=yF(r),ze(UF,r)||(e=_F(r),e===null))return cr;this.host=e}else{if(ze(DF,r))return cr;for(e="",t=Yr(r),i=0;i<t.length;i++)e+=xt(t[i],Ja);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return ec(Ga,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!rs(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,n=r.host,o=r.port,a=r.path,c=r.query,p=r.fragment,g=e+":";return n!==null?(g+="//",r.includesCredentials()&&(g+=t+(i?":"+i:"")+"@"),g+=es(n),o!==null&&(g+=":"+o)):e=="file"&&(g+="//"),g+=r.cannotBeABaseURL?a[0]:a.length?"/"+ts(a,"/"):"",c!==null&&(g+="?"+c),p!==null&&(g+="#"+p),g},setHref:function(r){var e=this.parse(r);if(e)throw tc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new ri(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+es(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(ct(r)+":",Gu)},getUsername:function(){return this.username},setUsername:function(r){var e=Yr(ct(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=xt(e[t],Wu)}},getPassword:function(){return this.password},setPassword:function(r){var e=Yr(ct(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=xt(e[t],Wu)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?es(r):es(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Ju)},getHostname:function(){var r=this.host;return r===null?"":es(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,$u)},getPort:function(){var r=this.port;return r===null?"":ct(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=ct(r),r==""?this.port=null:this.parse(r,Ku))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+ts(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,ei))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=ct(r),r==""?this.query=null:(Ae(r,0)=="?"&&(r=is(r,1)),this.query="",this.parse(r,mr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=ct(r),r==""){this.fragment=null;return}Ae(r,0)=="#"&&(r=is(r,1)),this.fragment="",this.parse(r,ut)},update:function(){this.query=this.searchParams.serialize()||null}};var ri=function(e){var t=fF(this,ne),i=kF(arguments.length,1)>1?arguments[1]:void 0,n=SF(t,new oc(e,!1,i));ic||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ne=ri.prototype,Te=function(r,e){return{get:function(){return Ka(this)[r]()},set:e&&function(t){return Ka(this)[e](t)},configurable:!0,enumerable:!0}};ic&&(xe(ne,"href",Te("serialize","setHref")),xe(ne,"origin",Te("getOrigin")),xe(ne,"protocol",Te("getProtocol","setProtocol")),xe(ne,"username",Te("getUsername","setUsername")),xe(ne,"password",Te("getPassword","setPassword")),xe(ne,"host",Te("getHost","setHost")),xe(ne,"hostname",Te("getHostname","setHostname")),xe(ne,"port",Te("getPort","setPort")),xe(ne,"pathname",Te("getPathname","setPathname")),xe(ne,"search",Te("getSearch","setSearch")),xe(ne,"searchParams",Te("getSearchParams")),xe(ne,"hash",Te("getHash","setHash")));$a(ne,"toJSON",function(){return Ka(this).serialize()},{enumerable:!0});$a(ne,"toString",function(){return Ka(this).serialize()},{enumerable:!0});Yn&&(Qu=Yn.createObjectURL,Yu=Yn.revokeObjectURL,Qu&&$a(ri,"createObjectURL",nv(Qu,Yn)),Yu&&$a(ri,"revokeObjectURL",nv(Yu,Yn)));var Qu,Yu;bF(ri,"URL");gF({global:!0,constructor:!0,forced:!hF,sham:!ic},{URL:ri})});var Cv=h(()=>{Pv()});var wv=h(()=>{"use strict";var GF=Wn(),VF=je();GF({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return VF(URL.prototype.toString,this)}})});var Iv=h(()=>{qu()});var Fv=h((vM,xv)=>{var zF=he();xv.exports=zF});var Av=h((yM,Tv)=>{Cv();wv();Iv();var JF=Fv();Tv.exports=JF.URL});var Bc=h((VL,Ny)=>{var aA=Object.prototype.toString;Ny.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return mA(e)?"generatorfunction":"function";if(dA(e))return"array";if(hA(e))return"buffer";if(gA(e))return"arguments";if(uA(e))return"date";if(lA(e))return"error";if(cA(e))return"regexp";switch(Ly(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(pA(e))return"generator";switch(t=aA.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Ly(r){return typeof r.constructor=="function"?r.constructor.name:null}function dA(r){return Array.isArray?Array.isArray(r):r instanceof Array}function lA(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function uA(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function cA(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function mA(r,e){return Ly(r)==="GeneratorFunction"}function pA(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function gA(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function hA(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var qy=h((zL,Hy)=>{"use strict";var _y=Symbol.prototype.valueOf,fA=Bc();function vA(r,e){switch(fA(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return SA(r);case"symbol":return PA(r);case"arraybuffer":return bA(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return kA(r);case"regexp":return yA(r);case"error":return Object.create(r);default:return r}}function yA(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function bA(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function kA(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function SA(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function PA(r){return _y?Object(_y.call(r)):{}}Hy.exports=vA});var Wy=h((JL,jy)=>{"use strict";jy.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var zy=h(($L,Vy)=>{"use strict";var CA=Wy();function Gy(r){return CA(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}Vy.exports=function(e){var t,i;return!(Gy(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,Gy(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var $y=h((KL,Jy)=>{"use strict";var wA=qy(),IA=Bc(),xA=zy();function Mc(r,e){switch(IA(r)){case"object":return FA(r,e);case"array":return TA(r,e);default:return wA(r)}}function FA(r,e){if(typeof e=="function")return e(r);if(e||xA(r)){let t=new r.constructor;for(let i in r)t[i]=Mc(r[i],e);return t}return r}function TA(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=Mc(r[i],e);return t}Jy.exports=Mc});var zc=h((vs,xi)=>{var AA=200,Vc="__lodash_hash_undefined__",Cd=1,ob=2,ab=9007199254740991,fd="[object Arguments]",Nc="[object Array]",EA="[object AsyncFunction]",db="[object Boolean]",lb="[object Date]",ub="[object Error]",cb="[object Function]",RA="[object GeneratorFunction]",vd="[object Map]",mb="[object Number]",OA="[object Null]",Ii="[object Object]",Ky="[object Promise]",BA="[object Proxy]",pb="[object RegExp]",yd="[object Set]",gb="[object String]",MA="[object Symbol]",UA="[object Undefined]",_c="[object WeakMap]",hb="[object ArrayBuffer]",bd="[object DataView]",DA="[object Float32Array]",LA="[object Float64Array]",NA="[object Int8Array]",_A="[object Int16Array]",HA="[object Int32Array]",qA="[object Uint8Array]",jA="[object Uint8ClampedArray]",WA="[object Uint16Array]",GA="[object Uint32Array]",VA=/[\\^$.*+?()[\]{}|]/g,zA=/^\[object .+?Constructor\]$/,JA=/^(?:0|[1-9]\d*)$/,W={};W[DA]=W[LA]=W[NA]=W[_A]=W[HA]=W[qA]=W[jA]=W[WA]=W[GA]=!0;W[fd]=W[Nc]=W[hb]=W[db]=W[bd]=W[lb]=W[ub]=W[cb]=W[vd]=W[mb]=W[Ii]=W[pb]=W[yd]=W[gb]=W[_c]=!1;var fb=typeof global=="object"&&global&&global.Object===Object&&global,$A=typeof self=="object"&&self&&self.Object===Object&&self,ht=fb||$A||Function("return this")(),vb=typeof vs=="object"&&vs&&!vs.nodeType&&vs,Xy=vb&&typeof xi=="object"&&xi&&!xi.nodeType&&xi,yb=Xy&&Xy.exports===vb,Uc=yb&&fb.process,Zy=function(){try{return Uc&&Uc.binding&&Uc.binding("util")}catch{}}(),Qy=Zy&&Zy.isTypedArray;function KA(r,e){for(var t=-1,i=r==null?0:r.length,n=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[n++]=a)}return o}function XA(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function ZA(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function QA(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function YA(r){return function(e){return r(e)}}function eE(r,e){return r.has(e)}function tE(r,e){return r?.[e]}function rE(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function iE(r,e){return function(t){return r(e(t))}}function nE(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var sE=Array.prototype,oE=Function.prototype,wd=Object.prototype,Dc=ht["__core-js_shared__"],bb=oE.toString,rt=wd.hasOwnProperty,Yy=function(){var r=/[^.]+$/.exec(Dc&&Dc.keys&&Dc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),kb=wd.toString,aE=RegExp("^"+bb.call(rt).replace(VA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eb=yb?ht.Buffer:void 0,kd=ht.Symbol,tb=ht.Uint8Array,Sb=wd.propertyIsEnumerable,dE=sE.splice,br=kd?kd.toStringTag:void 0,rb=Object.getOwnPropertySymbols,lE=eb?eb.isBuffer:void 0,uE=iE(Object.keys,Object),Hc=Fi(ht,"DataView"),ys=Fi(ht,"Map"),qc=Fi(ht,"Promise"),jc=Fi(ht,"Set"),Wc=Fi(ht,"WeakMap"),bs=Fi(Object,"create"),cE=Pr(Hc),mE=Pr(ys),pE=Pr(qc),gE=Pr(jc),hE=Pr(Wc),ib=kd?kd.prototype:void 0,Lc=ib?ib.valueOf:void 0;function kr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function fE(){this.__data__=bs?bs(null):{},this.size=0}function vE(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function yE(r){var e=this.__data__;if(bs){var t=e[r];return t===Vc?void 0:t}return rt.call(e,r)?e[r]:void 0}function bE(r){var e=this.__data__;return bs?e[r]!==void 0:rt.call(e,r)}function kE(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=bs&&e===void 0?Vc:e,this}kr.prototype.clear=fE;kr.prototype.delete=vE;kr.prototype.get=yE;kr.prototype.has=bE;kr.prototype.set=kE;function ft(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function SE(){this.__data__=[],this.size=0}function PE(r){var e=this.__data__,t=Id(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():dE.call(e,t,1),--this.size,!0}function CE(r){var e=this.__data__,t=Id(e,r);return t<0?void 0:e[t][1]}function wE(r){return Id(this.__data__,r)>-1}function IE(r,e){var t=this.__data__,i=Id(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ft.prototype.clear=SE;ft.prototype.delete=PE;ft.prototype.get=CE;ft.prototype.has=wE;ft.prototype.set=IE;function Sr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function xE(){this.size=0,this.__data__={hash:new kr,map:new(ys||ft),string:new kr}}function FE(r){var e=xd(this,r).delete(r);return this.size-=e?1:0,e}function TE(r){return xd(this,r).get(r)}function AE(r){return xd(this,r).has(r)}function EE(r,e){var t=xd(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}Sr.prototype.clear=xE;Sr.prototype.delete=FE;Sr.prototype.get=TE;Sr.prototype.has=AE;Sr.prototype.set=EE;function Sd(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Sr;++e<t;)this.add(r[e])}function RE(r){return this.__data__.set(r,Vc),this}function OE(r){return this.__data__.has(r)}Sd.prototype.add=Sd.prototype.push=RE;Sd.prototype.has=OE;function Lt(r){var e=this.__data__=new ft(r);this.size=e.size}function BE(){this.__data__=new ft,this.size=0}function ME(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function UE(r){return this.__data__.get(r)}function DE(r){return this.__data__.has(r)}function LE(r,e){var t=this.__data__;if(t instanceof ft){var i=t.__data__;if(!ys||i.length<AA-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new Sr(i)}return t.set(r,e),this.size=t.size,this}Lt.prototype.clear=BE;Lt.prototype.delete=ME;Lt.prototype.get=UE;Lt.prototype.has=DE;Lt.prototype.set=LE;function NE(r,e){var t=Pd(r),i=!t&&YE(r),n=!t&&!i&&Gc(r),o=!t&&!i&&!n&&Tb(r),a=t||i||n||o,c=a?QA(r.length,String):[],p=c.length;for(var g in r)(e||rt.call(r,g))&&!(a&&(g=="length"||n&&(g=="offset"||g=="parent")||o&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||$E(g,p)))&&c.push(g);return c}function Id(r,e){for(var t=r.length;t--;)if(wb(r[t][0],e))return t;return-1}function _E(r,e,t){var i=e(r);return Pd(r)?i:XA(i,t(r))}function Ss(r){return r==null?r===void 0?UA:OA:br&&br in Object(r)?zE(r):QE(r)}function nb(r){return ks(r)&&Ss(r)==fd}function Pb(r,e,t,i,n){return r===e?!0:r==null||e==null||!ks(r)&&!ks(e)?r!==r&&e!==e:HE(r,e,t,i,Pb,n)}function HE(r,e,t,i,n,o){var a=Pd(r),c=Pd(e),p=a?Nc:Dt(r),g=c?Nc:Dt(e);p=p==fd?Ii:p,g=g==fd?Ii:g;var f=p==Ii,m=g==Ii,b=p==g;if(b&&Gc(r)){if(!Gc(e))return!1;a=!0,f=!1}if(b&&!f)return o||(o=new Lt),a||Tb(r)?Cb(r,e,t,i,n,o):GE(r,e,p,t,i,n,o);if(!(t&Cd)){var v=f&&rt.call(r,"__wrapped__"),P=m&&rt.call(e,"__wrapped__");if(v||P){var C=v?r.value():r,F=P?e.value():e;return o||(o=new Lt),n(C,F,t,i,o)}}return b?(o||(o=new Lt),VE(r,e,t,i,n,o)):!1}function qE(r){if(!Fb(r)||XE(r))return!1;var e=Ib(r)?aE:zA;return e.test(Pr(r))}function jE(r){return ks(r)&&xb(r.length)&&!!W[Ss(r)]}function WE(r){if(!ZE(r))return uE(r);var e=[];for(var t in Object(r))rt.call(r,t)&&t!="constructor"&&e.push(t);return e}function Cb(r,e,t,i,n,o){var a=t&Cd,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var g=o.get(r);if(g&&o.get(e))return g==e;var f=-1,m=!0,b=t&ob?new Sd:void 0;for(o.set(r,e),o.set(e,r);++f<c;){var v=r[f],P=e[f];if(i)var C=a?i(P,v,f,e,r,o):i(v,P,f,r,e,o);if(C!==void 0){if(C)continue;m=!1;break}if(b){if(!ZA(e,function(F,x){if(!eE(b,x)&&(v===F||n(v,F,t,i,o)))return b.push(x)})){m=!1;break}}else if(!(v===P||n(v,P,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function GE(r,e,t,i,n,o,a){switch(t){case bd:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case hb:return!(r.byteLength!=e.byteLength||!o(new tb(r),new tb(e)));case db:case lb:case mb:return wb(+r,+e);case ub:return r.name==e.name&&r.message==e.message;case pb:case gb:return r==e+"";case vd:var c=rE;case yd:var p=i&Cd;if(c||(c=nE),r.size!=e.size&&!p)return!1;var g=a.get(r);if(g)return g==e;i|=ob,a.set(r,e);var f=Cb(c(r),c(e),i,n,o,a);return a.delete(r),f;case MA:if(Lc)return Lc.call(r)==Lc.call(e)}return!1}function VE(r,e,t,i,n,o){var a=t&Cd,c=sb(r),p=c.length,g=sb(e),f=g.length;if(p!=f&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:rt.call(e,b)))return!1}var v=o.get(r);if(v&&o.get(e))return v==e;var P=!0;o.set(r,e),o.set(e,r);for(var C=a;++m<p;){b=c[m];var F=r[b],x=e[b];if(i)var ge=a?i(x,F,b,e,r,o):i(F,x,b,r,e,o);if(!(ge===void 0?F===x||n(F,x,t,i,o):ge)){P=!1;break}C||(C=b=="constructor")}if(P&&!C){var Un=r.constructor,da=e.constructor;Un!=da&&"constructor"in r&&"constructor"in e&&!(typeof Un=="function"&&Un instanceof Un&&typeof da=="function"&&da instanceof da)&&(P=!1)}return o.delete(r),o.delete(e),P}function sb(r){return _E(r,rR,JE)}function xd(r,e){var t=r.__data__;return KE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Fi(r,e){var t=tE(r,e);return qE(t)?t:void 0}function zE(r){var e=rt.call(r,br),t=r[br];try{r[br]=void 0;var i=!0}catch{}var n=kb.call(r);return i&&(e?r[br]=t:delete r[br]),n}var JE=rb?function(r){return r==null?[]:(r=Object(r),KA(rb(r),function(e){return Sb.call(r,e)}))}:iR,Dt=Ss;(Hc&&Dt(new Hc(new ArrayBuffer(1)))!=bd||ys&&Dt(new ys)!=vd||qc&&Dt(qc.resolve())!=Ky||jc&&Dt(new jc)!=yd||Wc&&Dt(new Wc)!=_c)&&(Dt=function(r){var e=Ss(r),t=e==Ii?r.constructor:void 0,i=t?Pr(t):"";if(i)switch(i){case cE:return bd;case mE:return vd;case pE:return Ky;case gE:return yd;case hE:return _c}return e});function $E(r,e){return e=e??ab,!!e&&(typeof r=="number"||JA.test(r))&&r>-1&&r%1==0&&r<e}function KE(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function XE(r){return!!Yy&&Yy in r}function ZE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wd;return r===t}function QE(r){return kb.call(r)}function Pr(r){if(r!=null){try{return bb.call(r)}catch{}try{return r+""}catch{}}return""}function wb(r,e){return r===e||r!==r&&e!==e}var YE=nb(function(){return arguments}())?nb:function(r){return ks(r)&&rt.call(r,"callee")&&!Sb.call(r,"callee")},Pd=Array.isArray;function eR(r){return r!=null&&xb(r.length)&&!Ib(r)}var Gc=lE||nR;function tR(r,e){return Pb(r,e)}function Ib(r){if(!Fb(r))return!1;var e=Ss(r);return e==cb||e==RA||e==EA||e==BA}function xb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ab}function Fb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ks(r){return r!=null&&typeof r=="object"}var Tb=Qy?YA(Qy):jE;function rR(r){return eR(r)?NE(r):WE(r)}function iR(){return[]}function nR(){return!1}xi.exports=tR});var hS=h(Vd=>{"use strict";Vd.byteLength=OR;Vd.toByteArray=MR;Vd.fromByteArray=LR;var st=[],_e=[],RR=typeof Uint8Array<"u"?Uint8Array:Array,Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Lr=0,pS=Cm.length;Lr<pS;++Lr)st[Lr]=Cm[Lr],_e[Cm.charCodeAt(Lr)]=Lr;var Lr,pS;_e[45]=62;_e[95]=63;function gS(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function OR(r){var e=gS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function BR(r,e,t){return(e+t)*3/4-t}function MR(r){var e,t=gS(r),i=t[0],n=t[1],o=new RR(BR(r,i,n)),a=0,c=n>0?i-4:i,p;for(p=0;p<c;p+=4)e=_e[r.charCodeAt(p)]<<18|_e[r.charCodeAt(p+1)]<<12|_e[r.charCodeAt(p+2)]<<6|_e[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=_e[r.charCodeAt(p)]<<2|_e[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=_e[r.charCodeAt(p)]<<10|_e[r.charCodeAt(p+1)]<<4|_e[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function UR(r){return st[r>>18&63]+st[r>>12&63]+st[r>>6&63]+st[r&63]}function DR(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(UR(i));return n.join("")}function LR(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,c=t-i;a<c;a+=o)n.push(DR(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],n.push(st[e>>2]+st[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(st[e>>10]+st[e>>4&63]+st[e<<2&63]+"=")),n.join("")}});var Sq=Dn(Av(),1);function y(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function pr(r,e){if(!r)throw Error(e)}var se;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(se||(se={}));function Ft(r){return r.startsWith(se.COMMENT)}function Qa(r){return r.startsWith(se.ACCOUNT)}function gr(r){return r.startsWith(se.LINK)}function Ev(r){return r.startsWith(se.MESSAGE)}function Rv(r){return r.startsWith(se.SUBREDDIT)}function Ov(r){return r.startsWith(se.AWARD)}function $F(r){pr(Ft(r),`Expected comment id to start with ${se.COMMENT}, got ${r}}`)}function KF(r){pr(Qa(r),`Expected account id to start with ${se.ACCOUNT}, got ${r}}`)}function XF(r){pr(gr(r),`Expected link id to start with ${se.LINK}, got ${r}}`)}function ZF(r){pr(Ev(r),`Expected message id to start with ${se.MESSAGE}, got ${r}}`)}function QF(r){pr(Rv(r),`Expected subreddit id to start with ${se.SUBREDDIT}, got ${r}}`)}function YF(r){pr(Ov(r),`Expected award id to start with ${se.AWARD}, got ${r}}`)}function ii(r){return $F(r),r}function oe(r){return KF(r),r}function ye(r){return XF(r),r}function eT(r){return ZF(r),r}function ie(r){return QF(r),r}function tT(r){return YF(r),r}function Re(r){if(Ft(r))return ii(r);if(Qa(r))return oe(r);if(gr(r))return ye(r);if(Ev(r))return eT(r);if(Rv(r))return ie(r);if(Ov(r))return tT(r);throw new Error(`Expected thing id to start with ${Object.values(se).join(", ")} got ${r}}`)}function ac(r){return Ft(r)}import*as w from"@devvit/protos";var Ya=class{constructor(e){}};var dc=(t=>(t.Installation="installation",t.App="app",t))(dc||{});function hr(r,e=new Set){for(let t of r){if(t.type==="group"){hr(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}rT(r)}function rT(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var Tt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var TM=["3rd-party","activity","add-emoji","add","add-media","add-to-feed","admin","ads","ai","align-center","align-left","align-right","all","ama","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audience","audio","author","automod","avatar-style","award","back","backup","ban","best","block","blockchain","bold","boost","bot","bounce","brand-awareness","browse","browser","cake","calendar","camera","campaign","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","chat-private","checkbox-dismiss","checkbox","checkmark","chrome","clear","client-list","close","closed-captioning","code-block","code-inline","coins-color-old","coins","collapse-left","collapse-right","collectible-expressions","collection","comment","comments","communities","community","confidence","contest","controversial","conversion","copy-clipboard","crop","crosspost","crowd-control","custom-feed","customize","dashboard","day","delete-column","delete","delete-row","devvit","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","funnel","gif-post","gold","hashtag","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","insert-column-left","insert-column-right","insert-row-above","insert-row-below","internet","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","macro","mark-read","marketplace","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","mute","new","night","no-internet","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","official","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","play","poll-post","popular","posts","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radar","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","recovery-phrase","refresh","removal-reasons","remove","reply","report","reverse","rich-text","right","rising","rotate","rotate-image","rpan","rules","safari","save","save-view","saved","saved-response","search","self","send","settings","severity","share","share-new","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","spreadsheet","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","translation-off","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unstar","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","view-sort","views","volume","wallet","warning","webhook","whale","wiki-ban","wiki","wiki-unban","world","coins-color","powerup-color","powerup-fill-color","share-android","share-ios","video-live-1","video-live-fill-1","video-live","volume-mute","binoculars","caret-updown","planet","telescope"];import{AppSettingsDefinition as vT,GetFieldsResponse as yT}from"@devvit/protos";import{FormFieldType as Oe}from"@devvit/protos";function mt(r){return r.map(e=>{switch(e.type){case"string":return iT(e);case"image":return nT(e);case"paragraph":return sT(e);case"number":return oT(e);case"select":return aT(e);case"boolean":return dT(e);case"group":return lT(e);default:throw new Error("Unknown field type.")}})}function iT(r){return{defaultValue:{fieldType:Oe.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Oe.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret}}function nT(r){return{disabled:r.disabled,fieldId:r.name,fieldType:Oe.IMAGE,helpText:r.helpText,label:r.label,required:r.required}}function sT(r){return{defaultValue:{fieldType:Oe.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Oe.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required}}function oT(r){return{defaultValue:{fieldType:Oe.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Oe.NUMBER,helpText:r.helpText,label:r.label,required:r.required}}function aT(r){return{defaultValue:{fieldType:Oe.SELECTION,selectionValue:{values:r.defaultValue??[]}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Oe.SELECTION,helpText:r.helpText,label:r.label,required:r.required}}function dT(r){return{defaultValue:{fieldType:Oe.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Oe.BOOLEAN,helpText:r.helpText,label:r.label}}function lT(r){return{fieldId:"",fieldType:Oe.GROUP,fieldConfig:{groupConfig:{fields:mt(r.fields)}},label:r.label,helpText:r.helpText}}function M(r,e){u.prototype[r]=e}import{ValidateFormResponse as fT}from"@devvit/protos";import{RealtimeSubscriptionStatus as Mv}from"@devvit/protos";var D=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies"}),Bv;(function(r){r.Blocks="blocks",r.EmitSnapshots="emitSnapshots",r.EmitState="emitState",r.Realtime="realtime",r.Runtime="runtime",r.Surface="surface",r.UseAsync="useAsync",r.Payments="payments",r.Bootstrap="bootstrap",r.WebView="webView"})(Bv||(Bv={}));function Uv(r){function e(t){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[D.App]?.values[0];y(c,"useChannel - app is missing from Context");let p=r.metadata[D.Installation]?.values[0];y(p,"useChannel - installation is missing from Context");async function g(F){let x=o[n].channel;if(o[n].active)if(o[n].connected)await r.realtime.send(x,F);else throw Error(`Failed to send to channel '${x}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${x}`)}function f(){if(!o[n].active){let F=o[n].channel;o[n].active=!0,r.addRealtimeChannel(F)}}function m(){if(o[n].active){let F=o[n].channel;o[n].active=!1,r.removeRealtimeChannel(F)}}function b(F){return async()=>{let x;switch(F.status){case Mv.REALTIME_SUBSCRIBED:o[n].connected=!0,x=t.onSubscribed?.();break;case Mv.REALTIME_UNSUBSCRIBED:o[n].connected=!1,x=t.onUnsubscribed?.();break;default:x=t.onMessage(F.event?.data?.msg);break}await x}}let v={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:Tt.CHANNEL};n in o?v=o[n]:n in a&&(v=a[n]);let P=r.realtimeEvent;r.isInitialRender?v.active=!1:P&&v.active&&P.event.channel===v.channel&&(v.preventCallback||r.runHook(b(P)),r.rerenderIn(0)),o[n]=v,r.currentHookIndex++;let C=0;return v.active&&v.connected?C=2:v.active&&!v.connected?C=1:!v.active&&v.connected?C=3:!v.active&&!v.connected&&(C=4),{subscribe:f,unsubscribe:m,send:g,status:C}}return e}import{FormFieldType as ni}from"@devvit/protos";function lc(r){switch(r.fieldType){case ni.STRING:return r.stringValue;case ni.IMAGE:return r.stringValue;case ni.PARAGRAPH:return r.stringValue;case ni.NUMBER:return r.numberValue;case ni.BOOLEAN:return r.boolValue;case ni.SELECTION:return r.selectionValue?.values??[];default:return}}function At(r){return Object.keys(r).reduce((e,t)=>{let i=lc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function Dv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,g={formKey:p,preventSubmit:!1,type:Tt.FORM};n in a?g=a[n]:n in c&&(g=c[n]),a[n]=g,r.forms.set(p,t);let f=r.formSubmittedEvent;return f&&!g.preventSubmit&&f.formId===p&&r.runHook(async()=>{let m=i(At(f.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function Lv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),g={lastRun:void 0,running:!1,preventCallback:!1,type:Tt.INTERVAL};n in o?g=o[n]:n in a&&(g=a[n]);function f(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,v]of Object.entries(o))if(b!==n.toString()&&v?.type===Tt.INTERVAL&&v?.running)throw new Error("Only one useInterval hook may be running at a time");o[n]={running:!0,lastRun:o[n]?.lastRun??Date.now(),preventCallback:!1,type:Tt.INTERVAL},r.rerenderIn(p)}function m(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&g.running&&(g.preventCallback||(g.lastRun===void 0||g.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,g.lastRun=Date.now()}),r.rerenderIn(p)),g.preventCallback=!1,o[n]=g,r.currentHookIndex++,{start:f,stop:m}}return e}function Nv(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in n)return r.currentHookIndex++,[n[i],a];if(r.isInitialRender||!(i in o)){let c=t instanceof Function?t():t;if(c instanceof Promise)throw(async()=>{n[i]=await c,r.currentHookIndex=0})();n[i]=c}else n[i]=o[i];function a(c){if(r.isRendering)throw new Error("Cannot call setState while rendering.");n[i]=c instanceof Function?c(n[i]):c}return r.currentHookIndex++,[n[i],a]}return e}var pc={now(){return new Date}};function _v(r){return`__autocache__${r}`}function Hv(r){return`__lock__${r}`}var cT=300,mT=1e3,ed=5e3,uc=3,qv=.1,jv=1e3,pT=3e4;function Wv(r){if(r.error)throw new Error(r.error);return r.value}var Et,Rt,Be,si,$,Gv,Vv,zv,cc,Jv,$v,mc,Kv,td=class{constructor(e,t,i=pc){l(this,$);l(this,Et);l(this,Rt,{});l(this,Be);l(this,si);d(this,Et,e),d(this,si,t),d(this,Be,i)}async cache(e,t){d(this,Rt,s(this,si).__cache=s(this,si).__cache??{}),S(this,$,Kv).call(this,t);let i=S(this,$,Gv).call(this,t.key);if(i!==void 0)return i;let n=await S(this,$,mc).call(this,t.key),o=await S(this,$,Vv).call(this,t,n,e);return Wv(o)}};Et=new WeakMap,Rt=new WeakMap,Be=new WeakMap,si=new WeakMap,$=new WeakSet,Gv=function(e){let t=s(this,Rt)[e];if(t){let i=s(this,Be).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<uc&&Math.random()<qv&&t.errorTime+jv<i;if(t?.expires&&t.expires<i&&t.checkedAt+jv<i||n){delete s(this,Rt)[e];return}else return Wv(t)}},Vv=async function(e,t,i){let n=t?.expires,o=n?S(this,$,$v).call(this,n):1;return!t||t?.error&&t.errorCount<uc&&qv>Math.random()||o>Math.random()?S(this,$,zv).call(this,e,t,i):t},zv=async function(e,t,i){let n=Hv(e.key),o=s(this,Be).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,Et).set(n,"1",{expiration:a,nx:!0}))return S(this,$,Jv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Be).now();return S(this,$,cc).call(this,p,e.key,e.ttl)}},cc=async function(e,t,i){let n=Math.min(i,mT),o=await S(this,$,mc).call(this,t);if(o)return o;if(s(this,Be).now().getTime()-e.getTime()>=n)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,cT)),S(this,$,cc).call(this,e,t,i)},Jv=async function(e,t,i,n){let o=s(this,Be).now().getTime()+n;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=s(this,Be).now().getTime(),t.errorCount++}return s(this,Rt)[e]=t,await s(this,Et).set(_v(e),JSON.stringify(t),{expiration:new Date(o+pT)}),t.error&&t.errorCount<uc&&await s(this,Et).del(Hv(e)),t},$v=function(e){let t=s(this,Be).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},mc=async function(e){let t=await s(this,Et).get(_v(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Be).now().getTime(),s(this,Rt)[e]=i,i}},Kv=function(e){e.ttl<ed&&(console.warn(`Cache TTL cannot be less than ${ed} milliseconds! Updating ttl value of ${e.ttl} to ${ed}.`),e.ttl=ed)};function Xv(r,e,t=pc){let i=new td(r,e,t);return i.cache.bind(i)}function Zv(r){new URL(r.slice(0,r.indexOf(",")))}var oi,ai,li,Qv,Yv,di=class{constructor(){l(this,li);l(this,oi,{});l(this,ai,{});d(this,oi,u.assets),d(this,ai,u.webViewAssets)}getURL(e,t){return typeof e=="string"?S(this,li,Qv).call(this,e,t??{webView:!1}):S(this,li,Yv).call(this,e,t??{webView:!1})}};oi=new WeakMap,ai=new WeakMap,li=new WeakSet,Qv=function(e,t){let i=t.webView?s(this,ai)[e]:s(this,oi)[e];if(i)return i;try{return Zv(e),encodeURI(e)}catch{return""}},Yv=function(e,t){let i={},n=[],o=t.webView?s(this,ai):s(this,oi);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{Zv(a),i[a]=encodeURI(a)}catch{n.push(a)}else n=e;if(n.length>0)throw new Error(`The following assets were missing from the assets list: ${n.join(", ")}`);return i};var Ot,ui=class{constructor(e){l(this,Ot);d(this,Ot,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},s(this,Ot));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await u.kvStorePlugin.Put({messages:i},s(this,Ot))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},s(this,Ot))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},s(this,Ot));return e}};Ot=new WeakMap;var ns,ci=class{constructor(e){l(this,ns);d(this,ns,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,s(this,ns));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};ns=new WeakMap;var ss,mi=class{constructor(e){l(this,ss);d(this,ss,e)}async add(e){await u.modLogPlugin.Add(e,s(this,ss))}};ss=new WeakMap;var os,pi=class{constructor(e){l(this,os);d(this,os,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:{msg:t}},s(this,os))}};os=new WeakMap;var k,as,ds,gi=class{constructor(e){l(this,k);l(this,as);l(this,ds);d(this,k,e),d(this,as,new id(e))}get modMail(){return s(this,as)}getSubredditById(e){return be.getById(Re(e),s(this,k))}getSubredditInfoById(e){return ty(e,s(this,k))}getSubredditByName(e){return be.getByName(e,s(this,k))}getSubredditInfoByName(e){return ry(e,s(this,k))}addSubredditRemovalReason(e,t){return be.addRemovalReason(e,t.title,t.message,s(this,k))}getSubredditRemovalReasons(e){return be.getRemovalReasons(e,s(this,k))}getCurrentSubreddit(){return be.getFromMetadata(s(this,k))}getPostById(e){return z.getById(Re(e),s(this,k))}submitPost(e){return z.submit(e,s(this,k))}crosspost(e){return z.crosspost(e,s(this,k))}getUserById(e){return I.getById(Re(e),s(this,k))}getUserByUsername(e){return I.getByUsername(e,s(this,k))}async getCurrentUser(){return s(this,ds)??d(this,ds,I.getFromMetadata(D.User,s(this,k))),s(this,ds)}getAppUser(){return I.getFromMetadata(D.AppUser,s(this,k))}getSnoovatarUrl(e){return I.getSnoovatarUrl(e,s(this,k))}getCommentById(e){return re.getById(Re(e),s(this,k))}getComments(e){return re.getComments(e,s(this,k))}getCommentsByUser(e){return re.getCommentsByUser(e,s(this,k))}submitComment(e){return re.submit({...e,id:Re(e.id)},s(this,k))}getControversialPosts(e){return z.getControversialPosts(e,s(this,k))}getTopPosts(e){return z.getTopPosts(e,s(this,k))}getHotPosts(e){return z.getHotPosts(e,s(this,k))}getNewPosts(e){return z.getNewPosts(e,s(this,k))}getRisingPosts(e){return z.getRisingPosts(e,s(this,k))}getPostsByUser(e){return z.getPostsByUser(e,s(this,k))}getCommentsAndPostsByUser(e){return I.getOverview(e,s(this,k))}getModerationLog(e){return rd(e,s(this,k))}getApprovedUsers(e){return I.getSubredditUsersByType({type:"contributors",...e},s(this,k))}approveUser(e,t){return I.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}removeUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}getWikiContributors(e){return I.getSubredditUsersByType({type:"wikicontributors",...e},s(this,k))}addWikiContributor(e,t){return I.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}removeWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}getBannedUsers(e){return I.getSubredditUsersByType({type:"banned",...e},s(this,k))}banUser(e){return I.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration,banContext:e.context},s(this,k))}unbanUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,k))}getBannedWikiContributors(e){return I.getSubredditUsersByType({type:"wikibanned",...e},s(this,k))}banWikiContributor(e){return I.createRelationship({...e,type:"wikibanned"},s(this,k))}unbanWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,k))}getModerators(e){return I.getSubredditUsersByType({type:"moderators",...e},s(this,k))}inviteModerator(e){return I.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.username,permissions:e.permissions??[]},s(this,k))}revokeModeratorInvite(e,t){return I.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,k))}removeModerator(e,t){return I.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,k))}setModeratorPermissions(e,t,i){return I.setModeratorPermissions(e,t,i,s(this,k))}getMutedUsers(e){return I.getSubredditUsersByType({type:"muted",...e},s(this,k))}muteUser(e){return I.createRelationship({...e,type:"muted"},s(this,k))}unmuteUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"muted"},s(this,k))}getModNotes(e){return Me.get(e,s(this,k))}deleteModNote(e){return Me.delete(e,s(this,k))}addModNote(e){let t={...e,redditId:e.redditId?Re(e.redditId):void 0};return Me.add(t,s(this,k))}addRemovalNote(e){return Me.addRemovalNote(e,s(this,k))}async sendPrivateMessage(e){return fr.send(e,s(this,k))}async sendPrivateMessageAsSubreddit(e){return fr.sendAsSubreddit(e,s(this,k))}async approve(e){if(Ft(e))return re.approve(e,s(this,k));if(gr(e))return z.approve(e,s(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(Ft(e))return re.remove(e,t,s(this,k));if(gr(e))return z.remove(e,t,s(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return ue.getPostFlairTemplates(e,s(this,k))}async getUserFlairTemplates(e){return ue.getUserFlairTemplates(e,s(this,k))}async createPostFlairTemplate(e){return ue.createPostFlairTemplate(e,s(this,k))}async createUserFlairTemplate(e){return ue.createUserFlairTemplate(e,s(this,k))}async editFlairTemplate(e){return ue.editFlairTemplate(e,s(this,k))}async deleteFlairTemplate(e,t){return ue.deleteFlairTemplate(e,t,s(this,k))}async setUserFlair(e){return Ue.setUserFlair(e,s(this,k))}async removeUserFlair(e,t){return Ue.removeUserFlair(e,t,s(this,k))}async setPostFlair(e){return Ue.setPostFlair(e,s(this,k))}async removePostFlair(e,t){return Ue.removePostFlair(e,ye(t),s(this,k))}async getWidgets(e){return ae.getWidgets(e,s(this,k))}async deleteWidget(e,t){return ae.delete(e,t,s(this,k))}async addWidget(e){return ae.add(e,s(this,k))}async reorderWidgets(e,t){return ae.reorder(e,t,s(this,k))}async getWikiPage(e,t){return ke.getPage(e,t,s(this,k))}async getWikiPages(e){return ke.getPages(e,s(this,k))}async createWikiPage(e){return ke.createPage(e,s(this,k))}async updateWikiPage(e){return ke.updatePage(e,s(this,k))}getWikiPageRevisions(e){return ke.getPageRevisions(e,s(this,k))}async revertWikiPage(e,t,i){return ke.revertPage(e,t,i,s(this,k))}async getWikiPageSettings(e,t){return ke.getPageSettings(e,t,s(this,k))}async updateWikiPageSettings(e){return ke.updatePageSettings(e,s(this,k))}async addEditorToWikiPage(e,t,i){return ke.addEditor(e,t,i,s(this,k))}async removeEditorFromWikiPage(e,t,i){return ke.removeEditor(e,t,i,s(this,k))}getMessages(e){return fr.getMessages(e,s(this,k))}markAllMessagesAsRead(){return fr.markAllAsRead(s(this,k))}report(e,t){return u.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},s(this,k))}getModQueue(e){return be.aboutLocation({...e,location:"modqueue"},s(this,k))}getReports(e){return be.aboutLocation({...e,location:"reports"},s(this,k))}getSpam(e){return be.aboutLocation({...e,location:"spam"},s(this,k))}getUnmoderated(e){return be.aboutLocation({...e,location:"unmoderated"},s(this,k))}getEdited(e){return be.aboutLocation({...e,location:"edited"},s(this,k))}getVaultByAddress(e){return sy(e,s(this,k))}getVaultByUserId(e){return oy(Re(e),s(this,k))}getSubredditLeaderboard(e){return iy(e,s(this,k))}getSubredditStyles(e){return ny(e,s(this,k))}async subscribeToCurrentSubreddit(){let e=await this.getCurrentSubreddit();await u.redditAPIPlugins.Subreddits.Subscribe({action:"sub",actionSource:"",srName:e.name,sr:"",skipInitialDefaults:!0},s(this,k))}async unsubscribeFromCurrentSubreddit(){let e=await this.getCurrentSubreddit();await u.redditAPIPlugins.Subreddits.Subscribe({action:"unsub",actionSource:"",srName:e.name,sr:"",skipInitialDefaults:!1},s(this,k))}};k=new WeakMap,as=new WeakMap,ds=new WeakMap;import{RedisKeyScope as gc}from"@devvit/protos";function nd(r){return r&&typeof r=="object"&&"message"in r&&r.message!==void 0&&typeof r.message=="string"?r.message.includes("redis: nil"):!1}var R,O,B,hc=class{constructor(e,t,i){l(this,R);l(this,O);l(this,B);d(this,R,e),d(this,O,t),d(this,B,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,O)},s(this,B)),this}async multi(){await s(this,R).Multi(s(this,O),s(this,B))}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),await s(this,R).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:n||0,transactionId:s(this,O)},s(this,B)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,O)},s(this,B)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,O)},s(this,B)),this}async exec(){let e=await s(this,R).Exec(s(this,O),s(this,B)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await s(this,R).Discard(s(this,O),s(this,B))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,O)},s(this,B)),this}async unwatch(){return await s(this,R).Unwatch(s(this,O),s(this,B)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,O)},s(this,B)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,O)},s(this,B)),this}async strlen(e){return this.strLen(e)}async strLen(e){return await s(this,R).Strlen({key:e,transactionId:s(this,O)},s(this,B)),this}async mget(e){return this.mGet(e)}async mGet(e){return await s(this,R).MGet({keys:e,transactionId:s(this,O)},s(this,B)),this}async mset(e){return this.mSet(e)}async mSet(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));return await s(this,R).MSet({kv:t,transactionId:s(this,O)},s(this,B)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,O)},s(this,B)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,O)},s(this,B)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,O)},s(this,B)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,O)},s(this,B)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,O)},member:t},s(this,B)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,O)},member:t},s(this,B)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,O)},s(this,B)),this}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,O)};return await s(this,R).ZScan(o,s(this,B)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,O)},s(this,B)),this}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"&&(o.byScore=!0),await s(this,R).ZRange({key:{key:e,transactionId:s(this,O)},start:t+"",stop:i+"",...o},s(this,B)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,O)},members:t},s(this,B)),this}async zRemRangeByLex(e,t,i){return await s(this,R).ZRemRangeByLex({key:{key:e,transactionId:s(this,O)},min:t,max:i},s(this,B)),this}async zRemRangeByRank(e,t,i){return await s(this,R).ZRemRangeByRank({key:{key:e,transactionId:s(this,O)},start:t,stop:i},s(this,B)),this}async zRemRangeByScore(e,t,i){return await s(this,R).ZRemRangeByScore({key:{key:e,transactionId:s(this,O)},min:t,max:i},s(this,B)),this}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){return await s(this,R).HGetAll({key:e,transactionId:s(this,O)},s(this,B)),this}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){return await s(this,R).HGet({key:e,field:t,transactionId:s(this,O)},s(this,B)),this}async hset(e,t){return this.hSet(e,t)}async hSet(e,t){let i=Object.entries(t).map(([n,o])=>({field:n,value:o}));return await s(this,R).HSet({key:e,fv:i,transactionId:s(this,O)},s(this,B)),this}async hincrby(e,t,i){return this.hIncrBy(e,t,i)}async hIncrBy(e,t,i){return await s(this,R).HIncrBy({key:e,field:t,value:i,transactionId:s(this,O)},s(this,B)),this}async hdel(e,t){return this.hDel(e,t)}async hDel(e,t){return await s(this,R).HDel({key:e,fields:t,transactionId:s(this,O)},s(this,B)),this}async hscan(e,t,i,n){return this.hScan(e,t,i,n)}async hScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,O)};return await s(this,R).HScan(o,s(this,B)),this}async hkeys(e){return this.hKeys(e)}async hKeys(e){return await s(this,R).HKeys({key:e,transactionId:s(this,O)},s(this,B)),this}async hlen(e){return this.hLen(e)}async hLen(e){return await s(this,R).HLen({key:e,transactionId:s(this,O)},s(this,B)),this}};R=new WeakMap,O=new WeakMap,B=new WeakMap;var U,hi,fc=class fc{constructor(e,t=void 0,i=gc.INSTALLATION){l(this,U);l(this,hi);d(this,U,e),d(this,hi,t),this.scope=i,this.global=i===gc.INSTALLATION?new fc(s(this,U),s(this,hi),gc.GLOBAL):this}get storage(){return s(this,hi)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,U));return new hc(this.storage,t,s(this,U))}async get(e){try{let t=await this.storage.Get({key:e,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return t!==null?t.value??void 0:t}catch(t){if(nd(t))return;throw t}}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:n||0,scope:this.scope},s(this,U))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,U))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,U))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,U));return n!==null?n.value:n}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},s(this,U))).value}async strlen(e){return this.strLen(e)}async strLen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,U))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,U))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,U))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,U))).value}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},s(this,U))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,U))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,U))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,U))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,U))).value}async zScore(e,t){try{let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value:i}catch(i){if(nd(i))return;throw i}}async zRank(e,t){try{let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value:i}catch(i){if(nd(i))return;throw i}}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,U));return n!==null?n.value:n}async mget(e){return this.mGet(e)}async mGet(e){let t=await this.storage.MGet({keys:e,scope:this.scope},s(this,U));return t!==null?t.values.map(i=>i||null):t}async mset(e){return this.mSet(e)}async mSet(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));await this.storage.MSet({kv:t,scope:this.scope},s(this,U))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,U));return t!==null?t.value:t}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.ZScan(o,s(this,U))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,U));return t!==null?t.value:t}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){try{let i=await this.storage.HGet({key:e,field:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value??void 0:i}catch(i){if(nd(i))return;throw i}}async hset(e,t){return this.hSet(e,t)}async hSet(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},s(this,U))).value}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,U));return t!==null?t.fieldValues:t}async hdel(e,t){return this.hDel(e,t)}async hDel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},s(this,U))).value}async hscan(e,t,i,n){return this.hScan(e,t,i,n)}async hScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.HScan(o,s(this,U))}async hkeys(e){return this.hKeys(e)}async hKeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,U));return t!==null?t.keys:t}async hincrby(e,t,i){return this.hIncrBy(e,t,i)}async hIncrBy(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},s(this,U))).value}async hlen(e){return this.hLen(e)}async hLen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};U=new WeakMap,hi=new WeakMap;var fi=fc;var vr,vi=class{constructor(e){l(this,vr);d(this,vr,e)}async runJob(e){return(await u.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},s(this,vr))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},s(this,vr))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,vr))).actions.map(t=>(y(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};vr=new WeakMap;var ls,yi=class{constructor(e){l(this,ls);d(this,ls,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},s(this,ls));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...ay(t.installationSettings.settings,u.installationSettings),...ay(t.appSettings.settings,u.appSettings)}}};ls=new WeakMap;function ay(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=lc(r[n]),i),{});return e&&dy(t,e),t}function dy(r,e){for(let t of e)t.type==="group"?dy(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as sd,ToastAppearance as ly}from"@devvit/protos";var Bt,bi,us,ad,od=class{constructor(e){l(this,Bt,[]);l(this,bi);l(this,us);l(this,ad,(e,t)=>{s(this,Bt).push({type:sd.EFFECT_WEB_VIEW,webView:{postMessage:{webViewId:e,app:{message:t}}}})});d(this,bi,e),d(this,us,{postMessage:s(this,ad)})}get webView(){return s(this,us)}showForm(e,t){let i=u.formDefinitions.get(e);if(!i&&s(this,bi)){let a=s(this,bi).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let n=i.form instanceof Function?i.form(t??{}):i.form,o={fields:[],id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description};hr(n.fields),o.fields=mt(n.fields),s(this,Bt).push({type:sd.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?ly.SUCCESS:ly.NEUTRAL}:t={text:e},s(this,Bt).push({type:sd.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,Bt).push({type:sd.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,Bt)}};Bt=new WeakMap,bi=new WeakMap,us=new WeakMap,ad=new WeakMap;function De({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new mi(r),o=new ui(r),a=new fi(r),c=Xv(a,i?i.state:{}),p=new gi(r),g=new vi(r),f=new yi(r),m=e?new od(i):void 0,b=new ci(r),v=new di,P=new pi(r),C=t&&i?Nv(i):void 0,F=t&&i?Lv(i):void 0,x=t&&i?Dv(i):void 0,ge=t&&i?Uv(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:g,settings:f,media:b,assets:v,realtime:P,get useForm(){return x??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return C??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return F??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return ge??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!m)throw new Error("ui client is not available");return m}}}var uy={name:"@devvit/public-api",version:"0.11.3-dev",license:"BSD-3-Clause",repository:{type:"git",url:"https://developers.reddit.com/"},type:"module",exports:{".":"./dist/index.js","./package.json":"./package.json","./*":"./dist/*"},main:"./dist/index.js",files:["dist/**"],scripts:{build:"yarn build:icon-types && yarn build:semantic-colors && tsc && cp -af devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin","build:icon-types":"make-icons src/types/icons.ts","build:min":"esbuild --bundle --sourcemap=linked --target=es2020 --format=esm --metafile=dist/meta.min.json --outfile=dist/public-api.min.js --external:@devvit/protos --minify src/index.ts","build:semantic-colors":"node scripts/make-semantic-colors.js","build:types":"api-extractor run && sed -ne '/declare global {/,$ p' src/devvit/Devvit.ts >> dist/public-api.d.ts","build:unmin":"esbuild --bundle --sourcemap=inline --target=es2020 --format=iife --metafile=dist/meta.json --outfile=dist/public-api.iife.js --global-name=devvitPublicAPI src/index.ts",clean:"rm -rf .turbo api-extractor coverage dist src/devvit/internals/semanticColors.ts src/types/icons.ts || :",clobber:"yarn clean && rm -rf node_modules",dev:"tsc -w","dev:build":"chokidar ./src --command 'yarn build' --ignore './src/types/icons.ts' --ignore './src/devvit/internals/semanticColors.ts'",lint:"redlint .","lint:fix":"yarn lint --fix",prepublishOnly:"publish-package-json",test:"yarn test:unit && yarn test:types && yarn test:size","test:size":"filesize","test:types":"tsc --noEmit","test:unit":"vitest run","test:unit-with-coverage":"vitest run --coverage"},types:"./dist/index.d.ts",dependencies:{"@devvit/protos":"0.11.3-dev","@devvit/shared-types":"0.11.3-dev","base64-js":"1.5.1","clone-deep":"4.0.1","core-js":"3.27.2","lodash.isequal":"4.5.0"},devDependencies:{"@ampproject/filesize":"4.3.0","@devvit/repo-tools":"0.11.3-dev","@devvit/tsconfig":"0.11.3-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"18.0.1","@types/clone-deep":"4.0.1","@types/core-js":"2.5.6","@types/lodash.isequal":"4.5.6","@vitest/coverage-c8":"0.32.0","chokidar-cli":"3.0.0",esbuild:"0.23.0",eslint:"9.11.1",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"258 KB"}},source:"./src/index.ts"};function ce(r,e,t){let i=r[D.Subreddit]?.values[0];y(i,"subreddit is missing from Context");let n=r[D.SubredditName]?.values[0],o=r[D.AppUser]?.values[0],a=r[D.App]?.values[0],c=r[D.Version]?.values[0],p=r[D.User]?.values[0],g=hT(r);return{get appAccountId(){return y(o,"appAccountId is missing from Context"),o},subredditId:i,subredditName:n,userId:p,postId:e,commentId:t,appName:a,appVersion:c,debug:g,toJSON(){return{appAccountId:o,appName:a,appVersion:c,subredditId:i,subredditName:n,userId:p,postId:e,commentId:t,debug:g}}}}function hT(r){let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},t={};for(let n in e)t[n.toLowerCase()]=n;let i={};for(let n of(r[D.Debug]?.values??[]).join().split(",")){let[o,a]=n.split("=");o&&(o=o.trim(),a=a?.trim(),o.toLowerCase()in t&&(o=t[o.toLowerCase()]),i[o]??(i[o]=a||"true"))}return r[D.Debug]&&console.info(`[api] @devvit/public-api v${uy.version} ${Object.entries(i).map(([n,o])=>`${n}=${o}`).join(" ")}`),{...i,metadata:r}}function cy(r){return r.flatMap(e=>e.type==="group"?cy(e.fields):e)}async function dd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i={success:!0,errors:{}},n=At(r.fieldValues),o=cy(e);return await Promise.all(o.map(async a=>{let c=a.name;if(c&&a.onValidate){let p=n[c],g=a.onValidate,f=Object.assign(De({metadata:t}),ce(t)),m=await g({value:p,isEditing:r.editing},f);m&&(i.success=!1,i.errors[c]=m)}})),fT.fromJSON(i)}async function bT(){if(!u.appSettings)throw new Error("App settings were not defined.");return yT.fromJSON({fields:{fields:mt(u.appSettings)}})}async function kT(r,e){return dd(r,u.appSettings,e)}function my(r){r.provides(vT),M("GetAppSettingsFields",bT),M("ValidateAppForm",kT)}import{CustomPostDefinition as FT,RenderPostResponse as TT}from"@devvit/protos";import{BlockRenderEventType as Ec,EffectType as Fy}from"@devvit/protos";function ki(r){return r.__effects}function py(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as Ac,BlockAvatarBackground as Cy,BlockAvatarFacing as wy,BlockAvatarSize as Mt,BlockBorderWidth as md,BlockButtonAppearance as Ut,BlockButtonSize as Sc,BlockGap as pd,BlockHorizontalAlignment as Pc,BlockIconSize as gd,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as Cc,BlockSpacerSize as hd,BlockStackDirection as wc,BlockTextOutline as Ic,BlockTextOverflow as xc,BlockTextSize as Pi,BlockTextStyle as Fc,BlockTextWeight as Iy,BlockType as tt,BlockVerticalAlignment as Tc}from"@devvit/protos";var vc={"alienblue-100":"#DCE2FB","alienblue-200":"#B8C5FC","alienblue-25":"#F7F8FD","alienblue-300":"#90A9FD","alienblue-400":"#648EFC","alienblue-50":"#EEF0FB","alienblue-500":"#1870F4","alienblue-600":"#115BCA","alienblue-700":"#0A449B","alienblue-75":"#E6E9FB","alienblue-800":"#0A2F6C","alienblue-900":"#0A1A3F","alienblue-950":"#07102B","berrypurple-100":"#F3DAFB","berrypurple-200":"#EAB3FD","berrypurple-25":"#FBF6FD","berrypurple-300":"#DE8BFF","berrypurple-400":"#CF5FFF","berrypurple-50":"#F8EDFC","berrypurple-500":"#BC0EFF","berrypurple-600":"#9B00D4","berrypurple-700":"#7600A3","berrypurple-75":"#F6E4FB","berrypurple-800":"#520472","berrypurple-900":"#300643","berrypurple-950":"#20042A",black:"#000000","black-opacity-0":"#00000000","black-opacity-10":"#00000019","black-opacity-15":"#00000026","black-opacity-20":"#00000033","black-opacity-25":"#0000003F","black-opacity-33":"#00000054","black-opacity-5":"#0000000C","black-opacity-50":"#0000007F","black-opacity-60":"#00000099","black-opacity-67":"#000000AA","black-opacity-80":"#000000CC","black-opacity-90":"#000000E5","brown-100":"#F1DFCF","brown-200":"#E9BE95","brown-25":"#FBF7F4","brown-300":"#DC9D5D","brown-400":"#BA854E","brown-50":"#F7EFE9","brown-500":"#9A6D3F","brown-600":"#7B5631","brown-700":"#5D4023","brown-75":"#F4E7DC","brown-800":"#3F2C19","brown-900":"#221A11","brown-950":"#15100A","coolgray-100":"#DBE4E9","coolgray-150":"#C9D7DE","coolgray-200":"#B7CAD4","coolgray-25":"#F6F8F9","coolgray-250":"#A4BDCA","coolgray-300":"#97AFBC","coolgray-350":"#8BA2AD","coolgray-400":"#7F949F","coolgray-450":"#748791","coolgray-50":"#EEF1F3","coolgray-500":"#667780","coolgray-525":"#576F76","coolgray-550":"#5C6C74","coolgray-600":"#536168","coolgray-650":"#48545B","coolgray-700":"#3D494E","coolgray-75":"#E5EBEE","coolgray-750":"#333D42","coolgray-800":"#2A3236","coolgray-850":"#21272A","coolgray-900":"#181C1F","coolgray-950":"#0E1113","global-black":{light:"#000000",dark:"#000000"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-white":{light:"#FFFFFF",dark:"#FFFFFF"},"kiwigreen-100":"#A8F5A0","kiwigreen-200":"#58E15B","kiwigreen-25":"#EBFDE7","kiwigreen-300":"#00C61C","kiwigreen-400":"#01A816","kiwigreen-50":"#DDF8D7","kiwigreen-500":"#008A10","kiwigreen-600":"#016E0B","kiwigreen-700":"#005306","kiwigreen-75":"#CAF5C2","kiwigreen-800":"#033902","kiwigreen-900":"#0D2005","kiwigreen-950":"#081404","lightblue-100":"#CAE7FB","lightblue-200":"#87D0FD","lightblue-25":"#F3F9FD","lightblue-300":"#02B9FB","lightblue-400":"#029DD5","lightblue-50":"#E6F3FC","lightblue-500":"#007FAE","lightblue-600":"#01668D","lightblue-700":"#014D6B","lightblue-75":"#D9EDFB","lightblue-800":"#03354B","lightblue-900":"#051E2B","lightblue-950":"#04131A","lime-100":"#B7F28E","lime-200":"#90DA58","lime-25":"#EEFDDC","lime-300":"#6DBF01","lime-400":"#5BA200","lime-50":"#E0F8C8","lime-500":"#4A8500","lime-600":"#3A6A00","lime-700":"#2A5000","lime-75":"#CEF5AD","lime-800":"#1E3702","lime-900":"#151E05","lime-950":"#0D1304","mintgreen-100":"#9BF5D9","mintgreen-200":"#00E2B7","mintgreen-25":"#E7FDF5","mintgreen-300":"#00C29D","mintgreen-400":"#01A484","mintgreen-50":"#D7F8EC","mintgreen-500":"#01876D","mintgreen-600":"#006C56","mintgreen-700":"#015140","mintgreen-75":"#C0F5E3","mintgreen-800":"#00382B","mintgreen-900":"#032019","mintgreen-950":"#03140F","orangered-100":"#FCDBCF","orangered-200":"#FDB498","orangered-25":"#FDF6F4","orangered-300":"#FF895D","orangered-400":"#FF4500","orangered-50":"#FCEEE8","orangered-500":"#D93900","orangered-600":"#AE2C00","orangered-700":"#842100","orangered-75":"#FBE5DC","orangered-800":"#591B02","orangered-900":"#2F1405","orangered-950":"#1C0D04","periwinkle-100":"#E6DFFB","periwinkle-200":"#CDBEFD","periwinkle-25":"#F9F7FD","periwinkle-300":"#B29FFF","periwinkle-400":"#9580FF","periwinkle-50":"#F2EFFC","periwinkle-500":"#6A5CFF","periwinkle-600":"#523DFF","periwinkle-700":"#4001EA","periwinkle-75":"#ECE7FB","periwinkle-800":"#250AA6","periwinkle-900":"#160E5B","periwinkle-950":"#0C083F","poopbrown-100":"#FEEEDD","poopbrown-200":"#F6DDC3","poopbrown-300":"#EECCAA","poopbrown-400":"#CAA075","poopbrown-50":"#FEF7EE","poopbrown-500":"#9A6D3F","poopbrown-600":"#6E4924","poopbrown-700":"#54371A","poopbrown-800":"#3B2510","poopbrown-900":"#29190A","poopbrown-950":"#110B04","puregray-100":"#F2F2F2","puregray-150":"#EBEBEB","puregray-200":"#E4E4E4","puregray-250":"#DDDDDD","puregray-300":"#D6D6D6","puregray-350":"#C3C3C3","puregray-400":"#ACACAC","puregray-450":"#919191","puregray-50":"#F8F8F8","puregray-500":"#767676","puregray-550":"#5C5C5C","puregray-600":"#434343","puregray-650":"#393939","puregray-700":"#303030","puregray-750":"#272727","puregray-800":"#1E1E1E","puregray-850":"#181818","puregray-900":"#131313","puregray-950":"#080808","red-100":"#FBDBD4","red-200":"#FDB3A4","red-25":"#FDF6F5","red-300":"#FF8773","red-400":"#FF4F40","red-50":"#FCEEEA","red-500":"#EB001F","red-600":"#BC0117","red-700":"#90000F","red-75":"#FBE4DF","red-800":"#650405","red-900":"#340F05","red-950":"#1F0B04","sakurapink-100":"#FBD9EB","sakurapink-200":"#FDAEDA","sakurapink-25":"#FDF6F9","sakurapink-300":"#FF7ECA","sakurapink-400":"#FF38BB","sakurapink-50":"#FCEDF4","sakurapink-500":"#DE019F","sakurapink-600":"#B2007F","sakurapink-700":"#880060","sakurapink-75":"#FBE3EF","sakurapink-800":"#5F0443","sakurapink-900":"#380626","sakurapink-950":"#250419",transparent:"transparent",white:"#ffffff","white-opacity-0":"#FFFFFF00","white-opacity-10":"#FFFFFF19","white-opacity-15":"#FFFFFF26","white-opacity-20":"#FFFFFF33","white-opacity-25":"#FFFFFF3F","white-opacity-5":"#FFFFFF0C","white-opacity-50":"#FFFFFF7F","yellow-100":"#FFE284","yellow-200":"#FFBF0B","yellow-25":"#FFF9E0","yellow-300":"#D8A100","yellow-400":"#B78800","yellow-50":"#FFF3C0","yellow-500":"#977000","yellow-600":"#785800","yellow-700":"#5B4200","yellow-75":"#FFEAA2","yellow-800":"#3F2D00","yellow-900":"#231A03","yellow-950":"#161003","yelloworange-100":"#FCDCC8","yelloworange-200":"#FDB586","yelloworange-25":"#FDF7F3","yelloworange-300":"#FF8A35","yelloworange-400":"#E46C00","yelloworange-50":"#FCEEE6","yelloworange-500":"#BD5800","yelloworange-600":"#974500","yelloworange-700":"#733300","yelloworange-75":"#FBE5D7","yelloworange-800":"#4E2402","yelloworange-900":"#2A1705","yelloworange-950":"#1A0E04","action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"action-upvote":{light:"#D93900",dark:"#D93900"},"ai-background-weaker":{light:"#E7FDF5",dark:"#00382B"},"ai-plain":{light:"#006C56",dark:"#01A484"},"ai-plain-hover":{light:"#015140",dark:"#00C29D"},"alert-caution":{light:"#977000",dark:"#977000"},"avatar-gradient":{light:"",dark:""},"brand-background":{light:"#D93900",dark:"#D93900"},"brand-background-hover":{light:"#AE2C00",dark:"#AE2C00"},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"category-live":{light:"#D93900",dark:"#D93900"},"category-nsfw":{light:"#DE019F",dark:"#DE019F"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"caution-background":{light:"#FFBF0B",dark:"#D8A100"},"caution-background-hover":{light:"#D8A100",dark:"#FFBF0B"},"caution-onBackground":{light:"#000000",dark:"#000000"},"caution-plain":{light:"#785800",dark:"#FFBF0B"},"caution-plain-hover":{light:"#5B4200",dark:"#FFE284"},"danger-background":{light:"#EB001F",dark:"#BC0117"},"danger-background-disabled":{light:"#FDB3A4",dark:"#340F05"},"danger-background-hover":{light:"#BC0117",dark:"#EB001F"},"danger-background-weaker":{light:"#FBDBD4",dark:"#650405"},"danger-content":{light:"#BC0117",dark:"#FF4F40"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"danger-content-hover":{light:"#90000F",dark:"#FF8773"},"danger-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"danger-plain":{light:"#BC0117",dark:"#FF8773"},"danger-plain-hover":{light:"#90000F",dark:"#FDB3A4"},"downvote-background":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-background-disabled":{light:"#6a5cff4d",dark:"#6a5cff4d"},"downvote-background-hover":{light:"#523DFF",dark:"#523DFF"},"downvote-content":{light:"#523DFF",dark:"#9580FF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#523DFF4c",dark:"#9580FF4c"},"downvote-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"downvote-onStrongScrim":{light:"#B29FFF",dark:"#B29FFF"},"downvote-onStrongScrim-disabled":{light:"#b29fff4d",dark:"#b29fff4d"},"downvote-onStrongScrim-weaker":{light:"#9580FF",dark:"#9580FF"},"downvote-plain":{light:"#523DFF",dark:"#9580FF"},"downvote-plain-disabled":{light:"#523dff4d",dark:"#9580ff4d"},"downvote-plain-weaker":{light:"#6A5CFF",dark:"#6A5CFF"},"elevation-large1":{light:"#0000003F",dark:"#0000007F"},"elevation-large2":{light:"#00000026",dark:"#00000033"},"elevation-medium1":{light:"#0000003F",dark:"#0000007F"},"elevation-medium2":{light:"#00000019",dark:"#00000033"},"elevation-small":{light:"#00000026",dark:"#00000054"},"elevation-xsmall":{light:"#0000003F",dark:"#000000AA"},favorite:{light:"#977000",dark:"#B78800"},"global-admin":{light:"#D93900",dark:"#D93900"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#2A3236",dark:"#2A3236"},"global-focus":{light:"#029DD5",dark:"#007FAE"},"global-gold":{light:"#B78800",dark:"#D8A100"},"global-moderator":{light:"#008A10",dark:"#008A10"},"global-nsfw":{light:"#DE019F",dark:"#DE019F"},"global-offline":{light:"#667780",dark:"#667780"},"global-online":{light:"#00C61C",dark:"#00C61C"},"global-orangered":{light:"#FF4500",dark:"#FF4500"},"global-stars":{light:"#977000",dark:"#D8A100"},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"identity-admin":{light:"#D93900",dark:"#D93900"},"identity-coins":{light:"#B78800",dark:"#B78800"},"identity-moderator":{light:"#008A10",dark:"#008A10"},"identity-self":{light:"#01876D",dark:"#01876D"},"interactive-background-disabled":{light:"#0000000C",dark:"#FFFFFF0C"},"interactive-content-disabled":{light:"#0000003F",dark:"#FFFFFF3F"},"interactive-focused":{light:"#007FAE",dark:"#007FAE"},"interactive-pressed":{light:"#00000026",dark:"#FFFFFF26"},"inverted-interactive-background-disabled":{light:"#FFFFFF0C",dark:"#0000000C"},"inverted-interactive-content-disabled":{light:"#FFFFFF3F",dark:"#0000003F"},"inverted-interactive-pressed":{light:"#FFFFFF26",dark:"#00000026"},"inverted-neutral-background":{light:"#0E1113",dark:"#FFFFFF"},"inverted-neutral-background-hover":{light:"#181C1F",dark:"#F6F8F9"},"inverted-neutral-border":{light:"#FFFFFF33",dark:"#00000033"},"inverted-neutral-content":{light:"#B7CAD4",dark:"#333D42"},"inverted-neutral-content-strong":{light:"#EEF1F3",dark:"#181C1F"},"inverted-secondary-background":{light:"#2A3236",dark:"#E5EBEE"},"inverted-secondary-background-hover":{light:"#333D42",dark:"#DBE4E9"},"inverted-secondary-background-selected":{light:"#3D494E",dark:"#C9D7DE"},"inverted-secondary-onBackground":{light:"#FFFFFF",dark:"#000000"},"inverted-secondary-plain":{light:"#DBE4E9",dark:"#181C1F"},"inverted-secondary-plain-hover":{light:"#FFFFFF",dark:"#000000"},"media-background":{light:"#00000099",dark:"#00000099"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"media-border-selected":{light:"#FFFFFF",dark:"#FFFFFF"},"media-border-weak":{light:"#FFFFFF19",dark:"#FFFFFF19"},"media-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"media-onBackground-disabled":{light:"#FFFFFF3F",dark:"#FFFFFF3F"},"media-onBackground-weak":{light:"#E5EBEE",dark:"#E5EBEE"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-onbackground-weak":{light:"#B7CAD4",dark:"#B7CAD4"},"neutral-background":{light:"#FFFFFF",dark:"#0E1113"},"neutral-background-container":{light:"#F6F8F9",dark:"#181C1F"},"neutral-background-container-hover":{light:"#EEF1F3",dark:"#21272A"},"neutral-background-container-strong":{light:"#EEF1F3",dark:"#21272A"},"neutral-background-container-strong-hover":{light:"#E5EBEE",dark:"#2A3236"},"neutral-background-gilded":{light:"#FFF9E0",dark:"#181C1F"},"neutral-background-gilded-hover":{light:"#FFF3C0",dark:"#21272A"},"neutral-background-hover":{light:"#F6F8F9",dark:"#181C1F"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-pinned":{light:"#FFFFFF",dark:"#0E1113"},"neutral-background-selected":{light:"#E5EBEE",dark:"#2A3236"},"neutral-background-strong":{light:"#FFFFFF",dark:"#181C1F"},"neutral-background-strong-hover":{light:"#F6F8F9",dark:"#21272A"},"neutral-background-weak":{light:"#F6F8F9",dark:"#000000"},"neutral-background-weak-hover":{light:"#EEF1F3",dark:"#0E1113"},"neutral-border":{light:"#00000033",dark:"#FFFFFF33"},"neutral-border-medium":{light:"#0000007F",dark:"#FFFFFF7F"},"neutral-border-strong":{light:"#181C1F",dark:"#F6F8F9"},"neutral-border-weak":{light:"#00000019",dark:"#FFFFFF19"},"neutral-content":{light:"#333D42",dark:"#B7CAD4"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-strong":{light:"#181C1F",dark:"#EEF1F3"},"neutral-content-weak":{light:"#5C6C74",dark:"#8BA2AD"},offline:{light:"#767676",dark:"#767676"},online:{light:"#01A816",dark:"#01A816"},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},"opacity-highlight":{light:"",dark:""},pizzaRed:{light:"#ef5350",dark:"#c62828"},primary:{light:"#115BCA",dark:"#648EFC"},"primary-background":{light:"#0A449B",dark:"#115BCA"},"primary-background-hover":{light:"#0A2F6C",dark:"#1870F4"},"primary-background-selected":{light:"#0A1A3F",dark:"#648EFC"},"primary-border":{light:"#0A449B",dark:"#648EFC"},"primary-border-hover":{light:"#0A2F6C",dark:"#90A9FD"},"primary-hover":{light:"#0A449B",dark:"#90A9FD"},"primary-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"primary-onBackground-selected":{light:"#FFFFFF",dark:"#000000"},"primary-plain":{light:"#0A449B",dark:"#648EFC"},"primary-plain-hover":{light:"#0A2F6C",dark:"#90A9FD"},"primary-plain-visited":{light:"#7600A3",dark:"#CF5FFF"},"primary-visited":{light:"#9B00D4",dark:"#CF5FFF"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-background":{light:"#00000099",dark:"#00000099"},"scrim-background-strong":{light:"#000000CC",dark:"#000000CC"},"scrim-gradient":{light:"",dark:""},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},secondary:{light:"#21272A",dark:"#DBE4E9"},"secondary-background":{light:"#E5EBEE",dark:"#2A3236"},"secondary-background-hover":{light:"#DBE4E9",dark:"#333D42"},"secondary-background-selected":{light:"#C9D7DE",dark:"#3D494E"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-onBackground":{light:"#000000",dark:"#FFFFFF"},"secondary-plain":{light:"#181C1F",dark:"#DBE4E9"},"secondary-plain-hover":{light:"#000000",dark:"#FFFFFF"},"secondary-plain-weak":{light:"#5C6C74",dark:"#8BA2AD"},"secondary-weak":{light:"#576F76",dark:"#748791"},"success-background":{light:"#008A10",dark:"#016E0B"},"success-background-hover":{light:"#016E0B",dark:"#008A10"},"success-content":{light:"#016E0B",dark:"#01A816"},"success-hover":{light:"#005306",dark:"#00C61C"},"success-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"success-plain":{light:"#016E0B",dark:"#00C61C"},"success-plain-hover":{light:"#005306",dark:"#58E15B"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"transparent-background-hover":{light:"#74879119",dark:"#66778019"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#FFFFFF",dark:"#181C1F"},"upvote-background":{light:"#D93900",dark:"#D93900"},"upvote-background-disabled":{light:"#d939004d",dark:"#d939004d"},"upvote-background-hover":{light:"#AE2C00",dark:"#AE2C00"},"upvote-content":{light:"#AE2C00",dark:"#FF4500"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#AE2C004c",dark:"#FF45004c"},"upvote-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"upvote-onStrongScrim":{light:"#FF895D",dark:"#FF895D"},"upvote-onStrongScrim-disabled":{light:"#ff895d4d",dark:"#ff895d4d"},"upvote-onStrongScrim-weaker":{light:"#FF4500",dark:"#FF4500"},"upvote-plain":{light:"#AE2C00",dark:"#FF895D"},"upvote-plain-disabled":{light:"#ae2c004d",dark:"#ff895d4d"},"upvote-plain-weaker":{light:"#FF4500",dark:"#FF4500"},"warning-background":{light:"#B78800",dark:"#B78800"},"warning-background-hover":{light:"#977000",dark:"#D8A100"},"warning-content":{light:"#785800",dark:"#B78800"},"warning-content-hover":{light:"#5B4200",dark:"#D8A100"},"warning-onBackground":{light:"#000000",dark:"#000000"}};var gy={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},hy=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),fy=r=>r in vc,yc=r=>r in gy,vy=r=>!!r.match(/^rgba?\(.*/),yy=r=>!!r.match(/^hsla?\(.*/),by=(r,e="light")=>{if(yc(r))return ld(r);let i=vc[r];return typeof i=="string"?i:i[e]},ld=r=>gy[r]??r,ky=r=>{let[e,t,i,n]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(n){let p=parseFloat(n),g=Math.round(p*255);a.push(g)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as ud}from"@devvit/protos";var bc={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:ud.UNRECOGNIZED,alignment:void 0}};function Py(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:n}=ST(r?.grow,e.direction,e.alignment),o=t?.height?.value?.value||t?.height?.min?.value||Sy(2,i,n,e.hasHeight),a=t?.width?.value?.value||t?.width?.min?.value||Sy(1,i,n,e.hasWidth);return{hasHeight:!!o,hasWidth:!!a}}function Sy(r,e,t,i){return e===r&&i||t===r&&i}function ST(r,e,t){let i=e===ud.STACK_VERTICAL||e===ud.UNRECOGNIZED,n=e===ud.STACK_HORIZONTAL,o=0;n&&r?o=1:i&&r&&(o=2);let a=t===void 0||t.horizontal===void 0,c=t===void 0||t.vertical===void 0,p=n?!!c:i?!!a:!1,g=0;return n&&p?g=2:i&&p&&(g=1),{growDirection:o,stretchDirection:g}}import{BlockSizeUnit as yr,BlockStackDirection as cd}from"@devvit/protos";function Si(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:yr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=yr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=yr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function PT(r,e){return(r.width?.value?.unit===yr.SIZE_UNIT_PERCENT||r.width?.min?.unit===yr.SIZE_UNIT_PERCENT)&&(e.direction===cd.STACK_HORIZONTAL||e.direction===cd.STACK_DEPTH)&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===yr.SIZE_UNIT_PERCENT||r.height?.min?.unit===yr.SIZE_UNIT_PERCENT)&&(e.direction===cd.STACK_VERTICAL||e.direction===cd.STACK_DEPTH)&&(e.hasHeight||(r.height=void 0)),r}function kc(r,e){if(r){let t=r.width!=null||r.minWidth!=null||r.maxWidth!=null,i=r.height!=null||r.minHeight!=null||r.maxHeight!=null;if(t||i||r.grow!=null){let n={width:t?{value:Si(r.width),min:Si(r.minWidth),max:Si(r.maxWidth)}:void 0,height:i?{value:Si(r.height),min:Si(r.minHeight),max:Si(r.maxHeight)}:void 0,grow:r.grow};return e.stackParentLayout&&(n=PT(n,e.stackParentLayout)),n}}}var xy="data-",CT=new Set(["onPress","onMessage"]),wT=new Map([["onPress",Ac.ACTION_CLICK],["onMessage",Ac.ACTION_WEBVIEW]]),gs,Ci=class{constructor(e=()=>{}){l(this,gs);d(this,gs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let n=this.createBlocksElement({type:e,props:t,children:i},bc);if(!n)throw new Error(`Could not create block of type ${e}`);return n}createBlocksElement({type:e,props:t,children:i},n){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,n,...i);case"vstack":return this.makeVStack(t,n,...i);case"zstack":return this.makeZStack(t,n,...i);case"text":return this.makeText(t,n,...i);case"button":return this.makeButton(t,n,...i);case"image":return this.makeImage(t,n);case"spacer":return this.makeSpacer(t,n);case"icon":return this.makeIcon(t,n);case"avatar":return this.makeAvatar(t,n);case"webview":return this.makeWebView(t,n);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ms.PADDING_NONE;case"xsmall":return ms.PADDING_XSMALL;case"small":return ms.PADDING_SMALL;case"medium":return ms.PADDING_MEDIUM;case"large":return ms.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ps.RADIUS_NONE;case"small":return ps.RADIUS_SMALL;case"medium":return ps.RADIUS_MEDIUM;case"large":return ps.RADIUS_LARGE;case"full":return ps.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return pd.GAP_NONE;case"small":return pd.GAP_SMALL;case"medium":return pd.GAP_MEDIUM;case"large":return pd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Tc.ALIGN_TOP:e.includes("middle")?t=Tc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Tc.ALIGN_BOTTOM),e.includes("start")?i=Pc.ALIGN_START:e.includes("center")?i=Pc.ALIGN_CENTER:e.includes("end")&&(i=Pc.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,n){if(!e&&!t)return;let o;switch(e){case"none":o=md.BORDER_WIDTH_NONE;break;case"thin":o=md.BORDER_WIDTH_THIN;break;case"thick":o=md.BORDER_WIDTH_THICK;break;default:o=md.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",c=this.getThemedColors(a,i,n);return{width:o,color:c?.light,colors:c}}makeBlockTextSize(e){switch(e){case"xsmall":return Pi.TEXT_SIZE_XSMALL;case"small":return Pi.TEXT_SIZE_SMALL;case"medium":return Pi.TEXT_SIZE_MEDIUM;case"large":return Pi.TEXT_SIZE_LARGE;case"xlarge":return Pi.TEXT_SIZE_XLARGE;case"xxlarge":return Pi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Fc.TEXT_STYLE_BODY;case"metadata":return Fc.TEXT_STYLE_METADATA;case"heading":return Fc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return Ic.TEXT_OUTLINE_NONE;case"thin":return Ic.TEXT_OUTLINE_THIN;case"thick":return Ic.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Iy.TEXT_WEIGHT_REGULAR;case"bold":return Iy.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return xc.TEXT_OVERFLOW_CLIP;case"ellipsis":return xc.TEXT_OVERFLOW_ELLIPSE}return xc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Ut.BUTTON_APPEARANCE_SECONDARY;case"primary":return Ut.BUTTON_APPEARANCE_PRIMARY;case"plain":return Ut.BUTTON_APPEARANCE_PLAIN;case"bordered":return Ut.BUTTON_APPEARANCE_BORDERED;case"media":return Ut.BUTTON_APPEARANCE_MEDIA;case"destructive":return Ut.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Ut.BUTTON_APPEARANCE_CAUTION;case"success":return Ut.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Sc.BUTTON_SIZE_SMALL;case"medium":return Sc.BUTTON_SIZE_MEDIUM;case"large":return Sc.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return cs.IMAGE_RESIZE_NONE;case"fit":return cs.IMAGE_RESIZE_FIT;case"fill":return cs.IMAGE_RESIZE_FILL;case"cover":return cs.IMAGE_RESIZE_COVER;case"scale-down":return cs.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return hd.SPACER_XSMALL;case"small":return hd.SPACER_SMALL;case"medium":return hd.SPACER_MEDIUM;case"large":return hd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return Cc.SPACER_INVISIBLE;case"thin":return Cc.SPACER_THIN;case"square":return Cc.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return gd.ICON_SIZE_XSMALL;case"small":return gd.ICON_SIZE_SMALL;case"medium":return gd.ICON_SIZE_MEDIUM;case"large":return gd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Mt.AVATAR_SIZE_XXSMALL;case"xsmall":return Mt.AVATAR_SIZE_XSMALL;case"small":return Mt.AVATAR_SIZE_SMALL;case"medium":return Mt.AVATAR_SIZE_MEDIUM;case"large":return Mt.AVATAR_SIZE_LARGE;case"xlarge":return Mt.AVATAR_SIZE_XXLARGE;case"xxlarge":return Mt.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Mt.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return wy.AVATAR_FACING_LEFT;case"right":return wy.AVATAR_FACING_RIGHT}}makeBlockAvatarBackground(e){switch(e){case"dark":return Cy.AVATAR_BG_DARK;case"light":return Cy.AVATAR_BG_LIGHT}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(xy)).reduce((t,i)=>(t[i.substring(xy.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);return CT.forEach(o=>{if(o in t){let a=t[o];i.push({type:wT.get(o)??Ac.UNRECOGNIZED,id:a.toString(),data:n})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),hy(e)?e:fy(e)?by(e,t):yc(e)?ld(e):vy(e)?ky(e):yy(e)?e:(console.warn(`Could not parse color: ${e}.`),ld("red"))}childrenToBlocks(e,t){return e.flatMap(i=>(typeof i!="string"?this.createBlocksElement(i,t):void 0)??[])}getThemedColors(e,t,i){let n=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!n||!o)){let c=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...c.map(p=>p[0]))}return n||(n=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),n||o?{light:n,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}resolveAssetUrl(e,t){return s(this,gs).call(this)?.getURL(e,t)??e}childrenToString(e){return e.map(t=>t.toString()).join("")}makeRoot(e,...t){return this.wrapRoot(e,this.childrenToBlocks(t,bc))}wrapRoot(e,t){return this.makeBlock(tt.BLOCK_ROOT,{},{},{rootConfig:{children:t,height:this.makeRootHeight(u.customPostType?.height??e?.height??"regular")}})}makeStackBlock(e,t,i,n){let o=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor),a=this.makeBlockAlignment(t?.alignment),c=kc(t,i),p=Py(t,i.stackParentLayout,c);return this.makeBlock(tt.BLOCK_STACK,t,i,{stackConfig:{alignment:a,backgroundColor:o?.light,backgroundColors:o,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:this.childrenToBlocks(n,{stackParentLayout:{...p,direction:e,alignment:a}}),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}makeHStack(e,t,...i){return this.makeStackBlock(wc.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(wc.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(wc.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let n=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(tt.BLOCK_TEXT,e,t,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:n?.light,colors:n,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(i),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,t,...i){let n=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(tt.BLOCK_BUTTON,e,t,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(i),textColor:n?.light,textColors:n,disabled:e?.disabled}})}makeImage(e,t){return e&&this.makeBlock(tt.BLOCK_IMAGE,e,t,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:this.resolveAssetUrl(e.url),width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e,t){return this.makeBlock(tt.BLOCK_SPACER,e,t,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e,t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(tt.BLOCK_ICON,e,t,{iconConfig:{icon:e.name,color:i?.light,colors:i,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e,t){return e&&this.makeBlock(tt.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeWebView(e,t){return e&&this.makeBlock(tt.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webView:!0}),state:e.state}})}makeBlock(e,t,i,n){return{type:e,sizes:kc(t,i),config:n,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t;if(e.type===tt.BLOCK_ROOT?(e.config?.rootConfig&&u.customPostType?.height&&(e.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t=e):t=this.wrapRoot(void 0,[e]),!t)throw new Error("Could not create root block");return t}};gs=new WeakMap;function Ty(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Ay=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=Ay(i);return e+=`</${r.type}>`,e};function IT(r){return" ".repeat(r)}function xT(r){let e="",t=0,i=r.split(/>\s*</);for(let n=0;n<i.length;n++){let o=i[n];n===0&&(o=o.trim()),n===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=IT(t),n!==0&&(e+="<"),e+=o,n!==i.length-1&&(e+=`>
1
+ var FS=Object.create;var Em=Object.defineProperty;var TS=Object.getOwnPropertyDescriptor;var AS=Object.getOwnPropertyNames;var ES=Object.getPrototypeOf,RS=Object.prototype.hasOwnProperty;var Rm=r=>{throw TypeError(r)};var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var OS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of AS(e))!RS.call(r,n)&&n!==t&&Em(r,n,{get:()=>e[n],enumerable:!(i=TS(e,n))||i.enumerable});return r};var Dn=(r,e,t)=>(t=r!=null?FS(ES(r)):{},OS(e||!r||!r.__esModule?Em(t,"default",{value:r,enumerable:!0}):t,r));var ll=(r,e,t)=>e.has(r)||Rm("Cannot "+t);var s=(r,e,t)=>(ll(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>e.has(r)?Rm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),d=(r,e,t,i)=>(ll(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),S=(r,e,t)=>(ll(r,e,"access private method"),t);var Om=(r,e,t,i)=>({set _(n){d(r,e,n,t)},get _(){return s(r,e,i)}});var le=h((lO,Bm)=>{Bm.exports=function(r){try{return!!r()}catch{return!0}}});var la=h((uO,Mm)=>{var BS=le();Mm.exports=!BS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var Z=h((cO,Lm)=>{var Um=la(),Dm=Function.prototype,ul=Dm.call,MS=Um&&Dm.bind.bind(ul,ul);Lm.exports=Um?MS:function(r){return function(){return ul.apply(r,arguments)}}});var _m=h((mO,Nm)=>{var US=Math.ceil,DS=Math.floor;Nm.exports=Math.trunc||function(e){var t=+e;return(t>0?DS:US)(t)}});var ua=h((pO,Hm)=>{var LS=_m();Hm.exports=function(r){var e=+r;return e!==e||e===0?0:LS(e)}});var he=h((gO,qm)=>{var ca=function(r){return r&&r.Math==Math&&r};qm.exports=ca(typeof globalThis=="object"&&globalThis)||ca(typeof window=="object"&&window)||ca(typeof self=="object"&&self)||ca(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var Wr=h((hO,jm)=>{jm.exports=!1});var ma=h((fO,Gm)=>{var Wm=he(),NS=Object.defineProperty;Gm.exports=function(r,e){try{NS(Wm,r,{value:e,configurable:!0,writable:!0})}catch{Wm[r]=e}return e}});var pa=h((vO,zm)=>{var _S=he(),HS=ma(),Vm="__core-js_shared__",qS=_S[Vm]||HS(Vm,{});zm.exports=qS});var cl=h((yO,$m)=>{var jS=Wr(),Jm=pa();($m.exports=function(r,e){return Jm[r]||(Jm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:jS?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var ga=h((bO,Km)=>{Km.exports=function(r){return r==null}});var ha=h((kO,Xm)=>{var WS=ga(),GS=TypeError;Xm.exports=function(r){if(WS(r))throw GS("Can't call method on "+r);return r}});var Ln=h((SO,Zm)=>{var VS=ha(),zS=Object;Zm.exports=function(r){return zS(VS(r))}});var we=h((PO,Qm)=>{var JS=Z(),$S=Ln(),KS=JS({}.hasOwnProperty);Qm.exports=Object.hasOwn||function(e,t){return KS($S(e),t)}});var ml=h((CO,Ym)=>{var XS=Z(),ZS=0,QS=Math.random(),YS=XS(1 .toString);Ym.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+YS(++ZS+QS,36)}});var tp=h((wO,ep)=>{ep.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var dp=h((IO,ap)=>{var op=he(),pl=tp(),rp=op.process,ip=op.Deno,np=rp&&rp.versions||ip&&ip.version,sp=np&&np.v8,qe,fa;sp&&(qe=sp.split("."),fa=qe[0]>0&&qe[0]<4?1:+(qe[0]+qe[1]));!fa&&pl&&(qe=pl.match(/Edge\/(\d+)/),(!qe||qe[1]>=74)&&(qe=pl.match(/Chrome\/(\d+)/),qe&&(fa=+qe[1])));ap.exports=fa});var gl=h((xO,up)=>{var lp=dp(),eP=le();up.exports=!!Object.getOwnPropertySymbols&&!eP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&lp&&lp<41})});var hl=h((FO,cp)=>{var tP=gl();cp.exports=tP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ie=h((TO,pp)=>{var rP=he(),iP=cl(),mp=we(),nP=ml(),sP=gl(),oP=hl(),Gr=rP.Symbol,fl=iP("wks"),aP=oP?Gr.for||Gr:Gr&&Gr.withoutSetter||nP;pp.exports=function(r){return mp(fl,r)||(fl[r]=sP&&mp(Gr,r)?Gr[r]:aP("Symbol."+r)),fl[r]}});var fp=h((AO,hp)=>{var dP=Ie(),lP=dP("toStringTag"),gp={};gp[lP]="z";hp.exports=String(gp)==="[object z]"});var yl=h((EO,vp)=>{var vl=typeof document=="object"&&document.all,uP=typeof vl>"u"&&vl!==void 0;vp.exports={all:vl,IS_HTMLDDA:uP}});var Q=h((RO,bp)=>{var yp=yl(),cP=yp.all;bp.exports=yp.IS_HTMLDDA?function(r){return typeof r=="function"||r===cP}:function(r){return typeof r=="function"}});var va=h((OO,Sp)=>{var kp=Z(),mP=kp({}.toString),pP=kp("".slice);Sp.exports=function(r){return pP(mP(r),8,-1)}});var Nn=h((BO,Pp)=>{var gP=fp(),hP=Q(),ya=va(),fP=Ie(),vP=fP("toStringTag"),yP=Object,bP=ya(function(){return arguments}())=="Arguments",kP=function(r,e){try{return r[e]}catch{}};Pp.exports=gP?ya:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=kP(e=yP(r),vP))=="string"?t:bP?ya(e):(i=ya(e))=="Object"&&hP(e.callee)?"Arguments":i}});var _n=h((MO,Cp)=>{var SP=Nn(),PP=String;Cp.exports=function(r){if(SP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return PP(r)}});var kl=h((UO,xp)=>{var bl=Z(),CP=ua(),wP=_n(),IP=ha(),xP=bl("".charAt),wp=bl("".charCodeAt),FP=bl("".slice),Ip=function(r){return function(e,t){var i=wP(IP(e)),n=CP(t),o=i.length,a,c;return n<0||n>=o?r?"":void 0:(a=wp(i,n),a<55296||a>56319||n+1===o||(c=wp(i,n+1))<56320||c>57343?r?xP(i,n):a:r?FP(i,n,n+2):(a-55296<<10)+(c-56320)+65536)}};xp.exports={codeAt:Ip(!1),charAt:Ip(!0)}});var Ap=h((DO,Tp)=>{var TP=he(),AP=Q(),Fp=TP.WeakMap;Tp.exports=AP(Fp)&&/native code/.test(String(Fp))});var wt=h((LO,Op)=>{var Ep=Q(),Rp=yl(),EP=Rp.all;Op.exports=Rp.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Ep(r)||r===EP}:function(r){return typeof r=="object"?r!==null:Ep(r)}});var fe=h((NO,Bp)=>{var RP=le();Bp.exports=!RP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Pl=h((_O,Up)=>{var OP=he(),Mp=wt(),Sl=OP.document,BP=Mp(Sl)&&Mp(Sl.createElement);Up.exports=function(r){return BP?Sl.createElement(r):{}}});var Cl=h((HO,Dp)=>{var MP=fe(),UP=le(),DP=Pl();Dp.exports=!MP&&!UP(function(){return Object.defineProperty(DP("div"),"a",{get:function(){return 7}}).a!=7})});var wl=h((qO,Lp)=>{var LP=fe(),NP=le();Lp.exports=LP&&NP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Ze=h((jO,Np)=>{var _P=wt(),HP=String,qP=TypeError;Np.exports=function(r){if(_P(r))return r;throw qP(HP(r)+" is not an object")}});var je=h((WO,_p)=>{var jP=la(),ba=Function.prototype.call;_p.exports=jP?ba.bind(ba):function(){return ba.apply(ba,arguments)}});var Hn=h((GO,Hp)=>{var Il=he(),WP=Q(),GP=function(r){return WP(r)?r:void 0};Hp.exports=function(r,e){return arguments.length<2?GP(Il[r]):Il[r]&&Il[r][e]}});var xl=h((VO,qp)=>{var VP=Z();qp.exports=VP({}.isPrototypeOf)});var Fl=h((zO,jp)=>{var zP=Hn(),JP=Q(),$P=xl(),KP=hl(),XP=Object;jp.exports=KP?function(r){return typeof r=="symbol"}:function(r){var e=zP("Symbol");return JP(e)&&$P(e.prototype,XP(r))}});var Tl=h((JO,Wp)=>{var ZP=String;Wp.exports=function(r){try{return ZP(r)}catch{return"Object"}}});var ka=h(($O,Gp)=>{var QP=Q(),YP=Tl(),eC=TypeError;Gp.exports=function(r){if(QP(r))return r;throw eC(YP(r)+" is not a function")}});var Sa=h((KO,Vp)=>{var tC=ka(),rC=ga();Vp.exports=function(r,e){var t=r[e];return rC(t)?void 0:tC(t)}});var Jp=h((XO,zp)=>{var Al=je(),El=Q(),Rl=wt(),iC=TypeError;zp.exports=function(r,e){var t,i;if(e==="string"&&El(t=r.toString)&&!Rl(i=Al(t,r))||El(t=r.valueOf)&&!Rl(i=Al(t,r))||e!=="string"&&El(t=r.toString)&&!Rl(i=Al(t,r)))return i;throw iC("Can't convert object to primitive value")}});var Zp=h((ZO,Xp)=>{var nC=je(),$p=wt(),Kp=Fl(),sC=Sa(),oC=Jp(),aC=Ie(),dC=TypeError,lC=aC("toPrimitive");Xp.exports=function(r,e){if(!$p(r)||Kp(r))return r;var t=sC(r,lC),i;if(t){if(e===void 0&&(e="default"),i=nC(t,r,e),!$p(i)||Kp(i))return i;throw dC("Can't convert object to primitive value")}return e===void 0&&(e="number"),oC(r,e)}});var Pa=h((QO,Qp)=>{var uC=Zp(),cC=Fl();Qp.exports=function(r){var e=uC(r,"string");return cC(e)?e:e+""}});var Qe=h(eg=>{var mC=fe(),pC=Cl(),gC=wl(),Ca=Ze(),Yp=Pa(),hC=TypeError,Ol=Object.defineProperty,fC=Object.getOwnPropertyDescriptor,Bl="enumerable",Ml="configurable",Ul="writable";eg.f=mC?gC?function(e,t,i){if(Ca(e),t=Yp(t),Ca(i),typeof e=="function"&&t==="prototype"&&"value"in i&&Ul in i&&!i[Ul]){var n=fC(e,t);n&&n[Ul]&&(e[t]=i.value,i={configurable:Ml in i?i[Ml]:n[Ml],enumerable:Bl in i?i[Bl]:n[Bl],writable:!1})}return Ol(e,t,i)}:Ol:function(e,t,i){if(Ca(e),t=Yp(t),Ca(i),pC)try{return Ol(e,t,i)}catch{}if("get"in i||"set"in i)throw hC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Vr=h((eB,tg)=>{tg.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var wa=h((tB,rg)=>{var vC=fe(),yC=Qe(),bC=Vr();rg.exports=vC?function(r,e,t){return yC.f(r,e,bC(1,t))}:function(r,e,t){return r[e]=t,r}});var Ia=h((rB,ng)=>{var kC=cl(),SC=ml(),ig=kC("keys");ng.exports=function(r){return ig[r]||(ig[r]=SC(r))}});var xa=h((iB,sg)=>{sg.exports={}});var zr=h((nB,dg)=>{var PC=Ap(),ag=he(),CC=wt(),wC=wa(),Dl=we(),Ll=pa(),IC=Ia(),xC=xa(),og="Object already initialized",Nl=ag.TypeError,FC=ag.WeakMap,Fa,qn,Ta,TC=function(r){return Ta(r)?qn(r):Fa(r,{})},AC=function(r){return function(e){var t;if(!CC(e)||(t=qn(e)).type!==r)throw Nl("Incompatible receiver, "+r+" required");return t}};PC||Ll.state?(We=Ll.state||(Ll.state=new FC),We.get=We.get,We.has=We.has,We.set=We.set,Fa=function(r,e){if(We.has(r))throw Nl(og);return e.facade=r,We.set(r,e),e},qn=function(r){return We.get(r)||{}},Ta=function(r){return We.has(r)}):(ar=IC("state"),xC[ar]=!0,Fa=function(r,e){if(Dl(r,ar))throw Nl(og);return e.facade=r,wC(r,ar,e),e},qn=function(r){return Dl(r,ar)?r[ar]:{}},Ta=function(r){return Dl(r,ar)});var We,ar;dg.exports={set:Fa,get:qn,has:Ta,enforce:TC,getterFor:AC}});var _l=h(cg=>{"use strict";var lg={}.propertyIsEnumerable,ug=Object.getOwnPropertyDescriptor,EC=ug&&!lg.call({1:2},1);cg.f=EC?function(e){var t=ug(this,e);return!!t&&t.enumerable}:lg});var ql=h((oB,mg)=>{var RC=Z(),OC=le(),BC=va(),Hl=Object,MC=RC("".split);mg.exports=OC(function(){return!Hl("z").propertyIsEnumerable(0)})?function(r){return BC(r)=="String"?MC(r,""):Hl(r)}:Hl});var Jr=h((aB,pg)=>{var UC=ql(),DC=ha();pg.exports=function(r){return UC(DC(r))}});var jl=h(hg=>{var LC=fe(),NC=je(),_C=_l(),HC=Vr(),qC=Jr(),jC=Pa(),WC=we(),GC=Cl(),gg=Object.getOwnPropertyDescriptor;hg.f=LC?gg:function(e,t){if(e=qC(e),t=jC(t),GC)try{return gg(e,t)}catch{}if(WC(e,t))return HC(!NC(_C.f,e,t),e[t])}});var Vl=h((lB,vg)=>{var Wl=fe(),VC=we(),fg=Function.prototype,zC=Wl&&Object.getOwnPropertyDescriptor,Gl=VC(fg,"name"),JC=Gl&&function(){}.name==="something",$C=Gl&&(!Wl||Wl&&zC(fg,"name").configurable);vg.exports={EXISTS:Gl,PROPER:JC,CONFIGURABLE:$C}});var Jl=h((uB,yg)=>{var KC=Z(),XC=Q(),zl=pa(),ZC=KC(Function.toString);XC(zl.inspectSource)||(zl.inspectSource=function(r){return ZC(r)});yg.exports=zl.inspectSource});var Xl=h((cB,Sg)=>{var Kl=Z(),QC=le(),YC=Q(),Aa=we(),$l=fe(),e0=Vl().CONFIGURABLE,t0=Jl(),kg=zr(),r0=kg.enforce,i0=kg.get,bg=String,Ea=Object.defineProperty,n0=Kl("".slice),s0=Kl("".replace),o0=Kl([].join),a0=$l&&!QC(function(){return Ea(function(){},"length",{value:8}).length!==8}),d0=String(String).split("String"),l0=Sg.exports=function(r,e,t){n0(bg(e),0,7)==="Symbol("&&(e="["+s0(bg(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Aa(r,"name")||e0&&r.name!==e)&&($l?Ea(r,"name",{value:e,configurable:!0}):r.name=e),a0&&t&&Aa(t,"arity")&&r.length!==t.arity&&Ea(r,"length",{value:t.arity});try{t&&Aa(t,"constructor")&&t.constructor?$l&&Ea(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=r0(r);return Aa(i,"source")||(i.source=o0(d0,typeof e=="string"?e:"")),r};Function.prototype.toString=l0(function(){return YC(this)&&i0(this).source||t0(this)},"toString")});var dr=h((mB,Pg)=>{var u0=Q(),c0=Qe(),m0=Xl(),p0=ma();Pg.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(u0(t)&&m0(t,o,i),i.global)n?r[e]=t:p0(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:c0.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var Zl=h((pB,Cg)=>{var g0=ua(),h0=Math.max,f0=Math.min;Cg.exports=function(r,e){var t=g0(r);return t<0?h0(t+e,0):f0(t,e)}});var Ig=h((gB,wg)=>{var v0=ua(),y0=Math.min;wg.exports=function(r){return r>0?y0(v0(r),9007199254740991):0}});var Ra=h((hB,xg)=>{var b0=Ig();xg.exports=function(r){return b0(r.length)}});var Ag=h((fB,Tg)=>{var k0=Jr(),S0=Zl(),P0=Ra(),Fg=function(r){return function(e,t,i){var n=k0(e),o=P0(n),a=S0(i,o),c;if(r&&t!=t){for(;o>a;)if(c=n[a++],c!=c)return!0}else for(;o>a;a++)if((r||a in n)&&n[a]===t)return r||a||0;return!r&&-1}};Tg.exports={includes:Fg(!0),indexOf:Fg(!1)}});var Yl=h((vB,Rg)=>{var C0=Z(),Ql=we(),w0=Jr(),I0=Ag().indexOf,x0=xa(),Eg=C0([].push);Rg.exports=function(r,e){var t=w0(r),i=0,n=[],o;for(o in t)!Ql(x0,o)&&Ql(t,o)&&Eg(n,o);for(;e.length>i;)Ql(t,o=e[i++])&&(~I0(n,o)||Eg(n,o));return n}});var Oa=h((yB,Og)=>{Og.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Mg=h(Bg=>{var F0=Yl(),T0=Oa(),A0=T0.concat("length","prototype");Bg.f=Object.getOwnPropertyNames||function(e){return F0(e,A0)}});var eu=h(Ug=>{Ug.f=Object.getOwnPropertySymbols});var Lg=h((SB,Dg)=>{var E0=Hn(),R0=Z(),O0=Mg(),B0=eu(),M0=Ze(),U0=R0([].concat);Dg.exports=E0("Reflect","ownKeys")||function(e){var t=O0.f(M0(e)),i=B0.f;return i?U0(t,i(e)):t}});var Hg=h((PB,_g)=>{var Ng=we(),D0=Lg(),L0=jl(),N0=Qe();_g.exports=function(r,e,t){for(var i=D0(e),n=N0.f,o=L0.f,a=0;a<i.length;a++){var c=i[a];!Ng(r,c)&&!(t&&Ng(t,c))&&n(r,c,o(e,c))}}});var jg=h((CB,qg)=>{var _0=le(),H0=Q(),q0=/#|\.prototype\./,jn=function(r,e){var t=W0[j0(r)];return t==V0?!0:t==G0?!1:H0(e)?_0(e):!!e},j0=jn.normalize=function(r){return String(r).replace(q0,".").toLowerCase()},W0=jn.data={},G0=jn.NATIVE="N",V0=jn.POLYFILL="P";qg.exports=jn});var Wn=h((wB,Wg)=>{var tu=he(),z0=jl().f,J0=wa(),$0=dr(),K0=ma(),X0=Hg(),Z0=jg();Wg.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,c,p,g,f;if(i?a=tu:n?a=tu[t]||K0(t,{}):a=(tu[t]||{}).prototype,a)for(c in e){if(g=e[c],r.dontCallGetSet?(f=z0(a,c),p=f&&f.value):p=a[c],o=Z0(i?c:t+(n?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof g==typeof p)continue;X0(g,p)}(r.sham||p&&p.sham)&&J0(g,"sham",!0),$0(a,c,g,r)}}});var ru=h((IB,Gg)=>{var Q0=Yl(),Y0=Oa();Gg.exports=Object.keys||function(e){return Q0(e,Y0)}});var zg=h(Vg=>{var ew=fe(),tw=wl(),rw=Qe(),iw=Ze(),nw=Jr(),sw=ru();Vg.f=ew&&!tw?Object.defineProperties:function(e,t){iw(e);for(var i=nw(t),n=sw(t),o=n.length,a=0,c;o>a;)rw.f(e,c=n[a++],i[c]);return e}});var $g=h((FB,Jg)=>{var ow=Hn();Jg.exports=ow("document","documentElement")});var Gn=h((TB,th)=>{var aw=Ze(),dw=zg(),Kg=Oa(),lw=xa(),uw=$g(),cw=Pl(),mw=Ia(),Xg=">",Zg="<",nu="prototype",su="script",Yg=mw("IE_PROTO"),iu=function(){},eh=function(r){return Zg+su+Xg+r+Zg+"/"+su+Xg},Qg=function(r){r.write(eh("")),r.close();var e=r.parentWindow.Object;return r=null,e},pw=function(){var r=cw("iframe"),e="java"+su+":",t;return r.style.display="none",uw.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(eh("document.F=Object")),t.close(),t.F},Ba,Ma=function(){try{Ba=new ActiveXObject("htmlfile")}catch{}Ma=typeof document<"u"?document.domain&&Ba?Qg(Ba):pw():Qg(Ba);for(var r=Kg.length;r--;)delete Ma[nu][Kg[r]];return Ma()};lw[Yg]=!0;th.exports=Object.create||function(e,t){var i;return e!==null?(iu[nu]=aw(e),i=new iu,iu[nu]=null,i[Yg]=e):i=Ma(),t===void 0?i:dw.f(i,t)}});var ih=h((AB,rh)=>{var gw=le();rh.exports=!gw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var au=h((EB,sh)=>{var hw=we(),fw=Q(),vw=Ln(),yw=Ia(),bw=ih(),nh=yw("IE_PROTO"),ou=Object,kw=ou.prototype;sh.exports=bw?ou.getPrototypeOf:function(r){var e=vw(r);if(hw(e,nh))return e[nh];var t=e.constructor;return fw(t)&&e instanceof t?t.prototype:e instanceof ou?kw:null}});var cu=h((RB,dh)=>{"use strict";var Sw=le(),Pw=Q(),Cw=wt(),ww=Gn(),oh=au(),Iw=dr(),xw=Ie(),Fw=Wr(),uu=xw("iterator"),ah=!1,lt,du,lu;[].keys&&(lu=[].keys(),"next"in lu?(du=oh(oh(lu)),du!==Object.prototype&&(lt=du)):ah=!0);var Tw=!Cw(lt)||Sw(function(){var r={};return lt[uu].call(r)!==r});Tw?lt={}:Fw&&(lt=ww(lt));Pw(lt[uu])||Iw(lt,uu,function(){return this});dh.exports={IteratorPrototype:lt,BUGGY_SAFARI_ITERATORS:ah}});var Vn=h((OB,uh)=>{var Aw=Qe().f,Ew=we(),Rw=Ie(),lh=Rw("toStringTag");uh.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Ew(r,lh)&&Aw(r,lh,{configurable:!0,value:e})}});var $r=h((BB,ch)=>{ch.exports={}});var mu=h((MB,mh)=>{"use strict";var Ow=cu().IteratorPrototype,Bw=Gn(),Mw=Vr(),Uw=Vn(),Dw=$r(),Lw=function(){return this};mh.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=Bw(Ow,{next:Mw(+!i,t)}),Uw(r,n,!1,!0),Dw[n]=Lw,r}});var gh=h((UB,ph)=>{var Nw=Q(),_w=String,Hw=TypeError;ph.exports=function(r){if(typeof r=="object"||Nw(r))return r;throw Hw("Can't set "+_w(r)+" as a prototype")}});var fh=h((DB,hh)=>{var qw=Z(),jw=Ze(),Ww=gh();hh.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=qw(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return jw(n),Ww(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var gu=h((LB,xh)=>{"use strict";var Gw=Wn(),Vw=je(),Ua=Wr(),wh=Vl(),zw=Q(),Jw=mu(),vh=au(),yh=fh(),$w=Vn(),Kw=wa(),pu=dr(),Xw=Ie(),bh=$r(),Ih=cu(),Zw=wh.PROPER,Qw=wh.CONFIGURABLE,kh=Ih.IteratorPrototype,Da=Ih.BUGGY_SAFARI_ITERATORS,zn=Xw("iterator"),Sh="keys",Jn="values",Ph="entries",Ch=function(){return this};xh.exports=function(r,e,t,i,n,o,a){Jw(t,e,i);var c=function(x){if(x===n&&b)return b;if(!Da&&x in f)return f[x];switch(x){case Sh:return function(){return new t(this,x)};case Jn:return function(){return new t(this,x)};case Ph:return function(){return new t(this,x)}}return function(){return new t(this)}},p=e+" Iterator",g=!1,f=r.prototype,m=f[zn]||f["@@iterator"]||n&&f[n],b=!Da&&m||c(n),v=e=="Array"&&f.entries||m,P,C,F;if(v&&(P=vh(v.call(new r)),P!==Object.prototype&&P.next&&(!Ua&&vh(P)!==kh&&(yh?yh(P,kh):zw(P[zn])||pu(P,zn,Ch)),$w(P,p,!0,!0),Ua&&(bh[p]=Ch))),Zw&&n==Jn&&m&&m.name!==Jn&&(!Ua&&Qw?Kw(f,"name",Jn):(g=!0,b=function(){return Vw(m,this)})),n)if(C={values:c(Jn),keys:o?b:c(Sh),entries:c(Ph)},a)for(F in C)(Da||g||!(F in f))&&pu(f,F,C[F]);else Gw({target:e,proto:!0,forced:Da||g},C);return(!Ua||a)&&f[zn]!==b&&pu(f,zn,b,{name:n}),bh[e]=b,C}});var hu=h((NB,Fh)=>{Fh.exports=function(r,e){return{value:r,done:e}}});var Rh=h(()=>{"use strict";var Yw=kl().charAt,eI=_n(),Ah=zr(),tI=gu(),Th=hu(),Eh="String Iterator",rI=Ah.set,iI=Ah.getterFor(Eh);tI(String,"String",function(r){rI(this,{type:Eh,string:eI(r),index:0})},function(){var e=iI(this),t=e.string,i=e.index,n;return i>=t.length?Th(void 0,!0):(n=Yw(t,i),e.index+=n.length,Th(n,!1))})});var fu=h((qB,Oh)=>{var nI=le(),sI=Ie(),oI=Wr(),aI=sI("iterator");Oh.exports=!nI(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,n){e.delete("b"),t+=n+i}),oI&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[aI]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var Mh=h((jB,Bh)=>{var dI=va(),lI=Z();Bh.exports=function(r){if(dI(r)==="Function")return lI(r)}});var La=h((WB,Dh)=>{var Uh=Mh(),uI=ka(),cI=la(),mI=Uh(Uh.bind);Dh.exports=function(r,e){return uI(r),e===void 0?r:cI?mI(r,e):function(){return r.apply(e,arguments)}}});var _h=h((GB,Nh)=>{var Lh=Xl(),pI=Qe();Nh.exports=function(r,e,t){return t.get&&Lh(t.get,e,{getter:!0}),t.set&&Lh(t.set,e,{setter:!0}),pI.f(r,e,t)}});var vu=h((VB,Hh)=>{var gI=xl(),hI=TypeError;Hh.exports=function(r,e){if(gI(e,r))return r;throw hI("Incorrect invocation")}});var Gh=h((zB,Wh)=>{"use strict";var qh=fe(),fI=Z(),vI=je(),yI=le(),yu=ru(),bI=eu(),kI=_l(),SI=Ln(),PI=ql(),Kr=Object.assign,jh=Object.defineProperty,CI=fI([].concat);Wh.exports=!Kr||yI(function(){if(qh&&Kr({b:1},Kr(jh({},"a",{enumerable:!0,get:function(){jh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(n){e[n]=n}),Kr({},r)[t]!=7||yu(Kr({},e)).join("")!=i})?function(e,t){for(var i=SI(e),n=arguments.length,o=1,a=bI.f,c=kI.f;n>o;)for(var p=PI(arguments[o++]),g=a?CI(yu(p),a(p)):yu(p),f=g.length,m=0,b;f>m;)b=g[m++],(!qh||vI(c,p,b))&&(i[b]=p[b]);return i}:Kr});var Jh=h((JB,zh)=>{var wI=je(),Vh=Ze(),II=Sa();zh.exports=function(r,e,t){var i,n;Vh(r);try{if(i=II(r,"return"),!i){if(e==="throw")throw t;return t}i=wI(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Vh(i),t}});var Kh=h(($B,$h)=>{var xI=Ze(),FI=Jh();$h.exports=function(r,e,t,i){try{return i?e(xI(t)[0],t[1]):e(t)}catch(n){FI(r,"throw",n)}}});var Zh=h((KB,Xh)=>{var TI=Ie(),AI=$r(),EI=TI("iterator"),RI=Array.prototype;Xh.exports=function(r){return r!==void 0&&(AI.Array===r||RI[EI]===r)}});var nf=h((XB,rf)=>{var OI=Z(),BI=le(),Qh=Q(),MI=Nn(),UI=Hn(),DI=Jl(),Yh=function(){},LI=[],ef=UI("Reflect","construct"),bu=/^\s*(?:class|function)\b/,NI=OI(bu.exec),_I=!bu.exec(Yh),$n=function(e){if(!Qh(e))return!1;try{return ef(Yh,LI,e),!0}catch{return!1}},tf=function(e){if(!Qh(e))return!1;switch(MI(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return _I||!!NI(bu,DI(e))}catch{return!0}};tf.sham=!0;rf.exports=!ef||BI(function(){var r;return $n($n.call)||!$n(Object)||!$n(function(){r=!0})||r})?tf:$n});var ku=h((ZB,sf)=>{"use strict";var HI=Pa(),qI=Qe(),jI=Vr();sf.exports=function(r,e,t){var i=HI(e);i in r?qI.f(r,i,jI(0,t)):r[i]=t}});var Na=h((QB,af)=>{var WI=Nn(),of=Sa(),GI=ga(),VI=$r(),zI=Ie(),JI=zI("iterator");af.exports=function(r){if(!GI(r))return of(r,JI)||of(r,"@@iterator")||VI[WI(r)]}});var Su=h((YB,df)=>{var $I=je(),KI=ka(),XI=Ze(),ZI=Tl(),QI=Na(),YI=TypeError;df.exports=function(r,e){var t=arguments.length<2?QI(r):e;if(KI(t))return XI($I(t,r));throw YI(ZI(r)+" is not iterable")}});var mf=h((eM,cf)=>{"use strict";var ex=La(),tx=je(),rx=Ln(),ix=Kh(),nx=Zh(),sx=nf(),ox=Ra(),lf=ku(),ax=Su(),dx=Na(),uf=Array;cf.exports=function(e){var t=rx(e),i=sx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=ex(o,n>2?arguments[2]:void 0));var c=dx(t),p=0,g,f,m,b,v,P;if(c&&!(this===uf&&nx(c)))for(b=ax(t,c),v=b.next,f=i?new this:[];!(m=tx(v,b)).done;p++)P=a?ix(b,o,[m.value,p],!0):m.value,lf(f,p,P);else for(g=ox(t),f=i?new this(g):uf(g);g>p;p++)P=a?o(t[p],p):t[p],lf(f,p,P);return f.length=p,f}});var Pu=h((tM,gf)=>{var pf=Zl(),lx=Ra(),ux=ku(),cx=Array,mx=Math.max;gf.exports=function(r,e,t){for(var i=lx(r),n=pf(e,i),o=pf(t===void 0?i:t,i),a=cx(mx(o-n,0)),c=0;n<o;n++,c++)ux(a,c,r[n]);return a.length=c,a}});var Cf=h((rM,Pf)=>{var lr=Z(),Cu=2147483647,Kn=36,bf=1,xu=26,px=38,gx=700,hx=72,fx=128,vx="-",yx=/[^\0-\u007E]/,kf=/[.\u3002\uFF0E\uFF61]/g,hf="Overflow: input needs wider integers to process",wu=Kn-bf,ff=RangeError,bx=lr(kf.exec),Xr=Math.floor,Iu=String.fromCharCode,vf=lr("".charCodeAt),Sf=lr([].join),It=lr([].push),kx=lr("".replace),Sx=lr("".split),Px=lr("".toLowerCase),Cx=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=vf(r,t++);if(n>=55296&&n<=56319&&t<i){var o=vf(r,t++);(o&64512)==56320?It(e,((n&1023)<<10)+(o&1023)+65536):(It(e,n),t--)}else It(e,n)}return e},yf=function(r){return r+22+75*(r<26)},wx=function(r,e,t){var i=0;for(r=t?Xr(r/gx):r>>1,r+=Xr(r/e);r>wu*xu>>1;)r=Xr(r/wu),i+=Kn;return Xr(i+(wu+1)*r/(r+px))},Ix=function(r){var e=[];r=Cx(r);var t=r.length,i=fx,n=0,o=hx,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&It(e,Iu(c));var p=e.length,g=p;for(p&&It(e,vx);g<t;){var f=Cu;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<f&&(f=c);var m=g+1;if(f-i>Xr((Cu-n)/m))throw ff(hf);for(n+=(f-i)*m,i=f,a=0;a<r.length;a++){if(c=r[a],c<i&&++n>Cu)throw ff(hf);if(c==i){for(var b=n,v=Kn;;){var P=v<=o?bf:v>=o+xu?xu:v-o;if(b<P)break;var C=b-P,F=Kn-P;It(e,Iu(yf(P+C%F))),b=Xr(C/F),v+=Kn}It(e,Iu(yf(b))),o=wx(n,m,g==p),n=0,g++}}n++,i++}return Sf(e,"")};Pf.exports=function(r){var e=[],t=Sx(kx(Px(r),kf,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],It(e,bx(yx,n)?"xn--"+Ix(n):n);return Sf(e,".")}});var Fu=h((iM,wf)=>{var xx=TypeError;wf.exports=function(r,e){if(r<e)throw xx("Not enough arguments");return r}});var xf=h((nM,If)=>{var Fx=Ie(),Tx=Gn(),Ax=Qe().f,Tu=Fx("unscopables"),Au=Array.prototype;Au[Tu]==null&&Ax(Au,Tu,{configurable:!0,value:Tx(null)});If.exports=function(r){Au[Tu][r]=!0}});var Of=h((sM,Rf)=>{"use strict";var Ex=Jr(),Eu=xf(),Ff=$r(),Af=zr(),Rx=Qe().f,Ox=gu(),_a=hu(),Bx=Wr(),Mx=fe(),Ef="Array Iterator",Ux=Af.set,Dx=Af.getterFor(Ef);Rf.exports=Ox(Array,"Array",function(r,e){Ux(this,{type:Ef,target:Ex(r),index:0,kind:e})},function(){var r=Dx(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,_a(void 0,!0)):t=="keys"?_a(i,!1):t=="values"?_a(e[i],!1):_a([i,e[i]],!1)},"values");var Tf=Ff.Arguments=Ff.Array;Eu("keys");Eu("values");Eu("entries");if(!Bx&&Mx&&Tf.name!=="values")try{Rx(Tf,"name",{value:"values"})}catch{}});var Mf=h((oM,Bf)=>{var Lx=dr();Bf.exports=function(r,e,t){for(var i in e)Lx(r,i,e[i],t);return r}});var Lf=h((aM,Df)=>{var Uf=Pu(),Nx=Math.floor,Ru=function(r,e){var t=r.length,i=Nx(t/2);return t<8?_x(r,e):Hx(r,Ru(Uf(r,0,i),e),Ru(Uf(r,i),e),e)},_x=function(r,e){for(var t=r.length,i=1,n,o;i<t;){for(o=i,n=r[i];o&&e(r[o-1],n)>0;)r[o]=r[--o];o!==i++&&(r[o]=n)}return r},Hx=function(r,e,t,i){for(var n=e.length,o=t.length,a=0,c=0;a<n||c<o;)r[a+c]=a<n&&c<o?i(e[a],t[c])<=0?e[a++]:t[c++]:a<n?e[a++]:t[c++];return r};Df.exports=Ru});var qu=h((dM,iv)=>{"use strict";Of();var Du=Wn(),Qr=he(),Ha=je(),Ye=Z(),qx=fe(),Kf=fu(),Xf=dr(),jx=Mf(),Wx=Vn(),Gx=mu(),_u=zr(),Zf=vu(),Ou=Q(),Vx=we(),zx=La(),Jx=Nn(),$x=Ze(),Qf=wt(),ve=_n(),Kx=Gn(),Nf=Vr(),Lu=Su(),Xx=Na(),Zr=Fu(),Zx=Ie(),Qx=Lf(),Yx=Zx("iterator"),Qn="URLSearchParams",Yf=Qn+"Iterator",ev=_u.set,Ge=_u.getterFor(Qn),eF=_u.getterFor(Yf),tF=Object.getOwnPropertyDescriptor,Hu=function(r){if(!qx)return Qr[r];var e=tF(Qr,r);return e&&e.value},_f=Hu("fetch"),ja=Hu("Request"),Xn=Hu("Headers"),Bu=ja&&ja.prototype,Hf=Xn&&Xn.prototype,rF=Qr.RegExp,iF=Qr.TypeError,tv=Qr.decodeURIComponent,nF=Qr.encodeURIComponent,sF=Ye("".charAt),qf=Ye([].join),ur=Ye([].push),Nu=Ye("".replace),oF=Ye([].shift),jf=Ye([].splice),Wf=Ye("".split),aF=Ye("".slice),dF=/\+/g,Gf=Array(4),lF=function(r){return Gf[r-1]||(Gf[r-1]=rF("((?:%[\\da-f]{2}){"+r+"})","gi"))},uF=function(r){try{return tv(r)}catch{return r}},Vf=function(r){var e=Nu(r,dF," "),t=4;try{return tv(e)}catch{for(;t;)e=Nu(e,lF(t--),uF);return e}},cF=/[!'()~]|%20/g,mF={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pF=function(r){return mF[r]},zf=function(r){return Nu(nF(r),cF,pF)},Mu=Gx(function(e,t){ev(this,{type:Yf,iterator:Lu(Ge(e).entries),kind:t})},"Iterator",function(){var e=eF(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value=t==="keys"?n.key:t==="values"?n.value:[n.key,n.value]),i},!0),rv=function(r){this.entries=[],this.url=null,r!==void 0&&(Qf(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?sF(r,0)==="?"?aF(r,1):r:ve(r)))};rv.prototype={type:Qn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=Xx(r),t,i,n,o,a,c,p;if(e)for(t=Lu(r,e),i=t.next;!(n=Ha(i,t)).done;){if(o=Lu($x(n.value)),a=o.next,(c=Ha(a,o)).done||(p=Ha(a,o)).done||!Ha(a,o).done)throw iF("Expected sequence with length 2");ur(this.entries,{key:ve(c.value),value:ve(p.value)})}else for(var g in r)Vx(r,g)&&ur(this.entries,{key:g,value:ve(r[g])})},parseQuery:function(r){if(r)for(var e=Wf(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=Wf(i,"="),ur(this.entries,{key:Vf(oF(n)),value:Vf(qf(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],ur(e,zf(i.key)+"="+zf(i.value));return qf(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Wa=function(){Zf(this,Zn);var e=arguments.length>0?arguments[0]:void 0;ev(this,new rv(e))},Zn=Wa.prototype;jx(Zn,{append:function(e,t){Zr(arguments.length,2);var i=Ge(this);ur(i.entries,{key:ve(e),value:ve(t)}),i.updateURL()},delete:function(r){Zr(arguments.length,1);for(var e=Ge(this),t=e.entries,i=ve(r),n=0;n<t.length;)t[n].key===i?jf(t,n,1):n++;e.updateURL()},get:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=[],o=0;o<t.length;o++)t[o].key===i&&ur(n,t[o].value);return n},has:function(e){Zr(arguments.length,1);for(var t=Ge(this).entries,i=ve(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Zr(arguments.length,1);for(var i=Ge(this),n=i.entries,o=!1,a=ve(e),c=ve(t),p=0,g;p<n.length;p++)g=n[p],g.key===a&&(o?jf(n,p--,1):(o=!0,g.value=c));o||ur(n,{key:a,value:c}),i.updateURL()},sort:function(){var e=Ge(this);Qx(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ge(this).entries,i=zx(e,arguments.length>1?arguments[1]:void 0),n=0,o;n<t.length;)o=t[n++],i(o.value,o.key,this)},keys:function(){return new Mu(this,"keys")},values:function(){return new Mu(this,"values")},entries:function(){return new Mu(this,"entries")}},{enumerable:!0});Xf(Zn,Yx,Zn.entries,{name:"entries"});Xf(Zn,"toString",function(){return Ge(this).serialize()},{enumerable:!0});Wx(Wa,Qn);Du({global:!0,constructor:!0,forced:!Kf},{URLSearchParams:Wa});!Kf&&Ou(Xn)&&(Jf=Ye(Hf.has),$f=Ye(Hf.set),Uu=function(r){if(Qf(r)){var e=r.body,t;if(Jx(e)===Qn)return t=r.headers?new Xn(r.headers):new Xn,Jf(t,"content-type")||$f(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Kx(r,{body:Nf(0,ve(e)),headers:Nf(0,t)})}return r},Ou(_f)&&Du({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return _f(e,arguments.length>1?Uu(arguments[1]):{})}}),Ou(ja)&&(qa=function(e){return Zf(this,Bu),new ja(e,arguments.length>1?Uu(arguments[1]):{})},Bu.constructor=qa,qa.prototype=Bu,Du({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:qa})));var Jf,$f,Uu,qa;iv.exports={URLSearchParams:Wa,getState:Ge}});var Pv=h(()=>{"use strict";Rh();var gF=Wn(),ic=fe(),hF=fu(),nc=he(),nv=La(),Ee=Z(),$a=dr(),xe=_h(),fF=vu(),ec=we(),sc=Gh(),Yr=mf(),Ve=Pu(),vF=kl().codeAt,yF=Cf(),ct=_n(),bF=Vn(),kF=Fu(),fv=qu(),vv=zr(),SF=vv.set,Ka=vv.getterFor("URL"),PF=fv.URLSearchParams,CF=fv.getState,Yn=nc.URL,tc=nc.TypeError,Xa=nc.parseInt,wF=Math.floor,sv=Math.pow,Ae=Ee("".charAt),ze=Ee(/./.exec),ts=Ee([].join),IF=Ee(1 .toString),xF=Ee([].pop),ti=Ee([].push),ov=Ee("".replace),FF=Ee([].shift),TF=Ee("".split),is=Ee("".slice),Za=Ee("".toLowerCase),AF=Ee([].unshift),EF="Invalid authority",ju="Invalid scheme",cr="Invalid host",av="Invalid port",yv=/[a-z]/i,RF=/[\d+-.a-z]/i,rc=/\d/,OF=/^0x/i,BF=/^[0-7]+$/,MF=/^\d+$/,bv=/^[\da-f]+$/i,UF=/[\0\t\n\r #%/:<>?@[\\\]^|]/,DF=/[\0\t\n\r #/:<>?@[\\\]^|]/,LF=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,NF=/[\t\n\r]/g,Fe,_F=function(r){var e=TF(r,"."),t,i,n,o,a,c,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],n=0;n<t;n++){if(o=e[n],o=="")return r;if(a=10,o.length>1&&Ae(o,0)=="0"&&(a=ze(OF,o)?16:8,o=is(o,a==8?1:2)),o==="")c=0;else{if(!ze(a==10?MF:a==8?BF:bv,o))return r;c=Xa(o,a)}ti(i,c)}for(n=0;n<t;n++)if(c=i[n],n==t-1){if(c>=sv(256,5-t))return null}else if(c>255)return null;for(p=xF(i),n=0;n<i.length;n++)p+=i[n]*sv(256,3-n);return p},HF=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,c,p,g,f,m,b=function(){return Ae(r,n)};if(b()==":"){if(Ae(r,1)!=":")return;n+=2,t++,i=t}for(;b();){if(t==8)return;if(b()==":"){if(i!==null)return;n++,t++,i=t;continue}for(o=a=0;a<4&&ze(bv,b());)o=o*16+Xa(b(),16),n++,a++;if(b()=="."){if(a==0||(n-=a,t>6))return;for(c=0;b();){if(p=null,c>0)if(b()=="."&&c<4)n++;else return;if(!ze(rc,b()))return;for(;ze(rc,b());){if(g=Xa(b(),10),p===null)p=g;else{if(p==0)return;p=p*10+g}if(p>255)return;n++}e[t]=e[t]*256+p,c++,(c==2||c==4)&&t++}if(c!=4)return;break}else if(b()==":"){if(n++,!b())return}else if(b())return;e[t++]=o}if(i!==null)for(f=t-i,t=7;t!=0&&f>0;)m=e[t],e[t--]=e[i+f-1],e[i+--f]=m;else if(t!=8)return;return e},qF=function(r){for(var e=null,t=1,i=null,n=0,o=0;o<8;o++)r[o]!==0?(n>t&&(e=i,t=n),i=null,n=0):(i===null&&(i=o),++n);return n>t&&(e=i,t=n),e},es=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)AF(e,r%256),r=wF(r/256);return ts(e,".")}else if(typeof r=="object"){for(e="",i=qF(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=IF(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},Ja={},kv=sc({},Ja,{" ":1,'"':1,"<":1,">":1,"`":1}),Sv=sc({},kv,{"#":1,"?":1,"{":1,"}":1}),Wu=sc({},Sv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),xt=function(r,e){var t=vF(r,0);return t>32&&t<127&&!ec(e,r)?r:encodeURIComponent(r)},Ga={ftp:21,file:null,http:80,https:443,ws:80,wss:443},rs=function(r,e){var t;return r.length==2&&ze(yv,Ae(r,0))&&((t=Ae(r,1))==":"||!e&&t=="|")},dv=function(r){var e;return r.length>1&&rs(is(r,0,2))&&(r.length==2||(e=Ae(r,2))==="/"||e==="\\"||e==="?"||e==="#")},jF=function(r){return r==="."||Za(r)==="%2e"},WF=function(r){return r=Za(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Gu={},lv={},Vu={},uv={},cv={},zu={},mv={},pv={},Va={},za={},Ju={},$u={},Ku={},Xu={},gv={},Zu={},ei={},et={},hv={},mr={},ut={},oc=function(r,e,t){var i=ct(r),n,o,a;if(e){if(o=this.parse(i),o)throw tc(o);this.searchParams=null}else{if(t!==void 0&&(n=new oc(t,!0)),o=this.parse(i,null,n),o)throw tc(o);a=CF(new PF),a.bindURL(this),this.searchParams=a}};oc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Gu,o=0,a="",c=!1,p=!1,g=!1,f,m,b,v;for(r=ct(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=ov(r,LF,"")),r=ov(r,NF,""),f=Yr(r);o<=f.length;){switch(m=f[o],n){case Gu:if(m&&ze(yv,m))a+=Za(m),n=lv;else{if(e)return ju;n=Vu;continue}break;case lv:if(m&&(ze(RF,m)||m=="+"||m=="-"||m=="."))a+=Za(m);else if(m==":"){if(e&&(i.isSpecial()!=ec(Ga,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&Ga[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=Xu:i.isSpecial()&&t&&t.scheme==i.scheme?n=uv:i.isSpecial()?n=pv:f[o+1]=="/"?(n=cv,o++):(i.cannotBeABaseURL=!0,ti(i.path,""),n=hv)}else{if(e)return ju;a="",n=Vu,o=0;continue}break;case Vu:if(!t||t.cannotBeABaseURL&&m!="#")return ju;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=Ve(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=ut;break}n=t.scheme=="file"?Xu:zu;continue;case uv:if(m=="/"&&f[o+1]=="/")n=Va,o++;else{n=zu;continue}break;case cv:if(m=="/"){n=za;break}else{n=et;continue}case zu:if(i.scheme=t.scheme,m==Fe)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())n=mv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query="",n=mr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=ut;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.path.length--,n=et;continue}break;case mv:if(i.isSpecial()&&(m=="/"||m=="\\"))n=Va;else if(m=="/")n=za;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=et;continue}break;case pv:if(n=Va,m!="/"||Ae(a,o+1)!="/")continue;o++;break;case Va:if(m!="/"&&m!="\\"){n=za;continue}break;case za:if(m=="@"){c&&(a="%40"+a),c=!0,b=Yr(a);for(var P=0;P<b.length;P++){var C=b[P];if(C==":"&&!g){g=!0;continue}var F=xt(C,Wu);g?i.password+=F:i.username+=F}a=""}else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return EF;o-=Yr(a).length+1,a="",n=Ju}else a+=m;break;case Ju:case $u:if(e&&i.scheme=="file"){n=Zu;continue}else if(m==":"&&!p){if(a=="")return cr;if(v=i.parseHost(a),v)return v;if(a="",n=Ku,e==$u)return}else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return cr;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(v=i.parseHost(a),v)return v;if(a="",n=ei,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case Ku:if(ze(rc,m))a+=m;else if(m==Fe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var x=Xa(a,10);if(x>65535)return av;i.port=i.isSpecial()&&x===Ga[i.scheme]?null:x,a=""}if(e)return;n=ei;continue}else return av;break;case Xu:if(i.scheme="file",m=="/"||m=="\\")n=gv;else if(t&&t.scheme=="file")if(m==Fe)i.host=t.host,i.path=Ve(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=Ve(t.path),i.query="",n=mr;else if(m=="#")i.host=t.host,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=ut;else{dv(ts(Ve(f,o),""))||(i.host=t.host,i.path=Ve(t.path),i.shortenPath()),n=et;continue}else{n=et;continue}break;case gv:if(m=="/"||m=="\\"){n=Zu;break}t&&t.scheme=="file"&&!dv(ts(Ve(f,o),""))&&(rs(t.path[0],!0)?ti(i.path,t.path[0]):i.host=t.host),n=et;continue;case Zu:if(m==Fe||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&rs(a))n=et;else if(a==""){if(i.host="",e)return;n=ei}else{if(v=i.parseHost(a),v)return v;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=ei}continue}else a+=m;break;case ei:if(i.isSpecial()){if(n=et,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",n=mr;else if(!e&&m=="#")i.fragment="",n=ut;else if(m!=Fe&&(n=et,m!="/"))continue;break;case et:if(m==Fe||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(WF(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&ti(i.path,"")):jF(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&ti(i.path,""):(i.scheme=="file"&&!i.path.length&&rs(a)&&(i.host&&(i.host=""),a=Ae(a,0)+":"),ti(i.path,a)),a="",i.scheme=="file"&&(m==Fe||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)FF(i.path);m=="?"?(i.query="",n=mr):m=="#"&&(i.fragment="",n=ut)}else a+=xt(m,Sv);break;case hv:m=="?"?(i.query="",n=mr):m=="#"?(i.fragment="",n=ut):m!=Fe&&(i.path[0]+=xt(m,Ja));break;case mr:!e&&m=="#"?(i.fragment="",n=ut):m!=Fe&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=xt(m,Ja));break;case ut:m!=Fe&&(i.fragment+=xt(m,kv));break}o++}},parseHost:function(r){var e,t,i;if(Ae(r,0)=="["){if(Ae(r,r.length-1)!="]"||(e=HF(is(r,1,-1)),!e))return cr;this.host=e}else if(this.isSpecial()){if(r=yF(r),ze(UF,r)||(e=_F(r),e===null))return cr;this.host=e}else{if(ze(DF,r))return cr;for(e="",t=Yr(r),i=0;i<t.length;i++)e+=xt(t[i],Ja);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return ec(Ga,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!rs(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,n=r.host,o=r.port,a=r.path,c=r.query,p=r.fragment,g=e+":";return n!==null?(g+="//",r.includesCredentials()&&(g+=t+(i?":"+i:"")+"@"),g+=es(n),o!==null&&(g+=":"+o)):e=="file"&&(g+="//"),g+=r.cannotBeABaseURL?a[0]:a.length?"/"+ts(a,"/"):"",c!==null&&(g+="?"+c),p!==null&&(g+="#"+p),g},setHref:function(r){var e=this.parse(r);if(e)throw tc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new ri(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+es(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(ct(r)+":",Gu)},getUsername:function(){return this.username},setUsername:function(r){var e=Yr(ct(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=xt(e[t],Wu)}},getPassword:function(){return this.password},setPassword:function(r){var e=Yr(ct(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=xt(e[t],Wu)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?es(r):es(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Ju)},getHostname:function(){var r=this.host;return r===null?"":es(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,$u)},getPort:function(){var r=this.port;return r===null?"":ct(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=ct(r),r==""?this.port=null:this.parse(r,Ku))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+ts(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,ei))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=ct(r),r==""?this.query=null:(Ae(r,0)=="?"&&(r=is(r,1)),this.query="",this.parse(r,mr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=ct(r),r==""){this.fragment=null;return}Ae(r,0)=="#"&&(r=is(r,1)),this.fragment="",this.parse(r,ut)},update:function(){this.query=this.searchParams.serialize()||null}};var ri=function(e){var t=fF(this,ne),i=kF(arguments.length,1)>1?arguments[1]:void 0,n=SF(t,new oc(e,!1,i));ic||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ne=ri.prototype,Te=function(r,e){return{get:function(){return Ka(this)[r]()},set:e&&function(t){return Ka(this)[e](t)},configurable:!0,enumerable:!0}};ic&&(xe(ne,"href",Te("serialize","setHref")),xe(ne,"origin",Te("getOrigin")),xe(ne,"protocol",Te("getProtocol","setProtocol")),xe(ne,"username",Te("getUsername","setUsername")),xe(ne,"password",Te("getPassword","setPassword")),xe(ne,"host",Te("getHost","setHost")),xe(ne,"hostname",Te("getHostname","setHostname")),xe(ne,"port",Te("getPort","setPort")),xe(ne,"pathname",Te("getPathname","setPathname")),xe(ne,"search",Te("getSearch","setSearch")),xe(ne,"searchParams",Te("getSearchParams")),xe(ne,"hash",Te("getHash","setHash")));$a(ne,"toJSON",function(){return Ka(this).serialize()},{enumerable:!0});$a(ne,"toString",function(){return Ka(this).serialize()},{enumerable:!0});Yn&&(Qu=Yn.createObjectURL,Yu=Yn.revokeObjectURL,Qu&&$a(ri,"createObjectURL",nv(Qu,Yn)),Yu&&$a(ri,"revokeObjectURL",nv(Yu,Yn)));var Qu,Yu;bF(ri,"URL");gF({global:!0,constructor:!0,forced:!hF,sham:!ic},{URL:ri})});var Cv=h(()=>{Pv()});var wv=h(()=>{"use strict";var GF=Wn(),VF=je();GF({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return VF(URL.prototype.toString,this)}})});var Iv=h(()=>{qu()});var Fv=h((vM,xv)=>{var zF=he();xv.exports=zF});var Av=h((yM,Tv)=>{Cv();wv();Iv();var JF=Fv();Tv.exports=JF.URL});var Bc=h((VL,Ny)=>{var aA=Object.prototype.toString;Ny.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return mA(e)?"generatorfunction":"function";if(dA(e))return"array";if(hA(e))return"buffer";if(gA(e))return"arguments";if(uA(e))return"date";if(lA(e))return"error";if(cA(e))return"regexp";switch(Ly(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(pA(e))return"generator";switch(t=aA.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Ly(r){return typeof r.constructor=="function"?r.constructor.name:null}function dA(r){return Array.isArray?Array.isArray(r):r instanceof Array}function lA(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function uA(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function cA(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function mA(r,e){return Ly(r)==="GeneratorFunction"}function pA(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function gA(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function hA(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var qy=h((zL,Hy)=>{"use strict";var _y=Symbol.prototype.valueOf,fA=Bc();function vA(r,e){switch(fA(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return SA(r);case"symbol":return PA(r);case"arraybuffer":return bA(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return kA(r);case"regexp":return yA(r);case"error":return Object.create(r);default:return r}}function yA(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function bA(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function kA(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function SA(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function PA(r){return _y?Object(_y.call(r)):{}}Hy.exports=vA});var Wy=h((JL,jy)=>{"use strict";jy.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var zy=h(($L,Vy)=>{"use strict";var CA=Wy();function Gy(r){return CA(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}Vy.exports=function(e){var t,i;return!(Gy(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,Gy(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var $y=h((KL,Jy)=>{"use strict";var wA=qy(),IA=Bc(),xA=zy();function Mc(r,e){switch(IA(r)){case"object":return FA(r,e);case"array":return TA(r,e);default:return wA(r)}}function FA(r,e){if(typeof e=="function")return e(r);if(e||xA(r)){let t=new r.constructor;for(let i in r)t[i]=Mc(r[i],e);return t}return r}function TA(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=Mc(r[i],e);return t}Jy.exports=Mc});var zc=h((vs,xi)=>{var AA=200,Vc="__lodash_hash_undefined__",Cd=1,ob=2,ab=9007199254740991,fd="[object Arguments]",Nc="[object Array]",EA="[object AsyncFunction]",db="[object Boolean]",lb="[object Date]",ub="[object Error]",cb="[object Function]",RA="[object GeneratorFunction]",vd="[object Map]",mb="[object Number]",OA="[object Null]",Ii="[object Object]",Ky="[object Promise]",BA="[object Proxy]",pb="[object RegExp]",yd="[object Set]",gb="[object String]",MA="[object Symbol]",UA="[object Undefined]",_c="[object WeakMap]",hb="[object ArrayBuffer]",bd="[object DataView]",DA="[object Float32Array]",LA="[object Float64Array]",NA="[object Int8Array]",_A="[object Int16Array]",HA="[object Int32Array]",qA="[object Uint8Array]",jA="[object Uint8ClampedArray]",WA="[object Uint16Array]",GA="[object Uint32Array]",VA=/[\\^$.*+?()[\]{}|]/g,zA=/^\[object .+?Constructor\]$/,JA=/^(?:0|[1-9]\d*)$/,W={};W[DA]=W[LA]=W[NA]=W[_A]=W[HA]=W[qA]=W[jA]=W[WA]=W[GA]=!0;W[fd]=W[Nc]=W[hb]=W[db]=W[bd]=W[lb]=W[ub]=W[cb]=W[vd]=W[mb]=W[Ii]=W[pb]=W[yd]=W[gb]=W[_c]=!1;var fb=typeof global=="object"&&global&&global.Object===Object&&global,$A=typeof self=="object"&&self&&self.Object===Object&&self,ht=fb||$A||Function("return this")(),vb=typeof vs=="object"&&vs&&!vs.nodeType&&vs,Xy=vb&&typeof xi=="object"&&xi&&!xi.nodeType&&xi,yb=Xy&&Xy.exports===vb,Uc=yb&&fb.process,Zy=function(){try{return Uc&&Uc.binding&&Uc.binding("util")}catch{}}(),Qy=Zy&&Zy.isTypedArray;function KA(r,e){for(var t=-1,i=r==null?0:r.length,n=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[n++]=a)}return o}function XA(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function ZA(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function QA(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function YA(r){return function(e){return r(e)}}function eE(r,e){return r.has(e)}function tE(r,e){return r?.[e]}function rE(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function iE(r,e){return function(t){return r(e(t))}}function nE(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var sE=Array.prototype,oE=Function.prototype,wd=Object.prototype,Dc=ht["__core-js_shared__"],bb=oE.toString,rt=wd.hasOwnProperty,Yy=function(){var r=/[^.]+$/.exec(Dc&&Dc.keys&&Dc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),kb=wd.toString,aE=RegExp("^"+bb.call(rt).replace(VA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eb=yb?ht.Buffer:void 0,kd=ht.Symbol,tb=ht.Uint8Array,Sb=wd.propertyIsEnumerable,dE=sE.splice,br=kd?kd.toStringTag:void 0,rb=Object.getOwnPropertySymbols,lE=eb?eb.isBuffer:void 0,uE=iE(Object.keys,Object),Hc=Fi(ht,"DataView"),ys=Fi(ht,"Map"),qc=Fi(ht,"Promise"),jc=Fi(ht,"Set"),Wc=Fi(ht,"WeakMap"),bs=Fi(Object,"create"),cE=Pr(Hc),mE=Pr(ys),pE=Pr(qc),gE=Pr(jc),hE=Pr(Wc),ib=kd?kd.prototype:void 0,Lc=ib?ib.valueOf:void 0;function kr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function fE(){this.__data__=bs?bs(null):{},this.size=0}function vE(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function yE(r){var e=this.__data__;if(bs){var t=e[r];return t===Vc?void 0:t}return rt.call(e,r)?e[r]:void 0}function bE(r){var e=this.__data__;return bs?e[r]!==void 0:rt.call(e,r)}function kE(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=bs&&e===void 0?Vc:e,this}kr.prototype.clear=fE;kr.prototype.delete=vE;kr.prototype.get=yE;kr.prototype.has=bE;kr.prototype.set=kE;function ft(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function SE(){this.__data__=[],this.size=0}function PE(r){var e=this.__data__,t=Id(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():dE.call(e,t,1),--this.size,!0}function CE(r){var e=this.__data__,t=Id(e,r);return t<0?void 0:e[t][1]}function wE(r){return Id(this.__data__,r)>-1}function IE(r,e){var t=this.__data__,i=Id(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ft.prototype.clear=SE;ft.prototype.delete=PE;ft.prototype.get=CE;ft.prototype.has=wE;ft.prototype.set=IE;function Sr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function xE(){this.size=0,this.__data__={hash:new kr,map:new(ys||ft),string:new kr}}function FE(r){var e=xd(this,r).delete(r);return this.size-=e?1:0,e}function TE(r){return xd(this,r).get(r)}function AE(r){return xd(this,r).has(r)}function EE(r,e){var t=xd(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}Sr.prototype.clear=xE;Sr.prototype.delete=FE;Sr.prototype.get=TE;Sr.prototype.has=AE;Sr.prototype.set=EE;function Sd(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Sr;++e<t;)this.add(r[e])}function RE(r){return this.__data__.set(r,Vc),this}function OE(r){return this.__data__.has(r)}Sd.prototype.add=Sd.prototype.push=RE;Sd.prototype.has=OE;function Lt(r){var e=this.__data__=new ft(r);this.size=e.size}function BE(){this.__data__=new ft,this.size=0}function ME(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function UE(r){return this.__data__.get(r)}function DE(r){return this.__data__.has(r)}function LE(r,e){var t=this.__data__;if(t instanceof ft){var i=t.__data__;if(!ys||i.length<AA-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new Sr(i)}return t.set(r,e),this.size=t.size,this}Lt.prototype.clear=BE;Lt.prototype.delete=ME;Lt.prototype.get=UE;Lt.prototype.has=DE;Lt.prototype.set=LE;function NE(r,e){var t=Pd(r),i=!t&&YE(r),n=!t&&!i&&Gc(r),o=!t&&!i&&!n&&Tb(r),a=t||i||n||o,c=a?QA(r.length,String):[],p=c.length;for(var g in r)(e||rt.call(r,g))&&!(a&&(g=="length"||n&&(g=="offset"||g=="parent")||o&&(g=="buffer"||g=="byteLength"||g=="byteOffset")||$E(g,p)))&&c.push(g);return c}function Id(r,e){for(var t=r.length;t--;)if(wb(r[t][0],e))return t;return-1}function _E(r,e,t){var i=e(r);return Pd(r)?i:XA(i,t(r))}function Ss(r){return r==null?r===void 0?UA:OA:br&&br in Object(r)?zE(r):QE(r)}function nb(r){return ks(r)&&Ss(r)==fd}function Pb(r,e,t,i,n){return r===e?!0:r==null||e==null||!ks(r)&&!ks(e)?r!==r&&e!==e:HE(r,e,t,i,Pb,n)}function HE(r,e,t,i,n,o){var a=Pd(r),c=Pd(e),p=a?Nc:Dt(r),g=c?Nc:Dt(e);p=p==fd?Ii:p,g=g==fd?Ii:g;var f=p==Ii,m=g==Ii,b=p==g;if(b&&Gc(r)){if(!Gc(e))return!1;a=!0,f=!1}if(b&&!f)return o||(o=new Lt),a||Tb(r)?Cb(r,e,t,i,n,o):GE(r,e,p,t,i,n,o);if(!(t&Cd)){var v=f&&rt.call(r,"__wrapped__"),P=m&&rt.call(e,"__wrapped__");if(v||P){var C=v?r.value():r,F=P?e.value():e;return o||(o=new Lt),n(C,F,t,i,o)}}return b?(o||(o=new Lt),VE(r,e,t,i,n,o)):!1}function qE(r){if(!Fb(r)||XE(r))return!1;var e=Ib(r)?aE:zA;return e.test(Pr(r))}function jE(r){return ks(r)&&xb(r.length)&&!!W[Ss(r)]}function WE(r){if(!ZE(r))return uE(r);var e=[];for(var t in Object(r))rt.call(r,t)&&t!="constructor"&&e.push(t);return e}function Cb(r,e,t,i,n,o){var a=t&Cd,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var g=o.get(r);if(g&&o.get(e))return g==e;var f=-1,m=!0,b=t&ob?new Sd:void 0;for(o.set(r,e),o.set(e,r);++f<c;){var v=r[f],P=e[f];if(i)var C=a?i(P,v,f,e,r,o):i(v,P,f,r,e,o);if(C!==void 0){if(C)continue;m=!1;break}if(b){if(!ZA(e,function(F,x){if(!eE(b,x)&&(v===F||n(v,F,t,i,o)))return b.push(x)})){m=!1;break}}else if(!(v===P||n(v,P,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function GE(r,e,t,i,n,o,a){switch(t){case bd:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case hb:return!(r.byteLength!=e.byteLength||!o(new tb(r),new tb(e)));case db:case lb:case mb:return wb(+r,+e);case ub:return r.name==e.name&&r.message==e.message;case pb:case gb:return r==e+"";case vd:var c=rE;case yd:var p=i&Cd;if(c||(c=nE),r.size!=e.size&&!p)return!1;var g=a.get(r);if(g)return g==e;i|=ob,a.set(r,e);var f=Cb(c(r),c(e),i,n,o,a);return a.delete(r),f;case MA:if(Lc)return Lc.call(r)==Lc.call(e)}return!1}function VE(r,e,t,i,n,o){var a=t&Cd,c=sb(r),p=c.length,g=sb(e),f=g.length;if(p!=f&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:rt.call(e,b)))return!1}var v=o.get(r);if(v&&o.get(e))return v==e;var P=!0;o.set(r,e),o.set(e,r);for(var C=a;++m<p;){b=c[m];var F=r[b],x=e[b];if(i)var ge=a?i(x,F,b,e,r,o):i(F,x,b,r,e,o);if(!(ge===void 0?F===x||n(F,x,t,i,o):ge)){P=!1;break}C||(C=b=="constructor")}if(P&&!C){var Un=r.constructor,da=e.constructor;Un!=da&&"constructor"in r&&"constructor"in e&&!(typeof Un=="function"&&Un instanceof Un&&typeof da=="function"&&da instanceof da)&&(P=!1)}return o.delete(r),o.delete(e),P}function sb(r){return _E(r,rR,JE)}function xd(r,e){var t=r.__data__;return KE(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Fi(r,e){var t=tE(r,e);return qE(t)?t:void 0}function zE(r){var e=rt.call(r,br),t=r[br];try{r[br]=void 0;var i=!0}catch{}var n=kb.call(r);return i&&(e?r[br]=t:delete r[br]),n}var JE=rb?function(r){return r==null?[]:(r=Object(r),KA(rb(r),function(e){return Sb.call(r,e)}))}:iR,Dt=Ss;(Hc&&Dt(new Hc(new ArrayBuffer(1)))!=bd||ys&&Dt(new ys)!=vd||qc&&Dt(qc.resolve())!=Ky||jc&&Dt(new jc)!=yd||Wc&&Dt(new Wc)!=_c)&&(Dt=function(r){var e=Ss(r),t=e==Ii?r.constructor:void 0,i=t?Pr(t):"";if(i)switch(i){case cE:return bd;case mE:return vd;case pE:return Ky;case gE:return yd;case hE:return _c}return e});function $E(r,e){return e=e??ab,!!e&&(typeof r=="number"||JA.test(r))&&r>-1&&r%1==0&&r<e}function KE(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function XE(r){return!!Yy&&Yy in r}function ZE(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wd;return r===t}function QE(r){return kb.call(r)}function Pr(r){if(r!=null){try{return bb.call(r)}catch{}try{return r+""}catch{}}return""}function wb(r,e){return r===e||r!==r&&e!==e}var YE=nb(function(){return arguments}())?nb:function(r){return ks(r)&&rt.call(r,"callee")&&!Sb.call(r,"callee")},Pd=Array.isArray;function eR(r){return r!=null&&xb(r.length)&&!Ib(r)}var Gc=lE||nR;function tR(r,e){return Pb(r,e)}function Ib(r){if(!Fb(r))return!1;var e=Ss(r);return e==cb||e==RA||e==EA||e==BA}function xb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ab}function Fb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ks(r){return r!=null&&typeof r=="object"}var Tb=Qy?YA(Qy):jE;function rR(r){return eR(r)?NE(r):WE(r)}function iR(){return[]}function nR(){return!1}xi.exports=tR});var hS=h(Vd=>{"use strict";Vd.byteLength=OR;Vd.toByteArray=MR;Vd.fromByteArray=LR;var st=[],_e=[],RR=typeof Uint8Array<"u"?Uint8Array:Array,Cm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Lr=0,pS=Cm.length;Lr<pS;++Lr)st[Lr]=Cm[Lr],_e[Cm.charCodeAt(Lr)]=Lr;var Lr,pS;_e[45]=62;_e[95]=63;function gS(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function OR(r){var e=gS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function BR(r,e,t){return(e+t)*3/4-t}function MR(r){var e,t=gS(r),i=t[0],n=t[1],o=new RR(BR(r,i,n)),a=0,c=n>0?i-4:i,p;for(p=0;p<c;p+=4)e=_e[r.charCodeAt(p)]<<18|_e[r.charCodeAt(p+1)]<<12|_e[r.charCodeAt(p+2)]<<6|_e[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=_e[r.charCodeAt(p)]<<2|_e[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=_e[r.charCodeAt(p)]<<10|_e[r.charCodeAt(p+1)]<<4|_e[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function UR(r){return st[r>>18&63]+st[r>>12&63]+st[r>>6&63]+st[r&63]}function DR(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(UR(i));return n.join("")}function LR(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,c=t-i;a<c;a+=o)n.push(DR(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],n.push(st[e>>2]+st[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(st[e>>10]+st[e>>4&63]+st[e<<2&63]+"=")),n.join("")}});var Sq=Dn(Av(),1);function y(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function pr(r,e){if(!r)throw Error(e)}var se;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(se||(se={}));function Ft(r){return r.startsWith(se.COMMENT)}function Qa(r){return r.startsWith(se.ACCOUNT)}function gr(r){return r.startsWith(se.LINK)}function Ev(r){return r.startsWith(se.MESSAGE)}function Rv(r){return r.startsWith(se.SUBREDDIT)}function Ov(r){return r.startsWith(se.AWARD)}function $F(r){pr(Ft(r),`Expected comment id to start with ${se.COMMENT}, got ${r}}`)}function KF(r){pr(Qa(r),`Expected account id to start with ${se.ACCOUNT}, got ${r}}`)}function XF(r){pr(gr(r),`Expected link id to start with ${se.LINK}, got ${r}}`)}function ZF(r){pr(Ev(r),`Expected message id to start with ${se.MESSAGE}, got ${r}}`)}function QF(r){pr(Rv(r),`Expected subreddit id to start with ${se.SUBREDDIT}, got ${r}}`)}function YF(r){pr(Ov(r),`Expected award id to start with ${se.AWARD}, got ${r}}`)}function ii(r){return $F(r),r}function oe(r){return KF(r),r}function ye(r){return XF(r),r}function eT(r){return ZF(r),r}function ie(r){return QF(r),r}function tT(r){return YF(r),r}function Re(r){if(Ft(r))return ii(r);if(Qa(r))return oe(r);if(gr(r))return ye(r);if(Ev(r))return eT(r);if(Rv(r))return ie(r);if(Ov(r))return tT(r);throw new Error(`Expected thing id to start with ${Object.values(se).join(", ")} got ${r}}`)}function ac(r){return Ft(r)}import*as w from"@devvit/protos";var Ya=class{constructor(e){}};var dc=(t=>(t.Installation="installation",t.App="app",t))(dc||{});function hr(r,e=new Set){for(let t of r){if(t.type==="group"){hr(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}rT(r)}function rT(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var Tt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var TM=["3rd-party","activity","add-emoji","add","add-media","add-to-feed","admin","ads","ai","align-center","align-left","align-right","all","ama","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audience","audio","author","automod","avatar-style","award","back","backup","ban","best","block","blockchain","bold","boost","bot","bounce","brand-awareness","browse","browser","cake","calendar","camera","campaign","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","chat-private","checkbox-dismiss","checkbox","checkmark","chrome","clear","client-list","close","closed-captioning","code-block","code-inline","coins-color-old","coins","collapse-left","collapse-right","collectible-expressions","collection","comment","comments","communities","community","confidence","contest","controversial","conversion","copy-clipboard","crop","crosspost","crowd-control","custom-feed","customize","dashboard","day","delete-column","delete","delete-row","devvit","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","funnel","gif-post","gold","hashtag","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","insert-column-left","insert-column-right","insert-row-above","insert-row-below","internet","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","macro","mark-read","marketplace","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","mute","new","night","no-internet","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","official","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","play","poll-post","popular","posts","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radar","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","recovery-phrase","refresh","removal-reasons","remove","reply","report","reverse","rich-text","right","rising","rotate","rotate-image","rpan","rules","safari","save","save-view","saved","saved-response","search","self","send","settings","severity","share","share-new","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","spreadsheet","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","translation-off","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unstar","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","view-sort","views","volume","wallet","warning","webhook","whale","wiki-ban","wiki","wiki-unban","world","coins-color","powerup-color","powerup-fill-color","share-android","share-ios","video-live-1","video-live-fill-1","video-live","volume-mute","binoculars","caret-updown","planet","telescope"];import{AppSettingsDefinition as vT,GetFieldsResponse as yT}from"@devvit/protos";import{FormFieldType as Oe}from"@devvit/protos";function mt(r){return r.map(e=>{switch(e.type){case"string":return iT(e);case"image":return nT(e);case"paragraph":return sT(e);case"number":return oT(e);case"select":return aT(e);case"boolean":return dT(e);case"group":return lT(e);default:throw new Error("Unknown field type.")}})}function iT(r){return{defaultValue:{fieldType:Oe.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Oe.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret}}function nT(r){return{disabled:r.disabled,fieldId:r.name,fieldType:Oe.IMAGE,helpText:r.helpText,label:r.label,required:r.required}}function sT(r){return{defaultValue:{fieldType:Oe.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Oe.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required}}function oT(r){return{defaultValue:{fieldType:Oe.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Oe.NUMBER,helpText:r.helpText,label:r.label,required:r.required}}function aT(r){return{defaultValue:{fieldType:Oe.SELECTION,selectionValue:{values:r.defaultValue??[]}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Oe.SELECTION,helpText:r.helpText,label:r.label,required:r.required}}function dT(r){return{defaultValue:{fieldType:Oe.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Oe.BOOLEAN,helpText:r.helpText,label:r.label}}function lT(r){return{fieldId:"",fieldType:Oe.GROUP,fieldConfig:{groupConfig:{fields:mt(r.fields)}},label:r.label,helpText:r.helpText}}function M(r,e){u.prototype[r]=e}import{ValidateFormResponse as fT}from"@devvit/protos";import{RealtimeSubscriptionStatus as Mv}from"@devvit/protos";var D=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies"}),Bv;(function(r){r.Blocks="blocks",r.EmitSnapshots="emitSnapshots",r.EmitState="emitState",r.Realtime="realtime",r.Runtime="runtime",r.Surface="surface",r.UseAsync="useAsync",r.Payments="payments",r.Bootstrap="bootstrap",r.WebView="webView"})(Bv||(Bv={}));function Uv(r){function e(t){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[D.App]?.values[0];y(c,"useChannel - app is missing from Context");let p=r.metadata[D.Installation]?.values[0];y(p,"useChannel - installation is missing from Context");async function g(F){let x=o[n].channel;if(o[n].active)if(o[n].connected)await r.realtime.send(x,F);else throw Error(`Failed to send to channel '${x}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${x}`)}function f(){if(!o[n].active){let F=o[n].channel;o[n].active=!0,r.addRealtimeChannel(F)}}function m(){if(o[n].active){let F=o[n].channel;o[n].active=!1,r.removeRealtimeChannel(F)}}function b(F){return async()=>{let x;switch(F.status){case Mv.REALTIME_SUBSCRIBED:o[n].connected=!0,x=t.onSubscribed?.();break;case Mv.REALTIME_UNSUBSCRIBED:o[n].connected=!1,x=t.onUnsubscribed?.();break;default:x=t.onMessage(F.event?.data?.msg);break}await x}}let v={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:Tt.CHANNEL};n in o?v=o[n]:n in a&&(v=a[n]);let P=r.realtimeEvent;r.isInitialRender?v.active=!1:P&&v.active&&P.event.channel===v.channel&&(v.preventCallback||r.runHook(b(P)),r.rerenderIn(0)),o[n]=v,r.currentHookIndex++;let C=0;return v.active&&v.connected?C=2:v.active&&!v.connected?C=1:!v.active&&v.connected?C=3:!v.active&&!v.connected&&(C=4),{subscribe:f,unsubscribe:m,send:g,status:C}}return e}import{FormFieldType as ni}from"@devvit/protos";function lc(r){switch(r.fieldType){case ni.STRING:return r.stringValue;case ni.IMAGE:return r.stringValue;case ni.PARAGRAPH:return r.stringValue;case ni.NUMBER:return r.numberValue;case ni.BOOLEAN:return r.boolValue;case ni.SELECTION:return r.selectionValue?.values??[];default:return}}function At(r){return Object.keys(r).reduce((e,t)=>{let i=lc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function Dv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,g={formKey:p,preventSubmit:!1,type:Tt.FORM};n in a?g=a[n]:n in c&&(g=c[n]),a[n]=g,r.forms.set(p,t);let f=r.formSubmittedEvent;return f&&!g.preventSubmit&&f.formId===p&&r.runHook(async()=>{let m=i(At(f.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function Lv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),g={lastRun:void 0,running:!1,preventCallback:!1,type:Tt.INTERVAL};n in o?g=o[n]:n in a&&(g=a[n]);function f(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,v]of Object.entries(o))if(b!==n.toString()&&v?.type===Tt.INTERVAL&&v?.running)throw new Error("Only one useInterval hook may be running at a time");o[n]={running:!0,lastRun:o[n]?.lastRun??Date.now(),preventCallback:!1,type:Tt.INTERVAL},r.rerenderIn(p)}function m(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&g.running&&(g.preventCallback||(g.lastRun===void 0||g.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,g.lastRun=Date.now()}),r.rerenderIn(p)),g.preventCallback=!1,o[n]=g,r.currentHookIndex++,{start:f,stop:m}}return e}function Nv(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in n)return r.currentHookIndex++,[n[i],a];if(r.isInitialRender||!(i in o)){let c=t instanceof Function?t():t;if(c instanceof Promise)throw(async()=>{n[i]=await c,r.currentHookIndex=0})();n[i]=c}else n[i]=o[i];function a(c){if(r.isRendering)throw new Error("Cannot call setState while rendering.");n[i]=c instanceof Function?c(n[i]):c}return r.currentHookIndex++,[n[i],a]}return e}var pc={now(){return new Date}};function _v(r){return`__autocache__${r}`}function Hv(r){return`__lock__${r}`}var cT=300,mT=1e3,ed=5e3,uc=3,qv=.1,jv=1e3,pT=3e4;function Wv(r){if(r.error)throw new Error(r.error);return r.value}var Et,Rt,Be,si,$,Gv,Vv,zv,cc,Jv,$v,mc,Kv,td=class{constructor(e,t,i=pc){l(this,$);l(this,Et);l(this,Rt,{});l(this,Be);l(this,si);d(this,Et,e),d(this,si,t),d(this,Be,i)}async cache(e,t){d(this,Rt,s(this,si).__cache=s(this,si).__cache??{}),S(this,$,Kv).call(this,t);let i=S(this,$,Gv).call(this,t.key);if(i!==void 0)return i;let n=await S(this,$,mc).call(this,t.key),o=await S(this,$,Vv).call(this,t,n,e);return Wv(o)}};Et=new WeakMap,Rt=new WeakMap,Be=new WeakMap,si=new WeakMap,$=new WeakSet,Gv=function(e){let t=s(this,Rt)[e];if(t){let i=s(this,Be).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<uc&&Math.random()<qv&&t.errorTime+jv<i;if(t?.expires&&t.expires<i&&t.checkedAt+jv<i||n){delete s(this,Rt)[e];return}else return Wv(t)}},Vv=async function(e,t,i){let n=t?.expires,o=n?S(this,$,$v).call(this,n):1;return!t||t?.error&&t.errorCount<uc&&qv>Math.random()||o>Math.random()?S(this,$,zv).call(this,e,t,i):t},zv=async function(e,t,i){let n=Hv(e.key),o=s(this,Be).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,Et).set(n,"1",{expiration:a,nx:!0}))return S(this,$,Jv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Be).now();return S(this,$,cc).call(this,p,e.key,e.ttl)}},cc=async function(e,t,i){let n=Math.min(i,mT),o=await S(this,$,mc).call(this,t);if(o)return o;if(s(this,Be).now().getTime()-e.getTime()>=n)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,cT)),S(this,$,cc).call(this,e,t,i)},Jv=async function(e,t,i,n){let o=s(this,Be).now().getTime()+n;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=s(this,Be).now().getTime(),t.errorCount++}return s(this,Rt)[e]=t,await s(this,Et).set(_v(e),JSON.stringify(t),{expiration:new Date(o+pT)}),t.error&&t.errorCount<uc&&await s(this,Et).del(Hv(e)),t},$v=function(e){let t=s(this,Be).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},mc=async function(e){let t=await s(this,Et).get(_v(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Be).now().getTime(),s(this,Rt)[e]=i,i}},Kv=function(e){e.ttl<ed&&(console.warn(`Cache TTL cannot be less than ${ed} milliseconds! Updating ttl value of ${e.ttl} to ${ed}.`),e.ttl=ed)};function Xv(r,e,t=pc){let i=new td(r,e,t);return i.cache.bind(i)}function Zv(r){new URL(r.slice(0,r.indexOf(",")))}var oi,ai,li,Qv,Yv,di=class{constructor(){l(this,li);l(this,oi,{});l(this,ai,{});d(this,oi,u.assets),d(this,ai,u.webViewAssets)}getURL(e,t){return typeof e=="string"?S(this,li,Qv).call(this,e,t??{webView:!1}):S(this,li,Yv).call(this,e,t??{webView:!1})}};oi=new WeakMap,ai=new WeakMap,li=new WeakSet,Qv=function(e,t){let i=t.webView?s(this,ai)[e]:s(this,oi)[e];if(i)return i;try{return Zv(e),encodeURI(e)}catch{return""}},Yv=function(e,t){let i={},n=[],o=t.webView?s(this,ai):s(this,oi);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{Zv(a),i[a]=encodeURI(a)}catch{n.push(a)}else n=e;if(n.length>0)throw new Error(`The following assets were missing from the assets list: ${n.join(", ")}`);return i};var Ot,ui=class{constructor(e){l(this,Ot);d(this,Ot,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},s(this,Ot));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await u.kvStorePlugin.Put({messages:i},s(this,Ot))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},s(this,Ot))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},s(this,Ot));return e}};Ot=new WeakMap;var ns,ci=class{constructor(e){l(this,ns);d(this,ns,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,s(this,ns));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};ns=new WeakMap;var ss,mi=class{constructor(e){l(this,ss);d(this,ss,e)}async add(e){await u.modLogPlugin.Add(e,s(this,ss))}};ss=new WeakMap;var os,pi=class{constructor(e){l(this,os);d(this,os,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:{msg:t}},s(this,os))}};os=new WeakMap;var k,as,ds,gi=class{constructor(e){l(this,k);l(this,as);l(this,ds);d(this,k,e),d(this,as,new id(e))}get modMail(){return s(this,as)}getSubredditById(e){return be.getById(Re(e),s(this,k))}getSubredditInfoById(e){return ty(e,s(this,k))}getSubredditByName(e){return be.getByName(e,s(this,k))}getSubredditInfoByName(e){return ry(e,s(this,k))}addSubredditRemovalReason(e,t){return be.addRemovalReason(e,t.title,t.message,s(this,k))}getSubredditRemovalReasons(e){return be.getRemovalReasons(e,s(this,k))}getCurrentSubreddit(){return be.getFromMetadata(s(this,k))}getPostById(e){return z.getById(Re(e),s(this,k))}submitPost(e){return z.submit(e,s(this,k))}crosspost(e){return z.crosspost(e,s(this,k))}getUserById(e){return I.getById(Re(e),s(this,k))}getUserByUsername(e){return I.getByUsername(e,s(this,k))}async getCurrentUser(){return s(this,ds)??d(this,ds,I.getFromMetadata(D.User,s(this,k))),s(this,ds)}getAppUser(){return I.getFromMetadata(D.AppUser,s(this,k))}getSnoovatarUrl(e){return I.getSnoovatarUrl(e,s(this,k))}getCommentById(e){return re.getById(Re(e),s(this,k))}getComments(e){return re.getComments(e,s(this,k))}getCommentsByUser(e){return re.getCommentsByUser(e,s(this,k))}submitComment(e){return re.submit({...e,id:Re(e.id)},s(this,k))}getControversialPosts(e){return z.getControversialPosts(e,s(this,k))}getTopPosts(e){return z.getTopPosts(e,s(this,k))}getHotPosts(e){return z.getHotPosts(e,s(this,k))}getNewPosts(e){return z.getNewPosts(e,s(this,k))}getRisingPosts(e){return z.getRisingPosts(e,s(this,k))}getPostsByUser(e){return z.getPostsByUser(e,s(this,k))}getCommentsAndPostsByUser(e){return I.getOverview(e,s(this,k))}getModerationLog(e){return rd(e,s(this,k))}getApprovedUsers(e){return I.getSubredditUsersByType({type:"contributors",...e},s(this,k))}approveUser(e,t){return I.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}removeUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}getWikiContributors(e){return I.getSubredditUsersByType({type:"wikicontributors",...e},s(this,k))}addWikiContributor(e,t){return I.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}removeWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}getBannedUsers(e){return I.getSubredditUsersByType({type:"banned",...e},s(this,k))}banUser(e){return I.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration,banContext:e.context},s(this,k))}unbanUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,k))}getBannedWikiContributors(e){return I.getSubredditUsersByType({type:"wikibanned",...e},s(this,k))}banWikiContributor(e){return I.createRelationship({...e,type:"wikibanned"},s(this,k))}unbanWikiContributor(e,t){return I.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,k))}getModerators(e){return I.getSubredditUsersByType({type:"moderators",...e},s(this,k))}inviteModerator(e){return I.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.username,permissions:e.permissions??[]},s(this,k))}revokeModeratorInvite(e,t){return I.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,k))}removeModerator(e,t){return I.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,k))}setModeratorPermissions(e,t,i){return I.setModeratorPermissions(e,t,i,s(this,k))}getMutedUsers(e){return I.getSubredditUsersByType({type:"muted",...e},s(this,k))}muteUser(e){return I.createRelationship({...e,type:"muted"},s(this,k))}unmuteUser(e,t){return I.removeRelationship({username:e,subredditName:t,type:"muted"},s(this,k))}getModNotes(e){return Me.get(e,s(this,k))}deleteModNote(e){return Me.delete(e,s(this,k))}addModNote(e){let t={...e,redditId:e.redditId?Re(e.redditId):void 0};return Me.add(t,s(this,k))}addRemovalNote(e){return Me.addRemovalNote(e,s(this,k))}async sendPrivateMessage(e){return fr.send(e,s(this,k))}async sendPrivateMessageAsSubreddit(e){return fr.sendAsSubreddit(e,s(this,k))}async approve(e){if(Ft(e))return re.approve(e,s(this,k));if(gr(e))return z.approve(e,s(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(Ft(e))return re.remove(e,t,s(this,k));if(gr(e))return z.remove(e,t,s(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return ue.getPostFlairTemplates(e,s(this,k))}async getUserFlairTemplates(e){return ue.getUserFlairTemplates(e,s(this,k))}async createPostFlairTemplate(e){return ue.createPostFlairTemplate(e,s(this,k))}async createUserFlairTemplate(e){return ue.createUserFlairTemplate(e,s(this,k))}async editFlairTemplate(e){return ue.editFlairTemplate(e,s(this,k))}async deleteFlairTemplate(e,t){return ue.deleteFlairTemplate(e,t,s(this,k))}async setUserFlair(e){return Ue.setUserFlair(e,s(this,k))}async removeUserFlair(e,t){return Ue.removeUserFlair(e,t,s(this,k))}async setPostFlair(e){return Ue.setPostFlair(e,s(this,k))}async removePostFlair(e,t){return Ue.removePostFlair(e,ye(t),s(this,k))}async getWidgets(e){return ae.getWidgets(e,s(this,k))}async deleteWidget(e,t){return ae.delete(e,t,s(this,k))}async addWidget(e){return ae.add(e,s(this,k))}async reorderWidgets(e,t){return ae.reorder(e,t,s(this,k))}async getWikiPage(e,t){return ke.getPage(e,t,s(this,k))}async getWikiPages(e){return ke.getPages(e,s(this,k))}async createWikiPage(e){return ke.createPage(e,s(this,k))}async updateWikiPage(e){return ke.updatePage(e,s(this,k))}getWikiPageRevisions(e){return ke.getPageRevisions(e,s(this,k))}async revertWikiPage(e,t,i){return ke.revertPage(e,t,i,s(this,k))}async getWikiPageSettings(e,t){return ke.getPageSettings(e,t,s(this,k))}async updateWikiPageSettings(e){return ke.updatePageSettings(e,s(this,k))}async addEditorToWikiPage(e,t,i){return ke.addEditor(e,t,i,s(this,k))}async removeEditorFromWikiPage(e,t,i){return ke.removeEditor(e,t,i,s(this,k))}getMessages(e){return fr.getMessages(e,s(this,k))}markAllMessagesAsRead(){return fr.markAllAsRead(s(this,k))}report(e,t){return u.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},s(this,k))}getModQueue(e){return be.aboutLocation({...e,location:"modqueue"},s(this,k))}getReports(e){return be.aboutLocation({...e,location:"reports"},s(this,k))}getSpam(e){return be.aboutLocation({...e,location:"spam"},s(this,k))}getUnmoderated(e){return be.aboutLocation({...e,location:"unmoderated"},s(this,k))}getEdited(e){return be.aboutLocation({...e,location:"edited"},s(this,k))}getVaultByAddress(e){return sy(e,s(this,k))}getVaultByUserId(e){return oy(Re(e),s(this,k))}getSubredditLeaderboard(e){return iy(e,s(this,k))}getSubredditStyles(e){return ny(e,s(this,k))}async subscribeToCurrentSubreddit(){let e=await this.getCurrentSubreddit();await u.redditAPIPlugins.Subreddits.Subscribe({action:"sub",actionSource:"",srName:e.name,sr:"",skipInitialDefaults:!0},s(this,k))}async unsubscribeFromCurrentSubreddit(){let e=await this.getCurrentSubreddit();await u.redditAPIPlugins.Subreddits.Subscribe({action:"unsub",actionSource:"",srName:e.name,sr:"",skipInitialDefaults:!1},s(this,k))}};k=new WeakMap,as=new WeakMap,ds=new WeakMap;import{RedisKeyScope as gc}from"@devvit/protos";function nd(r){return r&&typeof r=="object"&&"message"in r&&r.message!==void 0&&typeof r.message=="string"?r.message.includes("redis: nil"):!1}var R,O,B,hc=class{constructor(e,t,i){l(this,R);l(this,O);l(this,B);d(this,R,e),d(this,O,t),d(this,B,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,O)},s(this,B)),this}async multi(){await s(this,R).Multi(s(this,O),s(this,B))}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),await s(this,R).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:n||0,transactionId:s(this,O)},s(this,B)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,O)},s(this,B)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,O)},s(this,B)),this}async exec(){let e=await s(this,R).Exec(s(this,O),s(this,B)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await s(this,R).Discard(s(this,O),s(this,B))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,O)},s(this,B)),this}async unwatch(){return await s(this,R).Unwatch(s(this,O),s(this,B)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,O)},s(this,B)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,O)},s(this,B)),this}async strlen(e){return this.strLen(e)}async strLen(e){return await s(this,R).Strlen({key:e,transactionId:s(this,O)},s(this,B)),this}async mget(e){return this.mGet(e)}async mGet(e){return await s(this,R).MGet({keys:e,transactionId:s(this,O)},s(this,B)),this}async mset(e){return this.mSet(e)}async mSet(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));return await s(this,R).MSet({kv:t,transactionId:s(this,O)},s(this,B)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,O)},s(this,B)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,O)},s(this,B)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,O)},s(this,B)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,O)},s(this,B)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,O)},member:t},s(this,B)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,O)},member:t},s(this,B)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,O)},s(this,B)),this}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,O)};return await s(this,R).ZScan(o,s(this,B)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,O)},s(this,B)),this}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"&&(o.byScore=!0),await s(this,R).ZRange({key:{key:e,transactionId:s(this,O)},start:t+"",stop:i+"",...o},s(this,B)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,O)},members:t},s(this,B)),this}async zRemRangeByLex(e,t,i){return await s(this,R).ZRemRangeByLex({key:{key:e,transactionId:s(this,O)},min:t,max:i},s(this,B)),this}async zRemRangeByRank(e,t,i){return await s(this,R).ZRemRangeByRank({key:{key:e,transactionId:s(this,O)},start:t,stop:i},s(this,B)),this}async zRemRangeByScore(e,t,i){return await s(this,R).ZRemRangeByScore({key:{key:e,transactionId:s(this,O)},min:t,max:i},s(this,B)),this}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){return await s(this,R).HGetAll({key:e,transactionId:s(this,O)},s(this,B)),this}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){return await s(this,R).HGet({key:e,field:t,transactionId:s(this,O)},s(this,B)),this}async hset(e,t){return this.hSet(e,t)}async hSet(e,t){let i=Object.entries(t).map(([n,o])=>({field:n,value:o}));return await s(this,R).HSet({key:e,fv:i,transactionId:s(this,O)},s(this,B)),this}async hincrby(e,t,i){return this.hIncrBy(e,t,i)}async hIncrBy(e,t,i){return await s(this,R).HIncrBy({key:e,field:t,value:i,transactionId:s(this,O)},s(this,B)),this}async hdel(e,t){return this.hDel(e,t)}async hDel(e,t){return await s(this,R).HDel({key:e,fields:t,transactionId:s(this,O)},s(this,B)),this}async hscan(e,t,i,n){return this.hScan(e,t,i,n)}async hScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,O)};return await s(this,R).HScan(o,s(this,B)),this}async hkeys(e){return this.hKeys(e)}async hKeys(e){return await s(this,R).HKeys({key:e,transactionId:s(this,O)},s(this,B)),this}async hlen(e){return this.hLen(e)}async hLen(e){return await s(this,R).HLen({key:e,transactionId:s(this,O)},s(this,B)),this}};R=new WeakMap,O=new WeakMap,B=new WeakMap;var U,hi,fc=class fc{constructor(e,t=void 0,i=gc.INSTALLATION){l(this,U);l(this,hi);d(this,U,e),d(this,hi,t),this.scope=i,this.global=i===gc.INSTALLATION?new fc(s(this,U),s(this,hi),gc.GLOBAL):this}get storage(){return s(this,hi)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,U));return new hc(this.storage,t,s(this,U))}async get(e){try{let t=await this.storage.Get({key:e,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return t!==null?t.value??void 0:t}catch(t){if(nd(t))return;throw t}}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:n||0,scope:this.scope},s(this,U))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,U))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,U))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,U));return n!==null?n.value:n}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},s(this,U))).value}async strlen(e){return this.strLen(e)}async strLen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,U))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,U))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,U))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,U))).value}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},s(this,U))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,U))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,U))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,U))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,U))).value}async zScore(e,t){try{let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value:i}catch(i){if(nd(i))return;throw i}}async zRank(e,t){try{let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value:i}catch(i){if(nd(i))return;throw i}}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,U));return n!==null?n.value:n}async mget(e){return this.mGet(e)}async mGet(e){let t=await this.storage.MGet({keys:e,scope:this.scope},s(this,U));return t!==null?t.values.map(i=>i||null):t}async mset(e){return this.mSet(e)}async mSet(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));await this.storage.MSet({kv:t,scope:this.scope},s(this,U))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,U));return t!==null?t.value:t}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.ZScan(o,s(this,U))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,U));return t!==null?t.value:t}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){try{let i=await this.storage.HGet({key:e,field:t,scope:this.scope},{...s(this,U),"throw-redis-nil":{values:["true"]}});return i!==null?i.value??void 0:i}catch(i){if(nd(i))return;throw i}}async hset(e,t){return this.hSet(e,t)}async hSet(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},s(this,U))).value}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,U));return t!==null?t.fieldValues:t}async hdel(e,t){return this.hDel(e,t)}async hDel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},s(this,U))).value}async hscan(e,t,i,n){return this.hScan(e,t,i,n)}async hScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.HScan(o,s(this,U))}async hkeys(e){return this.hKeys(e)}async hKeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,U));return t!==null?t.keys:t}async hincrby(e,t,i){return this.hIncrBy(e,t,i)}async hIncrBy(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},s(this,U))).value}async hlen(e){return this.hLen(e)}async hLen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};U=new WeakMap,hi=new WeakMap;var fi=fc;var vr,vi=class{constructor(e){l(this,vr);d(this,vr,e)}async runJob(e){return(await u.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},s(this,vr))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},s(this,vr))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,vr))).actions.map(t=>(y(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};vr=new WeakMap;var ls,yi=class{constructor(e){l(this,ls);d(this,ls,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},s(this,ls));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...ay(t.installationSettings.settings,u.installationSettings),...ay(t.appSettings.settings,u.appSettings)}}};ls=new WeakMap;function ay(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=lc(r[n]),i),{});return e&&dy(t,e),t}function dy(r,e){for(let t of e)t.type==="group"?dy(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as sd,ToastAppearance as ly}from"@devvit/protos";var Bt,bi,us,ad,od=class{constructor(e){l(this,Bt,[]);l(this,bi);l(this,us);l(this,ad,(e,t)=>{s(this,Bt).push({type:sd.EFFECT_WEB_VIEW,webView:{postMessage:{webViewId:e,app:{message:t}}}})});d(this,bi,e),d(this,us,{postMessage:s(this,ad)})}get webView(){return s(this,us)}showForm(e,t){let i=u.formDefinitions.get(e);if(!i&&s(this,bi)){let a=s(this,bi).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let n=i.form instanceof Function?i.form(t??{}):i.form,o={fields:[],id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description};hr(n.fields),o.fields=mt(n.fields),s(this,Bt).push({type:sd.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?ly.SUCCESS:ly.NEUTRAL}:t={text:e},s(this,Bt).push({type:sd.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,Bt).push({type:sd.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,Bt)}};Bt=new WeakMap,bi=new WeakMap,us=new WeakMap,ad=new WeakMap;function De({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new mi(r),o=new ui(r),a=new fi(r),c=Xv(a,i?i.state:{}),p=new gi(r),g=new vi(r),f=new yi(r),m=e?new od(i):void 0,b=new ci(r),v=new di,P=new pi(r),C=t&&i?Nv(i):void 0,F=t&&i?Lv(i):void 0,x=t&&i?Dv(i):void 0,ge=t&&i?Uv(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:g,settings:f,media:b,assets:v,realtime:P,get useForm(){return x??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return C??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return F??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return ge??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!m)throw new Error("ui client is not available");return m}}}var uy={name:"@devvit/public-api",version:"0.11.4-dev",license:"BSD-3-Clause",repository:{type:"git",url:"https://developers.reddit.com/"},type:"module",exports:{".":"./dist/index.js","./package.json":"./package.json","./*":"./dist/*"},main:"./dist/index.js",files:["dist/**"],scripts:{build:"yarn build:icon-types && yarn build:semantic-colors && tsc && cp -af devvit.tsconfig.json dist/ && yarn build:types && yarn build:min && yarn build:unmin","build:icon-types":"make-icons src/types/icons.ts","build:min":"esbuild --bundle --sourcemap=linked --target=es2020 --format=esm --metafile=dist/meta.min.json --outfile=dist/public-api.min.js --external:@devvit/protos --minify src/index.ts","build:semantic-colors":"node scripts/make-semantic-colors.js","build:types":"api-extractor run && sed -ne '/declare global {/,$ p' src/devvit/Devvit.ts >> dist/public-api.d.ts","build:unmin":"esbuild --bundle --sourcemap=inline --target=es2020 --format=iife --metafile=dist/meta.json --outfile=dist/public-api.iife.js --global-name=devvitPublicAPI src/index.ts",clean:"rm -rf .turbo api-extractor coverage dist src/devvit/internals/semanticColors.ts src/types/icons.ts || :",clobber:"yarn clean && rm -rf node_modules",dev:"tsc -w","dev:build":"chokidar ./src --command 'yarn build' --ignore './src/types/icons.ts' --ignore './src/devvit/internals/semanticColors.ts'",lint:"redlint .","lint:fix":"yarn lint --fix",prepublishOnly:"publish-package-json",test:"yarn test:unit && yarn test:types && yarn test:size","test:size":"filesize","test:types":"tsc --noEmit","test:unit":"vitest run","test:unit-with-coverage":"vitest run --coverage"},types:"./dist/index.d.ts",dependencies:{"@devvit/protos":"0.11.4-dev","@devvit/shared-types":"0.11.4-dev","base64-js":"1.5.1","clone-deep":"4.0.1","core-js":"3.27.2","lodash.isequal":"4.5.0"},devDependencies:{"@ampproject/filesize":"4.3.0","@devvit/repo-tools":"0.11.4-dev","@devvit/tsconfig":"0.11.4-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"18.0.1","@types/clone-deep":"4.0.1","@types/core-js":"2.5.6","@types/lodash.isequal":"4.5.6","@vitest/coverage-c8":"0.32.0","chokidar-cli":"3.0.0",esbuild:"0.23.0",eslint:"9.11.1",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"258 KB"}},source:"./src/index.ts"};function ce(r,e,t){let i=r[D.Subreddit]?.values[0];y(i,"subreddit is missing from Context");let n=r[D.SubredditName]?.values[0],o=r[D.AppUser]?.values[0],a=r[D.App]?.values[0],c=r[D.Version]?.values[0],p=r[D.User]?.values[0],g=hT(r);return{get appAccountId(){return y(o,"appAccountId is missing from Context"),o},subredditId:i,subredditName:n,userId:p,postId:e,commentId:t,appName:a,appVersion:c,debug:g,toJSON(){return{appAccountId:o,appName:a,appVersion:c,subredditId:i,subredditName:n,userId:p,postId:e,commentId:t,debug:g}}}}function hT(r){let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},t={};for(let n in e)t[n.toLowerCase()]=n;let i={};for(let n of(r[D.Debug]?.values??[]).join().split(",")){let[o,a]=n.split("=");o&&(o=o.trim(),a=a?.trim(),o.toLowerCase()in t&&(o=t[o.toLowerCase()]),i[o]??(i[o]=a||"true"))}return r[D.Debug]&&console.info(`[api] @devvit/public-api v${uy.version} ${Object.entries(i).map(([n,o])=>`${n}=${o}`).join(" ")}`),{...i,metadata:r}}function cy(r){return r.flatMap(e=>e.type==="group"?cy(e.fields):e)}async function dd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i={success:!0,errors:{}},n=At(r.fieldValues),o=cy(e);return await Promise.all(o.map(async a=>{let c=a.name;if(c&&a.onValidate){let p=n[c],g=a.onValidate,f=Object.assign(De({metadata:t}),ce(t)),m=await g({value:p,isEditing:r.editing},f);m&&(i.success=!1,i.errors[c]=m)}})),fT.fromJSON(i)}async function bT(){if(!u.appSettings)throw new Error("App settings were not defined.");return yT.fromJSON({fields:{fields:mt(u.appSettings)}})}async function kT(r,e){return dd(r,u.appSettings,e)}function my(r){r.provides(vT),M("GetAppSettingsFields",bT),M("ValidateAppForm",kT)}import{CustomPostDefinition as FT,RenderPostResponse as TT}from"@devvit/protos";import{BlockRenderEventType as Ec,EffectType as Fy}from"@devvit/protos";function ki(r){return r.__effects}function py(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as Ac,BlockAvatarBackground as Cy,BlockAvatarFacing as wy,BlockAvatarSize as Mt,BlockBorderWidth as md,BlockButtonAppearance as Ut,BlockButtonSize as Sc,BlockGap as pd,BlockHorizontalAlignment as Pc,BlockIconSize as gd,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as Cc,BlockSpacerSize as hd,BlockStackDirection as wc,BlockTextOutline as Ic,BlockTextOverflow as xc,BlockTextSize as Pi,BlockTextStyle as Fc,BlockTextWeight as Iy,BlockType as tt,BlockVerticalAlignment as Tc}from"@devvit/protos";var vc={"alienblue-100":"#DCE2FB","alienblue-200":"#B8C5FC","alienblue-25":"#F7F8FD","alienblue-300":"#90A9FD","alienblue-400":"#648EFC","alienblue-50":"#EEF0FB","alienblue-500":"#1870F4","alienblue-600":"#115BCA","alienblue-700":"#0A449B","alienblue-75":"#E6E9FB","alienblue-800":"#0A2F6C","alienblue-900":"#0A1A3F","alienblue-950":"#07102B","berrypurple-100":"#F3DAFB","berrypurple-200":"#EAB3FD","berrypurple-25":"#FBF6FD","berrypurple-300":"#DE8BFF","berrypurple-400":"#CF5FFF","berrypurple-50":"#F8EDFC","berrypurple-500":"#BC0EFF","berrypurple-600":"#9B00D4","berrypurple-700":"#7600A3","berrypurple-75":"#F6E4FB","berrypurple-800":"#520472","berrypurple-900":"#300643","berrypurple-950":"#20042A",black:"#000000","black-opacity-0":"#00000000","black-opacity-10":"#00000019","black-opacity-15":"#00000026","black-opacity-20":"#00000033","black-opacity-25":"#0000003F","black-opacity-33":"#00000054","black-opacity-5":"#0000000C","black-opacity-50":"#0000007F","black-opacity-60":"#00000099","black-opacity-67":"#000000AA","black-opacity-80":"#000000CC","black-opacity-90":"#000000E5","brown-100":"#F1DFCF","brown-200":"#E9BE95","brown-25":"#FBF7F4","brown-300":"#DC9D5D","brown-400":"#BA854E","brown-50":"#F7EFE9","brown-500":"#9A6D3F","brown-600":"#7B5631","brown-700":"#5D4023","brown-75":"#F4E7DC","brown-800":"#3F2C19","brown-900":"#221A11","brown-950":"#15100A","coolgray-100":"#DBE4E9","coolgray-150":"#C9D7DE","coolgray-200":"#B7CAD4","coolgray-25":"#F6F8F9","coolgray-250":"#A4BDCA","coolgray-300":"#97AFBC","coolgray-350":"#8BA2AD","coolgray-400":"#7F949F","coolgray-450":"#748791","coolgray-50":"#EEF1F3","coolgray-500":"#667780","coolgray-525":"#576F76","coolgray-550":"#5C6C74","coolgray-600":"#536168","coolgray-650":"#48545B","coolgray-700":"#3D494E","coolgray-75":"#E5EBEE","coolgray-750":"#333D42","coolgray-800":"#2A3236","coolgray-850":"#21272A","coolgray-900":"#181C1F","coolgray-950":"#0E1113","global-black":{light:"#000000",dark:"#000000"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-white":{light:"#FFFFFF",dark:"#FFFFFF"},"kiwigreen-100":"#A8F5A0","kiwigreen-200":"#58E15B","kiwigreen-25":"#EBFDE7","kiwigreen-300":"#00C61C","kiwigreen-400":"#01A816","kiwigreen-50":"#DDF8D7","kiwigreen-500":"#008A10","kiwigreen-600":"#016E0B","kiwigreen-700":"#005306","kiwigreen-75":"#CAF5C2","kiwigreen-800":"#033902","kiwigreen-900":"#0D2005","kiwigreen-950":"#081404","lightblue-100":"#CAE7FB","lightblue-200":"#87D0FD","lightblue-25":"#F3F9FD","lightblue-300":"#02B9FB","lightblue-400":"#029DD5","lightblue-50":"#E6F3FC","lightblue-500":"#007FAE","lightblue-600":"#01668D","lightblue-700":"#014D6B","lightblue-75":"#D9EDFB","lightblue-800":"#03354B","lightblue-900":"#051E2B","lightblue-950":"#04131A","lime-100":"#B7F28E","lime-200":"#90DA58","lime-25":"#EEFDDC","lime-300":"#6DBF01","lime-400":"#5BA200","lime-50":"#E0F8C8","lime-500":"#4A8500","lime-600":"#3A6A00","lime-700":"#2A5000","lime-75":"#CEF5AD","lime-800":"#1E3702","lime-900":"#151E05","lime-950":"#0D1304","mintgreen-100":"#9BF5D9","mintgreen-200":"#00E2B7","mintgreen-25":"#E7FDF5","mintgreen-300":"#00C29D","mintgreen-400":"#01A484","mintgreen-50":"#D7F8EC","mintgreen-500":"#01876D","mintgreen-600":"#006C56","mintgreen-700":"#015140","mintgreen-75":"#C0F5E3","mintgreen-800":"#00382B","mintgreen-900":"#032019","mintgreen-950":"#03140F","orangered-100":"#FCDBCF","orangered-200":"#FDB498","orangered-25":"#FDF6F4","orangered-300":"#FF895D","orangered-400":"#FF4500","orangered-50":"#FCEEE8","orangered-500":"#D93900","orangered-600":"#AE2C00","orangered-700":"#842100","orangered-75":"#FBE5DC","orangered-800":"#591B02","orangered-900":"#2F1405","orangered-950":"#1C0D04","periwinkle-100":"#E6DFFB","periwinkle-200":"#CDBEFD","periwinkle-25":"#F9F7FD","periwinkle-300":"#B29FFF","periwinkle-400":"#9580FF","periwinkle-50":"#F2EFFC","periwinkle-500":"#6A5CFF","periwinkle-600":"#523DFF","periwinkle-700":"#4001EA","periwinkle-75":"#ECE7FB","periwinkle-800":"#250AA6","periwinkle-900":"#160E5B","periwinkle-950":"#0C083F","poopbrown-100":"#FEEEDD","poopbrown-200":"#F6DDC3","poopbrown-300":"#EECCAA","poopbrown-400":"#CAA075","poopbrown-50":"#FEF7EE","poopbrown-500":"#9A6D3F","poopbrown-600":"#6E4924","poopbrown-700":"#54371A","poopbrown-800":"#3B2510","poopbrown-900":"#29190A","poopbrown-950":"#110B04","puregray-100":"#F2F2F2","puregray-150":"#EBEBEB","puregray-200":"#E4E4E4","puregray-250":"#DDDDDD","puregray-300":"#D6D6D6","puregray-350":"#C3C3C3","puregray-400":"#ACACAC","puregray-450":"#919191","puregray-50":"#F8F8F8","puregray-500":"#767676","puregray-550":"#5C5C5C","puregray-600":"#434343","puregray-650":"#393939","puregray-700":"#303030","puregray-750":"#272727","puregray-800":"#1E1E1E","puregray-850":"#181818","puregray-900":"#131313","puregray-950":"#080808","red-100":"#FBDBD4","red-200":"#FDB3A4","red-25":"#FDF6F5","red-300":"#FF8773","red-400":"#FF4F40","red-50":"#FCEEEA","red-500":"#EB001F","red-600":"#BC0117","red-700":"#90000F","red-75":"#FBE4DF","red-800":"#650405","red-900":"#340F05","red-950":"#1F0B04","sakurapink-100":"#FBD9EB","sakurapink-200":"#FDAEDA","sakurapink-25":"#FDF6F9","sakurapink-300":"#FF7ECA","sakurapink-400":"#FF38BB","sakurapink-50":"#FCEDF4","sakurapink-500":"#DE019F","sakurapink-600":"#B2007F","sakurapink-700":"#880060","sakurapink-75":"#FBE3EF","sakurapink-800":"#5F0443","sakurapink-900":"#380626","sakurapink-950":"#250419",transparent:"transparent",white:"#ffffff","white-opacity-0":"#FFFFFF00","white-opacity-10":"#FFFFFF19","white-opacity-15":"#FFFFFF26","white-opacity-20":"#FFFFFF33","white-opacity-25":"#FFFFFF3F","white-opacity-5":"#FFFFFF0C","white-opacity-50":"#FFFFFF7F","yellow-100":"#FFE284","yellow-200":"#FFBF0B","yellow-25":"#FFF9E0","yellow-300":"#D8A100","yellow-400":"#B78800","yellow-50":"#FFF3C0","yellow-500":"#977000","yellow-600":"#785800","yellow-700":"#5B4200","yellow-75":"#FFEAA2","yellow-800":"#3F2D00","yellow-900":"#231A03","yellow-950":"#161003","yelloworange-100":"#FCDCC8","yelloworange-200":"#FDB586","yelloworange-25":"#FDF7F3","yelloworange-300":"#FF8A35","yelloworange-400":"#E46C00","yelloworange-50":"#FCEEE6","yelloworange-500":"#BD5800","yelloworange-600":"#974500","yelloworange-700":"#733300","yelloworange-75":"#FBE5D7","yelloworange-800":"#4E2402","yelloworange-900":"#2A1705","yelloworange-950":"#1A0E04","action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"action-upvote":{light:"#D93900",dark:"#D93900"},"ai-background-weaker":{light:"#E7FDF5",dark:"#00382B"},"ai-plain":{light:"#006C56",dark:"#01A484"},"ai-plain-hover":{light:"#015140",dark:"#00C29D"},"alert-caution":{light:"#977000",dark:"#977000"},"avatar-gradient":{light:"",dark:""},"brand-background":{light:"#D93900",dark:"#D93900"},"brand-background-hover":{light:"#AE2C00",dark:"#AE2C00"},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"category-live":{light:"#D93900",dark:"#D93900"},"category-nsfw":{light:"#DE019F",dark:"#DE019F"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"caution-background":{light:"#FFBF0B",dark:"#D8A100"},"caution-background-hover":{light:"#D8A100",dark:"#FFBF0B"},"caution-onBackground":{light:"#000000",dark:"#000000"},"caution-plain":{light:"#785800",dark:"#FFBF0B"},"caution-plain-hover":{light:"#5B4200",dark:"#FFE284"},"danger-background":{light:"#EB001F",dark:"#BC0117"},"danger-background-disabled":{light:"#FDB3A4",dark:"#340F05"},"danger-background-hover":{light:"#BC0117",dark:"#EB001F"},"danger-background-weaker":{light:"#FBDBD4",dark:"#650405"},"danger-content":{light:"#BC0117",dark:"#FF4F40"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"danger-content-hover":{light:"#90000F",dark:"#FF8773"},"danger-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"danger-plain":{light:"#BC0117",dark:"#FF8773"},"danger-plain-hover":{light:"#90000F",dark:"#FDB3A4"},"downvote-background":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-background-disabled":{light:"#6a5cff4d",dark:"#6a5cff4d"},"downvote-background-hover":{light:"#523DFF",dark:"#523DFF"},"downvote-content":{light:"#523DFF",dark:"#9580FF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#523DFF4c",dark:"#9580FF4c"},"downvote-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"downvote-onStrongScrim":{light:"#B29FFF",dark:"#B29FFF"},"downvote-onStrongScrim-disabled":{light:"#b29fff4d",dark:"#b29fff4d"},"downvote-onStrongScrim-weaker":{light:"#9580FF",dark:"#9580FF"},"downvote-plain":{light:"#523DFF",dark:"#9580FF"},"downvote-plain-disabled":{light:"#523dff4d",dark:"#9580ff4d"},"downvote-plain-weaker":{light:"#6A5CFF",dark:"#6A5CFF"},"elevation-large1":{light:"#0000003F",dark:"#0000007F"},"elevation-large2":{light:"#00000026",dark:"#00000033"},"elevation-medium1":{light:"#0000003F",dark:"#0000007F"},"elevation-medium2":{light:"#00000019",dark:"#00000033"},"elevation-small":{light:"#00000026",dark:"#00000054"},"elevation-xsmall":{light:"#0000003F",dark:"#000000AA"},favorite:{light:"#977000",dark:"#B78800"},"global-admin":{light:"#D93900",dark:"#D93900"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#2A3236",dark:"#2A3236"},"global-focus":{light:"#029DD5",dark:"#007FAE"},"global-gold":{light:"#B78800",dark:"#D8A100"},"global-moderator":{light:"#008A10",dark:"#008A10"},"global-nsfw":{light:"#DE019F",dark:"#DE019F"},"global-offline":{light:"#667780",dark:"#667780"},"global-online":{light:"#00C61C",dark:"#00C61C"},"global-orangered":{light:"#FF4500",dark:"#FF4500"},"global-stars":{light:"#977000",dark:"#D8A100"},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"identity-admin":{light:"#D93900",dark:"#D93900"},"identity-coins":{light:"#B78800",dark:"#B78800"},"identity-moderator":{light:"#008A10",dark:"#008A10"},"identity-self":{light:"#01876D",dark:"#01876D"},"interactive-background-disabled":{light:"#0000000C",dark:"#FFFFFF0C"},"interactive-content-disabled":{light:"#0000003F",dark:"#FFFFFF3F"},"interactive-focused":{light:"#007FAE",dark:"#007FAE"},"interactive-pressed":{light:"#00000026",dark:"#FFFFFF26"},"inverted-interactive-background-disabled":{light:"#FFFFFF0C",dark:"#0000000C"},"inverted-interactive-content-disabled":{light:"#FFFFFF3F",dark:"#0000003F"},"inverted-interactive-pressed":{light:"#FFFFFF26",dark:"#00000026"},"inverted-neutral-background":{light:"#0E1113",dark:"#FFFFFF"},"inverted-neutral-background-hover":{light:"#181C1F",dark:"#F6F8F9"},"inverted-neutral-border":{light:"#FFFFFF33",dark:"#00000033"},"inverted-neutral-content":{light:"#B7CAD4",dark:"#333D42"},"inverted-neutral-content-strong":{light:"#EEF1F3",dark:"#181C1F"},"inverted-secondary-background":{light:"#2A3236",dark:"#E5EBEE"},"inverted-secondary-background-hover":{light:"#333D42",dark:"#DBE4E9"},"inverted-secondary-background-selected":{light:"#3D494E",dark:"#C9D7DE"},"inverted-secondary-onBackground":{light:"#FFFFFF",dark:"#000000"},"inverted-secondary-plain":{light:"#DBE4E9",dark:"#181C1F"},"inverted-secondary-plain-hover":{light:"#FFFFFF",dark:"#000000"},"media-background":{light:"#00000099",dark:"#00000099"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"media-border-selected":{light:"#FFFFFF",dark:"#FFFFFF"},"media-border-weak":{light:"#FFFFFF19",dark:"#FFFFFF19"},"media-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"media-onBackground-disabled":{light:"#FFFFFF3F",dark:"#FFFFFF3F"},"media-onBackground-weak":{light:"#E5EBEE",dark:"#E5EBEE"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-onbackground-weak":{light:"#B7CAD4",dark:"#B7CAD4"},"neutral-background":{light:"#FFFFFF",dark:"#0E1113"},"neutral-background-container":{light:"#F6F8F9",dark:"#181C1F"},"neutral-background-container-hover":{light:"#EEF1F3",dark:"#21272A"},"neutral-background-container-strong":{light:"#EEF1F3",dark:"#21272A"},"neutral-background-container-strong-hover":{light:"#E5EBEE",dark:"#2A3236"},"neutral-background-gilded":{light:"#FFF9E0",dark:"#181C1F"},"neutral-background-gilded-hover":{light:"#FFF3C0",dark:"#21272A"},"neutral-background-hover":{light:"#F6F8F9",dark:"#181C1F"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-pinned":{light:"#FFFFFF",dark:"#0E1113"},"neutral-background-selected":{light:"#E5EBEE",dark:"#2A3236"},"neutral-background-strong":{light:"#FFFFFF",dark:"#181C1F"},"neutral-background-strong-hover":{light:"#F6F8F9",dark:"#21272A"},"neutral-background-weak":{light:"#F6F8F9",dark:"#000000"},"neutral-background-weak-hover":{light:"#EEF1F3",dark:"#0E1113"},"neutral-border":{light:"#00000033",dark:"#FFFFFF33"},"neutral-border-medium":{light:"#0000007F",dark:"#FFFFFF7F"},"neutral-border-strong":{light:"#181C1F",dark:"#F6F8F9"},"neutral-border-weak":{light:"#00000019",dark:"#FFFFFF19"},"neutral-content":{light:"#333D42",dark:"#B7CAD4"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-strong":{light:"#181C1F",dark:"#EEF1F3"},"neutral-content-weak":{light:"#5C6C74",dark:"#8BA2AD"},offline:{light:"#767676",dark:"#767676"},online:{light:"#01A816",dark:"#01A816"},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},"opacity-highlight":{light:"",dark:""},pizzaRed:{light:"#ef5350",dark:"#c62828"},primary:{light:"#115BCA",dark:"#648EFC"},"primary-background":{light:"#0A449B",dark:"#115BCA"},"primary-background-hover":{light:"#0A2F6C",dark:"#1870F4"},"primary-background-selected":{light:"#0A1A3F",dark:"#648EFC"},"primary-border":{light:"#0A449B",dark:"#648EFC"},"primary-border-hover":{light:"#0A2F6C",dark:"#90A9FD"},"primary-hover":{light:"#0A449B",dark:"#90A9FD"},"primary-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"primary-onBackground-selected":{light:"#FFFFFF",dark:"#000000"},"primary-plain":{light:"#0A449B",dark:"#648EFC"},"primary-plain-hover":{light:"#0A2F6C",dark:"#90A9FD"},"primary-plain-visited":{light:"#7600A3",dark:"#CF5FFF"},"primary-visited":{light:"#9B00D4",dark:"#CF5FFF"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-background":{light:"#00000099",dark:"#00000099"},"scrim-background-strong":{light:"#000000CC",dark:"#000000CC"},"scrim-gradient":{light:"",dark:""},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},secondary:{light:"#21272A",dark:"#DBE4E9"},"secondary-background":{light:"#E5EBEE",dark:"#2A3236"},"secondary-background-hover":{light:"#DBE4E9",dark:"#333D42"},"secondary-background-selected":{light:"#C9D7DE",dark:"#3D494E"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-onBackground":{light:"#000000",dark:"#FFFFFF"},"secondary-plain":{light:"#181C1F",dark:"#DBE4E9"},"secondary-plain-hover":{light:"#000000",dark:"#FFFFFF"},"secondary-plain-weak":{light:"#5C6C74",dark:"#8BA2AD"},"secondary-weak":{light:"#576F76",dark:"#748791"},"success-background":{light:"#008A10",dark:"#016E0B"},"success-background-hover":{light:"#016E0B",dark:"#008A10"},"success-content":{light:"#016E0B",dark:"#01A816"},"success-hover":{light:"#005306",dark:"#00C61C"},"success-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"success-plain":{light:"#016E0B",dark:"#00C61C"},"success-plain-hover":{light:"#005306",dark:"#58E15B"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"transparent-background-hover":{light:"#74879119",dark:"#66778019"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#FFFFFF",dark:"#181C1F"},"upvote-background":{light:"#D93900",dark:"#D93900"},"upvote-background-disabled":{light:"#d939004d",dark:"#d939004d"},"upvote-background-hover":{light:"#AE2C00",dark:"#AE2C00"},"upvote-content":{light:"#AE2C00",dark:"#FF4500"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#AE2C004c",dark:"#FF45004c"},"upvote-onBackground":{light:"#FFFFFF",dark:"#FFFFFF"},"upvote-onStrongScrim":{light:"#FF895D",dark:"#FF895D"},"upvote-onStrongScrim-disabled":{light:"#ff895d4d",dark:"#ff895d4d"},"upvote-onStrongScrim-weaker":{light:"#FF4500",dark:"#FF4500"},"upvote-plain":{light:"#AE2C00",dark:"#FF895D"},"upvote-plain-disabled":{light:"#ae2c004d",dark:"#ff895d4d"},"upvote-plain-weaker":{light:"#FF4500",dark:"#FF4500"},"warning-background":{light:"#B78800",dark:"#B78800"},"warning-background-hover":{light:"#977000",dark:"#D8A100"},"warning-content":{light:"#785800",dark:"#B78800"},"warning-content-hover":{light:"#5B4200",dark:"#D8A100"},"warning-onBackground":{light:"#000000",dark:"#000000"}};var gy={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},hy=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),fy=r=>r in vc,yc=r=>r in gy,vy=r=>!!r.match(/^rgba?\(.*/),yy=r=>!!r.match(/^hsla?\(.*/),by=(r,e="light")=>{if(yc(r))return ld(r);let i=vc[r];return typeof i=="string"?i:i[e]},ld=r=>gy[r]??r,ky=r=>{let[e,t,i,n]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(n){let p=parseFloat(n),g=Math.round(p*255);a.push(g)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as ud}from"@devvit/protos";var bc={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:ud.UNRECOGNIZED,alignment:void 0}};function Py(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:n}=ST(r?.grow,e.direction,e.alignment),o=t?.height?.value?.value||t?.height?.min?.value||Sy(2,i,n,e.hasHeight),a=t?.width?.value?.value||t?.width?.min?.value||Sy(1,i,n,e.hasWidth);return{hasHeight:!!o,hasWidth:!!a}}function Sy(r,e,t,i){return e===r&&i||t===r&&i}function ST(r,e,t){let i=e===ud.STACK_VERTICAL||e===ud.UNRECOGNIZED,n=e===ud.STACK_HORIZONTAL,o=0;n&&r?o=1:i&&r&&(o=2);let a=t===void 0||t.horizontal===void 0,c=t===void 0||t.vertical===void 0,p=n?!!c:i?!!a:!1,g=0;return n&&p?g=2:i&&p&&(g=1),{growDirection:o,stretchDirection:g}}import{BlockSizeUnit as yr,BlockStackDirection as cd}from"@devvit/protos";function Si(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:yr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=yr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=yr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function PT(r,e){return(r.width?.value?.unit===yr.SIZE_UNIT_PERCENT||r.width?.min?.unit===yr.SIZE_UNIT_PERCENT)&&(e.direction===cd.STACK_HORIZONTAL||e.direction===cd.STACK_DEPTH)&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===yr.SIZE_UNIT_PERCENT||r.height?.min?.unit===yr.SIZE_UNIT_PERCENT)&&(e.direction===cd.STACK_VERTICAL||e.direction===cd.STACK_DEPTH)&&(e.hasHeight||(r.height=void 0)),r}function kc(r,e){if(r){let t=r.width!=null||r.minWidth!=null||r.maxWidth!=null,i=r.height!=null||r.minHeight!=null||r.maxHeight!=null;if(t||i||r.grow!=null){let n={width:t?{value:Si(r.width),min:Si(r.minWidth),max:Si(r.maxWidth)}:void 0,height:i?{value:Si(r.height),min:Si(r.minHeight),max:Si(r.maxHeight)}:void 0,grow:r.grow};return e.stackParentLayout&&(n=PT(n,e.stackParentLayout)),n}}}var xy="data-",CT=new Set(["onPress","onMessage"]),wT=new Map([["onPress",Ac.ACTION_CLICK],["onMessage",Ac.ACTION_WEBVIEW]]),gs,Ci=class{constructor(e=()=>{}){l(this,gs);d(this,gs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let n=this.createBlocksElement({type:e,props:t,children:i},bc);if(!n)throw new Error(`Could not create block of type ${e}`);return n}createBlocksElement({type:e,props:t,children:i},n){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,n,...i);case"vstack":return this.makeVStack(t,n,...i);case"zstack":return this.makeZStack(t,n,...i);case"text":return this.makeText(t,n,...i);case"button":return this.makeButton(t,n,...i);case"image":return this.makeImage(t,n);case"spacer":return this.makeSpacer(t,n);case"icon":return this.makeIcon(t,n);case"avatar":return this.makeAvatar(t,n);case"webview":return this.makeWebView(t,n);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ms.PADDING_NONE;case"xsmall":return ms.PADDING_XSMALL;case"small":return ms.PADDING_SMALL;case"medium":return ms.PADDING_MEDIUM;case"large":return ms.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ps.RADIUS_NONE;case"small":return ps.RADIUS_SMALL;case"medium":return ps.RADIUS_MEDIUM;case"large":return ps.RADIUS_LARGE;case"full":return ps.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return pd.GAP_NONE;case"small":return pd.GAP_SMALL;case"medium":return pd.GAP_MEDIUM;case"large":return pd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Tc.ALIGN_TOP:e.includes("middle")?t=Tc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Tc.ALIGN_BOTTOM),e.includes("start")?i=Pc.ALIGN_START:e.includes("center")?i=Pc.ALIGN_CENTER:e.includes("end")&&(i=Pc.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,n){if(!e&&!t)return;let o;switch(e){case"none":o=md.BORDER_WIDTH_NONE;break;case"thin":o=md.BORDER_WIDTH_THIN;break;case"thick":o=md.BORDER_WIDTH_THICK;break;default:o=md.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",c=this.getThemedColors(a,i,n);return{width:o,color:c?.light,colors:c}}makeBlockTextSize(e){switch(e){case"xsmall":return Pi.TEXT_SIZE_XSMALL;case"small":return Pi.TEXT_SIZE_SMALL;case"medium":return Pi.TEXT_SIZE_MEDIUM;case"large":return Pi.TEXT_SIZE_LARGE;case"xlarge":return Pi.TEXT_SIZE_XLARGE;case"xxlarge":return Pi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Fc.TEXT_STYLE_BODY;case"metadata":return Fc.TEXT_STYLE_METADATA;case"heading":return Fc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return Ic.TEXT_OUTLINE_NONE;case"thin":return Ic.TEXT_OUTLINE_THIN;case"thick":return Ic.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Iy.TEXT_WEIGHT_REGULAR;case"bold":return Iy.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return xc.TEXT_OVERFLOW_CLIP;case"ellipsis":return xc.TEXT_OVERFLOW_ELLIPSE}return xc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Ut.BUTTON_APPEARANCE_SECONDARY;case"primary":return Ut.BUTTON_APPEARANCE_PRIMARY;case"plain":return Ut.BUTTON_APPEARANCE_PLAIN;case"bordered":return Ut.BUTTON_APPEARANCE_BORDERED;case"media":return Ut.BUTTON_APPEARANCE_MEDIA;case"destructive":return Ut.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Ut.BUTTON_APPEARANCE_CAUTION;case"success":return Ut.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Sc.BUTTON_SIZE_SMALL;case"medium":return Sc.BUTTON_SIZE_MEDIUM;case"large":return Sc.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return cs.IMAGE_RESIZE_NONE;case"fit":return cs.IMAGE_RESIZE_FIT;case"fill":return cs.IMAGE_RESIZE_FILL;case"cover":return cs.IMAGE_RESIZE_COVER;case"scale-down":return cs.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return hd.SPACER_XSMALL;case"small":return hd.SPACER_SMALL;case"medium":return hd.SPACER_MEDIUM;case"large":return hd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return Cc.SPACER_INVISIBLE;case"thin":return Cc.SPACER_THIN;case"square":return Cc.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return gd.ICON_SIZE_XSMALL;case"small":return gd.ICON_SIZE_SMALL;case"medium":return gd.ICON_SIZE_MEDIUM;case"large":return gd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Mt.AVATAR_SIZE_XXSMALL;case"xsmall":return Mt.AVATAR_SIZE_XSMALL;case"small":return Mt.AVATAR_SIZE_SMALL;case"medium":return Mt.AVATAR_SIZE_MEDIUM;case"large":return Mt.AVATAR_SIZE_LARGE;case"xlarge":return Mt.AVATAR_SIZE_XXLARGE;case"xxlarge":return Mt.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Mt.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return wy.AVATAR_FACING_LEFT;case"right":return wy.AVATAR_FACING_RIGHT}}makeBlockAvatarBackground(e){switch(e){case"dark":return Cy.AVATAR_BG_DARK;case"light":return Cy.AVATAR_BG_LIGHT}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(xy)).reduce((t,i)=>(t[i.substring(xy.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);return CT.forEach(o=>{if(o in t){let a=t[o];i.push({type:wT.get(o)??Ac.UNRECOGNIZED,id:a.toString(),data:n})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),hy(e)?e:fy(e)?by(e,t):yc(e)?ld(e):vy(e)?ky(e):yy(e)?e:(console.warn(`Could not parse color: ${e}.`),ld("red"))}childrenToBlocks(e,t){return e.flatMap(i=>(typeof i!="string"?this.createBlocksElement(i,t):void 0)??[])}getThemedColors(e,t,i){let n=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!n||!o)){let c=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...c.map(p=>p[0]))}return n||(n=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),n||o?{light:n,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}resolveAssetUrl(e,t){return s(this,gs).call(this)?.getURL(e,t)??e}childrenToString(e){return e.map(t=>t.toString()).join("")}makeRoot(e,...t){return this.wrapRoot(e,this.childrenToBlocks(t,bc))}wrapRoot(e,t){return this.makeBlock(tt.BLOCK_ROOT,{},{},{rootConfig:{children:t,height:this.makeRootHeight(u.customPostType?.height??e?.height??"regular")}})}makeStackBlock(e,t,i,n){let o=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor),a=this.makeBlockAlignment(t?.alignment),c=kc(t,i),p=Py(t,i.stackParentLayout,c);return this.makeBlock(tt.BLOCK_STACK,t,i,{stackConfig:{alignment:a,backgroundColor:o?.light,backgroundColors:o,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:this.childrenToBlocks(n,{stackParentLayout:{...p,direction:e,alignment:a}}),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}makeHStack(e,t,...i){return this.makeStackBlock(wc.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(wc.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(wc.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let n=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(tt.BLOCK_TEXT,e,t,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:n?.light,colors:n,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(i),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,t,...i){let n=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(tt.BLOCK_BUTTON,e,t,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(i),textColor:n?.light,textColors:n,disabled:e?.disabled}})}makeImage(e,t){return e&&this.makeBlock(tt.BLOCK_IMAGE,e,t,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:this.resolveAssetUrl(e.url),width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e,t){return this.makeBlock(tt.BLOCK_SPACER,e,t,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e,t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(tt.BLOCK_ICON,e,t,{iconConfig:{icon:e.name,color:i?.light,colors:i,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e,t){return e&&this.makeBlock(tt.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeWebView(e,t){return e&&this.makeBlock(tt.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webView:!0}),state:e.state}})}makeBlock(e,t,i,n){return{type:e,sizes:kc(t,i),config:n,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t;if(e.type===tt.BLOCK_ROOT?(e.config?.rootConfig&&u.customPostType?.height&&(e.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t=e):t=this.wrapRoot(void 0,[e]),!t)throw new Error("Could not create root block");return t}};gs=new WeakMap;function Ty(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Ay=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=Ay(i);return e+=`</${r.type}>`,e};function IT(r){return" ".repeat(r)}function xT(r){let e="",t=0,i=r.split(/>\s*</);for(let n=0;n<i.length;n++){let o=i[n];n===0&&(o=o.trim()),n===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=IT(t),n!==0&&(e+="<"),e+=o,n!==i.length-1&&(e+=`>
2
2
  `),!a&&o.indexOf("</")===-1&&o.charAt(o.length-1)!=="/"&&t++}return e}var Le,Ey,hs,Rc,fs,pt=class{constructor(e,t,i,n,o){l(this,Le);this.renderState={};this.currentComponentKey=[];this.currentHookIndex=0;this.actions=new Map;this.forms=new Map;this.realtimeChannels=[];this.realtimeUpdated=!1;this.pendingHooks=[];this.isRendering=!1;this.transformer=new Ci(()=>this.assets);this.effects=[];l(this,fs,!1);this.component=e,this.event=t,this.state={__renderState:{},...i},this.metadata=n,this.state.__realtimeChannels&&(this.realtimeChannels=this.state.__realtimeChannels);let a=De({reconciler:this,hooks:!0,ui:!0,metadata:n});this.cache=a.cache,this.modLog=a.modLog,this.reddit=a.reddit,this.kvStore=a.kvStore,this.redis=a.redis,this.settings=a.settings,this.scheduler=a.scheduler,this.media=a.media,this.assets=a.assets,this.realtime=a.realtime,this.dimensions=o,this.ui=a.ui,this.hooks={useState:a.useState,useInterval:a.useInterval,useForm:a.useForm,useChannel:a.useChannel}}emitEffect(e,t){this.effects.push(t)}async render(){await this.reconcile(),this.isRendering=!0;let e=await this.buildBlocksUI();return this.isRendering=!1,e}makeUniqueActionID(e){let t=e,i=1;for(;this.actions.has(t);)t=`${e}.${i++}`;return t}async reconcile(){let e=S(this,Le,hs).call(this),t={type:this.component,props:e,children:[]},i=await this.processBlock(t);if(Ty(i),this.transformer.createBlocksElementOrThrow(i),this.isUserActionRender&&this.blockRenderEventId){let n=this.actions.get(this.blockRenderEventId);n&&await n(this.event.data)}for(let n of this.pendingHooks)await n();this.buildNextState(),S(this,Le,Ey).call(this)}async buildBlocksUI(){let e=S(this,Le,hs).call(this),t={type:this.component,props:e,children:[]},i=await this.renderElement(e,t);return this.transformer.ensureRootBlock(i)}async renderElement(e,t){let i=await this.processBlock(t);return Ty(i),(u.debug.emitSnapshots||e.debug.emitSnapshots)&&console.debug(xT(Ay(i))),(u.debug.emitState||e.debug.emitState)&&console.debug(JSON.stringify(this.state,void 0,2)),this.transformer.createBlocksElementOrThrow(i)}async processProps(e){let t=e.props??{},i=["onPress","onMessage"];for(let n of i)if(n in t){let o=t[n],a=o?.name,c=this.makeUniqueActionID(`${e.type}.${a??n}`);this.actions.set(c,o),t[n]=c}}async processBlock(e,t=py(),i=[]){let n=e;if(typeof n.type=="string"){let c=[];for(let m=0;m<n.children.length;m++){let b=n.children[m];b!=null&&c.push(await this.processBlock(b,t,[...i,`${n.type}.${m}`]))}let p=c.flat(),g=S(this,Le,Rc).call(this,p);return await this.processProps(n),{type:n.type,props:n.props,children:g}}if(typeof n.type=="function"){let c=t(`${i.length?i.join("."):"root"}.${n.type.name.length?n.type.name:"anonymous"}`);this.currentComponentKey.push(c),this.renderState[c]||(this.renderState[c]={});let p=n.children.flatMap(m=>m),g={...S(this,Le,hs).call(this),...n.props,children:p},f;for(;f===void 0;)try{f=await n.type(g,S(this,Le,hs).call(this))}catch(m){if(m instanceof Promise)f=await m;else throw m}if(!this.isInitialRender){let m=this.getPreviousComponentState();if(Object.keys(m).length!==this.currentHookIndex)throw new Error("Invalid hook call. Hooks can only be called at the top-level of a function component. Make sure that you are not calling hooks inside loops, conditions, or nested functions.")}if(this.currentComponentKey.pop(),this.currentHookIndex=0,typeof f=="object")return this.processBlock(f,t,[...i,n.type.name])}if(typeof n=="string")return n;if(typeof n=="number")return`${n}`;let o=[],a="";return Array.isArray(n)?o=n:typeof n.type>"u"&&n.children&&(o=n.children,a="fragmentChild."),{type:"__fragment",props:void 0,children:await Promise.all(o.flatMap(async(c,p)=>await this.processBlock(c,t,[...i,`${a}${p}`])))}}getCurrentComponentKey(){if(!this.currentComponentKey.at(-1))throw new Error("Current component key is missing");return this.currentComponentKey}getCurrentComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.renderState[e]}getPreviousComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.state.__renderState[e]||(this.state.__renderState[e]={}),this.state.__renderState[e]}get isInitialRender(){return this.event?this.event.type===Ec.RENDER_INITIAL:!1}get isUserActionRender(){return this.event?this.event.type===Ec.RENDER_USER_ACTION:!1}get isEffectRender(){return this.event?this.event.type===Ec.RENDER_EFFECT_EVENT:!1}get formSubmittedEvent(){return this.event?this.event.formSubmitted:!1}get blockRenderEventId(){return this.event?this.event.id:!1}get realtimeEvent(){if(!this.event)return!1;let e=this.event.realtimeEvent;return e?.event?.channel?e:!1}runHook(e){this.pendingHooks.push(e)}rerenderIn(e){s(this,fs)||(d(this,fs,!0),this.effects.push({type:Fy.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:e/1e3}}))}addRealtimeChannel(e){this.realtimeChannels.push(e),this.realtimeUpdated=!0}removeRealtimeChannel(e){this.realtimeChannels=this.realtimeChannels.filter(t=>t!==e),this.realtimeUpdated=!0}get realtimeEffect(){return this.realtimeUpdated&&this.realtimeChannels.length>0?[{type:Fy.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:this.realtimeChannels}}]:[]}getEffects(){return[...ki(this.ui),...this.effects,...this.realtimeEffect]}buildNextState(){for(let e of Object.keys(this.renderState))this.renderState[e]=Object.values(this.renderState[e]);this.state={__postData:this.state.__postData,__renderState:this.renderState,__cache:this.state.__cache,...this.realtimeChannels.length>0?{__realtimeChannels:this.realtimeChannels}:{}}}};Le=new WeakSet,Ey=function(){this.actions.clear(),this.currentComponentKey=[],this.currentHookIndex=0,this.pendingHooks=[],this.realtimeChannels=[],this.realtimeUpdated=!1},hs=function(){let e={...ce(this.metadata,this.state.__postData?.thingId),modLog:this.modLog,reddit:this.reddit,cache:this.cache,kvStore:this.kvStore,redis:this.redis,settings:this.settings,scheduler:this.scheduler,media:this.media,assets:this.assets,realtime:this.realtime,ui:this.ui,dimensions:this.dimensions,uiEnvironment:{timezone:this.metadata[D.Timezone]?.values[0],locale:this.metadata[D.Language]?.values[0],dimensions:this.dimensions},...this.hooks};return e.debug.effects=this,e},Rc=function(e){let t=[];for(let i of e)typeof i=="string"?t.push(i):i.type==="__fragment"?t.push(...S(this,Le,Rc).call(this,i.children)):t.push(i);return t},fs=new WeakMap;async function AT(r,e){let t=u.customPostType;if(!t)throw new Error("Custom post type not registered");let i=new pt((o,a)=>t.render(a),r.blocks,r.state,e,r.dimensions),n=await i.render();return TT.fromJSON({state:i.state,blocks:{ui:n},effects:i.getEffects()})}function Ry(r){r.provides(FT),M("RenderPost",AT)}import{GetFieldsResponse as ET,InstallationSettingsDefinition as RT}from"@devvit/protos";async function OT(){if(!u.installationSettings)throw new Error("Installation settings were not defined.");return ET.fromJSON({fields:{fields:mt(u.installationSettings)}})}async function BT(r,e){return dd(r,u.installationSettings,e)}function Oy(r){r.provides(RT),M("GetSettingsFields",OT),M("ValidateForm",BT)}import{ContextActionDefinition as MT,ContextActionList as UT,ContextActionResponse as DT}from"@devvit/protos";var By=r=>`menuItem.${r}`;function Oc(r){return u.menuItems.find((e,t)=>By(t)===r)}async function LT(r,e){let t=u.menuItems;if(!t.length)throw new Error("No menu items registered.");let i=t.map((n,o)=>({actionId:By(o),name:n.label,description:n.description,contexts:{subreddit:n.location.includes("subreddit"),post:n.location.includes("post"),comment:n.location.includes("comment")},users:{loggedOut:n.forUserType?.includes("loggedOut"),moderator:n.forUserType?.includes("moderator")},postFilters:n.postFilter==="currentApp"?{currentApp:!0}:void 0}));return UT.fromJSON({actions:i})}async function NT(r,e){let t=Oc(r.actionId);if(!t)throw new Error(`MenuItem ${r.actionId} not found`);let i=r.comment?.id&&`t1_${r.comment.id}`,n=r.post?.id&&`t3_${r.post.id}`,o=r.subreddit?.id&&`t5_${r.subreddit.id}`,a=i||n||o;y(a,"targetId is missing from ContextActionRequest");let c={targetId:a,location:r.comment?"comment":r.post?"post":"subreddit"},p=Object.assign(De({ui:!0,metadata:e}),ce(e,n,i),{uiEnvironment:{timezone:e[D.Timezone]?.values[0],locale:e[D.Language]?.values[0]}});return await t.onPress(c,p),DT.fromJSON({effects:ki(p.ui)})}function My(r){r.provides(MT),M("GetActions",LT),M("OnAction",NT)}function gt(r){return r?r===!0?!0:r.enabled:!1}import{SchedulerHandlerDefinition as _T}from"@devvit/protos";async function HT(r,e){let t=r.type,i=u.scheduledJobHandlers.get(t);if(!i)throw new Error(`Job ${t} not found`);let n={name:t,data:r.data},o=Object.assign(De({metadata:e}),ce(e));await i(n,o)}function Uy(r){r.provides(_T),M("HandleScheduledAction",HT)}import{OnAppInstallDefinition as qT,OnAppUpgradeDefinition as jT,OnAutomoderatorFilterCommentDefinition as WT,OnAutomoderatorFilterPostDefinition as GT,OnCommentCreateDefinition as VT,OnCommentDeleteDefinition as zT,OnCommentReportDefinition as JT,OnCommentSubmitDefinition as $T,OnCommentUpdateDefinition as KT,OnModActionDefinition as XT,OnModMailDefinition as ZT,OnPostCreateDefinition as QT,OnPostDeleteDefinition as YT,OnPostFlairUpdateDefinition as eA,OnPostNsfwUpdateDefinition as tA,OnPostReportDefinition as rA,OnPostSpoilerUpdateDefinition as iA,OnPostSubmitDefinition as nA,OnPostUpdateDefinition as sA}from"@devvit/protos";var wi;(function(r){function e(a,c){return a.length<=c?a:`${a.slice(0,c-1)}\u2026`}r.ellipsize=e;function t(a){return a[0]==null?a:`${a[0].toLocaleUpperCase()}${a.slice(1)}`}r.capitalize=t;function i(a){return a==null||/^\s*$/.test(a)}r.isBlank=i;function n(a,c="stack"){return a instanceof Error?`${a[c]||a.stack||a.message||a.name}`:String(a)}r.caughtToString=n;function o(a,c="stack"){return a instanceof Error?`${a[c]||a.stack||a.message||a.name}`:String(a)}r.caughtToStringUntyped=o})(wi||(wi={}));function X(r,e){return y(e),async(t,i)=>{let n={...t,type:r},o=Object.assign(De({metadata:i}),ce(i)),a=await Promise.allSettled(e.map(p=>p(n,o))),c=oA(a);if(c)throw c.err;return{}}}function Dy(r){for(let e of u.triggerOnEventHandlers.keys())switch(e){case"PostSubmit":r.provides(nA),M("OnPostSubmit",X("PostSubmit",u.triggerOnEventHandlers.get(e)));break;case"PostCreate":r.provides(QT),M("OnPostCreate",X("PostCreate",u.triggerOnEventHandlers.get(e)));break;case"PostUpdate":r.provides(sA),M("OnPostUpdate",X("PostUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostReport":r.provides(rA),M("OnPostReport",X("PostReport",u.triggerOnEventHandlers.get(e)));break;case"PostDelete":r.provides(YT),M("OnPostDelete",X("PostDelete",u.triggerOnEventHandlers.get(e)));break;case"PostFlairUpdate":r.provides(eA),M("OnPostFlairUpdate",X("PostFlairUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentSubmit":r.provides($T),M("OnCommentSubmit",X("CommentSubmit",u.triggerOnEventHandlers.get(e)));break;case"CommentCreate":r.provides(VT),M("OnCommentCreate",X("CommentCreate",u.triggerOnEventHandlers.get(e)));break;case"CommentUpdate":r.provides(KT),M("OnCommentUpdate",X("CommentUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentReport":r.provides(JT),M("OnCommentReport",X("CommentReport",u.triggerOnEventHandlers.get(e)));break;case"CommentDelete":r.provides(zT),M("OnCommentDelete",X("CommentDelete",u.triggerOnEventHandlers.get(e)));break;case"AppInstall":r.provides(qT),M("OnAppInstall",X("AppInstall",u.triggerOnEventHandlers.get(e)));break;case"AppUpgrade":r.provides(jT),M("OnAppUpgrade",X("AppUpgrade",u.triggerOnEventHandlers.get(e)));break;case"ModAction":r.provides(XT),M("OnModAction",X("ModAction",u.triggerOnEventHandlers.get(e)));break;case"ModMail":r.provides(ZT),M("OnModMail",X("ModMail",u.triggerOnEventHandlers.get(e)));break;case"PostNsfwUpdate":r.provides(tA),M("OnPostNsfwUpdate",X("PostNsfwUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostSpoilerUpdate":r.provides(iA),M("OnPostSpoilerUpdate",X("PostSpoilerUpdate",u.triggerOnEventHandlers.get(e)));break;case"AutomoderatorFilterPost":r.provides(GT),M("OnAutomoderatorFilterPost",X("AutomoderatorFilterPost",u.triggerOnEventHandlers.get(e)));break;case"AutomoderatorFilterComment":r.provides(WT),M("OnAutomoderatorFilterComment",X("AutomoderatorFilterComment",u.triggerOnEventHandlers.get(e)));break;default:throw new Error(`Unknown trigger event: ${e}`)}}function oA(r){let e=r.reduce((t,i)=>i.status==="rejected"?[...t,i.reason]:t,[]);if(e.length!==0)return e.length===1?{err:e[0]}:{err:new Error(e.map(t=>wi.caughtToString(t)).join(`
3
3
  `))}}import{EffectType as sR,HandleUIEventResponse as Jc,UIEventHandlerDefinition as oR}from"@devvit/protos";var Ab=Dn($y(),1),Eb=Dn(zc(),1);async function aR(r,e){let t=r.state??{},i=(0,Ab.default)(t),n=De({ui:!0,metadata:e});if(r.event?.formSubmitted&&r.event.formSubmitted.formId){let p=r.event.formSubmitted.formId;if(p.includes("form.hook.")&&u.customPostType){let v=new pt((P,C)=>u.customPostType?.render(C)??null,r.event,r.state,e,void 0);return await v.reconcile(),Jc.fromJSON({state:v.state,effects:v.getEffects()})}let g=u.formDefinitions.get(p);if(!g)throw new Error(`Form with key ${p} not found`);let f,m;if(i.__contextAction){let{actionId:v,thingId:P}=i.__contextAction,C=Oc(v);C?.location==="post"?f=P:C?.location==="comment"&&(m=P)}let b=Object.assign(n,ce(e,f,m),{uiEnvironment:{timezone:e[D.Timezone]?.values[0],locale:e[D.Language]?.values[0]}});await g.onSubmit({values:At(r.event.formSubmitted.results)},b)}else if(r.event?.realtimeEvent){if(u.customPostType){let p=new pt((g,f)=>u.customPostType?.render(f)??null,r.event,r.state,e,void 0);return await p.reconcile(),Jc.fromJSON({state:p.state,effects:p.getEffects()})}}else if(r.event?.toastAction)throw new Error("Toast actions not yet implemented");let o=!(0,Eb.default)(t,i),a=ki(n.ui),c=o?[...a,{type:sR.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:0}}]:a;return Jc.fromJSON({state:i,effects:c})}function Rb(r){r.provides(oR),M("HandleUIEvent",aR)}import{CustomPostDefinition as _d,UIResponse as sk}from"@devvit/protos";import{UIEventScope as hR}from"@devvit/protos";var $c="ServerCallRequired";function Fd(r){return r?.message===$c}var Qc={now(){return new Date}};function Ob(r){return`__autocache__${r}`}function Bb(r){return`__lock__${r}`}var dR=300,lR=1e3,Td=5e3,Kc=3,Mb=.1,Ub=1e3,uR=3e4;function Db(r){if(r.error)throw new Error(r.error);return r.value}var Nt,_t,Ne,Ti,K,Lb,Nb,_b,Xc,Hb,qb,Zc,jb,Ad=class{constructor(e,t,i=Qc){l(this,K);l(this,Nt);l(this,_t,{});l(this,Ne);l(this,Ti);d(this,Nt,e),d(this,Ti,t),d(this,Ne,i)}async cache(e,t){var a;(a=s(this,Ti)).__cache??(a.__cache={}),d(this,_t,s(this,Ti).__cache),S(this,K,jb).call(this,t);let i=S(this,K,Lb).call(this,t.key);if(i!==void 0)return i;let n=await S(this,K,Zc).call(this,t.key),o=await S(this,K,Nb).call(this,t,n,e);return Db(o)}};Nt=new WeakMap,_t=new WeakMap,Ne=new WeakMap,Ti=new WeakMap,K=new WeakSet,Lb=function(e){let t=s(this,_t)[e];if(t){let i=s(this,Ne).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<Kc&&Math.random()<Mb&&t.errorTime+Ub<i;if(t?.expires&&t.expires<i&&t.checkedAt+Ub<i||n){delete s(this,_t)[e];return}else return Db(t)}},Nb=async function(e,t,i){let n=t?.expires,o=n?S(this,K,qb).call(this,n):1;return!t||t?.error&&t.errorCount<Kc&&Mb>Math.random()||o>Math.random()?S(this,K,_b).call(this,e,t,i):t},_b=async function(e,t,i){let n=Bb(e.key),o=s(this,Ne).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,Nt).set(n,"1",{expiration:a,nx:!0}))return S(this,K,Hb).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Ne).now();return S(this,K,Xc).call(this,p,e.key,e.ttl)}},Xc=async function(e,t,i){let n=Math.min(i,lR),o=await S(this,K,Zc).call(this,t);if(o)return o;if(s(this,Ne).now().getTime()-e.getTime()>=n)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,dR)),S(this,K,Xc).call(this,e,t,i)},Hb=async function(e,t,i,n){let o=s(this,Ne).now().getTime()+n;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=s(this,Ne).now().getTime(),t.errorCount++}return s(this,_t)[e]=t,await s(this,Nt).set(Ob(e),JSON.stringify(t),{expiration:new Date(o+uR)}),t.error&&t.errorCount<Kc&&await s(this,Nt).del(Bb(e)),t},qb=function(e){let t=s(this,Ne).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},Zc=async function(e){let t=await s(this,Nt).get(Ob(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Ne).now().getTime(),s(this,_t)[e]=i,i}},jb=function(e){e.ttl<Td&&(console.warn(`Cache TTL cannot be less than ${Td} milliseconds! Updating ttl value of ${e.ttl} to ${Td}.`),e.ttl=Td)};function Wb(r,e,t=Qc){let i=new Ad(r,e,t);return i.cache.bind(i)}import{EffectType as Ed,ToastAppearance as zb}from"@devvit/protos";function Gb(r){let e=r.match(/form\.hook\.(.+)\.0/);if(e?.[1])return e[1]}var Yc=class{constructor(e,t,i){this.state=null;this.hookId=e.hookId,this.form=t,this.onSubmit=i,this.onUIEvent=async n=>{n.formSubmitted&&await i(At(n.formSubmitted.results))}}};function em(r,e){let t=Je({namespace:"useForm",initializer:i=>new Yc(i,r,e)});return cR({id:t.hookId})}function cR(r){return`form.hook.${r.id}.0`}function Vb(r,e){let t=Gb(e);return r.getHook({id:t})}var vt,Od,Ps,Bd,Rd=class{constructor(e){l(this,vt);l(this,Od,0);l(this,Ps);l(this,Bd,(e,t)=>{s(this,vt).emitEffect(`postMessage${Om(this,Od)._++}`,{type:Ed.EFFECT_WEB_VIEW,webView:{postMessage:{webViewId:e,app:{message:t}}}})});d(this,vt,e),d(this,Ps,{postMessage:s(this,Bd)})}get webView(){return s(this,Ps)}showForm(e,t){let i=Vb(s(this,vt),e);if(!i)throw new Error("Form does not exist. Make sure you have added it using useForm.");let n=i.form instanceof Function?i.form(t??{}):i.form,o={fields:[],id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description};hr(n.fields),o.fields=mt(n.fields),s(this,vt).emitEffect(e,{type:Ed.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?zb.SUCCESS:zb.NEUTRAL}:t={text:e},s(this,vt).emitEffect(e.toString(),{type:Ed.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,vt).emitEffect(t,{type:Ed.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}};vt=new WeakMap,Od=new WeakMap,Ps=new WeakMap,Bd=new WeakMap;import{EffectType as mR,RealtimeSubscriptionStatus as Jb}from"@devvit/protos";var Ht,it,qt,Cr,Cs,rm,Md=class Md{constructor(e,t){l(this,Cs);l(this,Ht);l(this,it);l(this,qt);l(this,Cr);d(this,Ht,t.context),d(this,it,!!t.context._devvitContext?.debug.realtime),d(this,Cr,e),d(this,qt,t.invalidate);let i=t.context.meta[D.App]?.values[0];if(!i)throw Error("useChannel missing app ID metadata");let n=t.context.meta[D.Installation]?.values[0];if(!n)throw Error("useChannel missing install ID from metadata");let o=`${i}:${n}:${e.name}`;if(Object.values(s(this,Ht)._hooks).filter(c=>c instanceof Md).some(c=>c.state.channel===o))throw Error(`useChannel channel names must be unique; "${o}" duplicated`);this.state={channel:o,connected:!1,subscribed:!1}}async onUIEvent(e){let t=e.realtimeEvent;if(!(!t||!this.state.subscribed))switch(t.status){case Jb.REALTIME_SUBSCRIBED:s(this,it)&&console.debug(`[realtime] "${this.state.channel}" connected`),this.state.connected=!0,s(this,qt).call(this),await s(this,Cr).onSubscribed?.();break;case Jb.REALTIME_UNSUBSCRIBED:s(this,it)&&console.debug(`[realtime] "${this.state.channel}" disconnected`),this.state.connected=!1,s(this,qt).call(this),await s(this,Cr).onUnsubscribed?.();break;default:s(this,it)&&console.debug(`[realtime] "${this.state.channel}" received message: ${JSON.stringify(e,void 0,2)}`),s(this,Cr).onMessage(t.event?.data?.msg);break}}async send(e){if(s(this,it)&&console.debug(`[realtime] "${this.state.channel}" send message: ${JSON.stringify(e,void 0,2)}`),!this.state.subscribed||!this.state.connected)throw console.debug(`[realtime] "${this.state.channel}" send failed; channel not connected`),Error(`useChannel send failed; "${this.state.channel}" channel not connected`);await s(this,Ht).devvitContext.realtime.send(this.state.channel,e)}get status(){return this.state.subscribed&&this.state.connected?2:this.state.subscribed&&!this.state.connected?1:!this.state.subscribed&&this.state.connected?3:4}subscribe(){this.state.subscribed||(s(this,it)&&console.debug(`[realtime] "${this.state.channel}" subscribed`),this.state.subscribed=!0,s(this,qt).call(this),S(this,Cs,rm).call(this))}unsubscribe(){this.state.subscribed&&(s(this,it)&&console.debug(`[realtime] "${this.state.channel}" unsubscribed`),this.state.subscribed=!1,s(this,qt).call(this),S(this,Cs,rm).call(this))}};Ht=new WeakMap,it=new WeakMap,qt=new WeakMap,Cr=new WeakMap,Cs=new WeakSet,rm=function(){let e=Object.values(s(this,Ht)._hooks).filter(t=>t instanceof Md&&t.state.subscribed).map(t=>t.state.channel);s(this,Ht).emitEffect(this.state.channel,{type:mR.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:e}})};var tm=Md;function im(r){if(!r.name||/[^a-zA-Z0-9_]/.test(r.name))throw Error(`useChannel error: The name "${r.name}" you provided for the hook is invalid. Valid names can only contain letters, numbers, and underscores (_).`);let e=`useChannel:${r.name}`;return Je({id:e,namespace:e,initializer:t=>new tm(r,t)})}import{EffectType as nm}from"@devvit/protos";function $b(r){return typeof r=="object"&&r!==null&&"__deleted"in r}var wr,jt,Ai=class Ai{constructor(e,t){l(this,wr);this._segments=[];l(this,jt,{});this._prevHooks={};this._prevHookId="";this._effects={};this._changed={};this._touched={};this._requeueEvents=[];this._rootProps={};this._generated={};this._undeliveredHandlers={};this.request=e,this.meta=t,d(this,wr,e.state??{__cache:{}}),this._rootProps=e.props??{}}get devvitContext(){if(!this._devvitContext)throw new Error("Devvit context not available");return this._devvitContext}set devvitContext(e){this._devvitContext=e}get _changedState(){let e={__cache:s(this,wr).__cache??{}};for(let i in this._changed)e[i]=this._state[i];let t=new Set(Object.keys(this._state));return Object.keys(s(this,jt)).forEach(i=>{i!=="__cache"&&t.delete(i)}),t.forEach(i=>{if(i==="__cache")return;let n={__deleted:!0};this._state[i]=e[i]=n}),e}get _hooks(){return s(this,jt)}set _hooks(e){this._prevHooks=s(this,jt),d(this,jt,e)}get _state(){return s(this,wr)}set _state(e){d(this,wr,e)}push(e){this._segments.push({...e,next:0})}pop(){this._segments.pop()}addUndeliveredEventHandler(e,t){this._undeliveredHandlers[e]=t}addGlobalUndeliveredEventHandler(e,t){Ai.addGlobalUndeliveredEventHandler(e,t)}getHook(e){return s(this,jt)[e.id]}static addGlobalUndeliveredEventHandler(e,t){Ai._staticUndeliveredHandlers[e]=t}async handleUndeliveredEvent(e){let t={...Ai._staticUndeliveredHandlers,...this._undeliveredHandlers};for(let[i,n]of Object.entries(t))await n(e,this)}emitEffect(e,t){this._effects[e]=t}addToRequeueEvents(...e){this._devvitContext?.debug.blocks&&console.debug("[blocks] requeueing events",e);let t=e.reduce((i,n)=>(n.retry?i.retry.push(n):i.normal.push(n),i),{retry:[],normal:[]});this._requeueEvents=[...t.retry,...this._requeueEvents,...t.normal]}get effects(){return Object.values(this._effects)}nextHookId(e){e.key===void 0&&(e.key=this._segments[this._segments.length-1].next+++""),this.push(e);try{let t=[];for(let n=this._segments.length-1;n>=0;n--){let o=this._segments[n];if(o.id){t.unshift(o.id);break}let a=[];o.namespace&&a.push(o.namespace),o.key!==void 0&&o.key!==!1&&a.push(o.key),t.unshift(a.join("-"))}let i=t.join(".");if(this._generated[i]&&!e.shared)throw new Error(`Hook id ${i} already used, cannot register another hook with the same id`);return this._generated[i]=!0,this._prevHookId=i,i}finally{this.pop()}}};wr=new WeakMap,jt=new WeakMap,Ai._staticUndeliveredHandlers={};var Ei=Ai;var Wt={};Ei.addGlobalUndeliveredEventHandler("intervals",async(r,e)=>{r.timer&&r.hook&&(delete Wt[r.hook],e.emitEffect("timers",{type:nm.EFFECT_SET_INTERVALS,interval:{intervals:Wt}}))});var Gt,Ri,ws,Oi,sm=class{constructor(e,t,i){l(this,Gt);l(this,Ri);l(this,ws);l(this,Oi);this.state={duration:{seconds:0,nanos:0},running:!1};d(this,Ri,i.invalidate),d(this,Gt,i.hookId),d(this,ws,e),d(this,Oi,i.context);let n=Math.floor(t/1e3),o=t%1e3*1e6;this.state.duration={seconds:n,nanos:o}}onStateLoaded(){this.state.running?Wt[s(this,Gt)]={duration:this.state.duration}:delete Wt[s(this,Gt)]}async onUIEvent(e){await s(this,ws).call(this)}start(){Wt[s(this,Gt)]={duration:this.state.duration},this.state.running=!0,s(this,Ri).call(this),s(this,Oi).emitEffect("timers",{type:nm.EFFECT_SET_INTERVALS,interval:{intervals:Wt}})}stop(){delete Wt[s(this,Gt)],this.state.running=!1,s(this,Ri).call(this),s(this,Oi).emitEffect("timers",{type:nm.EFFECT_SET_INTERVALS,interval:{intervals:Wt}})}};Gt=new WeakMap,Ri=new WeakMap,ws=new WeakMap,Oi=new WeakMap;function om(r,e){let t=Je({namespace:"useInterval",initializer:i=>new sm(r,e,i)});return{start:()=>t.start(),stop:()=>t.stop()}}import{UIEventScope as gR}from"@devvit/protos";var Ir=class extends Error{};import{UIEventScope as Kb}from"@devvit/protos";var Xb=Dn(zc(),1);function dm(r){if(r instanceof Error){if(r.message===$c)throw r;return console.error(r),{message:r.message,details:r.stack??""}}else return console.error(r),{message:"Unknown error",details:wi.caughtToString(r)}}var $e,nt,Bi,Is,am=class{constructor(e,t,i){l(this,$e);l(this,nt);l(this,Bi);l(this,Is);d(this,$e,!!i.context.devvitContext.debug.useAsync),s(this,$e)&&console.debug("[useAsync] v1",t),this.state={data:null,load_state:"initial",error:null,depends:null},d(this,nt,i.hookId),this.initializer=e,d(this,Bi,i.invalidate),d(this,Is,i.context),this.localDepends=t.depends??null}onStateLoaded(){if(this.state.load_state!=="disabled"&&(s(this,$e)&&console.debug("[useAsync] async onLoad ",s(this,nt),this.state),s(this,$e)&&console.debug("[useAsync] async onLoad have ",this.localDepends,"and",this.state.depends),!(0,Xb.default)(this.localDepends,this.state.depends)||this.state.load_state==="initial")){s(this,$e)&&console.debug("[useAsync] attempting to resolve for hookId",s(this,nt)),this.state.load_state="loading",this.state.depends=this.localDepends,s(this,Bi).call(this);let e={scope:Kb.ALL,hook:s(this,nt),async:!0,asyncRequest:{requestId:s(this,nt)+"-"+JSON.stringify(this.state.depends)}};s(this,$e)&&console.debug("[useAsync] onLoad requeue"),s(this,Is).addToRequeueEvents(e)}}async onUIEvent(e,t){if(e.asyncRequest){let i={requestId:e.asyncRequest.requestId};try{i.data={value:await this.initializer()}}catch(o){i.error=dm(o)}let n={scope:Kb.ALL,asyncResponse:i,hook:s(this,nt)};s(this,$e)&&console.debug("[useAsync] onReq requeue"),t.addToRequeueEvents(n)}else if(e.asyncResponse){let i=s(this,nt)+"-"+JSON.stringify(this.state.depends);e.asyncResponse.requestId===i?(this.state={...this.state,data:e.asyncResponse.data?.value,error:e.asyncResponse.error??null,load_state:e.asyncResponse.error?"error":"loaded"},s(this,Bi).call(this)):s(this,$e)&&console.debug("[useAsync] onResp skip, stale event")}else throw new Error("Unknown event type")}};$e=new WeakMap,nt=new WeakMap,Bi=new WeakMap,Is=new WeakMap;function pR(r,e={}){let t=Je({namespace:"useAsync",initializer:i=>new am(r,e,i)});return{data:t.state.data,error:t.state.error,loading:t.state.load_state==="loading"}}var yt,Mi,xr,Fr,lm=class{constructor(e,t){this.state={value:null,load_state:"initial",error:null};l(this,yt);l(this,Mi);l(this,xr);l(this,Fr);d(this,xr,e),d(this,Fr,t.hookId),d(this,yt,t.invalidate),d(this,Mi,t.context)}async onUIEvent(){if(this.state.load_state==="loading"&&this._promise){try{this.state.value=await this._promise,this.state.load_state="loaded"}catch(e){this.state.load_state="error",this.state.error=dm(e)}s(this,yt).call(this)}else console.warn("Invalid state: ",this.state.load_state,this._promise)}setter(e){this.state.value=e instanceof Function?e(this.state.value):e,this.state.load_state="loaded",s(this,yt).call(this)}onStateLoaded(){if(this._promise=s(this,Mi)._prevHooks[s(this,Fr)]?._promise,this.state.load_state==="loading")throw new Ir;if(this.state.load_state==="error")throw new Error(this.state.error?.message??"Unknown error");if(this.state.load_state==="initial"){let e;try{e=s(this,xr)instanceof Function?s(this,xr).call(this):s(this,xr)}catch(t){console.log("error in loading async",t),this.state.load_state="error",s(this,yt).call(this);return}if(e instanceof Promise){this._promise=e,this.state.load_state="loading";let t={scope:gR.ALL,asyncRequest:{requestId:s(this,Fr)},hook:s(this,Fr)};throw s(this,Mi).addToRequeueEvents(t),s(this,yt).call(this),new Ir}else this.state.value=e,this.state.load_state="loaded";s(this,yt).call(this)}}};yt=new WeakMap,Mi=new WeakMap,xr=new WeakMap,Fr=new WeakMap;function um(r){let e=Je({namespace:"useState",initializer:t=>new lm(r,t)});return[e.state.value,e.setter.bind(e)]}var Ud=class{buildContext(e,t,i){let n=new mi(i),o=new ui(i),a=new fi(i),c=new gi(i),p=new vi(i),g=new yi(i),f=new Rd(e),m=new ci(i),b=new di,v=new pi(i),P=Wb(a,e._state),C={modLog:n,kvStore:o,redis:a,reddit:c,scheduler:p,settings:g,media:m,assets:b,realtime:v,ui:f,useState:um,useChannel:im,useInterval:om,useForm:em,cache:P,dimensions:t.env?.dimensions,uiEnvironment:{timezone:i[D.Timezone]?.values[0],locale:i[D.Language]?.values[0],dimensions:t.env?.dimensions}},F=ce(i,t.props?.postId);return F.debug.effects=e,{...F,...C}}};var Se=null;function Zb(r){return JSON.parse(JSON.stringify(r))}function fR(r){if(!(r!==""&&!/[-.]/.test(r)))throw new Error(`Hook with namespace '${r}' is invalid. Hook namespaces cannot be empty string or contain dashes/dots because they are used as delimiters internally. Please update the hook namespace and try again.`)}function Je({initializer:r,...e}){if(!Se)throw new Error("Hooks can only be declared at the top of a component. You cannot declare hooks outside of components or inside of event handlers. It's almost always a mistake to declare hooks inside of loops or conditionals.");fR(e.namespace);let t=Se.nextHookId(e),i=Se,n={hookId:t,invalidate:()=>{i._changed[t]=!0,i._state[t]=i?._hooks[t]?.state},context:Se},o=Se._state[t]===void 0||$b(Se._state[t]);Se._hooks[t]=Se._hooks[t]??r(n);let a=Se._hooks[t];return o||(a.state=Se._state[t]),a.onStateLoaded?.(),o&&a.state!==void 0&&a.state!==null&&n.invalidate(),a}var vR=null,Ui,Nd,xs,T,me,Dd,Qb,cm,Yb,mm,pm,Ld,gm,ek,Tr=class{constructor(e){l(this,T);l(this,Ui);l(this,Nd,new Ud);l(this,xs,new Ci(()=>this._latestRenderContext?.devvitContext?.assets));this._latestRenderContext=null;s(this,T,me)&&console.debug("[blocks] BlocksHandler v1"),d(this,Ui,e),vR=this}async handle(e,t){let i=new Ei(e,t),n=s(this,Nd).buildContext(i,e,t);i.devvitContext=n;let o,a=e.events,p=!e.events?.length||a.some(v=>!v.async),g=a.some(v=>v.blocking),f,m,b=[...a];for(a.length===0&&a.push({scope:hR.ALL}),s(this,T,me)&&console.debug("[blocks] starting processing events");a.length>0;){s(this,T,me)&&console.debug("[blocks] processing events loop iteration",a.length);let v=[];if(!a[0].async)v.push(a.shift());else for(;a[0]?.async;)v.push(a.shift());if(!v.length)throw Error("batch must have at least one event");try{if(v[0].async){let C=Zb(i._state);await S(this,T,Qb).call(this,i,...v),i._state=C}else await S(this,T,Yb).call(this,i,...v)}catch(C){if(!Fd(C))throw C;if(s(this,T,me)&&console.debug("[blocks] caught in handler",C),i._latestRenderContent=void 0,m){i._state=m._state,i._changed=f,i._effects=m._effects;let F=b.map(x=>{let ge={...x};return ge.retry=!0,ge});i.addToRequeueEvents(...F);break}else throw Fd(C)||console.error("[blocks] unhandled error in handler",C),C}s(this,T,me)&&console.debug("[blocks] remaining events",i._requeueEvents);let P=[];for(let C of i._requeueEvents){if(!p&&!C.async){s(this,T,me)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch A",C),P.push(C);continue}if(p&&C.async&&!g){s(this,T,me)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch B",C),P.push(C);continue}s(this,T,me)&&console.debug("[blocks] reprocessing event in BlocksHandler",C),a.push(C)}i._requeueEvents=P,a.length>0&&(f={...i._changed},m={_state:Zb(i._state),_effects:{...i._effects}},b=[...a])}if(p){i._latestRenderContent||(i._latestRenderContent=S(this,T,mm).call(this,s(this,Ui),i.request.props??{},i));let v=i._latestRenderContent;v&&(o=s(this,xs).createBlocksElementOrThrow(v),o=s(this,xs).ensureRootBlock(o))}return{state:i._changedState,effects:i.effects,blocks:o,events:i._requeueEvents}}};Ui=new WeakMap,Nd=new WeakMap,xs=new WeakMap,T=new WeakSet,me=function(){return!!this._latestRenderContext?.devvitContext.debug.blocks},Dd=function(e,...t){e._hooks={},S(this,T,mm).call(this,s(this,Ui),e.request.props??{},e)},Qb=async function(e,...t){S(this,T,Dd).call(this,e,...t),await Promise.all(t.map(async i=>{if(!i.async)throw new Error("You can't mix main and other queues in one batch. This is likely a platform bug. Please file an issue in the Discord for someone to help! https://discord.com/channels/1050224141732687912/1115441897079574620");await S(this,T,cm).call(this,e,i)}))},cm=async function(e,t){let i=e._hooks[t.hook];if(i?.onUIEvent)try{await i.onUIEvent(t,e)}catch(n){throw Fd(n)?s(this,T,me)&&console.error("Server call required",n):console.error("Error in event handler",n),n}else await e.handleUndeliveredEvent(t)},Yb=async function(e,...t){for(let i of t)s(this,T,me)&&console.log("[blocks] handling main queue event",i),s(this,T,me)&&console.log("[blocks] before",e._state),S(this,T,Dd).call(this,e,i),await S(this,T,cm).call(this,e,i),s(this,T,me)&&console.log("[blocks] after",e._state);S(this,T,Dd).call(this,e)},mm=function(e,t,i){s(this,T,me)&&console.debug("[blocks] renderRoot"),i._generated={},Se=i,this._latestRenderContext=i;try{let n=S(this,T,pm).call(this,e,t,i);if(n.length!==1)throw new Error(`There can only be one root element, received: ${n.length}. Please wrap these elements in a <vstack></vstack> or <hstack></hstack> to continue. Fragments cannot be used as a root element.`);let o=n[0];if(o==="[object Promise]")throw new Error('Root elements cannot be async. To use data from an async endpoint, please use "const [data] = useState(async () => {/** your async code */})".');if(typeof o=="string")throw new Error("The root element must return a valid block, not a string. Try wrapping the element in a <text>your content</text> tag to continue.");return i._latestRenderContent=o,o}catch(n){if(n instanceof Ir)return;throw n}finally{Se=null}},pm=function(e,t,i){i.push({namespace:e.name||"anonymous",...t});try{let n=e(t,i.devvitContext);if(n instanceof Promise)throw new Error(`Components (found: ${e.name??"unknown component"}) cannot be async. To use data from an async endpoint, please use "const [data] = useState(async () => {/** your async code */})".`);return S(this,T,gm).call(this,n,i)}finally{i.pop()}},Ld=function(e,t){return e=e.flat(1/0),e.flatMap((i,n)=>(i&&typeof i=="object"&&"props"in i&&(i.props?.key||(i.props=i.props??{},i.props.key=`${n}`)),S(this,T,gm).call(this,i,t)))},gm=function(e,t){if(Array.isArray(e))return S(this,T,Ld).call(this,e,t);if(yR(e))if(e.type===void 0)try{return t.push({namespace:"fragment",...e.props}),S(this,T,Ld).call(this,e.children,t)}finally{t.pop()}else if(typeof e.type=="function"){let i={...e.props,children:e.children.flat(1/0)};return S(this,T,pm).call(this,e.type,i,t)}else try{t.push({namespace:e.type,...e.props});let i=S(this,T,Ld).call(this,e.children,t),n=S(this,T,ek).call(this,e.props??{});return[{type:e.type,children:i,props:n}]}finally{t.pop()}else return[(e??"").toString()]},ek=function(e){let t={};for(let i in e)if(!(typeof e[i]>"u"))if(typeof e[i]=="function"){let n=Je({namespace:i,key:!1,initializer:({hookId:o})=>({hookId:o,state:null,onUIEvent:a=>{if(a.userAction)return e[i](a.userAction.data);if(a.webView?.postMessage)return e[i](a.webView.postMessage.message)}})});t[i]=n.hookId,"captureHookRef"in e[i]&&e[i].captureHookRef()}else{let n=JSON.parse(JSON.stringify(e[i]));n!=null&&(t[i]=n)}return t};function yR(r){return typeof r=="object"&&r!=null&&"type"in r}var tk=r=>{let e=Number(r.trim().split(".").pop());return isNaN(e)?void 0:e},rk=r=>{let[e,t,i]=r.trim().split(";");if(!e||!t||!i){console.warn(`Received a malformed devvit-user-agent! Received: '${r}'`);return}if(e!=="Reddit"){console.warn(`Received unknown company name in user agent! Received: '${r}'`);return}if(t==="iOS"){let n=tk(i);if(n===void 0){console.warn(`Could not parse version number from user agent! Received: '${r}'`);return}return{company:"Reddit",platform:"iOS",rawVersion:i,versionNumber:n}}if(t==="Android"){let n=tk(i);if(n===void 0){console.warn(`Could not parse version number from user agent! Received: '${r}'`);return}return{company:"Reddit",platform:"Android",rawVersion:i,versionNumber:n}}if(t==="Shreddit")return{company:"Reddit",platform:"Shreddit",rawVersion:i};if(t==="Play")return{company:"Reddit",platform:"Play",rawVersion:i};console.warn("Received unknown platform:",t)},ik=r=>r?r.platform==="Android"?r.versionNumber<1875012:r.platform==="iOS"?r.versionNumber<614973:!1:(console.warn(`Could not parse devvit-user-agent! Received: '${JSON.stringify(r)}'`),!1),bR=r=>{switch(r){case"Android":return"https://play.google.com/store/apps/details?id=com.reddit.frontpage";case"iOS":return"https://apps.apple.com/us/app/reddit/id1064216828";case"Play":case"Shreddit":break;default:console.error(`No upgrade link for platform: ${r}`)}},kR=({platform:r},e)=>u.createElement("blocks",null,u.createElement("vstack",{alignment:"middle center",height:100,width:100},u.createElement("vstack",{maxWidth:"300px",gap:"large",alignment:"middle center"},u.createElement("vstack",{gap:"medium",alignment:"middle center"},u.createElement("image",{imageHeight:100,imageWidth:100,url:"https://i.redd.it/p1vmc5ulmpib1.png"}),u.createElement("text",{size:"large",weight:"bold",wrap:!0,alignment:"center"},"Uh oh, the app you're trying to use requires the latest version of Reddit. Please upgrade your app to continue.")),u.createElement("hstack",{alignment:"middle center"},u.createElement("button",{onPress:()=>{let t=bR(r);t?e.ui.navigateTo(t):console.warn("No upgrade link found for platform:",r)}},"Upgrade"))))),nk=r=>()=>u.createElement(kR,{platform:r});var SR=()=>u.createElement("vstack",{alignment:"center middle",width:"100%",height:"100%"},u.createElement("text",null,"This feature is not available yet")),PR=[[_d,_d.methods.renderPostContent,(r,e)=>u.customPostType?.render(e)??null],[_d,_d.methods.renderPostComposer,(r,e)=>u.createElement(SR,null)]];function CR(r){return async(e,t)=>{let i=rk(t["devvit-user-agent"]?.values?.[0]??"");if(i&&ik(i)){let o=new Tr(nk(i.platform));return sk.fromJSON(await o.handle(e,t))}let n=new Tr(r);return sk.fromJSON(await n.handle(e,t))}}function ok(r){for(let[e,t,i]of PR)r.provides(e),M(t.name,CR(i))}var Di,Fs,Li,Ar,Er,Ni,_i,Rr,Vt,Ts,As,Or,G,_=class _ extends Ya{static configure(e){d(this,Li,{...s(this,Li),...e}),gt(e.http)&&this.use(w.HTTPDefinition),(gt(e.kvStore)||gt(e.redis))&&(this.use(w.KVStoreDefinition),this.use(w.RedisAPIDefinition)),gt(e.media)&&this.use(w.MediaServiceDefinition),gt(e.modLog)&&this.use(w.ModlogDefinition),gt(e.redditAPI)&&(this.use(w.FlairDefinition),this.use(w.GraphQLDefinition),this.use(w.LinksAndCommentsDefinition),this.use(w.ListingsDefinition),this.use(w.ModerationDefinition),this.use(w.ModNoteDefinition),this.use(w.NewModmailDefinition),this.use(w.PrivateMessagesDefinition),this.use(w.SubredditsDefinition),this.use(w.UsersDefinition),this.use(w.WidgetsDefinition),this.use(w.WikiDefinition)),gt(e.realtime)&&this.use(w.RealtimeDefinition)}static addMenuItem(e){s(this,_i).push(e)}static addCustomPostType(e){d(this,Ar,e)}static createForm(e,t){let i=`form.${s(this,Er).size}`;return s(this,Er).set(i,{form:e,onSubmit:t}),i}static addSchedulerJob(e){if(s(this,G)[w.SchedulerDefinition.fullName]||this.use(w.SchedulerDefinition),s(this,Rr).has(e.name))throw new Error(`Job ${e.name} is already defined`);s(this,Rr).set(e.name,e.onRun)}static addSettings(e){hr(e);let t=e.filter(n=>n.type==="group"||!n.scope||n.scope==="installation"),i=e.filter(n=>n.type!=="group"&&n.scope==="app");t.length>0&&d(this,Ni,t),i.length>0&&d(this,Di,i),s(this,G)[w.SettingsDefinition.fullName]||this.use(w.SettingsDefinition)}static addTrigger(e){if("events"in e){for(let t of e.events)this.addTrigger({event:t,onEvent:(i,n)=>e.onEvent(i,n)});return this}return s(this,Vt).has(e.event)?s(this,Vt).get(e.event)?.push(e.onEvent):s(this,Vt).set(e.event,[e.onEvent]),_}static provide(e){s(this,As).push(e)}static use(e,t){s(this,Or)[e.fullName]={def:e,options:t??{},handler:void 0};let i={};for(let n of Object.values(e.methods))i[n.name]=(o,a)=>s(this,Or)[e.fullName].handler?.[n.name]?.(n.requestType?.fromPartial(o??{}),a);return s(this,G)[e.fullName]=i,i}static get redditAPIPlugins(){if(!gt(s(this,Li).redditAPI))throw new Error("Reddit API is not enabled. You can enable it by passing `redditAPI: true` to `Devvit.configure`.");return{Flair:s(this,G)[w.FlairDefinition.fullName],GraphQL:s(this,G)[w.GraphQLDefinition.fullName],LinksAndComments:s(this,G)[w.LinksAndCommentsDefinition.fullName],Listings:s(this,G)[w.ListingsDefinition.fullName],Moderation:s(this,G)[w.ModerationDefinition.fullName],ModNote:s(this,G)[w.ModNoteDefinition.fullName],NewModmail:s(this,G)[w.NewModmailDefinition.fullName],PrivateMessages:s(this,G)[w.PrivateMessagesDefinition.fullName],Subreddits:s(this,G)[w.SubredditsDefinition.fullName],Users:s(this,G)[w.UsersDefinition.fullName],Widgets:s(this,G)[w.WidgetsDefinition.fullName],Wiki:s(this,G)[w.WikiDefinition.fullName]}}static get modLogPlugin(){let e=s(this,G)[w.ModlogDefinition.fullName];if(!e)throw new Error("ModLog is not enabled. You can enable it by passing `modLog: true` to `Devvit.configure`");return e}static get schedulerPlugin(){let e=s(this,G)[w.SchedulerDefinition.fullName];if(!e)throw new Error("Scheduler is not enabled. You can enable it by calling `Devvit.addSchedulerJob` at the top level of your app.");return e}static get kvStorePlugin(){let e=s(this,G)[w.KVStoreDefinition.fullName];if(!e)throw new Error("Key Value Store is not enabled. You can enable it by passing `kvStore: true` to `Devvit.configure`");return e}static get redisPlugin(){let e=s(this,G)[w.RedisAPIDefinition.fullName];if(!e)throw new Error("Redis is not enabled. You can enable it by passing `redis: true` to `Devvit.configure`");return e}static get mediaPlugin(){let e=s(this,G)[w.MediaServiceDefinition.fullName];if(!e)throw new Error("MediaService is not enabled. You can enable it by passing `media: true` to `Devvit.configure`");return e}static get settingsPlugin(){let e=s(this,G)[w.SettingsDefinition.fullName];if(!e)throw new Error("Settings must first be configured with `Devvit.addSettings()` before they can be accessed");return e}static get realtimePlugin(){let e=s(this,G)[w.RealtimeDefinition.fullName];if(!e)throw new Error("Realtime is not enabled. You can enable it by passing `realtime: true` to `Devvit.configure`");return e}static get menuItems(){return s(this,_i)}static get customPostType(){return s(this,Ar)}static get formDefinitions(){return s(this,Er)}static get scheduledJobHandlers(){return s(this,Rr)}static get installationSettings(){return s(this,Ni)}static get appSettings(){return s(this,Di)}static get triggerOnEventHandlers(){return s(this,Vt)}static get assets(){return s(this,Fs)}static get webViewAssets(){return s(this,Ts)}constructor(e){super(e),d(_,Fs,e.assets??{}),d(_,Ts,e.webviewAssets??{});for(let t in s(_,Or)){let i=s(_,Or)[t];i.handler=e.use(i.def,i.options)}s(_,_i).length>0&&My(e),s(_,Rr).size>0&&Uy(e),s(_,Ar)&&(Ry(e),ok(e)),(s(_,Ar)||s(_,Er).size>0)&&Rb(e),s(_,Ni)&&Oy(e),s(_,Di)&&my(e),s(_,Vt).size>0&&Dy(e);for(let t of s(_,As))e.provides(t)}};Di=new WeakMap,Fs=new WeakMap,Li=new WeakMap,Ar=new WeakMap,Er=new WeakMap,Ni=new WeakMap,_i=new WeakMap,Rr=new WeakMap,Vt=new WeakMap,Ts=new WeakMap,As=new WeakMap,Or=new WeakMap,G=new WeakMap,_.debug={},l(_,Di),l(_,Fs,{}),l(_,Li,{}),l(_,Ar),l(_,Er,new Map),l(_,Ni),l(_,_i,[]),l(_,Rr,new Map),l(_,Vt,new Map),l(_,Ts,{}),l(_,As,[]),l(_,Or,{}),l(_,G,{});var u=_;(e=>{function r(t,i,...n){return{type:t,props:i,children:n}}e.createElement=r})(u||(u={}));function Y(r){let e=Object.getOwnPropertyDescriptors(r.constructor.prototype);for(let[t,i]of Object.entries(e))i.get&&Object.defineProperty(r,t,{...i,enumerable:!0})}var hm;(function(r){r[r.bold=1]="bold",r[r.italic=2]="italic",r[r.underline=4]="underline",r[r.strikethrough=8]="strikethrough",r[r.subscript=16]="subscript",r[r.superscript=32]="superscript",r[r.monospace=64]="monospace"})(hm||(hm={}));var ak="text",dk="raw",lk="br",uk="link",ck="c/",mk="p/",pk="r/",gk="u/",hk="@",fk="spoilertext",vk="par",yk="h",bk="hr",kk="blockquote",Sk="code",Pk="li",Ck="list",wk="L",Ik="R",xk="C",Fk="table",Tk="embed",Ak="img",Ek="gif",Rk="video";function Ok(r){return{e:Ek,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function Bk(r,e){let t={},i=[];return Object.assign(t,Es(t,i),Rs(t,i),Os(t,i),Us(t,i),Ds(t,i),Ls(t,i)),e(t),{e:kk,c:i,...r.author&&{a:r.author}}}function Mk(r,e){let t={},i=[];return Object.assign(t,vm(t,i)),e(t),{e:Sk,c:i,...r.language&&{l:r.language}}}function Uk(r){return{e:ck,t:r.permalink}}function Dk(r,e){let t={},i=[];return Object.assign(t,vm(t,i),Ms(t,i)),e(t),{e:yk,l:r.level,c:i}}function Lk(r){return{e:Tk,u:r.sourceUrl,c:r.contentUrl,x:r.width,y:r.height}}function Nk(){return{e:bk}}function _k(r){return{e:Ak,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function Hk(){return{e:lk}}function qk(r){return{e:uk,t:r.text,u:r.url,...r.formatting&&{f:r.formatting},...r.tooltip&&{a:r.tooltip}}}function jk(r,e){let t={},i=[];return Object.assign(t,nS(t,i)),e(t),{e:Ck,o:r.ordered,c:i}}function Wk(r){let e={},t=[];return Object.assign(e,Es(e,t),Rs(e,t),Os(e,t),Hd(e,t),Us(e,t),Ds(e,t),Ls(e,t)),r(e),{e:Pk,c:t}}function Gk(r){let e={},t=[];return Object.assign(e,qd(e,t),Ms(e,t),fm(e,t),ym(e,t),Bs(e,t)),r(e),{e:vk,c:t}}function Vk(r){return{e:mk,t:r.permalink}}function zk(r){return{e:dk,t:r}}function Jk(r){let e={},t=[];return Object.assign(e,qd(e,t),Ms(e,t),fm(e,t)),r(e),{e:fk,c:t}}function $k(r){return{e:pk,t:r.subredditName,l:r.showPrefix}}function Kk(r){let e={},t=[],i=[];return Object.assign(e,sS(e,t,i)),r(e),{e:Fk,h:t,c:i}}function Xk(r){let[e,t]=iS();return r(e),{c:t}}function Zk(r,e){let[t,i]=iS();e(t);let n;switch(r.columnAlignment){case"left":n=wk;break;case"right":n=Ik;break;case"center":n=xk;break}return{...n&&{a:n},...i&&{c:i}}}function Qk(r){let e={},t=[];return Object.assign(e,oS(e,t)),r(e),t}function Yk(r){return{e:ak,t:r.text,...r.formatting&&{f:r.formatting}}}function eS(r){return{e:gk,t:r.username,l:r.showPrefix}}function tS(r){return{e:hk,t:r.username,l:r.showPrefix}}function rS(r){return{e:Rk,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur},...r.thumbnail&&{p:r.thumbnail},...r.convertToGif&&{gifify:r.convertToGif}}}function iS(){let r={},e=[];return Object.assign(r,qd(r,e),Ms(r,e),ym(r,e),Bs(r,e)),[r,e]}function Es(r,e){return{blockQuote(t,i){return e.push(Bk(t,i)),r}}}function Rs(r,e){return{codeBlock(t,i){return e.push(Mk(t,i)),r}}}function aS(r,e){return{embed(t){return e.push(Lk(t)),r}}}function Os(r,e){return{heading(t,i){return e.push(Dk(t,i)),r}}}function Hd(r,e){return{horizontalRule(){return e.push(Nk()),r}}}function Bs(r,e){return{image(t){return e.push(_k(t)),r},animatedImage(t){return e.push(Ok(t)),r}}}function fm(r,e){return{linebreak(){return e.push(Hk()),r}}}function Ms(r,e){return{link(t){return e.push(qk(t)),r},commentLink(t){return e.push(Uk(t)),r},postLink(t){return e.push(Vk(t)),r},subredditLink(t){return e.push($k(t)),r},userLink(t){return e.push(eS(t)),r},userMention(t){return e.push(tS(t)),r}}}function Us(r,e){return{list(t,i){return e.push(jk(t,i)),r}}}function nS(r,e){return{item(t){return e.push(Wk(t)),r}}}function Ds(r,e){return{paragraph(t){return e.push(Gk(t)),r}}}function vm(r,e){return{rawText(t){return e.push(zk(t)),r}}}function ym(r,e){return{spoiler(t){return e.push(Jk(t)),r}}}function sS(r,e,t){return{headerCell(i,n){return e.push(Zk(i,n)),r},row(i){return t.push(Qk(i)),r}}}function Ls(r,e){return{table(t){return e.push(Kk(t)),r}}}function oS(r,e){return{cell(t){return e.push(Xk(t)),r}}}function qd(r,e){return{text(t){return e.push(Yk(t)),r}}}function dS(r,e){return{video(t){return e.push(rS(t)),r}}}var wR=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},IR=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},jd,bt=class{constructor(){jd.set(this,void 0);let e=[];Object.assign(this,Ds(this,e),Os(this,e),Hd(this,e),Es(this,e),Rs(this,e),aS(this,e),Us(this,e),Ls(this,e),Bs(this,e),dS(this,e)),wR(this,jd,{document:e},"f")}build(){return JSON.stringify(IR(this,jd,"f"))}paragraph(e){return this}heading(e,t){return this}horizontalRule(){return this}blockQuote(e,t){return this}codeBlock(e,t){return this}embed(e){return this}list(e,t){return this}table(e){return this}image(e){return this}animatedImage(e){return this}video(e){return this}};jd=new WeakMap;function Hi(r){let e;return r instanceof bt?e=r.build():typeof r=="object"?e=JSON.stringify(r):e=r,e}var lS=100,uS=1/0,Br,Mr,zt,qi,ji,Wd,V=class{constructor(e){l(this,ji);l(this,Br);l(this,Mr);l(this,zt);l(this,qi,!1);this.pageSize=lS;this.limit=uS;this.children=[];Y(this),this._fetch=e.fetch,this.pageSize=e.pageSize??lS,this.limit=e.limit??uS,d(this,Mr,e.after),d(this,Br,e.before),d(this,zt,e.more),e.children&&(this.children=e.children)}get hasMore(){return!s(this,qi)||!!(s(this,Mr)||s(this,Br)||s(this,zt))}async*[Symbol.asyncIterator](){let e=0;for(;;){if(e===this.children.length)if(this.hasMore){if((await S(this,ji,Wd).call(this)).length===0)break}else break;if(yield this.children[e],e++,e===this.limit)break}}setMore(e){d(this,zt,e)}preventInitialFetch(){d(this,qi,!0)}async all(){for(;this.hasMore&&this.children.length<this.limit;)await S(this,ji,Wd).call(this);return this.children.slice(0,this.limit)}async get(e){let t=e<=this.limit?e:this.limit;for(;this.hasMore&&this.children.length<t;)await S(this,ji,Wd).call(this);return this.children.slice(0,t)}};Br=new WeakMap,Mr=new WeakMap,zt=new WeakMap,qi=new WeakMap,ji=new WeakSet,Wd=async function(){if(!this.hasMore)throw new Error("This listing does not have any more items to load.");let{children:e,before:t,after:i,more:n}=await this._fetch({before:s(this,Br),after:s(this,Mr),limit:this.pageSize,more:s(this,zt)});return this.children.push(...e),d(this,Br,t),d(this,Mr,i),d(this,zt,n),d(this,qi,!0),e};var Ns,bm,Me=class{constructor(){}static get(e,t){let i=u.redditAPIPlugins.ModNote;return new V({hasMore:!0,before:e.before,limit:e.limit,pageSize:e.limit,fetch:async n=>{let o=await i.GetNotes({subreddit:e.subreddit,user:e.user,filter:e.filter,before:n.before,limit:n.limit},t);return{children:o.modNotes?.map(a=>S(this,Ns,bm).call(this,a))||[],before:o.hasNextPage?o.endCursor:void 0,hasMore:o.hasNextPage}}})}static async delete(e,t){let i=u.redditAPIPlugins.ModNote,{deleted:n}=await i.DeleteNotes(e,t);return!!n}static async add(e,t){let n=await u.redditAPIPlugins.ModNote.PostNotes(e,t);if(!n?.created)throw new Error("Failed to create mod note");return S(this,Ns,bm).call(this,n.created)}static async addRemovalNote(e,t){await u.redditAPIPlugins.ModNote.PostRemovalNote(e,t)}};Ns=new WeakSet,bm=function(e){return y(e.id,"Mod note ID is null or undefined"),y(e.createdAt,"Mod note createdAt is null or undefined"),y(e.type,"Mod note type is null or undefined"),y(e.subreddit,"Mod note subreddit is null or undefined"),y(e.subredditId,"Mod note subredditId is null or undefined"),y(e.operator,"Mod note operator is null or undefined"),y(e.operatorId,"Mod note operatorId is null or undefined"),y(e.user,"Mod note user is null or undefined"),y(e.userId,"Mod note userId is null or undefined"),y(e.userNoteData,"Mod note userNote is null or undefined"),y(e.modActionData,"Mod note modAction is null or undefined"),{id:e.id,user:{id:oe(e.userId??""),name:e.user},subreddit:{id:ie(e.subredditId??""),name:e.subreddit},operator:{id:oe(e.operatorId??""),name:e.operator},createdAt:new Date(e.createdAt*1e3),userNote:{note:e.userNoteData?.note,redditId:e.userNoteData?.redditId?Re(e.userNoteData?.redditId):void 0,label:e.userNoteData?.label},type:e.type}},l(Me,Ns);var ee=class{static queryWithQueryString(e,t){return u.redditAPIPlugins.GraphQL.Query({query:e},t)}static query(e,t,i,n){return u.redditAPIPlugins.GraphQL.PersistedQuery({operationName:e,id:t,variables:i},n)}};var cS=["all","wiki","posts","access","mail","config","flair","channels","chat_config","chat_operator","community_chat"];function xR(r,e){return e.map(t=>(r.includes(t)?"+":"-")+t).join(",")}function km(r){return xR(r,cS)}function mS(r){return r.filter(e=>cS.includes(e))}var FR=(t=>(t.User="USER_FLAIR",t.Post="LINK_FLAIR",t))(FR||{}),Dr,Wi,Gi,Vi,zi,Ji,$i,Ki,Xi,Zi,Qi,Gd,Ke=class Ke{constructor(e,t,i){l(this,Dr);l(this,Wi);l(this,Gi);l(this,Vi);l(this,zi);l(this,Ji);l(this,$i);l(this,Ki);l(this,Xi);l(this,Zi);Y(this),y(e.id),y(e.text),d(this,Dr,e.id),d(this,Wi,t),d(this,Gi,e.text),d(this,Vi,TR(e.textColor)),d(this,zi,AR(e.backgroundColor)),d(this,Ji,ER(e.allowableContent)),d(this,$i,e.modOnly),d(this,Ki,e.maxEmojis),d(this,Xi,e.textEditable),d(this,Zi,i)}get id(){return s(this,Dr)}get text(){return s(this,Gi)}get textColor(){return s(this,Vi)}get backgroundColor(){return s(this,zi)}get allowableContent(){return s(this,Ji)}get modOnly(){return s(this,$i)}get maxEmojis(){return s(this,Ki)}get allowUserEdits(){return s(this,Xi)}async delete(){return Ke.deleteFlairTemplate(s(this,Dr),s(this,Wi),s(this,Zi))}async edit(e){return Ke.editFlairTemplate({id:s(this,Dr),subredditName:s(this,Wi),text:e.text??s(this,Gi),allowableContent:e.allowableContent??s(this,Ji),backgroundColor:e.backgroundColor??s(this,zi),maxEmojis:e.maxEmojis??s(this,Ki),modOnly:e.modOnly??s(this,$i),textColor:e.textColor??s(this,Vi),allowUserEdits:e.allowUserEdits??s(this,Xi)},s(this,Zi))}static async createPostFlairTemplate(e,t){var i;return S(i=Ke,Qi,Gd).call(i,{...e,flairType:"LINK_FLAIR"},t)}static async createUserFlairTemplate(e,t){var i;return S(i=Ke,Qi,Gd).call(i,{...e,flairType:"USER_FLAIR"},t)}static async editFlairTemplate(e,t){var i;return S(i=Ke,Qi,Gd).call(i,e,t)}static async getPostFlairTemplates(e,t){return(await u.redditAPIPlugins.Flair.LinkFlair({subreddit:e},t)).flair?.map(o=>new Ke(o,e,t))||[]}static async getUserFlairTemplates(e,t){return(await u.redditAPIPlugins.Flair.UserFlair({subreddit:e},t)).flair?.map(o=>new Ke(o,e,t))||[]}static async deleteFlairTemplate(e,t,i){await u.redditAPIPlugins.Flair.DeleteFlairTemplate({subreddit:e,flairTemplateId:t},i)}};Dr=new WeakMap,Wi=new WeakMap,Gi=new WeakMap,Vi=new WeakMap,zi=new WeakMap,Ji=new WeakMap,$i=new WeakMap,Ki=new WeakMap,Xi=new WeakMap,Zi=new WeakMap,Qi=new WeakSet,Gd=async function(e,t){let{subredditName:i,allowableContent:n="all",backgroundColor:o="transparent",flairType:a="",maxEmojis:c=10,modOnly:p=!1,text:g,textColor:f="dark",allowUserEdits:m=!1,id:b=""}=e;if(p&&m)throw new Error("Cannot have a mod only flair that is editable by users");let P=await u.redditAPIPlugins.Flair.FlairTemplate({subreddit:i,allowableContent:n,backgroundColor:o,flairType:a,maxEmojis:c,modOnly:p,text:g,textColor:f,textEditable:m,flairTemplateId:b,cssClass:"",overrideCss:!1},t);return new Ke(P,i,t)},l(Ke,Qi);var ue=Ke;function _s(r){return{flairCssClass:r.flairCssClass,user:r.user,flairText:r.flairText}}var Jt,Sm,Pm,Ur=class Ur{static async getUserFlairBySubreddit(e,t){return u.redditAPIPlugins.Flair.FlairList(e,t)}static setUserFlair(e,t){var i;return S(i=Ur,Jt,Sm).call(i,e,t)}static setPostFlair(e,t){var i;return S(i=Ur,Jt,Sm).call(i,{...e,postId:ye(e.postId)},t)}static async removePostFlair(e,t,i){var n;return S(n=Ur,Jt,Pm).call(n,e,t,void 0,i)}static async removeUserFlair(e,t,i){var n;return S(n=Ur,Jt,Pm).call(n,e,void 0,t,i)}};Jt=new WeakSet,Sm=async function(e,t){await u.redditAPIPlugins.Flair.SelectFlair({subreddit:e.subredditName,flairTemplateId:e.flairTemplateId??"",text:e.text??"",name:e.username,link:e.postId,backgroundColor:e.backgroundColor??"",textColor:e.textColor??"dark",cssClass:e.cssClass??"",returnRtjson:"none"},t)},Pm=async function(e,t,i,n){await u.redditAPIPlugins.Flair.SelectFlair({subreddit:e,name:i??"",link:t??"",flairTemplateId:"",backgroundColor:"",text:"",textColor:"",cssClass:"",returnRtjson:"none"},n)},l(Ur,Jt);var Ue=Ur;function TR(r){if(y(r,"Flair text color is required"),r==="light"||r==="dark")return r;throw new Error(`Invalid flair text color: ${r}`)}function AR(r){if(!r||r.length===0||r==="transparent")return"transparent";if(/^#([A-Fa-f0-9]{6})$/.test(r))return r;throw new Error(`Invalid flair background color: ${r}`)}function ER(r){if(r==="all"||r==="text"||r==="emoji")return r;throw new Error(`Invalid allowable content: ${r}`)}import{Block as fS,CustomPostDefinition as _R,Definition as HR,UIEventHandlerDefinition as qR,UIResponse as jR}from"@devvit/protos";import{LinkedBundle as vS}from"@devvit/protos/types/devvit/runtime/bundle.js";var Yi=Dn(hS(),1);var wm=r=>"text"in r?r.text:NR(r.richtext),NR=r=>r instanceof bt?r.build():typeof r=="object"?JSON.stringify(r):r;var en,qs,tn,js,rn,Ws,Gs,Vs,$t,zs,Js,$s,Ks,Xs,Zs,Kt,Qs,Ys,Nr,nn,Xt,sn,on,an,kt,Zt,Qt,dn,Yt,er,tr,St,eo,to,ln,un,L,N=class N{constructor(e,t){l(this,en);l(this,qs);l(this,tn);l(this,js);l(this,rn);l(this,Ws);l(this,Gs);l(this,Vs);l(this,$t);l(this,zs);l(this,Js);l(this,$s);l(this,Ks);l(this,Xs);l(this,Zs);l(this,Kt);l(this,Qs);l(this,Ys);l(this,Nr);l(this,nn);l(this,Xt);l(this,sn);l(this,on);l(this,an);l(this,kt);l(this,Zt);l(this,Qt);l(this,dn);l(this,Yt);l(this,er);l(this,tr);l(this,St);l(this,eo);l(this,to);l(this,ln);l(this,un);l(this,L);Y(this),y(e.id,"Post is missing id"),y(e.title,"Post is missing title"),y(e.createdUtc,"Post is missing created date"),y(e.author,"Post is missing author name"),y(e.subreddit,"Post is missing subreddit name"),y(e.subredditId,"Post is missing subreddit id"),y(e.url,"Post is missing url"),y(e.permalink,"Post is missing permalink"),d(this,en,ye(`t3_${e.id}`)),d(this,tn,e.author),d(this,qs,e.authorFullname?oe(e.authorFullname):void 0),d(this,rn,ie(e.subredditId)),d(this,Ws,e.subreddit),d(this,$s,e.score??0),d(this,Ks,e.numComments??0),d(this,Xs,e.numReports??0);let i=new Date(0);i.setUTCSeconds(e.createdUtc),d(this,js,i),d(this,Vs,e.title),d(this,$t,e.selftext),d(this,zs,e.selftextHtml),d(this,Js,e.url),d(this,Gs,e.permalink),e.thumbnail&&e.thumbnail!=="self"&&e.thumbnail!=="nsfw"&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null&&d(this,Zs,{url:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth}),d(this,Kt,e.approved??!1),d(this,Qs,e.approvedAtUtc??0),d(this,Ys,e.bannedAtUtc??0),d(this,Xt,e.removed??!1),d(this,sn,e.removedBy),d(this,on,e.removedByCategory),d(this,Nr,e.spam??!1),d(this,nn,e.stickied??!1),d(this,an,e.archived??!1),d(this,kt,e.edited??!1),d(this,Zt,e.locked??!1),d(this,Qt,e.over18??!1),d(this,dn,e.quarantine??!1),d(this,Yt,e.spoiler),d(this,er,e.hidden??!1),d(this,tr,e.ignoreReports??!1),d(this,St,e.distinguished),d(this,to,e.secureMedia),d(this,ln,(e.modReports??[]).map(([n])=>n)),d(this,un,(e.userReports??[]).map(([n])=>n)),d(this,L,t),(e.linkFlairBackgroundColor||e.linkFlairCssClass||e.linkFlairText||e.linkFlairType||e.linkFlairTemplateId||e.linkFlairRichtext||e.linkFlairTextColor)&&d(this,eo,{backgroundColor:e.linkFlairBackgroundColor,cssClass:e.linkFlairCssClass,text:e.linkFlairText,type:e.linkFlairType,templateId:e.linkFlairTemplateId,richtext:(e.linkFlairRichtext??[]).map(({e:n,t:o,a,u:c})=>({elementType:n,text:o,emojiRef:a,url:c})),textColor:e.linkFlairTextColor})}get id(){return s(this,en)}get authorId(){return s(this,qs)}get authorName(){return s(this,tn)}get subredditId(){return s(this,rn)}get subredditName(){return s(this,Ws)}get permalink(){return s(this,Gs)}get title(){return s(this,Vs)}get body(){return s(this,$t)}get bodyHtml(){return s(this,zs)}get url(){return s(this,Js)}get thumbnail(){return s(this,Zs)}get createdAt(){return s(this,js)}get score(){return s(this,$s)}get numberOfComments(){return s(this,Ks)}get numberOfReports(){return s(this,Xs)}get approved(){return s(this,Kt)}get approvedAtUtc(){return s(this,Qs)}get bannedAtUtc(){return s(this,Ys)}get spam(){return s(this,Nr)}get stickied(){return s(this,nn)}get removed(){return s(this,Xt)}get removedBy(){return s(this,sn)}get removedByCategory(){return s(this,on)}get archived(){return s(this,an)}get edited(){return s(this,kt)}get locked(){return s(this,Zt)}get nsfw(){return s(this,Qt)}get quarantined(){return s(this,dn)}get spoiler(){return s(this,Yt)}get hidden(){return s(this,er)}get ignoringReports(){return s(this,tr)}get distinguishedBy(){return s(this,St)}get comments(){return re.getComments({postId:this.id},s(this,L))}get flair(){return s(this,eo)}get secureMedia(){return s(this,to)}get userReportReasons(){return s(this,un)}get modReportReasons(){return s(this,ln)}toJSON(){return{id:this.id,authorId:this.authorId,authorName:this.authorName,subredditId:this.subredditId,subredditName:this.subredditName,permalink:this.permalink,title:this.title,body:this.body,bodyHtml:this.bodyHtml,url:this.url,thumbnail:this.thumbnail,score:this.score,numberOfComments:this.numberOfComments,numberOfReports:this.numberOfReports,createdAt:this.createdAt,approved:this.approved,spam:this.spam,stickied:this.stickied,removed:this.removed,removedBy:s(this,sn),removedByCategory:s(this,on),archived:this.archived,edited:this.edited,locked:this.locked,nsfw:this.nsfw,quarantined:this.quarantined,spoiler:this.spoiler,hidden:this.hidden,ignoringReports:this.ignoringReports,distinguishedBy:this.distinguishedBy,flair:this.flair,secureMedia:this.secureMedia,modReportReasons:s(this,ln),userReportReasons:s(this,un)}}isApproved(){return s(this,Kt)}isSpam(){return s(this,Nr)}isStickied(){return s(this,nn)}isRemoved(){return s(this,Xt)}isArchived(){return s(this,an)}isEdited(){return s(this,kt)}isLocked(){return s(this,Zt)}isNsfw(){return s(this,Qt)}isQuarantined(){return s(this,dn)}isSpoiler(){return s(this,Yt)}isHidden(){return s(this,er)}isIgnoringReports(){return s(this,tr)}isDistinguishedBy(){return s(this,St)}async edit(e){let t=await N.edit({id:this.id,...e},s(this,L));d(this,$t,t.body),d(this,kt,t.edited)}async setSuggestedCommentSort(e){await N.setSuggestedCommentSort({id:this.id,subredditId:s(this,rn),suggestedSort:e},s(this,L))}async setCustomPostPreview(e){let t=await N.setCustomPostPreview({id:this.id,body:this.body,ui:e},s(this,L));d(this,$t,t.body),d(this,kt,t.edited)}async setTextFallback(e){let t=await N.setTextFallback(e,this.id,s(this,L));d(this,$t,t.body),d(this,kt,t.edited)}async addComment(e){return re.submit({id:this.id,...e},s(this,L))}async delete(){return N.delete(this.id,s(this,L))}async approve(){await N.approve(this.id,s(this,L)),d(this,Kt,!0),d(this,Xt,!1)}async remove(e=!1){await N.remove(this.id,e,s(this,L)),d(this,Xt,!0),d(this,Nr,e),d(this,Kt,!1)}async lock(){await N.lock(this.id,s(this,L)),d(this,Zt,!0)}async unlock(){await N.unlock(this.id,s(this,L)),d(this,Zt,!1)}async hide(){await N.hide(this.id,s(this,L)),d(this,er,!0)}async unhide(){await N.unhide(this.id,s(this,L)),d(this,er,!1)}async markAsNsfw(){await N.markAsNsfw(this.id,s(this,L)),d(this,Qt,!0)}async unmarkAsNsfw(){await N.unmarkAsNsfw(this.id,s(this,L)),d(this,Qt,!1)}async markAsSpoiler(){await N.markAsSpoiler(this.id,s(this,L)),d(this,Yt,!0)}async unmarkAsSpoiler(){await N.unmarkAsSpoiler(this.id,s(this,L)),d(this,Yt,!1)}async sticky(e){await N.sticky(this.id,e,s(this,L))}async unsticky(){await N.unsticky(this.id,s(this,L))}async distinguish(){let{distinguishedBy:e}=await N.distinguish(this.id,!1,s(this,L));d(this,St,e)}async distinguishAsAdmin(){let{distinguishedBy:e}=await N.distinguish(this.id,!0,s(this,L));d(this,St,e)}async undistinguish(){let{distinguishedBy:e}=await N.undistinguish(this.id,s(this,L));d(this,St,e)}async ignoreReports(){await N.ignoreReports(this.id,s(this,L)),d(this,tr,!0)}async unignoreReports(){await N.unignoreReports(this.id,s(this,L)),d(this,tr,!1)}async getAuthor(){return I.getByUsername(s(this,tn),s(this,L))}async crosspost(e){return N.crosspost({...e,postId:this.id},s(this,L))}addRemovalNote(e){return Me.addRemovalNote({itemIds:[s(this,en)],...e},s(this,L))}async getEnrichedThumbnail(){return WR({id:this.id},s(this,L))}static async getById(e,t){let i=u.redditAPIPlugins.LinksAndComments,n=gr(e)?e:`t3_${e}`,o=await i.Info({subreddits:[],thingIds:[n]},t);if(!o.data?.children?.length)throw new Error("could not find post");let a=o.data.children[0];if(!a?.data)throw new Error("could not find post");return new N(a.data,t)}static async submit(e,t){let i=u.redditAPIPlugins.LinksAndComments,n;if("preview"in e){y(t,"Missing metadata in `SubmitPostOptions`");let c=await new pt(()=>e.preview,void 0,{},t,void 0).buildBlocksUI(),p=fS.encode(c).finish(),{textFallback:g,...f}=e,m=g?wm(g):"",b={kind:"custom",sr:e.subredditName,richtextJson:(0,Yi.fromByteArray)(p),richtextFallback:m,...f};n=await i.SubmitCustomPost(b,t)}else n=await i.Submit({kind:"kind"in e?e.kind:"url"in e?"link":"self",sr:e.subredditName,richtextJson:"richtext"in e?Hi(e.richtext):void 0,...e},t);if("kind"in e&&["image","video","videogif"].includes(e.kind)&&!n.json?.data?.id&&"url"in e)throw new Error(`Post of ${e.kind} type with ${e.url} is being created asynchronously and should be updated in the subreddit soon.`);if(!n.json?.data?.id||n.json?.errors?.length)throw new Error(`failed to submit post - either post ID is empty or request failed with errors: ${n.json?.errors}`);return N.getById(`t3_${n.json.data.id}`,t)}static async crosspost(e,t){let i=u.redditAPIPlugins.LinksAndComments,{postId:n,subredditName:o,...a}=e,c=await i.Submit({kind:"crosspost",sr:o,crosspostFullname:ye(n),...a},t);if(!c.json?.data?.id||c.json?.errors?.length)throw new Error("failed to crosspost post");return N.getById(`t3_${c.json.data.id}`,t)}static async edit(e,t){let i=u.redditAPIPlugins.LinksAndComments,{id:n}=e,o;if("richtext"in e&&(o=Hi(e.richtext)),(await i.EditUserText({thingId:n,text:"text"in e?e.text:"",richtextJson:o},t)).json?.errors?.length)throw new Error("Failed to edit post");return N.getById(n,t)}static async setSuggestedCommentSort(e,t){if(!(await ee.query("SetSuggestedSort","cf6052acc7fefaa65b710625b81dba8041f258313aafe9730e2a3dc855e5d10d",{input:{subredditId:e.subredditId,postId:e.id,sort:e.suggestedSort}},t)).data?.setSuggestedSort?.ok)throw new Error("Failed to set suggested sort")}static async setCustomPostPreview(e,t){if(!t)throw new Error("Failed to set custom post preview. Metadata not found");let i=new RegExp(/DX_Bundle:\n\n {4}(?<bundle>[^\n]*)/g).exec(e.body??"");if(!i?.groups?.bundle)throw new Error(`Failed to set custom post preview. Couldn't find bundle in post ${e.id}`);let n=(0,Yi.toByteArray)(i.groups.bundle),o=vS.decode(n);o.provides=[_R,qR].map(x=>HR.toSerializable(x));let a=(0,Yi.fromByteArray)(vS.encode(o).finish()),p=new RegExp(/DX_RichtextFallback:\n\n {4}(?<fallback>[^\n]*)/g).exec(e.body??"")?.groups?.fallback,g=new Tr(e.ui),m=jR.fromJSON(await g.handle({events:[]},t)).blocks,b=(0,Yi.fromByteArray)(fS.encode(m).finish()),v=new bt().heading({level:1},x=>x.rawText("DX_Bundle:")).codeBlock({language:""},x=>{x.rawText(a)}).heading({level:1},x=>x.rawText("DX_Config:")).codeBlock({language:""},x=>{x.rawText("EgA=")}).heading({level:1},x=>x.rawText("DX_Cached:")).codeBlock({language:""},x=>{x.rawText(b)});if(p&&v.heading({level:1},x=>x.rawText("DX_RichtextFallback:")).codeBlock({language:""},x=>{x.rawText(p)}),!(await ee.query("UpdatePost","ccc5f1da31a8d8c518b6607e81c2903a46f922cb6562c8b47fcc8988f0611360",{input:{postId:e.id,content:{richText:v.build()}}},t)).data?.updatePost?.ok)throw new Error("Failed to set custom post preview");return N.getById(e.id,t)}static async setTextFallback(e,t,i){if(!("text"in e)&&!("richtext"in e))throw new Error(`No text fallback provided for post ${t}.`);let n=u.redditAPIPlugins.LinksAndComments,o=wm(e);if((await n.EditCustomPost({thingId:t,richtextFallback:o},i)).json?.errors?.length)throw new Error("Failed to set post text fallback");return N.getById(t,i)}static async delete(e,t){await u.redditAPIPlugins.LinksAndComments.Del({id:e},t)}static async approve(e,t){await u.redditAPIPlugins.Moderation.Approve({id:e},t)}static async remove(e,t=!1,i){await u.redditAPIPlugins.Moderation.Remove({id:e,spam:t},i)}static async hide(e,t){await u.redditAPIPlugins.LinksAndComments.Hide({id:e},t)}static async unhide(e,t){await u.redditAPIPlugins.LinksAndComments.Unhide({id:e},t)}static async markAsNsfw(e,t){await u.redditAPIPlugins.LinksAndComments.MarkNSFW({id:e},t)}static async unmarkAsNsfw(e,t){await u.redditAPIPlugins.LinksAndComments.UnmarkNSFW({id:e},t)}static async markAsSpoiler(e,t){await u.redditAPIPlugins.LinksAndComments.Spoiler({id:e},t)}static async unmarkAsSpoiler(e,t){await u.redditAPIPlugins.LinksAndComments.Unspoiler({id:e},t)}static async sticky(e,t,i){await u.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!0,num:t},i)}static async unsticky(e,t){await u.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!1},t)}static async lock(e,t){await u.redditAPIPlugins.LinksAndComments.Lock({id:e},t)}static async unlock(e,t){await u.redditAPIPlugins.LinksAndComments.Unlock({id:e},t)}static async distinguish(e,t,i){let a=(await u.redditAPIPlugins.Moderation.Distinguish({id:e,how:t?"admin":"yes",sticky:!1},i)).json?.data?.things?.[0]?.data;return y(a),{distinguishedBy:a.distinguished}}static async undistinguish(e,t){let o=(await u.redditAPIPlugins.Moderation.Distinguish({id:e,how:"no",sticky:!1},t)).json?.data?.things?.[0]?.data;return y(o),{distinguishedBy:o.distinguished}}static async ignoreReports(e,t){await u.redditAPIPlugins.Moderation.IgnoreReports({id:e},t)}static async unignoreReports(e,t){await u.redditAPIPlugins.Moderation.UnignoreReports({id:e},t)}static getControversialPosts(e={},t){return this.getSortedPosts({...e,sort:"controversial"},t)}static getTopPosts(e={},t){return this.getSortedPosts({...e,sort:"top"},t)}static getSortedPosts(e,t){let i=u.redditAPIPlugins.Listings;return new V({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Sort({show:"all",sort:e.sort,t:e.timeframe,subreddit:e.subredditName,...n},t);return Hs(o,t)}})}static getHotPosts(e={location:"GLOBAL"},t){let i=u.redditAPIPlugins.Listings;return new V({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Hot({g:e.location,show:"all",subreddit:e.subredditName,...n},t);return Hs(o,t)}})}static getNewPosts(e,t){let i=u.redditAPIPlugins.Listings;return new V({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.New({show:"all",subreddit:e.subredditName,...n},t);return Hs(o,t)}})}static getRisingPosts(e,t){let i=u.redditAPIPlugins.Listings;return new V({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Rising({show:"all",subreddit:e.subredditName,...n},t);return Hs(o,t)}})}static getPostsByUser(e,t){let i=u.redditAPIPlugins.Users;return new V({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,async fetch(n){let o=await i.UserWhere({username:e.username,where:"submitted",...n},t);return Hs(o,t)}})}};en=new WeakMap,qs=new WeakMap,tn=new WeakMap,js=new WeakMap,rn=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,Vs=new WeakMap,$t=new WeakMap,zs=new WeakMap,Js=new WeakMap,$s=new WeakMap,Ks=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,Kt=new WeakMap,Qs=new WeakMap,Ys=new WeakMap,Nr=new WeakMap,nn=new WeakMap,Xt=new WeakMap,sn=new WeakMap,on=new WeakMap,an=new WeakMap,kt=new WeakMap,Zt=new WeakMap,Qt=new WeakMap,dn=new WeakMap,Yt=new WeakMap,er=new WeakMap,tr=new WeakMap,St=new WeakMap,eo=new WeakMap,to=new WeakMap,ln=new WeakMap,un=new WeakMap,L=new WeakMap;var z=N;function Hs(r,e){if(!r.data?.children)throw new Error("Listing response is missing children");return{children:r.data.children.map(i=>new z(i.data,e)),before:r.data.before,after:r.data.after}}async function WR(r,e){let o=(await ee.query("GetThumbnailV2","81580ce4e23d748c5a59a1618489b559bf4518b6a73af41f345d8d074c8b2ce9",{id:r.id},e)).data?.postInfoById?.thumbnailV2;if(o){if(!o.image)return}else throw new Error("Failed to get thumbnail");return{attribution:o.attribution,image:{url:o.image.url,width:o.image.dimensions.width,height:o.image.dimensions.height},isObfuscatedDefault:o.isObfuscatedDefault,...o.obfuscatedImage&&{obfuscatedImage:{url:o.obfuscatedImage.url,width:o.obfuscatedImage.dimensions.width,height:o.obfuscatedImage.dimensions.height}}}}var GR=(q=>(q.Custom="CUSTOM",q.Reddit="REDDIT",q.Instagram="INSTAGRAM",q.Twitter="TWITTER",q.Tiktok="TIKTOK",q.Twitch="TWITCH",q.Facebook="FACEBOOK",q.Youtube="YOUTUBE",q.Tumblr="TUMBLR",q.Spotify="SPOTIFY",q.Soundcloud="SOUNDCLOUD",q.Beacons="BEACONS",q.Linktree="LINKTREE",q.Discord="DISCORD",q.Venmo="VENMO",q.CashApp="CASH_APP",q.Patreon="PATREON",q.Kofi="KOFI",q.Paypal="PAYPAL",q.Cameo="CAMEO",q.Onlyfans="ONLYFANS",q.Substack="SUBSTACK",q.Kickstarter="KICKSTARTER",q.Indiegogo="INDIEGOGO",q.BuyMeACoffee="BUY_ME_A_COFFEE",q.Shopify="SHOPIFY",q))(GR||{}),ro,cn,io,no,so,oo,ao,rr,lo,uo,ot,_r=class _r{constructor(e,t){l(this,ro);l(this,cn);l(this,io);l(this,no);l(this,so);l(this,oo);l(this,ao);l(this,rr,new Map);l(this,lo);l(this,uo);l(this,ot);Y(this),y(e.id,"User ID is missing or undefined"),y(e.name,"Username is missing or undefined"),y(e.createdUtc,"User is missing created date"),d(this,ro,oe(Qa(e.id)?e.id:`t2_${e.id}`)),d(this,cn,e.name),d(this,oo,e.over18??!1),d(this,ao,e.isEmployee??!1);let i=new Date(0);if(i.setUTCSeconds(e.createdUtc),d(this,io,i),d(this,no,e.linkKarma??0),d(this,so,e.commentKarma??0),e.modPermissions)for(let[n,o]of Object.entries(e.modPermissions))s(this,rr).set(n,mS(o));d(this,lo,new URL(e.subreddit?.url??"","https://www.reddit.com").toString()),d(this,uo,e.subreddit?.url??""),d(this,ot,t)}get id(){return s(this,ro)}get username(){return s(this,cn)}get createdAt(){return s(this,io)}get linkKarma(){return s(this,no)}get commentKarma(){return s(this,so)}get nsfw(){return s(this,oo)}get isAdmin(){return s(this,ao)}get modPermissions(){return s(this,rr)}get url(){return s(this,lo)}get permalink(){return s(this,uo)}toJSON(){return{id:this.id,username:this.username,createdAt:this.createdAt,linkKarma:this.linkKarma,commentKarma:this.commentKarma,nsfw:this.nsfw,modPermissionsBySubreddit:Object.fromEntries(this.modPermissions)}}async getModPermissionsForSubreddit(e){if(s(this,rr).has(e))return s(this,rr).get(e);let t=await _r.getSubredditUsersByType({subredditName:e,type:"moderators",username:this.username},s(this,ot)).all();if(t.length===0)return[];let i=t[0].modPermissions.get(e)??[];return i.length>0&&s(this,rr).set(e,i),i}getComments(e){return re.getCommentsByUser({username:this.username,...e},s(this,ot))}getPosts(e){return z.getPostsByUser({username:this.username,...e},s(this,ot))}async getUserFlairBySubreddit(e){let t=await Ue.getUserFlairBySubreddit({subreddit:e,name:s(this,cn)},s(this,ot));return t.users[0]?_s(t.users[0]):void 0}getSnoovatarUrl(){return _r.getSnoovatarUrl(this.username,s(this,ot))}async getSocialLinks(){let i=await ee.query("GetUserSocialLinks","2aca18ef5f4fc75fb91cdaace3e9aeeae2cb3843b5c26ad511e6f01b8521593a",{name:this.username},s(this,ot));return i.data?.user?.profile?.socialLinks?i.data.user.profile.socialLinks.map(n=>({...n,handle:n.handle??void 0})):[]}static async getById(e,t){let o=(await u.redditAPIPlugins.Users.UserDataByAccountIds({ids:e},t))?.users?.[e]?.name;return o==null?void 0:_r.getByUsername(o,t)}static async getByUsername(e,t){let n=await u.redditAPIPlugins.Users.UserAbout({username:e},t);if(n.data?.id)return new _r(n.data,t)}static async getFromMetadata(e,t){y(t);let i=t?.[e]?.values[0];return i?_r.getById(oe(i),t):Promise.resolve(void 0)}static getSubredditUsersByType(e,t){let i=u.redditAPIPlugins.Subreddits;return new V({hasMore:!0,pageSize:e.pageSize,limit:e.limit,after:e.after,before:e.before,fetch:async n=>{let o=await i.AboutWhere({where:e.type,user:e.username,subreddit:e.subredditName,show:"all",...n},t);return zR(o,e.subredditName,t)}})}static async createRelationship(e,t){let i=u.redditAPIPlugins.Users,{type:n,subredditName:o,username:a,permissions:c,...p}=e,g=await i.Friend({type:n,subreddit:o,name:a,permissions:c?km(c):void 0,...p},t);if(g.json?.errors?.length)throw new Error(g.json.errors.join(`
4
4
  `))}static async removeRelationship(e,t){await u.redditAPIPlugins.Users.Unfriend({type:e.type,subreddit:e.subredditName,name:e.username},t)}static async setModeratorPermissions(e,t,i,n){let a=await u.redditAPIPlugins.Users.SetPermissions({subreddit:t,name:e,type:"moderator",permissions:km(i)},n);if(a.json?.errors?.length)throw new Error(a.json.errors.join(`