@devvit/public-api 0.11.0-next-2024-08-01-8accf308b.0 → 0.11.0-next-2024-08-01-3d10bfd31.0

Sign up to get free protection for your applications and to get access to all the features.
package/public-api.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var SS=Object.create;var Lm=Object.defineProperty;var PS=Object.getOwnPropertyDescriptor;var CS=Object.getOwnPropertyNames;var IS=Object.getPrototypeOf,wS=Object.prototype.hasOwnProperty;var Um=r=>{throw TypeError(r)};var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var xS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of CS(e))!wS.call(r,n)&&n!==t&&Lm(r,n,{get:()=>e[n],enumerable:!(i=PS(e,n))||i.enumerable});return r};var _n=(r,e,t)=>(t=r!=null?SS(IS(r)):{},xS(e||!r||!r.__esModule?Lm(t,"default",{value:r,enumerable:!0}):t,r));var fl=(r,e,t)=>e.has(r)||Um("Cannot "+t);var s=(r,e,t)=>(fl(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>e.has(r)?Um("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),d=(r,e,t,i)=>(fl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),S=(r,e,t)=>(fl(r,e,"access private method"),t);var oe=h((ZO,Bm)=>{Bm.exports=function(r){try{return!!r()}catch{return!0}}});var ka=h((YO,Dm)=>{var TS=oe();Dm.exports=!TS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var X=h((QO,qm)=>{var _m=ka(),Nm=Function.prototype,gl=Nm.call,AS=_m&&Nm.bind.bind(gl,gl);qm.exports=_m?AS:function(r){return function(){return gl.apply(r,arguments)}}});var jm=h((eF,Hm)=>{var ES=Math.ceil,RS=Math.floor;Hm.exports=Math.trunc||function(e){var t=+e;return(t>0?RS:ES)(t)}});var Sa=h((tF,Wm)=>{var OS=jm();Wm.exports=function(r){var e=+r;return e!==e||e===0?0:OS(e)}});var ce=h((rF,Gm)=>{var Pa=function(r){return r&&r.Math==Math&&r};Gm.exports=Pa(typeof globalThis=="object"&&globalThis)||Pa(typeof window=="object"&&window)||Pa(typeof self=="object"&&self)||Pa(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var jr=h((iF,Vm)=>{Vm.exports=!1});var Ca=h((nF,Jm)=>{var zm=ce(),FS=Object.defineProperty;Jm.exports=function(r,e){try{FS(zm,r,{value:e,configurable:!0,writable:!0})}catch{zm[r]=e}return e}});var Ia=h((sF,Km)=>{var MS=ce(),LS=Ca(),$m="__core-js_shared__",US=MS[$m]||LS($m,{});Km.exports=US});var hl=h((oF,Zm)=>{var BS=jr(),Xm=Ia();(Zm.exports=function(r,e){return Xm[r]||(Xm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:BS?"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 wa=h((aF,Ym)=>{Ym.exports=function(r){return r==null}});var xa=h((dF,Qm)=>{var DS=wa(),_S=TypeError;Qm.exports=function(r){if(DS(r))throw _S("Can't call method on "+r);return r}});var Nn=h((lF,ep)=>{var NS=xa(),qS=Object;ep.exports=function(r){return qS(NS(r))}});var Ce=h((uF,tp)=>{var HS=X(),jS=Nn(),WS=HS({}.hasOwnProperty);tp.exports=Object.hasOwn||function(e,t){return WS(jS(e),t)}});var vl=h((cF,rp)=>{var GS=X(),VS=0,zS=Math.random(),JS=GS(1 .toString);rp.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+JS(++VS+zS,36)}});var np=h((mF,ip)=>{ip.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var cp=h((pF,up)=>{var lp=ce(),yl=np(),sp=lp.process,op=lp.Deno,ap=sp&&sp.versions||op&&op.version,dp=ap&&ap.v8,je,Ta;dp&&(je=dp.split("."),Ta=je[0]>0&&je[0]<4?1:+(je[0]+je[1]));!Ta&&yl&&(je=yl.match(/Edge\/(\d+)/),(!je||je[1]>=74)&&(je=yl.match(/Chrome\/(\d+)/),je&&(Ta=+je[1])));up.exports=Ta});var bl=h((fF,pp)=>{var mp=cp(),$S=oe();pp.exports=!!Object.getOwnPropertySymbols&&!$S(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&mp&&mp<41})});var kl=h((gF,fp)=>{var KS=bl();fp.exports=KS&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ie=h((hF,hp)=>{var XS=ce(),ZS=hl(),gp=Ce(),YS=vl(),QS=bl(),eP=kl(),Wr=XS.Symbol,Sl=ZS("wks"),tP=eP?Wr.for||Wr:Wr&&Wr.withoutSetter||YS;hp.exports=function(r){return gp(Sl,r)||(Sl[r]=QS&&gp(Wr,r)?Wr[r]:tP("Symbol."+r)),Sl[r]}});var bp=h((vF,yp)=>{var rP=Ie(),iP=rP("toStringTag"),vp={};vp[iP]="z";yp.exports=String(vp)==="[object z]"});var Cl=h((yF,kp)=>{var Pl=typeof document=="object"&&document.all,nP=typeof Pl>"u"&&Pl!==void 0;kp.exports={all:Pl,IS_HTMLDDA:nP}});var Z=h((bF,Pp)=>{var Sp=Cl(),sP=Sp.all;Pp.exports=Sp.IS_HTMLDDA?function(r){return typeof r=="function"||r===sP}:function(r){return typeof r=="function"}});var Aa=h((kF,Ip)=>{var Cp=X(),oP=Cp({}.toString),aP=Cp("".slice);Ip.exports=function(r){return aP(oP(r),8,-1)}});var qn=h((SF,wp)=>{var dP=bp(),lP=Z(),Ea=Aa(),uP=Ie(),cP=uP("toStringTag"),mP=Object,pP=Ea(function(){return arguments}())=="Arguments",fP=function(r,e){try{return r[e]}catch{}};wp.exports=dP?Ea:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=fP(e=mP(r),cP))=="string"?t:pP?Ea(e):(i=Ea(e))=="Object"&&lP(e.callee)?"Arguments":i}});var Hn=h((PF,xp)=>{var gP=qn(),hP=String;xp.exports=function(r){if(gP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return hP(r)}});var wl=h((CF,Ep)=>{var Il=X(),vP=Sa(),yP=Hn(),bP=xa(),kP=Il("".charAt),Tp=Il("".charCodeAt),SP=Il("".slice),Ap=function(r){return function(e,t){var i=yP(bP(e)),n=vP(t),o=i.length,a,c;return n<0||n>=o?r?"":void 0:(a=Tp(i,n),a<55296||a>56319||n+1===o||(c=Tp(i,n+1))<56320||c>57343?r?kP(i,n):a:r?SP(i,n,n+2):(a-55296<<10)+(c-56320)+65536)}};Ep.exports={codeAt:Ap(!1),charAt:Ap(!0)}});var Fp=h((IF,Op)=>{var PP=ce(),CP=Z(),Rp=PP.WeakMap;Op.exports=CP(Rp)&&/native code/.test(String(Rp))});var Pt=h((wF,Up)=>{var Mp=Z(),Lp=Cl(),IP=Lp.all;Up.exports=Lp.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Mp(r)||r===IP}:function(r){return typeof r=="object"?r!==null:Mp(r)}});var me=h((xF,Bp)=>{var wP=oe();Bp.exports=!wP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Tl=h((TF,_p)=>{var xP=ce(),Dp=Pt(),xl=xP.document,TP=Dp(xl)&&Dp(xl.createElement);_p.exports=function(r){return TP?xl.createElement(r):{}}});var Al=h((AF,Np)=>{var AP=me(),EP=oe(),RP=Tl();Np.exports=!AP&&!EP(function(){return Object.defineProperty(RP("div"),"a",{get:function(){return 7}}).a!=7})});var El=h((EF,qp)=>{var OP=me(),FP=oe();qp.exports=OP&&FP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Ze=h((RF,Hp)=>{var MP=Pt(),LP=String,UP=TypeError;Hp.exports=function(r){if(MP(r))return r;throw UP(LP(r)+" is not an object")}});var We=h((OF,jp)=>{var BP=ka(),Ra=Function.prototype.call;jp.exports=BP?Ra.bind(Ra):function(){return Ra.apply(Ra,arguments)}});var jn=h((FF,Wp)=>{var Rl=ce(),DP=Z(),_P=function(r){return DP(r)?r:void 0};Wp.exports=function(r,e){return arguments.length<2?_P(Rl[r]):Rl[r]&&Rl[r][e]}});var Ol=h((MF,Gp)=>{var NP=X();Gp.exports=NP({}.isPrototypeOf)});var Fl=h((LF,Vp)=>{var qP=jn(),HP=Z(),jP=Ol(),WP=kl(),GP=Object;Vp.exports=WP?function(r){return typeof r=="symbol"}:function(r){var e=qP("Symbol");return HP(e)&&jP(e.prototype,GP(r))}});var Ml=h((UF,zp)=>{var VP=String;zp.exports=function(r){try{return VP(r)}catch{return"Object"}}});var Oa=h((BF,Jp)=>{var zP=Z(),JP=Ml(),$P=TypeError;Jp.exports=function(r){if(zP(r))return r;throw $P(JP(r)+" is not a function")}});var Fa=h((DF,$p)=>{var KP=Oa(),XP=wa();$p.exports=function(r,e){var t=r[e];return XP(t)?void 0:KP(t)}});var Xp=h((_F,Kp)=>{var Ll=We(),Ul=Z(),Bl=Pt(),ZP=TypeError;Kp.exports=function(r,e){var t,i;if(e==="string"&&Ul(t=r.toString)&&!Bl(i=Ll(t,r))||Ul(t=r.valueOf)&&!Bl(i=Ll(t,r))||e!=="string"&&Ul(t=r.toString)&&!Bl(i=Ll(t,r)))return i;throw ZP("Can't convert object to primitive value")}});var ef=h((NF,Qp)=>{var YP=We(),Zp=Pt(),Yp=Fl(),QP=Fa(),eC=Xp(),tC=Ie(),rC=TypeError,iC=tC("toPrimitive");Qp.exports=function(r,e){if(!Zp(r)||Yp(r))return r;var t=QP(r,iC),i;if(t){if(e===void 0&&(e="default"),i=YP(t,r,e),!Zp(i)||Yp(i))return i;throw rC("Can't convert object to primitive value")}return e===void 0&&(e="number"),eC(r,e)}});var Ma=h((qF,tf)=>{var nC=ef(),sC=Fl();tf.exports=function(r){var e=nC(r,"string");return sC(e)?e:e+""}});var Ye=h(nf=>{var oC=me(),aC=Al(),dC=El(),La=Ze(),rf=Ma(),lC=TypeError,Dl=Object.defineProperty,uC=Object.getOwnPropertyDescriptor,_l="enumerable",Nl="configurable",ql="writable";nf.f=oC?dC?function(e,t,i){if(La(e),t=rf(t),La(i),typeof e=="function"&&t==="prototype"&&"value"in i&&ql in i&&!i[ql]){var n=uC(e,t);n&&n[ql]&&(e[t]=i.value,i={configurable:Nl in i?i[Nl]:n[Nl],enumerable:_l in i?i[_l]:n[_l],writable:!1})}return Dl(e,t,i)}:Dl:function(e,t,i){if(La(e),t=rf(t),La(i),aC)try{return Dl(e,t,i)}catch{}if("get"in i||"set"in i)throw lC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Gr=h((jF,sf)=>{sf.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Ua=h((WF,of)=>{var cC=me(),mC=Ye(),pC=Gr();of.exports=cC?function(r,e,t){return mC.f(r,e,pC(1,t))}:function(r,e,t){return r[e]=t,r}});var Ba=h((GF,df)=>{var fC=hl(),gC=vl(),af=fC("keys");df.exports=function(r){return af[r]||(af[r]=gC(r))}});var Da=h((VF,lf)=>{lf.exports={}});var Vr=h((zF,mf)=>{var hC=Fp(),cf=ce(),vC=Pt(),yC=Ua(),Hl=Ce(),jl=Ia(),bC=Ba(),kC=Da(),uf="Object already initialized",Wl=cf.TypeError,SC=cf.WeakMap,_a,Wn,Na,PC=function(r){return Na(r)?Wn(r):_a(r,{})},CC=function(r){return function(e){var t;if(!vC(e)||(t=Wn(e)).type!==r)throw Wl("Incompatible receiver, "+r+" required");return t}};hC||jl.state?(Ge=jl.state||(jl.state=new SC),Ge.get=Ge.get,Ge.has=Ge.has,Ge.set=Ge.set,_a=function(r,e){if(Ge.has(r))throw Wl(uf);return e.facade=r,Ge.set(r,e),e},Wn=function(r){return Ge.get(r)||{}},Na=function(r){return Ge.has(r)}):(ir=bC("state"),kC[ir]=!0,_a=function(r,e){if(Hl(r,ir))throw Wl(uf);return e.facade=r,yC(r,ir,e),e},Wn=function(r){return Hl(r,ir)?r[ir]:{}},Na=function(r){return Hl(r,ir)});var Ge,ir;mf.exports={set:_a,get:Wn,has:Na,enforce:PC,getterFor:CC}});var Gl=h(gf=>{"use strict";var pf={}.propertyIsEnumerable,ff=Object.getOwnPropertyDescriptor,IC=ff&&!pf.call({1:2},1);gf.f=IC?function(e){var t=ff(this,e);return!!t&&t.enumerable}:pf});var zl=h(($F,hf)=>{var wC=X(),xC=oe(),TC=Aa(),Vl=Object,AC=wC("".split);hf.exports=xC(function(){return!Vl("z").propertyIsEnumerable(0)})?function(r){return TC(r)=="String"?AC(r,""):Vl(r)}:Vl});var zr=h((KF,vf)=>{var EC=zl(),RC=xa();vf.exports=function(r){return EC(RC(r))}});var Jl=h(bf=>{var OC=me(),FC=We(),MC=Gl(),LC=Gr(),UC=zr(),BC=Ma(),DC=Ce(),_C=Al(),yf=Object.getOwnPropertyDescriptor;bf.f=OC?yf:function(e,t){if(e=UC(e),t=BC(t),_C)try{return yf(e,t)}catch{}if(DC(e,t))return LC(!FC(MC.f,e,t),e[t])}});var Xl=h((ZF,Sf)=>{var $l=me(),NC=Ce(),kf=Function.prototype,qC=$l&&Object.getOwnPropertyDescriptor,Kl=NC(kf,"name"),HC=Kl&&function(){}.name==="something",jC=Kl&&(!$l||$l&&qC(kf,"name").configurable);Sf.exports={EXISTS:Kl,PROPER:HC,CONFIGURABLE:jC}});var Yl=h((YF,Pf)=>{var WC=X(),GC=Z(),Zl=Ia(),VC=WC(Function.toString);GC(Zl.inspectSource)||(Zl.inspectSource=function(r){return VC(r)});Pf.exports=Zl.inspectSource});var tu=h((QF,wf)=>{var eu=X(),zC=oe(),JC=Z(),qa=Ce(),Ql=me(),$C=Xl().CONFIGURABLE,KC=Yl(),If=Vr(),XC=If.enforce,ZC=If.get,Cf=String,Ha=Object.defineProperty,YC=eu("".slice),QC=eu("".replace),eI=eu([].join),tI=Ql&&!zC(function(){return Ha(function(){},"length",{value:8}).length!==8}),rI=String(String).split("String"),iI=wf.exports=function(r,e,t){YC(Cf(e),0,7)==="Symbol("&&(e="["+QC(Cf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!qa(r,"name")||$C&&r.name!==e)&&(Ql?Ha(r,"name",{value:e,configurable:!0}):r.name=e),tI&&t&&qa(t,"arity")&&r.length!==t.arity&&Ha(r,"length",{value:t.arity});try{t&&qa(t,"constructor")&&t.constructor?Ql&&Ha(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=XC(r);return qa(i,"source")||(i.source=eI(rI,typeof e=="string"?e:"")),r};Function.prototype.toString=iI(function(){return JC(this)&&ZC(this).source||KC(this)},"toString")});var nr=h((eM,xf)=>{var nI=Z(),sI=Ye(),oI=tu(),aI=Ca();xf.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(nI(t)&&oI(t,o,i),i.global)n?r[e]=t:aI(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:sI.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var ru=h((tM,Tf)=>{var dI=Sa(),lI=Math.max,uI=Math.min;Tf.exports=function(r,e){var t=dI(r);return t<0?lI(t+e,0):uI(t,e)}});var Ef=h((rM,Af)=>{var cI=Sa(),mI=Math.min;Af.exports=function(r){return r>0?mI(cI(r),9007199254740991):0}});var ja=h((iM,Rf)=>{var pI=Ef();Rf.exports=function(r){return pI(r.length)}});var Mf=h((nM,Ff)=>{var fI=zr(),gI=ru(),hI=ja(),Of=function(r){return function(e,t,i){var n=fI(e),o=hI(n),a=gI(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}};Ff.exports={includes:Of(!0),indexOf:Of(!1)}});var nu=h((sM,Uf)=>{var vI=X(),iu=Ce(),yI=zr(),bI=Mf().indexOf,kI=Da(),Lf=vI([].push);Uf.exports=function(r,e){var t=yI(r),i=0,n=[],o;for(o in t)!iu(kI,o)&&iu(t,o)&&Lf(n,o);for(;e.length>i;)iu(t,o=e[i++])&&(~bI(n,o)||Lf(n,o));return n}});var Wa=h((oM,Bf)=>{Bf.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var _f=h(Df=>{var SI=nu(),PI=Wa(),CI=PI.concat("length","prototype");Df.f=Object.getOwnPropertyNames||function(e){return SI(e,CI)}});var su=h(Nf=>{Nf.f=Object.getOwnPropertySymbols});var Hf=h((lM,qf)=>{var II=jn(),wI=X(),xI=_f(),TI=su(),AI=Ze(),EI=wI([].concat);qf.exports=II("Reflect","ownKeys")||function(e){var t=xI.f(AI(e)),i=TI.f;return i?EI(t,i(e)):t}});var Gf=h((uM,Wf)=>{var jf=Ce(),RI=Hf(),OI=Jl(),FI=Ye();Wf.exports=function(r,e,t){for(var i=RI(e),n=FI.f,o=OI.f,a=0;a<i.length;a++){var c=i[a];!jf(r,c)&&!(t&&jf(t,c))&&n(r,c,o(e,c))}}});var zf=h((cM,Vf)=>{var MI=oe(),LI=Z(),UI=/#|\.prototype\./,Gn=function(r,e){var t=DI[BI(r)];return t==NI?!0:t==_I?!1:LI(e)?MI(e):!!e},BI=Gn.normalize=function(r){return String(r).replace(UI,".").toLowerCase()},DI=Gn.data={},_I=Gn.NATIVE="N",NI=Gn.POLYFILL="P";Vf.exports=Gn});var Vn=h((mM,Jf)=>{var ou=ce(),qI=Jl().f,HI=Ua(),jI=nr(),WI=Ca(),GI=Gf(),VI=zf();Jf.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,c,p,f,v;if(i?a=ou:n?a=ou[t]||WI(t,{}):a=(ou[t]||{}).prototype,a)for(c in e){if(f=e[c],r.dontCallGetSet?(v=qI(a,c),p=v&&v.value):p=a[c],o=VI(i?c:t+(n?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;GI(f,p)}(r.sham||p&&p.sham)&&HI(f,"sham",!0),jI(a,c,f,r)}}});var au=h((pM,$f)=>{var zI=nu(),JI=Wa();$f.exports=Object.keys||function(e){return zI(e,JI)}});var Xf=h(Kf=>{var $I=me(),KI=El(),XI=Ye(),ZI=Ze(),YI=zr(),QI=au();Kf.f=$I&&!KI?Object.defineProperties:function(e,t){ZI(e);for(var i=YI(t),n=QI(t),o=n.length,a=0,c;o>a;)XI.f(e,c=n[a++],i[c]);return e}});var Yf=h((gM,Zf)=>{var ew=jn();Zf.exports=ew("document","documentElement")});var zn=h((hM,sg)=>{var tw=Ze(),rw=Xf(),Qf=Wa(),iw=Da(),nw=Yf(),sw=Tl(),ow=Ba(),eg=">",tg="<",lu="prototype",uu="script",ig=ow("IE_PROTO"),du=function(){},ng=function(r){return tg+uu+eg+r+tg+"/"+uu+eg},rg=function(r){r.write(ng("")),r.close();var e=r.parentWindow.Object;return r=null,e},aw=function(){var r=sw("iframe"),e="java"+uu+":",t;return r.style.display="none",nw.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(ng("document.F=Object")),t.close(),t.F},Ga,Va=function(){try{Ga=new ActiveXObject("htmlfile")}catch{}Va=typeof document<"u"?document.domain&&Ga?rg(Ga):aw():rg(Ga);for(var r=Qf.length;r--;)delete Va[lu][Qf[r]];return Va()};iw[ig]=!0;sg.exports=Object.create||function(e,t){var i;return e!==null?(du[lu]=tw(e),i=new du,du[lu]=null,i[ig]=e):i=Va(),t===void 0?i:rw.f(i,t)}});var ag=h((vM,og)=>{var dw=oe();og.exports=!dw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var mu=h((yM,lg)=>{var lw=Ce(),uw=Z(),cw=Nn(),mw=Ba(),pw=ag(),dg=mw("IE_PROTO"),cu=Object,fw=cu.prototype;lg.exports=pw?cu.getPrototypeOf:function(r){var e=cw(r);if(lw(e,dg))return e[dg];var t=e.constructor;return uw(t)&&e instanceof t?t.prototype:e instanceof cu?fw:null}});var hu=h((bM,mg)=>{"use strict";var gw=oe(),hw=Z(),vw=Pt(),yw=zn(),ug=mu(),bw=nr(),kw=Ie(),Sw=jr(),gu=kw("iterator"),cg=!1,at,pu,fu;[].keys&&(fu=[].keys(),"next"in fu?(pu=ug(ug(fu)),pu!==Object.prototype&&(at=pu)):cg=!0);var Pw=!vw(at)||gw(function(){var r={};return at[gu].call(r)!==r});Pw?at={}:Sw&&(at=yw(at));hw(at[gu])||bw(at,gu,function(){return this});mg.exports={IteratorPrototype:at,BUGGY_SAFARI_ITERATORS:cg}});var Jn=h((kM,fg)=>{var Cw=Ye().f,Iw=Ce(),ww=Ie(),pg=ww("toStringTag");fg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Iw(r,pg)&&Cw(r,pg,{configurable:!0,value:e})}});var Jr=h((SM,gg)=>{gg.exports={}});var vu=h((PM,hg)=>{"use strict";var xw=hu().IteratorPrototype,Tw=zn(),Aw=Gr(),Ew=Jn(),Rw=Jr(),Ow=function(){return this};hg.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=Tw(xw,{next:Aw(+!i,t)}),Ew(r,n,!1,!0),Rw[n]=Ow,r}});var yg=h((CM,vg)=>{var Fw=Z(),Mw=String,Lw=TypeError;vg.exports=function(r){if(typeof r=="object"||Fw(r))return r;throw Lw("Can't set "+Mw(r)+" as a prototype")}});var kg=h((IM,bg)=>{var Uw=X(),Bw=Ze(),Dw=yg();bg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Uw(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return Bw(n),Dw(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var bu=h((wM,Rg)=>{"use strict";var _w=Vn(),Nw=We(),za=jr(),Ag=Xl(),qw=Z(),Hw=vu(),Sg=mu(),Pg=kg(),jw=Jn(),Ww=Ua(),yu=nr(),Gw=Ie(),Cg=Jr(),Eg=hu(),Vw=Ag.PROPER,zw=Ag.CONFIGURABLE,Ig=Eg.IteratorPrototype,Ja=Eg.BUGGY_SAFARI_ITERATORS,$n=Gw("iterator"),wg="keys",Kn="values",xg="entries",Tg=function(){return this};Rg.exports=function(r,e,t,i,n,o,a){Hw(t,e,i);var c=function(M){if(M===n&&b)return b;if(!Ja&&M in v)return v[M];switch(M){case wg:return function(){return new t(this,M)};case Kn:return function(){return new t(this,M)};case xg:return function(){return new t(this,M)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,v=r.prototype,m=v[$n]||v["@@iterator"]||n&&v[n],b=!Ja&&m||c(n),y=e=="Array"&&v.entries||m,C,I,T;if(y&&(C=Sg(y.call(new r)),C!==Object.prototype&&C.next&&(!za&&Sg(C)!==Ig&&(Pg?Pg(C,Ig):qw(C[$n])||yu(C,$n,Tg)),jw(C,p,!0,!0),za&&(Cg[p]=Tg))),Vw&&n==Kn&&m&&m.name!==Kn&&(!za&&zw?Ww(v,"name",Kn):(f=!0,b=function(){return Nw(m,this)})),n)if(I={values:c(Kn),keys:o?b:c(wg),entries:c(xg)},a)for(T in I)(Ja||f||!(T in v))&&yu(v,T,I[T]);else _w({target:e,proto:!0,forced:Ja||f},I);return(!za||a)&&v[$n]!==b&&yu(v,$n,b,{name:n}),Cg[e]=b,I}});var ku=h((xM,Og)=>{Og.exports=function(r,e){return{value:r,done:e}}});var Ug=h(()=>{"use strict";var Jw=wl().charAt,$w=Hn(),Mg=Vr(),Kw=bu(),Fg=ku(),Lg="String Iterator",Xw=Mg.set,Zw=Mg.getterFor(Lg);Kw(String,"String",function(r){Xw(this,{type:Lg,string:$w(r),index:0})},function(){var e=Zw(this),t=e.string,i=e.index,n;return i>=t.length?Fg(void 0,!0):(n=Jw(t,i),e.index+=n.length,Fg(n,!1))})});var Su=h((EM,Bg)=>{var Yw=oe(),Qw=Ie(),ex=jr(),tx=Qw("iterator");Bg.exports=!Yw(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}),ex&&!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[tx]||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 _g=h((RM,Dg)=>{var rx=Aa(),ix=X();Dg.exports=function(r){if(rx(r)==="Function")return ix(r)}});var $a=h((OM,qg)=>{var Ng=_g(),nx=Oa(),sx=ka(),ox=Ng(Ng.bind);qg.exports=function(r,e){return nx(r),e===void 0?r:sx?ox(r,e):function(){return r.apply(e,arguments)}}});var Wg=h((FM,jg)=>{var Hg=tu(),ax=Ye();jg.exports=function(r,e,t){return t.get&&Hg(t.get,e,{getter:!0}),t.set&&Hg(t.set,e,{setter:!0}),ax.f(r,e,t)}});var Pu=h((MM,Gg)=>{var dx=Ol(),lx=TypeError;Gg.exports=function(r,e){if(dx(e,r))return r;throw lx("Incorrect invocation")}});var $g=h((LM,Jg)=>{"use strict";var Vg=me(),ux=X(),cx=We(),mx=oe(),Cu=au(),px=su(),fx=Gl(),gx=Nn(),hx=zl(),$r=Object.assign,zg=Object.defineProperty,vx=ux([].concat);Jg.exports=!$r||mx(function(){if(Vg&&$r({b:1},$r(zg({},"a",{enumerable:!0,get:function(){zg(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}),$r({},r)[t]!=7||Cu($r({},e)).join("")!=i})?function(e,t){for(var i=gx(e),n=arguments.length,o=1,a=px.f,c=fx.f;n>o;)for(var p=hx(arguments[o++]),f=a?vx(Cu(p),a(p)):Cu(p),v=f.length,m=0,b;v>m;)b=f[m++],(!Vg||cx(c,p,b))&&(i[b]=p[b]);return i}:$r});var Zg=h((UM,Xg)=>{var yx=We(),Kg=Ze(),bx=Fa();Xg.exports=function(r,e,t){var i,n;Kg(r);try{if(i=bx(r,"return"),!i){if(e==="throw")throw t;return t}i=yx(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Kg(i),t}});var Qg=h((BM,Yg)=>{var kx=Ze(),Sx=Zg();Yg.exports=function(r,e,t,i){try{return i?e(kx(t)[0],t[1]):e(t)}catch(n){Sx(r,"throw",n)}}});var th=h((DM,eh)=>{var Px=Ie(),Cx=Jr(),Ix=Px("iterator"),wx=Array.prototype;eh.exports=function(r){return r!==void 0&&(Cx.Array===r||wx[Ix]===r)}});var ah=h((_M,oh)=>{var xx=X(),Tx=oe(),rh=Z(),Ax=qn(),Ex=jn(),Rx=Yl(),ih=function(){},Ox=[],nh=Ex("Reflect","construct"),Iu=/^\s*(?:class|function)\b/,Fx=xx(Iu.exec),Mx=!Iu.exec(ih),Xn=function(e){if(!rh(e))return!1;try{return nh(ih,Ox,e),!0}catch{return!1}},sh=function(e){if(!rh(e))return!1;switch(Ax(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mx||!!Fx(Iu,Rx(e))}catch{return!0}};sh.sham=!0;oh.exports=!nh||Tx(function(){var r;return Xn(Xn.call)||!Xn(Object)||!Xn(function(){r=!0})||r})?sh:Xn});var wu=h((NM,dh)=>{"use strict";var Lx=Ma(),Ux=Ye(),Bx=Gr();dh.exports=function(r,e,t){var i=Lx(e);i in r?Ux.f(r,i,Bx(0,t)):r[i]=t}});var Ka=h((qM,uh)=>{var Dx=qn(),lh=Fa(),_x=wa(),Nx=Jr(),qx=Ie(),Hx=qx("iterator");uh.exports=function(r){if(!_x(r))return lh(r,Hx)||lh(r,"@@iterator")||Nx[Dx(r)]}});var xu=h((HM,ch)=>{var jx=We(),Wx=Oa(),Gx=Ze(),Vx=Ml(),zx=Ka(),Jx=TypeError;ch.exports=function(r,e){var t=arguments.length<2?zx(r):e;if(Wx(t))return Gx(jx(t,r));throw Jx(Vx(r)+" is not iterable")}});var gh=h((jM,fh)=>{"use strict";var $x=$a(),Kx=We(),Xx=Nn(),Zx=Qg(),Yx=th(),Qx=ah(),eT=ja(),mh=wu(),tT=xu(),rT=Ka(),ph=Array;fh.exports=function(e){var t=Xx(e),i=Qx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=$x(o,n>2?arguments[2]:void 0));var c=rT(t),p=0,f,v,m,b,y,C;if(c&&!(this===ph&&Yx(c)))for(b=tT(t,c),y=b.next,v=i?new this:[];!(m=Kx(y,b)).done;p++)C=a?Zx(b,o,[m.value,p],!0):m.value,mh(v,p,C);else for(f=eT(t),v=i?new this(f):ph(f);f>p;p++)C=a?o(t[p],p):t[p],mh(v,p,C);return v.length=p,v}});var Tu=h((WM,vh)=>{var hh=ru(),iT=ja(),nT=wu(),sT=Array,oT=Math.max;vh.exports=function(r,e,t){for(var i=iT(r),n=hh(e,i),o=hh(t===void 0?i:t,i),a=sT(oT(o-n,0)),c=0;n<o;n++,c++)nT(a,c,r[n]);return a.length=c,a}});var xh=h((GM,wh)=>{var sr=X(),Au=2147483647,Zn=36,Ph=1,Ou=26,aT=38,dT=700,lT=72,uT=128,cT="-",mT=/[^\0-\u007E]/,Ch=/[.\u3002\uFF0E\uFF61]/g,yh="Overflow: input needs wider integers to process",Eu=Zn-Ph,bh=RangeError,pT=sr(Ch.exec),Kr=Math.floor,Ru=String.fromCharCode,kh=sr("".charCodeAt),Ih=sr([].join),Ct=sr([].push),fT=sr("".replace),gT=sr("".split),hT=sr("".toLowerCase),vT=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=kh(r,t++);if(n>=55296&&n<=56319&&t<i){var o=kh(r,t++);(o&64512)==56320?Ct(e,((n&1023)<<10)+(o&1023)+65536):(Ct(e,n),t--)}else Ct(e,n)}return e},Sh=function(r){return r+22+75*(r<26)},yT=function(r,e,t){var i=0;for(r=t?Kr(r/dT):r>>1,r+=Kr(r/e);r>Eu*Ou>>1;)r=Kr(r/Eu),i+=Zn;return Kr(i+(Eu+1)*r/(r+aT))},bT=function(r){var e=[];r=vT(r);var t=r.length,i=uT,n=0,o=lT,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&Ct(e,Ru(c));var p=e.length,f=p;for(p&&Ct(e,cT);f<t;){var v=Au;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<v&&(v=c);var m=f+1;if(v-i>Kr((Au-n)/m))throw bh(yh);for(n+=(v-i)*m,i=v,a=0;a<r.length;a++){if(c=r[a],c<i&&++n>Au)throw bh(yh);if(c==i){for(var b=n,y=Zn;;){var C=y<=o?Ph:y>=o+Ou?Ou:y-o;if(b<C)break;var I=b-C,T=Zn-C;Ct(e,Ru(Sh(C+I%T))),b=Kr(I/T),y+=Zn}Ct(e,Ru(Sh(b))),o=yT(n,m,f==p),n=0,f++}}n++,i++}return Ih(e,"")};wh.exports=function(r){var e=[],t=gT(fT(hT(r),Ch,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],Ct(e,pT(mT,n)?"xn--"+bT(n):n);return Ih(e,".")}});var Fu=h((VM,Th)=>{var kT=TypeError;Th.exports=function(r,e){if(r<e)throw kT("Not enough arguments");return r}});var Eh=h((zM,Ah)=>{var ST=Ie(),PT=zn(),CT=Ye().f,Mu=ST("unscopables"),Lu=Array.prototype;Lu[Mu]==null&&CT(Lu,Mu,{configurable:!0,value:PT(null)});Ah.exports=function(r){Lu[Mu][r]=!0}});var Uh=h((JM,Lh)=>{"use strict";var IT=zr(),Uu=Eh(),Rh=Jr(),Fh=Vr(),wT=Ye().f,xT=bu(),Xa=ku(),TT=jr(),AT=me(),Mh="Array Iterator",ET=Fh.set,RT=Fh.getterFor(Mh);Lh.exports=xT(Array,"Array",function(r,e){ET(this,{type:Mh,target:IT(r),index:0,kind:e})},function(){var r=RT(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,Xa(void 0,!0)):t=="keys"?Xa(i,!1):t=="values"?Xa(e[i],!1):Xa([i,e[i]],!1)},"values");var Oh=Rh.Arguments=Rh.Array;Uu("keys");Uu("values");Uu("entries");if(!TT&&AT&&Oh.name!=="values")try{wT(Oh,"name",{value:"values"})}catch{}});var Dh=h(($M,Bh)=>{var OT=nr();Bh.exports=function(r,e,t){for(var i in e)OT(r,i,e[i],t);return r}});var qh=h((KM,Nh)=>{var _h=Tu(),FT=Math.floor,Bu=function(r,e){var t=r.length,i=FT(t/2);return t<8?MT(r,e):LT(r,Bu(_h(r,0,i),e),Bu(_h(r,i),e),e)},MT=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},LT=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};Nh.exports=Bu});var zu=h((XM,ov)=>{"use strict";Uh();var Hu=Vn(),Zr=ce(),Za=We(),Qe=X(),UT=me(),Yh=Su(),Qh=nr(),BT=Dh(),DT=Jn(),_T=vu(),Gu=Vr(),ev=Pu(),Du=Z(),NT=Ce(),qT=$a(),HT=qn(),jT=Ze(),tv=Pt(),pe=Hn(),WT=zn(),Hh=Gr(),ju=xu(),GT=Ka(),Xr=Fu(),VT=Ie(),zT=qh(),JT=VT("iterator"),es="URLSearchParams",rv=es+"Iterator",iv=Gu.set,Ve=Gu.getterFor(es),$T=Gu.getterFor(rv),KT=Object.getOwnPropertyDescriptor,Vu=function(r){if(!UT)return Zr[r];var e=KT(Zr,r);return e&&e.value},jh=Vu("fetch"),Qa=Vu("Request"),Yn=Vu("Headers"),_u=Qa&&Qa.prototype,Wh=Yn&&Yn.prototype,XT=Zr.RegExp,ZT=Zr.TypeError,nv=Zr.decodeURIComponent,YT=Zr.encodeURIComponent,QT=Qe("".charAt),Gh=Qe([].join),or=Qe([].push),Wu=Qe("".replace),eA=Qe([].shift),Vh=Qe([].splice),zh=Qe("".split),tA=Qe("".slice),rA=/\+/g,Jh=Array(4),iA=function(r){return Jh[r-1]||(Jh[r-1]=XT("((?:%[\\da-f]{2}){"+r+"})","gi"))},nA=function(r){try{return nv(r)}catch{return r}},$h=function(r){var e=Wu(r,rA," "),t=4;try{return nv(e)}catch{for(;t;)e=Wu(e,iA(t--),nA);return e}},sA=/[!'()~]|%20/g,oA={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},aA=function(r){return oA[r]},Kh=function(r){return Wu(YT(r),sA,aA)},Nu=_T(function(e,t){iv(this,{type:rv,iterator:ju(Ve(e).entries),kind:t})},"Iterator",function(){var e=$T(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),sv=function(r){this.entries=[],this.url=null,r!==void 0&&(tv(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?QT(r,0)==="?"?tA(r,1):r:pe(r)))};sv.prototype={type:es,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=GT(r),t,i,n,o,a,c,p;if(e)for(t=ju(r,e),i=t.next;!(n=Za(i,t)).done;){if(o=ju(jT(n.value)),a=o.next,(c=Za(a,o)).done||(p=Za(a,o)).done||!Za(a,o).done)throw ZT("Expected sequence with length 2");or(this.entries,{key:pe(c.value),value:pe(p.value)})}else for(var f in r)NT(r,f)&&or(this.entries,{key:f,value:pe(r[f])})},parseQuery:function(r){if(r)for(var e=zh(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=zh(i,"="),or(this.entries,{key:$h(eA(n)),value:$h(Gh(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],or(e,Kh(i.key)+"="+Kh(i.value));return Gh(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ed=function(){ev(this,Qn);var e=arguments.length>0?arguments[0]:void 0;iv(this,new sv(e))},Qn=ed.prototype;BT(Qn,{append:function(e,t){Xr(arguments.length,2);var i=Ve(this);or(i.entries,{key:pe(e),value:pe(t)}),i.updateURL()},delete:function(r){Xr(arguments.length,1);for(var e=Ve(this),t=e.entries,i=pe(r),n=0;n<t.length;)t[n].key===i?Vh(t,n,1):n++;e.updateURL()},get:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=[],o=0;o<t.length;o++)t[o].key===i&&or(n,t[o].value);return n},has:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Xr(arguments.length,1);for(var i=Ve(this),n=i.entries,o=!1,a=pe(e),c=pe(t),p=0,f;p<n.length;p++)f=n[p],f.key===a&&(o?Vh(n,p--,1):(o=!0,f.value=c));o||or(n,{key:a,value:c}),i.updateURL()},sort:function(){var e=Ve(this);zT(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ve(this).entries,i=qT(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 Nu(this,"keys")},values:function(){return new Nu(this,"values")},entries:function(){return new Nu(this,"entries")}},{enumerable:!0});Qh(Qn,JT,Qn.entries,{name:"entries"});Qh(Qn,"toString",function(){return Ve(this).serialize()},{enumerable:!0});DT(ed,es);Hu({global:!0,constructor:!0,forced:!Yh},{URLSearchParams:ed});!Yh&&Du(Yn)&&(Xh=Qe(Wh.has),Zh=Qe(Wh.set),qu=function(r){if(tv(r)){var e=r.body,t;if(HT(e)===es)return t=r.headers?new Yn(r.headers):new Yn,Xh(t,"content-type")||Zh(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),WT(r,{body:Hh(0,pe(e)),headers:Hh(0,t)})}return r},Du(jh)&&Hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return jh(e,arguments.length>1?qu(arguments[1]):{})}}),Du(Qa)&&(Ya=function(e){return ev(this,_u),new Qa(e,arguments.length>1?qu(arguments[1]):{})},_u.constructor=Ya,Ya.prototype=_u,Hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ya})));var Xh,Zh,qu,Ya;ov.exports={URLSearchParams:ed,getState:Ve}});var wv=h(()=>{"use strict";Ug();var dA=Vn(),dc=me(),lA=Su(),lc=ce(),av=$a(),Ee=X(),sd=nr(),we=Wg(),uA=Pu(),sc=Ce(),uc=$g(),Yr=gh(),ze=Tu(),cA=wl().codeAt,mA=xh(),lt=Hn(),pA=Jn(),fA=Fu(),bv=zu(),kv=Vr(),gA=kv.set,od=kv.getterFor("URL"),hA=bv.URLSearchParams,vA=bv.getState,ts=lc.URL,oc=lc.TypeError,ad=lc.parseInt,yA=Math.floor,dv=Math.pow,Ae=Ee("".charAt),Je=Ee(/./.exec),is=Ee([].join),bA=Ee(1 .toString),kA=Ee([].pop),ei=Ee([].push),lv=Ee("".replace),SA=Ee([].shift),PA=Ee("".split),ss=Ee("".slice),dd=Ee("".toLowerCase),CA=Ee([].unshift),IA="Invalid authority",Ju="Invalid scheme",ar="Invalid host",uv="Invalid port",Sv=/[a-z]/i,wA=/[\d+-.a-z]/i,ac=/\d/,xA=/^0x/i,TA=/^[0-7]+$/,AA=/^\d+$/,Pv=/^[\da-f]+$/i,EA=/[\0\t\n\r #%/:<>?@[\\\]^|]/,RA=/[\0\t\n\r #/:<>?@[\\\]^|]/,OA=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,FA=/[\t\n\r]/g,xe,MA=function(r){var e=PA(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=Je(xA,o)?16:8,o=ss(o,a==8?1:2)),o==="")c=0;else{if(!Je(a==10?AA:a==8?TA:Pv,o))return r;c=ad(o,a)}ei(i,c)}for(n=0;n<t;n++)if(c=i[n],n==t-1){if(c>=dv(256,5-t))return null}else if(c>255)return null;for(p=kA(i),n=0;n<i.length;n++)p+=i[n]*dv(256,3-n);return p},LA=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,c,p,f,v,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&&Je(Pv,b());)o=o*16+ad(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(!Je(ac,b()))return;for(;Je(ac,b());){if(f=ad(b(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}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(v=t-i,t=7;t!=0&&v>0;)m=e[t],e[t--]=e[i+v-1],e[i+--v]=m;else if(t!=8)return;return e},UA=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},rs=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)CA(e,r%256),r=yA(r/256);return is(e,".")}else if(typeof r=="object"){for(e="",i=UA(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=bA(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},nd={},Cv=uc({},nd,{" ":1,'"':1,"<":1,">":1,"`":1}),Iv=uc({},Cv,{"#":1,"?":1,"{":1,"}":1}),$u=uc({},Iv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),It=function(r,e){var t=cA(r,0);return t>32&&t<127&&!sc(e,r)?r:encodeURIComponent(r)},td={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ns=function(r,e){var t;return r.length==2&&Je(Sv,Ae(r,0))&&((t=Ae(r,1))==":"||!e&&t=="|")},cv=function(r){var e;return r.length>1&&ns(ss(r,0,2))&&(r.length==2||(e=Ae(r,2))==="/"||e==="\\"||e==="?"||e==="#")},BA=function(r){return r==="."||dd(r)==="%2e"},DA=function(r){return r=dd(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ku={},mv={},Xu={},pv={},fv={},Zu={},gv={},hv={},rd={},id={},Yu={},Qu={},ec={},tc={},vv={},rc={},Qr={},et={},yv={},dr={},dt={},cc=function(r,e,t){var i=lt(r),n,o,a;if(e){if(o=this.parse(i),o)throw oc(o);this.searchParams=null}else{if(t!==void 0&&(n=new cc(t,!0)),o=this.parse(i,null,n),o)throw oc(o);a=vA(new hA),a.bindURL(this),this.searchParams=a}};cc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Ku,o=0,a="",c=!1,p=!1,f=!1,v,m,b,y;for(r=lt(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=lv(r,OA,"")),r=lv(r,FA,""),v=Yr(r);o<=v.length;){switch(m=v[o],n){case Ku:if(m&&Je(Sv,m))a+=dd(m),n=mv;else{if(e)return Ju;n=Xu;continue}break;case mv:if(m&&(Je(wA,m)||m=="+"||m=="-"||m=="."))a+=dd(m);else if(m==":"){if(e&&(i.isSpecial()!=sc(td,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&td[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=tc:i.isSpecial()&&t&&t.scheme==i.scheme?n=pv:i.isSpecial()?n=hv:v[o+1]=="/"?(n=fv,o++):(i.cannotBeABaseURL=!0,ei(i.path,""),n=yv)}else{if(e)return Ju;a="",n=Xu,o=0;continue}break;case Xu:if(!t||t.cannotBeABaseURL&&m!="#")return Ju;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=ze(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=dt;break}n=t.scheme=="file"?tc:Zu;continue;case pv:if(m=="/"&&v[o+1]=="/")n=rd,o++;else{n=Zu;continue}break;case fv:if(m=="/"){n=id;break}else{n=et;continue}case Zu:if(i.scheme=t.scheme,m==xe)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())n=gv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query="",n=dr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query=t.query,i.fragment="",n=dt;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.path.length--,n=et;continue}break;case gv:if(i.isSpecial()&&(m=="/"||m=="\\"))n=rd;else if(m=="/")n=id;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=et;continue}break;case hv:if(n=rd,m!="/"||Ae(a,o+1)!="/")continue;o++;break;case rd:if(m!="/"&&m!="\\"){n=id;continue}break;case id:if(m=="@"){c&&(a="%40"+a),c=!0,b=Yr(a);for(var C=0;C<b.length;C++){var I=b[C];if(I==":"&&!f){f=!0;continue}var T=It(I,$u);f?i.password+=T:i.username+=T}a=""}else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return IA;o-=Yr(a).length+1,a="",n=Yu}else a+=m;break;case Yu:case Qu:if(e&&i.scheme=="file"){n=rc;continue}else if(m==":"&&!p){if(a=="")return ar;if(y=i.parseHost(a),y)return y;if(a="",n=ec,e==Qu)return}else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return ar;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(y=i.parseHost(a),y)return y;if(a="",n=Qr,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case ec:if(Je(ac,m))a+=m;else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var M=ad(a,10);if(M>65535)return uv;i.port=i.isSpecial()&&M===td[i.scheme]?null:M,a=""}if(e)return;n=Qr;continue}else return uv;break;case tc:if(i.scheme="file",m=="/"||m=="\\")n=vv;else if(t&&t.scheme=="file")if(m==xe)i.host=t.host,i.path=ze(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=ze(t.path),i.query="",n=dr;else if(m=="#")i.host=t.host,i.path=ze(t.path),i.query=t.query,i.fragment="",n=dt;else{cv(is(ze(v,o),""))||(i.host=t.host,i.path=ze(t.path),i.shortenPath()),n=et;continue}else{n=et;continue}break;case vv:if(m=="/"||m=="\\"){n=rc;break}t&&t.scheme=="file"&&!cv(is(ze(v,o),""))&&(ns(t.path[0],!0)?ei(i.path,t.path[0]):i.host=t.host),n=et;continue;case rc:if(m==xe||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&ns(a))n=et;else if(a==""){if(i.host="",e)return;n=Qr}else{if(y=i.parseHost(a),y)return y;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=Qr}continue}else a+=m;break;case Qr:if(i.isSpecial()){if(n=et,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",n=dr;else if(!e&&m=="#")i.fragment="",n=dt;else if(m!=xe&&(n=et,m!="/"))continue;break;case et:if(m==xe||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(DA(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&ei(i.path,"")):BA(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&ei(i.path,""):(i.scheme=="file"&&!i.path.length&&ns(a)&&(i.host&&(i.host=""),a=Ae(a,0)+":"),ei(i.path,a)),a="",i.scheme=="file"&&(m==xe||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)SA(i.path);m=="?"?(i.query="",n=dr):m=="#"&&(i.fragment="",n=dt)}else a+=It(m,Iv);break;case yv:m=="?"?(i.query="",n=dr):m=="#"?(i.fragment="",n=dt):m!=xe&&(i.path[0]+=It(m,nd));break;case dr:!e&&m=="#"?(i.fragment="",n=dt):m!=xe&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=It(m,nd));break;case dt:m!=xe&&(i.fragment+=It(m,Cv));break}o++}},parseHost:function(r){var e,t,i;if(Ae(r,0)=="["){if(Ae(r,r.length-1)!="]"||(e=LA(ss(r,1,-1)),!e))return ar;this.host=e}else if(this.isSpecial()){if(r=mA(r),Je(EA,r)||(e=MA(r),e===null))return ar;this.host=e}else{if(Je(RA,r))return ar;for(e="",t=Yr(r),i=0;i<t.length;i++)e+=It(t[i],nd);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return sc(td,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!ns(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,f=e+":";return n!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=rs(n),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+is(a,"/"):"",c!==null&&(f+="?"+c),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw oc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new ti(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+rs(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(lt(r)+":",Ku)},getUsername:function(){return this.username},setUsername:function(r){var e=Yr(lt(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=It(e[t],$u)}},getPassword:function(){return this.password},setPassword:function(r){var e=Yr(lt(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=It(e[t],$u)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?rs(r):rs(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Yu)},getHostname:function(){var r=this.host;return r===null?"":rs(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Qu)},getPort:function(){var r=this.port;return r===null?"":lt(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=lt(r),r==""?this.port=null:this.parse(r,ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+is(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Qr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=lt(r),r==""?this.query=null:(Ae(r,0)=="?"&&(r=ss(r,1)),this.query="",this.parse(r,dr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=lt(r),r==""){this.fragment=null;return}Ae(r,0)=="#"&&(r=ss(r,1)),this.fragment="",this.parse(r,dt)},update:function(){this.query=this.searchParams.serialize()||null}};var ti=function(e){var t=uA(this,te),i=fA(arguments.length,1)>1?arguments[1]:void 0,n=gA(t,new cc(e,!1,i));dc||(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())},te=ti.prototype,Te=function(r,e){return{get:function(){return od(this)[r]()},set:e&&function(t){return od(this)[e](t)},configurable:!0,enumerable:!0}};dc&&(we(te,"href",Te("serialize","setHref")),we(te,"origin",Te("getOrigin")),we(te,"protocol",Te("getProtocol","setProtocol")),we(te,"username",Te("getUsername","setUsername")),we(te,"password",Te("getPassword","setPassword")),we(te,"host",Te("getHost","setHost")),we(te,"hostname",Te("getHostname","setHostname")),we(te,"port",Te("getPort","setPort")),we(te,"pathname",Te("getPathname","setPathname")),we(te,"search",Te("getSearch","setSearch")),we(te,"searchParams",Te("getSearchParams")),we(te,"hash",Te("getHash","setHash")));sd(te,"toJSON",function(){return od(this).serialize()},{enumerable:!0});sd(te,"toString",function(){return od(this).serialize()},{enumerable:!0});ts&&(ic=ts.createObjectURL,nc=ts.revokeObjectURL,ic&&sd(ti,"createObjectURL",av(ic,ts)),nc&&sd(ti,"revokeObjectURL",av(nc,ts)));var ic,nc;pA(ti,"URL");dA({global:!0,constructor:!0,forced:!lA,sham:!dc},{URL:ti})});var xv=h(()=>{wv()});var Tv=h(()=>{"use strict";var _A=Vn(),NA=We();_A({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return NA(URL.prototype.toString,this)}})});var Av=h(()=>{zu()});var Rv=h((sL,Ev)=>{var qA=ce();Ev.exports=qA});var Fv=h((oL,Ov)=>{xv();Tv();Av();var HA=Rv();Ov.exports=HA.URL});var Nc=h((RD,Hy)=>{var eE=Object.prototype.toString;Hy.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 sE(e)?"generatorfunction":"function";if(tE(e))return"array";if(dE(e))return"buffer";if(aE(e))return"arguments";if(iE(e))return"date";if(rE(e))return"error";if(nE(e))return"regexp";switch(qy(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(oE(e))return"generator";switch(t=eE.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 qy(r){return typeof r.constructor=="function"?r.constructor.name:null}function tE(r){return Array.isArray?Array.isArray(r):r instanceof Array}function rE(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function iE(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function nE(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function sE(r,e){return qy(r)==="GeneratorFunction"}function oE(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function aE(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 dE(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var Gy=h((OD,Wy)=>{"use strict";var jy=Symbol.prototype.valueOf,lE=Nc();function uE(r,e){switch(lE(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 fE(r);case"symbol":return gE(r);case"arraybuffer":return mE(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return pE(r);case"regexp":return cE(r);case"error":return Object.create(r);default:return r}}function cE(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 mE(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function pE(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function fE(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function gE(r){return jy?Object(jy.call(r)):{}}Wy.exports=uE});var zy=h((FD,Vy)=>{"use strict";Vy.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var Ky=h((MD,$y)=>{"use strict";var hE=zy();function Jy(r){return hE(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}$y.exports=function(e){var t,i;return!(Jy(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,Jy(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Zy=h((LD,Xy)=>{"use strict";var vE=Gy(),yE=Nc(),bE=Ky();function qc(r,e){switch(yE(r)){case"object":return kE(r,e);case"array":return SE(r,e);default:return vE(r)}}function kE(r,e){if(typeof e=="function")return e(r);if(e||bE(r)){let t=new r.constructor;for(let i in r)t[i]=qc(r[i],e);return t}return r}function SE(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=qc(r[i],e);return t}Xy.exports=qc});var Yc=h((vs,Ti)=>{var PE=200,Zc="__lodash_hash_undefined__",Od=1,lb=2,ub=9007199254740991,Id="[object Arguments]",Gc="[object Array]",CE="[object AsyncFunction]",cb="[object Boolean]",mb="[object Date]",pb="[object Error]",fb="[object Function]",IE="[object GeneratorFunction]",wd="[object Map]",gb="[object Number]",wE="[object Null]",xi="[object Object]",Yy="[object Promise]",xE="[object Proxy]",hb="[object RegExp]",xd="[object Set]",vb="[object String]",TE="[object Symbol]",AE="[object Undefined]",Vc="[object WeakMap]",yb="[object ArrayBuffer]",Td="[object DataView]",EE="[object Float32Array]",RE="[object Float64Array]",OE="[object Int8Array]",FE="[object Int16Array]",ME="[object Int32Array]",LE="[object Uint8Array]",UE="[object Uint8ClampedArray]",BE="[object Uint16Array]",DE="[object Uint32Array]",_E=/[\\^$.*+?()[\]{}|]/g,NE=/^\[object .+?Constructor\]$/,qE=/^(?:0|[1-9]\d*)$/,H={};H[EE]=H[RE]=H[OE]=H[FE]=H[ME]=H[LE]=H[UE]=H[BE]=H[DE]=!0;H[Id]=H[Gc]=H[yb]=H[cb]=H[Td]=H[mb]=H[pb]=H[fb]=H[wd]=H[gb]=H[xi]=H[hb]=H[xd]=H[vb]=H[Vc]=!1;var bb=typeof global=="object"&&global&&global.Object===Object&&global,HE=typeof self=="object"&&self&&self.Object===Object&&self,pt=bb||HE||Function("return this")(),kb=typeof vs=="object"&&vs&&!vs.nodeType&&vs,Qy=kb&&typeof Ti=="object"&&Ti&&!Ti.nodeType&&Ti,Sb=Qy&&Qy.exports===kb,Hc=Sb&&bb.process,eb=function(){try{return Hc&&Hc.binding&&Hc.binding("util")}catch{}}(),tb=eb&&eb.isTypedArray;function jE(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 WE(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function GE(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 VE(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function zE(r){return function(e){return r(e)}}function JE(r,e){return r.has(e)}function $E(r,e){return r?.[e]}function KE(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function XE(r,e){return function(t){return r(e(t))}}function ZE(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var YE=Array.prototype,QE=Function.prototype,Fd=Object.prototype,jc=pt["__core-js_shared__"],Pb=QE.toString,tt=Fd.hasOwnProperty,rb=function(){var r=/[^.]+$/.exec(jc&&jc.keys&&jc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Cb=Fd.toString,eR=RegExp("^"+Pb.call(tt).replace(_E,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ib=Sb?pt.Buffer:void 0,Ad=pt.Symbol,nb=pt.Uint8Array,Ib=Fd.propertyIsEnumerable,tR=YE.splice,vr=Ad?Ad.toStringTag:void 0,sb=Object.getOwnPropertySymbols,rR=ib?ib.isBuffer:void 0,iR=XE(Object.keys,Object),zc=Ai(pt,"DataView"),ys=Ai(pt,"Map"),Jc=Ai(pt,"Promise"),$c=Ai(pt,"Set"),Kc=Ai(pt,"WeakMap"),bs=Ai(Object,"create"),nR=kr(zc),sR=kr(ys),oR=kr(Jc),aR=kr($c),dR=kr(Kc),ob=Ad?Ad.prototype:void 0,Wc=ob?ob.valueOf:void 0;function yr(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 lR(){this.__data__=bs?bs(null):{},this.size=0}function uR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function cR(r){var e=this.__data__;if(bs){var t=e[r];return t===Zc?void 0:t}return tt.call(e,r)?e[r]:void 0}function mR(r){var e=this.__data__;return bs?e[r]!==void 0:tt.call(e,r)}function pR(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=bs&&e===void 0?Zc:e,this}yr.prototype.clear=lR;yr.prototype.delete=uR;yr.prototype.get=cR;yr.prototype.has=mR;yr.prototype.set=pR;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 fR(){this.__data__=[],this.size=0}function gR(r){var e=this.__data__,t=Md(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():tR.call(e,t,1),--this.size,!0}function hR(r){var e=this.__data__,t=Md(e,r);return t<0?void 0:e[t][1]}function vR(r){return Md(this.__data__,r)>-1}function yR(r,e){var t=this.__data__,i=Md(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ft.prototype.clear=fR;ft.prototype.delete=gR;ft.prototype.get=hR;ft.prototype.has=vR;ft.prototype.set=yR;function br(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 bR(){this.size=0,this.__data__={hash:new yr,map:new(ys||ft),string:new yr}}function kR(r){var e=Ld(this,r).delete(r);return this.size-=e?1:0,e}function SR(r){return Ld(this,r).get(r)}function PR(r){return Ld(this,r).has(r)}function CR(r,e){var t=Ld(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}br.prototype.clear=bR;br.prototype.delete=kR;br.prototype.get=SR;br.prototype.has=PR;br.prototype.set=CR;function Ed(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new br;++e<t;)this.add(r[e])}function IR(r){return this.__data__.set(r,Zc),this}function wR(r){return this.__data__.has(r)}Ed.prototype.add=Ed.prototype.push=IR;Ed.prototype.has=wR;function Lt(r){var e=this.__data__=new ft(r);this.size=e.size}function xR(){this.__data__=new ft,this.size=0}function TR(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function AR(r){return this.__data__.get(r)}function ER(r){return this.__data__.has(r)}function RR(r,e){var t=this.__data__;if(t instanceof ft){var i=t.__data__;if(!ys||i.length<PE-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new br(i)}return t.set(r,e),this.size=t.size,this}Lt.prototype.clear=xR;Lt.prototype.delete=TR;Lt.prototype.get=AR;Lt.prototype.has=ER;Lt.prototype.set=RR;function OR(r,e){var t=Rd(r),i=!t&&zR(r),n=!t&&!i&&Xc(r),o=!t&&!i&&!n&&Ob(r),a=t||i||n||o,c=a?VE(r.length,String):[],p=c.length;for(var f in r)(e||tt.call(r,f))&&!(a&&(f=="length"||n&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||HR(f,p)))&&c.push(f);return c}function Md(r,e){for(var t=r.length;t--;)if(Tb(r[t][0],e))return t;return-1}function FR(r,e,t){var i=e(r);return Rd(r)?i:WE(i,t(r))}function Ss(r){return r==null?r===void 0?AE:wE:vr&&vr in Object(r)?NR(r):VR(r)}function ab(r){return ks(r)&&Ss(r)==Id}function wb(r,e,t,i,n){return r===e?!0:r==null||e==null||!ks(r)&&!ks(e)?r!==r&&e!==e:MR(r,e,t,i,wb,n)}function MR(r,e,t,i,n,o){var a=Rd(r),c=Rd(e),p=a?Gc:Mt(r),f=c?Gc:Mt(e);p=p==Id?xi:p,f=f==Id?xi:f;var v=p==xi,m=f==xi,b=p==f;if(b&&Xc(r)){if(!Xc(e))return!1;a=!0,v=!1}if(b&&!v)return o||(o=new Lt),a||Ob(r)?xb(r,e,t,i,n,o):DR(r,e,p,t,i,n,o);if(!(t&Od)){var y=v&&tt.call(r,"__wrapped__"),C=m&&tt.call(e,"__wrapped__");if(y||C){var I=y?r.value():r,T=C?e.value():e;return o||(o=new Lt),n(I,T,t,i,o)}}return b?(o||(o=new Lt),_R(r,e,t,i,n,o)):!1}function LR(r){if(!Rb(r)||WR(r))return!1;var e=Ab(r)?eR:NE;return e.test(kr(r))}function UR(r){return ks(r)&&Eb(r.length)&&!!H[Ss(r)]}function BR(r){if(!GR(r))return iR(r);var e=[];for(var t in Object(r))tt.call(r,t)&&t!="constructor"&&e.push(t);return e}function xb(r,e,t,i,n,o){var a=t&Od,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var v=-1,m=!0,b=t&lb?new Ed:void 0;for(o.set(r,e),o.set(e,r);++v<c;){var y=r[v],C=e[v];if(i)var I=a?i(C,y,v,e,r,o):i(y,C,v,r,e,o);if(I!==void 0){if(I)continue;m=!1;break}if(b){if(!GE(e,function(T,M){if(!JE(b,M)&&(y===T||n(y,T,t,i,o)))return b.push(M)})){m=!1;break}}else if(!(y===C||n(y,C,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function DR(r,e,t,i,n,o,a){switch(t){case Td:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case yb:return!(r.byteLength!=e.byteLength||!o(new nb(r),new nb(e)));case cb:case mb:case gb:return Tb(+r,+e);case pb:return r.name==e.name&&r.message==e.message;case hb:case vb:return r==e+"";case wd:var c=KE;case xd:var p=i&Od;if(c||(c=ZE),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=lb,a.set(r,e);var v=xb(c(r),c(e),i,n,o,a);return a.delete(r),v;case TE:if(Wc)return Wc.call(r)==Wc.call(e)}return!1}function _R(r,e,t,i,n,o){var a=t&Od,c=db(r),p=c.length,f=db(e),v=f.length;if(p!=v&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:tt.call(e,b)))return!1}var y=o.get(r);if(y&&o.get(e))return y==e;var C=!0;o.set(r,e),o.set(e,r);for(var I=a;++m<p;){b=c[m];var T=r[b],M=e[b];if(i)var ue=a?i(M,T,b,e,r,o):i(T,M,b,r,e,o);if(!(ue===void 0?T===M||n(T,M,t,i,o):ue)){C=!1;break}I||(I=b=="constructor")}if(C&&!I){var Dn=r.constructor,ba=e.constructor;Dn!=ba&&"constructor"in r&&"constructor"in e&&!(typeof Dn=="function"&&Dn instanceof Dn&&typeof ba=="function"&&ba instanceof ba)&&(C=!1)}return o.delete(r),o.delete(e),C}function db(r){return FR(r,KR,qR)}function Ld(r,e){var t=r.__data__;return jR(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Ai(r,e){var t=$E(r,e);return LR(t)?t:void 0}function NR(r){var e=tt.call(r,vr),t=r[vr];try{r[vr]=void 0;var i=!0}catch{}var n=Cb.call(r);return i&&(e?r[vr]=t:delete r[vr]),n}var qR=sb?function(r){return r==null?[]:(r=Object(r),jE(sb(r),function(e){return Ib.call(r,e)}))}:XR,Mt=Ss;(zc&&Mt(new zc(new ArrayBuffer(1)))!=Td||ys&&Mt(new ys)!=wd||Jc&&Mt(Jc.resolve())!=Yy||$c&&Mt(new $c)!=xd||Kc&&Mt(new Kc)!=Vc)&&(Mt=function(r){var e=Ss(r),t=e==xi?r.constructor:void 0,i=t?kr(t):"";if(i)switch(i){case nR:return Td;case sR:return wd;case oR:return Yy;case aR:return xd;case dR:return Vc}return e});function HR(r,e){return e=e??ub,!!e&&(typeof r=="number"||qE.test(r))&&r>-1&&r%1==0&&r<e}function jR(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function WR(r){return!!rb&&rb in r}function GR(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Fd;return r===t}function VR(r){return Cb.call(r)}function kr(r){if(r!=null){try{return Pb.call(r)}catch{}try{return r+""}catch{}}return""}function Tb(r,e){return r===e||r!==r&&e!==e}var zR=ab(function(){return arguments}())?ab:function(r){return ks(r)&&tt.call(r,"callee")&&!Ib.call(r,"callee")},Rd=Array.isArray;function JR(r){return r!=null&&Eb(r.length)&&!Ab(r)}var Xc=rR||ZR;function $R(r,e){return wb(r,e)}function Ab(r){if(!Rb(r))return!1;var e=Ss(r);return e==fb||e==IE||e==CE||e==xE}function Eb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ub}function Rb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ks(r){return r!=null&&typeof r=="object"}var Ob=tb?zE(tb):UR;function KR(r){return JR(r)?OR(r):BR(r)}function XR(){return[]}function ZR(){return!1}Ti.exports=$R});var fS=h(Kd=>{"use strict";Kd.byteLength=IO;Kd.toByteArray=xO;Kd.fromByteArray=EO;var nt=[],Ne=[],CO=typeof Uint8Array<"u"?Uint8Array:Array,Em="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ur=0,mS=Em.length;Ur<mS;++Ur)nt[Ur]=Em[Ur],Ne[Em.charCodeAt(Ur)]=Ur;var Ur,mS;Ne[45]=62;Ne[95]=63;function pS(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 IO(r){var e=pS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function wO(r,e,t){return(e+t)*3/4-t}function xO(r){var e,t=pS(r),i=t[0],n=t[1],o=new CO(wO(r,i,n)),a=0,c=n>0?i-4:i,p;for(p=0;p<c;p+=4)e=Ne[r.charCodeAt(p)]<<18|Ne[r.charCodeAt(p+1)]<<12|Ne[r.charCodeAt(p+2)]<<6|Ne[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Ne[r.charCodeAt(p)]<<2|Ne[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=Ne[r.charCodeAt(p)]<<10|Ne[r.charCodeAt(p+1)]<<4|Ne[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function TO(r){return nt[r>>18&63]+nt[r>>12&63]+nt[r>>6&63]+nt[r&63]}function AO(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(TO(i));return n.join("")}function EO(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,c=t-i;a<c;a+=o)n.push(AO(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],n.push(nt[e>>2]+nt[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(nt[e>>10]+nt[e>>4&63]+nt[e<<2&63]+"=")),n.join("")}});var $H=_n(Fv(),1);function g(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function lr(r,e){if(!r)throw Error(e)}var re;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(re||(re={}));function wt(r){return r.startsWith(re.COMMENT)}function ld(r){return r.startsWith(re.ACCOUNT)}function ur(r){return r.startsWith(re.LINK)}function Mv(r){return r.startsWith(re.MESSAGE)}function Lv(r){return r.startsWith(re.SUBREDDIT)}function Uv(r){return r.startsWith(re.AWARD)}function jA(r){lr(wt(r),`Expected comment id to start with ${re.COMMENT}, got ${r}}`)}function WA(r){lr(ld(r),`Expected account id to start with ${re.ACCOUNT}, got ${r}}`)}function GA(r){lr(ur(r),`Expected link id to start with ${re.LINK}, got ${r}}`)}function VA(r){lr(Mv(r),`Expected message id to start with ${re.MESSAGE}, got ${r}}`)}function zA(r){lr(Lv(r),`Expected subreddit id to start with ${re.SUBREDDIT}, got ${r}}`)}function JA(r){lr(Uv(r),`Expected award id to start with ${re.AWARD}, got ${r}}`)}function ri(r){return jA(r),r}function ie(r){return WA(r),r}function fe(r){return GA(r),r}function $A(r){return VA(r),r}function Re(r){return zA(r),r}function KA(r){return JA(r),r}function ge(r){if(wt(r))return ri(r);if(ld(r))return ie(r);if(ur(r))return fe(r);if(Mv(r))return $A(r);if(Lv(r))return Re(r);if(Uv(r))return KA(r);throw new Error(`Expected thing id to start with ${Object.values(re).join(", ")} got ${r}}`)}function mc(r){return wt(r)}import*as P from"@devvit/protos";var ud=class{constructor(e){}};var pc=(t=>(t.Installation="installation",t.App="app",t))(pc||{});function cr(r,e=new Set){for(let t of r){if(t.type==="group"){cr(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}XA(r)}function XA(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 xt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var hL=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","brand-awareness","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","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","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","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","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","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","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as m0,GetFieldsResponse as p0}from"@devvit/protos";import{FormField as mr,FormFieldType as Oe}from"@devvit/protos";function ut(r){return r.map(e=>{switch(e.type){case"string":return ZA(e);case"image":return YA(e);case"paragraph":return QA(e);case"number":return e0(e);case"select":return t0(e);case"boolean":return r0(e);case"group":return i0(e);default:throw new Error("Unknown field type.")}})}function ZA(r){return mr.fromPartial({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 YA(r){return mr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Oe.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function QA(r){return mr.fromPartial({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 e0(r){return mr.fromPartial({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 t0(r){return mr.fromPartial({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 r0(r){return mr.fromPartial({defaultValue:{fieldType:Oe.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Oe.BOOLEAN,helpText:r.helpText,label:r.label})}function i0(r){return mr.fromPartial({fieldType:Oe.GROUP,fieldConfig:{groupConfig:{fields:ut(r.fields)}},label:r.label,helpText:r.helpText})}function U(r,e){u.prototype[r]=e}import{ValidateFormResponse as c0}from"@devvit/protos";import{RealtimeSubscriptionStatus as Dv}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",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",TraceID:"devvit-trace-id",User:"devvit-user",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies",WebviewTemplate:"devvit-webview-template"}),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"})(Bv||(Bv={}));function _v(r){function e(t){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[D.App]?.values[0];g(c,"useChannel - app is missing from Context");let p=r.metadata[D.Installation]?.values[0];g(p,"useChannel - installation is missing from Context");async function f(T){let M=o[n].channel;if(o[n].active)if(o[n].connected)await r.realtime.send(M,T);else throw Error(`Failed to send to channel '${M}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${M}`)}function v(){if(!o[n].active){let T=o[n].channel;o[n].active=!0,r.addRealtimeChannel(T)}}function m(){if(o[n].active){let T=o[n].channel;o[n].active=!1,r.removeRealtimeChannel(T)}}function b(T){return async()=>{let M;switch(T.status){case Dv.REALTIME_SUBSCRIBED:o[n].connected=!0,M=t.onSubscribed?.();break;case Dv.REALTIME_UNSUBSCRIBED:o[n].connected=!1,M=t.onUnsubscribed?.();break;default:M=t.onMessage(T.event?.data??{});break}await M}}let y={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:xt.CHANNEL};n in o?y=o[n]:n in a&&(y=a[n]);let C=r.realtimeEvent;r.isInitialRender?y.active=!1:C&&y.active&&C.event.channel===y.channel&&(y.preventCallback||r.runHook(b(C)),r.rerenderIn(0)),o[n]=y,r.currentHookIndex++;let I=0;return y.active&&y.connected?I=2:y.active&&!y.connected?I=1:!y.active&&y.connected?I=3:!y.active&&!y.connected&&(I=4),{subscribe:v,unsubscribe:m,send:f,status:I}}return e}import{FormFieldType as ii}from"@devvit/protos";function fc(r){switch(r.fieldType){case ii.STRING:return r.stringValue;case ii.IMAGE:return r.stringValue;case ii.PARAGRAPH:return r.stringValue;case ii.NUMBER:return r.numberValue;case ii.BOOLEAN:return r.boolValue;case ii.SELECTION:return r.selectionValue?.values??[];default:return}}function Tt(r){return Object.keys(r).reduce((e,t)=>{let i=fc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function Nv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,f={formKey:p,preventSubmit:!1,type:xt.FORM};n in a?f=a[n]:n in c&&(f=c[n]),a[n]=f,r.forms.set(p,t);let v=r.formSubmittedEvent;return v&&!f.preventSubmit&&v.formId===p&&r.runHook(async()=>{let m=i(Tt(v.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function qv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:xt.INTERVAL};n in o?f=o[n]:n in a&&(f=a[n]);function v(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,y]of Object.entries(o))if(b!==n.toString()&&y?.type===xt.INTERVAL&&y?.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:xt.INTERVAL},r.rerenderIn(p)}function m(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[n]=f,r.currentHookIndex++,{start:v,stop:m}}return e}function Hv(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 yc={now(){return new Date}};function jv(r){return`__autocache__${r}`}function Wv(r){return`__lock__${r}`}var s0=300,o0=1e3,cd=5e3,gc=3,Gv=.1,Vv=1e3,a0=3e4;function zv(r){if(r.error)throw new Error(r.error);return r.value}var At,Et,Fe,ni,J,Jv,$v,Kv,hc,Xv,Zv,vc,Yv,md=class{constructor(e,t,i=yc){l(this,J);l(this,At);l(this,Et,{});l(this,Fe);l(this,ni);d(this,At,e),d(this,ni,t),d(this,Fe,i)}async cache(e,t){d(this,Et,s(this,ni).__cache=s(this,ni).__cache??{}),S(this,J,Yv).call(this,t);let i=S(this,J,Jv).call(this,t.key);if(i!==void 0)return i;let n=await S(this,J,vc).call(this,t.key),o=await S(this,J,$v).call(this,t,n,e);return zv(o)}};At=new WeakMap,Et=new WeakMap,Fe=new WeakMap,ni=new WeakMap,J=new WeakSet,Jv=function(e){let t=s(this,Et)[e];if(t){let i=s(this,Fe).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<gc&&Math.random()<Gv&&t.errorTime+Vv<i;if(t?.expires&&t.expires<i&&t.checkedAt+Vv<i||n){delete s(this,Et)[e];return}else return zv(t)}},$v=async function(e,t,i){let n=t?.expires,o=n?S(this,J,Zv).call(this,n):1;return!t||t?.error&&t.errorCount<gc&&Gv>Math.random()||o>Math.random()?S(this,J,Kv).call(this,e,t,i):t},Kv=async function(e,t,i){let n=Wv(e.key),o=s(this,Fe).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,At).set(n,"1",{expiration:a,nx:!0}))return S(this,J,Xv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Fe).now();return S(this,J,hc).call(this,p,e.key,e.ttl)}},hc=async function(e,t,i){let n=Math.min(i,o0),o=await S(this,J,vc).call(this,t);if(o)return o;if(s(this,Fe).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,s0)),S(this,J,hc).call(this,e,t,i)},Xv=async function(e,t,i,n){let o=s(this,Fe).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,Fe).now().getTime(),t.errorCount++}return s(this,Et)[e]=t,await s(this,At).set(jv(e),JSON.stringify(t),{expiration:new Date(o+a0)}),t.error&&t.errorCount<gc&&await s(this,At).del(Wv(e)),t},Zv=function(e){let t=s(this,Fe).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},vc=async function(e){let t=await s(this,At).get(jv(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Fe).now().getTime(),s(this,Et)[e]=i,i}},Yv=function(e){e.ttl<cd&&(console.warn(`Cache TTL cannot be less than ${cd} milliseconds! Updating ttl value of ${e.ttl} to ${cd}.`),e.ttl=cd)};function Qv(r,e,t=yc){let i=new md(r,e,t);return i.cache.bind(i)}function ey(r){new URL(r.slice(0,r.indexOf(",")))}var si,oi,di,ty,ry,ai=class{constructor(){l(this,di);l(this,si,{});l(this,oi,{});d(this,si,u.assets),d(this,oi,u.webviewAssets)}getURL(e,t){return typeof e=="string"?S(this,di,ty).call(this,e,t??{webview:!1}):S(this,di,ry).call(this,e,t??{webview:!1})}};si=new WeakMap,oi=new WeakMap,di=new WeakSet,ty=function(e,t){let i=t.webview?s(this,oi)[e]:s(this,si)[e];if(i)return i;try{return ey(e),encodeURI(e)}catch{return""}},ry=function(e,t){let i={},n=[],o=t.webview?s(this,oi):s(this,si);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{ey(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 Rt,li=class{constructor(e){l(this,Rt);d(this,Rt,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},s(this,Rt));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,Rt))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},s(this,Rt))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},s(this,Rt));return e}};Rt=new WeakMap;var os,ui=class{constructor(e){l(this,os);d(this,os,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,s(this,os));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};os=new WeakMap;var as,ci=class{constructor(e){l(this,as);d(this,as,e)}async add(e){await u.modLogPlugin.Add(e,s(this,as))}};as=new WeakMap;var ds,mi=class{constructor(e){l(this,ds);d(this,ds,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:t},s(this,ds))}};ds=new WeakMap;var k,ls,fi=class{constructor(e){l(this,k);l(this,ls);d(this,k,e),d(this,ls,new fd(e))}get modMail(){return s(this,ls)}getSubredditById(e){return he.getById(ge(e),s(this,k))}getSubredditByName(e){return he.getByName(e,s(this,k))}addSubredditRemovalReason(e,t){return he.addRemovalReason(e,t.title,t.message,s(this,k))}getSubredditRemovalReasons(e){return he.getRemovalReasons(e,s(this,k))}getCurrentSubreddit(){return he.getFromMetadata(s(this,k))}getPostById(e){return V.getById(ge(e),s(this,k))}submitPost(e){return V.submit(e,s(this,k))}crosspost(e){return V.crosspost(e,s(this,k))}getUserById(e){return w.getById(ge(e),s(this,k))}getCollectionById(e){return pi.getCollectionById({collectionId:e},s(this,k))}createCollection(e){return pi.create(e,s(this,k))}getCollectionsForSubreddit(e){return pi.getCollectionsForSubreddit({subredditId:e},s(this,k))}getUserByUsername(e){return w.getByUsername(e,s(this,k))}getCurrentUser(){return w.getFromMetadata(D.User,s(this,k))}getAppUser(){return w.getFromMetadata(D.AppUser,s(this,k))}getSnoovatarUrl(e){return w.getSnoovatarUrl(e,s(this,k))}getCommentById(e){return Y.getById(ge(e),s(this,k))}getComments(e){return Y.getComments(e,s(this,k))}getCommentsByUser(e){return Y.getCommentsByUser(e,s(this,k))}submitComment(e){return Y.submit({...e,id:ge(e.id)},s(this,k))}getControversialPosts(e){return V.getControversialPosts(e,s(this,k))}getTopPosts(e){return V.getTopPosts(e,s(this,k))}getHotPosts(e){return V.getHotPosts(e,s(this,k))}getNewPosts(e){return V.getNewPosts(e,s(this,k))}getRisingPosts(e){return V.getRisingPosts(e,s(this,k))}getPostsByUser(e){return V.getPostsByUser(e,s(this,k))}getCommentsAndPostsByUser(e){return w.getOverview(e,s(this,k))}getModerationLog(e){return pd(e,s(this,k))}getApprovedUsers(e){return w.getSubredditUsersByType({type:"contributors",...e},s(this,k))}approveUser(e,t){return w.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}removeUser(e,t){return w.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}getWikiContributors(e){return w.getSubredditUsersByType({type:"wikicontributors",...e},s(this,k))}addWikiContributor(e,t){return w.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}removeWikiContributor(e,t){return w.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}getBannedUsers(e){return w.getSubredditUsersByType({type:"banned",...e},s(this,k))}banUser(e){return w.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},s(this,k))}unbanUser(e,t){return w.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,k))}getBannedWikiContributors(e){return w.getSubredditUsersByType({type:"wikibanned",...e},s(this,k))}banWikiContributor(e){return w.createRelationship({...e,type:"wikibanned"},s(this,k))}unbanWikiContributor(e,t){return w.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,k))}getModerators(e){return w.getSubredditUsersByType({type:"moderators",...e},s(this,k))}inviteModerator(e){return w.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},s(this,k))}revokeModeratorInvite(e,t){return w.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,k))}removeModerator(e,t){return w.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,k))}setModeratorPermissions(e,t,i){return w.setModeratorPermissions(e,t,i,s(this,k))}getMutedUsers(e){return w.getSubredditUsersByType({type:"muted",...e},s(this,k))}muteUser(e){return w.createRelationship({...e,type:"muted"},s(this,k))}unmuteUser(e,t){return w.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?ge(e.redditId):void 0};return Me.add(t,s(this,k))}addRemovalNote(e){return Me.addRemovalNote(e,s(this,k))}async sendPrivateMessage(e){return pr.send(e,s(this,k))}async sendPrivateMessageAsSubreddit(e){return pr.sendAsSubreddit(e,s(this,k))}async approve(e){if(wt(e))return Y.approve(e,s(this,k));if(ur(e))return V.approve(e,s(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(wt(e))return Y.remove(e,t,s(this,k));if(ur(e))return V.remove(e,t,s(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return ae.getPostFlairTemplates(e,s(this,k))}async getUserFlairTemplates(e){return ae.getUserFlairTemplates(e,s(this,k))}async createPostFlairTemplate(e){return ae.createPostFlairTemplate(e,s(this,k))}async createUserFlairTemplate(e){return ae.createUserFlairTemplate(e,s(this,k))}async editFlairTemplate(e){return ae.editFlairTemplate(e,s(this,k))}async deleteFlairTemplate(e,t){return ae.deleteFlairTemplate(e,t,s(this,k))}async setUserFlair(e){return Le.setUserFlair(e,s(this,k))}async removeUserFlair(e,t){return Le.removeUserFlair(e,t,s(this,k))}async setPostFlair(e){return Le.setPostFlair(e,s(this,k))}async removePostFlair(e,t){return Le.removePostFlair(e,fe(t),s(this,k))}async getWidgets(e){return ne.getWidgets(e,s(this,k))}async deleteWidget(e,t){return ne.delete(e,t,s(this,k))}async addWidget(e){return ne.add(e,s(this,k))}async reorderWidgets(e,t){return ne.reorder(e,t,s(this,k))}async getWikiPage(e,t){return ve.getPage(e,t,s(this,k))}async getWikiPages(e){return ve.getPages(e,s(this,k))}async createWikiPage(e){return ve.createPage(e,s(this,k))}async updateWikiPage(e){return ve.updatePage(e,s(this,k))}getWikiPageRevisions(e){return ve.getPageRevisions(e,s(this,k))}async revertWikiPage(e,t,i){return ve.revertPage(e,t,i,s(this,k))}async getWikiPageSettings(e,t){return ve.getPageSettings(e,t,s(this,k))}async updateWikiPageSettings(e){return ve.updatePageSettings(e,s(this,k))}async addEditorToWikiPage(e,t,i){return ve.addEditor(e,t,i,s(this,k))}async removeEditorFromWikiPage(e,t,i){return ve.removeEditor(e,t,i,s(this,k))}getMessages(e){return pr.getMessages(e,s(this,k))}markAllMessagesAsRead(){return pr.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 he.aboutLocation({...e,location:"modqueue"},s(this,k))}getReports(e){return he.aboutLocation({...e,location:"reports"},s(this,k))}getSpam(e){return he.aboutLocation({...e,location:"spam"},s(this,k))}getUnmoderated(e){return he.aboutLocation({...e,location:"unmoderated"},s(this,k))}getEdited(e){return he.aboutLocation({...e,location:"edited"},s(this,k))}getVaultByAddress(e){return sy(e,s(this,k))}getVaultByUserId(e){return oy(ge(e),s(this,k))}getSubredditLeaderboard(e){return ny(e,s(this,k))}};k=new WeakMap,ls=new WeakMap;import{RedisKeyScope as bc}from"@devvit/protos";var R,O,F,kc=class{constructor(e,t,i){l(this,R);l(this,O);l(this,F);d(this,R,e),d(this,O,t),d(this,F,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,O)},s(this,F)),this}async multi(){await s(this,R).Multi(s(this,O),s(this,F))}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,F)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,O)},s(this,F)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,O)},s(this,F)),this}async exec(){let e=await s(this,R).Exec(s(this,O),s(this,F)),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,F))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,O)},s(this,F)),this}async unwatch(){return await s(this,R).Unwatch(s(this,O),s(this,F)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,O)},s(this,F)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,O)},s(this,F)),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,F)),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,F)),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,F)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,O)},s(this,F)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,O)},s(this,F)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,O)},s(this,F)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,O)},s(this,F)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,O)},member:t},s(this,F)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,O)},member:t},s(this,F)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,O)},s(this,F)),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,F)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,O)},s(this,F)),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,F)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,O)},members:t},s(this,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),this}};R=new WeakMap,O=new WeakMap,F=new WeakMap;var L,gi,Sc=class Sc{constructor(e,t=void 0,i=bc.INSTALLATION){l(this,L);l(this,gi);d(this,L,e),d(this,gi,t),this.scope=i,this.global=i===bc.INSTALLATION?new Sc(s(this,L),s(this,gi),bc.GLOBAL):this}get storage(){return s(this,gi)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,L));return new kc(this.storage,t,s(this,L))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},s(this,L));return t!==null?t.value??void 0: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,L))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,L))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,L))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,L));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,L))).value}async strlen(e){return this.strLen(e)}async strLen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,L))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,L))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,L))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,L))).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,L))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,L))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,L))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,L))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,L))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},s(this,L));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},s(this,L));return i!==null?i.value:i}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,L));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,L));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,L))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,L));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,L))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,L));return t!==null?t.value:t}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},s(this,L));return i!==null?i.value??void 0: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,L))).value}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,L));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,L))).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,L))}async hkeys(e){return this.hKeys(e)}async hKeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,L));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,L))).value}async hlen(e){return this.hLen(e)}async hLen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};L=new WeakMap,gi=new WeakMap;var hi=Sc;var fr,vi=class{constructor(e){l(this,fr);d(this,fr,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,fr))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},s(this,fr))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,fr))).actions.map(t=>(g(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}))}};fr=new WeakMap;var us,yi=class{constructor(e){l(this,us);d(this,us,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},s(this,us));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)}}};us=new WeakMap;function ay(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=fc(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 Pc,Form as d0,ToastAppearance as ly}from"@devvit/protos";var gr,bi,gd=class{constructor(e){l(this,gr,[]);l(this,bi);d(this,bi,e)}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=d0.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});cr(n.fields),o.fields=ut(n.fields),s(this,gr).push({type:Pc.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,gr).push({type:Pc.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,gr).push({type:Pc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,gr)}};gr=new WeakMap,bi=new WeakMap;function Ue({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new ci(r),o=new li(r),a=new hi(r),c=Qv(a,i?i.state:{}),p=new fi(r),f=new vi(r),v=new yi(r),m=e?new gd(i):void 0,b=new ui(r),y=new ai,C=new mi(r),I=t&&i?Hv(i):void 0,T=t&&i?qv(i):void 0,M=t&&i?Nv(i):void 0,ue=t&&i?_v(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:f,settings:v,media:b,assets:y,realtime:C,get useForm(){return M??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return I??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return T??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return ue??(()=>{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.0-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.0-dev","@devvit/shared-types":"0.11.0-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/eslint-config":"0.11.0-dev","@devvit/repo-tools":"0.11.0-dev","@devvit/tsconfig":"0.11.0-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"11.3.3","@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:"8.9.0",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"255 KB"}},source:"./src/index.ts"};function de(r,e,t){let i=r[D.Subreddit]?.values[0];g(i,"subreddit is missing from Context");let n=r[D.AppUser]?.values[0],o=r[D.User]?.values[0],a=u0(r);return{get appAccountId(){return g(n,"appAccountId is missing from Context"),n},subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}function u0(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},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 hd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=c0.fromPartial({success:!0,errors:{}}),n=Tt(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],f=a.onValidate,v=Object.assign(Ue({metadata:t}),de(t)),m=await f({value:p,isEditing:r.editing},v);m&&(i.success=!1,i.errors[c]=m)}})),i}async function f0(){if(!u.appSettings)throw new Error("App settings were not defined.");return p0.fromPartial({fields:{fields:ut(u.appSettings)}})}async function g0(r,e){return hd(r,u.appSettings,e)}function my(r){r.provides(m0),U("GetAppSettingsFields",f0),U("ValidateAppForm",g0)}import{CustomPostDefinition as P0}from"@devvit/protos";import{BlockRenderEventType as Bc,EffectType as Ry}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 Uc,BlockAnimationDirection as Cy,BlockAnimationLoopMode as Iy,BlockAnimationType as wy,BlockAvatarBackground as xy,BlockAvatarFacing as Ty,BlockAvatarSize as Ot,BlockBorderWidth as kd,BlockButtonAppearance as Ft,BlockButtonSize as Tc,BlockFullSnooSize as Pi,BlockGap as Sd,BlockHorizontalAlignment as Ac,BlockIconSize as Pd,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as Ec,BlockSpacerSize as Cd,BlockStackDirection as Rc,BlockTextOutline as Oc,BlockTextOverflow as Fc,BlockTextSize as Ci,BlockTextStyle as Mc,BlockTextWeight as Ay,BlockType as Be,BlockVerticalAlignment as Lc}from"@devvit/protos";var Cc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"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"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var fy={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"},gy=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),hy=r=>r in Cc,Ic=r=>r in fy,vy=r=>!!r.match(/^rgba?\(.*/),yy=r=>!!r.match(/^hsla?\(.*/),by=(r,e="light")=>{if(Ic(r))return vd(r);let i=Cc[r];return typeof i=="string"?i:i[e]},vd=r=>fy[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),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as yd}from"@devvit/protos";var wc={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:yd.UNRECOGNIZED,alignment:void 0}};function Py(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:n}=h0(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 h0(r,e,t){let i=e===yd.STACK_VERTICAL||e===yd.UNRECOGNIZED,n=e===yd.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,f=0;return n&&p?f=2:i&&p&&(f=1),{growDirection:o,stretchDirection:f}}import{BlockSizeUnit as hr,BlockStackDirection as bd}from"@devvit/protos";function Si(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:hr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=hr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=hr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function v0(r,e){return(r.width?.value?.unit===hr.SIZE_UNIT_PERCENT||r.width?.min?.unit===hr.SIZE_UNIT_PERCENT)&&(e.direction===bd.STACK_HORIZONTAL||e.direction===bd.STACK_DEPTH)&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===hr.SIZE_UNIT_PERCENT||r.height?.min?.unit===hr.SIZE_UNIT_PERCENT)&&(e.direction===bd.STACK_VERTICAL||e.direction===bd.STACK_DEPTH)&&(e.hasHeight||(r.height=void 0)),r}function xc(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=v0(n,e.stackParentLayout)),n}}}var Ey="data-",y0=new Set(["onPress","onMessage"]),b0=new Map([["onPress",Uc.ACTION_CLICK],["onMessage",Uc.ACTION_WEBVIEW]]),fs,Ii=class{constructor(e=()=>{}){l(this,fs);d(this,fs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let n=this.createBlocksElement({type:e,props:t,children:i},wc);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"fullsnoo":return this.makeFullSnoo(t,n);case"animation":return this.makeAnimation(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 Sd.GAP_NONE;case"small":return Sd.GAP_SMALL;case"medium":return Sd.GAP_MEDIUM;case"large":return Sd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Lc.ALIGN_TOP:e.includes("middle")?t=Lc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Lc.ALIGN_BOTTOM),e.includes("start")?i=Ac.ALIGN_START:e.includes("center")?i=Ac.ALIGN_CENTER:e.includes("end")&&(i=Ac.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=kd.BORDER_WIDTH_NONE;break;case"thin":o=kd.BORDER_WIDTH_THIN;break;case"thick":o=kd.BORDER_WIDTH_THICK;break;default:o=kd.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 Ci.TEXT_SIZE_XSMALL;case"small":return Ci.TEXT_SIZE_SMALL;case"medium":return Ci.TEXT_SIZE_MEDIUM;case"large":return Ci.TEXT_SIZE_LARGE;case"xlarge":return Ci.TEXT_SIZE_XLARGE;case"xxlarge":return Ci.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Mc.TEXT_STYLE_BODY;case"metadata":return Mc.TEXT_STYLE_METADATA;case"heading":return Mc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return Oc.TEXT_OUTLINE_NONE;case"thin":return Oc.TEXT_OUTLINE_THIN;case"thick":return Oc.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Ay.TEXT_WEIGHT_REGULAR;case"bold":return Ay.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return Fc.TEXT_OVERFLOW_CLIP;case"ellipsis":return Fc.TEXT_OVERFLOW_ELLIPSE}return Fc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Ft.BUTTON_APPEARANCE_SECONDARY;case"primary":return Ft.BUTTON_APPEARANCE_PRIMARY;case"plain":return Ft.BUTTON_APPEARANCE_PLAIN;case"bordered":return Ft.BUTTON_APPEARANCE_BORDERED;case"media":return Ft.BUTTON_APPEARANCE_MEDIA;case"destructive":return Ft.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Ft.BUTTON_APPEARANCE_CAUTION;case"success":return Ft.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Tc.BUTTON_SIZE_SMALL;case"medium":return Tc.BUTTON_SIZE_MEDIUM;case"large":return Tc.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 Cd.SPACER_XSMALL;case"small":return Cd.SPACER_SMALL;case"medium":return Cd.SPACER_MEDIUM;case"large":return Cd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return Ec.SPACER_INVISIBLE;case"thin":return Ec.SPACER_THIN;case"square":return Ec.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return Pd.ICON_SIZE_XSMALL;case"small":return Pd.ICON_SIZE_SMALL;case"medium":return Pd.ICON_SIZE_MEDIUM;case"large":return Pd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Ot.AVATAR_SIZE_XXSMALL;case"xsmall":return Ot.AVATAR_SIZE_XSMALL;case"small":return Ot.AVATAR_SIZE_SMALL;case"medium":return Ot.AVATAR_SIZE_MEDIUM;case"large":return Ot.AVATAR_SIZE_LARGE;case"xlarge":return Ot.AVATAR_SIZE_XXLARGE;case"xxlarge":return Ot.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Ot.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Ty.AVATAR_FACING_LEFT;case"right":return Ty.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return Pi.FULLSNOO_XSMALL;case"small":return Pi.FULLSNOO_SMALL;case"medium":return Pi.FULLSNOO_MEDIUM;case"large":return Pi.FULLSNOO_LARGE;case"xlarge":return Pi.FULLSNOO_XLARGE;case"xxlarge":return Pi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return xy.AVATAR_BG_DARK;case"light":return xy.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?wy.ANIM_LOTTIE:wy.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return Cy.ANIM_DIR_BACKWARD;case"forward":return Cy.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Iy.ANIM_LOOP_REPEAT;case"bounce":return Iy.ANIM_LOOP_BOUNCE}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(Ey)).reduce((t,i)=>(t[i.substring(Ey.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);return y0.forEach(o=>{if(o in t){let a=t[o];i.push({type:b0.get(o)??Uc.UNRECOGNIZED,id:a.toString(),data:n})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),gy(e)?e:hy(e)?by(e,t):Ic(e)?vd(e):vy(e)?ky(e):yy(e)?e:(console.warn(`Could not parse color: ${e}.`),vd("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,fs).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,wc))}wrapRoot(e,t){return this.makeBlock(Be.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=xc(t,i),p=Py(t,i.stackParentLayout,c);return this.makeBlock(Be.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(Rc.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(Rc.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(Rc.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let n=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(Be.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(Be.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(Be.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(Be.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(Be.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(Be.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e,t){return e&&this.makeBlock(Be.BLOCK_FULLSNOO,e,t,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}makeAnimation(e,t){return e&&this.makeBlock(Be.BLOCK_ANIMATION,e,t,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:this.resolveAssetUrl(e.url),loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e,t){return e&&this.makeBlock(Be.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webview:!0}),state:e.state}})}makeBlock(e,t,i,n){return{type:e,sizes:xc(t,i),config:n,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t=e;if(t.type===Be.BLOCK_ROOT)return t.config?.rootConfig&&u.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t;let i=this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};fs=new WeakMap;function Oy(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Fy=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+=Fy(i);return e+=`</${r.type}>`,e};function k0(r){return" ".repeat(r)}function S0(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+=k0(t),n!==0&&(e+="<"),e+=o,n!==i.length-1&&(e+=`>
1
+ var SS=Object.create;var Lm=Object.defineProperty;var PS=Object.getOwnPropertyDescriptor;var CS=Object.getOwnPropertyNames;var IS=Object.getPrototypeOf,wS=Object.prototype.hasOwnProperty;var Um=r=>{throw TypeError(r)};var h=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var xS=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of CS(e))!wS.call(r,n)&&n!==t&&Lm(r,n,{get:()=>e[n],enumerable:!(i=PS(e,n))||i.enumerable});return r};var _n=(r,e,t)=>(t=r!=null?SS(IS(r)):{},xS(e||!r||!r.__esModule?Lm(t,"default",{value:r,enumerable:!0}):t,r));var fl=(r,e,t)=>e.has(r)||Um("Cannot "+t);var s=(r,e,t)=>(fl(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>e.has(r)?Um("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),d=(r,e,t,i)=>(fl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),S=(r,e,t)=>(fl(r,e,"access private method"),t);var oe=h((ZO,Bm)=>{Bm.exports=function(r){try{return!!r()}catch{return!0}}});var ka=h((YO,Dm)=>{var TS=oe();Dm.exports=!TS(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var X=h((QO,qm)=>{var _m=ka(),Nm=Function.prototype,gl=Nm.call,AS=_m&&Nm.bind.bind(gl,gl);qm.exports=_m?AS:function(r){return function(){return gl.apply(r,arguments)}}});var jm=h((eF,Hm)=>{var ES=Math.ceil,RS=Math.floor;Hm.exports=Math.trunc||function(e){var t=+e;return(t>0?RS:ES)(t)}});var Sa=h((tF,Wm)=>{var OS=jm();Wm.exports=function(r){var e=+r;return e!==e||e===0?0:OS(e)}});var ce=h((rF,Gm)=>{var Pa=function(r){return r&&r.Math==Math&&r};Gm.exports=Pa(typeof globalThis=="object"&&globalThis)||Pa(typeof window=="object"&&window)||Pa(typeof self=="object"&&self)||Pa(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var jr=h((iF,Vm)=>{Vm.exports=!1});var Ca=h((nF,Jm)=>{var zm=ce(),FS=Object.defineProperty;Jm.exports=function(r,e){try{FS(zm,r,{value:e,configurable:!0,writable:!0})}catch{zm[r]=e}return e}});var Ia=h((sF,Km)=>{var MS=ce(),LS=Ca(),$m="__core-js_shared__",US=MS[$m]||LS($m,{});Km.exports=US});var hl=h((oF,Zm)=>{var BS=jr(),Xm=Ia();(Zm.exports=function(r,e){return Xm[r]||(Xm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:BS?"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 wa=h((aF,Ym)=>{Ym.exports=function(r){return r==null}});var xa=h((dF,Qm)=>{var DS=wa(),_S=TypeError;Qm.exports=function(r){if(DS(r))throw _S("Can't call method on "+r);return r}});var Nn=h((lF,ep)=>{var NS=xa(),qS=Object;ep.exports=function(r){return qS(NS(r))}});var Ce=h((uF,tp)=>{var HS=X(),jS=Nn(),WS=HS({}.hasOwnProperty);tp.exports=Object.hasOwn||function(e,t){return WS(jS(e),t)}});var vl=h((cF,rp)=>{var GS=X(),VS=0,zS=Math.random(),JS=GS(1 .toString);rp.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+JS(++VS+zS,36)}});var np=h((mF,ip)=>{ip.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var cp=h((pF,up)=>{var lp=ce(),yl=np(),sp=lp.process,op=lp.Deno,ap=sp&&sp.versions||op&&op.version,dp=ap&&ap.v8,je,Ta;dp&&(je=dp.split("."),Ta=je[0]>0&&je[0]<4?1:+(je[0]+je[1]));!Ta&&yl&&(je=yl.match(/Edge\/(\d+)/),(!je||je[1]>=74)&&(je=yl.match(/Chrome\/(\d+)/),je&&(Ta=+je[1])));up.exports=Ta});var bl=h((fF,pp)=>{var mp=cp(),$S=oe();pp.exports=!!Object.getOwnPropertySymbols&&!$S(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&mp&&mp<41})});var kl=h((gF,fp)=>{var KS=bl();fp.exports=KS&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var Ie=h((hF,hp)=>{var XS=ce(),ZS=hl(),gp=Ce(),YS=vl(),QS=bl(),eP=kl(),Wr=XS.Symbol,Sl=ZS("wks"),tP=eP?Wr.for||Wr:Wr&&Wr.withoutSetter||YS;hp.exports=function(r){return gp(Sl,r)||(Sl[r]=QS&&gp(Wr,r)?Wr[r]:tP("Symbol."+r)),Sl[r]}});var bp=h((vF,yp)=>{var rP=Ie(),iP=rP("toStringTag"),vp={};vp[iP]="z";yp.exports=String(vp)==="[object z]"});var Cl=h((yF,kp)=>{var Pl=typeof document=="object"&&document.all,nP=typeof Pl>"u"&&Pl!==void 0;kp.exports={all:Pl,IS_HTMLDDA:nP}});var Z=h((bF,Pp)=>{var Sp=Cl(),sP=Sp.all;Pp.exports=Sp.IS_HTMLDDA?function(r){return typeof r=="function"||r===sP}:function(r){return typeof r=="function"}});var Aa=h((kF,Ip)=>{var Cp=X(),oP=Cp({}.toString),aP=Cp("".slice);Ip.exports=function(r){return aP(oP(r),8,-1)}});var qn=h((SF,wp)=>{var dP=bp(),lP=Z(),Ea=Aa(),uP=Ie(),cP=uP("toStringTag"),mP=Object,pP=Ea(function(){return arguments}())=="Arguments",fP=function(r,e){try{return r[e]}catch{}};wp.exports=dP?Ea:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=fP(e=mP(r),cP))=="string"?t:pP?Ea(e):(i=Ea(e))=="Object"&&lP(e.callee)?"Arguments":i}});var Hn=h((PF,xp)=>{var gP=qn(),hP=String;xp.exports=function(r){if(gP(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return hP(r)}});var wl=h((CF,Ep)=>{var Il=X(),vP=Sa(),yP=Hn(),bP=xa(),kP=Il("".charAt),Tp=Il("".charCodeAt),SP=Il("".slice),Ap=function(r){return function(e,t){var i=yP(bP(e)),n=vP(t),o=i.length,a,c;return n<0||n>=o?r?"":void 0:(a=Tp(i,n),a<55296||a>56319||n+1===o||(c=Tp(i,n+1))<56320||c>57343?r?kP(i,n):a:r?SP(i,n,n+2):(a-55296<<10)+(c-56320)+65536)}};Ep.exports={codeAt:Ap(!1),charAt:Ap(!0)}});var Fp=h((IF,Op)=>{var PP=ce(),CP=Z(),Rp=PP.WeakMap;Op.exports=CP(Rp)&&/native code/.test(String(Rp))});var Pt=h((wF,Up)=>{var Mp=Z(),Lp=Cl(),IP=Lp.all;Up.exports=Lp.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Mp(r)||r===IP}:function(r){return typeof r=="object"?r!==null:Mp(r)}});var me=h((xF,Bp)=>{var wP=oe();Bp.exports=!wP(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Tl=h((TF,_p)=>{var xP=ce(),Dp=Pt(),xl=xP.document,TP=Dp(xl)&&Dp(xl.createElement);_p.exports=function(r){return TP?xl.createElement(r):{}}});var Al=h((AF,Np)=>{var AP=me(),EP=oe(),RP=Tl();Np.exports=!AP&&!EP(function(){return Object.defineProperty(RP("div"),"a",{get:function(){return 7}}).a!=7})});var El=h((EF,qp)=>{var OP=me(),FP=oe();qp.exports=OP&&FP(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Ze=h((RF,Hp)=>{var MP=Pt(),LP=String,UP=TypeError;Hp.exports=function(r){if(MP(r))return r;throw UP(LP(r)+" is not an object")}});var We=h((OF,jp)=>{var BP=ka(),Ra=Function.prototype.call;jp.exports=BP?Ra.bind(Ra):function(){return Ra.apply(Ra,arguments)}});var jn=h((FF,Wp)=>{var Rl=ce(),DP=Z(),_P=function(r){return DP(r)?r:void 0};Wp.exports=function(r,e){return arguments.length<2?_P(Rl[r]):Rl[r]&&Rl[r][e]}});var Ol=h((MF,Gp)=>{var NP=X();Gp.exports=NP({}.isPrototypeOf)});var Fl=h((LF,Vp)=>{var qP=jn(),HP=Z(),jP=Ol(),WP=kl(),GP=Object;Vp.exports=WP?function(r){return typeof r=="symbol"}:function(r){var e=qP("Symbol");return HP(e)&&jP(e.prototype,GP(r))}});var Ml=h((UF,zp)=>{var VP=String;zp.exports=function(r){try{return VP(r)}catch{return"Object"}}});var Oa=h((BF,Jp)=>{var zP=Z(),JP=Ml(),$P=TypeError;Jp.exports=function(r){if(zP(r))return r;throw $P(JP(r)+" is not a function")}});var Fa=h((DF,$p)=>{var KP=Oa(),XP=wa();$p.exports=function(r,e){var t=r[e];return XP(t)?void 0:KP(t)}});var Xp=h((_F,Kp)=>{var Ll=We(),Ul=Z(),Bl=Pt(),ZP=TypeError;Kp.exports=function(r,e){var t,i;if(e==="string"&&Ul(t=r.toString)&&!Bl(i=Ll(t,r))||Ul(t=r.valueOf)&&!Bl(i=Ll(t,r))||e!=="string"&&Ul(t=r.toString)&&!Bl(i=Ll(t,r)))return i;throw ZP("Can't convert object to primitive value")}});var ef=h((NF,Qp)=>{var YP=We(),Zp=Pt(),Yp=Fl(),QP=Fa(),eC=Xp(),tC=Ie(),rC=TypeError,iC=tC("toPrimitive");Qp.exports=function(r,e){if(!Zp(r)||Yp(r))return r;var t=QP(r,iC),i;if(t){if(e===void 0&&(e="default"),i=YP(t,r,e),!Zp(i)||Yp(i))return i;throw rC("Can't convert object to primitive value")}return e===void 0&&(e="number"),eC(r,e)}});var Ma=h((qF,tf)=>{var nC=ef(),sC=Fl();tf.exports=function(r){var e=nC(r,"string");return sC(e)?e:e+""}});var Ye=h(nf=>{var oC=me(),aC=Al(),dC=El(),La=Ze(),rf=Ma(),lC=TypeError,Dl=Object.defineProperty,uC=Object.getOwnPropertyDescriptor,_l="enumerable",Nl="configurable",ql="writable";nf.f=oC?dC?function(e,t,i){if(La(e),t=rf(t),La(i),typeof e=="function"&&t==="prototype"&&"value"in i&&ql in i&&!i[ql]){var n=uC(e,t);n&&n[ql]&&(e[t]=i.value,i={configurable:Nl in i?i[Nl]:n[Nl],enumerable:_l in i?i[_l]:n[_l],writable:!1})}return Dl(e,t,i)}:Dl:function(e,t,i){if(La(e),t=rf(t),La(i),aC)try{return Dl(e,t,i)}catch{}if("get"in i||"set"in i)throw lC("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Gr=h((jF,sf)=>{sf.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var Ua=h((WF,of)=>{var cC=me(),mC=Ye(),pC=Gr();of.exports=cC?function(r,e,t){return mC.f(r,e,pC(1,t))}:function(r,e,t){return r[e]=t,r}});var Ba=h((GF,df)=>{var fC=hl(),gC=vl(),af=fC("keys");df.exports=function(r){return af[r]||(af[r]=gC(r))}});var Da=h((VF,lf)=>{lf.exports={}});var Vr=h((zF,mf)=>{var hC=Fp(),cf=ce(),vC=Pt(),yC=Ua(),Hl=Ce(),jl=Ia(),bC=Ba(),kC=Da(),uf="Object already initialized",Wl=cf.TypeError,SC=cf.WeakMap,_a,Wn,Na,PC=function(r){return Na(r)?Wn(r):_a(r,{})},CC=function(r){return function(e){var t;if(!vC(e)||(t=Wn(e)).type!==r)throw Wl("Incompatible receiver, "+r+" required");return t}};hC||jl.state?(Ge=jl.state||(jl.state=new SC),Ge.get=Ge.get,Ge.has=Ge.has,Ge.set=Ge.set,_a=function(r,e){if(Ge.has(r))throw Wl(uf);return e.facade=r,Ge.set(r,e),e},Wn=function(r){return Ge.get(r)||{}},Na=function(r){return Ge.has(r)}):(ir=bC("state"),kC[ir]=!0,_a=function(r,e){if(Hl(r,ir))throw Wl(uf);return e.facade=r,yC(r,ir,e),e},Wn=function(r){return Hl(r,ir)?r[ir]:{}},Na=function(r){return Hl(r,ir)});var Ge,ir;mf.exports={set:_a,get:Wn,has:Na,enforce:PC,getterFor:CC}});var Gl=h(gf=>{"use strict";var pf={}.propertyIsEnumerable,ff=Object.getOwnPropertyDescriptor,IC=ff&&!pf.call({1:2},1);gf.f=IC?function(e){var t=ff(this,e);return!!t&&t.enumerable}:pf});var zl=h(($F,hf)=>{var wC=X(),xC=oe(),TC=Aa(),Vl=Object,AC=wC("".split);hf.exports=xC(function(){return!Vl("z").propertyIsEnumerable(0)})?function(r){return TC(r)=="String"?AC(r,""):Vl(r)}:Vl});var zr=h((KF,vf)=>{var EC=zl(),RC=xa();vf.exports=function(r){return EC(RC(r))}});var Jl=h(bf=>{var OC=me(),FC=We(),MC=Gl(),LC=Gr(),UC=zr(),BC=Ma(),DC=Ce(),_C=Al(),yf=Object.getOwnPropertyDescriptor;bf.f=OC?yf:function(e,t){if(e=UC(e),t=BC(t),_C)try{return yf(e,t)}catch{}if(DC(e,t))return LC(!FC(MC.f,e,t),e[t])}});var Xl=h((ZF,Sf)=>{var $l=me(),NC=Ce(),kf=Function.prototype,qC=$l&&Object.getOwnPropertyDescriptor,Kl=NC(kf,"name"),HC=Kl&&function(){}.name==="something",jC=Kl&&(!$l||$l&&qC(kf,"name").configurable);Sf.exports={EXISTS:Kl,PROPER:HC,CONFIGURABLE:jC}});var Yl=h((YF,Pf)=>{var WC=X(),GC=Z(),Zl=Ia(),VC=WC(Function.toString);GC(Zl.inspectSource)||(Zl.inspectSource=function(r){return VC(r)});Pf.exports=Zl.inspectSource});var tu=h((QF,wf)=>{var eu=X(),zC=oe(),JC=Z(),qa=Ce(),Ql=me(),$C=Xl().CONFIGURABLE,KC=Yl(),If=Vr(),XC=If.enforce,ZC=If.get,Cf=String,Ha=Object.defineProperty,YC=eu("".slice),QC=eu("".replace),eI=eu([].join),tI=Ql&&!zC(function(){return Ha(function(){},"length",{value:8}).length!==8}),rI=String(String).split("String"),iI=wf.exports=function(r,e,t){YC(Cf(e),0,7)==="Symbol("&&(e="["+QC(Cf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!qa(r,"name")||$C&&r.name!==e)&&(Ql?Ha(r,"name",{value:e,configurable:!0}):r.name=e),tI&&t&&qa(t,"arity")&&r.length!==t.arity&&Ha(r,"length",{value:t.arity});try{t&&qa(t,"constructor")&&t.constructor?Ql&&Ha(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=XC(r);return qa(i,"source")||(i.source=eI(rI,typeof e=="string"?e:"")),r};Function.prototype.toString=iI(function(){return JC(this)&&ZC(this).source||KC(this)},"toString")});var nr=h((eM,xf)=>{var nI=Z(),sI=Ye(),oI=tu(),aI=Ca();xf.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(nI(t)&&oI(t,o,i),i.global)n?r[e]=t:aI(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:sI.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var ru=h((tM,Tf)=>{var dI=Sa(),lI=Math.max,uI=Math.min;Tf.exports=function(r,e){var t=dI(r);return t<0?lI(t+e,0):uI(t,e)}});var Ef=h((rM,Af)=>{var cI=Sa(),mI=Math.min;Af.exports=function(r){return r>0?mI(cI(r),9007199254740991):0}});var ja=h((iM,Rf)=>{var pI=Ef();Rf.exports=function(r){return pI(r.length)}});var Mf=h((nM,Ff)=>{var fI=zr(),gI=ru(),hI=ja(),Of=function(r){return function(e,t,i){var n=fI(e),o=hI(n),a=gI(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}};Ff.exports={includes:Of(!0),indexOf:Of(!1)}});var nu=h((sM,Uf)=>{var vI=X(),iu=Ce(),yI=zr(),bI=Mf().indexOf,kI=Da(),Lf=vI([].push);Uf.exports=function(r,e){var t=yI(r),i=0,n=[],o;for(o in t)!iu(kI,o)&&iu(t,o)&&Lf(n,o);for(;e.length>i;)iu(t,o=e[i++])&&(~bI(n,o)||Lf(n,o));return n}});var Wa=h((oM,Bf)=>{Bf.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var _f=h(Df=>{var SI=nu(),PI=Wa(),CI=PI.concat("length","prototype");Df.f=Object.getOwnPropertyNames||function(e){return SI(e,CI)}});var su=h(Nf=>{Nf.f=Object.getOwnPropertySymbols});var Hf=h((lM,qf)=>{var II=jn(),wI=X(),xI=_f(),TI=su(),AI=Ze(),EI=wI([].concat);qf.exports=II("Reflect","ownKeys")||function(e){var t=xI.f(AI(e)),i=TI.f;return i?EI(t,i(e)):t}});var Gf=h((uM,Wf)=>{var jf=Ce(),RI=Hf(),OI=Jl(),FI=Ye();Wf.exports=function(r,e,t){for(var i=RI(e),n=FI.f,o=OI.f,a=0;a<i.length;a++){var c=i[a];!jf(r,c)&&!(t&&jf(t,c))&&n(r,c,o(e,c))}}});var zf=h((cM,Vf)=>{var MI=oe(),LI=Z(),UI=/#|\.prototype\./,Gn=function(r,e){var t=DI[BI(r)];return t==NI?!0:t==_I?!1:LI(e)?MI(e):!!e},BI=Gn.normalize=function(r){return String(r).replace(UI,".").toLowerCase()},DI=Gn.data={},_I=Gn.NATIVE="N",NI=Gn.POLYFILL="P";Vf.exports=Gn});var Vn=h((mM,Jf)=>{var ou=ce(),qI=Jl().f,HI=Ua(),jI=nr(),WI=Ca(),GI=Gf(),VI=zf();Jf.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,c,p,f,v;if(i?a=ou:n?a=ou[t]||WI(t,{}):a=(ou[t]||{}).prototype,a)for(c in e){if(f=e[c],r.dontCallGetSet?(v=qI(a,c),p=v&&v.value):p=a[c],o=VI(i?c:t+(n?".":"#")+c,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;GI(f,p)}(r.sham||p&&p.sham)&&HI(f,"sham",!0),jI(a,c,f,r)}}});var au=h((pM,$f)=>{var zI=nu(),JI=Wa();$f.exports=Object.keys||function(e){return zI(e,JI)}});var Xf=h(Kf=>{var $I=me(),KI=El(),XI=Ye(),ZI=Ze(),YI=zr(),QI=au();Kf.f=$I&&!KI?Object.defineProperties:function(e,t){ZI(e);for(var i=YI(t),n=QI(t),o=n.length,a=0,c;o>a;)XI.f(e,c=n[a++],i[c]);return e}});var Yf=h((gM,Zf)=>{var ew=jn();Zf.exports=ew("document","documentElement")});var zn=h((hM,sg)=>{var tw=Ze(),rw=Xf(),Qf=Wa(),iw=Da(),nw=Yf(),sw=Tl(),ow=Ba(),eg=">",tg="<",lu="prototype",uu="script",ig=ow("IE_PROTO"),du=function(){},ng=function(r){return tg+uu+eg+r+tg+"/"+uu+eg},rg=function(r){r.write(ng("")),r.close();var e=r.parentWindow.Object;return r=null,e},aw=function(){var r=sw("iframe"),e="java"+uu+":",t;return r.style.display="none",nw.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(ng("document.F=Object")),t.close(),t.F},Ga,Va=function(){try{Ga=new ActiveXObject("htmlfile")}catch{}Va=typeof document<"u"?document.domain&&Ga?rg(Ga):aw():rg(Ga);for(var r=Qf.length;r--;)delete Va[lu][Qf[r]];return Va()};iw[ig]=!0;sg.exports=Object.create||function(e,t){var i;return e!==null?(du[lu]=tw(e),i=new du,du[lu]=null,i[ig]=e):i=Va(),t===void 0?i:rw.f(i,t)}});var ag=h((vM,og)=>{var dw=oe();og.exports=!dw(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var mu=h((yM,lg)=>{var lw=Ce(),uw=Z(),cw=Nn(),mw=Ba(),pw=ag(),dg=mw("IE_PROTO"),cu=Object,fw=cu.prototype;lg.exports=pw?cu.getPrototypeOf:function(r){var e=cw(r);if(lw(e,dg))return e[dg];var t=e.constructor;return uw(t)&&e instanceof t?t.prototype:e instanceof cu?fw:null}});var hu=h((bM,mg)=>{"use strict";var gw=oe(),hw=Z(),vw=Pt(),yw=zn(),ug=mu(),bw=nr(),kw=Ie(),Sw=jr(),gu=kw("iterator"),cg=!1,at,pu,fu;[].keys&&(fu=[].keys(),"next"in fu?(pu=ug(ug(fu)),pu!==Object.prototype&&(at=pu)):cg=!0);var Pw=!vw(at)||gw(function(){var r={};return at[gu].call(r)!==r});Pw?at={}:Sw&&(at=yw(at));hw(at[gu])||bw(at,gu,function(){return this});mg.exports={IteratorPrototype:at,BUGGY_SAFARI_ITERATORS:cg}});var Jn=h((kM,fg)=>{var Cw=Ye().f,Iw=Ce(),ww=Ie(),pg=ww("toStringTag");fg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!Iw(r,pg)&&Cw(r,pg,{configurable:!0,value:e})}});var Jr=h((SM,gg)=>{gg.exports={}});var vu=h((PM,hg)=>{"use strict";var xw=hu().IteratorPrototype,Tw=zn(),Aw=Gr(),Ew=Jn(),Rw=Jr(),Ow=function(){return this};hg.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=Tw(xw,{next:Aw(+!i,t)}),Ew(r,n,!1,!0),Rw[n]=Ow,r}});var yg=h((CM,vg)=>{var Fw=Z(),Mw=String,Lw=TypeError;vg.exports=function(r){if(typeof r=="object"||Fw(r))return r;throw Lw("Can't set "+Mw(r)+" as a prototype")}});var kg=h((IM,bg)=>{var Uw=X(),Bw=Ze(),Dw=yg();bg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=Uw(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return Bw(n),Dw(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var bu=h((wM,Rg)=>{"use strict";var _w=Vn(),Nw=We(),za=jr(),Ag=Xl(),qw=Z(),Hw=vu(),Sg=mu(),Pg=kg(),jw=Jn(),Ww=Ua(),yu=nr(),Gw=Ie(),Cg=Jr(),Eg=hu(),Vw=Ag.PROPER,zw=Ag.CONFIGURABLE,Ig=Eg.IteratorPrototype,Ja=Eg.BUGGY_SAFARI_ITERATORS,$n=Gw("iterator"),wg="keys",Kn="values",xg="entries",Tg=function(){return this};Rg.exports=function(r,e,t,i,n,o,a){Hw(t,e,i);var c=function(M){if(M===n&&b)return b;if(!Ja&&M in v)return v[M];switch(M){case wg:return function(){return new t(this,M)};case Kn:return function(){return new t(this,M)};case xg:return function(){return new t(this,M)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,v=r.prototype,m=v[$n]||v["@@iterator"]||n&&v[n],b=!Ja&&m||c(n),y=e=="Array"&&v.entries||m,C,I,T;if(y&&(C=Sg(y.call(new r)),C!==Object.prototype&&C.next&&(!za&&Sg(C)!==Ig&&(Pg?Pg(C,Ig):qw(C[$n])||yu(C,$n,Tg)),jw(C,p,!0,!0),za&&(Cg[p]=Tg))),Vw&&n==Kn&&m&&m.name!==Kn&&(!za&&zw?Ww(v,"name",Kn):(f=!0,b=function(){return Nw(m,this)})),n)if(I={values:c(Kn),keys:o?b:c(wg),entries:c(xg)},a)for(T in I)(Ja||f||!(T in v))&&yu(v,T,I[T]);else _w({target:e,proto:!0,forced:Ja||f},I);return(!za||a)&&v[$n]!==b&&yu(v,$n,b,{name:n}),Cg[e]=b,I}});var ku=h((xM,Og)=>{Og.exports=function(r,e){return{value:r,done:e}}});var Ug=h(()=>{"use strict";var Jw=wl().charAt,$w=Hn(),Mg=Vr(),Kw=bu(),Fg=ku(),Lg="String Iterator",Xw=Mg.set,Zw=Mg.getterFor(Lg);Kw(String,"String",function(r){Xw(this,{type:Lg,string:$w(r),index:0})},function(){var e=Zw(this),t=e.string,i=e.index,n;return i>=t.length?Fg(void 0,!0):(n=Jw(t,i),e.index+=n.length,Fg(n,!1))})});var Su=h((EM,Bg)=>{var Yw=oe(),Qw=Ie(),ex=jr(),tx=Qw("iterator");Bg.exports=!Yw(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}),ex&&!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[tx]||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 _g=h((RM,Dg)=>{var rx=Aa(),ix=X();Dg.exports=function(r){if(rx(r)==="Function")return ix(r)}});var $a=h((OM,qg)=>{var Ng=_g(),nx=Oa(),sx=ka(),ox=Ng(Ng.bind);qg.exports=function(r,e){return nx(r),e===void 0?r:sx?ox(r,e):function(){return r.apply(e,arguments)}}});var Wg=h((FM,jg)=>{var Hg=tu(),ax=Ye();jg.exports=function(r,e,t){return t.get&&Hg(t.get,e,{getter:!0}),t.set&&Hg(t.set,e,{setter:!0}),ax.f(r,e,t)}});var Pu=h((MM,Gg)=>{var dx=Ol(),lx=TypeError;Gg.exports=function(r,e){if(dx(e,r))return r;throw lx("Incorrect invocation")}});var $g=h((LM,Jg)=>{"use strict";var Vg=me(),ux=X(),cx=We(),mx=oe(),Cu=au(),px=su(),fx=Gl(),gx=Nn(),hx=zl(),$r=Object.assign,zg=Object.defineProperty,vx=ux([].concat);Jg.exports=!$r||mx(function(){if(Vg&&$r({b:1},$r(zg({},"a",{enumerable:!0,get:function(){zg(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}),$r({},r)[t]!=7||Cu($r({},e)).join("")!=i})?function(e,t){for(var i=gx(e),n=arguments.length,o=1,a=px.f,c=fx.f;n>o;)for(var p=hx(arguments[o++]),f=a?vx(Cu(p),a(p)):Cu(p),v=f.length,m=0,b;v>m;)b=f[m++],(!Vg||cx(c,p,b))&&(i[b]=p[b]);return i}:$r});var Zg=h((UM,Xg)=>{var yx=We(),Kg=Ze(),bx=Fa();Xg.exports=function(r,e,t){var i,n;Kg(r);try{if(i=bx(r,"return"),!i){if(e==="throw")throw t;return t}i=yx(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Kg(i),t}});var Qg=h((BM,Yg)=>{var kx=Ze(),Sx=Zg();Yg.exports=function(r,e,t,i){try{return i?e(kx(t)[0],t[1]):e(t)}catch(n){Sx(r,"throw",n)}}});var th=h((DM,eh)=>{var Px=Ie(),Cx=Jr(),Ix=Px("iterator"),wx=Array.prototype;eh.exports=function(r){return r!==void 0&&(Cx.Array===r||wx[Ix]===r)}});var ah=h((_M,oh)=>{var xx=X(),Tx=oe(),rh=Z(),Ax=qn(),Ex=jn(),Rx=Yl(),ih=function(){},Ox=[],nh=Ex("Reflect","construct"),Iu=/^\s*(?:class|function)\b/,Fx=xx(Iu.exec),Mx=!Iu.exec(ih),Xn=function(e){if(!rh(e))return!1;try{return nh(ih,Ox,e),!0}catch{return!1}},sh=function(e){if(!rh(e))return!1;switch(Ax(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Mx||!!Fx(Iu,Rx(e))}catch{return!0}};sh.sham=!0;oh.exports=!nh||Tx(function(){var r;return Xn(Xn.call)||!Xn(Object)||!Xn(function(){r=!0})||r})?sh:Xn});var wu=h((NM,dh)=>{"use strict";var Lx=Ma(),Ux=Ye(),Bx=Gr();dh.exports=function(r,e,t){var i=Lx(e);i in r?Ux.f(r,i,Bx(0,t)):r[i]=t}});var Ka=h((qM,uh)=>{var Dx=qn(),lh=Fa(),_x=wa(),Nx=Jr(),qx=Ie(),Hx=qx("iterator");uh.exports=function(r){if(!_x(r))return lh(r,Hx)||lh(r,"@@iterator")||Nx[Dx(r)]}});var xu=h((HM,ch)=>{var jx=We(),Wx=Oa(),Gx=Ze(),Vx=Ml(),zx=Ka(),Jx=TypeError;ch.exports=function(r,e){var t=arguments.length<2?zx(r):e;if(Wx(t))return Gx(jx(t,r));throw Jx(Vx(r)+" is not iterable")}});var gh=h((jM,fh)=>{"use strict";var $x=$a(),Kx=We(),Xx=Nn(),Zx=Qg(),Yx=th(),Qx=ah(),eT=ja(),mh=wu(),tT=xu(),rT=Ka(),ph=Array;fh.exports=function(e){var t=Xx(e),i=Qx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=$x(o,n>2?arguments[2]:void 0));var c=rT(t),p=0,f,v,m,b,y,C;if(c&&!(this===ph&&Yx(c)))for(b=tT(t,c),y=b.next,v=i?new this:[];!(m=Kx(y,b)).done;p++)C=a?Zx(b,o,[m.value,p],!0):m.value,mh(v,p,C);else for(f=eT(t),v=i?new this(f):ph(f);f>p;p++)C=a?o(t[p],p):t[p],mh(v,p,C);return v.length=p,v}});var Tu=h((WM,vh)=>{var hh=ru(),iT=ja(),nT=wu(),sT=Array,oT=Math.max;vh.exports=function(r,e,t){for(var i=iT(r),n=hh(e,i),o=hh(t===void 0?i:t,i),a=sT(oT(o-n,0)),c=0;n<o;n++,c++)nT(a,c,r[n]);return a.length=c,a}});var xh=h((GM,wh)=>{var sr=X(),Au=2147483647,Zn=36,Ph=1,Ou=26,aT=38,dT=700,lT=72,uT=128,cT="-",mT=/[^\0-\u007E]/,Ch=/[.\u3002\uFF0E\uFF61]/g,yh="Overflow: input needs wider integers to process",Eu=Zn-Ph,bh=RangeError,pT=sr(Ch.exec),Kr=Math.floor,Ru=String.fromCharCode,kh=sr("".charCodeAt),Ih=sr([].join),Ct=sr([].push),fT=sr("".replace),gT=sr("".split),hT=sr("".toLowerCase),vT=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=kh(r,t++);if(n>=55296&&n<=56319&&t<i){var o=kh(r,t++);(o&64512)==56320?Ct(e,((n&1023)<<10)+(o&1023)+65536):(Ct(e,n),t--)}else Ct(e,n)}return e},Sh=function(r){return r+22+75*(r<26)},yT=function(r,e,t){var i=0;for(r=t?Kr(r/dT):r>>1,r+=Kr(r/e);r>Eu*Ou>>1;)r=Kr(r/Eu),i+=Zn;return Kr(i+(Eu+1)*r/(r+aT))},bT=function(r){var e=[];r=vT(r);var t=r.length,i=uT,n=0,o=lT,a,c;for(a=0;a<r.length;a++)c=r[a],c<128&&Ct(e,Ru(c));var p=e.length,f=p;for(p&&Ct(e,cT);f<t;){var v=Au;for(a=0;a<r.length;a++)c=r[a],c>=i&&c<v&&(v=c);var m=f+1;if(v-i>Kr((Au-n)/m))throw bh(yh);for(n+=(v-i)*m,i=v,a=0;a<r.length;a++){if(c=r[a],c<i&&++n>Au)throw bh(yh);if(c==i){for(var b=n,y=Zn;;){var C=y<=o?Ph:y>=o+Ou?Ou:y-o;if(b<C)break;var I=b-C,T=Zn-C;Ct(e,Ru(Sh(C+I%T))),b=Kr(I/T),y+=Zn}Ct(e,Ru(Sh(b))),o=yT(n,m,f==p),n=0,f++}}n++,i++}return Ih(e,"")};wh.exports=function(r){var e=[],t=gT(fT(hT(r),Ch,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],Ct(e,pT(mT,n)?"xn--"+bT(n):n);return Ih(e,".")}});var Fu=h((VM,Th)=>{var kT=TypeError;Th.exports=function(r,e){if(r<e)throw kT("Not enough arguments");return r}});var Eh=h((zM,Ah)=>{var ST=Ie(),PT=zn(),CT=Ye().f,Mu=ST("unscopables"),Lu=Array.prototype;Lu[Mu]==null&&CT(Lu,Mu,{configurable:!0,value:PT(null)});Ah.exports=function(r){Lu[Mu][r]=!0}});var Uh=h((JM,Lh)=>{"use strict";var IT=zr(),Uu=Eh(),Rh=Jr(),Fh=Vr(),wT=Ye().f,xT=bu(),Xa=ku(),TT=jr(),AT=me(),Mh="Array Iterator",ET=Fh.set,RT=Fh.getterFor(Mh);Lh.exports=xT(Array,"Array",function(r,e){ET(this,{type:Mh,target:IT(r),index:0,kind:e})},function(){var r=RT(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,Xa(void 0,!0)):t=="keys"?Xa(i,!1):t=="values"?Xa(e[i],!1):Xa([i,e[i]],!1)},"values");var Oh=Rh.Arguments=Rh.Array;Uu("keys");Uu("values");Uu("entries");if(!TT&&AT&&Oh.name!=="values")try{wT(Oh,"name",{value:"values"})}catch{}});var Dh=h(($M,Bh)=>{var OT=nr();Bh.exports=function(r,e,t){for(var i in e)OT(r,i,e[i],t);return r}});var qh=h((KM,Nh)=>{var _h=Tu(),FT=Math.floor,Bu=function(r,e){var t=r.length,i=FT(t/2);return t<8?MT(r,e):LT(r,Bu(_h(r,0,i),e),Bu(_h(r,i),e),e)},MT=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},LT=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};Nh.exports=Bu});var zu=h((XM,ov)=>{"use strict";Uh();var Hu=Vn(),Zr=ce(),Za=We(),Qe=X(),UT=me(),Yh=Su(),Qh=nr(),BT=Dh(),DT=Jn(),_T=vu(),Gu=Vr(),ev=Pu(),Du=Z(),NT=Ce(),qT=$a(),HT=qn(),jT=Ze(),tv=Pt(),pe=Hn(),WT=zn(),Hh=Gr(),ju=xu(),GT=Ka(),Xr=Fu(),VT=Ie(),zT=qh(),JT=VT("iterator"),es="URLSearchParams",rv=es+"Iterator",iv=Gu.set,Ve=Gu.getterFor(es),$T=Gu.getterFor(rv),KT=Object.getOwnPropertyDescriptor,Vu=function(r){if(!UT)return Zr[r];var e=KT(Zr,r);return e&&e.value},jh=Vu("fetch"),Qa=Vu("Request"),Yn=Vu("Headers"),_u=Qa&&Qa.prototype,Wh=Yn&&Yn.prototype,XT=Zr.RegExp,ZT=Zr.TypeError,nv=Zr.decodeURIComponent,YT=Zr.encodeURIComponent,QT=Qe("".charAt),Gh=Qe([].join),or=Qe([].push),Wu=Qe("".replace),eA=Qe([].shift),Vh=Qe([].splice),zh=Qe("".split),tA=Qe("".slice),rA=/\+/g,Jh=Array(4),iA=function(r){return Jh[r-1]||(Jh[r-1]=XT("((?:%[\\da-f]{2}){"+r+"})","gi"))},nA=function(r){try{return nv(r)}catch{return r}},$h=function(r){var e=Wu(r,rA," "),t=4;try{return nv(e)}catch{for(;t;)e=Wu(e,iA(t--),nA);return e}},sA=/[!'()~]|%20/g,oA={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},aA=function(r){return oA[r]},Kh=function(r){return Wu(YT(r),sA,aA)},Nu=_T(function(e,t){iv(this,{type:rv,iterator:ju(Ve(e).entries),kind:t})},"Iterator",function(){var e=$T(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),sv=function(r){this.entries=[],this.url=null,r!==void 0&&(tv(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?QT(r,0)==="?"?tA(r,1):r:pe(r)))};sv.prototype={type:es,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=GT(r),t,i,n,o,a,c,p;if(e)for(t=ju(r,e),i=t.next;!(n=Za(i,t)).done;){if(o=ju(jT(n.value)),a=o.next,(c=Za(a,o)).done||(p=Za(a,o)).done||!Za(a,o).done)throw ZT("Expected sequence with length 2");or(this.entries,{key:pe(c.value),value:pe(p.value)})}else for(var f in r)NT(r,f)&&or(this.entries,{key:f,value:pe(r[f])})},parseQuery:function(r){if(r)for(var e=zh(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=zh(i,"="),or(this.entries,{key:$h(eA(n)),value:$h(Gh(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],or(e,Kh(i.key)+"="+Kh(i.value));return Gh(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ed=function(){ev(this,Qn);var e=arguments.length>0?arguments[0]:void 0;iv(this,new sv(e))},Qn=ed.prototype;BT(Qn,{append:function(e,t){Xr(arguments.length,2);var i=Ve(this);or(i.entries,{key:pe(e),value:pe(t)}),i.updateURL()},delete:function(r){Xr(arguments.length,1);for(var e=Ve(this),t=e.entries,i=pe(r),n=0;n<t.length;)t[n].key===i?Vh(t,n,1):n++;e.updateURL()},get:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=[],o=0;o<t.length;o++)t[o].key===i&&or(n,t[o].value);return n},has:function(e){Xr(arguments.length,1);for(var t=Ve(this).entries,i=pe(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Xr(arguments.length,1);for(var i=Ve(this),n=i.entries,o=!1,a=pe(e),c=pe(t),p=0,f;p<n.length;p++)f=n[p],f.key===a&&(o?Vh(n,p--,1):(o=!0,f.value=c));o||or(n,{key:a,value:c}),i.updateURL()},sort:function(){var e=Ve(this);zT(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ve(this).entries,i=qT(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 Nu(this,"keys")},values:function(){return new Nu(this,"values")},entries:function(){return new Nu(this,"entries")}},{enumerable:!0});Qh(Qn,JT,Qn.entries,{name:"entries"});Qh(Qn,"toString",function(){return Ve(this).serialize()},{enumerable:!0});DT(ed,es);Hu({global:!0,constructor:!0,forced:!Yh},{URLSearchParams:ed});!Yh&&Du(Yn)&&(Xh=Qe(Wh.has),Zh=Qe(Wh.set),qu=function(r){if(tv(r)){var e=r.body,t;if(HT(e)===es)return t=r.headers?new Yn(r.headers):new Yn,Xh(t,"content-type")||Zh(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),WT(r,{body:Hh(0,pe(e)),headers:Hh(0,t)})}return r},Du(jh)&&Hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return jh(e,arguments.length>1?qu(arguments[1]):{})}}),Du(Qa)&&(Ya=function(e){return ev(this,_u),new Qa(e,arguments.length>1?qu(arguments[1]):{})},_u.constructor=Ya,Ya.prototype=_u,Hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Ya})));var Xh,Zh,qu,Ya;ov.exports={URLSearchParams:ed,getState:Ve}});var wv=h(()=>{"use strict";Ug();var dA=Vn(),dc=me(),lA=Su(),lc=ce(),av=$a(),Ee=X(),sd=nr(),we=Wg(),uA=Pu(),sc=Ce(),uc=$g(),Yr=gh(),ze=Tu(),cA=wl().codeAt,mA=xh(),lt=Hn(),pA=Jn(),fA=Fu(),bv=zu(),kv=Vr(),gA=kv.set,od=kv.getterFor("URL"),hA=bv.URLSearchParams,vA=bv.getState,ts=lc.URL,oc=lc.TypeError,ad=lc.parseInt,yA=Math.floor,dv=Math.pow,Ae=Ee("".charAt),Je=Ee(/./.exec),is=Ee([].join),bA=Ee(1 .toString),kA=Ee([].pop),ei=Ee([].push),lv=Ee("".replace),SA=Ee([].shift),PA=Ee("".split),ss=Ee("".slice),dd=Ee("".toLowerCase),CA=Ee([].unshift),IA="Invalid authority",Ju="Invalid scheme",ar="Invalid host",uv="Invalid port",Sv=/[a-z]/i,wA=/[\d+-.a-z]/i,ac=/\d/,xA=/^0x/i,TA=/^[0-7]+$/,AA=/^\d+$/,Pv=/^[\da-f]+$/i,EA=/[\0\t\n\r #%/:<>?@[\\\]^|]/,RA=/[\0\t\n\r #/:<>?@[\\\]^|]/,OA=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,FA=/[\t\n\r]/g,xe,MA=function(r){var e=PA(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=Je(xA,o)?16:8,o=ss(o,a==8?1:2)),o==="")c=0;else{if(!Je(a==10?AA:a==8?TA:Pv,o))return r;c=ad(o,a)}ei(i,c)}for(n=0;n<t;n++)if(c=i[n],n==t-1){if(c>=dv(256,5-t))return null}else if(c>255)return null;for(p=kA(i),n=0;n<i.length;n++)p+=i[n]*dv(256,3-n);return p},LA=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,c,p,f,v,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&&Je(Pv,b());)o=o*16+ad(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(!Je(ac,b()))return;for(;Je(ac,b());){if(f=ad(b(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}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(v=t-i,t=7;t!=0&&v>0;)m=e[t],e[t--]=e[i+v-1],e[i+--v]=m;else if(t!=8)return;return e},UA=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},rs=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)CA(e,r%256),r=yA(r/256);return is(e,".")}else if(typeof r=="object"){for(e="",i=UA(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=bA(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},nd={},Cv=uc({},nd,{" ":1,'"':1,"<":1,">":1,"`":1}),Iv=uc({},Cv,{"#":1,"?":1,"{":1,"}":1}),$u=uc({},Iv,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),It=function(r,e){var t=cA(r,0);return t>32&&t<127&&!sc(e,r)?r:encodeURIComponent(r)},td={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ns=function(r,e){var t;return r.length==2&&Je(Sv,Ae(r,0))&&((t=Ae(r,1))==":"||!e&&t=="|")},cv=function(r){var e;return r.length>1&&ns(ss(r,0,2))&&(r.length==2||(e=Ae(r,2))==="/"||e==="\\"||e==="?"||e==="#")},BA=function(r){return r==="."||dd(r)==="%2e"},DA=function(r){return r=dd(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ku={},mv={},Xu={},pv={},fv={},Zu={},gv={},hv={},rd={},id={},Yu={},Qu={},ec={},tc={},vv={},rc={},Qr={},et={},yv={},dr={},dt={},cc=function(r,e,t){var i=lt(r),n,o,a;if(e){if(o=this.parse(i),o)throw oc(o);this.searchParams=null}else{if(t!==void 0&&(n=new cc(t,!0)),o=this.parse(i,null,n),o)throw oc(o);a=vA(new hA),a.bindURL(this),this.searchParams=a}};cc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Ku,o=0,a="",c=!1,p=!1,f=!1,v,m,b,y;for(r=lt(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=lv(r,OA,"")),r=lv(r,FA,""),v=Yr(r);o<=v.length;){switch(m=v[o],n){case Ku:if(m&&Je(Sv,m))a+=dd(m),n=mv;else{if(e)return Ju;n=Xu;continue}break;case mv:if(m&&(Je(wA,m)||m=="+"||m=="-"||m=="."))a+=dd(m);else if(m==":"){if(e&&(i.isSpecial()!=sc(td,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&td[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=tc:i.isSpecial()&&t&&t.scheme==i.scheme?n=pv:i.isSpecial()?n=hv:v[o+1]=="/"?(n=fv,o++):(i.cannotBeABaseURL=!0,ei(i.path,""),n=yv)}else{if(e)return Ju;a="",n=Xu,o=0;continue}break;case Xu:if(!t||t.cannotBeABaseURL&&m!="#")return Ju;if(t.cannotBeABaseURL&&m=="#"){i.scheme=t.scheme,i.path=ze(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=dt;break}n=t.scheme=="file"?tc:Zu;continue;case pv:if(m=="/"&&v[o+1]=="/")n=rd,o++;else{n=Zu;continue}break;case fv:if(m=="/"){n=id;break}else{n=et;continue}case Zu:if(i.scheme=t.scheme,m==xe)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query=t.query;else if(m=="/"||m=="\\"&&i.isSpecial())n=gv;else if(m=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query="",n=dr;else if(m=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.query=t.query,i.fragment="",n=dt;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=ze(t.path),i.path.length--,n=et;continue}break;case gv:if(i.isSpecial()&&(m=="/"||m=="\\"))n=rd;else if(m=="/")n=id;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=et;continue}break;case hv:if(n=rd,m!="/"||Ae(a,o+1)!="/")continue;o++;break;case rd:if(m!="/"&&m!="\\"){n=id;continue}break;case id:if(m=="@"){c&&(a="%40"+a),c=!0,b=Yr(a);for(var C=0;C<b.length;C++){var I=b[C];if(I==":"&&!f){f=!0;continue}var T=It(I,$u);f?i.password+=T:i.username+=T}a=""}else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(c&&a=="")return IA;o-=Yr(a).length+1,a="",n=Yu}else a+=m;break;case Yu:case Qu:if(e&&i.scheme=="file"){n=rc;continue}else if(m==":"&&!p){if(a=="")return ar;if(y=i.parseHost(a),y)return y;if(a="",n=ec,e==Qu)return}else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return ar;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(y=i.parseHost(a),y)return y;if(a="",n=Qr,e)return;continue}else m=="["?p=!0:m=="]"&&(p=!1),a+=m;break;case ec:if(Je(ac,m))a+=m;else if(m==xe||m=="/"||m=="?"||m=="#"||m=="\\"&&i.isSpecial()||e){if(a!=""){var M=ad(a,10);if(M>65535)return uv;i.port=i.isSpecial()&&M===td[i.scheme]?null:M,a=""}if(e)return;n=Qr;continue}else return uv;break;case tc:if(i.scheme="file",m=="/"||m=="\\")n=vv;else if(t&&t.scheme=="file")if(m==xe)i.host=t.host,i.path=ze(t.path),i.query=t.query;else if(m=="?")i.host=t.host,i.path=ze(t.path),i.query="",n=dr;else if(m=="#")i.host=t.host,i.path=ze(t.path),i.query=t.query,i.fragment="",n=dt;else{cv(is(ze(v,o),""))||(i.host=t.host,i.path=ze(t.path),i.shortenPath()),n=et;continue}else{n=et;continue}break;case vv:if(m=="/"||m=="\\"){n=rc;break}t&&t.scheme=="file"&&!cv(is(ze(v,o),""))&&(ns(t.path[0],!0)?ei(i.path,t.path[0]):i.host=t.host),n=et;continue;case rc:if(m==xe||m=="/"||m=="\\"||m=="?"||m=="#"){if(!e&&ns(a))n=et;else if(a==""){if(i.host="",e)return;n=Qr}else{if(y=i.parseHost(a),y)return y;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=Qr}continue}else a+=m;break;case Qr:if(i.isSpecial()){if(n=et,m!="/"&&m!="\\")continue}else if(!e&&m=="?")i.query="",n=dr;else if(!e&&m=="#")i.fragment="",n=dt;else if(m!=xe&&(n=et,m!="/"))continue;break;case et:if(m==xe||m=="/"||m=="\\"&&i.isSpecial()||!e&&(m=="?"||m=="#")){if(DA(a)?(i.shortenPath(),m!="/"&&!(m=="\\"&&i.isSpecial())&&ei(i.path,"")):BA(a)?m!="/"&&!(m=="\\"&&i.isSpecial())&&ei(i.path,""):(i.scheme=="file"&&!i.path.length&&ns(a)&&(i.host&&(i.host=""),a=Ae(a,0)+":"),ei(i.path,a)),a="",i.scheme=="file"&&(m==xe||m=="?"||m=="#"))for(;i.path.length>1&&i.path[0]==="";)SA(i.path);m=="?"?(i.query="",n=dr):m=="#"&&(i.fragment="",n=dt)}else a+=It(m,Iv);break;case yv:m=="?"?(i.query="",n=dr):m=="#"?(i.fragment="",n=dt):m!=xe&&(i.path[0]+=It(m,nd));break;case dr:!e&&m=="#"?(i.fragment="",n=dt):m!=xe&&(m=="'"&&i.isSpecial()?i.query+="%27":m=="#"?i.query+="%23":i.query+=It(m,nd));break;case dt:m!=xe&&(i.fragment+=It(m,Cv));break}o++}},parseHost:function(r){var e,t,i;if(Ae(r,0)=="["){if(Ae(r,r.length-1)!="]"||(e=LA(ss(r,1,-1)),!e))return ar;this.host=e}else if(this.isSpecial()){if(r=mA(r),Je(EA,r)||(e=MA(r),e===null))return ar;this.host=e}else{if(Je(RA,r))return ar;for(e="",t=Yr(r),i=0;i<t.length;i++)e+=It(t[i],nd);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return sc(td,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!ns(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,f=e+":";return n!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=rs(n),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+is(a,"/"):"",c!==null&&(f+="?"+c),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw oc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new ti(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+rs(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(lt(r)+":",Ku)},getUsername:function(){return this.username},setUsername:function(r){var e=Yr(lt(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=It(e[t],$u)}},getPassword:function(){return this.password},setPassword:function(r){var e=Yr(lt(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=It(e[t],$u)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?rs(r):rs(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Yu)},getHostname:function(){var r=this.host;return r===null?"":rs(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Qu)},getPort:function(){var r=this.port;return r===null?"":lt(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=lt(r),r==""?this.port=null:this.parse(r,ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+is(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,Qr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=lt(r),r==""?this.query=null:(Ae(r,0)=="?"&&(r=ss(r,1)),this.query="",this.parse(r,dr)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=lt(r),r==""){this.fragment=null;return}Ae(r,0)=="#"&&(r=ss(r,1)),this.fragment="",this.parse(r,dt)},update:function(){this.query=this.searchParams.serialize()||null}};var ti=function(e){var t=uA(this,te),i=fA(arguments.length,1)>1?arguments[1]:void 0,n=gA(t,new cc(e,!1,i));dc||(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())},te=ti.prototype,Te=function(r,e){return{get:function(){return od(this)[r]()},set:e&&function(t){return od(this)[e](t)},configurable:!0,enumerable:!0}};dc&&(we(te,"href",Te("serialize","setHref")),we(te,"origin",Te("getOrigin")),we(te,"protocol",Te("getProtocol","setProtocol")),we(te,"username",Te("getUsername","setUsername")),we(te,"password",Te("getPassword","setPassword")),we(te,"host",Te("getHost","setHost")),we(te,"hostname",Te("getHostname","setHostname")),we(te,"port",Te("getPort","setPort")),we(te,"pathname",Te("getPathname","setPathname")),we(te,"search",Te("getSearch","setSearch")),we(te,"searchParams",Te("getSearchParams")),we(te,"hash",Te("getHash","setHash")));sd(te,"toJSON",function(){return od(this).serialize()},{enumerable:!0});sd(te,"toString",function(){return od(this).serialize()},{enumerable:!0});ts&&(ic=ts.createObjectURL,nc=ts.revokeObjectURL,ic&&sd(ti,"createObjectURL",av(ic,ts)),nc&&sd(ti,"revokeObjectURL",av(nc,ts)));var ic,nc;pA(ti,"URL");dA({global:!0,constructor:!0,forced:!lA,sham:!dc},{URL:ti})});var xv=h(()=>{wv()});var Tv=h(()=>{"use strict";var _A=Vn(),NA=We();_A({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return NA(URL.prototype.toString,this)}})});var Av=h(()=>{zu()});var Rv=h((sL,Ev)=>{var qA=ce();Ev.exports=qA});var Fv=h((oL,Ov)=>{xv();Tv();Av();var HA=Rv();Ov.exports=HA.URL});var Nc=h((RD,Hy)=>{var eE=Object.prototype.toString;Hy.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 sE(e)?"generatorfunction":"function";if(tE(e))return"array";if(dE(e))return"buffer";if(aE(e))return"arguments";if(iE(e))return"date";if(rE(e))return"error";if(nE(e))return"regexp";switch(qy(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(oE(e))return"generator";switch(t=eE.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 qy(r){return typeof r.constructor=="function"?r.constructor.name:null}function tE(r){return Array.isArray?Array.isArray(r):r instanceof Array}function rE(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function iE(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function nE(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function sE(r,e){return qy(r)==="GeneratorFunction"}function oE(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function aE(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 dE(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var Gy=h((OD,Wy)=>{"use strict";var jy=Symbol.prototype.valueOf,lE=Nc();function uE(r,e){switch(lE(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 fE(r);case"symbol":return gE(r);case"arraybuffer":return mE(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return pE(r);case"regexp":return cE(r);case"error":return Object.create(r);default:return r}}function cE(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 mE(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function pE(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function fE(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function gE(r){return jy?Object(jy.call(r)):{}}Wy.exports=uE});var zy=h((FD,Vy)=>{"use strict";Vy.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var Ky=h((MD,$y)=>{"use strict";var hE=zy();function Jy(r){return hE(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}$y.exports=function(e){var t,i;return!(Jy(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,Jy(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var Zy=h((LD,Xy)=>{"use strict";var vE=Gy(),yE=Nc(),bE=Ky();function qc(r,e){switch(yE(r)){case"object":return kE(r,e);case"array":return SE(r,e);default:return vE(r)}}function kE(r,e){if(typeof e=="function")return e(r);if(e||bE(r)){let t=new r.constructor;for(let i in r)t[i]=qc(r[i],e);return t}return r}function SE(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=qc(r[i],e);return t}Xy.exports=qc});var Yc=h((vs,Ti)=>{var PE=200,Zc="__lodash_hash_undefined__",Od=1,lb=2,ub=9007199254740991,Id="[object Arguments]",Gc="[object Array]",CE="[object AsyncFunction]",cb="[object Boolean]",mb="[object Date]",pb="[object Error]",fb="[object Function]",IE="[object GeneratorFunction]",wd="[object Map]",gb="[object Number]",wE="[object Null]",xi="[object Object]",Yy="[object Promise]",xE="[object Proxy]",hb="[object RegExp]",xd="[object Set]",vb="[object String]",TE="[object Symbol]",AE="[object Undefined]",Vc="[object WeakMap]",yb="[object ArrayBuffer]",Td="[object DataView]",EE="[object Float32Array]",RE="[object Float64Array]",OE="[object Int8Array]",FE="[object Int16Array]",ME="[object Int32Array]",LE="[object Uint8Array]",UE="[object Uint8ClampedArray]",BE="[object Uint16Array]",DE="[object Uint32Array]",_E=/[\\^$.*+?()[\]{}|]/g,NE=/^\[object .+?Constructor\]$/,qE=/^(?:0|[1-9]\d*)$/,H={};H[EE]=H[RE]=H[OE]=H[FE]=H[ME]=H[LE]=H[UE]=H[BE]=H[DE]=!0;H[Id]=H[Gc]=H[yb]=H[cb]=H[Td]=H[mb]=H[pb]=H[fb]=H[wd]=H[gb]=H[xi]=H[hb]=H[xd]=H[vb]=H[Vc]=!1;var bb=typeof global=="object"&&global&&global.Object===Object&&global,HE=typeof self=="object"&&self&&self.Object===Object&&self,pt=bb||HE||Function("return this")(),kb=typeof vs=="object"&&vs&&!vs.nodeType&&vs,Qy=kb&&typeof Ti=="object"&&Ti&&!Ti.nodeType&&Ti,Sb=Qy&&Qy.exports===kb,Hc=Sb&&bb.process,eb=function(){try{return Hc&&Hc.binding&&Hc.binding("util")}catch{}}(),tb=eb&&eb.isTypedArray;function jE(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 WE(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function GE(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 VE(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function zE(r){return function(e){return r(e)}}function JE(r,e){return r.has(e)}function $E(r,e){return r?.[e]}function KE(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function XE(r,e){return function(t){return r(e(t))}}function ZE(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var YE=Array.prototype,QE=Function.prototype,Fd=Object.prototype,jc=pt["__core-js_shared__"],Pb=QE.toString,tt=Fd.hasOwnProperty,rb=function(){var r=/[^.]+$/.exec(jc&&jc.keys&&jc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Cb=Fd.toString,eR=RegExp("^"+Pb.call(tt).replace(_E,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ib=Sb?pt.Buffer:void 0,Ad=pt.Symbol,nb=pt.Uint8Array,Ib=Fd.propertyIsEnumerable,tR=YE.splice,vr=Ad?Ad.toStringTag:void 0,sb=Object.getOwnPropertySymbols,rR=ib?ib.isBuffer:void 0,iR=XE(Object.keys,Object),zc=Ai(pt,"DataView"),ys=Ai(pt,"Map"),Jc=Ai(pt,"Promise"),$c=Ai(pt,"Set"),Kc=Ai(pt,"WeakMap"),bs=Ai(Object,"create"),nR=kr(zc),sR=kr(ys),oR=kr(Jc),aR=kr($c),dR=kr(Kc),ob=Ad?Ad.prototype:void 0,Wc=ob?ob.valueOf:void 0;function yr(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 lR(){this.__data__=bs?bs(null):{},this.size=0}function uR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function cR(r){var e=this.__data__;if(bs){var t=e[r];return t===Zc?void 0:t}return tt.call(e,r)?e[r]:void 0}function mR(r){var e=this.__data__;return bs?e[r]!==void 0:tt.call(e,r)}function pR(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=bs&&e===void 0?Zc:e,this}yr.prototype.clear=lR;yr.prototype.delete=uR;yr.prototype.get=cR;yr.prototype.has=mR;yr.prototype.set=pR;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 fR(){this.__data__=[],this.size=0}function gR(r){var e=this.__data__,t=Md(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():tR.call(e,t,1),--this.size,!0}function hR(r){var e=this.__data__,t=Md(e,r);return t<0?void 0:e[t][1]}function vR(r){return Md(this.__data__,r)>-1}function yR(r,e){var t=this.__data__,i=Md(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}ft.prototype.clear=fR;ft.prototype.delete=gR;ft.prototype.get=hR;ft.prototype.has=vR;ft.prototype.set=yR;function br(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 bR(){this.size=0,this.__data__={hash:new yr,map:new(ys||ft),string:new yr}}function kR(r){var e=Ld(this,r).delete(r);return this.size-=e?1:0,e}function SR(r){return Ld(this,r).get(r)}function PR(r){return Ld(this,r).has(r)}function CR(r,e){var t=Ld(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}br.prototype.clear=bR;br.prototype.delete=kR;br.prototype.get=SR;br.prototype.has=PR;br.prototype.set=CR;function Ed(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new br;++e<t;)this.add(r[e])}function IR(r){return this.__data__.set(r,Zc),this}function wR(r){return this.__data__.has(r)}Ed.prototype.add=Ed.prototype.push=IR;Ed.prototype.has=wR;function Lt(r){var e=this.__data__=new ft(r);this.size=e.size}function xR(){this.__data__=new ft,this.size=0}function TR(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function AR(r){return this.__data__.get(r)}function ER(r){return this.__data__.has(r)}function RR(r,e){var t=this.__data__;if(t instanceof ft){var i=t.__data__;if(!ys||i.length<PE-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new br(i)}return t.set(r,e),this.size=t.size,this}Lt.prototype.clear=xR;Lt.prototype.delete=TR;Lt.prototype.get=AR;Lt.prototype.has=ER;Lt.prototype.set=RR;function OR(r,e){var t=Rd(r),i=!t&&zR(r),n=!t&&!i&&Xc(r),o=!t&&!i&&!n&&Ob(r),a=t||i||n||o,c=a?VE(r.length,String):[],p=c.length;for(var f in r)(e||tt.call(r,f))&&!(a&&(f=="length"||n&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||HR(f,p)))&&c.push(f);return c}function Md(r,e){for(var t=r.length;t--;)if(Tb(r[t][0],e))return t;return-1}function FR(r,e,t){var i=e(r);return Rd(r)?i:WE(i,t(r))}function Ss(r){return r==null?r===void 0?AE:wE:vr&&vr in Object(r)?NR(r):VR(r)}function ab(r){return ks(r)&&Ss(r)==Id}function wb(r,e,t,i,n){return r===e?!0:r==null||e==null||!ks(r)&&!ks(e)?r!==r&&e!==e:MR(r,e,t,i,wb,n)}function MR(r,e,t,i,n,o){var a=Rd(r),c=Rd(e),p=a?Gc:Mt(r),f=c?Gc:Mt(e);p=p==Id?xi:p,f=f==Id?xi:f;var v=p==xi,m=f==xi,b=p==f;if(b&&Xc(r)){if(!Xc(e))return!1;a=!0,v=!1}if(b&&!v)return o||(o=new Lt),a||Ob(r)?xb(r,e,t,i,n,o):DR(r,e,p,t,i,n,o);if(!(t&Od)){var y=v&&tt.call(r,"__wrapped__"),C=m&&tt.call(e,"__wrapped__");if(y||C){var I=y?r.value():r,T=C?e.value():e;return o||(o=new Lt),n(I,T,t,i,o)}}return b?(o||(o=new Lt),_R(r,e,t,i,n,o)):!1}function LR(r){if(!Rb(r)||WR(r))return!1;var e=Ab(r)?eR:NE;return e.test(kr(r))}function UR(r){return ks(r)&&Eb(r.length)&&!!H[Ss(r)]}function BR(r){if(!GR(r))return iR(r);var e=[];for(var t in Object(r))tt.call(r,t)&&t!="constructor"&&e.push(t);return e}function xb(r,e,t,i,n,o){var a=t&Od,c=r.length,p=e.length;if(c!=p&&!(a&&p>c))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var v=-1,m=!0,b=t&lb?new Ed:void 0;for(o.set(r,e),o.set(e,r);++v<c;){var y=r[v],C=e[v];if(i)var I=a?i(C,y,v,e,r,o):i(y,C,v,r,e,o);if(I!==void 0){if(I)continue;m=!1;break}if(b){if(!GE(e,function(T,M){if(!JE(b,M)&&(y===T||n(y,T,t,i,o)))return b.push(M)})){m=!1;break}}else if(!(y===C||n(y,C,t,i,o))){m=!1;break}}return o.delete(r),o.delete(e),m}function DR(r,e,t,i,n,o,a){switch(t){case Td:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case yb:return!(r.byteLength!=e.byteLength||!o(new nb(r),new nb(e)));case cb:case mb:case gb:return Tb(+r,+e);case pb:return r.name==e.name&&r.message==e.message;case hb:case vb:return r==e+"";case wd:var c=KE;case xd:var p=i&Od;if(c||(c=ZE),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=lb,a.set(r,e);var v=xb(c(r),c(e),i,n,o,a);return a.delete(r),v;case TE:if(Wc)return Wc.call(r)==Wc.call(e)}return!1}function _R(r,e,t,i,n,o){var a=t&Od,c=db(r),p=c.length,f=db(e),v=f.length;if(p!=v&&!a)return!1;for(var m=p;m--;){var b=c[m];if(!(a?b in e:tt.call(e,b)))return!1}var y=o.get(r);if(y&&o.get(e))return y==e;var C=!0;o.set(r,e),o.set(e,r);for(var I=a;++m<p;){b=c[m];var T=r[b],M=e[b];if(i)var ue=a?i(M,T,b,e,r,o):i(T,M,b,r,e,o);if(!(ue===void 0?T===M||n(T,M,t,i,o):ue)){C=!1;break}I||(I=b=="constructor")}if(C&&!I){var Dn=r.constructor,ba=e.constructor;Dn!=ba&&"constructor"in r&&"constructor"in e&&!(typeof Dn=="function"&&Dn instanceof Dn&&typeof ba=="function"&&ba instanceof ba)&&(C=!1)}return o.delete(r),o.delete(e),C}function db(r){return FR(r,KR,qR)}function Ld(r,e){var t=r.__data__;return jR(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Ai(r,e){var t=$E(r,e);return LR(t)?t:void 0}function NR(r){var e=tt.call(r,vr),t=r[vr];try{r[vr]=void 0;var i=!0}catch{}var n=Cb.call(r);return i&&(e?r[vr]=t:delete r[vr]),n}var qR=sb?function(r){return r==null?[]:(r=Object(r),jE(sb(r),function(e){return Ib.call(r,e)}))}:XR,Mt=Ss;(zc&&Mt(new zc(new ArrayBuffer(1)))!=Td||ys&&Mt(new ys)!=wd||Jc&&Mt(Jc.resolve())!=Yy||$c&&Mt(new $c)!=xd||Kc&&Mt(new Kc)!=Vc)&&(Mt=function(r){var e=Ss(r),t=e==xi?r.constructor:void 0,i=t?kr(t):"";if(i)switch(i){case nR:return Td;case sR:return wd;case oR:return Yy;case aR:return xd;case dR:return Vc}return e});function HR(r,e){return e=e??ub,!!e&&(typeof r=="number"||qE.test(r))&&r>-1&&r%1==0&&r<e}function jR(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function WR(r){return!!rb&&rb in r}function GR(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Fd;return r===t}function VR(r){return Cb.call(r)}function kr(r){if(r!=null){try{return Pb.call(r)}catch{}try{return r+""}catch{}}return""}function Tb(r,e){return r===e||r!==r&&e!==e}var zR=ab(function(){return arguments}())?ab:function(r){return ks(r)&&tt.call(r,"callee")&&!Ib.call(r,"callee")},Rd=Array.isArray;function JR(r){return r!=null&&Eb(r.length)&&!Ab(r)}var Xc=rR||ZR;function $R(r,e){return wb(r,e)}function Ab(r){if(!Rb(r))return!1;var e=Ss(r);return e==fb||e==IE||e==CE||e==xE}function Eb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ub}function Rb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ks(r){return r!=null&&typeof r=="object"}var Ob=tb?zE(tb):UR;function KR(r){return JR(r)?OR(r):BR(r)}function XR(){return[]}function ZR(){return!1}Ti.exports=$R});var fS=h(Kd=>{"use strict";Kd.byteLength=IO;Kd.toByteArray=xO;Kd.fromByteArray=EO;var nt=[],Ne=[],CO=typeof Uint8Array<"u"?Uint8Array:Array,Em="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ur=0,mS=Em.length;Ur<mS;++Ur)nt[Ur]=Em[Ur],Ne[Em.charCodeAt(Ur)]=Ur;var Ur,mS;Ne[45]=62;Ne[95]=63;function pS(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 IO(r){var e=pS(r),t=e[0],i=e[1];return(t+i)*3/4-i}function wO(r,e,t){return(e+t)*3/4-t}function xO(r){var e,t=pS(r),i=t[0],n=t[1],o=new CO(wO(r,i,n)),a=0,c=n>0?i-4:i,p;for(p=0;p<c;p+=4)e=Ne[r.charCodeAt(p)]<<18|Ne[r.charCodeAt(p+1)]<<12|Ne[r.charCodeAt(p+2)]<<6|Ne[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Ne[r.charCodeAt(p)]<<2|Ne[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=Ne[r.charCodeAt(p)]<<10|Ne[r.charCodeAt(p+1)]<<4|Ne[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function TO(r){return nt[r>>18&63]+nt[r>>12&63]+nt[r>>6&63]+nt[r&63]}function AO(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(TO(i));return n.join("")}function EO(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,c=t-i;a<c;a+=o)n.push(AO(r,a,a+o>c?c:a+o));return i===1?(e=r[t-1],n.push(nt[e>>2]+nt[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(nt[e>>10]+nt[e>>4&63]+nt[e<<2&63]+"=")),n.join("")}});var $H=_n(Fv(),1);function g(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function lr(r,e){if(!r)throw Error(e)}var re;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(re||(re={}));function wt(r){return r.startsWith(re.COMMENT)}function ld(r){return r.startsWith(re.ACCOUNT)}function ur(r){return r.startsWith(re.LINK)}function Mv(r){return r.startsWith(re.MESSAGE)}function Lv(r){return r.startsWith(re.SUBREDDIT)}function Uv(r){return r.startsWith(re.AWARD)}function jA(r){lr(wt(r),`Expected comment id to start with ${re.COMMENT}, got ${r}}`)}function WA(r){lr(ld(r),`Expected account id to start with ${re.ACCOUNT}, got ${r}}`)}function GA(r){lr(ur(r),`Expected link id to start with ${re.LINK}, got ${r}}`)}function VA(r){lr(Mv(r),`Expected message id to start with ${re.MESSAGE}, got ${r}}`)}function zA(r){lr(Lv(r),`Expected subreddit id to start with ${re.SUBREDDIT}, got ${r}}`)}function JA(r){lr(Uv(r),`Expected award id to start with ${re.AWARD}, got ${r}}`)}function ri(r){return jA(r),r}function ie(r){return WA(r),r}function fe(r){return GA(r),r}function $A(r){return VA(r),r}function Re(r){return zA(r),r}function KA(r){return JA(r),r}function ge(r){if(wt(r))return ri(r);if(ld(r))return ie(r);if(ur(r))return fe(r);if(Mv(r))return $A(r);if(Lv(r))return Re(r);if(Uv(r))return KA(r);throw new Error(`Expected thing id to start with ${Object.values(re).join(", ")} got ${r}}`)}function mc(r){return wt(r)}import*as P from"@devvit/protos";var ud=class{constructor(e){}};var pc=(t=>(t.Installation="installation",t.App="app",t))(pc||{});function cr(r,e=new Set){for(let t of r){if(t.type==="group"){cr(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}XA(r)}function XA(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 xt=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var hL=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","brand-awareness","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","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","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","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","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","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","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as m0,GetFieldsResponse as p0}from"@devvit/protos";import{FormField as mr,FormFieldType as Oe}from"@devvit/protos";function ut(r){return r.map(e=>{switch(e.type){case"string":return ZA(e);case"image":return YA(e);case"paragraph":return QA(e);case"number":return e0(e);case"select":return t0(e);case"boolean":return r0(e);case"group":return i0(e);default:throw new Error("Unknown field type.")}})}function ZA(r){return mr.fromPartial({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 YA(r){return mr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Oe.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function QA(r){return mr.fromPartial({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 e0(r){return mr.fromPartial({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 t0(r){return mr.fromPartial({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 r0(r){return mr.fromPartial({defaultValue:{fieldType:Oe.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Oe.BOOLEAN,helpText:r.helpText,label:r.label})}function i0(r){return mr.fromPartial({fieldType:Oe.GROUP,fieldConfig:{groupConfig:{fields:ut(r.fields)}},label:r.label,helpText:r.helpText})}function U(r,e){u.prototype[r]=e}import{ValidateFormResponse as c0}from"@devvit/protos";import{RealtimeSubscriptionStatus as Dv}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",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",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",WebviewTemplate:"devvit-webview-template"}),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"})(Bv||(Bv={}));function _v(r){function e(t){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=r.metadata[D.App]?.values[0];g(c,"useChannel - app is missing from Context");let p=r.metadata[D.Installation]?.values[0];g(p,"useChannel - installation is missing from Context");async function f(T){let M=o[n].channel;if(o[n].active)if(o[n].connected)await r.realtime.send(M,T);else throw Error(`Failed to send to channel '${M}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${M}`)}function v(){if(!o[n].active){let T=o[n].channel;o[n].active=!0,r.addRealtimeChannel(T)}}function m(){if(o[n].active){let T=o[n].channel;o[n].active=!1,r.removeRealtimeChannel(T)}}function b(T){return async()=>{let M;switch(T.status){case Dv.REALTIME_SUBSCRIBED:o[n].connected=!0,M=t.onSubscribed?.();break;case Dv.REALTIME_UNSUBSCRIBED:o[n].connected=!1,M=t.onUnsubscribed?.();break;default:M=t.onMessage(T.event?.data??{});break}await M}}let y={channel:`${c}:${p}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:xt.CHANNEL};n in o?y=o[n]:n in a&&(y=a[n]);let C=r.realtimeEvent;r.isInitialRender?y.active=!1:C&&y.active&&C.event.channel===y.channel&&(y.preventCallback||r.runHook(b(C)),r.rerenderIn(0)),o[n]=y,r.currentHookIndex++;let I=0;return y.active&&y.connected?I=2:y.active&&!y.connected?I=1:!y.active&&y.connected?I=3:!y.active&&!y.connected&&(I=4),{subscribe:v,unsubscribe:m,send:f,status:I}}return e}import{FormFieldType as ii}from"@devvit/protos";function fc(r){switch(r.fieldType){case ii.STRING:return r.stringValue;case ii.IMAGE:return r.stringValue;case ii.PARAGRAPH:return r.stringValue;case ii.NUMBER:return r.numberValue;case ii.BOOLEAN:return r.boolValue;case ii.SELECTION:return r.selectionValue?.values??[];default:return}}function Tt(r){return Object.keys(r).reduce((e,t)=>{let i=fc(r[t]);return i!==void 0&&(e[t]=i),e},{})}function Nv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),c=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,f={formKey:p,preventSubmit:!1,type:xt.FORM};n in a?f=a[n]:n in c&&(f=c[n]),a[n]=f,r.forms.set(p,t);let v=r.formSubmittedEvent;return v&&!f.preventSubmit&&v.formId===p&&r.runHook(async()=>{let m=i(Tt(v.results));m&&m instanceof Promise&&await m,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function qv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),c=100,p=Math.max(c,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:xt.INTERVAL};n in o?f=o[n]:n in a&&(f=a[n]);function v(){i<c&&console.error(`useInterval delay must be at least ${c}ms. Your interval of ${i}ms was automatically extended.`);for(let[b,y]of Object.entries(o))if(b!==n.toString()&&y?.type===xt.INTERVAL&&y?.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:xt.INTERVAL},r.rerenderIn(p)}function m(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let b=t();b&&b instanceof Promise&&await b,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[n]=f,r.currentHookIndex++,{start:v,stop:m}}return e}function Hv(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 yc={now(){return new Date}};function jv(r){return`__autocache__${r}`}function Wv(r){return`__lock__${r}`}var s0=300,o0=1e3,cd=5e3,gc=3,Gv=.1,Vv=1e3,a0=3e4;function zv(r){if(r.error)throw new Error(r.error);return r.value}var At,Et,Fe,ni,J,Jv,$v,Kv,hc,Xv,Zv,vc,Yv,md=class{constructor(e,t,i=yc){l(this,J);l(this,At);l(this,Et,{});l(this,Fe);l(this,ni);d(this,At,e),d(this,ni,t),d(this,Fe,i)}async cache(e,t){d(this,Et,s(this,ni).__cache=s(this,ni).__cache??{}),S(this,J,Yv).call(this,t);let i=S(this,J,Jv).call(this,t.key);if(i!==void 0)return i;let n=await S(this,J,vc).call(this,t.key),o=await S(this,J,$v).call(this,t,n,e);return zv(o)}};At=new WeakMap,Et=new WeakMap,Fe=new WeakMap,ni=new WeakMap,J=new WeakSet,Jv=function(e){let t=s(this,Et)[e];if(t){let i=s(this,Fe).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<gc&&Math.random()<Gv&&t.errorTime+Vv<i;if(t?.expires&&t.expires<i&&t.checkedAt+Vv<i||n){delete s(this,Et)[e];return}else return zv(t)}},$v=async function(e,t,i){let n=t?.expires,o=n?S(this,J,Zv).call(this,n):1;return!t||t?.error&&t.errorCount<gc&&Gv>Math.random()||o>Math.random()?S(this,J,Kv).call(this,e,t,i):t},Kv=async function(e,t,i){let n=Wv(e.key),o=s(this,Fe).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,At).set(n,"1",{expiration:a,nx:!0}))return S(this,J,Xv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Fe).now();return S(this,J,hc).call(this,p,e.key,e.ttl)}},hc=async function(e,t,i){let n=Math.min(i,o0),o=await S(this,J,vc).call(this,t);if(o)return o;if(s(this,Fe).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,s0)),S(this,J,hc).call(this,e,t,i)},Xv=async function(e,t,i,n){let o=s(this,Fe).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,Fe).now().getTime(),t.errorCount++}return s(this,Et)[e]=t,await s(this,At).set(jv(e),JSON.stringify(t),{expiration:new Date(o+a0)}),t.error&&t.errorCount<gc&&await s(this,At).del(Wv(e)),t},Zv=function(e){let t=s(this,Fe).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},vc=async function(e){let t=await s(this,At).get(jv(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Fe).now().getTime(),s(this,Et)[e]=i,i}},Yv=function(e){e.ttl<cd&&(console.warn(`Cache TTL cannot be less than ${cd} milliseconds! Updating ttl value of ${e.ttl} to ${cd}.`),e.ttl=cd)};function Qv(r,e,t=yc){let i=new md(r,e,t);return i.cache.bind(i)}function ey(r){new URL(r.slice(0,r.indexOf(",")))}var si,oi,di,ty,ry,ai=class{constructor(){l(this,di);l(this,si,{});l(this,oi,{});d(this,si,u.assets),d(this,oi,u.webviewAssets)}getURL(e,t){return typeof e=="string"?S(this,di,ty).call(this,e,t??{webview:!1}):S(this,di,ry).call(this,e,t??{webview:!1})}};si=new WeakMap,oi=new WeakMap,di=new WeakSet,ty=function(e,t){let i=t.webview?s(this,oi)[e]:s(this,si)[e];if(i)return i;try{return ey(e),encodeURI(e)}catch{return""}},ry=function(e,t){let i={},n=[],o=t.webview?s(this,oi):s(this,si);if(o)for(let a of e)if(o[a])i[a]=o[a];else try{ey(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 Rt,li=class{constructor(e){l(this,Rt);d(this,Rt,e)}async get(e){let{messages:t}=await u.kvStorePlugin.Get({keys:[e]},s(this,Rt));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,Rt))}async delete(e){await u.kvStorePlugin.Del({keys:[e]},s(this,Rt))}async list(){let{keys:e}=await u.kvStorePlugin.List({filter:"*"},s(this,Rt));return e}};Rt=new WeakMap;var os,ui=class{constructor(e){l(this,os);d(this,os,e)}async upload(e){let t=await u.mediaPlugin.Upload(e,s(this,os));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};os=new WeakMap;var as,ci=class{constructor(e){l(this,as);d(this,as,e)}async add(e){await u.modLogPlugin.Add(e,s(this,as))}};as=new WeakMap;var ds,mi=class{constructor(e){l(this,ds);d(this,ds,e)}async send(e,t){await u.realtimePlugin.Send({channel:e,data:t},s(this,ds))}};ds=new WeakMap;var k,ls,fi=class{constructor(e){l(this,k);l(this,ls);d(this,k,e),d(this,ls,new fd(e))}get modMail(){return s(this,ls)}getSubredditById(e){return he.getById(ge(e),s(this,k))}getSubredditByName(e){return he.getByName(e,s(this,k))}addSubredditRemovalReason(e,t){return he.addRemovalReason(e,t.title,t.message,s(this,k))}getSubredditRemovalReasons(e){return he.getRemovalReasons(e,s(this,k))}getCurrentSubreddit(){return he.getFromMetadata(s(this,k))}getPostById(e){return V.getById(ge(e),s(this,k))}submitPost(e){return V.submit(e,s(this,k))}crosspost(e){return V.crosspost(e,s(this,k))}getUserById(e){return w.getById(ge(e),s(this,k))}getCollectionById(e){return pi.getCollectionById({collectionId:e},s(this,k))}createCollection(e){return pi.create(e,s(this,k))}getCollectionsForSubreddit(e){return pi.getCollectionsForSubreddit({subredditId:e},s(this,k))}getUserByUsername(e){return w.getByUsername(e,s(this,k))}getCurrentUser(){return w.getFromMetadata(D.User,s(this,k))}getAppUser(){return w.getFromMetadata(D.AppUser,s(this,k))}getSnoovatarUrl(e){return w.getSnoovatarUrl(e,s(this,k))}getCommentById(e){return Y.getById(ge(e),s(this,k))}getComments(e){return Y.getComments(e,s(this,k))}getCommentsByUser(e){return Y.getCommentsByUser(e,s(this,k))}submitComment(e){return Y.submit({...e,id:ge(e.id)},s(this,k))}getControversialPosts(e){return V.getControversialPosts(e,s(this,k))}getTopPosts(e){return V.getTopPosts(e,s(this,k))}getHotPosts(e){return V.getHotPosts(e,s(this,k))}getNewPosts(e){return V.getNewPosts(e,s(this,k))}getRisingPosts(e){return V.getRisingPosts(e,s(this,k))}getPostsByUser(e){return V.getPostsByUser(e,s(this,k))}getCommentsAndPostsByUser(e){return w.getOverview(e,s(this,k))}getModerationLog(e){return pd(e,s(this,k))}getApprovedUsers(e){return w.getSubredditUsersByType({type:"contributors",...e},s(this,k))}approveUser(e,t){return w.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}removeUser(e,t){return w.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,k))}getWikiContributors(e){return w.getSubredditUsersByType({type:"wikicontributors",...e},s(this,k))}addWikiContributor(e,t){return w.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}removeWikiContributor(e,t){return w.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,k))}getBannedUsers(e){return w.getSubredditUsersByType({type:"banned",...e},s(this,k))}banUser(e){return w.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},s(this,k))}unbanUser(e,t){return w.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,k))}getBannedWikiContributors(e){return w.getSubredditUsersByType({type:"wikibanned",...e},s(this,k))}banWikiContributor(e){return w.createRelationship({...e,type:"wikibanned"},s(this,k))}unbanWikiContributor(e,t){return w.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,k))}getModerators(e){return w.getSubredditUsersByType({type:"moderators",...e},s(this,k))}inviteModerator(e){return w.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},s(this,k))}revokeModeratorInvite(e,t){return w.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,k))}removeModerator(e,t){return w.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,k))}setModeratorPermissions(e,t,i){return w.setModeratorPermissions(e,t,i,s(this,k))}getMutedUsers(e){return w.getSubredditUsersByType({type:"muted",...e},s(this,k))}muteUser(e){return w.createRelationship({...e,type:"muted"},s(this,k))}unmuteUser(e,t){return w.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?ge(e.redditId):void 0};return Me.add(t,s(this,k))}addRemovalNote(e){return Me.addRemovalNote(e,s(this,k))}async sendPrivateMessage(e){return pr.send(e,s(this,k))}async sendPrivateMessageAsSubreddit(e){return pr.sendAsSubreddit(e,s(this,k))}async approve(e){if(wt(e))return Y.approve(e,s(this,k));if(ur(e))return V.approve(e,s(this,k));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(wt(e))return Y.remove(e,t,s(this,k));if(ur(e))return V.remove(e,t,s(this,k));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return ae.getPostFlairTemplates(e,s(this,k))}async getUserFlairTemplates(e){return ae.getUserFlairTemplates(e,s(this,k))}async createPostFlairTemplate(e){return ae.createPostFlairTemplate(e,s(this,k))}async createUserFlairTemplate(e){return ae.createUserFlairTemplate(e,s(this,k))}async editFlairTemplate(e){return ae.editFlairTemplate(e,s(this,k))}async deleteFlairTemplate(e,t){return ae.deleteFlairTemplate(e,t,s(this,k))}async setUserFlair(e){return Le.setUserFlair(e,s(this,k))}async removeUserFlair(e,t){return Le.removeUserFlair(e,t,s(this,k))}async setPostFlair(e){return Le.setPostFlair(e,s(this,k))}async removePostFlair(e,t){return Le.removePostFlair(e,fe(t),s(this,k))}async getWidgets(e){return ne.getWidgets(e,s(this,k))}async deleteWidget(e,t){return ne.delete(e,t,s(this,k))}async addWidget(e){return ne.add(e,s(this,k))}async reorderWidgets(e,t){return ne.reorder(e,t,s(this,k))}async getWikiPage(e,t){return ve.getPage(e,t,s(this,k))}async getWikiPages(e){return ve.getPages(e,s(this,k))}async createWikiPage(e){return ve.createPage(e,s(this,k))}async updateWikiPage(e){return ve.updatePage(e,s(this,k))}getWikiPageRevisions(e){return ve.getPageRevisions(e,s(this,k))}async revertWikiPage(e,t,i){return ve.revertPage(e,t,i,s(this,k))}async getWikiPageSettings(e,t){return ve.getPageSettings(e,t,s(this,k))}async updateWikiPageSettings(e){return ve.updatePageSettings(e,s(this,k))}async addEditorToWikiPage(e,t,i){return ve.addEditor(e,t,i,s(this,k))}async removeEditorFromWikiPage(e,t,i){return ve.removeEditor(e,t,i,s(this,k))}getMessages(e){return pr.getMessages(e,s(this,k))}markAllMessagesAsRead(){return pr.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 he.aboutLocation({...e,location:"modqueue"},s(this,k))}getReports(e){return he.aboutLocation({...e,location:"reports"},s(this,k))}getSpam(e){return he.aboutLocation({...e,location:"spam"},s(this,k))}getUnmoderated(e){return he.aboutLocation({...e,location:"unmoderated"},s(this,k))}getEdited(e){return he.aboutLocation({...e,location:"edited"},s(this,k))}getVaultByAddress(e){return sy(e,s(this,k))}getVaultByUserId(e){return oy(ge(e),s(this,k))}getSubredditLeaderboard(e){return ny(e,s(this,k))}};k=new WeakMap,ls=new WeakMap;import{RedisKeyScope as bc}from"@devvit/protos";var R,O,F,kc=class{constructor(e,t,i){l(this,R);l(this,O);l(this,F);d(this,R,e),d(this,O,t),d(this,F,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,O)},s(this,F)),this}async multi(){await s(this,R).Multi(s(this,O),s(this,F))}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,F)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,O)},s(this,F)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,O)},s(this,F)),this}async exec(){let e=await s(this,R).Exec(s(this,O),s(this,F)),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,F))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,O)},s(this,F)),this}async unwatch(){return await s(this,R).Unwatch(s(this,O),s(this,F)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,O)},s(this,F)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,O)},s(this,F)),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,F)),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,F)),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,F)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,O)},s(this,F)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,O)},s(this,F)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,O)},s(this,F)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,O)},s(this,F)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,O)},member:t},s(this,F)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,O)},member:t},s(this,F)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,O)},s(this,F)),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,F)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,O)},s(this,F)),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,F)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,O)},members:t},s(this,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),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,F)),this}};R=new WeakMap,O=new WeakMap,F=new WeakMap;var L,gi,Sc=class Sc{constructor(e,t=void 0,i=bc.INSTALLATION){l(this,L);l(this,gi);d(this,L,e),d(this,gi,t),this.scope=i,this.global=i===bc.INSTALLATION?new Sc(s(this,L),s(this,gi),bc.GLOBAL):this}get storage(){return s(this,gi)||u.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,L));return new kc(this.storage,t,s(this,L))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},s(this,L));return t!==null?t.value??void 0: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,L))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,L))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,L))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,L));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,L))).value}async strlen(e){return this.strLen(e)}async strLen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,L))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,L))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,L))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,L))).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,L))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,L))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,L))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,L))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,L))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},s(this,L));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},s(this,L));return i!==null?i.value:i}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,L));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,L));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,L))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,L));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,L))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,L));return t!==null?t.value:t}async hget(e,t){return this.hGet(e,t)}async hGet(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},s(this,L));return i!==null?i.value??void 0: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,L))).value}async hgetall(e){return this.hGetAll(e)}async hGetAll(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,L));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,L))).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,L))}async hkeys(e){return this.hKeys(e)}async hKeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,L));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,L))).value}async hlen(e){return this.hLen(e)}async hLen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};L=new WeakMap,gi=new WeakMap;var hi=Sc;var fr,vi=class{constructor(e){l(this,fr);d(this,fr,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,fr))).id}async cancelJob(e){await u.schedulerPlugin.Cancel({id:e},s(this,fr))}async listJobs(){return(await u.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,fr))).actions.map(t=>(g(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}))}};fr=new WeakMap;var us,yi=class{constructor(e){l(this,us);d(this,us,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await u.settingsPlugin.GetSettings({},s(this,us));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)}}};us=new WeakMap;function ay(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=fc(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 Pc,Form as d0,ToastAppearance as ly}from"@devvit/protos";var gr,bi,gd=class{constructor(e){l(this,gr,[]);l(this,bi);d(this,bi,e)}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=d0.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});cr(n.fields),o.fields=ut(n.fields),s(this,gr).push({type:Pc.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,gr).push({type:Pc.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,gr).push({type:Pc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,gr)}};gr=new WeakMap,bi=new WeakMap;function Ue({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new ci(r),o=new li(r),a=new hi(r),c=Qv(a,i?i.state:{}),p=new fi(r),f=new vi(r),v=new yi(r),m=e?new gd(i):void 0,b=new ui(r),y=new ai,C=new mi(r),I=t&&i?Hv(i):void 0,T=t&&i?qv(i):void 0,M=t&&i?Nv(i):void 0,ue=t&&i?_v(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:f,settings:v,media:b,assets:y,realtime:C,get useForm(){return M??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return c??(()=>{throw new Error("cache() is unavailable")})},get useState(){return I??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return T??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return ue??(()=>{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.0-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.0-dev","@devvit/shared-types":"0.11.0-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/eslint-config":"0.11.0-dev","@devvit/repo-tools":"0.11.0-dev","@devvit/tsconfig":"0.11.0-dev","@microsoft/api-extractor":"7.41.0","@reddit/faceplate-ui":"11.3.3","@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:"8.9.0",typescript:"5.3.2",vitest:"1.6.0"},publishConfig:{directory:"dist"},filesize:{"dist/public-api.min.js":{gzip:"78 KB",none:"255 KB"}},source:"./src/index.ts"};function de(r,e,t){let i=r[D.Subreddit]?.values[0];g(i,"subreddit is missing from Context");let n=r[D.AppUser]?.values[0],o=r[D.User]?.values[0],a=u0(r);return{get appAccountId(){return g(n,"appAccountId is missing from Context"),n},subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}function u0(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},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 hd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=c0.fromPartial({success:!0,errors:{}}),n=Tt(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],f=a.onValidate,v=Object.assign(Ue({metadata:t}),de(t)),m=await f({value:p,isEditing:r.editing},v);m&&(i.success=!1,i.errors[c]=m)}})),i}async function f0(){if(!u.appSettings)throw new Error("App settings were not defined.");return p0.fromPartial({fields:{fields:ut(u.appSettings)}})}async function g0(r,e){return hd(r,u.appSettings,e)}function my(r){r.provides(m0),U("GetAppSettingsFields",f0),U("ValidateAppForm",g0)}import{CustomPostDefinition as P0}from"@devvit/protos";import{BlockRenderEventType as Bc,EffectType as Ry}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 Uc,BlockAnimationDirection as Cy,BlockAnimationLoopMode as Iy,BlockAnimationType as wy,BlockAvatarBackground as xy,BlockAvatarFacing as Ty,BlockAvatarSize as Ot,BlockBorderWidth as kd,BlockButtonAppearance as Ft,BlockButtonSize as Tc,BlockFullSnooSize as Pi,BlockGap as Sd,BlockHorizontalAlignment as Ac,BlockIconSize as Pd,BlockImageResizeMode as cs,BlockPadding as ms,BlockRadius as ps,BlockSpacerShape as Ec,BlockSpacerSize as Cd,BlockStackDirection as Rc,BlockTextOutline as Oc,BlockTextOverflow as Fc,BlockTextSize as Ci,BlockTextStyle as Mc,BlockTextWeight as Ay,BlockType as Be,BlockVerticalAlignment as Lc}from"@devvit/protos";var Cc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"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"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var fy={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"},gy=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),hy=r=>r in Cc,Ic=r=>r in fy,vy=r=>!!r.match(/^rgba?\(.*/),yy=r=>!!r.match(/^hsla?\(.*/),by=(r,e="light")=>{if(Ic(r))return vd(r);let i=Cc[r];return typeof i=="string"?i:i[e]},vd=r=>fy[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),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};import{BlockStackDirection as yd}from"@devvit/protos";var wc={stackParentLayout:{hasHeight:!0,hasWidth:!0,direction:yd.UNRECOGNIZED,alignment:void 0}};function Py(r,e,t){if(!e)return{hasHeight:!1,hasWidth:!1};let{growDirection:i,stretchDirection:n}=h0(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 h0(r,e,t){let i=e===yd.STACK_VERTICAL||e===yd.UNRECOGNIZED,n=e===yd.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,f=0;return n&&p?f=2:i&&p&&(f=1),{growDirection:o,stretchDirection:f}}import{BlockSizeUnit as hr,BlockStackDirection as bd}from"@devvit/protos";function Si(r){if(r==null)return;if(typeof r=="number")return{value:r,unit:hr.SIZE_UNIT_PERCENT};let e=r.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(e==null)return;let t=hr.SIZE_UNIT_PERCENT;return e.at(2)==="px"&&(t=hr.SIZE_UNIT_PIXELS),{value:Number.parseFloat(e[1]),unit:t}}function v0(r,e){return(r.width?.value?.unit===hr.SIZE_UNIT_PERCENT||r.width?.min?.unit===hr.SIZE_UNIT_PERCENT)&&(e.direction===bd.STACK_HORIZONTAL||e.direction===bd.STACK_DEPTH)&&(e.hasWidth||(r.width=void 0)),(r.height?.value?.unit===hr.SIZE_UNIT_PERCENT||r.height?.min?.unit===hr.SIZE_UNIT_PERCENT)&&(e.direction===bd.STACK_VERTICAL||e.direction===bd.STACK_DEPTH)&&(e.hasHeight||(r.height=void 0)),r}function xc(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=v0(n,e.stackParentLayout)),n}}}var Ey="data-",y0=new Set(["onPress","onMessage"]),b0=new Map([["onPress",Uc.ACTION_CLICK],["onMessage",Uc.ACTION_WEBVIEW]]),fs,Ii=class{constructor(e=()=>{}){l(this,fs);d(this,fs,e)}createBlocksElementOrThrow({type:e,props:t,children:i}){let n=this.createBlocksElement({type:e,props:t,children:i},wc);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"fullsnoo":return this.makeFullSnoo(t,n);case"animation":return this.makeAnimation(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 Sd.GAP_NONE;case"small":return Sd.GAP_SMALL;case"medium":return Sd.GAP_MEDIUM;case"large":return Sd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Lc.ALIGN_TOP:e.includes("middle")?t=Lc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Lc.ALIGN_BOTTOM),e.includes("start")?i=Ac.ALIGN_START:e.includes("center")?i=Ac.ALIGN_CENTER:e.includes("end")&&(i=Ac.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=kd.BORDER_WIDTH_NONE;break;case"thin":o=kd.BORDER_WIDTH_THIN;break;case"thick":o=kd.BORDER_WIDTH_THICK;break;default:o=kd.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 Ci.TEXT_SIZE_XSMALL;case"small":return Ci.TEXT_SIZE_SMALL;case"medium":return Ci.TEXT_SIZE_MEDIUM;case"large":return Ci.TEXT_SIZE_LARGE;case"xlarge":return Ci.TEXT_SIZE_XLARGE;case"xxlarge":return Ci.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Mc.TEXT_STYLE_BODY;case"metadata":return Mc.TEXT_STYLE_METADATA;case"heading":return Mc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return Oc.TEXT_OUTLINE_NONE;case"thin":return Oc.TEXT_OUTLINE_THIN;case"thick":return Oc.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return Ay.TEXT_WEIGHT_REGULAR;case"bold":return Ay.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return Fc.TEXT_OVERFLOW_CLIP;case"ellipsis":return Fc.TEXT_OVERFLOW_ELLIPSE}return Fc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Ft.BUTTON_APPEARANCE_SECONDARY;case"primary":return Ft.BUTTON_APPEARANCE_PRIMARY;case"plain":return Ft.BUTTON_APPEARANCE_PLAIN;case"bordered":return Ft.BUTTON_APPEARANCE_BORDERED;case"media":return Ft.BUTTON_APPEARANCE_MEDIA;case"destructive":return Ft.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Ft.BUTTON_APPEARANCE_CAUTION;case"success":return Ft.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Tc.BUTTON_SIZE_SMALL;case"medium":return Tc.BUTTON_SIZE_MEDIUM;case"large":return Tc.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 Cd.SPACER_XSMALL;case"small":return Cd.SPACER_SMALL;case"medium":return Cd.SPACER_MEDIUM;case"large":return Cd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return Ec.SPACER_INVISIBLE;case"thin":return Ec.SPACER_THIN;case"square":return Ec.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return Pd.ICON_SIZE_XSMALL;case"small":return Pd.ICON_SIZE_SMALL;case"medium":return Pd.ICON_SIZE_MEDIUM;case"large":return Pd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Ot.AVATAR_SIZE_XXSMALL;case"xsmall":return Ot.AVATAR_SIZE_XSMALL;case"small":return Ot.AVATAR_SIZE_SMALL;case"medium":return Ot.AVATAR_SIZE_MEDIUM;case"large":return Ot.AVATAR_SIZE_LARGE;case"xlarge":return Ot.AVATAR_SIZE_XXLARGE;case"xxlarge":return Ot.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Ot.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Ty.AVATAR_FACING_LEFT;case"right":return Ty.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return Pi.FULLSNOO_XSMALL;case"small":return Pi.FULLSNOO_SMALL;case"medium":return Pi.FULLSNOO_MEDIUM;case"large":return Pi.FULLSNOO_LARGE;case"xlarge":return Pi.FULLSNOO_XLARGE;case"xxlarge":return Pi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return xy.AVATAR_BG_DARK;case"light":return xy.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?wy.ANIM_LOTTIE:wy.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return Cy.ANIM_DIR_BACKWARD;case"forward":return Cy.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Iy.ANIM_LOOP_REPEAT;case"bounce":return Iy.ANIM_LOOP_BOUNCE}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(Ey)).reduce((t,i)=>(t[i.substring(Ey.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);return y0.forEach(o=>{if(o in t){let a=t[o];i.push({type:b0.get(o)??Uc.UNRECOGNIZED,id:a.toString(),data:n})}}),i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),gy(e)?e:hy(e)?by(e,t):Ic(e)?vd(e):vy(e)?ky(e):yy(e)?e:(console.warn(`Could not parse color: ${e}.`),vd("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,fs).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,wc))}wrapRoot(e,t){return this.makeBlock(Be.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=xc(t,i),p=Py(t,i.stackParentLayout,c);return this.makeBlock(Be.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(Rc.STACK_HORIZONTAL,e,t,i)}makeVStack(e,t,...i){return this.makeStackBlock(Rc.STACK_VERTICAL,e,t,i)}makeZStack(e,t,...i){return this.makeStackBlock(Rc.STACK_DEPTH,e,t,i)}makeText(e,t,...i){let n=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(Be.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(Be.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(Be.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(Be.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(Be.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(Be.BLOCK_AVATAR,e,t,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e,t){return e&&this.makeBlock(Be.BLOCK_FULLSNOO,e,t,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}makeAnimation(e,t){return e&&this.makeBlock(Be.BLOCK_ANIMATION,e,t,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:this.resolveAssetUrl(e.url),loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e,t){return e&&this.makeBlock(Be.BLOCK_WEBVIEW,e,t,{webviewConfig:{url:this.resolveAssetUrl(e.url,{webview:!0}),state:e.state}})}makeBlock(e,t,i,n){return{type:e,sizes:xc(t,i),config:n,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}ensureRootBlock(e){let t=e;if(t.type===Be.BLOCK_ROOT)return t.config?.rootConfig&&u.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(u.customPostType?.height)),t;let i=this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};fs=new WeakMap;function Oy(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Fy=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+=Fy(i);return e+=`</${r.type}>`,e};function k0(r){return" ".repeat(r)}function S0(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+=k0(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 De,My,gs,Dc,hs,ct=class{constructor(e,t,i,n,o){l(this,De);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 Ii(()=>this.assets);this.effects=[];l(this,hs,!1);this.component=e,this.event=t,this.state={__renderState:{},...i},this.metadata=n,this.state.__realtimeChannels&&(this.realtimeChannels=this.state.__realtimeChannels);let a=Ue({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,De,gs).call(this),t={type:this.component,props:e,children:[]},i=await this.processBlock(t);if(Oy(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,De,My).call(this)}async buildBlocksUI(){let e=S(this,De,gs).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 Oy(i),(u.debug.emitSnapshots||e.debug.emitSnapshots)&&console.debug(S0(Fy(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(),f=S(this,De,Dc).call(this,p);return await this.processProps(n),{type:n.type,props:n.props,children:f}}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),f={...S(this,De,gs).call(this),...n.props,children:p},v;for(;v===void 0;)try{v=await n.type(f,S(this,De,gs).call(this))}catch(m){if(m instanceof Promise)v=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 v=="object")return this.processBlock(v,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===Bc.RENDER_INITIAL:!1}get isUserActionRender(){return this.event?this.event.type===Bc.RENDER_USER_ACTION:!1}get isEffectRender(){return this.event?this.event.type===Bc.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,hs)||(d(this,hs,!0),this.effects.push({type:Ry.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:Ry.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}:{}}}};De=new WeakSet,My=function(){this.actions.clear(),this.currentComponentKey=[],this.currentHookIndex=0,this.pendingHooks=[],this.realtimeChannels=[],this.realtimeUpdated=!1},gs=function(){let e={...de(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},Dc=function(e){let t=[];for(let i of e)typeof i=="string"?t.push(i):i.type==="__fragment"?t.push(...S(this,De,Dc).call(this,i.children)):t.push(i);return t},hs=new WeakMap;async function C0(r,e){let t=u.customPostType;if(!t)throw new Error("Custom post type not registered");let i=new ct((o,a)=>t.render(a),r.blocks,r.state,e,r.dimensions),n=await i.render();return{state:i.state,blocks:{ui:n},effects:i.getEffects()}}function Ly(r){r.provides(P0),U("RenderPost",C0)}import{GetFieldsResponse as I0,InstallationSettingsDefinition as w0}from"@devvit/protos";async function x0(){if(!u.installationSettings)throw new Error("Installation settings were not defined.");return I0.fromPartial({fields:{fields:ut(u.installationSettings)}})}async function T0(r,e){return hd(r,u.installationSettings,e)}function Uy(r){r.provides(w0),U("GetSettingsFields",x0),U("ValidateForm",T0)}import{ContextActionDefinition as A0,ContextActionDescription as E0,ContextActionResponse as R0}from"@devvit/protos";var By=r=>`menuItem.${r}`;function _c(r){return u.menuItems.find((e,t)=>By(t)===r)}async function O0(r,e){let t=u.menuItems;if(!t.length)throw new Error("No menu items registered.");return{actions:t.map((n,o)=>E0.fromPartial({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"),member:n.forUserType?.includes("member"),moderator:n.forUserType?.includes("moderator")},postFilters:n.postFilter==="currentApp"?{currentApp:!0}:void 0}))}}async function F0(r,e){let t=_c(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;g(a,"targetId is missing from ContextActionRequest");let c={targetId:a,location:r.comment?"comment":r.post?"post":"subreddit"},p=Object.assign(Ue({ui:!0,metadata:e}),de(e,n,i),{uiEnvironment:{timezone:e[D.Timezone]?.values[0],locale:e[D.Language]?.values[0]}});return await t.onPress(c,p),R0.fromPartial({effects:ki(p.ui)})}function Dy(r){r.provides(A0),U("GetActions",O0),U("OnAction",F0)}function mt(r){return r?r===!0?!0:r.enabled:!1}import{SchedulerHandlerDefinition as M0}from"@devvit/protos";async function L0(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(Ue({metadata:e}),de(e));await i(n,o)}function _y(r){r.provides(M0),U("HandleScheduledAction",L0)}import{HandlerResult as U0,OnAppInstallDefinition as B0,OnAppUpgradeDefinition as D0,OnCommentCreateDefinition as _0,OnCommentDeleteDefinition as N0,OnCommentReportDefinition as q0,OnCommentSubmitDefinition as H0,OnCommentUpdateDefinition as j0,OnModActionDefinition as W0,OnModMailDefinition as G0,OnPostCreateDefinition as V0,OnPostDeleteDefinition as z0,OnPostFlairUpdateDefinition as J0,OnPostReportDefinition as $0,OnPostSubmitDefinition as K0,OnPostUpdateDefinition as X0,OnPostNsfwUpdateDefinition as Z0,OnPostSpoilerUpdateDefinition as Y0}from"@devvit/protos";var wi;(function(r){function e(o,a){return o.length<=a?o:`${o.slice(0,a-1)}\u2026`}r.ellipsize=e;function t(o){return o[0]==null?o:`${o[0].toLocaleUpperCase()}${o.slice(1)}`}r.capitalize=t;function i(o){return o==null||/^\s*$/.test(o)}r.isBlank=i;function n(o){return o instanceof Error?`${o.stack||o.message||o.name}`:String(o)}r.caughtToString=n})(wi||(wi={}));function Q(r,e){return g(e),async(t,i)=>{let n={...t,type:r},o=Object.assign(Ue({metadata:i}),de(i)),a=await Promise.allSettled(e.map(p=>p(n,o))),c=Q0(a);if(c)throw c.err;return U0.fromPartial({})}}function Ny(r){for(let e of u.triggerOnEventHandlers.keys())switch(e){case"PostSubmit":r.provides(K0),U("OnPostSubmit",Q("PostSubmit",u.triggerOnEventHandlers.get(e)));break;case"PostCreate":r.provides(V0),U("OnPostCreate",Q("PostCreate",u.triggerOnEventHandlers.get(e)));break;case"PostUpdate":r.provides(X0),U("OnPostUpdate",Q("PostUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostReport":r.provides($0),U("OnPostReport",Q("PostReport",u.triggerOnEventHandlers.get(e)));break;case"PostDelete":r.provides(z0),U("OnPostDelete",Q("PostDelete",u.triggerOnEventHandlers.get(e)));break;case"PostFlairUpdate":r.provides(J0),U("OnPostFlairUpdate",Q("PostFlairUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentSubmit":r.provides(H0),U("OnCommentSubmit",Q("CommentSubmit",u.triggerOnEventHandlers.get(e)));break;case"CommentCreate":r.provides(_0),U("OnCommentCreate",Q("CommentCreate",u.triggerOnEventHandlers.get(e)));break;case"CommentUpdate":r.provides(j0),U("OnCommentUpdate",Q("CommentUpdate",u.triggerOnEventHandlers.get(e)));break;case"CommentReport":r.provides(q0),U("OnCommentReport",Q("CommentReport",u.triggerOnEventHandlers.get(e)));break;case"CommentDelete":r.provides(N0),U("OnCommentDelete",Q("CommentDelete",u.triggerOnEventHandlers.get(e)));break;case"AppInstall":r.provides(B0),U("OnAppInstall",Q("AppInstall",u.triggerOnEventHandlers.get(e)));break;case"AppUpgrade":r.provides(D0),U("OnAppUpgrade",Q("AppUpgrade",u.triggerOnEventHandlers.get(e)));break;case"ModAction":r.provides(W0),U("OnModAction",Q("ModAction",u.triggerOnEventHandlers.get(e)));break;case"ModMail":r.provides(G0),U("OnModMail",Q("ModMail",u.triggerOnEventHandlers.get(e)));break;case"PostNsfwUpdate":r.provides(Z0),U("OnPostNsfwUpdate",Q("PostNsfwUpdate",u.triggerOnEventHandlers.get(e)));break;case"PostSpoilerUpdate":r.provides(Y0),U("OnPostSpoilerUpdate",Q("PostSpoilerUpdate",u.triggerOnEventHandlers.get(e)));break;default:throw new Error(`Unknown trigger event: ${e}`)}}function Q0(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
  `))}}var Fb=_n(Zy(),1),Mb=_n(Yc(),1);import{EffectType as YR,UIEventHandlerDefinition as QR}from"@devvit/protos";async function eO(r,e){let t=r.state??{},i=(0,Fb.default)(t),n=Ue({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 y=new ct((C,I)=>u.customPostType?.render(I)??null,r.event,r.state,e,void 0);return await y.reconcile(),{state:y.state,effects:y.getEffects()}}let f=u.formDefinitions.get(p);if(!f)throw new Error(`Form with key ${p} not found`);let v,m;if(i.__contextAction){let{actionId:y,thingId:C}=i.__contextAction,I=_c(y);I?.location==="post"?v=C:I?.location==="comment"&&(m=C)}let b=Object.assign(n,de(e,v,m),{uiEnvironment:{timezone:e[D.Timezone]?.values[0],locale:e[D.Language]?.values[0]}});await f.onSubmit({values:Tt(r.event.formSubmitted.results)},b)}else if(r.event?.realtimeEvent){if(u.customPostType){let p=new ct((f,v)=>u.customPostType?.render(v)??null,r.event,r.state,e,void 0);return await p.reconcile(),{state:p.state,effects:p.getEffects()}}}else if(r.event?.toastAction)throw new Error("Toast actions not yet implemented");let o=!(0,Mb.default)(t,i),a=ki(n.ui),c=o?[...a,{type:YR.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:0}}]:a;return{state:i,effects:c}}function Lb(r){r.provides(QR),U("HandleUIEvent",eO)}import{CustomPostDefinition as nk}from"@devvit/protos";import{EffectType as tm,Form as rO,ToastAppearance as Db}from"@devvit/protos";function Ub(r){let e=r.match(/form\.hook\.(.+)\.0/);if(e?.[1])return e[1]}var Qc=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(Tt(n.formSubmitted.results))}}};function em(r,e){let t=$e({namespace:"useForm"},i=>new Qc(i,r,e));return tO({id:t.hookId})}function tO(r){return`form.hook.${r.id}.0`}function Bb(r,e){let t=Ub(e);return r.getHook({id:t})}var Ut,Ud=class{constructor(e){l(this,Ut);d(this,Ut,e)}showForm(e,t){let i=Bb(s(this,Ut),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=rO.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});cr(n.fields),o.fields=ut(n.fields),s(this,Ut).emitEffect(e,{type:tm.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?Db.SUCCESS:Db.NEUTRAL}:t={text:e},s(this,Ut).emitEffect(e.toString(),{type:tm.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,Ut).emitEffect(t,{type:tm.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}};Ut=new WeakMap;import{EffectType as iO,RealtimeSubscriptionStatus as _b}from"@devvit/protos";var Bt,rt,Dt,Sr,Ps,im,Bd=class Bd{constructor(e,t){l(this,Ps);l(this,Bt);l(this,rt);l(this,Dt);l(this,Sr);d(this,Bt,t.context),d(this,rt,!!t.context._devvitContext?.debug.realtime),d(this,Sr,e),d(this,Dt,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,Bt).hooks).filter(c=>c instanceof Bd).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 _b.REALTIME_SUBSCRIBED:s(this,rt)&&console.debug(`[realtime] "${this.state.channel}" connected`),this.state.connected=!0,s(this,Dt).call(this),await s(this,Sr).onSubscribed?.();break;case _b.REALTIME_UNSUBSCRIBED:s(this,rt)&&console.debug(`[realtime] "${this.state.channel}" disconnected`),this.state.connected=!1,s(this,Dt).call(this),await s(this,Sr).onUnsubscribed?.();break;default:s(this,rt)&&console.debug(`[realtime] "${this.state.channel}" received message: ${JSON.stringify(e,void 0,2)}`),s(this,Sr).onMessage(t.event?.data??{});break}}async send(e){if(s(this,rt)&&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,Bt).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,rt)&&console.debug(`[realtime] "${this.state.channel}" subscribed`),this.state.subscribed=!0,s(this,Dt).call(this),S(this,Ps,im).call(this))}unsubscribe(){this.state.subscribed&&(s(this,rt)&&console.debug(`[realtime] "${this.state.channel}" unsubscribed`),this.state.subscribed=!1,s(this,Dt).call(this),S(this,Ps,im).call(this))}};Bt=new WeakMap,rt=new WeakMap,Dt=new WeakMap,Sr=new WeakMap,Ps=new WeakSet,im=function(){let e=Object.values(s(this,Bt).hooks).filter(t=>t instanceof Bd&&t.state.subscribed).map(t=>t.state.channel);s(this,Bt).emitEffect(this.state.channel,{type:iO.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:e}})};var rm=Bd;function nm(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 $e({id:e,namespace:e},t=>new rm(r,t))}import{EffectType as sm}from"@devvit/protos";function Nb(r){return typeof r=="object"&&r!==null&&"__deleted"in r}var Pr,Ei=class Ei{constructor(e,t){l(this,Pr);this._segments=[];this._hooks={};this._prevHookId="";this._effects={};this._changed={};this._touched={};this._requeueEvents=[];this._rootProps={};this._generated={};this._undeliveredHandlers={};this.request=e,this.meta=t,d(this,Pr,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,Pr).__cache??{}};for(let i in this._changed)e[i]=this._state[i];let t=new Set(Object.keys(this._state));return Object.keys(this._hooks).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 this._hooks}get _state(){return s(this,Pr)}set _state(e){this._changed={},this._hooks={},d(this,Pr,e)}push(e){this._segments.push({...e,next:0})}pop(){this._segments.pop()}addUndeliveredEventHandler(e,t){this._undeliveredHandlers[e]=t}addGlobalUndeliveredEventHandler(e,t){Ei.addGlobalUndeliveredEventHandler(e,t)}getHook(e){return this._hooks[e.id]}static addGlobalUndeliveredEventHandler(e,t){Ei._staticUndeliveredHandlers[e]=t}async handleUndeliveredEvent(e){let t={...Ei._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()}}};Pr=new WeakMap,Ei._staticUndeliveredHandlers={};var Ri=Ei;var _t={};Ri.addGlobalUndeliveredEventHandler("intervals",async(r,e)=>{r.timer&&r.hook&&(delete _t[r.hook],e.emitEffect("timers",{type:sm.EFFECT_SET_INTERVALS,interval:{intervals:_t}}))});var Nt,Oi,Cs,Fi,om=class{constructor(e,t,i){l(this,Nt);l(this,Oi);l(this,Cs);l(this,Fi);this.state={duration:{seconds:0,nanos:0},running:!1};d(this,Oi,i.invalidate),d(this,Nt,i.hookId),d(this,Cs,e),d(this,Fi,i.context);let n=Math.floor(t/1e3),o=t%1e3*1e6;this.state.duration={seconds:n,nanos:o}}onStateLoaded(){this.state.running?_t[s(this,Nt)]={duration:this.state.duration}:delete _t[s(this,Nt)]}async onUIEvent(e){await s(this,Cs).call(this)}start(){_t[s(this,Nt)]={duration:this.state.duration},this.state.running=!0,s(this,Oi).call(this),s(this,Fi).emitEffect("timers",{type:sm.EFFECT_SET_INTERVALS,interval:{intervals:_t}})}stop(){delete _t[s(this,Nt)],this.state.running=!1,s(this,Oi).call(this),s(this,Fi).emitEffect("timers",{type:sm.EFFECT_SET_INTERVALS,interval:{intervals:_t}})}};Nt=new WeakMap,Oi=new WeakMap,Cs=new WeakMap,Fi=new WeakMap;function am(r,e){let t=$e({namespace:"useInterval"},i=>new om(r,e,i));return{start:()=>t.start(),stop:()=>t.stop()}}var Cr=class extends Error{};var dm="ServerCallRequired";function qb(r){return r?.message===dm}var Hb=_n(Yc(),1);function um(r){if(r instanceof Error){if(r.message===dm)throw r;return{message:r.message,details:r.stack??""}}else return{message:"Unknown error",details:wi.caughtToString(r)}}var it,gt,Is,Mi,ws,Ir,lm=class{constructor(e,t,i){l(this,it);l(this,gt);l(this,Is);l(this,Mi);l(this,ws);l(this,Ir);d(this,it,!!i.context.devvitContext.debug.useAsync),s(this,it)&&console.debug("[useAsync] v1",t),this.state={data:null,load_state:"initial",error:null,depends:null},d(this,gt,i.hookId),d(this,Is,e),d(this,Mi,i.invalidate),d(this,ws,i.context),d(this,Ir,t.depends??null)}onStateLoaded(){if(this.state.load_state!=="disabled"&&(s(this,it)&&console.debug("[useAsync] async onLoad ",s(this,gt),this.state),s(this,it)&&console.debug("[useAsync] async onLoad have ",s(this,Ir),"and",this.state.depends),!(0,Hb.default)(s(this,Ir),this.state.depends)||this.state.load_state==="initial")){this.state.load_state="loading",this.state.depends=s(this,Ir),s(this,Mi).call(this);let e={hook:s(this,gt),async:!0,asyncRequest:{requestId:s(this,gt)+"-"+JSON.stringify(this.state.depends)}};s(this,it)&&console.debug("[useAsync] onLoad requeue"),s(this,ws).addToRequeueEvents(e)}}async onUIEvent(e,t){if(e.asyncRequest){let i={requestId:e.asyncRequest.requestId};try{i.data={value:await s(this,Is).call(this)}}catch(o){i.error=um(o)}let n={asyncResponse:i,hook:s(this,gt)};s(this,it)&&console.debug("[useAsync] onReq requeue"),t.addToRequeueEvents(n)}else if(e.asyncResponse){let i=s(this,gt)+"-"+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,Mi).call(this)):s(this,it)&&console.debug("[useAsync] onResp skip, stale event")}else throw new Error("Unknown event type")}};it=new WeakMap,gt=new WeakMap,Is=new WeakMap,Mi=new WeakMap,ws=new WeakMap,Ir=new WeakMap;function nO(r,e={}){let t=$e({namespace:"useAsync"},i=>new lm(r,e,i));return{data:t.state.data,error:t.state.error,loading:t.state.load_state==="loading"}}var ht,xs,wr,Li,xr,cm=class{constructor(e,t){this.state={value:null,load_state:"initial",error:null};l(this,ht);l(this,xs);l(this,wr);l(this,Li);l(this,xr);d(this,wr,e),d(this,Li,t.hookId),d(this,ht,t.invalidate),d(this,xs,t.context)}async onUIEvent(){if(this.state.load_state==="loading"&&s(this,xr)){try{this.state.value=await s(this,xr),this.state.load_state="loaded"}catch(e){this.state.load_state="error",this.state.error=um(e)}s(this,ht).call(this)}else console.warn("Invalid state: ",this.state.load_state,s(this,xr))}setter(e){this.state.value=e instanceof Function?e(this.state.value):e,this.state.load_state="loaded",s(this,ht).call(this)}onStateLoaded(){if(this.state.load_state==="loading")throw new Cr;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,wr)instanceof Function?s(this,wr).call(this):s(this,wr)}catch(t){console.log("error in loading async",t),this.state.load_state="error",s(this,ht).call(this);return}if(e instanceof Promise){d(this,xr,e),this.state.load_state="loading";let t={asyncRequest:{requestId:s(this,Li)},hook:s(this,Li)};throw s(this,xs).addToRequeueEvents(t),s(this,ht).call(this),new Cr}else this.state.value=e,this.state.load_state="loaded";s(this,ht).call(this)}}};ht=new WeakMap,xs=new WeakMap,wr=new WeakMap,Li=new WeakMap,xr=new WeakMap;function mm(r){let e=$e({namespace:"useState"},t=>new cm(r,t));return[e.state.value,e.setter.bind(e)]}var hm={now(){return new Date}};function jb(r){return`__autocache__${r}`}function Wb(r){return`__lock__${r}`}var sO=300,oO=1e3,Dd=5e3,pm=3,Gb=.1,Vb=1e3,aO=3e4;function zb(r){if(r.error)throw new Error(r.error);return r.value}var qt,Ht,_e,Ui,$,Jb,$b,Kb,fm,Xb,Zb,gm,Yb,_d=class{constructor(e,t,i=hm){l(this,$);l(this,qt);l(this,Ht,{});l(this,_e);l(this,Ui);d(this,qt,e),d(this,Ui,t),d(this,_e,i)}async cache(e,t){var a;(a=s(this,Ui)).__cache??(a.__cache={}),d(this,Ht,s(this,Ui).__cache),S(this,$,Yb).call(this,t);let i=S(this,$,Jb).call(this,t.key);if(i!==void 0)return i;let n=await S(this,$,gm).call(this,t.key),o=await S(this,$,$b).call(this,t,n,e);return zb(o)}};qt=new WeakMap,Ht=new WeakMap,_e=new WeakMap,Ui=new WeakMap,$=new WeakSet,Jb=function(e){let t=s(this,Ht)[e];if(t){let i=s(this,_e).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<pm&&Math.random()<Gb&&t.errorTime+Vb<i;if(t?.expires&&t.expires<i&&t.checkedAt+Vb<i||n){delete s(this,Ht)[e];return}else return zb(t)}},$b=async function(e,t,i){let n=t?.expires,o=n?S(this,$,Zb).call(this,n):1;return!t||t?.error&&t.errorCount<pm&&Gb>Math.random()||o>Math.random()?S(this,$,Kb).call(this,e,t,i):t},Kb=async function(e,t,i){let n=Wb(e.key),o=s(this,_e).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,qt).set(n,"1",{expiration:a,nx:!0}))return S(this,$,Xb).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,_e).now();return S(this,$,fm).call(this,p,e.key,e.ttl)}},fm=async function(e,t,i){let n=Math.min(i,oO),o=await S(this,$,gm).call(this,t);if(o)return o;if(s(this,_e).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,sO)),S(this,$,fm).call(this,e,t,i)},Xb=async function(e,t,i,n){let o=s(this,_e).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,_e).now().getTime(),t.errorCount++}return s(this,Ht)[e]=t,await s(this,qt).set(jb(e),JSON.stringify(t),{expiration:new Date(o+aO)}),t.error&&t.errorCount<pm&&await s(this,qt).del(Wb(e)),t},Zb=function(e){let t=s(this,_e).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},gm=async function(e){let t=await s(this,qt).get(jb(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,_e).now().getTime(),s(this,Ht)[e]=i,i}},Yb=function(e){e.ttl<Dd&&(console.warn(`Cache TTL cannot be less than ${Dd} milliseconds! Updating ttl value of ${e.ttl} to ${Dd}.`),e.ttl=Dd)};function Qb(r,e,t=hm){let i=new _d(r,e,t);return i.cache.bind(i)}var Nd=class{buildContext(e,t,i){let n=new ci(i),o=new li(i),a=new hi(i),c=new fi(i),p=new vi(i),f=new yi(i),v=new Ud(e),m=new ui(i),b=new ai,y=new mi(i),C=Qb(a,e._state),I={modLog:n,kvStore:o,redis:a,reddit:c,scheduler:p,settings:f,media:m,assets:b,realtime:y,ui:v,useState:mm,useChannel:nm,useInterval:am,useForm:em,cache:C,dimensions:t.env?.dimensions,uiEnvironment:{timezone:i[D.Timezone]?.values[0],locale:i[D.Language]?.values[0],dimensions:t.env?.dimensions}},T=de(i,t.props?.postId);return T.debug.effects=e,{...T,...I}}};var ye=null;function ek(r){return JSON.parse(JSON.stringify(r))}function dO(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 lO(r){return r.blocking||r.resize?!1:!r.hook}function $e(r,e){if(!ye)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.");dO(r.namespace);let t=ye.nextHookId(r),i=ye;i._touched[t]=!0;let n={hookId:t,invalidate:()=>{i._changed[t]=!0,i._state[t]=i?._hooks[t]?.state},context:ye},o=ye._state[t]===void 0||Nb(ye._state[t]);ye._hooks[t]=ye._hooks[t]??e(n);let a=ye._hooks[t];return o||(a.state=ye._state[t]),a.onStateLoaded?.(),o&&a.state!==void 0&&a.state!==null&&n.invalidate(),a}var uO=null,Bi,Wd,Ts,A,be,qd,tk,vm,rk,ym,bm,Hd,km,ik,jd=class{constructor(e){l(this,A);l(this,Bi);l(this,Wd,new Nd);l(this,Ts,new Ii(()=>this._latestRenderContext?.devvitContext?.assets));this._latestRenderContext=null;s(this,A,be)&&console.debug("[blocks] BlocksHandler v1"),d(this,Bi,e),uO=this}async handle(e,t){let i=new Ri(e,t),n=s(this,Wd).buildContext(i,e,t);i.devvitContext=n;let o,a=e.events,p=!e.events?.length||a.some(y=>!y.async),f=a.some(y=>y.blocking),v,m,b=[...a];for(a.length===0&&a.push({}),s(this,A,be)&&console.debug("[blocks] starting processing events");a.length>0;){s(this,A,be)&&console.debug("[blocks] processing events loop iteration",a.length);let y=[];if(!a[0].async)y.push(a.shift());else for(;a[0]?.async;)y.push(a.shift());if(!y.length)throw Error("batch must have at least one event");try{if(y[0].async){let I=ek(i._state);await S(this,A,tk).call(this,i,...y),i._state=I}else await S(this,A,rk).call(this,i,...y)}catch(I){if(!qb(I))throw I;if(s(this,A,be)&&console.debug("[blocks] caught in handler",I),i._latestRenderContent=void 0,m){i._state=m._state,i._changed=v,i._effects=m._effects;let T=b.map(M=>{let ue={...M};return ue.retry=!0,ue});i.addToRequeueEvents(...T);break}else throw console.error("[blocks] unhandled error in handler",I),I}s(this,A,be)&&console.debug("[blocks] remaining events",i._requeueEvents);let C=[];for(let I of i._requeueEvents){if(!p&&!I.async){s(this,A,be)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch A",I),C.push(I);continue}if(p&&I.async&&!f){s(this,A,be)&&console.debug("[blocks] NOT reprocessing event in BlocksHandler, sync mismatch B",I),C.push(I);continue}s(this,A,be)&&console.debug("[blocks] reprocessing event in BlocksHandler",I),a.push(I)}i._requeueEvents=C,a.length>0&&(v={...i._changed},m={_state:ek(i._state),_effects:{...i._effects}},b=[...a])}if(p){i._latestRenderContent||(i._latestRenderContent=S(this,A,ym).call(this,s(this,Bi),i.request.props??{},i));let y=i._latestRenderContent;y&&(o=s(this,Ts).createBlocksElementOrThrow(y),o=s(this,Ts).ensureRootBlock(o))}return{state:i._changedState,effects:i.effects,blocks:o,events:i._requeueEvents}}};Bi=new WeakMap,Wd=new WeakMap,Ts=new WeakMap,A=new WeakSet,be=function(){return!!this._latestRenderContext?.devvitContext.debug.blocks},qd=function(e,...t){e._touched={},S(this,A,ym).call(this,s(this,Bi),e.request.props??{},e);for(let i in e._hooks)e._touched[i]||delete e._hooks[i]},tk=async function(e,...t){S(this,A,qd).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,A,vm).call(this,e,i)}))},vm=async function(e,t){lO(t)&&console.warn("Received an event in #attemptHook that does not have an associated hook. This will cause the event to be undelivered and may cause bugs. Make sure that event passes a hook field. Event:",{event:t});let i=e._hooks[t.hook];if(i?.onUIEvent)try{await i.onUIEvent(t,e)}catch(n){throw console.error("Error in event handler",n),n}else await e.handleUndeliveredEvent(t)},rk=async function(e,...t){for(let i of t)s(this,A,be)&&console.log("[blocks] handling main queue event",i),s(this,A,be)&&console.log("[blocks] before",e._state),S(this,A,qd).call(this,e,i),await S(this,A,vm).call(this,e,i),s(this,A,be)&&console.log("[blocks] after",e._state);S(this,A,qd).call(this,e)},ym=function(e,t,i){s(this,A,be)&&console.debug("[blocks] renderRoot"),i._generated={},ye=i,this._latestRenderContext=i;try{let n=S(this,A,bm).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 asynchronous. To use data from an async endpoint, please use "const [data] = context.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 Cr)return;throw n}finally{ye=null}},bm=function(e,t,i){i.push({namespace:e.name||"anonymous",...t});try{let n=e(t,i.devvitContext);return S(this,A,km).call(this,n,i)}finally{i.pop()}},Hd=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,A,km).call(this,i,t)))},km=function(e,t){if(Array.isArray(e))return S(this,A,Hd).call(this,e,t);if(cO(e))if(e.type===void 0){t.push({namespace:"fragment",...e.props});let i=S(this,A,Hd).call(this,e.children,t);return t.pop(),i}else if(typeof e.type=="function"){let i={...e.props,children:e.children};return S(this,A,bm).call(this,e.type,i,t)}else{t.push({namespace:e.type,...e.props});let i=S(this,A,Hd).call(this,e.children,t),n=S(this,A,ik).call(this,e.props??{});return t.pop(),[{type:e.type,children:i,props:n}]}else return[(e??"").toString()]},ik=function(e){let t={};for(let i in e)if(!(typeof e[i]>"u"))if(typeof e[i]=="function"){let n=$e({namespace:i,key:!1},({hookId:o})=>({hookId:o,state:null,onUIEvent:e[i]}));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 cO(r){return typeof r=="object"&&r!=null&&"type"in r}var mO=[[nk,nk.methods.renderPostContent,(r,e)=>u.customPostType?.render(e)??null]];function pO(r){return async(e,t)=>new jd(r).handle(e,t)}function sk(r){for(let[e,t,i]of mO)r.provides(e),U(t.name,pO(i))}var Di,As,_i,Tr,Ar,Ni,qi,Er,jt,Es,Rs,Rr,N,B=class B extends ud{static configure(e){d(this,_i,{...s(this,_i),...e}),mt(e.http)&&this.use(P.HTTPDefinition),(mt(e.kvStore)||mt(e.redis))&&(this.use(P.KVStoreDefinition),this.use(P.RedisAPIDefinition)),mt(e.media)&&this.use(P.MediaServiceDefinition),mt(e.modLog)&&this.use(P.ModlogDefinition),mt(e.redditAPI)&&(this.use(P.FlairDefinition),this.use(P.GraphQLDefinition),this.use(P.LinksAndCommentsDefinition),this.use(P.ListingsDefinition),this.use(P.ModerationDefinition),this.use(P.ModNoteDefinition),this.use(P.NewModmailDefinition),this.use(P.PrivateMessagesDefinition),this.use(P.SubredditsDefinition),this.use(P.PostCollectionsDefinition),this.use(P.UsersDefinition),this.use(P.WidgetsDefinition),this.use(P.WikiDefinition),this.use(P.RedditAPIV2Definition)),mt(e.realtime)&&this.use(P.RealtimeDefinition)}static addMenuItem(e){s(this,qi).push(e)}static addCustomPostType(e){d(this,Tr,e)}static createForm(e,t){let i=`form.${s(this,Ar).size}`;return s(this,Ar).set(i,{form:e,onSubmit:t}),i}static addSchedulerJob(e){if(s(this,N)[P.SchedulerDefinition.fullName]||this.use(P.SchedulerDefinition),s(this,Er).has(e.name))throw new Error(`Job ${e.name} is already defined`);s(this,Er).set(e.name,e.onRun)}static addSettings(e){cr(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,N)[P.SettingsDefinition.fullName]||this.use(P.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,jt).has(e.event)?s(this,jt).get(e.event)?.push(e.onEvent):s(this,jt).set(e.event,[e.onEvent]),B}static provide(e){s(this,Rs).push(e)}static use(e,t){s(this,Rr)[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,Rr)[e.fullName].handler?.[n.name]?.(n.requestType?.fromPartial(o??{}),a);return s(this,N)[e.fullName]=i,i}static get redditAPIPlugins(){if(!mt(s(this,_i).redditAPI))throw new Error("Reddit API is not enabled. You can enable it by passing `redditAPI: true` to `Devvit.configure`.");return{Flair:s(this,N)[P.FlairDefinition.fullName],GraphQL:s(this,N)[P.GraphQLDefinition.fullName],LinksAndComments:s(this,N)[P.LinksAndCommentsDefinition.fullName],Listings:s(this,N)[P.ListingsDefinition.fullName],Moderation:s(this,N)[P.ModerationDefinition.fullName],ModNote:s(this,N)[P.ModNoteDefinition.fullName],NewModmail:s(this,N)[P.NewModmailDefinition.fullName],PrivateMessages:s(this,N)[P.PrivateMessagesDefinition.fullName],Subreddits:s(this,N)[P.SubredditsDefinition.fullName],PostCollections:s(this,N)[P.PostCollectionsDefinition.fullName],Users:s(this,N)[P.UsersDefinition.fullName],Widgets:s(this,N)[P.WidgetsDefinition.fullName],Wiki:s(this,N)[P.WikiDefinition.fullName]}}static get modLogPlugin(){let e=s(this,N)[P.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,N)[P.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,N)[P.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,N)[P.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,N)[P.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 redditapiv2Plugin(){let e=s(this,N)[P.RedditAPIV2Definition.fullName];if(!e)throw new Error("RedditAPIV2 is not enabled. You can enable it by passing `apiV2: true` to `Devvit.configure`");return e}static get settingsPlugin(){let e=s(this,N)[P.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,N)[P.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,qi)}static get customPostType(){return s(this,Tr)}static get formDefinitions(){return s(this,Ar)}static get scheduledJobHandlers(){return s(this,Er)}static get installationSettings(){return s(this,Ni)}static get appSettings(){return s(this,Di)}static get triggerOnEventHandlers(){return s(this,jt)}static get assets(){return s(this,As)}static get webviewAssets(){return s(this,Es)}constructor(e){super(e),d(B,As,e.assets??{}),d(B,Es,e.webviewAssets??{});for(let t in s(B,Rr)){let i=s(B,Rr)[t];i.handler=e.use(i.def,i.options)}s(B,qi).length>0&&Dy(e),s(B,Er).size>0&&_y(e),s(B,Tr)&&(Ly(e),sk(e)),(s(B,Tr)||s(B,Ar).size>0)&&Lb(e),s(B,Ni)&&Uy(e),s(B,Di)&&my(e),s(B,jt).size>0&&Ny(e);for(let t of s(B,Rs))e.provides(t)}};Di=new WeakMap,As=new WeakMap,_i=new WeakMap,Tr=new WeakMap,Ar=new WeakMap,Ni=new WeakMap,qi=new WeakMap,Er=new WeakMap,jt=new WeakMap,Es=new WeakMap,Rs=new WeakMap,Rr=new WeakMap,N=new WeakMap,B.debug={},l(B,Di),l(B,As,{}),l(B,_i,{}),l(B,Tr),l(B,Ar,new Map),l(B,Ni),l(B,qi,[]),l(B,Er,new Map),l(B,jt,new Map),l(B,Es,{}),l(B,Rs,[]),l(B,Rr,{}),l(B,N,{});var u=B;(e=>{function r(t,i,...n){return{type:t,props:i,children:n}}e.createElement=r})(u||(u={}));function K(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 Sm;(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"})(Sm||(Sm={}));var ok="text",ak="raw",dk="br",lk="link",uk="c/",ck="p/",mk="r/",pk="u/",fk="@",gk="spoilertext",hk="par",vk="h",yk="hr",bk="blockquote",kk="code",Sk="li",Pk="list",Ck="L",Ik="R",wk="C",xk="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 Fk(r,e){let t={},i=[];return Object.assign(t,Os(t,i),Fs(t,i),Ms(t,i),Bs(t,i),Ds(t,i),_s(t,i)),e(t),{e:bk,c:i,...r.author&&{a:r.author}}}function Mk(r,e){let t={},i=[];return Object.assign(t,Cm(t,i)),e(t),{e:kk,c:i,...r.language&&{l:r.language}}}function Lk(r){return{e:uk,t:r.permalink}}function Uk(r,e){let t={},i=[];return Object.assign(t,Cm(t,i),Us(t,i)),e(t),{e:vk,l:r.level,c:i}}function Bk(r){return{e:Tk,u:r.sourceUrl,c:r.contentUrl,x:r.width,y:r.height}}function Dk(){return{e:yk}}function _k(r){return{e:Ak,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function Nk(){return{e:dk}}function qk(r){return{e:lk,t:r.text,u:r.url,...r.formatting&&{f:r.formatting},...r.tooltip&&{a:r.tooltip}}}function Hk(r,e){let t={},i=[];return Object.assign(t,iS(t,i)),e(t),{e:Pk,o:r.ordered,c:i}}function jk(r){let e={},t=[];return Object.assign(e,Os(e,t),Fs(e,t),Ms(e,t),Gd(e,t),Bs(e,t),Ds(e,t),_s(e,t)),r(e),{e:Sk,c:t}}function Wk(r){let e={},t=[];return Object.assign(e,Vd(e,t),Us(e,t),Pm(e,t),Im(e,t),Ls(e,t)),r(e),{e:hk,c:t}}function Gk(r){return{e:ck,t:r.permalink}}function Vk(r){return{e:ak,t:r}}function zk(r){let e={},t=[];return Object.assign(e,Vd(e,t),Us(e,t),Pm(e,t)),r(e),{e:gk,c:t}}function Jk(r){return{e:mk,t:r.subredditName,l:r.showPrefix}}function $k(r){let e={},t=[],i=[];return Object.assign(e,nS(e,t,i)),r(e),{e:xk,h:t,c:i}}function Kk(r){let[e,t]=rS();return r(e),{c:t}}function Xk(r,e){let[t,i]=rS();e(t);let n;switch(r.columnAlignment){case"left":n=Ck;break;case"right":n=Ik;break;case"center":n=wk;break}return{...n&&{a:n},...i&&{c:i}}}function Zk(r){let e={},t=[];return Object.assign(e,sS(e,t)),r(e),t}function Yk(r){return{e:ok,t:r.text,...r.formatting&&{f:r.formatting}}}function Qk(r){return{e:pk,t:r.username,l:r.showPrefix}}function eS(r){return{e:fk,t:r.username,l:r.showPrefix}}function tS(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 rS(){let r={},e=[];return Object.assign(r,Vd(r,e),Us(r,e),Im(r,e),Ls(r,e)),[r,e]}function Os(r,e){return{blockQuote(t,i){return e.push(Fk(t,i)),r}}}function Fs(r,e){return{codeBlock(t,i){return e.push(Mk(t,i)),r}}}function oS(r,e){return{embed(t){return e.push(Bk(t)),r}}}function Ms(r,e){return{heading(t,i){return e.push(Uk(t,i)),r}}}function Gd(r,e){return{horizontalRule(){return e.push(Dk()),r}}}function Ls(r,e){return{image(t){return e.push(_k(t)),r},animatedImage(t){return e.push(Ok(t)),r}}}function Pm(r,e){return{linebreak(){return e.push(Nk()),r}}}function Us(r,e){return{link(t){return e.push(qk(t)),r},commentLink(t){return e.push(Lk(t)),r},postLink(t){return e.push(Gk(t)),r},subredditLink(t){return e.push(Jk(t)),r},userLink(t){return e.push(Qk(t)),r},userMention(t){return e.push(eS(t)),r}}}function Bs(r,e){return{list(t,i){return e.push(Hk(t,i)),r}}}function iS(r,e){return{item(t){return e.push(jk(t)),r}}}function Ds(r,e){return{paragraph(t){return e.push(Wk(t)),r}}}function Cm(r,e){return{rawText(t){return e.push(Vk(t)),r}}}function Im(r,e){return{spoiler(t){return e.push(zk(t)),r}}}function nS(r,e,t){return{headerCell(i,n){return e.push(Xk(i,n)),r},row(i){return t.push(Zk(i)),r}}}function _s(r,e){return{table(t){return e.push($k(t)),r}}}function sS(r,e){return{cell(t){return e.push(Kk(t)),r}}}function Vd(r,e){return{text(t){return e.push(Yk(t)),r}}}function aS(r,e){return{video(t){return e.push(tS(t)),r}}}var fO=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},gO=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)},zd,Ns=class{constructor(){zd.set(this,void 0);let e=[];Object.assign(this,Ds(this,e),Ms(this,e),Gd(this,e),Os(this,e),Fs(this,e),oS(this,e),Bs(this,e),_s(this,e),Ls(this,e),aS(this,e)),fO(this,zd,{document:e},"f")}build(){return JSON.stringify(gO(this,zd,"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}};zd=new WeakMap;function Hi(r){let e;return r instanceof Ns?e=r.build():typeof r=="object"?e=JSON.stringify(r):e=r,e}var dS=100,lS=1/0,Or,Fr,Wt,ji,Wi,Jd,j=class{constructor(e){l(this,Wi);l(this,Or);l(this,Fr);l(this,Wt);l(this,ji,!1);this.pageSize=dS;this.limit=lS;this.children=[];K(this),this._fetch=e.fetch,this.pageSize=e.pageSize??dS,this.limit=e.limit??lS,d(this,Fr,e.after),d(this,Or,e.before),d(this,Wt,e.more),e.children&&(this.children=e.children)}get hasMore(){return!s(this,ji)||!!(s(this,Fr)||s(this,Or)||s(this,Wt))}async*[Symbol.asyncIterator](){let e=0;for(;;){if(e===this.children.length)if(this.hasMore){if((await S(this,Wi,Jd).call(this)).length===0)break}else break;if(yield this.children[e],e++,e===this.limit)break}}setMore(e){d(this,Wt,e)}preventInitialFetch(){d(this,ji,!0)}async all(){for(;this.hasMore&&this.children.length<this.limit;)await S(this,Wi,Jd).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,Wi,Jd).call(this);return this.children.slice(0,t)}};Or=new WeakMap,Fr=new WeakMap,Wt=new WeakMap,ji=new WeakMap,Wi=new WeakSet,Jd=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,Or),after:s(this,Fr),limit:this.pageSize,more:s(this,Wt)});return this.children.push(...e),d(this,Or,t),d(this,Fr,i),d(this,Wt,n),d(this,ji,!0),e};function hO(r){try{return!0}catch{return!1}}function vO(r){try{return!0}catch{return!1}}var qs,wm,Me=class{constructor(){}static get(e,t){let i=u.redditAPIPlugins.ModNote;return new j({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,qs,wm).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,qs,wm).call(this,n.created)}static async addRemovalNote(e,t){await u.redditAPIPlugins.ModNote.PostRemovalNote(e,t)}};qs=new WeakSet,wm=function(e){if(g(e.id,"Mod note ID is null or undefined"),g(e.createdAt,"Mod note createdAt is null or undefined"),g(e.type,"Mod note type is null or undefined"),g(e.subreddit,"Mod note subreddit is null or undefined"),g(e.subredditId,"Mod note subredditId is null or undefined"),g(e.operator,"Mod note operator is null or undefined"),g(e.operatorId,"Mod note operatorId is null or undefined"),g(e.user,"Mod note user is null or undefined"),g(e.userId,"Mod note userId is null or undefined"),g(e.userNoteData,"Mod note userNote is null or undefined"),g(e.modActionData,"Mod note modAction is null or undefined"),!hO(e.userNoteData?.label??""))throw new Error(`Invalid user note label: ${e.userNoteData?.label}`);if(!vO(e.type))throw new Error(`Invalid mod note type: ${e.type}`);return{id:e.id,user:{id:ie(e.userId??""),name:e.user},subreddit:{id:Re(e.subredditId??""),name:e.subreddit},operator:{id:ie(e.operatorId??""),name:e.operator},createdAt:new Date(e.createdAt*1e3),userNote:{note:e.userNoteData?.note,redditId:ge(e.userNoteData?.redditId??""),label:e.userNoteData?.label},type:e.type}},l(Me,qs);var Gt=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 uS=["all","wiki","posts","access","mail","config","flair","channels","chat_config","chat_community","chat_operator"];function yO(r,e,t=!1){let i=t?"%2b":"+";return e.map(n=>(r.includes(n)?i:"-")+n).join(",")}function xm(r){return yO(r,uS,!0)}function cS(r){return r.filter(e=>uS.includes(e))}var bO=(t=>(t.User="USER_FLAIR",t.Post="LINK_FLAIR",t))(bO||{}),Lr,Gi,Vi,zi,Ji,$i,Ki,Xi,Zi,Yi,Qi,$d,Ke=class Ke{constructor(e,t,i){l(this,Lr);l(this,Gi);l(this,Vi);l(this,zi);l(this,Ji);l(this,$i);l(this,Ki);l(this,Xi);l(this,Zi);l(this,Yi);K(this),g(e.id),g(e.text),d(this,Lr,e.id),d(this,Gi,t),d(this,Vi,e.text),d(this,zi,kO(e.textColor)),d(this,Ji,SO(e.backgroundColor)),d(this,$i,PO(e.allowableContent)),d(this,Ki,e.modOnly),d(this,Xi,e.maxEmojis),d(this,Zi,e.textEditable),d(this,Yi,i)}get id(){return s(this,Lr)}get text(){return s(this,Vi)}get textColor(){return s(this,zi)}get backgroundColor(){return s(this,Ji)}get allowableContent(){return s(this,$i)}get modOnly(){return s(this,Ki)}get maxEmojis(){return s(this,Xi)}get allowUserEdits(){return s(this,Zi)}async delete(){return Ke.deleteFlairTemplate(s(this,Lr),s(this,Gi),s(this,Yi))}async edit(e){return Ke.editFlairTemplate({id:s(this,Lr),subredditName:s(this,Gi),text:e.text??s(this,Vi),allowableContent:e.allowableContent??s(this,$i),backgroundColor:e.backgroundColor??s(this,Ji),maxEmojis:e.maxEmojis??s(this,Xi),modOnly:e.modOnly??s(this,Ki),textColor:e.textColor??s(this,zi),allowUserEdits:e.allowUserEdits??s(this,Zi)},s(this,Yi))}static async createPostFlairTemplate(e,t){var i;return S(i=Ke,Qi,$d).call(i,{...e,flairType:"LINK_FLAIR"},t)}static async createUserFlairTemplate(e,t){var i;return S(i=Ke,Qi,$d).call(i,{...e,flairType:"USER_FLAIR"},t)}static async editFlairTemplate(e,t){var i;return S(i=Ke,Qi,$d).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)}};Lr=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,Yi=new WeakMap,Qi=new WeakSet,$d=async function(e,t){let{subredditName:i,allowableContent:n="all",backgroundColor:o="transparent",flairType:a="",maxEmojis:c=10,modOnly:p=!1,text:f,textColor:v="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 C=await u.redditAPIPlugins.Flair.FlairTemplate({subreddit:i,allowableContent:n,backgroundColor:o,flairType:a,maxEmojis:c,modOnly:p,text:f,textColor:v,textEditable:m,flairTemplateId:b,cssClass:"",overrideCss:!1},t);return new Ke(C,i,t)},l(Ke,Qi);var ae=Ke;function Hs(r){return{flairCssClass:r.flairCssClass,user:r.user,flairText:r.flairText}}var Vt,Tm,Am,Mr=class Mr{static async getUserFlairBySubreddit(e,t){return u.redditAPIPlugins.Flair.FlairList(e,t)}static setUserFlair(e,t){var i;return S(i=Mr,Vt,Tm).call(i,e,t)}static setPostFlair(e,t){var i;return S(i=Mr,Vt,Tm).call(i,{...e,postId:fe(e.postId)},t)}static async removePostFlair(e,t,i){var n;return S(n=Mr,Vt,Am).call(n,e,t,void 0,i)}static async removeUserFlair(e,t,i){var n;return S(n=Mr,Vt,Am).call(n,e,void 0,t,i)}};Vt=new WeakSet,Tm=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)},Am=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(Mr,Vt);var Le=Mr;function kO(r){if(g(r,"Flair text color is required"),r==="light"||r==="dark")return r;throw new Error(`Invalid flair text color: ${r}`)}function SO(r){if(g(r,"Flair background color is required"),r==="transparent"||/^#([A-Fa-f0-9]{6})$/.test(r))return r;throw new Error(`Invalid flair background color: ${r}`)}function PO(r){if(r==="all"||r==="text"||r==="emoji")return r;throw new Error(`Invalid allowable content: ${r}`)}import{Block as RO}from"@devvit/protos";var gS=_n(fS(),1);var en,Ws,tn,Gs,Vs,zs,Js,$s,rn,Ks,Xs,Zs,Ys,Qs,eo,zt,to,ro,Br,nn,Jt,sn,on,an,Dr,$t,Kt,dn,Xt,Zt,Yt,vt,io,no,ln,un,_,q=class q{constructor(e,t){l(this,en);l(this,Ws);l(this,tn);l(this,Gs);l(this,Vs);l(this,zs);l(this,Js);l(this,$s);l(this,rn);l(this,Ks);l(this,Xs);l(this,Zs);l(this,Ys);l(this,Qs);l(this,eo);l(this,zt);l(this,to);l(this,ro);l(this,Br);l(this,nn);l(this,Jt);l(this,sn);l(this,on);l(this,an);l(this,Dr);l(this,$t);l(this,Kt);l(this,dn);l(this,Xt);l(this,Zt);l(this,Yt);l(this,vt);l(this,io);l(this,no);l(this,ln);l(this,un);l(this,_);K(this),g(e.id,"Post is missing id"),g(e.title,"Post is missing title"),g(e.createdUtc,"Post is missing created date"),g(e.author,"Post is missing author name"),g(e.subreddit,"Post is missing subreddit name"),g(e.subredditId,"Post is missing subreddit id"),g(e.url,"Post is missing url"),g(e.permalink,"Post is missing permalink"),d(this,en,fe(`t3_${e.id}`)),d(this,tn,e.author),d(this,Ws,e.authorFullname?ie(e.authorFullname):void 0),d(this,Vs,Re(e.subredditId)),d(this,zs,e.subreddit),d(this,Zs,e.score??0),d(this,Ys,e.numComments??0),d(this,Qs,e.numReports??0);let i=new Date(0);i.setUTCSeconds(e.createdUtc),d(this,Gs,i),d(this,$s,e.title),d(this,rn,e.selftext),d(this,Ks,e.selftextHtml),d(this,Xs,e.url),d(this,Js,e.permalink),e.thumbnail&&e.thumbnail!=="self"&&e.thumbnail!=="nsfw"&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null&&d(this,eo,{url:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth}),d(this,zt,e.approved??!1),d(this,to,e.approvedAtUtc??0),d(this,ro,e.bannedAtUtc??0),d(this,Jt,e.removed??!1),d(this,sn,e.removedBy),d(this,on,e.removedByCategory),d(this,Br,e.spam??!1),d(this,nn,e.stickied??!1),d(this,an,e.archived??!1),d(this,Dr,e.edited??!1),d(this,$t,e.locked??!1),d(this,Kt,e.over18??!1),d(this,dn,e.quarantine??!1),d(this,Xt,e.spoiler),d(this,Zt,e.hidden??!1),d(this,Yt,e.ignoreReports??!1),d(this,vt,e.distinguished),d(this,no,e.secureMedia),d(this,ln,(e.modReports??[]).map(([n])=>n)),d(this,un,(e.userReports??[]).map(([n])=>n)),d(this,_,t),(e.linkFlairBackgroundColor||e.linkFlairCssClass||e.linkFlairText||e.linkFlairType||e.linkFlairTemplateId||e.linkFlairRichtext||e.linkFlairTextColor)&&d(this,io,{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,Ws)}get authorName(){return s(this,tn)}get subredditId(){return s(this,Vs)}get subredditName(){return s(this,zs)}get permalink(){return s(this,Js)}get title(){return s(this,$s)}get body(){return s(this,rn)}get bodyHtml(){return s(this,Ks)}get url(){return s(this,Xs)}get thumbnail(){return s(this,eo)}get createdAt(){return s(this,Gs)}get score(){return s(this,Zs)}get numberOfComments(){return s(this,Ys)}get numberOfReports(){return s(this,Qs)}get approved(){return s(this,zt)}get approvedAtUtc(){return s(this,to)}get bannedAtUtc(){return s(this,ro)}get spam(){return s(this,Br)}get stickied(){return s(this,nn)}get removed(){return s(this,Jt)}get removedBy(){return s(this,sn)}get removedByCategory(){return s(this,on)}get archived(){return s(this,an)}get edited(){return s(this,Dr)}get locked(){return s(this,$t)}get nsfw(){return s(this,Kt)}get quarantined(){return s(this,dn)}get spoiler(){return s(this,Xt)}get hidden(){return s(this,Zt)}get ignoringReports(){return s(this,Yt)}get distinguishedBy(){return s(this,vt)}get comments(){return Y.getComments({postId:this.id},s(this,_))}get flair(){return s(this,io)}get secureMedia(){return s(this,no)}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,zt)}isSpam(){return s(this,Br)}isStickied(){return s(this,nn)}isRemoved(){return s(this,Jt)}isArchived(){return s(this,an)}isEdited(){return s(this,Dr)}isLocked(){return s(this,$t)}isNsfw(){return s(this,Kt)}isQuarantined(){return s(this,dn)}isSpoiler(){return s(this,Xt)}isHidden(){return s(this,Zt)}isIgnoringReports(){return s(this,Yt)}isDistinguishedBy(){return s(this,vt)}async edit(e){let t=await q.edit({id:this.id,...e},s(this,_));d(this,rn,t.body),d(this,Dr,t.edited)}async addComment(e){return Y.submit({id:this.id,...e},s(this,_))}async delete(){return q.delete(this.id,s(this,_))}async approve(){await q.approve(this.id,s(this,_)),d(this,zt,!0),d(this,Jt,!1)}async remove(e=!1){await q.remove(this.id,e,s(this,_)),d(this,Jt,!0),d(this,Br,e),d(this,zt,!1)}async lock(){await q.lock(this.id,s(this,_)),d(this,$t,!0)}async unlock(){await q.unlock(this.id,s(this,_)),d(this,$t,!1)}async hide(){await q.hide(this.id,s(this,_)),d(this,Zt,!0)}async unhide(){await q.unhide(this.id,s(this,_)),d(this,Zt,!1)}async markAsNsfw(){await q.markAsNsfw(this.id,s(this,_)),d(this,Kt,!0)}async unmarkAsNsfw(){await q.unmarkAsNsfw(this.id,s(this,_)),d(this,Kt,!1)}async markAsSpoiler(){await q.markAsSpoiler(this.id,s(this,_)),d(this,Xt,!0)}async unmarkAsSpoiler(){await q.unmarkAsSpoiler(this.id,s(this,_)),d(this,Xt,!1)}async sticky(e){await q.sticky(this.id,e,s(this,_))}async unsticky(){await q.unsticky(this.id,s(this,_))}async distinguish(){let{distinguishedBy:e}=await q.distinguish(this.id,!1,s(this,_));d(this,vt,e)}async distinguishAsAdmin(){let{distinguishedBy:e}=await q.distinguish(this.id,!0,s(this,_));d(this,vt,e)}async undistinguish(){let{distinguishedBy:e}=await q.undistinguish(this.id,s(this,_));d(this,vt,e)}async ignoreReports(){await q.ignoreReports(this.id,s(this,_)),d(this,Yt,!0)}async unignoreReports(){await q.unignoreReports(this.id,s(this,_)),d(this,Yt,!1)}async getAuthor(){return w.getByUsername(s(this,tn),s(this,_))}async crosspost(e){return q.crosspost({...e,postId:this.id},s(this,_))}addRemovalNote(e){return Me.addRemovalNote({itemIds:[s(this,en)],...e},s(this,_))}static async getById(e,t){let i=u.redditAPIPlugins.LinksAndComments,n=ur(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 q(a.data,t)}static async submit(e,t){let i=u.redditAPIPlugins.LinksAndComments,n;if("preview"in e){g(t,"Missing metadata in `SubmitPostOptions`");let c=await new ct(()=>e.preview,void 0,{},t,void 0).buildBlocksUI(),p=RO.encode(c).finish();n=await i.Submit({kind:"custom",sr:e.subredditName,richtextJson:(0,gS.fromByteArray)(p),...e},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 q.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:fe(n),...a},t);if(!c.json?.data?.id||c.json?.errors?.length)throw new Error("failed to crosspost post");return q.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 q.getById(n,t)}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 g(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 g(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 j({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 js(o,t)}})}static getHotPosts(e={location:"GLOBAL"},t){let i=u.redditAPIPlugins.Listings;return new j({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 js(o,t)}})}static getNewPosts(e,t){let i=u.redditAPIPlugins.Listings;return new j({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 js(o,t)}})}static getRisingPosts(e,t){let i=u.redditAPIPlugins.Listings;return new j({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 js(o,t)}})}static getPostsByUser(e,t){let i=u.redditAPIPlugins.Users;return new j({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 js(o,t)}})}};en=new WeakMap,Ws=new WeakMap,tn=new WeakMap,Gs=new WeakMap,Vs=new WeakMap,zs=new WeakMap,Js=new WeakMap,$s=new WeakMap,rn=new WeakMap,Ks=new WeakMap,Xs=new WeakMap,Zs=new WeakMap,Ys=new WeakMap,Qs=new WeakMap,eo=new WeakMap,zt=new WeakMap,to=new WeakMap,ro=new WeakMap,Br=new WeakMap,nn=new WeakMap,Jt=new WeakMap,sn=new WeakMap,on=new WeakMap,an=new WeakMap,Dr=new WeakMap,$t=new WeakMap,Kt=new WeakMap,dn=new WeakMap,Xt=new WeakMap,Zt=new WeakMap,Yt=new WeakMap,vt=new WeakMap,io=new WeakMap,no=new WeakMap,ln=new WeakMap,un=new WeakMap,_=new WeakMap;var V=q;function js(r,e){if(!r.data?.children)throw new Error("Listing response is missing children");return{children:r.data.children.map(i=>new V(i.data,e)),before:r.data.before,after:r.data.after}}var so,cn,oo,ao,lo,uo,co,Qt,mo,po,yt,_r=class _r{constructor(e,t){l(this,so);l(this,cn);l(this,oo);l(this,ao);l(this,lo);l(this,uo);l(this,co);l(this,Qt,new Map);l(this,mo);l(this,po);l(this,yt);K(this),g(e.id,"User ID is missing or undefined"),g(e.name,"Username is missing or undefined"),g(e.createdUtc,"User is missing created date"),d(this,so,ie(ld(e.id)?e.id:`t2_${e.id}`)),d(this,cn,e.name),d(this,uo,e.over18??!1),d(this,co,e.isEmployee??!1);let i=new Date(0);if(i.setUTCSeconds(e.createdUtc),d(this,oo,i),d(this,ao,e.linkKarma??0),d(this,lo,e.commentKarma??0),e.modPermissions)for(let[n,o]of Object.entries(e.modPermissions))s(this,Qt).set(n,cS(o));d(this,mo,new URL(e.subreddit?.url??"","https://www.reddit.com").toString()),d(this,po,e.subreddit?.url??""),d(this,yt,t)}get id(){return s(this,so)}get username(){return s(this,cn)}get createdAt(){return s(this,oo)}get linkKarma(){return s(this,ao)}get commentKarma(){return s(this,lo)}get nsfw(){return s(this,uo)}get isAdmin(){return s(this,co)}get modPermissions(){return s(this,Qt)}get url(){return s(this,mo)}get permalink(){return s(this,po)}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,Qt).has(e))return s(this,Qt).get(e);let t=await _r.getSubredditUsersByType({subredditName:e,type:"moderators",username:this.username},s(this,yt)).all();if(t.length===0)return[];let i=t[0].modPermissions.get(e)??[];return i.length>0&&s(this,Qt).set(e,i),i}getComments(e){return Y.getCommentsByUser({username:this.username,...e},s(this,yt))}getPosts(e){return V.getPostsByUser({username:this.username,...e},s(this,yt))}async getUserFlairBySubreddit(e){let t=await Le.getUserFlairBySubreddit({subreddit:e,name:s(this,cn)},s(this,yt));return t.users[0]?Hs(t.users[0]):void 0}getSnoovatarUrl(){return _r.getSnoovatarUrl(this.username,s(this,yt))}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){g(t);let i=t?.[e]?.values[0];return i?_r.getById(ie(i),t):Promise.resolve(void 0)}static getSubredditUsersByType(e,t){let i=u.redditAPIPlugins.Subreddits;return new j({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 FO(o,e.subredditName,t)}})}static async createRelationship(e,t){let i=u.redditAPIPlugins.Users,{type:n,subredditName:o,username:a,permissions:c,...p}=e,f=await i.Friend({type:n,subreddit:o,name:a,permissions:c?xm(c):void 0,...p},t);if(f.json?.errors?.length)throw new Error(f.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:xm(i)},n);if(a.json?.errors?.length)throw new Error(a.json.errors.join(`