@devvit/ui-renderer 0.11.4-next-2024-12-04-1757fb455.0 → 0.11.4-next-2024-12-04-4c7d45aca.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -622,7 +622,7 @@ button inline-flex`},AN=e=>{let{createElement:n}=je(),{attributes:i,selected:d,r
622
622
  style="${d(t)}"
623
623
  >
624
624
  ${r===ke?"":r}
625
- </div>`}else return r}var Kc,Xc,g4,Cl=class extends dr{constructor(){super(...arguments);we(this,Kc,window.matchMedia("(prefers-color-scheme: dark)"));we(this,Xc,()=>this.requestUpdate());we(this,g4,()=>({stackDirection:Te.UNRECOGNIZED}))}static get styles(){return[v4]}connectedCallback(){super.connectedCallback(),N(this,Kc)?.addEventListener("change",N(this,Xc))}disconnectedCallback(){super.disconnectedCallback(),N(this,Kc)?.removeEventListener("change",N(this,Xc))}async getUpdateComplete(){let i=await super.getUpdateComplete(),d=this.renderRoot.querySelectorAll("[data-block-type]");for(let r=0;r<d.length;r++)await d.item(r).updateComplete;return i}reset(){this.renderRoot.querySelectorAll("[data-block-type]").forEach(d=>{d.reset?.()})}findBlockById(i){let d=this.renderRoot.querySelector(`#${i}[data-block-type]`);if(d)return{blockType:d.dataset.blockType,element:d}}render(){if(this.block&&this.block.type===pe.BLOCK_ROOT){let i={...N(this,g4).call(this),...this.renderContext?.()??{}},d=new h4,r=d8(this.block,i);return d.finish(),this.dispatchEvent(O0(Jc,{name:"blocks_layout",duration:d.duration})),Nt` <div class="${Ko(this.class)}">${r}</div>`}return Nt`${CN({creative:Nt`<slot name="empty-state-image"></slot>`,title:zp("Whoops!",{desc:"Header for message to display when rendering fails"}),description:zp("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};Kc=new WeakMap,Xc=new WeakMap,g4=new WeakMap,Ge([_n({attribute:!1})],Cl.prototype,"block",2),Ge([_n({attribute:!1})],Cl.prototype,"renderContext",2),Ge([_n()],Cl.prototype,"class",2),Cl=Ge([wN(),P0("devvit-blocks-renderer")],Cl);var bI="ServerCallRequired";var b4=class extends Error{constructor(n,i){super(bI),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function TI(e){return e?.message===bI}var ku=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies"}),RI;(function(e){e.Blocks="blocks",e.EmitSnapshots="emitSnapshots",e.EmitState="emitState",e.Realtime="realtime",e.Runtime="runtime",e.Surface="surface",e.UseAsync="useAsync",e.Payments="payments",e.Bootstrap="bootstrap",e.WebView="webView"})(RI||(RI={}));function NI(e,n){let i,d=0,r;return function(...t){return r=t,i??(i=setTimeout(()=>{d=Date.now(),i=void 0;let s=r;r=void 0,e.apply(this,s)},Math.max(0,n-(Date.now()-d)))),()=>{i!=null&&clearTimeout(i),i=void 0,r=void 0}}}function II(e,n){if(!e)throw Error(n)}var T4;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(T4||(T4={}));function wB(e){return e.startsWith(T4.LINK)}function AB(e){II(wB(e),`Expected link id to start with ${T4.LINK}, got ${e}}`)}function xI(e){return AB(e),e}var LO=P(zI(),1),FO=P(jI(),1);function ex(e,n,i){let{width:d,height:r}=e.contentRect,s=n.getComputedStyle(i).fontSize.split("px")[0],f=s?parseFloat(s)/16:1;return{width:Math.round(d),height:Math.round(r),scale:n.devicePixelRatio,fontScale:f}}typeof ArrayBuffer.isView>"u"&&(ArrayBuffer.isView=function(e){return e!=null&&e.__proto__!=null&&e.__proto__.__proto__===Int8Array.prototype.__proto__});typeof Array.prototype.fill>"u"&&Object.defineProperty(Array.prototype,"fill",{value:function(e){if(this==null)throw new TypeError("this is null or not defined");for(var n=Object(this),i=n.length>>>0,d=arguments[1],r=d>>0,t=r<0?Math.max(i+r,0):Math.min(r,i),s=arguments[2],f=s===void 0?i:s>>0,c=f<0?Math.max(i+f,0):Math.min(f,i);t<c;)n[t]=e,t++;return n}});[Int8Array,Int16Array,Uint16Array,Int32Array,Float32Array,Float64Array].forEach(function(e){typeof e.prototype.fill>"u"&&Object.defineProperty(e.prototype,"fill",{value:Array.prototype.fill})});typeof Math.clz32>"u"&&(Math.clz32=function(e,n){return function(i){var d=i>>>0;return d===0?32:31-(e(d)/n|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(n,i){return(n&4294901760)*(i&65535)+(n&65535)*(i|0)|0});var kx=Math.clz32,k8=ArrayBuffer.isView,An=Math.imul;q(x8,"CharSequence",qo);q(E8,"Number",ue);q(O8,"Unit",oi);q(D0,"IntCompanionObject",oi);q(rt,"Collection",qo);q(Zo,"AbstractCollection",ue,U,[rt]);q(Yr,"AbstractMutableCollection",ue,Zo,[Zo,rt]);q(e3,"IteratorImpl",ue);q(W0,"List",qo,U,[rt]);q(br,"AbstractMutableList",ue,Yr,[Yr,rt,W0]);q(Uo,"Map",qo);q(Tr,"AbstractMap",ue,U,[Uo]);q(F0,"AbstractMutableMap",ue,Tr,[Tr,Uo]);q(U4,"Set",qo,U,[rt]);q(U0,"AbstractMutableSet",ue,Yr,[Yr,rt,U4]);q(Ax,"Companion",oi);q(Yn,"ArrayList",ue,br,[br,rt,W0],Vo);q(Qr,"HashMap",ue,F0,[F0,Uo],oL);q(Rr,"HashMapEntrySetBase",ue,U0,[rt,U4,U0]);q(_8,"HashMapEntrySet",ue,Rr);q(xx,"Companion",oi);q(bl,"Itr",ue);q(i3,"EntriesItr",ue,bl);q(Fo,"Entry",qo);q(Tl,"EntryRef",ue,U,[Fo]);function GB(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o(),t=r,s;if(t!=null&&Xn(t,Fo)?s=this.w3(t):s=!1,!s){n=!1;break e}}n=!0}return n}q(Ex,"InternalMap",qo);q(Hi,"InternalHashMap",ue,U,[Ex],Nx);q(F4,"LinkedHashMap",ue,Qr,[Qr,Uo],t3);q(ed,"StringBuilder",ue,U,[x8],F8);q(Lx,"Companion",oi);q(Fx,"Char",ue);q(Ux,"Companion",oi);q(gt,"Enum",ue);q(Z4,U,ue);q(Kx,"Companion",oi);q(Me,"Long",ue,E8);q(Jo,"Exception",ue,Error,U,aE);q(Di,"RuntimeException",ue,Jo,U,cE);q(Y0,"IllegalArgumentException",ue,Di,U,lE);q(j0,"IndexOutOfBoundsException",ue,Di,U,sE);q(es,"IllegalStateException",ue,Di,U,fE);q(q4,"UnsupportedOperationException",ue,Di,U,ns);q(is,"NoSuchElementException",ue,Di,U,Au);q(J4,"ConcurrentModificationException",ue,Di,U,H8);q(ts,"ArithmeticException",ue,Di,U,hE);q(H4,"NullPointerException",ue,Di,U,D8);q(D4,"ClassCastException",ue,Di,U,$8);q(rs,"UninitializedPropertyAccessException",ue,Di,U,mE);q(Cu,"Companion",oi);q(SE,"Companion",oi);q($4,"Companion",oi);q(AE,"Companion",oi);q(Bn,"ArrayDeque",ue,br,U,u3);q(rd,"EmptyList",oi,U,[W0]);q(W4,"EmptyIterator",oi);q(Ho,"ArrayAsCollection",ue,U,[rt]);q(G4,"IntIterator",ue);q(gE,"Companion",oi);q(Bd,"IntProgression",ue);q(wu,"IntRange",ue,Bd);q(z4,"IntProgressionIterator",ue,G4);q(K8,"Companion",oi);q(Ct,"Pair",ue);function x8(){}function E8(){}function O8(){}p(O8).toString=function(){return"kotlin.Unit"};var qe;function D0(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}p(D0).c=function(){return this.MIN_VALUE};p(D0).d=function(){return this.MAX_VALUE};p(D0).e=function(){return this.SIZE_BYTES};p(D0).f=function(){return this.SIZE_BITS};var P8;function zB(e){return e!==e}function KB(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-kx(e)|0)}return n}function yx(e){return $F(e)}function XB(e,n){return n}function YB(e,n){return G0(Array(n),null)}function _4(e){return zF([e])}function $0(e){var n;return e.toArray!==void 0?n=e.toArray():n=yx(e),n}function Ve(e,n,i,d,r){tt.h(d,r,e.length);var t=r-d|0;if(tt.h(i,i+t|0,n.length),k8(n)&&k8(e)){var s=e.subarray(d,r);n.set(s,i)}else if(e!==n||i<=d){var f=0;if(f<t)do{var c=f;f=f+1|0,n[i+c|0]=e[d+c|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var w=v;v=v+-1|0,n[i+w|0]=e[d+w|0]}while(0<=v)}}function QB(e){return e<0&&KF(),e}function Yr(){Zo.call(this)}p(Yr).j=function(e){this.k();for(var n=this.l();n.m();)if(Je(n.o(),e))return n.n(),!0;return!1};p(Yr).p=function(e){this.k();for(var n=!1,i=e.l();i.m();){var d=i.o();this.i(d)&&(n=!0)}return n};p(Yr).toJSON=function(){return this.toArray()};p(Yr).k=function(){};function e3(e){this.w_1=e,this.u_1=0,this.v_1=-1}p(e3).m=function(){return this.u_1<this.w_1.q()};p(e3).o=function(){if(!this.m())throw Au();var e=this,n=this.u_1;return this.u_1=n+1|0,e.v_1=n,this.w_1.x(this.v_1)};p(e3).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw o3(nd(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function br(){Yr.call(this),this.y_1=0}p(br).i=function(e){return this.k(),this.a1(this.q(),e),!0};p(br).l=function(){return new e3(this)};p(br).r=function(e){return this.b1(e)>=0};p(br).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Je(r,e)){n=i;break e}i=i+1|0}n=-1}return n};p(br).equals=function(e){return e===this?!0:e!=null&&Xn(e,W0)?tt.c1(this,e):!1};p(br).hashCode=function(){return tt.d1(this)};function F0(){Tr.call(this),this.g1_1=null,this.h1_1=null}p(F0).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Je(e,d)){var r=i.m1();return n.n(),r}}return null};p(F0).k=function(){};function U0(){Yr.call(this)}p(U0).equals=function(e){return e===this?!0:e!=null&&Xn(e,U4)?W8.s1(this,e):!1};p(U0).hashCode=function(){return W8.t1(this)};function Sx(e){if(!(e>=0)){var n="capacity must be non-negative.";throw jr(nd(n))}return G0(Array(e),null)}function wx(e,n){e[n]=null}function nx(e,n,i){e.fill(null,n,i)}function ix(e,n){return CF(e,n)}function Ax(){y8=this;var e=this,n=M8(0);n.w1_1=!0,e.x1_1=n}var y8;function jB(){return y8==null&&new Ax,y8}function eL(e){var n=[];return Yn.call(e,n),e}function Vo(){return eL(Qe(p(Yn)))}function nL(e,n){var i=[];if(Yn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw jr(nd(d))}return n}function M8(e){return nL(e,Qe(p(Yn)))}function iL(e,n){var i=$0(e);return Yn.call(n,i),n}function Cx(e){return iL(e,Qe(p(Yn)))}function tL(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function gx(e,n){return tt.y1(n,e.q()),n}function rL(e,n){return tt.z1(n,e.q()),n}function Yn(e){jB(),br.call(this),this.v1_1=e,this.w1_1=!1}p(Yn).q=function(){return this.v1_1.length};p(Yn).x=function(e){var n=this.v1_1[gx(this,e)];return n==null||n!=null?n:an()};p(Yn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};p(Yn).a1=function(e,n){this.k(),this.v1_1.splice(rL(this,e),0,n),this.y_1=this.y_1+1|0};p(Yn).p=function(e){if(this.k(),e.t())return!1;for(var n=tL(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=QB(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};p(Yn).z=function(e){this.k(),gx(this,e),this.y_1=this.y_1+1|0;var n;return e===M4(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};p(Yn).j=function(e){this.k();var n=0,i=this.v1_1.length-1|0;if(n<=i)do{var d=n;if(n=n+1|0,Je(this.v1_1[d],e))return this.v1_1.splice(d,1),this.y_1=this.y_1+1|0,!0}while(n<=i);return!1};p(Yn).b1=function(e){return Mx(this.v1_1,e)};p(Yn).toString=function(){return ZL(this.v1_1)};p(Yn).a2=function(){return[].slice.call(this.v1_1)};p(Yn).toArray=function(){return this.a2()};p(Yn).k=function(){if(this.w1_1)throw ns()};function dL(e,n){return F0.call(n),Qr.call(n),n.f2_1=e,n}function bx(e){return dL(Nx(),e),e}function oL(){return bx(Qe(p(Qr)))}p(Qr).p1=function(e){return this.f2_1.h2(e)};p(Qr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new _8(this.f2_1);this.g2_1=i,n=i}else n=e;return n};p(Qr).r1=function(e){return this.f2_1.r1(e)};p(Qr).i1=function(e,n){return this.f2_1.i1(e,n)};p(Qr).j1=function(e){return this.f2_1.j1(e)};p(Qr).q=function(){return this.f2_1.q()};function Qr(){this.g2_1=null}function _8(e){Rr.call(this,e)}p(_8).l=function(){return this.j2_1.k2()};function Rr(e){U0.call(this),this.j2_1=e}p(Rr).q=function(){return this.j2_1.q()};p(Rr).t=function(){return this.j2_1.q()===0};p(Rr).l2=function(e){return this.j2_1.n2(e)};p(Rr).r=function(e){return e!=null&&Xn(e,Fo)?this.l2(e!=null&&Xn(e,Fo)?e:an()):!1};p(Rr).m2=function(e){throw ns()};p(Rr).i=function(e){return this.m2(e!=null&&Xn(e,Fo)?e:an())};p(Rr).p=function(e){throw ns()};p(Rr).s=function(e){return this.j2_1.o2(e)};p(Rr).k=function(){return this.j2_1.k()};function Tx(e,n){return KB(An(x4(n,1),3))}function Rx(e,n){return kx(n)+1|0}function aL(e){return uL(8,e),e}function Nx(){return aL(Qe(p(Hi)))}function uL(e,n){return Hi.call(n,Sx(e),null,new Int32Array(e),new Int32Array(Tx(n3,e)),2,0),n}function Z0(e){return e.p2_1.length}function er(e){return e.s2_1.length}function B8(e){e.w2_1=e.w2_1+1|0}function lL(e,n){sL(e,n)?L8(e,er(e)):fL(e,e.u2_1+n|0)}function sL(e,n){var i=Z0(e)-e.u2_1|0,d=e.u2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(Z0(e)/4|0):!1}function fL(e,n){if(n<0)throw pE("too many elements");if(n>Z0(e)){var i=tt.z2(Z0(e),n);e.p2_1=ix(e.p2_1,i);var d=e,r=e.q2_1;d.q2_1=r==null?null:ix(r,i),e.r2_1=AF(e.r2_1,i);var t=Tx(n3,i);t>er(e)&&L8(e,t)}}function cL(e){var n=e.q2_1;if(n!=null)return n;var i=Sx(Z0(e));return e.q2_1=i,i}function B4(e,n){return n==null?0:An(Jn(n),-1640531527)>>>e.v2_1|0}function pL(e){for(var n=0,i=0,d=e.q2_1;n<e.u2_1;)e.r2_1[n]>=0&&(e.p2_1[i]=e.p2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;nx(e.p2_1,i,e.u2_1),d==null||nx(d,i,e.u2_1),e.u2_1=i}function L8(e,n){B8(e),e.u2_1>e.x2_1&&pL(e),n!==er(e)?(e.s2_1=new Int32Array(n),e.v2_1=Rx(n3,n)):SF(e.s2_1,0,0,er(e));for(var i=0;i<e.u2_1;){var d=i;if(i=d+1|0,!hL(e,d))throw o3("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function hL(e,n){for(var i=B4(e,e.p2_1[n]),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return e.s2_1[i]=n+1|0,e.r2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=er(e)-1|0)}}function L4(e,n){for(var i=B4(e,n),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return-1;if(r>0&&Je(e.p2_1[r-1|0],n))return r-1|0;if(d=d-1|0,d<0)return-1;var t=i;i=t-1|0,t===0&&(i=er(e)-1|0)}}function vL(e,n){e.k();e:for(;;)for(var i=B4(e,n),d=E4(An(e.t2_1,2),er(e)/2|0),r=0;;){var t=e.s2_1[i];if(t<=0){if(e.u2_1>=Z0(e)){lL(e,1);continue e}var s=e.u2_1;e.u2_1=s+1|0;var f=s;return e.p2_1[f]=n,e.r2_1[f]=i,e.s2_1[i]=f+1|0,e.x2_1=e.x2_1+1|0,B8(e),r>e.t2_1&&(e.t2_1=r),f}if(Je(e.p2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){L8(e,An(er(e),2));continue e}var c=i;i=c-1|0,c===0&&(i=er(e)-1|0)}}function mL(e,n){e.k();var i=L4(e,n);return i<0?-1:(Ix(e,i),i)}function Ix(e,n){wx(e.p2_1,n),kL(e,e.r2_1[n]),e.r2_1[n]=-1,e.x2_1=e.x2_1-1|0,B8(e)}function kL(e,n){for(var i=n,d=n,r=0,t=E4(An(e.t2_1,2),er(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=er(e)-1|0),r=r+1|0,r>e.t2_1)return e.s2_1[d]=0,qe;var f=e.s2_1[i];if(f===0)return e.s2_1[d]=0,qe;if(f<0)e.s2_1[d]=-1,d=i,r=0;else{var c=B4(e,e.p2_1[f-1|0]);((c-i|0)&(er(e)-1|0))>=r&&(e.s2_1[d]=f,e.r2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.s2_1[d]=-1,qe}}function yL(e,n){return e.x2_1===n.q()?e.o2(n.k1()):!1}function xx(){this.a3_1=-1640531527,this.b3_1=8,this.c3_1=2,this.d3_1=-1}var n3;function bl(e){this.e3_1=e,this.f3_1=0,this.g3_1=-1,this.h3_1=this.e3_1.w2_1,this.i3()}p(bl).i3=function(){for(;this.f3_1<this.e3_1.u2_1&&this.e3_1.r2_1[this.f3_1]<0;)this.f3_1=this.f3_1+1|0};p(bl).m=function(){return this.f3_1<this.e3_1.u2_1};p(bl).n=function(){if(this.j3(),this.g3_1===-1){var e="Call next() before removing element from the iterator.";throw o3(nd(e))}this.e3_1.k(),Ix(this.e3_1,this.g3_1),this.g3_1=-1,this.h3_1=this.e3_1.w2_1};p(bl).j3=function(){if(this.e3_1.w2_1!==this.h3_1)throw H8()};function i3(e){bl.call(this,e)}p(i3).o=function(){if(this.j3(),this.f3_1>=this.e3_1.u2_1)throw Au();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=new Tl(this.e3_1,this.g3_1);return this.i3(),i};p(i3).o3=function(){if(this.f3_1>=this.e3_1.u2_1)throw Au();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=this.e3_1.p2_1[this.g3_1],d=i==null?null:Jn(i),r=d??0,t=K0(this.e3_1.q2_1)[this.g3_1],s=t==null?null:Jn(t),f=r^(s??0);return this.i3(),f};p(i3).p3=function(e){if(this.f3_1>=this.e3_1.u2_1)throw Au();var n=this,i=this.f3_1;this.f3_1=i+1|0,n.g3_1=i;var d=this.e3_1.p2_1[this.g3_1];Je(d,this.e3_1)?e.s3("(this Map)"):e.r3(d),e.t3(61);var r=K0(this.e3_1.q2_1)[this.g3_1];Je(r,this.e3_1)?e.s3("(this Map)"):e.r3(r),this.i3()};function Tl(e,n){this.u3_1=e,this.v3_1=n}p(Tl).l1=function(){return this.u3_1.p2_1[this.v3_1]};p(Tl).m1=function(){return K0(this.u3_1.q2_1)[this.v3_1]};p(Tl).equals=function(e){var n,i;return e!=null&&Xn(e,Fo)?i=Je(e.l1(),this.l1()):i=!1,i?n=Je(e.m1(),this.m1()):n=!1,n};p(Tl).hashCode=function(){var e=this.l1(),n=e==null?null:Jn(e),i=n??0,d=this.m1(),r=d==null?null:Jn(d);return i^(r??0)};p(Tl).toString=function(){return""+this.l1()+"="+this.m1()};function Hi(e,n,i,d,r,t){this.p2_1=e,this.q2_1=n,this.r2_1=i,this.s2_1=d,this.t2_1=r,this.u2_1=t,this.v2_1=Rx(n3,er(this)),this.w2_1=0,this.x2_1=0,this.y2_1=!1}p(Hi).q=function(){return this.x2_1};p(Hi).r1=function(e){var n=L4(this,e);return n<0?null:K0(this.q2_1)[n]};p(Hi).h2=function(e){return L4(this,e)>=0};p(Hi).i1=function(e,n){var i=vL(this,e),d=cL(this);if(i<0){var r=d[(-i|0)-1|0];return d[(-i|0)-1|0]=n,r}else return d[i]=n,null};p(Hi).j1=function(e){var n=mL(this,e);if(n<0)return null;var i=K0(this.q2_1),d=i[n];return wx(i,n),d};p(Hi).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&Xn(e,Uo)?i=yL(this,e):i=!1,n=i}return n};p(Hi).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.o3()|0;return e};p(Hi).toString=function(){var e=AL(2+An(this.x2_1,3)|0);e.s3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.s3(", "),i.p3(e),n=n+1|0;return e.s3("}"),e.toString()};p(Hi).k=function(){if(this.y2_1)throw ns()};p(Hi).n2=function(e){var n=L4(this,e.l1());return n<0?!1:Je(K0(this.q2_1)[n],e.m1())};p(Hi).w3=function(e){return this.n2(Xn(e,Fo)?e:an())};p(Hi).k2=function(){return new i3(this)};function Ex(){}function SL(e){return bx(e),F4.call(e),e}function t3(){return SL(Qe(p(F4)))}p(F4).k=function(){return this.f2_1.k()};function F4(){}function wL(e,n){return Ox(n),n}function AL(e){return wL(e,Qe(p(ed)))}function Ox(e){return ed.call(e,""),e}function F8(){return Ox(Qe(p(ed)))}function ed(e){this.q3_1=e!==void 0?e:""}p(ed).a=function(){return this.q3_1.length};p(ed).b=function(e){var n=this.q3_1,i;if(e>=0&&e<=RE(n))i=V0(n,e);else throw Q0("index: "+e+", length: "+this.a()+"}");return i};p(ed).t3=function(e){return this.q3_1=this.q3_1+O4(e),this};p(ed).d4=function(e){return this.q3_1=this.q3_1+r3(e),this};p(ed).r3=function(e){return this.q3_1=this.q3_1+r3(e),this};p(ed).s3=function(e){var n=this,i=this.q3_1;return n.q3_1=i+(e??"null"),this};p(ed).toString=function(){return this.q3_1};function tx(e){var n=O4(e).toUpperCase();return n.length>1?e:V0(n,0)}function CL(e,n,i,d,r,t){return t=t===U?!1:t,xE(e,n,i,d,r,t)}function U8(e){switch(e.length){case 0:return td();case 1:return _4(e[0]);default:return gL(e)}}function Px(e){return e.length-1|0}function gL(e){return Cx(GF(e))}function Mx(e,n){if(n==null){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;if(i=i+1|0,e[r]==null)return r}while(i<=d)}else{var t=0,s=e.length-1|0;if(t<=s)do{var f=t;if(t=t+1|0,Je(n,e[f]))return f}while(t<=s)}return-1}function bL(e,n){return Mx(e,n)>=0}function TL(e,n,i,d,r,t,s){return n=n===U?", ":n,i=i===U?"":i,d=d===U?"":d,r=r===U?-1:r,t=t===U?"...":t,s=s===U?null:s,RL(e,F8(),n,i,d,r,t,s).toString()}function RL(e,n,i,d,r,t,s,f){i=i===U?", ":i,d=d===U?"":d,r=r===U?"":r,t=t===U?-1:t,s=s===U?"...":s,f=f===U?null:f,n.d4(d);var c=0,v=0,w=e.length;e:for(;v<w;){var b=e[v];if(v=v+1|0,c=c+1|0,c>1&&n.d4(i),t<0||c<=t)TE(n,b,f);else break e}return t>=0&&c>t&&n.d4(s),n.d4(r),n}function _x(e,n,i,d,r,t,s){return n=n===U?", ":n,i=i===U?"":i,d=d===U?"":d,r=r===U?-1:r,t=t===U?"...":t,s=s===U?null:s,NL(e,F8(),n,i,d,r,t,s).toString()}function NL(e,n,i,d,r,t,s,f){i=i===U?", ":i,d=d===U?"":d,r=r===U?"":r,t=t===U?-1:t,s=s===U?"...":s,f=f===U?null:f,n.d4(d);var c=0,v=e.l();e:for(;v.m();){var w=v.o();if(c=c+1|0,c>1&&n.d4(i),t<0||c<=t)TE(n,w,f);else break e}return t>=0&&c>t&&n.d4(s),n.d4(r),n}function Bx(e){if(e.t())throw a3("List is empty.");return e.x(0)}function x4(e,n){return e<n?n:e}function IL(e,n){return bE.e4(e,n,-1)}function E4(e,n){return e>n?n:e}function xL(e){var n=e&65535;return n}function rx(e){return e}function O4(e){return String.fromCharCode(e)}function Lx(){S8=this,this.f4_1=0,this.g4_1=65535,this.h4_1=55296,this.i4_1=56319,this.j4_1=56320,this.k4_1=57343,this.l4_1=55296,this.m4_1=57343,this.n4_1=2,this.o4_1=16}var S8;function dx(){return S8==null&&new Lx,S8}function Fx(){}function W0(){}function rt(){}function Fo(){}function Uo(){}function U4(){}function Ux(){}var EL;function gt(e,n){this.p4_1=e,this.q4_1=n}p(gt).r4=function(){return this.p4_1};p(gt).s4=function(){return this.q4_1};p(gt).t4=function(e){return qL(this.q4_1,e.q4_1)};p(gt).u4=function(e){return this.t4(e instanceof gt?e:an())};p(gt).equals=function(e){return this===e};p(gt).hashCode=function(){return HL(this)};p(gt).toString=function(){return this.p4_1};function r3(e){var n=e==null?null:nd(e);return n??"null"}function OL(e){for(var n=1,i=[],d=0,r=e.length;d<r;){var t=e[d];d=d+1|0;var s=n,f=t.prototype.$imask$,c=f??t.$imask$;c!=null&&(i.push(c),s=c.length);var v=t.$metadata$.iid,w;v==null?w=null:w=PL(v);var b=w;b!=null&&(i.push(b),s=Math.max(s,b.length)),s>n&&(n=s)}return ML(n,i)}function PL(e){var n=e>>5,i=new Int32Array(n+1|0),d=e&31,r=1<<d;return i[n]=i[n]|r,i}function ML(e,n){for(var i=0,d=new Int32Array(e);i<e;){for(var r=i,t=0,s=0,f=n.length;s<f;){var c=n[s];s=s+1|0,r<c.length&&(t=t|c[r])}d[r]=t,i=i+1|0}return d}function _L(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function G0(e,n){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;i=i+1|0,e[r]=n}while(r!==d);return e}function BL(e){return new Z4(e)}function Z4(e){this.w4_1=e,this.v4_1=0}p(Z4).m=function(){return this.v4_1!==this.w4_1.length};p(Z4).o=function(){var e;if(this.v4_1!==this.w4_1.length){var n=this.v4_1;this.v4_1=n+1|0,e=this.w4_1[n]}else throw a3(""+this.v4_1);return e};function c8(){return z0(),Zx}var Zx;function Vx(){return z0(),qx}var qx,LL;function w8(){return z0(),Jx}var Jx;function Hx(){return z0(),Dx}var Dx;function FL(){return z0(),$x}var $x;function UL(e){return z0(),(e|0)===e?iE(e):(Vx()[0]=e,An(w8()[FL()],31)+w8()[Hx()]|0)}var ox;function z0(){ox||(ox=!0,Zx=new ArrayBuffer(8),qx=new Float64Array(c8()),LL=new Float32Array(c8()),Jx=new Int32Array(c8()),Vx()[0]=-1,Dx=w8()[0]!==0?1:0,$x=1-Hx()|0)}function V0(e,n){var i;if(Wx(e)){var d=e.charCodeAt(n),r;dx();var t=0;if(d<rx(t))r=!0;else{dx();var s=65535;r=d>rx(s)}if(r)throw jr("Invalid Char code: "+d);i=pF(d)}else i=e.b(n);return i}function Wx(e){return typeof e=="string"}function yu(e){var n;return Wx(e)?n=e.length:n=e.a(),n}function ZL(e){return TL(e,", ","[","]",U,U,VL)}function VL(e){return nd(e)}function qL(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=ax(e,n):n instanceof Me?d=ax(e,n.z4()):d=ux(e,n),i=d;break;case"string":case"boolean":i=ux(e,n);break;default:i=JL(e,n);break}return i}function ax(e,n){var i;if(e<n)i=-1;else if(e>n)i=1;else if(e===n){var d;if(e!==0)d=0;else{var r=1/e,t;r===1/n?t=0:r<0?t=-1:t=1,d=t}i=d}else e!==e?i=n!==n?0:1:i=-1;return i}function ux(e,n){return e<n?-1:e>n?1:0}function JL(e,n){return e.u4(n)}function HL(e){return A8(e)}function A8(e){if(!("kotlinHashCodeValue$"in e)){var n=Gx(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function Gx(){return Math.random()*4294967296|0}function nd(e){var n;return e==null?n="null":vF(e)?n="[...]":typeof e.toString!="function"?n=DL(e):n=e.toString(),n}function DL(e){return Object.prototype.toString.call(e)}function Jn(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():A8(e);break;case"function":i=A8(e);break;case"number":i=UL(e);break;case"boolean":i=$L(e);break;case"string":i=Z8(String(e));break;case"bigint":i=WL(e);break;case"symbol":i=GL(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function $L(e){return e?1231:1237}function Z8(e){var n=0,i=e.length,d=0,r=i-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e.charCodeAt(t);n=An(n,31)+s|0}while(t!==r);return n}function WL(e){for(var n=BigInt(32),i=BigInt(4294967295),d=e<0?-e:e,r=0,t=e<0?-1:1;d!=0;){var s=Number(d&i);r=An(31,r)+s|0,d=d>>n}return An(r,t)}function GL(e){var n=zL(e)?KL():XL(),i=n.get(e);if(i!==U)return i;var d=Gx();return n.set(e,d),d}function zL(e){return Symbol.keyFor(e)!=U}function KL(){return p8===U&&(p8=new Map),p8}function XL(){return h8===U&&(h8=new WeakMap),h8}var p8,h8;function Je(e,n){if(e==null)return n==null;if(n==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(n);if(e!==e)return n!==n;if(typeof e=="number"&&typeof n=="number"){var i;if(e===n){var d;if(e!==0)d=!0;else{var r=1/e;d=r===1/n}i=d}else i=!1;return i}return e===n}function He(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function p(e){return e.prototype}function Qn(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function Qe(e){return Object.create(e)}function zx(e,n,i){Error.call(e),YL(e,n,i)}function YL(e,n,i){var d=dE(Object.getPrototypeOf(e));if(!(d&1)){var r;if(n==null){var t;if(n!==null){var s=i==null?null:i.toString();t=s??U}else t=U;r=t}else r=n;e.message=r}d&2||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}function K0(e){var n;return e==null?QL():n=e,n}function QL(){throw D8()}function an(){throw $8()}function d3(e){throw kE("lateinit property "+e+" has not been initialized")}function V8(e){throw jr(e)}function jL(e,n){for(var i=e.length,d=n.length,r=0,t=n;r<i&&r<d;){var s=r,f=r;r=f+1|0,t[s]=e[f]}return n}function eF(e,n,i){var d=e.slice(0,n);e.$type$!==void 0&&(d.$type$=e.$type$);var r=e.length;if(n>r)for(d.length=n;r<n;){var t=r;r=t+1|0,d[t]=i}return d}function Kx(){C8=this,this.a5_1=new Me(0,-2147483648),this.b5_1=new Me(-1,2147483647),this.c5_1=8,this.d5_1=64}var C8;function nF(){return C8==null&&new Kx,C8}function Me(e,n){nF(),E8.call(this),this.x4_1=e,this.y4_1=n}p(Me).e5=function(e){return V4(this,e)};p(Me).u4=function(e){return this.e5(e instanceof Me?e:an())};p(Me).f5=function(e){return P4(this,e)};p(Me).g5=function(e){return q0(this,e)};p(Me).h5=function(e){return tF(this,e)};p(Me).i5=function(){return this.j5().f5(new Me(1,0))};p(Me).j5=function(){return new Me(~this.x4_1,~this.y4_1)};p(Me).k5=function(){return this.x4_1};p(Me).z4=function(){return jc(this)};p(Me).valueOf=function(){return this.z4()};p(Me).equals=function(e){var n;return e instanceof Me?n=Xr(this,e):n=!1,n};p(Me).hashCode=function(){return oF(this)};p(Me).toString=function(){return g8(this,10)};function Lo(){return un(),Xx}var Xx;function I4(){return un(),Yx}var Yx;function lx(){return un(),Qx}var Qx;function iF(){return un(),jx}var jx;function _d(){return un(),eE}var eE;function sx(){return un(),nE}var nE;function V4(e,n){if(un(),Xr(e,n))return 0;var i=gr(e),d=gr(n);return i&&!d?-1:!i&&d?1:gr(q0(e,n))?-1:1}function P4(e,n){un();var i=e.y4_1>>>16|0,d=e.y4_1&65535,r=e.x4_1>>>16|0,t=e.x4_1&65535,s=n.y4_1>>>16|0,f=n.y4_1&65535,c=n.x4_1>>>16|0,v=n.x4_1&65535,w=0,b=0,g=0,_=0;return _=_+(t+v|0)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+(r+c|0)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(d+f|0)|0,w=w+(b>>>16|0)|0,b=b&65535,w=w+(i+s|0)|0,w=w&65535,new Me(g<<16|_,w<<16|b)}function q0(e,n){return un(),P4(e,n.i5())}function Su(e,n){if(un(),gl(e))return Lo();if(gl(n))return Lo();if(Xr(e,_d()))return fx(n)?_d():Lo();if(Xr(n,_d()))return fx(e)?_d():Lo();if(gr(e)){var i;return gr(n)?i=Su(At(e),At(n)):i=At(Su(At(e),n)),i}else if(gr(n))return At(Su(e,At(n)));if(cx(e,sx())&&cx(n,sx()))return J0(jc(e)*jc(n));var d=e.y4_1>>>16|0,r=e.y4_1&65535,t=e.x4_1>>>16|0,s=e.x4_1&65535,f=n.y4_1>>>16|0,c=n.y4_1&65535,v=n.x4_1>>>16|0,w=n.x4_1&65535,b=0,g=0,_=0,Y=0;return Y=Y+An(s,w)|0,_=_+(Y>>>16|0)|0,Y=Y&65535,_=_+An(t,w)|0,g=g+(_>>>16|0)|0,_=_&65535,_=_+An(s,v)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+An(r,w)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+An(t,v)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+An(s,c)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(((An(d,w)+An(r,v)|0)+An(t,c)|0)+An(s,f)|0)|0,b=b&65535,new Me(_<<16|Y,b<<16|g)}function tF(e,n){if(un(),gl(n))throw J8("division by zero");if(gl(e))return Lo();if(Xr(e,_d())){if(Xr(n,I4())||Xr(n,lx()))return _d();if(Xr(n,_d()))return I4();var i=dF(e,1),d=rF(i.h5(n),1);if(Xr(d,Lo()))return gr(n)?I4():lx();var r=q0(e,Su(n,d));return P4(d,r.h5(n))}else if(Xr(n,_d()))return Lo();if(gr(e)){var t;return gr(n)?t=At(e).h5(At(n)):t=At(At(e).h5(n)),t}else if(gr(n))return At(e.h5(At(n)));for(var s=Lo(),f=e;uF(f,n);){for(var c=jc(f)/jc(n),v=Math.max(1,Math.floor(c)),w=Math.ceil(Math.log(v)/Math.LN2),b=w<=48?1:Math.pow(2,w-48),g=J0(v),_=Su(g,n);gr(_)||aF(_,f);)v=v-b,g=J0(v),_=Su(g,n);gl(g)&&(g=I4()),s=P4(s,g),f=q0(f,_)}return s}function rF(e,n){un();var i=n&63;return i===0?e:i<32?new Me(e.x4_1<<i,e.y4_1<<i|(e.x4_1>>>(32-i|0)|0)):new Me(0,e.x4_1<<(i-32|0))}function dF(e,n){un();var i=n&63;return i===0?e:i<32?new Me(e.x4_1>>>i|0|e.y4_1<<(32-i|0),e.y4_1>>i):new Me(e.y4_1>>(i-32|0),e.y4_1>=0?0:-1)}function jc(e){return un(),e.y4_1*4294967296+lF(e)}function Xr(e,n){return un(),e.y4_1===n.y4_1?e.x4_1===n.x4_1:!1}function oF(e){return un(),e.x4_1^e.y4_1}function g8(e,n){if(un(),n<2||36<n)throw J8("radix out of range: "+n);if(gl(e))return"0";if(gr(e))if(Xr(e,_d())){var i=Qc(n),d=e.h5(i),r=q0(Su(d,i),e).k5(),t=g8(d,n);return t+r.toString(n)}else return"-"+g8(At(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=J0(Math.pow(n,s)),c=e,v="";;){var w=c.h5(f),b=q0(c,Su(w,f)).k5(),g=b.toString(n);if(c=w,gl(c))return g+v;for(;g.length<s;)g="0"+g;v=g+v}}function Qc(e){return un(),new Me(e,e<0?-1:0)}function gr(e){return un(),e.y4_1<0}function gl(e){return un(),e.y4_1===0?e.x4_1===0:!1}function fx(e){return un(),(e.x4_1&1)===1}function At(e){return un(),e.i5()}function cx(e,n){return un(),V4(e,n)<0}function J0(e){if(un(),zB(e))return Lo();if(e<=-9223372036854776e3)return _d();if(e+1>=9223372036854776e3)return iF();if(e<0)return At(J0(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Me(i,d)}function aF(e,n){return un(),V4(e,n)>0}function uF(e,n){return un(),V4(e,n)>=0}function lF(e){return un(),e.x4_1>=0?e.x4_1:4294967296+e.x4_1}var px;function un(){px||(px=!0,Xx=Qc(0),Yx=Qc(1),Qx=Qc(-1),jx=new Me(-1,2147483647),eE=new Me(0,-2147483648),nE=Qc(16777216))}function ue(e,n,i,d,r){return q8("class",e,n,i,d,r,null)}function q8(e,n,i,d,r,t,s){var f=U;return{kind:e,simpleName:n,associatedObjectKey:d,associatedObjects:r,suspendArity:t,$kClass$:f,defaultConstructor:i,iid:s}}function q(e,n,i,d,r,t,s,f,c){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,c??[]);if(e.$metadata$=v,r!=null){var w=v.iid!=null?e:e.prototype;w.$imask$=OL(r)}}function qo(e,n,i,d,r){return q8("interface",e,n,i,d,r,sF())}function sF(){return Yc===U&&(Yc=0),Yc=Yc+1|0,Yc}var Yc;function oi(e,n,i,d,r){return q8("object",e,n,i,d,r,null)}function X0(e){var n=e.length,i=Array(n),d=0,r=n-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e[t];s!=null&&H0(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function iE(e){var n;return e instanceof Me?n=e.k5():n=fF(e),n}function fF(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function cF(e){return e<<16>>16}function tE(e){var n;return e instanceof Me?n=e:n=J0(e),n}function pF(e){var n=iE(e),i=cF(n);return xL(i)}function hF(e,n){return new wu(e,n)}function vF(e){return rE(e)?!0:k8(e)}function rE(e){return Array.isArray(e)}function Xn(e,n){return mF(e,n.$metadata$.iid)}function mF(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return _L(r,n)}function H0(e){var n;return rE(e)?n=!e.$type$:n=!1,n}function kF(e){return typeof e=="string"?!0:Xn(e,x8)}function dE(e){var n=e.constructor,i=n==null?null:n.$metadata$,d=i==null?null:i.errorInfo;if(d!=null)return d;var r=0;if(hx(e,"message")&&(r=r|1),hx(e,"cause")&&(r=r|2),r!==3){var t=yF(e);t!=Error.prototype&&(r=r|dE(t))}return i!=null&&(i.errorInfo=r),r}function hx(e,n){return e.hasOwnProperty(n)}function yF(e){return Object.getPrototypeOf(e)}var U;function SF(e,n,i,d){i=i===U?0:i,d=d===U?e.length:d,tt.h(i,d,e.length),e.fill(n,i,d)}function v8(e,n,i,d){i=i===U?0:i,d=d===U?e.length:d,tt.h(i,d,e.length),e.fill(n,i,d)}function wF(e){return new Yn(e)}function AF(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw jr(nd(i))}return jL(e,new Int32Array(n))}function CF(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw jr(nd(i))}return eF(e,n,null)}function oE(e){return zx(e),Jo.call(e),e}function aE(){var e=oE(Qe(p(Jo)));return He(e,aE),e}function uE(e,n){return zx(n,e),Jo.call(n),n}function J8(e){var n=uE(e,Qe(p(Jo)));return He(n,J8),n}function Jo(){He(this,Jo)}function gF(e){return id(e),Y0.call(e),e}function lE(){var e=gF(Qe(p(Y0)));return He(e,lE),e}function bF(e,n){return Rl(e,n),Y0.call(n),n}function jr(e){var n=bF(e,Qe(p(Y0)));return He(n,jr),n}function Y0(){He(this,Y0)}function TF(e){return id(e),j0.call(e),e}function sE(){var e=TF(Qe(p(j0)));return He(e,sE),e}function RF(e,n){return Rl(e,n),j0.call(n),n}function Q0(e){var n=RF(e,Qe(p(j0)));return He(n,Q0),n}function j0(){He(this,j0)}function NF(e){return id(e),es.call(e),e}function fE(){var e=NF(Qe(p(es)));return He(e,fE),e}function IF(e,n){return Rl(e,n),es.call(n),n}function o3(e){var n=IF(e,Qe(p(es)));return He(n,o3),n}function es(){He(this,es)}function xF(e){return id(e),q4.call(e),e}function ns(){var e=xF(Qe(p(q4)));return He(e,ns),e}function q4(){He(this,q4)}function id(e){return oE(e),Di.call(e),e}function cE(){var e=id(Qe(p(Di)));return He(e,cE),e}function Rl(e,n){return uE(e,n),Di.call(n),n}function pE(e){var n=Rl(e,Qe(p(Di)));return He(n,pE),n}function Di(){He(this,Di)}function EF(e){return id(e),is.call(e),e}function Au(){var e=EF(Qe(p(is)));return He(e,Au),e}function OF(e,n){return Rl(e,n),is.call(n),n}function a3(e){var n=OF(e,Qe(p(is)));return He(n,a3),n}function is(){He(this,is)}function PF(e){return id(e),J4.call(e),e}function H8(){var e=PF(Qe(p(J4)));return He(e,H8),e}function J4(){He(this,J4)}function MF(e){return id(e),ts.call(e),e}function hE(){var e=MF(Qe(p(ts)));return He(e,hE),e}function _F(e,n){return Rl(e,n),ts.call(n),n}function vE(e){var n=_F(e,Qe(p(ts)));return He(n,vE),n}function ts(){He(this,ts)}function BF(e){return id(e),H4.call(e),e}function D8(){var e=BF(Qe(p(H4)));return He(e,D8),e}function H4(){He(this,H4)}function LF(e){return id(e),D4.call(e),e}function $8(){var e=LF(Qe(p(D4)));return He(e,$8),e}function D4(){He(this,D4)}function FF(e){return id(e),rs.call(e),e}function mE(){var e=FF(Qe(p(rs)));return He(e,mE),e}function UF(e,n){return Rl(e,n),rs.call(n),n}function kE(e){var n=UF(e,Qe(p(rs)));return He(n,kE),n}function rs(){He(this,rs)}function ZF(e){return function(n){return n===e?"(this Collection)":r3(n)}}function Zo(){}p(Zo).r=function(e){var n;e:{var i;if(Xn(this,rt)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Je(r,e)){n=!0;break e}}n=!1}return n};p(Zo).s=function(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.r(r)){n=!1;break e}}n=!0}return n};p(Zo).t=function(){return this.q()===0};p(Zo).toString=function(){return _x(this,", ","[","]",U,U,ZF(this))};p(Zo).toArray=function(){return yx(this)};function Cu(){this.g_1=2147483639}p(Cu).y1=function(e,n){if(e<0||e>=n)throw Q0("index: "+e+", size: "+n)};p(Cu).z1=function(e,n){if(e<0||e>n)throw Q0("index: "+e+", size: "+n)};p(Cu).h=function(e,n,i){if(e<0||n>i)throw Q0("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw jr("fromIndex: "+e+" > toIndex: "+n)};p(Cu).z2=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?P8.MAX_VALUE:2147483639),i};p(Cu).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=An(31,n),t=d==null?null:Jn(d);n=r+(t??0)|0}return n};p(Cu).c1=function(e,n){if(e.q()!==n.q())return!1;for(var i=n.l(),d=e.l();d.m();){var r=d.o(),t=i.o();if(!Je(r,t))return!1}return!0};var tt;function vx(e,n){return n===e?"(this Map)":r3(n)}function yE(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Je(r.l1(),n)){i=r;break e}}i=null}return i}function SE(){}var VF;function qF(e){return function(n){return e.n5(n)}}function Tr(){this.n1_1=null,this.o1_1=null}p(Tr).p1=function(e){return yE(this,e)!=null};p(Tr).q1=function(e){if(!(e!=null&&Xn(e,Fo)))return!1;var n=e.l1(),i=e.m1(),d=(Xn(this,Uo)?this:an()).r1(n);if(!Je(i,d))return!1;var r;return d==null?r=!(Xn(this,Uo)?this:an()).p1(n):r=!1,!r};p(Tr).equals=function(e){if(e===this)return!0;if(!(e!=null&&Xn(e,Uo))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(Xn(i,rt)?d=i.t():d=!1,d){n=!0;break e}for(var r=i.l();r.m();){var t=r.o();if(!this.q1(t)){n=!1;break e}}n=!0}return n};p(Tr).r1=function(e){var n=yE(this,e);return n==null?null:n.m1()};p(Tr).hashCode=function(){return Jn(this.k1())};p(Tr).q=function(){return this.k1().q()};p(Tr).toString=function(){var e=this.k1();return _x(e,", ","{","}",U,U,qF(this))};p(Tr).n5=function(e){return vx(this,e.l1())+"="+vx(this,e.m1())};function $4(){}p($4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:Jn(d);n=r+(t??0)|0}return n};p($4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var W8;function JF(e){return br.call(e),Bn.call(e),e.q5_1=G8().s5_1,e}function u3(){return JF(Qe(p(Bn)))}function l3(e,n){if(n<0)throw o3("Deque is too big.");if(n<=e.q5_1.length)return qe;if(e.q5_1===G8().s5_1){var i=e,d=x4(n,10);return i.q5_1=G0(Array(d),null),qe}var r=tt.z2(e.q5_1.length,n);HF(e,r)}function HF(e,n){var i=G0(Array(n),null),d=e.q5_1,r=e.p5_1,t=e.q5_1.length;Ve(d,i,0,r,t);var s=e.q5_1,f=e.q5_1.length-e.p5_1|0,c=e.p5_1;Ve(s,i,f,0,c),e.p5_1=0,e.q5_1=i}function nr(e,n){return n>=e.q5_1.length?n-e.q5_1.length|0:n}function DF(e,n){return n<0?n+e.q5_1.length|0:n}function wE(e,n){return n===Px(e.q5_1)?0:n+1|0}function b8(e,n){return n===0?Px(e.q5_1):n-1|0}function T8(e,n,i){var d=i.l(),r=n,t=e.q5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.q5_1[s]=d.o()}while(r<t);var f=0,c=e.p5_1;if(f<c)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.q5_1[v]=d.o()}while(f<c);e.r5_1=e.r5_1+i.q()|0}function AE(){R8=this;var e=this;e.s5_1=[],this.t5_1=10}var R8;function G8(){return R8==null&&new AE,R8}p(Bn).q=function(){return this.r5_1};p(Bn).t=function(){return this.r5_1===0};p(Bn).u5=function(e){l3(this,this.r5_1+1|0),this.p5_1=b8(this,this.p5_1),this.q5_1[this.p5_1]=e,this.r5_1=this.r5_1+1|0};p(Bn).v5=function(e){l3(this,this.r5_1+1|0);var n=this.q5_1,i=this.r5_1;n[nr(this,this.p5_1+i|0)]=e,this.r5_1=this.r5_1+1|0};p(Bn).w5=function(){if(this.t())throw a3("ArrayDeque is empty.");var e=this.p5_1,n=this.q5_1[e],i=n==null||n!=null?n:an();return this.q5_1[this.p5_1]=null,this.p5_1=wE(this,this.p5_1),this.r5_1=this.r5_1-1|0,i};p(Bn).x5=function(){if(this.t())throw a3("ArrayDeque is empty.");var e=M4(this),n=nr(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:an();return this.q5_1[n]=null,this.r5_1=this.r5_1-1|0,d};p(Bn).i=function(e){return this.v5(e),!0};p(Bn).a1=function(e,n){if(tt.z1(e,this.r5_1),e===this.r5_1)return this.v5(n),qe;if(e===0)return this.u5(n),qe;l3(this,this.r5_1+1|0);var i=nr(this,this.p5_1+e|0);if(e<(this.r5_1+1|0)>>1){var d=b8(this,i),r=b8(this,this.p5_1);if(d>=this.p5_1){this.q5_1[r]=this.q5_1[this.p5_1];var t=this.q5_1,s=this.q5_1,f=this.p5_1,c=this.p5_1+1|0,v=d+1|0;Ve(t,s,f,c,v)}else{var w=this.q5_1,b=this.q5_1,g=this.p5_1-1|0,_=this.p5_1,Y=this.q5_1.length;Ve(w,b,g,_,Y),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Ce=this.q5_1,De=this.q5_1,Ri=d+1|0;Ve(Ce,De,0,1,Ri)}this.q5_1[d]=n,this.p5_1=r}else{var Ni=this.r5_1,Tt=nr(this,this.p5_1+Ni|0);if(i<Tt){var Rt=this.q5_1,qd=this.q5_1,ld=i+1|0;Ve(Rt,qd,ld,i,Tt)}else{var sd=this.q5_1,Er=this.q5_1;Ve(sd,Er,1,0,Tt),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var Jd=this.q5_1,Hd=this.q5_1,fd=i+1|0,_u=this.q5_1.length-1|0;Ve(Jd,Hd,fd,i,_u)}this.q5_1[i]=n}this.r5_1=this.r5_1+1|0};p(Bn).p=function(e){if(e.t())return!1;l3(this,this.r5_1+e.q()|0);var n=this.r5_1,i=nr(this,this.p5_1+n|0);return T8(this,i,e),!0};p(Bn).y5=function(e,n){if(tt.z1(e,this.r5_1),n.t())return!1;if(e===this.r5_1)return this.p(n);l3(this,this.r5_1+n.q()|0);var i=this.r5_1,d=nr(this,this.p5_1+i|0),r=nr(this,this.p5_1+e|0),t=n.q();if(e<(this.r5_1+1|0)>>1){var s=this.p5_1-t|0;if(r>=this.p5_1)if(s>=0){var f=this.q5_1,c=this.q5_1,v=s,w=this.p5_1;Ve(f,c,v,w,r)}else{s=s+this.q5_1.length|0;var b=r-this.p5_1|0,g=this.q5_1.length-s|0;if(g>=b){var _=this.q5_1,Y=this.q5_1,Ce=s,De=this.p5_1;Ve(_,Y,Ce,De,r)}else{var Ri=this.q5_1,Ni=this.q5_1,Tt=s,Rt=this.p5_1,qd=this.p5_1+g|0;Ve(Ri,Ni,Tt,Rt,qd);var ld=this.q5_1,sd=this.q5_1,Er=this.p5_1+g|0;Ve(ld,sd,0,Er,r)}}else{var Jd=this.q5_1,Hd=this.q5_1,fd=s,_u=this.p5_1,Fl=this.q5_1.length;if(Ve(Jd,Hd,fd,_u,Fl),t>=r){var Ul=this.q5_1,Zl=this.q5_1,UO=this.q5_1.length-t|0;Ve(Ul,Zl,UO,0,r)}else{var ZO=this.q5_1,VO=this.q5_1,qO=this.q5_1.length-t|0;Ve(ZO,VO,qO,0,t);var JO=this.q5_1,HO=this.q5_1;Ve(JO,HO,0,t,r)}}this.p5_1=s,T8(this,DF(this,r-t|0),n)}else{var Bu=r+t|0;if(r<d)if((d+t|0)<=this.q5_1.length){var DO=this.q5_1,$O=this.q5_1;Ve(DO,$O,Bu,r,d)}else if(Bu>=this.q5_1.length){var WO=this.q5_1,GO=this.q5_1,zO=Bu-this.q5_1.length|0;Ve(WO,GO,zO,r,d)}else{var Bh=(d+t|0)-this.q5_1.length|0,KO=this.q5_1,XO=this.q5_1,YO=d-Bh|0;Ve(KO,XO,0,YO,d);var QO=this.q5_1,jO=this.q5_1,eP=d-Bh|0;Ve(QO,jO,Bu,r,eP)}else{var nP=this.q5_1,iP=this.q5_1;if(Ve(nP,iP,t,0,d),Bu>=this.q5_1.length){var tP=this.q5_1,rP=this.q5_1,dP=Bu-this.q5_1.length|0,oP=this.q5_1.length;Ve(tP,rP,dP,r,oP)}else{var aP=this.q5_1,uP=this.q5_1,lP=this.q5_1.length-t|0,sP=this.q5_1.length;Ve(aP,uP,0,lP,sP);var fP=this.q5_1,cP=this.q5_1,pP=this.q5_1.length-t|0;Ve(fP,cP,Bu,r,pP)}}T8(this,r,n)}return!0};p(Bn).x=function(e){tt.y1(e,this.r5_1);var n=nr(this,this.p5_1+e|0),i=this.q5_1[n];return i==null||i!=null?i:an()};p(Bn).r=function(e){return this.b1(e)!==-1};p(Bn).b1=function(e){var n=this.r5_1,i=nr(this,this.p5_1+n|0);if(this.p5_1<i){var d=this.p5_1;if(d<i)do{var r=d;if(d=d+1|0,Je(e,this.q5_1[r]))return r-this.p5_1|0}while(d<i)}else if(this.p5_1>=i){var t=this.p5_1,s=this.q5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Je(e,this.q5_1[f]))return f-this.p5_1|0}while(t<s);var c=0;if(c<i)do{var v=c;if(c=c+1|0,Je(e,this.q5_1[v]))return(v+this.q5_1.length|0)-this.p5_1|0}while(c<i)}return-1};p(Bn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};p(Bn).z=function(e){if(tt.y1(e,this.r5_1),e===M4(this))return this.x5();if(e===0)return this.w5();var n=nr(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:an();if(e<this.r5_1>>1){if(n>=this.p5_1){var r=this.q5_1,t=this.q5_1,s=this.p5_1+1|0,f=this.p5_1;Ve(r,t,s,f,n)}else{var c=this.q5_1,v=this.q5_1;Ve(c,v,1,0,n),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var w=this.q5_1,b=this.q5_1,g=this.p5_1+1|0,_=this.p5_1,Y=this.q5_1.length-1|0;Ve(w,b,g,_,Y)}this.q5_1[this.p5_1]=null,this.p5_1=wE(this,this.p5_1)}else{var Ce=M4(this),De=nr(this,this.p5_1+Ce|0);if(n<=De){var Ri=this.q5_1,Ni=this.q5_1,Tt=n+1|0,Rt=De+1|0;Ve(Ri,Ni,n,Tt,Rt)}else{var qd=this.q5_1,ld=this.q5_1,sd=n+1|0,Er=this.q5_1.length;Ve(qd,ld,n,sd,Er),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Jd=this.q5_1,Hd=this.q5_1,fd=De+1|0;Ve(Jd,Hd,0,1,fd)}this.q5_1[De]=null}return this.r5_1=this.r5_1-1|0,d};p(Bn).z5=function(){var e=this.r5_1,n=nr(this,this.p5_1+e|0);this.p5_1<n?v8(this.q5_1,null,this.p5_1,n):this.t()||(v8(this.q5_1,null,this.p5_1,this.q5_1.length),v8(this.q5_1,null,0,n)),this.p5_1=0,this.r5_1=0};p(Bn).a6=function(e){var n=e.length>=this.r5_1?e:YB(e,this.r5_1),i=H0(n)?n:an(),d=this.r5_1,r=nr(this,this.p5_1+d|0);if(this.p5_1<r){var t=this.q5_1,s=this.p5_1;Ve(t,i,0,s,r)}else if(!this.t()){var f=this.q5_1,c=this.p5_1,v=this.q5_1.length;Ve(f,i,0,c,v);var w=this.q5_1,b=this.q5_1.length-this.p5_1|0;Ve(w,i,b,0,r)}var g=XB(this.r5_1,i);return H0(g)?g:an()};p(Bn).a2=function(){var e=this.r5_1,n=G0(Array(e),null);return this.a6(n)};p(Bn).toArray=function(){return this.a2()};function Bn(){G8(),this.p5_1=0,this.r5_1=0}function $F(e){if(e.t())return[];for(var n=e.q(),i=G0(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function td(){return WF()}function M4(e){return e.q()-1|0}function rd(){N8=this,this.b6_1=new Me(-1478467534,-1720727600)}p(rd).equals=function(e){var n;return e!=null&&Xn(e,W0)?n=e.t():n=!1,n};p(rd).hashCode=function(){return 1};p(rd).toString=function(){return"[]"};p(rd).q=function(){return 0};p(rd).t=function(){return!0};p(rd).c6=function(e){return e.t()};p(rd).s=function(e){return this.c6(e)};p(rd).x=function(e){throw Q0("Empty list doesn't contain element at index "+e+".")};p(rd).l=function(){return CE};var N8;function WF(){return N8==null&&new rd,N8}function W4(){}p(W4).m=function(){return!1};p(W4).o=function(){throw Au()};var CE;function GF(e){return new Ho(e,!1)}function zF(e){return e.length===0?Vo():Cx(new Ho(e,!0))}function Ho(e,n){this.d6_1=e,this.e6_1=n}p(Ho).q=function(){return this.d6_1.length};p(Ho).t=function(){return this.d6_1.length===0};p(Ho).f6=function(e){return bL(this.d6_1,e)};p(Ho).g6=function(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.f6(r)){n=!1;break e}}n=!0}return n};p(Ho).s=function(e){return this.g6(e)};p(Ho).l=function(){return BL(this.d6_1)};function KF(){throw vE("Index overflow has happened.")}function z8(e,n){return e.p(wF(n))}function G4(){}p(G4).o=function(){return this.h6()};function XF(e,n,i){var d;if(i>0)d=e>=n?n:n-mx(n,e,i)|0;else if(i<0)d=e<=n?n:n+mx(e,n,-i|0)|0;else throw jr("Step is zero.");return d}function mx(e,n,i){return m8(m8(e,i)-m8(n,i)|0,i)}function m8(e,n){var i=e%n|0;return i>=0?i:i+n|0}function gE(){I8=this,this.i6_1=new wu(1,0)}var I8;function YF(){return I8==null&&new gE,I8}function wu(e,n){YF(),Bd.call(this,e,n,1)}p(wu).t=function(){return this.m6_1>this.n6_1};p(wu).equals=function(e){var n;return e instanceof wu?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1?this.n6_1===e.n6_1:!1:n=!1,n};p(wu).hashCode=function(){return this.t()?-1:An(31,this.m6_1)+this.n6_1|0};p(wu).toString=function(){return""+this.m6_1+".."+this.n6_1};function z4(e,n,i){G4.call(this),this.p6_1=i,this.q6_1=n,this.r6_1=this.p6_1>0?e<=n:e>=n,this.s6_1=this.r6_1?e:this.q6_1}p(z4).m=function(){return this.r6_1};p(z4).h6=function(){var e=this.s6_1;if(e===this.q6_1){if(!this.r6_1)throw Au();this.r6_1=!1}else this.s6_1=this.s6_1+this.p6_1|0;return e};function K8(){}p(K8).e4=function(e,n,i){return new Bd(e,n,i)};var bE;function Bd(e,n,i){if(i===0)throw jr("Step must be non-zero.");if(i===P8.MIN_VALUE)throw jr("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.m6_1=e,this.n6_1=XF(e,n,i),this.o6_1=i}p(Bd).l=function(){return new z4(this.m6_1,this.n6_1,this.o6_1)};p(Bd).t=function(){return this.o6_1>0?this.m6_1>this.n6_1:this.m6_1<this.n6_1};p(Bd).equals=function(e){var n;return e instanceof Bd?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1&&this.n6_1===e.n6_1?this.o6_1===e.o6_1:!1:n=!1,n};p(Bd).hashCode=function(){return this.t()?-1:An(31,An(31,this.m6_1)+this.n6_1|0)+this.o6_1|0};p(Bd).toString=function(){return this.o6_1>0?""+this.m6_1+".."+this.n6_1+" step "+this.o6_1:""+this.m6_1+" downTo "+this.n6_1+" step "+(-this.o6_1|0)};function TE(e,n,i){i!=null?e.d4(i(n)):n==null||kF(n)?e.d4(n):n instanceof Fx?e.t3(n.t6_1):e.d4(r3(n))}function QF(e,n,i){if(i=i===U?!1:i,e===n)return!0;if(!i)return!1;var d=tx(e),r=tx(n),t;if(d===r)t=!0;else{var s=O4(d).toLowerCase(),f=V0(s,0),c=O4(r).toLowerCase();t=f===V0(c,0)}return t}function RE(e){return yu(e)-1|0}function NE(e,n,i){i=i===U?!1:i;var d;return typeof n=="string"?d=jF(e,n,U,i)>=0:d=IE(e,n,0,yu(e),i)>=0,d}function jF(e,n,i,d){i=i===U?0:i,d=d===U?!1:d;var r,t;return d?t=!0:t=typeof e!="string",t?r=IE(e,n,i,yu(e),d):r=e.indexOf(n,i),r}function IE(e,n,i,d,r,t){t=t===U?!1:t;var s=t?IL(E4(i,RE(e)),x4(d,0)):hF(x4(i,0),E4(d,yu(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var c=s.m6_1,v=s.n6_1,w=s.o6_1;if(w>0&&c<=v||w<0&&v<=c)do{var b=c;if(c=c+w|0,CL(n,0,e,b,yu(n),r))return b}while(b!==v)}else{var g=s.m6_1,_=s.n6_1,Y=s.o6_1;if(Y>0&&g<=_||Y<0&&_<=g)do{var Ce=g;if(g=g+Y|0,xE(n,0,e,Ce,yu(n),r))return Ce}while(Ce!==_)}return-1}function xE(e,n,i,d,r,t){if(d<0||n<0||n>(yu(e)-r|0)||d>(yu(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!QF(V0(e,n+f|0),V0(i,d+f|0),t))return!1}while(s<r);return!0}function Ct(e,n){this.u6_1=e,this.v6_1=n}p(Ct).toString=function(){return"("+this.u6_1+", "+this.v6_1+")"};p(Ct).hashCode=function(){var e=this.u6_1==null?0:Jn(this.u6_1);return e=An(e,31)+(this.v6_1==null?0:Jn(this.v6_1))|0,e};p(Ct).equals=function(e){if(this===e)return!0;if(!(e instanceof Ct))return!1;var n=e instanceof Ct?e:an();return!(!Je(this.u6_1,n.u6_1)||!Je(this.v6_1,n.v6_1))};function EE(e,n){return new Ct(e,n)}p(Hi).o2=GB;qe=new O8;P8=new D0;n3=new xx;EL=new Ux;tt=new Cu;VF=new SE;W8=new $4;CE=new W4;bE=new K8;var Do=Math.imul;q(Q8,"OneAtATimeAssembler",ue);q(j8,"AllAtOnceAssembler",ue);q($i,"SubscribeCallbackParams",ue);q(ir,"Mode",ue,gt);q(Nl,"Callback",ue);q(nh,U,ue);q(gi,"DispatcherImpl",ue);q(Wi,"EmptyOptions",ue,U,U,Wi);q(Ln,"DispatcherSnapshot",ue);q(ai,"EventScope",ue,gt);q(ih,"LocalEventsDeduper",ue);q(th,"NoOpUnsubscriber",oi);q(v3,"BaseTrace",ue);q(m3,"ErrorInfo",ue);q($E,"PerformanceAnalyticsDelegate",qo);q(f3,"NoOpPerformanceAnalyticsDelegate",ue,U,[$E],f3);q(k3,"RuntimeTrace",ue,v3);q(Tu,"Disabled",oi);q(y3,"NiceLogger",ue);q(bu,"NoOpLogger",ue,U,U,bu);q(dt,"TimerDefinition",ue);q(i6,"Span",ue);q(rh,"Tracer",oi);q(t6,"JsDispatcherImpl",ue,gi);q(r6,"JsRequestBuilderAdapter",ue);q(c3,"JsonStateOperations",ue,U,U,c3);function Q8(e,n){this.w6_1=e,this.x6_1=n}p(Q8).y6=function(e,n){var i;if(e.t())i=td();else{for(var d=this.x6_1.list(),r=e.w5();_E(r);){for(var t=0,s=d.length;t<s;){var f=d[t];if(t=t+1|0,f.id===r.hook)return this.w6_1.a7([""+n+" building batch of ",r]),_4(r)}if(!e.t())r=e.w5();else return td()}this.w6_1.a7([""+n+" building batch of ",r]),i=_4(r)}return i};function j8(e,n){this.b7_1=e,this.c7_1=n}p(j8).y6=function(e,n){var i;if(e.t())i=td();else{for(var d=this.c7_1.list(),r=Vo(),t=e.l();t.m();){var s=t.o(),f;if(_E(s)){var c;if(d.length===0)c=!1;else{var v;e:{for(var w=0,b=d.length;w<b;){var g=d[w];if(w=w+1|0,g.id===s.hook){v=g;break e}}v=null}c=v!=null}f=c}else f=!0;f&&r.i(s)}var _=r;e.z5(),this.b7_1.a7([""+n+" building batch of ",_]),i=_}return i};function _E(e){var n=e.hook;return(n==null?null:NE(n,"useInterval"))===!0}function $i(e,n,i){this.request=e,this.response=n,this.mode=i}p($i).d7=function(){return this.request};p($i).e7=function(){return this.response};p($i).f7=function(){return this.mode};p($i).g7=function(){return this.request};p($i).h7=function(){return this.response};p($i).i7=function(){return this.mode};p($i).j7=function(e,n,i){return new $i(e,n,i)};p($i).copy=function(e,n,i,d){return e=e===U?this.request:e,n=n===U?this.response:n,i=i===U?this.mode:i,this.j7(e,n,i)};p($i).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};p($i).hashCode=function(){var e=this.request==null?0:Jn(this.request);return e=Do(e,31)+(this.response==null?0:Jn(this.response))|0,e=Do(e,31)+this.mode.hashCode()|0,e};p($i).equals=function(e){if(this===e)return!0;if(!(e instanceof $i))return!1;var n=e instanceof $i?e:an();return!(!Je(this.request,n.request)||!Je(this.response,n.response)||!this.mode.equals(n.mode))};var BE,LE,FE;function eU(){return[Ld(),s3(),Fd()]}function nU(e){switch(e){case"SYNC":return Ld();case"ASYNC":return s3();case"SPEC":return Fd();default:X4(),V8("No enum constant value.");break}}var OE;function X4(){if(OE)return qe;OE=!0,BE=new ir("SYNC",0),LE=new ir("ASYNC",1),FE=new ir("SPEC",2)}function ir(e,n){gt.call(this,e,n)}function Ld(){return X4(),BE}function s3(){return X4(),LE}function Fd(){return X4(),FE}function Nl(e,n){this.m7_1=e,this.n7_1=n}p(Nl).toString=function(){return"Callback(success="+this.m7_1+", failure="+this.n7_1+")"};p(Nl).hashCode=function(){var e=Jn(this.m7_1);return e=Do(e,31)+Jn(this.n7_1)|0,e};p(Nl).equals=function(e){if(this===e)return!0;if(!(e instanceof Nl))return!1;var n=e instanceof Nl?e:an();return!(!Je(this.m7_1,n.m7_1)||!Je(this.n7_1,n.n7_1))};function X8(e){var n=e.w7_1;if(n!=null)return n;d3("assembler")}function Il(e){var n=e.d8_1;if(n!=null)return n;d3("local")}function p3(e){var n=e.e8_1;if(n!=null)return n;d3("remote")}function Y4(e){var n=e.f8_1;if(n!=null)return n;d3("timers")}function UE(e){ZE(e),e.k8_1=!0,e.t7_1.a7(["recalculateSpeculativeWork"]);var n=e.x7_1.l(),i=0;e:for(;n.m();){var d=i;i=i+1|0;var r=n.o();if(d===0||r.retry===!0||r.async===!0||r.scope.equals(gu()))continue e;if(e.z7_1.r5_1>10)break e;e.z7_1.i(r)}e.t7_1.a7(["Speculative queue size: "+e.z7_1.r5_1]),Q4(e,e.z7_1)}function eh(e){e.t7_1.a7(["cancelSpeculation"]),e.k8_1=!1,ZE(e)}function ZE(e){e.z7_1.z5(),e.h8_1=e.q7_1.clone(e.state),e.i8_1=e.i8_1+1|0}function Y8(e,n,i){if(n.t())return qe;var d=Bx(n),r=d.scope.equals(gu())?!0:pU(d.scope)?!Il(e).isReady():!1;i.equals(Ld())&&(e.a8_1=!0);var t=e.p7_1.l8(i.equals(Fd())?e.h8_1:e.state,n),s=r?p3(e):Il(e),f=e.u7_1;e.u7_1=f+1|0;var c=f,v=e.i8_1,w=KE.m8("runtime_trace"),b=dU(e,i,r,w,n,c,v,t),g=new Nl(b,oU(e,i,r,w,n,c));e.b8_1.i1(c,g),e.t7_1.a7(["Signpost: Handling "+K4(e,i,r)+" request"]),Q4(e,t),s.handle(e.r7_1,t,g.m7_1,g.n7_1)}function K4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function VE(e,n){e.k8_1=e.j8_1,e.a8_1=!1,e.state=e.q7_1.clone(e.g8_1),e.y7_1.z5(),e.x7_1.z5(),Il(e).reset(),p3(e).reset(),eh(e),n&&Y4(e).clear()}function h3(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Jo){var t=s;e.t7_1.n8([t]),e.s7_1.errorHandler(t),r=n}else throw s;d=r}return d}function Q4(e,n){e.s7_1.featureFlags.isVerboseLoggingEnabled&&e.t7_1.a7([n])}function iU(e){return function(){return Il(e).isReady()}}function tU(e,n,i,d){return function(){e.t7_1.a7(["Signpost: Initializing Dispatcher",n,i]),e.d8_1=n,e.e8_1=i,e.f8_1=d;var r=e,t;return e.s7_1.featureFlags.isUsingEverythingAssembler?t=new j8(e.t7_1,d):t=new Q8(e.t7_1,d),r.w7_1=t,e.o8(),qe}}function nh(e,n){this.p8_1=e,this.q8_1=n}p(nh).unsubscribe=function(){this.p8_1.c8_1.j(this.q8_1)};function rU(e,n){return function(){var i=typeof e=="function"?e:an();return n.c8_1.i(i),new nh(n,i)}}function dU(e,n,i,d,r,t,s,f){return function(c){e.t7_1.a7(["Signpost: Response success for "+K4(e,n,i)+" request"]),Q4(e,c),d.u8(),WE(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q()),e.b8_1.j1(t);var v;if(n.equals(Fd())&&e.i8_1!==s)return e.t7_1.a7(["throwing away stale speculative results"]),qe;e.t7_1.a7(["Responding to "+K4(e,n,i)+" runtime result subscriptions"]);for(var w=e.c8_1.l();w.m();){var b=w.o();b(new $i(f,c,n))}var g;n.equals(Ld())?(e.state=e.q7_1.merge(e.state,c.state),e.a8_1=!1,g=qe):n.equals(Fd())&&(e.h8_1=e.q7_1.merge(e.h8_1,c.state),g=qe),e.v8(U8(c.replay),n);var _;return n.equals(Ld())&&e.j8_1&&(UE(e),_=qe),e.o8(),qe}}function oU(e,n,i,d,r,t){return function(s){e.t7_1.a7(["Signpost: Response error for "+K4(e,n,i)+" request",s]),d.u8(),WE(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q());var f=e.s7_1.performanceAnalyticsDelegate,c=s.message;hU(f,c??"",i,""),e.b8_1.j1(t);var v;n.equals(Ld())&&(e.a8_1=!1,v=qe);var w;if(n.equals(Fd()))return eh(e),e.o8(),qe;for(var b=r,g=t3(),_=b.l();_.m();){var Y=_.o(),Ce=Y.scope.equals(gu())?!1:Y.retry!==!0,De=g.r1(Ce),Ri;if(De==null){var Ni=Vo();g.i1(Ce,Ni),Ri=Ni}else Ri=De;var Tt=Ri;Tt.i(Y)}var Rt=g,qd,ld=Rt.r1(!1);if(!(ld==null||ld.t())){var sd=Rt.r1(!1),Er=sd??td(),Jd=$0(Er);e.t7_1.a7(X0([["unretryable events",s],Jd])),qd=e.s7_1.errorHandler(s)}var Hd,fd=Rt.r1(!0);if(!(fd==null||fd.t())){var _u=Rt.r1(!0);if(_u!=null)for(var Fl=_u.l();Fl.m();){var Ul=Fl.o();Ul.retry=!0,Ul.scope=gu()}var Zl=Rt.r1(!0);e.v8(Zl??td(),n),n.equals(Ld())&&e.j8_1&&UE(e),e.o8(),Hd=qe}return qe}}function aU(e,n){return function(){e.t7_1.a7(X0([["Signpost: Submitted events"],n]));for(var i=e.v7_1.w8(U8(n)),d=i.l();d.m();){var r=d.o();r.async===!0?e.y7_1.i(r):(e.x7_1.i(r),e.a8_1&&e.k8_1&&e.z7_1.i(r))}return e.o8(),qe}}function uU(e){return function(){return VE(e,!0),qe}}function lU(e,n){return function(){e.state=e.q7_1.clone(n.state),e.y7_1.z5();var i=n.asyncQueue;z8(e.y7_1,H0(i)?i:an()),e.x7_1.z5();var d=n.syncQueue;return z8(e.x7_1,H0(d)?d:an()),eh(e),Il(e).resume(n.localSnapshot),p3(e).resume(n.remoteSnapshot),Y4(e).resumeAll(n.timerSnapshot),qe}}function gi(e,n,i,d,r){d=d===U?"RenderPostContent":d,r=r===U?new Wi:r,this.o7_1=e,this.p7_1=n,this.q7_1=i,this.r7_1=d,this.s7_1=r,this.t7_1=new y3(this.s7_1.logger),this.u7_1=0;var t=this;t.v7_1=new ih(iU(this),this.t7_1),this.x7_1=u3(),this.y7_1=u3(),this.z7_1=u3(),this.a8_1=!1;var s=this;s.b8_1=t3();var f=this;f.c8_1=Vo(),this.g8_1=this.q7_1.clone(this.state),this.h8_1=this.q7_1.clone(this.g8_1),this.i8_1=0,this.j8_1=this.s7_1.featureFlags.isSpeculativeExecutionEnabled,this.k8_1=this.j8_1,this.t7_1.a7(["Signpost: Constructed KMP Dispatcher"])}p(gi).x8=function(e){this.o7_1=e};p(gi).y8=function(){return this.o7_1};p(gi).z8=function(){return this.x7_1};p(gi).a9=function(){return this.y7_1};p(gi).b9=function(){return this.z7_1};p(gi).init=function(e,n,i){h3(this,qe,tU(this,e,n,i))};p(gi).subscribe=function(e){var n=DE;return h3(this,n,rU(e,this))};p(gi).o8=function(){if(this.t7_1.a7(["ticking","syncInFlight "+this.a8_1,"asyncQueue.size "+this.y7_1.r5_1,"syncQueue.size "+this.x7_1.r5_1,"speculativeQueue.size "+this.z7_1.r5_1]),!Il(this).isReady()&&!p3(this).isReady()&&!(this.x7_1.t()&&this.y7_1.t()))return this.t7_1.c9(["ticking with events and no runtime, deferring..."]),qe;if(this.a8_1){if(this.k8_1){var n=X8(this).y6(this.z7_1,Fd());Y8(this,n,Fd())}}else{var e=X8(this).y6(this.x7_1,Ld());Y8(this,e,Ld())}if(!this.y7_1.t()){for(;!this.y7_1.t();){var i=X8(this).y6(this.y7_1,s3());Y8(this,i,s3())}this.o8()}};p(gi).v8=function(e,n){if(e.t()||n.equals(Fd()))return qe;this.t7_1.a7(["replaying "+e.q()+" events"]),Q4(this,e);for(var i=t3(),d=e.l();d.m();){var r=d.o(),t=new Ct(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var c=Vo();i.i1(t,c),f=c}else f=s;var v=f;v.i(r)}var w=i,b=w.r1(new Ct(!0,!0));this.y7_1.y5(0,b??td());var g=w.r1(new Ct(!0,!1));this.y7_1.p(g??td());var _=w.r1(new Ct(!1,!0));this.x7_1.y5(0,_??td());var Y=w.r1(new Ct(!1,!1));this.x7_1.p(Y??td())};p(gi).submit=function(e){h3(this,qe,aU(this,e))};p(gi).reset=function(){h3(this,qe,uU(this))};p(gi).snapshot=function(){var e=this.q7_1.clone(this.state),n=this.x7_1,i=$0(n),d=this.y7_1,r=$0(d);return new Ln(e,i,r,Il(this).snapshot(),p3(this).snapshot(),Y4(this).list())};p(gi).pause=function(){var e=this.snapshot();return Y4(this).pauseAll(),VE(this,!1),e};p(gi).resume=function(e){h3(this,qe,lU(this,e))};function sU(e){return qe}function Wi(){this.d9_1=new bu;var e=this;e.e9_1=sU,this.f9_1=zE,this.g9_1=new f3}p(Wi).h9=function(e){this.d9_1=e};p(Wi).i9=function(){return this.d9_1};p(Wi).j9=function(e){this.e9_1=e};p(Wi).k9=function(){return this.e9_1};p(Wi).l9=function(e){this.f9_1=e};p(Wi).m9=function(){return this.f9_1};p(Wi).n9=function(e){this.g9_1=e};p(Wi).o9=function(){return this.g9_1};function Ln(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}p(Ln).y8=function(){return this.state};p(Ln).z8=function(){return this.syncQueue};p(Ln).a9=function(){return this.asyncQueue};p(Ln).p9=function(){return this.localSnapshot};p(Ln).q9=function(){return this.remoteSnapshot};p(Ln).r9=function(){return this.timerSnapshot};p(Ln).g7=function(){return this.state};p(Ln).h7=function(){return this.syncQueue};p(Ln).i7=function(){return this.asyncQueue};p(Ln).s9=function(){return this.localSnapshot};p(Ln).t9=function(){return this.remoteSnapshot};p(Ln).u9=function(){return this.timerSnapshot};p(Ln).v9=function(e,n,i,d,r,t){return new Ln(e,n,i,d,r,t)};p(Ln).copy=function(e,n,i,d,r,t,s){return e=e===U?this.state:e,n=n===U?this.syncQueue:n,i=i===U?this.asyncQueue:i,d=d===U?this.localSnapshot:d,r=r===U?this.remoteSnapshot:r,t=t===U?this.timerSnapshot:t,this.v9(e,n,i,d,r,t)};p(Ln).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+nd(this.syncQueue)+", asyncQueue="+nd(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};p(Ln).hashCode=function(){var e=this.state==null?0:Jn(this.state);return e=Do(e,31)+Jn(this.syncQueue)|0,e=Do(e,31)+Jn(this.asyncQueue)|0,e=Do(e,31)+(this.localSnapshot==null?0:Jn(this.localSnapshot))|0,e=Do(e,31)+(this.remoteSnapshot==null?0:Jn(this.remoteSnapshot))|0,e=Do(e,31)+(this.timerSnapshot==null?0:Jn(this.timerSnapshot))|0,e};p(Ln).equals=function(e){if(this===e)return!0;if(!(e instanceof Ln))return!1;var n=e instanceof Ln?e:an();return!(!Je(this.state,n.state)||!Je(this.syncQueue,n.syncQueue)||!Je(this.asyncQueue,n.asyncQueue)||!Je(this.localSnapshot,n.localSnapshot)||!Je(this.remoteSnapshot,n.remoteSnapshot)||!Je(this.timerSnapshot,n.timerSnapshot))};var qE,JE,HE;function fU(){return[e6(),n6(),gu()]}function cU(e){switch(e){case"ALL":return e6();case"LOCAL":return n6();case"REMOTE":return gu();default:j4(),V8("No enum constant value.");break}}var PE;function j4(){if(PE)return qe;PE=!0,qE=new ai("ALL",0),JE=new ai("LOCAL",1),HE=new ai("REMOTE",2)}function ai(e,n){gt.call(this,e,n)}function pU(e){return e.equals(gu())?!0:e.equals(e6())}function e6(){return j4(),qE}function n6(){return j4(),JE}function gu(){return j4(),HE}function ih(e,n){this.y9_1=e,this.z9_1=n}p(ih).w8=function(e){var n;if(this.y9_1())n=e;else{for(var i=Vo(),d=Vo(),r=e.l();r.m();){var t=r.o();t.scope.equals(n6())?d.i(t):i.i(t)}var s=new Ct(i,d);if(!s.v6_1.t()){var f=["Dropping "+s.v6_1.q()+" local events",s.v6_1];this.z9_1.a7([f])}n=s.u6_1}return n};function th(){}p(th).unsubscribe=function(){};var DE;function v3(e,n){this.spanName=e,this.durationMs=n}p(v3).aa=function(){return this.spanName};p(v3).ba=function(){return this.durationMs};function m3(e,n,i){this.message=e,this.origin=n,this.version=i}p(m3).l5=function(){return this.message};p(m3).ca=function(){return this.origin};p(m3).da=function(){return this.version};function $E(){}function f3(){}p(f3).logRuntimeTrace=function(e){};p(f3).logRuntimeError=function(e){};function WE(e,n,i,d,r){e.logRuntimeTrace(new k3(n.r8_1,n.ea().toString(),d,GE(i),r))}function hU(e,n,i,d){e.logRuntimeError(new m3(n,GE(i),d))}function GE(e){return e?"remote":"local"}function k3(e,n,i,d,r){v3.call(this,e,n),this.intent=i,this.target=d,this.eventCount=r}p(k3).fa=function(){return this.intent};p(k3).ga=function(){return this.target};p(k3).ha=function(){return this.eventCount};function Tu(){this.ia_1=!1,this.ja_1=!1,this.ka_1=!1}p(Tu).la=function(){return this.ia_1};p(Tu).ma=function(){return this.ja_1};p(Tu).na=function(){return this.ka_1};var zE;function y3(e){this.z6_1=e}p(y3).n8=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.error(n)};p(y3).c9=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.warn(n)};p(y3).a7=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.debug(n)};function bu(){}p(bu).info=function(e){};p(bu).error=function(e){};p(bu).warn=function(e){};p(bu).debug=function(e){};p(bu).tag=function(){return""};function dt(e,n){this.id=e,this.duration=n}p(dt).oa=function(){return this.id};p(dt).pa=function(){return this.duration};p(dt).g7=function(){return this.id};p(dt).h7=function(){return this.duration};p(dt).qa=function(e,n){return new dt(e,n)};p(dt).copy=function(e,n,i){return e=e===U?this.id:e,n=n===U?this.duration:n,this.qa(e,n)};p(dt).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};p(dt).hashCode=function(){var e=Z8(this.id);return e=Do(e,31)+this.duration|0,e};p(dt).equals=function(e){if(this===e)return!0;if(!(e instanceof dt))return!1;var n=e instanceof dt?e:an();return!(this.id!==n.id||this.duration!==n.duration)};function i6(e,n){this.r8_1=e,this.s8_1=n,this.t8_1=new Me(0,0)}p(i6).u8=function(){this.t8_1=XE()};p(i6).ea=function(){return this.t8_1.g5(this.s8_1)};function rh(){}p(rh).m8=function(e){return new i6(e,XE())};var KE;function t6(e,n,i,d){i=i===U?"RenderPostContent":i,d=d===U?new Wi:d,gi.call(this,e,new r6(n),new c3,i,d),this.ob_1=i,this.pb_1=d}function r6(e){this.qb_1=e}p(r6).rb=function(e,n){var i=$0(n);return this.qb_1.build(e,i)};p(r6).l8=function(e,n){return this.rb(e!=null&&e!=null?e:an(),n)};function ME(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:an())(e),d=M8(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],c=EE(f!=null&&typeof f=="string"?f:an(),s[1]);d.i(c)}return d}function c3(){}p(c3).clone=function(e){return JSON.parse(JSON.stringify(e))};p(c3).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:an(),r=ME(e).l();r.m();){var t=r.o();d[t.u6_1]=t.v6_1}for(var s=ME(n).l();s.m();){var f=s.o();d[f.u6_1]=f.v6_1}return d};function XE(){return tE(new Date().getTime())}Qn(p(ir),"name",p(ir).r4);Qn(p(ir),"ordinal",p(ir).s4);Qn(p(gi),"state",function(){return this.y8()},function(e){this.x8(e)});Qn(p(Wi),"logger",function(){return this.i9()},function(e){this.h9(e)});Qn(p(Wi),"errorHandler",function(){return this.k9()},function(e){this.j9(e)});Qn(p(Wi),"featureFlags",function(){return this.m9()},function(e){this.l9(e)});Qn(p(Wi),"performanceAnalyticsDelegate",function(){return this.o9()},function(e){this.n9(e)});Qn(p(ai),"name",p(ai).r4);Qn(p(ai),"ordinal",p(ai).s4);Qn(p(Tu),"isSpeculativeExecutionEnabled",function(){return this.la()});Qn(p(Tu),"isVerboseLoggingEnabled",function(){return this.ma()});Qn(p(Tu),"isUsingEverythingAssembler",function(){return this.na()});Qn(p(t6),"state",function(){return this.y8()},function(e){this.x8(e)});DE=new th;zE=new Tu;KE=new rh;ir.values=eU;ir.valueOf=nU;Qn(ir,"SYNC",Ld);Qn(ir,"ASYNC",s3);Qn(ir,"SPEC",Fd);ai.values=fU;ai.valueOf=cU;Qn(ai,"ALL",e6);Qn(ai,"LOCAL",n6);Qn(ai,"REMOTE",gu);var rr=P(F(),1);var El=P(F(),1);var Ud;(function(e){e[e.ENVIRONMENT_UNSPECIFIED=0]="ENVIRONMENT_UNSPECIFIED",e[e.ENVIRONMENT_SANDBOX=1]="ENVIRONMENT_SANDBOX",e[e.ENVIRONMENT_PRODUCTION=2]="ENVIRONMENT_PRODUCTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ud||(Ud={}));function d6(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Ud.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Ud.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Ud.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Ud.UNRECOGNIZED}}function o6(e){switch(e){case Ud.ENVIRONMENT_UNSPECIFIED:return 0;case Ud.ENVIRONMENT_SANDBOX:return 1;case Ud.ENVIRONMENT_PRODUCTION:return 2;case Ud.UNRECOGNIZED:default:return-1}}var tr=P(F(),1);var Nu;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Nu||(Nu={}));function vU(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return Nu.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return Nu.GOLD;case-1:case"UNRECOGNIZED":default:return Nu.UNRECOGNIZED}}function mU(e){switch(e){case Nu.CURRENCY_UNSPECIFIED:return 0;case Nu.GOLD:return 200;case Nu.UNRECOGNIZED:default:return-1}}var jn;(function(e){e[e.ACCOUNTING_TYPE_UNSPECIFIED=0]="ACCOUNTING_TYPE_UNSPECIFIED",e[e.ACCOUNTING_TYPE_INSTANT=1]="ACCOUNTING_TYPE_INSTANT",e[e.ACCOUNTING_TYPE_DURABLE=2]="ACCOUNTING_TYPE_DURABLE",e[e.ACCOUNTING_TYPE_CONSUMABLE=3]="ACCOUNTING_TYPE_CONSUMABLE",e[e.ACCOUNTING_TYPE_VALID_FOR_1D=4]="ACCOUNTING_TYPE_VALID_FOR_1D",e[e.ACCOUNTING_TYPE_VALID_FOR_7D=5]="ACCOUNTING_TYPE_VALID_FOR_7D",e[e.ACCOUNTING_TYPE_VALID_FOR_30D=6]="ACCOUNTING_TYPE_VALID_FOR_30D",e[e.ACCOUNTING_TYPE_VALID_FOR_1Y=7]="ACCOUNTING_TYPE_VALID_FOR_1Y",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(jn||(jn={}));function kU(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return jn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return jn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return jn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return jn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return jn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return jn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return jn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return jn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return jn.UNRECOGNIZED}}function yU(e){switch(e){case jn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case jn.ACCOUNTING_TYPE_INSTANT:return 1;case jn.ACCOUNTING_TYPE_DURABLE:return 2;case jn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case jn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case jn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case jn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case jn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case jn.UNRECOGNIZED:default:return-1}}function YE(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var ot={$type:"devvit.payments.v1alpha.Product",encode(e,n=tr.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&Ru.encode(e.price,n.uint32(42).fork()).ldelim(),e.environment!==0&&n.uint32(160).int32(e.environment),e.description!==""&&n.uint32(170).string(e.description),e.accountingType!==0&&n.uint32(184).int32(e.accountingType),Object.entries(e.productMetadata).forEach(([i,d])=>{S3.encode({key:i,value:d},n.uint32(8018).fork()).ldelim()}),Object.entries(e.images).forEach(([i,d])=>{w3.encode({key:i,value:d},n.uint32(8026).fork()).ldelim()}),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=YE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1001:if(t!==8010)break;r.sku=i.string();continue;case 3:if(t!==26)break;r.name=i.string();continue;case 5:if(t!==42)break;r.price=Ru.decode(i,i.uint32());continue;case 20:if(t!==160)break;r.environment=i.int32();continue;case 21:if(t!==170)break;r.description=i.string();continue;case 23:if(t!==184)break;r.accountingType=i.int32();continue;case 1002:if(t!==8018)break;let s=S3.decode(i,i.uint32());s.value!==void 0&&(r.productMetadata[s.key]=s.value);continue;case 1003:if(t!==8026)break;let f=w3.decode(i,i.uint32());f.value!==void 0&&(r.images[f.key]=f.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{sku:Nr(e.sku)?globalThis.String(e.sku):"",name:Nr(e.name)?globalThis.String(e.name):"",price:Nr(e.price)?Ru.fromJSON(e.price):void 0,environment:Nr(e.environment)?d6(e.environment):0,description:Nr(e.description)?globalThis.String(e.description):"",accountingType:Nr(e.accountingType)?kU(e.accountingType):0,productMetadata:nO(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:nO(e.images)?Object.entries(e.images).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.sku!==""&&(n.sku=e.sku),e.name!==""&&(n.name=e.name),e.price!==void 0&&(n.price=Ru.toJSON(e.price)),e.environment!==0&&(n.environment=o6(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=yU(e.accountingType)),e.productMetadata){let i=Object.entries(e.productMetadata);i.length>0&&(n.productMetadata={},i.forEach(([d,r])=>{n.productMetadata[d]=r}))}if(e.images){let i=Object.entries(e.images);i.length>0&&(n.images={},i.forEach(([d,r])=>{n.images[d]=r}))}return n},create(e){return ot.fromPartial(e??{})},fromPartial(e){let n=YE();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?Ru.fromPartial(e.price):void 0,n.environment=e.environment??0,n.description=e.description??"",n.accountingType=e.accountingType??0,n.productMetadata=Object.entries(e.productMetadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.images=Object.entries(e.images??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ot.$type,ot);function QE(){return{key:"",value:""}}var S3={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=tr.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=QE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Nr(e.key)?globalThis.String(e.key):"",value:Nr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return S3.fromPartial(e??{})},fromPartial(e){let n=QE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(S3.$type,S3);function jE(){return{key:"",value:""}}var w3={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=tr.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=jE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Nr(e.key)?globalThis.String(e.key):"",value:Nr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return w3.fromPartial(e??{})},fromPartial(e){let n=jE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(w3.$type,w3);function eO(){return{amount:0,currency:0}}var Ru={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=tr.default.Writer.create()){return e.amount!==0&&n.uint32(8).int32(e.amount),e.currency!==0&&n.uint32(16).int32(e.currency),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=eO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.amount=i.int32();continue;case 2:if(t!==16)break;r.currency=i.int32();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{amount:Nr(e.amount)?globalThis.Number(e.amount):0,currency:Nr(e.currency)?vU(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=mU(e.currency)),n},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let n=eO();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(Ru.$type,Ru);function nO(e){return typeof e=="object"&&e!==null}function Nr(e){return e!=null}var bi;(function(e){e[e.ORDER_STATUS_UNSPECIFIED=0]="ORDER_STATUS_UNSPECIFIED",e[e.ORDER_STATUS_NEW=1]="ORDER_STATUS_NEW",e[e.ORDER_STATUS_CREATED=2]="ORDER_STATUS_CREATED",e[e.ORDER_STATUS_PAID=3]="ORDER_STATUS_PAID",e[e.ORDER_STATUS_DELIVERED=4]="ORDER_STATUS_DELIVERED",e[e.ORDER_STATUS_CANCELED=5]="ORDER_STATUS_CANCELED",e[e.ORDER_STATUS_REVERTED=6]="ORDER_STATUS_REVERTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(bi||(bi={}));function oh(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return bi.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return bi.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return bi.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return bi.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return bi.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return bi.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return bi.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return bi.UNRECOGNIZED}}function ah(e){switch(e){case bi.ORDER_STATUS_UNSPECIFIED:return 0;case bi.ORDER_STATUS_NEW:return 1;case bi.ORDER_STATUS_CREATED:return 2;case bi.ORDER_STATUS_PAID:return 3;case bi.ORDER_STATUS_DELIVERED:return 4;case bi.ORDER_STATUS_CANCELED:return 5;case bi.ORDER_STATUS_REVERTED:return 6;case bi.UNRECOGNIZED:default:return-1}}function iO(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var ei={$type:"devvit.payments.v1alpha.Order",encode(e,n=El.default.Writer.create()){e.id!==""&&n.uint32(10).string(e.id),e.status!==0&&n.uint32(16).int32(e.status),e.createdAt!==void 0&&de.encode(rO(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&de.encode(rO(e.updatedAt),n.uint32(34).fork()).ldelim();for(let i of e.products)ot.encode(i,n.uint32(42).fork()).ldelim();return e.environment!==0&&n.uint32(64).int32(e.environment),Object.entries(e.metadata).forEach(([i,d])=>{A3.encode({key:i,value:d},n.uint32(8010).fork()).ldelim()}),n},decode(e,n){let i=e instanceof El.default.Reader?e:El.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=iO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.id=i.string();continue;case 2:if(t!==16)break;r.status=i.int32();continue;case 3:if(t!==26)break;r.createdAt=dh(de.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=dh(de.decode(i,i.uint32()));continue;case 5:if(t!==42)break;r.products.push(ot.decode(i,i.uint32()));continue;case 8:if(t!==64)break;r.environment=i.int32();continue;case 1001:if(t!==8010)break;let s=A3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{id:xl(e.id)?globalThis.String(e.id):"",status:xl(e.status)?oh(e.status):0,createdAt:xl(e.createdAt)?dO(e.createdAt):void 0,updatedAt:xl(e.updatedAt)?dO(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[],environment:xl(e.environment)?d6(e.environment):0,metadata:SU(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.id!==""&&(n.id=e.id),e.status!==0&&(n.status=ah(e.status)),e.createdAt!==void 0&&(n.createdAt=e.createdAt.toISOString()),e.updatedAt!==void 0&&(n.updatedAt=e.updatedAt.toISOString()),e.products?.length&&(n.products=e.products.map(i=>ot.toJSON(i))),e.environment!==0&&(n.environment=o6(e.environment)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return ei.fromPartial(e??{})},fromPartial(e){let n=iO();return n.id=e.id??"",n.status=e.status??0,n.createdAt=e.createdAt??void 0,n.updatedAt=e.updatedAt??void 0,n.products=e.products?.map(i=>ot.fromPartial(i))||[],n.environment=e.environment??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ei.$type,ei);function tO(){return{key:"",value:""}}var A3={$type:"devvit.payments.v1alpha.Order.MetadataEntry",encode(e,n=El.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof El.default.Reader?e:El.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=tO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:xl(e.key)?globalThis.String(e.key):"",value:xl(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return A3.fromPartial(e??{})},fromPartial(e){let n=tO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(A3.$type,A3);function rO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function dh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function dO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):dh(de.fromJSON(e))}function SU(e){return typeof e=="object"&&e!==null}function xl(e){return e!=null}function oO(){return{order:void 0}}var uh={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=rr.default.Writer.create()){return e.order!==void 0&&ei.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=oO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=ei.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:a6(e.order)?ei.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=ei.toJSON(e.order)),n},create(e){return uh.fromPartial(e??{})},fromPartial(e){let n=oO();return n.order=e.order!==void 0&&e.order!==null?ei.fromPartial(e.order):void 0,n}};l.set(uh.$type,uh);function aO(){return{order:void 0}}var lh={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=rr.default.Writer.create()){return e.order!==void 0&&ei.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=aO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=ei.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:a6(e.order)?ei.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=ei.toJSON(e.order)),n},create(e){return lh.fromPartial(e??{})},fromPartial(e){let n=aO();return n.order=e.order!==void 0&&e.order!==null?ei.fromPartial(e.order):void 0,n}};l.set(lh.$type,lh);function uO(){return{acknowledged:void 0,rejectionReason:void 0}}var sh={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=rr.default.Writer.create()){return e.acknowledged!==void 0&&n.uint32(8).bool(e.acknowledged),e.rejectionReason!==void 0&&n.uint32(18).string(e.rejectionReason),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=uO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.acknowledged=i.bool();continue;case 2:if(t!==18)break;r.rejectionReason=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{acknowledged:a6(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:a6(e.rejectionReason)?globalThis.String(e.rejectionReason):void 0}},toJSON(e){let n={};return e.acknowledged!==void 0&&(n.acknowledged=e.acknowledged),e.rejectionReason!==void 0&&(n.rejectionReason=e.rejectionReason),n},create(e){return sh.fromPartial(e??{})},fromPartial(e){let n=uO();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(sh.$type,sh);function lO(){return{}}var fh={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=rr.default.Writer.create()){return n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=lO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return fh.fromPartial(e??{})},fromPartial(e){return lO()}};l.set(fh.$type,fh);function a6(e){return e!=null}var dn=P(F(),1);function sO(){return{skus:[],metadata:{}}}var ch={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=dn.default.Writer.create()){for(let i of e.skus)n.uint32(10).string(i);return Object.entries(e.metadata).forEach(([i,d])=>{C3.encode({key:i,value:d},n.uint32(18).fork()).ldelim()}),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=sO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.skus.push(i.string());continue;case 2:if(t!==18)break;let s=C3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{skus:globalThis.Array.isArray(e?.skus)?e.skus.map(n=>globalThis.String(n)):[],metadata:AO(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.skus?.length&&(n.skus=e.skus),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return ch.fromPartial(e??{})},fromPartial(e){let n=sO();return n.skus=e.skus?.map(i=>i)||[],n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ch.$type,ch);function fO(){return{key:"",value:""}}var C3={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=dn.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=fO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ei(e.key)?globalThis.String(e.key):"",value:Ei(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return C3.fromPartial(e??{})},fromPartial(e){let n=fO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(C3.$type,C3);function cO(){return{products:[]}}var ph={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=dn.default.Writer.create()){for(let i of e.products)ot.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=cO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.products.push(ot.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[]}},toJSON(e){let n={};return e.products?.length&&(n.products=e.products.map(i=>ot.toJSON(i))),n},create(e){return ph.fromPartial(e??{})},fromPartial(e){let n=cO();return n.products=e.products?.map(i=>ot.fromPartial(i))||[],n}};l.set(ph.$type,ph);function pO(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var hh={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=dn.default.Writer.create()){return e.start!==void 0&&de.encode(SO(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&de.encode(SO(e.end),n.uint32(18).fork()).ldelim(),e.limit!==0&&n.uint32(24).int32(e.limit),e.sku!==""&&n.uint32(34).string(e.sku),e.buyer!==""&&n.uint32(42).string(e.buyer),e.status!==0&&n.uint32(48).int32(e.status),Object.entries(e.metadata).forEach(([i,d])=>{g3.encode({key:i,value:d},n.uint32(58).fork()).ldelim()}),e.cursor!==""&&n.uint32(66).string(e.cursor),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=pO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=yh(de.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=yh(de.decode(i,i.uint32()));continue;case 3:if(t!==24)break;r.limit=i.int32();continue;case 4:if(t!==34)break;r.sku=i.string();continue;case 5:if(t!==42)break;r.buyer=i.string();continue;case 6:if(t!==48)break;r.status=i.int32();continue;case 7:if(t!==58)break;let s=g3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue;case 8:if(t!==66)break;r.cursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{start:Ei(e.start)?wO(e.start):void 0,end:Ei(e.end)?wO(e.end):void 0,limit:Ei(e.limit)?globalThis.Number(e.limit):0,sku:Ei(e.sku)?globalThis.String(e.sku):"",buyer:Ei(e.buyer)?globalThis.String(e.buyer):"",status:Ei(e.status)?oh(e.status):0,metadata:AO(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},cursor:Ei(e.cursor)?globalThis.String(e.cursor):""}},toJSON(e){let n={};if(e.start!==void 0&&(n.start=e.start.toISOString()),e.end!==void 0&&(n.end=e.end.toISOString()),e.limit!==0&&(n.limit=Math.round(e.limit)),e.sku!==""&&(n.sku=e.sku),e.buyer!==""&&(n.buyer=e.buyer),e.status!==0&&(n.status=ah(e.status)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return e.cursor!==""&&(n.cursor=e.cursor),n},create(e){return hh.fromPartial(e??{})},fromPartial(e){let n=pO();return n.start=e.start??void 0,n.end=e.end??void 0,n.limit=e.limit??0,n.sku=e.sku??"",n.buyer=e.buyer??"",n.status=e.status??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.cursor=e.cursor??"",n}};l.set(hh.$type,hh);function hO(){return{key:"",value:""}}var g3={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=dn.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=hO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ei(e.key)?globalThis.String(e.key):"",value:Ei(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return g3.fromPartial(e??{})},fromPartial(e){let n=hO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(g3.$type,g3);function vO(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var Iu={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=dn.default.Writer.create()){return e.hasNextPage!==!1&&n.uint32(8).bool(e.hasNextPage),e.endCursor!==""&&n.uint32(18).string(e.endCursor),e.hasPreviousPage!==!1&&n.uint32(24).bool(e.hasPreviousPage),e.startCursor!==""&&n.uint32(34).string(e.startCursor),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=vO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.hasNextPage=i.bool();continue;case 2:if(t!==18)break;r.endCursor=i.string();continue;case 3:if(t!==24)break;r.hasPreviousPage=i.bool();continue;case 4:if(t!==34)break;r.startCursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{hasNextPage:Ei(e.hasNextPage)?globalThis.Boolean(e.hasNextPage):!1,endCursor:Ei(e.endCursor)?globalThis.String(e.endCursor):"",hasPreviousPage:Ei(e.hasPreviousPage)?globalThis.Boolean(e.hasPreviousPage):!1,startCursor:Ei(e.startCursor)?globalThis.String(e.startCursor):""}},toJSON(e){let n={};return e.hasNextPage!==!1&&(n.hasNextPage=e.hasNextPage),e.endCursor!==""&&(n.endCursor=e.endCursor),e.hasPreviousPage!==!1&&(n.hasPreviousPage=e.hasPreviousPage),e.startCursor!==""&&(n.startCursor=e.startCursor),n},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let n=vO();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(Iu.$type,Iu);function mO(){return{orders:[],pageInfo:void 0}}var vh={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=dn.default.Writer.create()){for(let i of e.orders)ei.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&Iu.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=mO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orders.push(ei.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=Iu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orders:globalThis.Array.isArray(e?.orders)?e.orders.map(n=>ei.fromJSON(n)):[],pageInfo:Ei(e.pageInfo)?Iu.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>ei.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=Iu.toJSON(e.pageInfo)),n},create(e){return vh.fromPartial(e??{})},fromPartial(e){let n=mO();return n.orders=e.orders?.map(i=>ei.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?Iu.fromPartial(e.pageInfo):void 0,n}};l.set(vh.$type,vh);function kO(){return{orderId:""}}var mh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=dn.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=kO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orderId=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orderId:Ei(e.orderId)?globalThis.String(e.orderId):""}},toJSON(e){let n={};return e.orderId!==""&&(n.orderId=e.orderId),n},create(e){return mh.fromPartial(e??{})},fromPartial(e){let n=kO();return n.orderId=e.orderId??"",n}};l.set(mh.$type,mh);function yO(){return{}}var kh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=dn.default.Writer.create()){return n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=yO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return kh.fromPartial(e??{})},fromPartial(e){return yO()}};l.set(kh.$type,kh);function SO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function yh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function wO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):yh(de.fromJSON(e))}function AO(e){return typeof e=="object"&&e!==null}function Ei(e){return e!=null}var wU=e=>{switch(e){case Mn.ALL:return ai.ALL;case Mn.REMOTE:return ai.REMOTE;case Mn.LOCAL:return ai.LOCAL;case Mn.UNRECOGNIZED:return ai.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},dd=class{constructor(n){this.scope=n.scope?wU(n.scope):ai.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},u6=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new dd(i)),n.state&&(this.state=n.state)}},b3=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new dd(i)),n.state&&(this.state=n.state)}};function CO(){var r,t;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(r=globalThis.devvit).debug??(r.debug={});let n={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},i={};for(let s in n)i[s.toLowerCase()]=s;let d=[...e.searchParams].find(([s])=>s.toLowerCase()==="devvitdebug")?.[1];if(d!=null){d===""&&(d=Object.keys(n).filter(s=>s!=="emitSnapshots"&&s!=="emitState").join());for(let s of d.split(",")??[]){let[f,c]=s.split("=");f&&(f.toLowerCase()in i?f=i[f.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${f}"`),(t=globalThis.devvit.debug)[f]??(t[f]=c||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var od;(function(e){e.ENABLE_APP_LOGGING="enableAppLogging",e.ENABLE_DEBUG_LOGGING="enableDebugLogging",e.ENABLE_PLUGINS="enablePlugins",e.LOAD_BUNDLE="loadBundle",e.CALL="call",e.PLUGIN_RESPONSE="pluginResponse",e.QUIT="quit"})(od||(od={}));var Ir;(function(e){e.READY="ready",e.PLUGINS_CONFIGURED="pluginsConfigured",e.BUNDLE_LOADED="bundleLoaded",e.BUNDLE_LOAD_FAILED="bundleLoadFailed",e.RETURN="return",e.ERROR="error",e.CIRCUIT_BREAKER="circuitBreaker",e.PLUGIN_CALL="pluginCall",e.UNHANDLED_REJECTION="unhandledRejection"})(Ir||(Ir={}));function Sh(e){return e.hostname.split(".")[1]??e.hostname}function gO(e){return`${Sh(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Gi=P(F(),1);function bO(){return{callState:void 0,connect:void 0}}var wh={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Gi.default.Writer.create()){return e.callState!==void 0&&Eu.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&Ou.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=bO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=Eu.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=Ou.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:l6(e.callState)?Eu.fromJSON(e.callState):void 0,connect:l6(e.connect)?Ou.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=Eu.toJSON(e.callState)),e.connect!==void 0&&(n.connect=Ou.toJSON(e.connect)),n},create(e){return wh.fromPartial(e??{})},fromPartial(e){let n=bO();return n.callState=e.callState!==void 0&&e.callState!==null?Eu.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?Ou.fromPartial(e.connect):void 0,n}};l.set(wh.$type,wh);function TO(){return{appInstalled:void 0}}var T3={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Gi.default.Writer.create()){return e.appInstalled!==void 0&&xu.encode(e.appInstalled,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=TO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.appInstalled=xu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:l6(e.appInstalled)?xu.fromJSON(e.appInstalled):void 0}},toJSON(e){let n={};return e.appInstalled!==void 0&&(n.appInstalled=xu.toJSON(e.appInstalled)),n},create(e){return T3.fromPartial(e??{})},fromPartial(e){let n=TO();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?xu.fromPartial(e.appInstalled):void 0,n}};l.set(T3.$type,T3);function RO(){return{}}var xu={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Gi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=RO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return xu.fromPartial(e??{})},fromPartial(e){return RO()}};l.set(xu.$type,xu);function NO(){return{logs:[]}}var Eu={$type:"devvit.cli.PlaytestCallState",encode(e,n=Gi.default.Writer.create()){for(let i of e.logs)mt.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=NO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.logs.push(mt.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(n=>mt.fromJSON(n)):[]}},toJSON(e){let n={};return e.logs?.length&&(n.logs=e.logs.map(i=>mt.toJSON(i))),n},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let n=NO();return n.logs=e.logs?.map(i=>mt.fromPartial(i))||[],n}};l.set(Eu.$type,Eu);function IO(){return{url:""}}var Ou={$type:"devvit.cli.PlaytestConnect",encode(e,n=Gi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=IO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.url=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{url:l6(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let n=IO();return n.url=e.url??"",n}};l.set(Ou.$type,Ou);function l6(e){return e!=null}var Ah="playtest",xO="ws://localhost:5678";function EO(e){let n=Ch();return n===""||n===e}function Ch(){return globalThis.location?new URL(location.href).searchParams.get(Ah)??void 0:void 0}var Dn=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},R3=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},N3,Hn,gh,OO,bh,Th,Rh,Nh,AU=15e3,s6=class{constructor(){N3.add(this),Hn.set(this,{type:"Init"}),bh.set(this,()=>{Dn(this,Hn,"f").type==="Opened"&&this.onState?.("Closed"),R3(this,Hn,Dn(this,N3,"m",OO).call(this),"f")}),Th.set(this,n=>{let i=T3.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),Rh.set(this,()=>{if(Dn(this,Hn,"f").type!=="Opening")throw Error(`invalid transition from ${Dn(this,Hn,"f").type}`);this.onState?.("Opened"),R3(this,Hn,{sock:Dn(this,Hn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),Nh.set(this,()=>{R3(this,Hn,Dn(this,N3,"m",gh).call(this),"f")})}close(){"timer"in Dn(this,Hn,"f")&&clearTimeout(Dn(this,Hn,"f").timer),"sock"in Dn(this,Hn,"f")&&(Dn(this,Hn,"f").sock.onopen=null,Dn(this,Hn,"f").sock.onmessage=null,Dn(this,Hn,"f").sock.onclose=null,Dn(this,Hn,"f").sock.close()),R3(this,Hn,{type:"Init"},"f")}open(){Dn(this,Hn,"f").type==="Init"&&R3(this,Hn,Dn(this,N3,"m",gh).call(this),"f")}send(n){"sock"in Dn(this,Hn,"f")?Dn(this,Hn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Hn=new WeakMap,bh=new WeakMap,Th=new WeakMap,Rh=new WeakMap,Nh=new WeakMap,N3=new WeakSet,gh=function(){let n=new WebSocket(xO);return n.onclose=Dn(this,bh,"f"),n.onmessage=Dn(this,Th,"f"),n.onopen=Dn(this,Rh,"f"),{sock:n,type:"Opening"}},OO=function(){return{timer:setTimeout(Dn(this,Nh,"f"),AU),type:"Retrying"}};var ui=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},ve=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Zd,f6,li,ds,c6,x3,ad,$o,os,us,Wo,Ih,I3,p6,xh,PO,as,Eh,Oh,CU={debug:En.DEBUG,error:En.ERROR,info:En.INFO,log:En.DEBUG,trace:En.DEBUG,warn:En.WARN},h6=class{constructor(n,i,d){Zd.add(this),f6.set(this,void 0),li.set(this,void 0),ds.set(this,!1),c6.set(this,0),x3.set(this,void 0),ad.set(this,{}),$o.set(this,void 0),os.set(this,()=>{}),us.set(this,void 0),Wo.set(this,void 0),Ih.set(this,Ch()),I3.set(this,!1),p6.set(this,void 0),xh.set(this,r=>{let t=r.data,[s]=t;switch(s){case Ir.READY:{let[,f]=t;ui(this,p6,f,"f"),ve(this,us,"f")?.plugins?ve(this,Zd,"m",PO).call(this):ve(this,Zd,"m",Eh).call(this);break}case Ir.PLUGINS_CONFIGURED:ve(this,Zd,"m",Eh).call(this);break;case Ir.BUNDLE_LOADED:{let[,f,c]=t;ve(this,Zd,"m",as).call(this,f),ui(this,ds,!0,"f"),ve(this,$o,"f")?.resolve({metrics:{init:ve(this,p6,"f"),loadBundle:c}}),ui(this,$o,void 0,"f");break}case Ir.BUNDLE_LOAD_FAILED:{let[,,f,c]=t;ve(this,Zd,"m",as).call(this,c),ve(this,$o,"f")?.reject(f),ui(this,$o,void 0,"f");break}case Ir.RETURN:{let[,f,c,v]=t;ve(this,Zd,"m",as).call(this,v),ve(this,ad,"f")[f]?.resolve(c),delete ve(this,ad,"f")[f];break}case Ir.ERROR:{let[,f,c,v]=t;ve(this,Zd,"m",as).call(this,v),ve(this,ad,"f")[f]?.reject(c),delete ve(this,ad,"f")[f];break}case Ir.CIRCUIT_BREAKER:{let[,f,c,v]=t;ve(this,ad,"f")[f]?.reject(new b4(c,v)),delete ve(this,ad,"f")[f];break}case Ir.PLUGIN_CALL:{let[,f,c,v,w,b]=t;ve(this,us,"f")?.callback(f,c,v,w,b);break}case Ir.UNHANDLED_REJECTION:{let[,,f,c]=t;ve(this,Zd,"m",as).call(this,c),ve(this,os,"f").call(this,"UnhandledRejection",f);break}}}),Oh.set(this,r=>{switch(r){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),ve(this,Wo,"f")?.close();let t=new URL(location.href);t.searchParams.set(Ah,ve(this,Ih,"f")??""),location.assign(t),location.reload();break}}}),ui(this,f6,n,"f"),i&&ui(this,os,i,"f"),d&&ui(this,us,d,"f")}get ready(){return ve(this,ds,"f")}get runtimeDebugLogging(){return ve(this,I3,"f")}set runtimeDebugLogging(n){n!==ve(this,I3,"f")&&(ui(this,I3,n,"f"),this.runtimeDebugLogging&&ve(this,li,"f")?.postMessage([od.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(ve(this,li,"f"))throw new Error("Bundle already loaded");let i=EO(Sh(n));i&&(ui(this,Wo,new s6,"f"),ve(this,Wo,"f").onState=ve(this,Oh,"f")),ve(this,Wo,"f")?.open();let d=new Worker(URL.createObjectURL(ve(this,f6,"f")),{name:`App: ${gO(n)}`,type:"module"});return d.onerror=r=>ve(this,os,"f").call(this,"Error",r.error),d.onmessageerror=r=>ve(this,os,"f").call(this,"MessageError",r.data),d.onmessage=ve(this,xh,"f"),ui(this,li,d,"f"),ui(this,x3,n,"f"),this.runtimeDebugLogging&&ve(this,li,"f").postMessage([od.ENABLE_DEBUG_LOGGING]),i&&ve(this,li,"f").postMessage([od.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ui(this,$o,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!ve(this,ds,"f")||!ve(this,li,"f"))throw new Error("No bundle loaded");let t=ui(this,c6,(r=ve(this,c6,"f"),++r),"f"),s=new Promise((f,c)=>{ve(this,ad,"f")[t]={resolve:f,reject:c}});return ve(this,li,"f").postMessage([od.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){ve(this,li,"f")?.postMessage([od.PLUGIN_RESPONSE,n,i])}quit(){ve(this,Wo,"f")?.close(),ui(this,Wo,void 0,"f"),ui(this,ds,!1,"f"),ve(this,li,"f")&&(ve(this,li,"f").postMessage([od.QUIT]),ve(this,li,"f").onerror=null,ve(this,li,"f").onmessageerror=null,ve(this,li,"f").onmessage=null,ve(this,li,"f").terminate()),ui(this,li,void 0,"f");for(let{reject:n}of Object.values(ve(this,ad,"f")))n(Error("worker terminated"));ui(this,ad,{},"f"),ve(this,$o,"f")?.reject(Error("worker terminated")),ui(this,$o,void 0,"f")}};f6=new WeakMap,li=new WeakMap,ds=new WeakMap,c6=new WeakMap,x3=new WeakMap,ad=new WeakMap,$o=new WeakMap,os=new WeakMap,us=new WeakMap,Wo=new WeakMap,Ih=new WeakMap,I3=new WeakMap,p6=new WeakMap,xh=new WeakMap,Oh=new WeakMap,Zd=new WeakSet,PO=function(){ve(this,li,"f")?.postMessage([od.ENABLE_PLUGINS,ve(this,us,"f")?.plugins??[]])},as=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:CU[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};ve(this,Wo,"f")?.send({callState:d})},Eh=function(){ve(this,li,"f")?.postMessage([od.LOAD_BUNDLE,ve(this,x3,"f")]),ui(this,x3,void 0,"f")};var Ph="RenderPostContent",gU=new Set([Ph]);function MO(e){if(gU.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var ls,E3,v6=class{constructor(n){we(this,ls);we(this,E3);Be(this,ls,n)}set env(n){Be(this,ls,n)}set props(n){Be(this,E3,n)}build(n,i){return new u6({state:n,events:i.map(d=>d.uiEvent),env:N(this,ls),props:N(this,E3)})}};ls=new WeakMap,E3=new WeakMap;var bt,O3,y6,m6=class{constructor(){we(this,bt);we(this,O3,!1);we(this,y6,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===nl.fullName&&d===nl.methods.send.name&&N(this,bt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!N(this,bt)?.ready}set runtimeDebugLogging(n){Be(this,O3,n),N(this,bt)&&(N(this,bt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),Be(this,bt,n?new h6(n,(i,d)=>console.error(i,d),{callback:N(this,y6),plugins:[]}):void 0),N(this,bt)&&(N(this,bt).runtimeDebugLogging=N(this,O3))}unload(){N(this,bt)?.quit()}async load(n){this.unload();try{return await N(this,bt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!N(this,bt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),N(this,bt)?.call(MO(n),i.uiRequest,this.metadata).then(t=>d(new b3(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};bt=new WeakMap,O3=new WeakMap,y6=new WeakMap;var k6=class{isReady(){return!!this.remote}load(n){this.remote=n}handle(n,i,d,r){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[MO(n)](i.uiRequest,this.metadata).then(t=>d(new b3(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var Go,zo,P3,S6=class{constructor(n){we(this,Go,new Map);we(this,zo,new Map);we(this,P3);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),Be(this,P3,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),N(this,zo).set(n.id,n),N(this,Go).set(n.id,window.setInterval(()=>{N(this,P3).submit([new dd({scope:Mn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(N(this,zo));n.forEach(d=>{i.delete(d.id),N(this,zo).has(d.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",d),this.add(d))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",i);for(let[d]of i)this.remove(d)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let n of N(this,Go).values())clearInterval(n);N(this,Go).clear(),N(this,zo).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...N(this,zo).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of N(this,Go).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),N(this,zo).delete(n),clearInterval(N(this,Go).get(n)),N(this,Go).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};Go=new WeakMap,zo=new WeakMap,P3=new WeakMap;var _O=e=>e.message==="ServerCallRequired",Mh=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){_O(n[0])||console.error(this.tag(),...n)}info(n){console.info(this.tag(),...n)}warn(n){console.warn(this.tag(),...n)}tag(){return"[kmp-dispatcher]"}},M3,_3,_h=class{constructor(n,i){we(this,M3);we(this,_3);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};Be(this,M3,n),Be(this,_3,i)}logRuntimeError(n){var i;_O(n)||(console.error("[kmp-dispatcher-perf-analytics] error",n),(i=N(this,_3))==null||i.call(this,n))}logRuntimeTrace(n){var i;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n),(i=N(this,M3))==null||i.call(this,n)}};M3=new WeakMap,_3=new WeakMap;CO();var bU=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},TU=["showToast","showForm","navigateToUrl","createOrder"],Ol,Pl,xr,B3,Ml,ud,ss,w6=class{constructor(n,i,d){we(this,Ol);we(this,Pl);we(this,xr);we(this,B3);this.hasRendered=!1;we(this,Ml);we(this,ud);we(this,ss);Be(this,Ol,new v6(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),Be(this,xr,new t6(n??{},N(this,Ol),Ph,{logger:new Mh,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new _h(d.performanceTracker,d.errorTracker),errorHandler:r=>this.onError?.(r)})),Be(this,Pl,new S6(N(this,xr))),Be(this,Ml,new k6),Be(this,ud,new m6),this.init()}get state(){return N(this,xr).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[ku.Debug]={values:d}),N(this,ud).metadata=i,N(this,Ml).metadata=i}set onPluginCall(n){N(this,ud).onPluginCall=n}set runtimeDebugLogging(n){N(this,ud).runtimeDebugLogging=n}subscribe(n){Be(this,B3,N(this,xr).subscribe((...i)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",i[0]);let[{response:d}]=i;d.uiResponse.effects.forEach(r=>{if(TU.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&N(this,Pl).clear(),N(this,Pl).apply(t.map(([s,f])=>new dt(s,bU(f.duration))));return}if(r.webView){this.onWebViewMessage?.(r);return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(r,null,2)}`)}),n(...i)}))}submit(...n){N(this,xr).submit(...n)}unsubscribe(){N(this,B3)?.unsubscribe()}init(){N(this,xr).init(N(this,ud),N(this,Ml),N(this,Pl))}togglePause(n){n?Be(this,ss,N(this,xr).pause()):N(this,ss)&&N(this,xr).resume(N(this,ss))}resetAppState(){this.hasRendered=!1,N(this,xr).reset()}setEnv(n){N(this,Ol).env=n}setProps(n){N(this,Ol).props=n}remoteLoad(...n){N(this,Ml).load(...n)}async localLoad(...n){return N(this,ud).reset(),await N(this,ud).load(...n)}localLoadWorker(...n){N(this,ud).setLocalSrc(...n)}};Ol=new WeakMap,Pl=new WeakMap,xr=new WeakMap,B3=new WeakMap,Ml=new WeakMap,ud=new WeakMap,ss=new WeakMap;function BO(e,n,i,d){let r=d.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(r.length<3)return"";let[t,s,f]=r;if(!n||!s||!f)return"";let c=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",c).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var _l,Bl,Ll,Mu,L3,cn,A6,C6,g6,b6,Vd,Pu,T6,R6,Ti=class extends dr{constructor(){super();we(this,Vd);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.disableAssetSandbox=!1;we(this,_l);we(this,Bl);we(this,Ll);we(this,Mu,"");we(this,L3,!1);we(this,cn);we(this,A6,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:i=>this.disableAssetSandbox?i:BO(this.webViewUrlTemplate,this.metadata?.[ku.Subreddit]?.values?.[0],N(this,Mu),i),onAction:i=>{let d={};i.type===Bi.ACTION_CLICK||N(this,L3)?d.userAction={actionId:i.id,data:i.data??{}}:i.type===Bi.ACTION_WEBVIEW&&(d.webView={postMessage:{message:i.data}}),N(this,cn)?.submit([new dd({scope:Mn.ALL,hook:i.id,...d})])},stackDirection:Te.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));we(this,C6,i=>{TI(i)||console.error(i),pn(this,Vd,Pu).call(this,"devvit-ui-error",{err:i,type:"Error"})});we(this,g6,(i,d,r,t,s)=>{d===nl.fullName&&r===nl.methods.send.name&&pn(this,Vd,Pu).call(this,"devvit-realtime-send",{event:t})});we(this,b6,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,N(this,_l)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=N(this,_l)):Be(this,_l,this._rootBlock.config?.rootConfig?.height||r8))});we(this,T6,i=>{pn(this,Vd,Pu).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>N(this,cn)?.submit([new dd(d)]),metadata:this.metadata})});we(this,R6,async i=>{if(await this.updateComplete,i.webView?.postMessage?.app&&i.webView.postMessage.webViewId){let d=this._blocksRenderer?.findBlockById(i.webView.postMessage.webViewId);d?.blockType!=="web-view"||!d?.element?console.error("Invalid postMessage request: could not find block with ID",i.webView.postMessage.webViewId):d.element.postMessage(i.webView.postMessage.app)}});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[v4]}async connectedCallback(){super.connectedCallback(),Be(this,cn,new w6({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[ku.Language]?.values?.[0],timezone:this.metadata?.[ku.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:i=>{pn(this,Vd,Pu).call(this,gN,{name:i.spanName,duration:parseInt(i.durationMs),target:i.target,intent:i.intent,eventCount:i.eventCount})},errorTracker:i=>{pn(this,Vd,Pu).call(this,bN,{message:i.message,origin:i.origin,version:i.version})}})),N(this,cn).onPluginCall=N(this,g6),N(this,cn).onError=N(this,C6),N(this,cn).onUserAction=N(this,T6),N(this,cn).onWebViewMessage=N(this,R6),N(this,cn).subscribe(i=>{N(this,b6).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),Be(this,Bl,new ResizeObserver(NI(i=>{i.length!==0&&(this.dimensions=ex(i[0],window,document.body))},600))),N(this,Bl).observe(this,{box:"content-box"}),Be(this,Ll,new IntersectionObserver(i=>{i.forEach(d=>{N(this,cn)?.togglePause(!d.isIntersecting)})})),N(this,Ll).observe(this)}disconnectedCallback(){N(this,Bl)?.unobserve(this),N(this,Bl)?.disconnect(),N(this,Ll)?.unobserve(this),N(this,Ll)?.disconnect(),N(this,cn)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?Nt`<div class="relative">
625
+ </div>`}else return r}var Kc,Xc,g4,Cl=class extends dr{constructor(){super(...arguments);we(this,Kc,window.matchMedia("(prefers-color-scheme: dark)"));we(this,Xc,()=>this.requestUpdate());we(this,g4,()=>({stackDirection:Te.UNRECOGNIZED}))}static get styles(){return[v4]}connectedCallback(){super.connectedCallback(),N(this,Kc)?.addEventListener("change",N(this,Xc))}disconnectedCallback(){super.disconnectedCallback(),N(this,Kc)?.removeEventListener("change",N(this,Xc))}async getUpdateComplete(){let i=await super.getUpdateComplete(),d=this.renderRoot.querySelectorAll("[data-block-type]");for(let r=0;r<d.length;r++)await d.item(r).updateComplete;return i}reset(){this.renderRoot.querySelectorAll("[data-block-type]").forEach(d=>{d.reset?.()})}findBlockById(i){let d=this.renderRoot.querySelector(`#${i}[data-block-type]`);if(d)return{blockType:d.dataset.blockType,element:d}}findBlocksByType(i){return Array.from(this.renderRoot.querySelectorAll(`[data-block-type=${i}]`)).map(d=>({blockType:i,element:d}))}render(){if(this.block&&this.block.type===pe.BLOCK_ROOT){let i={...N(this,g4).call(this),...this.renderContext?.()??{}},d=new h4,r=d8(this.block,i);return d.finish(),this.dispatchEvent(O0(Jc,{name:"blocks_layout",duration:d.duration})),Nt` <div class="${Ko(this.class)}">${r}</div>`}return Nt`${CN({creative:Nt`<slot name="empty-state-image"></slot>`,title:zp("Whoops!",{desc:"Header for message to display when rendering fails"}),description:zp("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};Kc=new WeakMap,Xc=new WeakMap,g4=new WeakMap,Ge([_n({attribute:!1})],Cl.prototype,"block",2),Ge([_n({attribute:!1})],Cl.prototype,"renderContext",2),Ge([_n()],Cl.prototype,"class",2),Cl=Ge([wN(),P0("devvit-blocks-renderer")],Cl);var bI="ServerCallRequired";var b4=class extends Error{constructor(n,i){super(bI),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function TI(e){return e?.message===bI}var ku=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",Debug:"devvit-debug",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",Post:"devvit-post",PostAuthor:"devvit-post-author",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",SubredditName:"devvit-subreddit-name",TraceID:"devvit-trace-id",User:"devvit-user",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies"}),RI;(function(e){e.Blocks="blocks",e.EmitSnapshots="emitSnapshots",e.EmitState="emitState",e.Realtime="realtime",e.Runtime="runtime",e.Surface="surface",e.UseAsync="useAsync",e.Payments="payments",e.Bootstrap="bootstrap",e.WebView="webView"})(RI||(RI={}));function NI(e,n){let i,d=0,r;return function(...t){return r=t,i??(i=setTimeout(()=>{d=Date.now(),i=void 0;let s=r;r=void 0,e.apply(this,s)},Math.max(0,n-(Date.now()-d)))),()=>{i!=null&&clearTimeout(i),i=void 0,r=void 0}}}function II(e,n){if(!e)throw Error(n)}var T4;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(T4||(T4={}));function wB(e){return e.startsWith(T4.LINK)}function AB(e){II(wB(e),`Expected link id to start with ${T4.LINK}, got ${e}}`)}function xI(e){return AB(e),e}var LO=P(zI(),1),FO=P(jI(),1);function ex(e,n,i){let{width:d,height:r}=e.contentRect,s=n.getComputedStyle(i).fontSize.split("px")[0],f=s?parseFloat(s)/16:1;return{width:Math.round(d),height:Math.round(r),scale:n.devicePixelRatio,fontScale:f}}typeof ArrayBuffer.isView>"u"&&(ArrayBuffer.isView=function(e){return e!=null&&e.__proto__!=null&&e.__proto__.__proto__===Int8Array.prototype.__proto__});typeof Array.prototype.fill>"u"&&Object.defineProperty(Array.prototype,"fill",{value:function(e){if(this==null)throw new TypeError("this is null or not defined");for(var n=Object(this),i=n.length>>>0,d=arguments[1],r=d>>0,t=r<0?Math.max(i+r,0):Math.min(r,i),s=arguments[2],f=s===void 0?i:s>>0,c=f<0?Math.max(i+f,0):Math.min(f,i);t<c;)n[t]=e,t++;return n}});[Int8Array,Int16Array,Uint16Array,Int32Array,Float32Array,Float64Array].forEach(function(e){typeof e.prototype.fill>"u"&&Object.defineProperty(e.prototype,"fill",{value:Array.prototype.fill})});typeof Math.clz32>"u"&&(Math.clz32=function(e,n){return function(i){var d=i>>>0;return d===0?32:31-(e(d)/n|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(n,i){return(n&4294901760)*(i&65535)+(n&65535)*(i|0)|0});var kx=Math.clz32,k8=ArrayBuffer.isView,An=Math.imul;q(x8,"CharSequence",qo);q(E8,"Number",ue);q(O8,"Unit",oi);q(D0,"IntCompanionObject",oi);q(rt,"Collection",qo);q(Zo,"AbstractCollection",ue,U,[rt]);q(Yr,"AbstractMutableCollection",ue,Zo,[Zo,rt]);q(e3,"IteratorImpl",ue);q(W0,"List",qo,U,[rt]);q(br,"AbstractMutableList",ue,Yr,[Yr,rt,W0]);q(Uo,"Map",qo);q(Tr,"AbstractMap",ue,U,[Uo]);q(F0,"AbstractMutableMap",ue,Tr,[Tr,Uo]);q(U4,"Set",qo,U,[rt]);q(U0,"AbstractMutableSet",ue,Yr,[Yr,rt,U4]);q(Ax,"Companion",oi);q(Yn,"ArrayList",ue,br,[br,rt,W0],Vo);q(Qr,"HashMap",ue,F0,[F0,Uo],oL);q(Rr,"HashMapEntrySetBase",ue,U0,[rt,U4,U0]);q(_8,"HashMapEntrySet",ue,Rr);q(xx,"Companion",oi);q(bl,"Itr",ue);q(i3,"EntriesItr",ue,bl);q(Fo,"Entry",qo);q(Tl,"EntryRef",ue,U,[Fo]);function GB(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o(),t=r,s;if(t!=null&&Xn(t,Fo)?s=this.w3(t):s=!1,!s){n=!1;break e}}n=!0}return n}q(Ex,"InternalMap",qo);q(Hi,"InternalHashMap",ue,U,[Ex],Nx);q(F4,"LinkedHashMap",ue,Qr,[Qr,Uo],t3);q(ed,"StringBuilder",ue,U,[x8],F8);q(Lx,"Companion",oi);q(Fx,"Char",ue);q(Ux,"Companion",oi);q(gt,"Enum",ue);q(Z4,U,ue);q(Kx,"Companion",oi);q(Me,"Long",ue,E8);q(Jo,"Exception",ue,Error,U,aE);q(Di,"RuntimeException",ue,Jo,U,cE);q(Y0,"IllegalArgumentException",ue,Di,U,lE);q(j0,"IndexOutOfBoundsException",ue,Di,U,sE);q(es,"IllegalStateException",ue,Di,U,fE);q(q4,"UnsupportedOperationException",ue,Di,U,ns);q(is,"NoSuchElementException",ue,Di,U,Au);q(J4,"ConcurrentModificationException",ue,Di,U,H8);q(ts,"ArithmeticException",ue,Di,U,hE);q(H4,"NullPointerException",ue,Di,U,D8);q(D4,"ClassCastException",ue,Di,U,$8);q(rs,"UninitializedPropertyAccessException",ue,Di,U,mE);q(Cu,"Companion",oi);q(SE,"Companion",oi);q($4,"Companion",oi);q(AE,"Companion",oi);q(Bn,"ArrayDeque",ue,br,U,u3);q(rd,"EmptyList",oi,U,[W0]);q(W4,"EmptyIterator",oi);q(Ho,"ArrayAsCollection",ue,U,[rt]);q(G4,"IntIterator",ue);q(gE,"Companion",oi);q(Bd,"IntProgression",ue);q(wu,"IntRange",ue,Bd);q(z4,"IntProgressionIterator",ue,G4);q(K8,"Companion",oi);q(Ct,"Pair",ue);function x8(){}function E8(){}function O8(){}p(O8).toString=function(){return"kotlin.Unit"};var qe;function D0(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}p(D0).c=function(){return this.MIN_VALUE};p(D0).d=function(){return this.MAX_VALUE};p(D0).e=function(){return this.SIZE_BYTES};p(D0).f=function(){return this.SIZE_BITS};var P8;function zB(e){return e!==e}function KB(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-kx(e)|0)}return n}function yx(e){return $F(e)}function XB(e,n){return n}function YB(e,n){return G0(Array(n),null)}function _4(e){return zF([e])}function $0(e){var n;return e.toArray!==void 0?n=e.toArray():n=yx(e),n}function Ve(e,n,i,d,r){tt.h(d,r,e.length);var t=r-d|0;if(tt.h(i,i+t|0,n.length),k8(n)&&k8(e)){var s=e.subarray(d,r);n.set(s,i)}else if(e!==n||i<=d){var f=0;if(f<t)do{var c=f;f=f+1|0,n[i+c|0]=e[d+c|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var w=v;v=v+-1|0,n[i+w|0]=e[d+w|0]}while(0<=v)}}function QB(e){return e<0&&KF(),e}function Yr(){Zo.call(this)}p(Yr).j=function(e){this.k();for(var n=this.l();n.m();)if(Je(n.o(),e))return n.n(),!0;return!1};p(Yr).p=function(e){this.k();for(var n=!1,i=e.l();i.m();){var d=i.o();this.i(d)&&(n=!0)}return n};p(Yr).toJSON=function(){return this.toArray()};p(Yr).k=function(){};function e3(e){this.w_1=e,this.u_1=0,this.v_1=-1}p(e3).m=function(){return this.u_1<this.w_1.q()};p(e3).o=function(){if(!this.m())throw Au();var e=this,n=this.u_1;return this.u_1=n+1|0,e.v_1=n,this.w_1.x(this.v_1)};p(e3).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw o3(nd(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function br(){Yr.call(this),this.y_1=0}p(br).i=function(e){return this.k(),this.a1(this.q(),e),!0};p(br).l=function(){return new e3(this)};p(br).r=function(e){return this.b1(e)>=0};p(br).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Je(r,e)){n=i;break e}i=i+1|0}n=-1}return n};p(br).equals=function(e){return e===this?!0:e!=null&&Xn(e,W0)?tt.c1(this,e):!1};p(br).hashCode=function(){return tt.d1(this)};function F0(){Tr.call(this),this.g1_1=null,this.h1_1=null}p(F0).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Je(e,d)){var r=i.m1();return n.n(),r}}return null};p(F0).k=function(){};function U0(){Yr.call(this)}p(U0).equals=function(e){return e===this?!0:e!=null&&Xn(e,U4)?W8.s1(this,e):!1};p(U0).hashCode=function(){return W8.t1(this)};function Sx(e){if(!(e>=0)){var n="capacity must be non-negative.";throw jr(nd(n))}return G0(Array(e),null)}function wx(e,n){e[n]=null}function nx(e,n,i){e.fill(null,n,i)}function ix(e,n){return CF(e,n)}function Ax(){y8=this;var e=this,n=M8(0);n.w1_1=!0,e.x1_1=n}var y8;function jB(){return y8==null&&new Ax,y8}function eL(e){var n=[];return Yn.call(e,n),e}function Vo(){return eL(Qe(p(Yn)))}function nL(e,n){var i=[];if(Yn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw jr(nd(d))}return n}function M8(e){return nL(e,Qe(p(Yn)))}function iL(e,n){var i=$0(e);return Yn.call(n,i),n}function Cx(e){return iL(e,Qe(p(Yn)))}function tL(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function gx(e,n){return tt.y1(n,e.q()),n}function rL(e,n){return tt.z1(n,e.q()),n}function Yn(e){jB(),br.call(this),this.v1_1=e,this.w1_1=!1}p(Yn).q=function(){return this.v1_1.length};p(Yn).x=function(e){var n=this.v1_1[gx(this,e)];return n==null||n!=null?n:an()};p(Yn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};p(Yn).a1=function(e,n){this.k(),this.v1_1.splice(rL(this,e),0,n),this.y_1=this.y_1+1|0};p(Yn).p=function(e){if(this.k(),e.t())return!1;for(var n=tL(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=QB(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};p(Yn).z=function(e){this.k(),gx(this,e),this.y_1=this.y_1+1|0;var n;return e===M4(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};p(Yn).j=function(e){this.k();var n=0,i=this.v1_1.length-1|0;if(n<=i)do{var d=n;if(n=n+1|0,Je(this.v1_1[d],e))return this.v1_1.splice(d,1),this.y_1=this.y_1+1|0,!0}while(n<=i);return!1};p(Yn).b1=function(e){return Mx(this.v1_1,e)};p(Yn).toString=function(){return ZL(this.v1_1)};p(Yn).a2=function(){return[].slice.call(this.v1_1)};p(Yn).toArray=function(){return this.a2()};p(Yn).k=function(){if(this.w1_1)throw ns()};function dL(e,n){return F0.call(n),Qr.call(n),n.f2_1=e,n}function bx(e){return dL(Nx(),e),e}function oL(){return bx(Qe(p(Qr)))}p(Qr).p1=function(e){return this.f2_1.h2(e)};p(Qr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new _8(this.f2_1);this.g2_1=i,n=i}else n=e;return n};p(Qr).r1=function(e){return this.f2_1.r1(e)};p(Qr).i1=function(e,n){return this.f2_1.i1(e,n)};p(Qr).j1=function(e){return this.f2_1.j1(e)};p(Qr).q=function(){return this.f2_1.q()};function Qr(){this.g2_1=null}function _8(e){Rr.call(this,e)}p(_8).l=function(){return this.j2_1.k2()};function Rr(e){U0.call(this),this.j2_1=e}p(Rr).q=function(){return this.j2_1.q()};p(Rr).t=function(){return this.j2_1.q()===0};p(Rr).l2=function(e){return this.j2_1.n2(e)};p(Rr).r=function(e){return e!=null&&Xn(e,Fo)?this.l2(e!=null&&Xn(e,Fo)?e:an()):!1};p(Rr).m2=function(e){throw ns()};p(Rr).i=function(e){return this.m2(e!=null&&Xn(e,Fo)?e:an())};p(Rr).p=function(e){throw ns()};p(Rr).s=function(e){return this.j2_1.o2(e)};p(Rr).k=function(){return this.j2_1.k()};function Tx(e,n){return KB(An(x4(n,1),3))}function Rx(e,n){return kx(n)+1|0}function aL(e){return uL(8,e),e}function Nx(){return aL(Qe(p(Hi)))}function uL(e,n){return Hi.call(n,Sx(e),null,new Int32Array(e),new Int32Array(Tx(n3,e)),2,0),n}function Z0(e){return e.p2_1.length}function er(e){return e.s2_1.length}function B8(e){e.w2_1=e.w2_1+1|0}function lL(e,n){sL(e,n)?L8(e,er(e)):fL(e,e.u2_1+n|0)}function sL(e,n){var i=Z0(e)-e.u2_1|0,d=e.u2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(Z0(e)/4|0):!1}function fL(e,n){if(n<0)throw pE("too many elements");if(n>Z0(e)){var i=tt.z2(Z0(e),n);e.p2_1=ix(e.p2_1,i);var d=e,r=e.q2_1;d.q2_1=r==null?null:ix(r,i),e.r2_1=AF(e.r2_1,i);var t=Tx(n3,i);t>er(e)&&L8(e,t)}}function cL(e){var n=e.q2_1;if(n!=null)return n;var i=Sx(Z0(e));return e.q2_1=i,i}function B4(e,n){return n==null?0:An(Jn(n),-1640531527)>>>e.v2_1|0}function pL(e){for(var n=0,i=0,d=e.q2_1;n<e.u2_1;)e.r2_1[n]>=0&&(e.p2_1[i]=e.p2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;nx(e.p2_1,i,e.u2_1),d==null||nx(d,i,e.u2_1),e.u2_1=i}function L8(e,n){B8(e),e.u2_1>e.x2_1&&pL(e),n!==er(e)?(e.s2_1=new Int32Array(n),e.v2_1=Rx(n3,n)):SF(e.s2_1,0,0,er(e));for(var i=0;i<e.u2_1;){var d=i;if(i=d+1|0,!hL(e,d))throw o3("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function hL(e,n){for(var i=B4(e,e.p2_1[n]),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return e.s2_1[i]=n+1|0,e.r2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=er(e)-1|0)}}function L4(e,n){for(var i=B4(e,n),d=e.t2_1;;){var r=e.s2_1[i];if(r===0)return-1;if(r>0&&Je(e.p2_1[r-1|0],n))return r-1|0;if(d=d-1|0,d<0)return-1;var t=i;i=t-1|0,t===0&&(i=er(e)-1|0)}}function vL(e,n){e.k();e:for(;;)for(var i=B4(e,n),d=E4(An(e.t2_1,2),er(e)/2|0),r=0;;){var t=e.s2_1[i];if(t<=0){if(e.u2_1>=Z0(e)){lL(e,1);continue e}var s=e.u2_1;e.u2_1=s+1|0;var f=s;return e.p2_1[f]=n,e.r2_1[f]=i,e.s2_1[i]=f+1|0,e.x2_1=e.x2_1+1|0,B8(e),r>e.t2_1&&(e.t2_1=r),f}if(Je(e.p2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){L8(e,An(er(e),2));continue e}var c=i;i=c-1|0,c===0&&(i=er(e)-1|0)}}function mL(e,n){e.k();var i=L4(e,n);return i<0?-1:(Ix(e,i),i)}function Ix(e,n){wx(e.p2_1,n),kL(e,e.r2_1[n]),e.r2_1[n]=-1,e.x2_1=e.x2_1-1|0,B8(e)}function kL(e,n){for(var i=n,d=n,r=0,t=E4(An(e.t2_1,2),er(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=er(e)-1|0),r=r+1|0,r>e.t2_1)return e.s2_1[d]=0,qe;var f=e.s2_1[i];if(f===0)return e.s2_1[d]=0,qe;if(f<0)e.s2_1[d]=-1,d=i,r=0;else{var c=B4(e,e.p2_1[f-1|0]);((c-i|0)&(er(e)-1|0))>=r&&(e.s2_1[d]=f,e.r2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.s2_1[d]=-1,qe}}function yL(e,n){return e.x2_1===n.q()?e.o2(n.k1()):!1}function xx(){this.a3_1=-1640531527,this.b3_1=8,this.c3_1=2,this.d3_1=-1}var n3;function bl(e){this.e3_1=e,this.f3_1=0,this.g3_1=-1,this.h3_1=this.e3_1.w2_1,this.i3()}p(bl).i3=function(){for(;this.f3_1<this.e3_1.u2_1&&this.e3_1.r2_1[this.f3_1]<0;)this.f3_1=this.f3_1+1|0};p(bl).m=function(){return this.f3_1<this.e3_1.u2_1};p(bl).n=function(){if(this.j3(),this.g3_1===-1){var e="Call next() before removing element from the iterator.";throw o3(nd(e))}this.e3_1.k(),Ix(this.e3_1,this.g3_1),this.g3_1=-1,this.h3_1=this.e3_1.w2_1};p(bl).j3=function(){if(this.e3_1.w2_1!==this.h3_1)throw H8()};function i3(e){bl.call(this,e)}p(i3).o=function(){if(this.j3(),this.f3_1>=this.e3_1.u2_1)throw Au();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=new Tl(this.e3_1,this.g3_1);return this.i3(),i};p(i3).o3=function(){if(this.f3_1>=this.e3_1.u2_1)throw Au();var e=this,n=this.f3_1;this.f3_1=n+1|0,e.g3_1=n;var i=this.e3_1.p2_1[this.g3_1],d=i==null?null:Jn(i),r=d??0,t=K0(this.e3_1.q2_1)[this.g3_1],s=t==null?null:Jn(t),f=r^(s??0);return this.i3(),f};p(i3).p3=function(e){if(this.f3_1>=this.e3_1.u2_1)throw Au();var n=this,i=this.f3_1;this.f3_1=i+1|0,n.g3_1=i;var d=this.e3_1.p2_1[this.g3_1];Je(d,this.e3_1)?e.s3("(this Map)"):e.r3(d),e.t3(61);var r=K0(this.e3_1.q2_1)[this.g3_1];Je(r,this.e3_1)?e.s3("(this Map)"):e.r3(r),this.i3()};function Tl(e,n){this.u3_1=e,this.v3_1=n}p(Tl).l1=function(){return this.u3_1.p2_1[this.v3_1]};p(Tl).m1=function(){return K0(this.u3_1.q2_1)[this.v3_1]};p(Tl).equals=function(e){var n,i;return e!=null&&Xn(e,Fo)?i=Je(e.l1(),this.l1()):i=!1,i?n=Je(e.m1(),this.m1()):n=!1,n};p(Tl).hashCode=function(){var e=this.l1(),n=e==null?null:Jn(e),i=n??0,d=this.m1(),r=d==null?null:Jn(d);return i^(r??0)};p(Tl).toString=function(){return""+this.l1()+"="+this.m1()};function Hi(e,n,i,d,r,t){this.p2_1=e,this.q2_1=n,this.r2_1=i,this.s2_1=d,this.t2_1=r,this.u2_1=t,this.v2_1=Rx(n3,er(this)),this.w2_1=0,this.x2_1=0,this.y2_1=!1}p(Hi).q=function(){return this.x2_1};p(Hi).r1=function(e){var n=L4(this,e);return n<0?null:K0(this.q2_1)[n]};p(Hi).h2=function(e){return L4(this,e)>=0};p(Hi).i1=function(e,n){var i=vL(this,e),d=cL(this);if(i<0){var r=d[(-i|0)-1|0];return d[(-i|0)-1|0]=n,r}else return d[i]=n,null};p(Hi).j1=function(e){var n=mL(this,e);if(n<0)return null;var i=K0(this.q2_1),d=i[n];return wx(i,n),d};p(Hi).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&Xn(e,Uo)?i=yL(this,e):i=!1,n=i}return n};p(Hi).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.o3()|0;return e};p(Hi).toString=function(){var e=AL(2+An(this.x2_1,3)|0);e.s3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.s3(", "),i.p3(e),n=n+1|0;return e.s3("}"),e.toString()};p(Hi).k=function(){if(this.y2_1)throw ns()};p(Hi).n2=function(e){var n=L4(this,e.l1());return n<0?!1:Je(K0(this.q2_1)[n],e.m1())};p(Hi).w3=function(e){return this.n2(Xn(e,Fo)?e:an())};p(Hi).k2=function(){return new i3(this)};function Ex(){}function SL(e){return bx(e),F4.call(e),e}function t3(){return SL(Qe(p(F4)))}p(F4).k=function(){return this.f2_1.k()};function F4(){}function wL(e,n){return Ox(n),n}function AL(e){return wL(e,Qe(p(ed)))}function Ox(e){return ed.call(e,""),e}function F8(){return Ox(Qe(p(ed)))}function ed(e){this.q3_1=e!==void 0?e:""}p(ed).a=function(){return this.q3_1.length};p(ed).b=function(e){var n=this.q3_1,i;if(e>=0&&e<=RE(n))i=V0(n,e);else throw Q0("index: "+e+", length: "+this.a()+"}");return i};p(ed).t3=function(e){return this.q3_1=this.q3_1+O4(e),this};p(ed).d4=function(e){return this.q3_1=this.q3_1+r3(e),this};p(ed).r3=function(e){return this.q3_1=this.q3_1+r3(e),this};p(ed).s3=function(e){var n=this,i=this.q3_1;return n.q3_1=i+(e??"null"),this};p(ed).toString=function(){return this.q3_1};function tx(e){var n=O4(e).toUpperCase();return n.length>1?e:V0(n,0)}function CL(e,n,i,d,r,t){return t=t===U?!1:t,xE(e,n,i,d,r,t)}function U8(e){switch(e.length){case 0:return td();case 1:return _4(e[0]);default:return gL(e)}}function Px(e){return e.length-1|0}function gL(e){return Cx(GF(e))}function Mx(e,n){if(n==null){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;if(i=i+1|0,e[r]==null)return r}while(i<=d)}else{var t=0,s=e.length-1|0;if(t<=s)do{var f=t;if(t=t+1|0,Je(n,e[f]))return f}while(t<=s)}return-1}function bL(e,n){return Mx(e,n)>=0}function TL(e,n,i,d,r,t,s){return n=n===U?", ":n,i=i===U?"":i,d=d===U?"":d,r=r===U?-1:r,t=t===U?"...":t,s=s===U?null:s,RL(e,F8(),n,i,d,r,t,s).toString()}function RL(e,n,i,d,r,t,s,f){i=i===U?", ":i,d=d===U?"":d,r=r===U?"":r,t=t===U?-1:t,s=s===U?"...":s,f=f===U?null:f,n.d4(d);var c=0,v=0,w=e.length;e:for(;v<w;){var b=e[v];if(v=v+1|0,c=c+1|0,c>1&&n.d4(i),t<0||c<=t)TE(n,b,f);else break e}return t>=0&&c>t&&n.d4(s),n.d4(r),n}function _x(e,n,i,d,r,t,s){return n=n===U?", ":n,i=i===U?"":i,d=d===U?"":d,r=r===U?-1:r,t=t===U?"...":t,s=s===U?null:s,NL(e,F8(),n,i,d,r,t,s).toString()}function NL(e,n,i,d,r,t,s,f){i=i===U?", ":i,d=d===U?"":d,r=r===U?"":r,t=t===U?-1:t,s=s===U?"...":s,f=f===U?null:f,n.d4(d);var c=0,v=e.l();e:for(;v.m();){var w=v.o();if(c=c+1|0,c>1&&n.d4(i),t<0||c<=t)TE(n,w,f);else break e}return t>=0&&c>t&&n.d4(s),n.d4(r),n}function Bx(e){if(e.t())throw a3("List is empty.");return e.x(0)}function x4(e,n){return e<n?n:e}function IL(e,n){return bE.e4(e,n,-1)}function E4(e,n){return e>n?n:e}function xL(e){var n=e&65535;return n}function rx(e){return e}function O4(e){return String.fromCharCode(e)}function Lx(){S8=this,this.f4_1=0,this.g4_1=65535,this.h4_1=55296,this.i4_1=56319,this.j4_1=56320,this.k4_1=57343,this.l4_1=55296,this.m4_1=57343,this.n4_1=2,this.o4_1=16}var S8;function dx(){return S8==null&&new Lx,S8}function Fx(){}function W0(){}function rt(){}function Fo(){}function Uo(){}function U4(){}function Ux(){}var EL;function gt(e,n){this.p4_1=e,this.q4_1=n}p(gt).r4=function(){return this.p4_1};p(gt).s4=function(){return this.q4_1};p(gt).t4=function(e){return qL(this.q4_1,e.q4_1)};p(gt).u4=function(e){return this.t4(e instanceof gt?e:an())};p(gt).equals=function(e){return this===e};p(gt).hashCode=function(){return HL(this)};p(gt).toString=function(){return this.p4_1};function r3(e){var n=e==null?null:nd(e);return n??"null"}function OL(e){for(var n=1,i=[],d=0,r=e.length;d<r;){var t=e[d];d=d+1|0;var s=n,f=t.prototype.$imask$,c=f??t.$imask$;c!=null&&(i.push(c),s=c.length);var v=t.$metadata$.iid,w;v==null?w=null:w=PL(v);var b=w;b!=null&&(i.push(b),s=Math.max(s,b.length)),s>n&&(n=s)}return ML(n,i)}function PL(e){var n=e>>5,i=new Int32Array(n+1|0),d=e&31,r=1<<d;return i[n]=i[n]|r,i}function ML(e,n){for(var i=0,d=new Int32Array(e);i<e;){for(var r=i,t=0,s=0,f=n.length;s<f;){var c=n[s];s=s+1|0,r<c.length&&(t=t|c[r])}d[r]=t,i=i+1|0}return d}function _L(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function G0(e,n){var i=0,d=e.length-1|0;if(i<=d)do{var r=i;i=i+1|0,e[r]=n}while(r!==d);return e}function BL(e){return new Z4(e)}function Z4(e){this.w4_1=e,this.v4_1=0}p(Z4).m=function(){return this.v4_1!==this.w4_1.length};p(Z4).o=function(){var e;if(this.v4_1!==this.w4_1.length){var n=this.v4_1;this.v4_1=n+1|0,e=this.w4_1[n]}else throw a3(""+this.v4_1);return e};function c8(){return z0(),Zx}var Zx;function Vx(){return z0(),qx}var qx,LL;function w8(){return z0(),Jx}var Jx;function Hx(){return z0(),Dx}var Dx;function FL(){return z0(),$x}var $x;function UL(e){return z0(),(e|0)===e?iE(e):(Vx()[0]=e,An(w8()[FL()],31)+w8()[Hx()]|0)}var ox;function z0(){ox||(ox=!0,Zx=new ArrayBuffer(8),qx=new Float64Array(c8()),LL=new Float32Array(c8()),Jx=new Int32Array(c8()),Vx()[0]=-1,Dx=w8()[0]!==0?1:0,$x=1-Hx()|0)}function V0(e,n){var i;if(Wx(e)){var d=e.charCodeAt(n),r;dx();var t=0;if(d<rx(t))r=!0;else{dx();var s=65535;r=d>rx(s)}if(r)throw jr("Invalid Char code: "+d);i=pF(d)}else i=e.b(n);return i}function Wx(e){return typeof e=="string"}function yu(e){var n;return Wx(e)?n=e.length:n=e.a(),n}function ZL(e){return TL(e,", ","[","]",U,U,VL)}function VL(e){return nd(e)}function qL(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=ax(e,n):n instanceof Me?d=ax(e,n.z4()):d=ux(e,n),i=d;break;case"string":case"boolean":i=ux(e,n);break;default:i=JL(e,n);break}return i}function ax(e,n){var i;if(e<n)i=-1;else if(e>n)i=1;else if(e===n){var d;if(e!==0)d=0;else{var r=1/e,t;r===1/n?t=0:r<0?t=-1:t=1,d=t}i=d}else e!==e?i=n!==n?0:1:i=-1;return i}function ux(e,n){return e<n?-1:e>n?1:0}function JL(e,n){return e.u4(n)}function HL(e){return A8(e)}function A8(e){if(!("kotlinHashCodeValue$"in e)){var n=Gx(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function Gx(){return Math.random()*4294967296|0}function nd(e){var n;return e==null?n="null":vF(e)?n="[...]":typeof e.toString!="function"?n=DL(e):n=e.toString(),n}function DL(e){return Object.prototype.toString.call(e)}function Jn(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():A8(e);break;case"function":i=A8(e);break;case"number":i=UL(e);break;case"boolean":i=$L(e);break;case"string":i=Z8(String(e));break;case"bigint":i=WL(e);break;case"symbol":i=GL(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function $L(e){return e?1231:1237}function Z8(e){var n=0,i=e.length,d=0,r=i-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e.charCodeAt(t);n=An(n,31)+s|0}while(t!==r);return n}function WL(e){for(var n=BigInt(32),i=BigInt(4294967295),d=e<0?-e:e,r=0,t=e<0?-1:1;d!=0;){var s=Number(d&i);r=An(31,r)+s|0,d=d>>n}return An(r,t)}function GL(e){var n=zL(e)?KL():XL(),i=n.get(e);if(i!==U)return i;var d=Gx();return n.set(e,d),d}function zL(e){return Symbol.keyFor(e)!=U}function KL(){return p8===U&&(p8=new Map),p8}function XL(){return h8===U&&(h8=new WeakMap),h8}var p8,h8;function Je(e,n){if(e==null)return n==null;if(n==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(n);if(e!==e)return n!==n;if(typeof e=="number"&&typeof n=="number"){var i;if(e===n){var d;if(e!==0)d=!0;else{var r=1/e;d=r===1/n}i=d}else i=!1;return i}return e===n}function He(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function p(e){return e.prototype}function Qn(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function Qe(e){return Object.create(e)}function zx(e,n,i){Error.call(e),YL(e,n,i)}function YL(e,n,i){var d=dE(Object.getPrototypeOf(e));if(!(d&1)){var r;if(n==null){var t;if(n!==null){var s=i==null?null:i.toString();t=s??U}else t=U;r=t}else r=n;e.message=r}d&2||(e.cause=i),e.name=Object.getPrototypeOf(e).constructor.name}function K0(e){var n;return e==null?QL():n=e,n}function QL(){throw D8()}function an(){throw $8()}function d3(e){throw kE("lateinit property "+e+" has not been initialized")}function V8(e){throw jr(e)}function jL(e,n){for(var i=e.length,d=n.length,r=0,t=n;r<i&&r<d;){var s=r,f=r;r=f+1|0,t[s]=e[f]}return n}function eF(e,n,i){var d=e.slice(0,n);e.$type$!==void 0&&(d.$type$=e.$type$);var r=e.length;if(n>r)for(d.length=n;r<n;){var t=r;r=t+1|0,d[t]=i}return d}function Kx(){C8=this,this.a5_1=new Me(0,-2147483648),this.b5_1=new Me(-1,2147483647),this.c5_1=8,this.d5_1=64}var C8;function nF(){return C8==null&&new Kx,C8}function Me(e,n){nF(),E8.call(this),this.x4_1=e,this.y4_1=n}p(Me).e5=function(e){return V4(this,e)};p(Me).u4=function(e){return this.e5(e instanceof Me?e:an())};p(Me).f5=function(e){return P4(this,e)};p(Me).g5=function(e){return q0(this,e)};p(Me).h5=function(e){return tF(this,e)};p(Me).i5=function(){return this.j5().f5(new Me(1,0))};p(Me).j5=function(){return new Me(~this.x4_1,~this.y4_1)};p(Me).k5=function(){return this.x4_1};p(Me).z4=function(){return jc(this)};p(Me).valueOf=function(){return this.z4()};p(Me).equals=function(e){var n;return e instanceof Me?n=Xr(this,e):n=!1,n};p(Me).hashCode=function(){return oF(this)};p(Me).toString=function(){return g8(this,10)};function Lo(){return un(),Xx}var Xx;function I4(){return un(),Yx}var Yx;function lx(){return un(),Qx}var Qx;function iF(){return un(),jx}var jx;function _d(){return un(),eE}var eE;function sx(){return un(),nE}var nE;function V4(e,n){if(un(),Xr(e,n))return 0;var i=gr(e),d=gr(n);return i&&!d?-1:!i&&d?1:gr(q0(e,n))?-1:1}function P4(e,n){un();var i=e.y4_1>>>16|0,d=e.y4_1&65535,r=e.x4_1>>>16|0,t=e.x4_1&65535,s=n.y4_1>>>16|0,f=n.y4_1&65535,c=n.x4_1>>>16|0,v=n.x4_1&65535,w=0,b=0,g=0,_=0;return _=_+(t+v|0)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+(r+c|0)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(d+f|0)|0,w=w+(b>>>16|0)|0,b=b&65535,w=w+(i+s|0)|0,w=w&65535,new Me(g<<16|_,w<<16|b)}function q0(e,n){return un(),P4(e,n.i5())}function Su(e,n){if(un(),gl(e))return Lo();if(gl(n))return Lo();if(Xr(e,_d()))return fx(n)?_d():Lo();if(Xr(n,_d()))return fx(e)?_d():Lo();if(gr(e)){var i;return gr(n)?i=Su(At(e),At(n)):i=At(Su(At(e),n)),i}else if(gr(n))return At(Su(e,At(n)));if(cx(e,sx())&&cx(n,sx()))return J0(jc(e)*jc(n));var d=e.y4_1>>>16|0,r=e.y4_1&65535,t=e.x4_1>>>16|0,s=e.x4_1&65535,f=n.y4_1>>>16|0,c=n.y4_1&65535,v=n.x4_1>>>16|0,w=n.x4_1&65535,b=0,g=0,_=0,Y=0;return Y=Y+An(s,w)|0,_=_+(Y>>>16|0)|0,Y=Y&65535,_=_+An(t,w)|0,g=g+(_>>>16|0)|0,_=_&65535,_=_+An(s,v)|0,g=g+(_>>>16|0)|0,_=_&65535,g=g+An(r,w)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+An(t,v)|0,b=b+(g>>>16|0)|0,g=g&65535,g=g+An(s,c)|0,b=b+(g>>>16|0)|0,g=g&65535,b=b+(((An(d,w)+An(r,v)|0)+An(t,c)|0)+An(s,f)|0)|0,b=b&65535,new Me(_<<16|Y,b<<16|g)}function tF(e,n){if(un(),gl(n))throw J8("division by zero");if(gl(e))return Lo();if(Xr(e,_d())){if(Xr(n,I4())||Xr(n,lx()))return _d();if(Xr(n,_d()))return I4();var i=dF(e,1),d=rF(i.h5(n),1);if(Xr(d,Lo()))return gr(n)?I4():lx();var r=q0(e,Su(n,d));return P4(d,r.h5(n))}else if(Xr(n,_d()))return Lo();if(gr(e)){var t;return gr(n)?t=At(e).h5(At(n)):t=At(At(e).h5(n)),t}else if(gr(n))return At(e.h5(At(n)));for(var s=Lo(),f=e;uF(f,n);){for(var c=jc(f)/jc(n),v=Math.max(1,Math.floor(c)),w=Math.ceil(Math.log(v)/Math.LN2),b=w<=48?1:Math.pow(2,w-48),g=J0(v),_=Su(g,n);gr(_)||aF(_,f);)v=v-b,g=J0(v),_=Su(g,n);gl(g)&&(g=I4()),s=P4(s,g),f=q0(f,_)}return s}function rF(e,n){un();var i=n&63;return i===0?e:i<32?new Me(e.x4_1<<i,e.y4_1<<i|(e.x4_1>>>(32-i|0)|0)):new Me(0,e.x4_1<<(i-32|0))}function dF(e,n){un();var i=n&63;return i===0?e:i<32?new Me(e.x4_1>>>i|0|e.y4_1<<(32-i|0),e.y4_1>>i):new Me(e.y4_1>>(i-32|0),e.y4_1>=0?0:-1)}function jc(e){return un(),e.y4_1*4294967296+lF(e)}function Xr(e,n){return un(),e.y4_1===n.y4_1?e.x4_1===n.x4_1:!1}function oF(e){return un(),e.x4_1^e.y4_1}function g8(e,n){if(un(),n<2||36<n)throw J8("radix out of range: "+n);if(gl(e))return"0";if(gr(e))if(Xr(e,_d())){var i=Qc(n),d=e.h5(i),r=q0(Su(d,i),e).k5(),t=g8(d,n);return t+r.toString(n)}else return"-"+g8(At(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=J0(Math.pow(n,s)),c=e,v="";;){var w=c.h5(f),b=q0(c,Su(w,f)).k5(),g=b.toString(n);if(c=w,gl(c))return g+v;for(;g.length<s;)g="0"+g;v=g+v}}function Qc(e){return un(),new Me(e,e<0?-1:0)}function gr(e){return un(),e.y4_1<0}function gl(e){return un(),e.y4_1===0?e.x4_1===0:!1}function fx(e){return un(),(e.x4_1&1)===1}function At(e){return un(),e.i5()}function cx(e,n){return un(),V4(e,n)<0}function J0(e){if(un(),zB(e))return Lo();if(e<=-9223372036854776e3)return _d();if(e+1>=9223372036854776e3)return iF();if(e<0)return At(J0(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Me(i,d)}function aF(e,n){return un(),V4(e,n)>0}function uF(e,n){return un(),V4(e,n)>=0}function lF(e){return un(),e.x4_1>=0?e.x4_1:4294967296+e.x4_1}var px;function un(){px||(px=!0,Xx=Qc(0),Yx=Qc(1),Qx=Qc(-1),jx=new Me(-1,2147483647),eE=new Me(0,-2147483648),nE=Qc(16777216))}function ue(e,n,i,d,r){return q8("class",e,n,i,d,r,null)}function q8(e,n,i,d,r,t,s){var f=U;return{kind:e,simpleName:n,associatedObjectKey:d,associatedObjects:r,suspendArity:t,$kClass$:f,defaultConstructor:i,iid:s}}function q(e,n,i,d,r,t,s,f,c){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,c??[]);if(e.$metadata$=v,r!=null){var w=v.iid!=null?e:e.prototype;w.$imask$=OL(r)}}function qo(e,n,i,d,r){return q8("interface",e,n,i,d,r,sF())}function sF(){return Yc===U&&(Yc=0),Yc=Yc+1|0,Yc}var Yc;function oi(e,n,i,d,r){return q8("object",e,n,i,d,r,null)}function X0(e){var n=e.length,i=Array(n),d=0,r=n-1|0;if(d<=r)do{var t=d;d=d+1|0;var s=e[t];s!=null&&H0(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function iE(e){var n;return e instanceof Me?n=e.k5():n=fF(e),n}function fF(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function cF(e){return e<<16>>16}function tE(e){var n;return e instanceof Me?n=e:n=J0(e),n}function pF(e){var n=iE(e),i=cF(n);return xL(i)}function hF(e,n){return new wu(e,n)}function vF(e){return rE(e)?!0:k8(e)}function rE(e){return Array.isArray(e)}function Xn(e,n){return mF(e,n.$metadata$.iid)}function mF(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return _L(r,n)}function H0(e){var n;return rE(e)?n=!e.$type$:n=!1,n}function kF(e){return typeof e=="string"?!0:Xn(e,x8)}function dE(e){var n=e.constructor,i=n==null?null:n.$metadata$,d=i==null?null:i.errorInfo;if(d!=null)return d;var r=0;if(hx(e,"message")&&(r=r|1),hx(e,"cause")&&(r=r|2),r!==3){var t=yF(e);t!=Error.prototype&&(r=r|dE(t))}return i!=null&&(i.errorInfo=r),r}function hx(e,n){return e.hasOwnProperty(n)}function yF(e){return Object.getPrototypeOf(e)}var U;function SF(e,n,i,d){i=i===U?0:i,d=d===U?e.length:d,tt.h(i,d,e.length),e.fill(n,i,d)}function v8(e,n,i,d){i=i===U?0:i,d=d===U?e.length:d,tt.h(i,d,e.length),e.fill(n,i,d)}function wF(e){return new Yn(e)}function AF(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw jr(nd(i))}return jL(e,new Int32Array(n))}function CF(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw jr(nd(i))}return eF(e,n,null)}function oE(e){return zx(e),Jo.call(e),e}function aE(){var e=oE(Qe(p(Jo)));return He(e,aE),e}function uE(e,n){return zx(n,e),Jo.call(n),n}function J8(e){var n=uE(e,Qe(p(Jo)));return He(n,J8),n}function Jo(){He(this,Jo)}function gF(e){return id(e),Y0.call(e),e}function lE(){var e=gF(Qe(p(Y0)));return He(e,lE),e}function bF(e,n){return Rl(e,n),Y0.call(n),n}function jr(e){var n=bF(e,Qe(p(Y0)));return He(n,jr),n}function Y0(){He(this,Y0)}function TF(e){return id(e),j0.call(e),e}function sE(){var e=TF(Qe(p(j0)));return He(e,sE),e}function RF(e,n){return Rl(e,n),j0.call(n),n}function Q0(e){var n=RF(e,Qe(p(j0)));return He(n,Q0),n}function j0(){He(this,j0)}function NF(e){return id(e),es.call(e),e}function fE(){var e=NF(Qe(p(es)));return He(e,fE),e}function IF(e,n){return Rl(e,n),es.call(n),n}function o3(e){var n=IF(e,Qe(p(es)));return He(n,o3),n}function es(){He(this,es)}function xF(e){return id(e),q4.call(e),e}function ns(){var e=xF(Qe(p(q4)));return He(e,ns),e}function q4(){He(this,q4)}function id(e){return oE(e),Di.call(e),e}function cE(){var e=id(Qe(p(Di)));return He(e,cE),e}function Rl(e,n){return uE(e,n),Di.call(n),n}function pE(e){var n=Rl(e,Qe(p(Di)));return He(n,pE),n}function Di(){He(this,Di)}function EF(e){return id(e),is.call(e),e}function Au(){var e=EF(Qe(p(is)));return He(e,Au),e}function OF(e,n){return Rl(e,n),is.call(n),n}function a3(e){var n=OF(e,Qe(p(is)));return He(n,a3),n}function is(){He(this,is)}function PF(e){return id(e),J4.call(e),e}function H8(){var e=PF(Qe(p(J4)));return He(e,H8),e}function J4(){He(this,J4)}function MF(e){return id(e),ts.call(e),e}function hE(){var e=MF(Qe(p(ts)));return He(e,hE),e}function _F(e,n){return Rl(e,n),ts.call(n),n}function vE(e){var n=_F(e,Qe(p(ts)));return He(n,vE),n}function ts(){He(this,ts)}function BF(e){return id(e),H4.call(e),e}function D8(){var e=BF(Qe(p(H4)));return He(e,D8),e}function H4(){He(this,H4)}function LF(e){return id(e),D4.call(e),e}function $8(){var e=LF(Qe(p(D4)));return He(e,$8),e}function D4(){He(this,D4)}function FF(e){return id(e),rs.call(e),e}function mE(){var e=FF(Qe(p(rs)));return He(e,mE),e}function UF(e,n){return Rl(e,n),rs.call(n),n}function kE(e){var n=UF(e,Qe(p(rs)));return He(n,kE),n}function rs(){He(this,rs)}function ZF(e){return function(n){return n===e?"(this Collection)":r3(n)}}function Zo(){}p(Zo).r=function(e){var n;e:{var i;if(Xn(this,rt)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Je(r,e)){n=!0;break e}}n=!1}return n};p(Zo).s=function(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.r(r)){n=!1;break e}}n=!0}return n};p(Zo).t=function(){return this.q()===0};p(Zo).toString=function(){return _x(this,", ","[","]",U,U,ZF(this))};p(Zo).toArray=function(){return yx(this)};function Cu(){this.g_1=2147483639}p(Cu).y1=function(e,n){if(e<0||e>=n)throw Q0("index: "+e+", size: "+n)};p(Cu).z1=function(e,n){if(e<0||e>n)throw Q0("index: "+e+", size: "+n)};p(Cu).h=function(e,n,i){if(e<0||n>i)throw Q0("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw jr("fromIndex: "+e+" > toIndex: "+n)};p(Cu).z2=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?P8.MAX_VALUE:2147483639),i};p(Cu).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=An(31,n),t=d==null?null:Jn(d);n=r+(t??0)|0}return n};p(Cu).c1=function(e,n){if(e.q()!==n.q())return!1;for(var i=n.l(),d=e.l();d.m();){var r=d.o(),t=i.o();if(!Je(r,t))return!1}return!0};var tt;function vx(e,n){return n===e?"(this Map)":r3(n)}function yE(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Je(r.l1(),n)){i=r;break e}}i=null}return i}function SE(){}var VF;function qF(e){return function(n){return e.n5(n)}}function Tr(){this.n1_1=null,this.o1_1=null}p(Tr).p1=function(e){return yE(this,e)!=null};p(Tr).q1=function(e){if(!(e!=null&&Xn(e,Fo)))return!1;var n=e.l1(),i=e.m1(),d=(Xn(this,Uo)?this:an()).r1(n);if(!Je(i,d))return!1;var r;return d==null?r=!(Xn(this,Uo)?this:an()).p1(n):r=!1,!r};p(Tr).equals=function(e){if(e===this)return!0;if(!(e!=null&&Xn(e,Uo))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(Xn(i,rt)?d=i.t():d=!1,d){n=!0;break e}for(var r=i.l();r.m();){var t=r.o();if(!this.q1(t)){n=!1;break e}}n=!0}return n};p(Tr).r1=function(e){var n=yE(this,e);return n==null?null:n.m1()};p(Tr).hashCode=function(){return Jn(this.k1())};p(Tr).q=function(){return this.k1().q()};p(Tr).toString=function(){var e=this.k1();return _x(e,", ","{","}",U,U,qF(this))};p(Tr).n5=function(e){return vx(this,e.l1())+"="+vx(this,e.m1())};function $4(){}p($4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:Jn(d);n=r+(t??0)|0}return n};p($4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var W8;function JF(e){return br.call(e),Bn.call(e),e.q5_1=G8().s5_1,e}function u3(){return JF(Qe(p(Bn)))}function l3(e,n){if(n<0)throw o3("Deque is too big.");if(n<=e.q5_1.length)return qe;if(e.q5_1===G8().s5_1){var i=e,d=x4(n,10);return i.q5_1=G0(Array(d),null),qe}var r=tt.z2(e.q5_1.length,n);HF(e,r)}function HF(e,n){var i=G0(Array(n),null),d=e.q5_1,r=e.p5_1,t=e.q5_1.length;Ve(d,i,0,r,t);var s=e.q5_1,f=e.q5_1.length-e.p5_1|0,c=e.p5_1;Ve(s,i,f,0,c),e.p5_1=0,e.q5_1=i}function nr(e,n){return n>=e.q5_1.length?n-e.q5_1.length|0:n}function DF(e,n){return n<0?n+e.q5_1.length|0:n}function wE(e,n){return n===Px(e.q5_1)?0:n+1|0}function b8(e,n){return n===0?Px(e.q5_1):n-1|0}function T8(e,n,i){var d=i.l(),r=n,t=e.q5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.q5_1[s]=d.o()}while(r<t);var f=0,c=e.p5_1;if(f<c)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.q5_1[v]=d.o()}while(f<c);e.r5_1=e.r5_1+i.q()|0}function AE(){R8=this;var e=this;e.s5_1=[],this.t5_1=10}var R8;function G8(){return R8==null&&new AE,R8}p(Bn).q=function(){return this.r5_1};p(Bn).t=function(){return this.r5_1===0};p(Bn).u5=function(e){l3(this,this.r5_1+1|0),this.p5_1=b8(this,this.p5_1),this.q5_1[this.p5_1]=e,this.r5_1=this.r5_1+1|0};p(Bn).v5=function(e){l3(this,this.r5_1+1|0);var n=this.q5_1,i=this.r5_1;n[nr(this,this.p5_1+i|0)]=e,this.r5_1=this.r5_1+1|0};p(Bn).w5=function(){if(this.t())throw a3("ArrayDeque is empty.");var e=this.p5_1,n=this.q5_1[e],i=n==null||n!=null?n:an();return this.q5_1[this.p5_1]=null,this.p5_1=wE(this,this.p5_1),this.r5_1=this.r5_1-1|0,i};p(Bn).x5=function(){if(this.t())throw a3("ArrayDeque is empty.");var e=M4(this),n=nr(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:an();return this.q5_1[n]=null,this.r5_1=this.r5_1-1|0,d};p(Bn).i=function(e){return this.v5(e),!0};p(Bn).a1=function(e,n){if(tt.z1(e,this.r5_1),e===this.r5_1)return this.v5(n),qe;if(e===0)return this.u5(n),qe;l3(this,this.r5_1+1|0);var i=nr(this,this.p5_1+e|0);if(e<(this.r5_1+1|0)>>1){var d=b8(this,i),r=b8(this,this.p5_1);if(d>=this.p5_1){this.q5_1[r]=this.q5_1[this.p5_1];var t=this.q5_1,s=this.q5_1,f=this.p5_1,c=this.p5_1+1|0,v=d+1|0;Ve(t,s,f,c,v)}else{var w=this.q5_1,b=this.q5_1,g=this.p5_1-1|0,_=this.p5_1,Y=this.q5_1.length;Ve(w,b,g,_,Y),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Ce=this.q5_1,De=this.q5_1,Ri=d+1|0;Ve(Ce,De,0,1,Ri)}this.q5_1[d]=n,this.p5_1=r}else{var Ni=this.r5_1,Tt=nr(this,this.p5_1+Ni|0);if(i<Tt){var Rt=this.q5_1,qd=this.q5_1,ld=i+1|0;Ve(Rt,qd,ld,i,Tt)}else{var sd=this.q5_1,Er=this.q5_1;Ve(sd,Er,1,0,Tt),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var Jd=this.q5_1,Hd=this.q5_1,fd=i+1|0,_u=this.q5_1.length-1|0;Ve(Jd,Hd,fd,i,_u)}this.q5_1[i]=n}this.r5_1=this.r5_1+1|0};p(Bn).p=function(e){if(e.t())return!1;l3(this,this.r5_1+e.q()|0);var n=this.r5_1,i=nr(this,this.p5_1+n|0);return T8(this,i,e),!0};p(Bn).y5=function(e,n){if(tt.z1(e,this.r5_1),n.t())return!1;if(e===this.r5_1)return this.p(n);l3(this,this.r5_1+n.q()|0);var i=this.r5_1,d=nr(this,this.p5_1+i|0),r=nr(this,this.p5_1+e|0),t=n.q();if(e<(this.r5_1+1|0)>>1){var s=this.p5_1-t|0;if(r>=this.p5_1)if(s>=0){var f=this.q5_1,c=this.q5_1,v=s,w=this.p5_1;Ve(f,c,v,w,r)}else{s=s+this.q5_1.length|0;var b=r-this.p5_1|0,g=this.q5_1.length-s|0;if(g>=b){var _=this.q5_1,Y=this.q5_1,Ce=s,De=this.p5_1;Ve(_,Y,Ce,De,r)}else{var Ri=this.q5_1,Ni=this.q5_1,Tt=s,Rt=this.p5_1,qd=this.p5_1+g|0;Ve(Ri,Ni,Tt,Rt,qd);var ld=this.q5_1,sd=this.q5_1,Er=this.p5_1+g|0;Ve(ld,sd,0,Er,r)}}else{var Jd=this.q5_1,Hd=this.q5_1,fd=s,_u=this.p5_1,Fl=this.q5_1.length;if(Ve(Jd,Hd,fd,_u,Fl),t>=r){var Ul=this.q5_1,Zl=this.q5_1,UO=this.q5_1.length-t|0;Ve(Ul,Zl,UO,0,r)}else{var ZO=this.q5_1,VO=this.q5_1,qO=this.q5_1.length-t|0;Ve(ZO,VO,qO,0,t);var JO=this.q5_1,HO=this.q5_1;Ve(JO,HO,0,t,r)}}this.p5_1=s,T8(this,DF(this,r-t|0),n)}else{var Bu=r+t|0;if(r<d)if((d+t|0)<=this.q5_1.length){var DO=this.q5_1,$O=this.q5_1;Ve(DO,$O,Bu,r,d)}else if(Bu>=this.q5_1.length){var WO=this.q5_1,GO=this.q5_1,zO=Bu-this.q5_1.length|0;Ve(WO,GO,zO,r,d)}else{var Bh=(d+t|0)-this.q5_1.length|0,KO=this.q5_1,XO=this.q5_1,YO=d-Bh|0;Ve(KO,XO,0,YO,d);var QO=this.q5_1,jO=this.q5_1,eP=d-Bh|0;Ve(QO,jO,Bu,r,eP)}else{var nP=this.q5_1,iP=this.q5_1;if(Ve(nP,iP,t,0,d),Bu>=this.q5_1.length){var tP=this.q5_1,rP=this.q5_1,dP=Bu-this.q5_1.length|0,oP=this.q5_1.length;Ve(tP,rP,dP,r,oP)}else{var aP=this.q5_1,uP=this.q5_1,lP=this.q5_1.length-t|0,sP=this.q5_1.length;Ve(aP,uP,0,lP,sP);var fP=this.q5_1,cP=this.q5_1,pP=this.q5_1.length-t|0;Ve(fP,cP,Bu,r,pP)}}T8(this,r,n)}return!0};p(Bn).x=function(e){tt.y1(e,this.r5_1);var n=nr(this,this.p5_1+e|0),i=this.q5_1[n];return i==null||i!=null?i:an()};p(Bn).r=function(e){return this.b1(e)!==-1};p(Bn).b1=function(e){var n=this.r5_1,i=nr(this,this.p5_1+n|0);if(this.p5_1<i){var d=this.p5_1;if(d<i)do{var r=d;if(d=d+1|0,Je(e,this.q5_1[r]))return r-this.p5_1|0}while(d<i)}else if(this.p5_1>=i){var t=this.p5_1,s=this.q5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Je(e,this.q5_1[f]))return f-this.p5_1|0}while(t<s);var c=0;if(c<i)do{var v=c;if(c=c+1|0,Je(e,this.q5_1[v]))return(v+this.q5_1.length|0)-this.p5_1|0}while(c<i)}return-1};p(Bn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};p(Bn).z=function(e){if(tt.y1(e,this.r5_1),e===M4(this))return this.x5();if(e===0)return this.w5();var n=nr(this,this.p5_1+e|0),i=this.q5_1[n],d=i==null||i!=null?i:an();if(e<this.r5_1>>1){if(n>=this.p5_1){var r=this.q5_1,t=this.q5_1,s=this.p5_1+1|0,f=this.p5_1;Ve(r,t,s,f,n)}else{var c=this.q5_1,v=this.q5_1;Ve(c,v,1,0,n),this.q5_1[0]=this.q5_1[this.q5_1.length-1|0];var w=this.q5_1,b=this.q5_1,g=this.p5_1+1|0,_=this.p5_1,Y=this.q5_1.length-1|0;Ve(w,b,g,_,Y)}this.q5_1[this.p5_1]=null,this.p5_1=wE(this,this.p5_1)}else{var Ce=M4(this),De=nr(this,this.p5_1+Ce|0);if(n<=De){var Ri=this.q5_1,Ni=this.q5_1,Tt=n+1|0,Rt=De+1|0;Ve(Ri,Ni,n,Tt,Rt)}else{var qd=this.q5_1,ld=this.q5_1,sd=n+1|0,Er=this.q5_1.length;Ve(qd,ld,n,sd,Er),this.q5_1[this.q5_1.length-1|0]=this.q5_1[0];var Jd=this.q5_1,Hd=this.q5_1,fd=De+1|0;Ve(Jd,Hd,0,1,fd)}this.q5_1[De]=null}return this.r5_1=this.r5_1-1|0,d};p(Bn).z5=function(){var e=this.r5_1,n=nr(this,this.p5_1+e|0);this.p5_1<n?v8(this.q5_1,null,this.p5_1,n):this.t()||(v8(this.q5_1,null,this.p5_1,this.q5_1.length),v8(this.q5_1,null,0,n)),this.p5_1=0,this.r5_1=0};p(Bn).a6=function(e){var n=e.length>=this.r5_1?e:YB(e,this.r5_1),i=H0(n)?n:an(),d=this.r5_1,r=nr(this,this.p5_1+d|0);if(this.p5_1<r){var t=this.q5_1,s=this.p5_1;Ve(t,i,0,s,r)}else if(!this.t()){var f=this.q5_1,c=this.p5_1,v=this.q5_1.length;Ve(f,i,0,c,v);var w=this.q5_1,b=this.q5_1.length-this.p5_1|0;Ve(w,i,b,0,r)}var g=XB(this.r5_1,i);return H0(g)?g:an()};p(Bn).a2=function(){var e=this.r5_1,n=G0(Array(e),null);return this.a6(n)};p(Bn).toArray=function(){return this.a2()};function Bn(){G8(),this.p5_1=0,this.r5_1=0}function $F(e){if(e.t())return[];for(var n=e.q(),i=G0(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function td(){return WF()}function M4(e){return e.q()-1|0}function rd(){N8=this,this.b6_1=new Me(-1478467534,-1720727600)}p(rd).equals=function(e){var n;return e!=null&&Xn(e,W0)?n=e.t():n=!1,n};p(rd).hashCode=function(){return 1};p(rd).toString=function(){return"[]"};p(rd).q=function(){return 0};p(rd).t=function(){return!0};p(rd).c6=function(e){return e.t()};p(rd).s=function(e){return this.c6(e)};p(rd).x=function(e){throw Q0("Empty list doesn't contain element at index "+e+".")};p(rd).l=function(){return CE};var N8;function WF(){return N8==null&&new rd,N8}function W4(){}p(W4).m=function(){return!1};p(W4).o=function(){throw Au()};var CE;function GF(e){return new Ho(e,!1)}function zF(e){return e.length===0?Vo():Cx(new Ho(e,!0))}function Ho(e,n){this.d6_1=e,this.e6_1=n}p(Ho).q=function(){return this.d6_1.length};p(Ho).t=function(){return this.d6_1.length===0};p(Ho).f6=function(e){return bL(this.d6_1,e)};p(Ho).g6=function(e){var n;e:{var i;if(Xn(e,rt)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.f6(r)){n=!1;break e}}n=!0}return n};p(Ho).s=function(e){return this.g6(e)};p(Ho).l=function(){return BL(this.d6_1)};function KF(){throw vE("Index overflow has happened.")}function z8(e,n){return e.p(wF(n))}function G4(){}p(G4).o=function(){return this.h6()};function XF(e,n,i){var d;if(i>0)d=e>=n?n:n-mx(n,e,i)|0;else if(i<0)d=e<=n?n:n+mx(e,n,-i|0)|0;else throw jr("Step is zero.");return d}function mx(e,n,i){return m8(m8(e,i)-m8(n,i)|0,i)}function m8(e,n){var i=e%n|0;return i>=0?i:i+n|0}function gE(){I8=this,this.i6_1=new wu(1,0)}var I8;function YF(){return I8==null&&new gE,I8}function wu(e,n){YF(),Bd.call(this,e,n,1)}p(wu).t=function(){return this.m6_1>this.n6_1};p(wu).equals=function(e){var n;return e instanceof wu?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1?this.n6_1===e.n6_1:!1:n=!1,n};p(wu).hashCode=function(){return this.t()?-1:An(31,this.m6_1)+this.n6_1|0};p(wu).toString=function(){return""+this.m6_1+".."+this.n6_1};function z4(e,n,i){G4.call(this),this.p6_1=i,this.q6_1=n,this.r6_1=this.p6_1>0?e<=n:e>=n,this.s6_1=this.r6_1?e:this.q6_1}p(z4).m=function(){return this.r6_1};p(z4).h6=function(){var e=this.s6_1;if(e===this.q6_1){if(!this.r6_1)throw Au();this.r6_1=!1}else this.s6_1=this.s6_1+this.p6_1|0;return e};function K8(){}p(K8).e4=function(e,n,i){return new Bd(e,n,i)};var bE;function Bd(e,n,i){if(i===0)throw jr("Step must be non-zero.");if(i===P8.MIN_VALUE)throw jr("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.m6_1=e,this.n6_1=XF(e,n,i),this.o6_1=i}p(Bd).l=function(){return new z4(this.m6_1,this.n6_1,this.o6_1)};p(Bd).t=function(){return this.o6_1>0?this.m6_1>this.n6_1:this.m6_1<this.n6_1};p(Bd).equals=function(e){var n;return e instanceof Bd?n=this.t()&&e.t()?!0:this.m6_1===e.m6_1&&this.n6_1===e.n6_1?this.o6_1===e.o6_1:!1:n=!1,n};p(Bd).hashCode=function(){return this.t()?-1:An(31,An(31,this.m6_1)+this.n6_1|0)+this.o6_1|0};p(Bd).toString=function(){return this.o6_1>0?""+this.m6_1+".."+this.n6_1+" step "+this.o6_1:""+this.m6_1+" downTo "+this.n6_1+" step "+(-this.o6_1|0)};function TE(e,n,i){i!=null?e.d4(i(n)):n==null||kF(n)?e.d4(n):n instanceof Fx?e.t3(n.t6_1):e.d4(r3(n))}function QF(e,n,i){if(i=i===U?!1:i,e===n)return!0;if(!i)return!1;var d=tx(e),r=tx(n),t;if(d===r)t=!0;else{var s=O4(d).toLowerCase(),f=V0(s,0),c=O4(r).toLowerCase();t=f===V0(c,0)}return t}function RE(e){return yu(e)-1|0}function NE(e,n,i){i=i===U?!1:i;var d;return typeof n=="string"?d=jF(e,n,U,i)>=0:d=IE(e,n,0,yu(e),i)>=0,d}function jF(e,n,i,d){i=i===U?0:i,d=d===U?!1:d;var r,t;return d?t=!0:t=typeof e!="string",t?r=IE(e,n,i,yu(e),d):r=e.indexOf(n,i),r}function IE(e,n,i,d,r,t){t=t===U?!1:t;var s=t?IL(E4(i,RE(e)),x4(d,0)):hF(x4(i,0),E4(d,yu(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var c=s.m6_1,v=s.n6_1,w=s.o6_1;if(w>0&&c<=v||w<0&&v<=c)do{var b=c;if(c=c+w|0,CL(n,0,e,b,yu(n),r))return b}while(b!==v)}else{var g=s.m6_1,_=s.n6_1,Y=s.o6_1;if(Y>0&&g<=_||Y<0&&_<=g)do{var Ce=g;if(g=g+Y|0,xE(n,0,e,Ce,yu(n),r))return Ce}while(Ce!==_)}return-1}function xE(e,n,i,d,r,t){if(d<0||n<0||n>(yu(e)-r|0)||d>(yu(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!QF(V0(e,n+f|0),V0(i,d+f|0),t))return!1}while(s<r);return!0}function Ct(e,n){this.u6_1=e,this.v6_1=n}p(Ct).toString=function(){return"("+this.u6_1+", "+this.v6_1+")"};p(Ct).hashCode=function(){var e=this.u6_1==null?0:Jn(this.u6_1);return e=An(e,31)+(this.v6_1==null?0:Jn(this.v6_1))|0,e};p(Ct).equals=function(e){if(this===e)return!0;if(!(e instanceof Ct))return!1;var n=e instanceof Ct?e:an();return!(!Je(this.u6_1,n.u6_1)||!Je(this.v6_1,n.v6_1))};function EE(e,n){return new Ct(e,n)}p(Hi).o2=GB;qe=new O8;P8=new D0;n3=new xx;EL=new Ux;tt=new Cu;VF=new SE;W8=new $4;CE=new W4;bE=new K8;var Do=Math.imul;q(Q8,"OneAtATimeAssembler",ue);q(j8,"AllAtOnceAssembler",ue);q($i,"SubscribeCallbackParams",ue);q(ir,"Mode",ue,gt);q(Nl,"Callback",ue);q(nh,U,ue);q(gi,"DispatcherImpl",ue);q(Wi,"EmptyOptions",ue,U,U,Wi);q(Ln,"DispatcherSnapshot",ue);q(ai,"EventScope",ue,gt);q(ih,"LocalEventsDeduper",ue);q(th,"NoOpUnsubscriber",oi);q(v3,"BaseTrace",ue);q(m3,"ErrorInfo",ue);q($E,"PerformanceAnalyticsDelegate",qo);q(f3,"NoOpPerformanceAnalyticsDelegate",ue,U,[$E],f3);q(k3,"RuntimeTrace",ue,v3);q(Tu,"Disabled",oi);q(y3,"NiceLogger",ue);q(bu,"NoOpLogger",ue,U,U,bu);q(dt,"TimerDefinition",ue);q(i6,"Span",ue);q(rh,"Tracer",oi);q(t6,"JsDispatcherImpl",ue,gi);q(r6,"JsRequestBuilderAdapter",ue);q(c3,"JsonStateOperations",ue,U,U,c3);function Q8(e,n){this.w6_1=e,this.x6_1=n}p(Q8).y6=function(e,n){var i;if(e.t())i=td();else{for(var d=this.x6_1.list(),r=e.w5();_E(r);){for(var t=0,s=d.length;t<s;){var f=d[t];if(t=t+1|0,f.id===r.hook)return this.w6_1.a7([""+n+" building batch of ",r]),_4(r)}if(!e.t())r=e.w5();else return td()}this.w6_1.a7([""+n+" building batch of ",r]),i=_4(r)}return i};function j8(e,n){this.b7_1=e,this.c7_1=n}p(j8).y6=function(e,n){var i;if(e.t())i=td();else{for(var d=this.c7_1.list(),r=Vo(),t=e.l();t.m();){var s=t.o(),f;if(_E(s)){var c;if(d.length===0)c=!1;else{var v;e:{for(var w=0,b=d.length;w<b;){var g=d[w];if(w=w+1|0,g.id===s.hook){v=g;break e}}v=null}c=v!=null}f=c}else f=!0;f&&r.i(s)}var _=r;e.z5(),this.b7_1.a7([""+n+" building batch of ",_]),i=_}return i};function _E(e){var n=e.hook;return(n==null?null:NE(n,"useInterval"))===!0}function $i(e,n,i){this.request=e,this.response=n,this.mode=i}p($i).d7=function(){return this.request};p($i).e7=function(){return this.response};p($i).f7=function(){return this.mode};p($i).g7=function(){return this.request};p($i).h7=function(){return this.response};p($i).i7=function(){return this.mode};p($i).j7=function(e,n,i){return new $i(e,n,i)};p($i).copy=function(e,n,i,d){return e=e===U?this.request:e,n=n===U?this.response:n,i=i===U?this.mode:i,this.j7(e,n,i)};p($i).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};p($i).hashCode=function(){var e=this.request==null?0:Jn(this.request);return e=Do(e,31)+(this.response==null?0:Jn(this.response))|0,e=Do(e,31)+this.mode.hashCode()|0,e};p($i).equals=function(e){if(this===e)return!0;if(!(e instanceof $i))return!1;var n=e instanceof $i?e:an();return!(!Je(this.request,n.request)||!Je(this.response,n.response)||!this.mode.equals(n.mode))};var BE,LE,FE;function eU(){return[Ld(),s3(),Fd()]}function nU(e){switch(e){case"SYNC":return Ld();case"ASYNC":return s3();case"SPEC":return Fd();default:X4(),V8("No enum constant value.");break}}var OE;function X4(){if(OE)return qe;OE=!0,BE=new ir("SYNC",0),LE=new ir("ASYNC",1),FE=new ir("SPEC",2)}function ir(e,n){gt.call(this,e,n)}function Ld(){return X4(),BE}function s3(){return X4(),LE}function Fd(){return X4(),FE}function Nl(e,n){this.m7_1=e,this.n7_1=n}p(Nl).toString=function(){return"Callback(success="+this.m7_1+", failure="+this.n7_1+")"};p(Nl).hashCode=function(){var e=Jn(this.m7_1);return e=Do(e,31)+Jn(this.n7_1)|0,e};p(Nl).equals=function(e){if(this===e)return!0;if(!(e instanceof Nl))return!1;var n=e instanceof Nl?e:an();return!(!Je(this.m7_1,n.m7_1)||!Je(this.n7_1,n.n7_1))};function X8(e){var n=e.w7_1;if(n!=null)return n;d3("assembler")}function Il(e){var n=e.d8_1;if(n!=null)return n;d3("local")}function p3(e){var n=e.e8_1;if(n!=null)return n;d3("remote")}function Y4(e){var n=e.f8_1;if(n!=null)return n;d3("timers")}function UE(e){ZE(e),e.k8_1=!0,e.t7_1.a7(["recalculateSpeculativeWork"]);var n=e.x7_1.l(),i=0;e:for(;n.m();){var d=i;i=i+1|0;var r=n.o();if(d===0||r.retry===!0||r.async===!0||r.scope.equals(gu()))continue e;if(e.z7_1.r5_1>10)break e;e.z7_1.i(r)}e.t7_1.a7(["Speculative queue size: "+e.z7_1.r5_1]),Q4(e,e.z7_1)}function eh(e){e.t7_1.a7(["cancelSpeculation"]),e.k8_1=!1,ZE(e)}function ZE(e){e.z7_1.z5(),e.h8_1=e.q7_1.clone(e.state),e.i8_1=e.i8_1+1|0}function Y8(e,n,i){if(n.t())return qe;var d=Bx(n),r=d.scope.equals(gu())?!0:pU(d.scope)?!Il(e).isReady():!1;i.equals(Ld())&&(e.a8_1=!0);var t=e.p7_1.l8(i.equals(Fd())?e.h8_1:e.state,n),s=r?p3(e):Il(e),f=e.u7_1;e.u7_1=f+1|0;var c=f,v=e.i8_1,w=KE.m8("runtime_trace"),b=dU(e,i,r,w,n,c,v,t),g=new Nl(b,oU(e,i,r,w,n,c));e.b8_1.i1(c,g),e.t7_1.a7(["Signpost: Handling "+K4(e,i,r)+" request"]),Q4(e,t),s.handle(e.r7_1,t,g.m7_1,g.n7_1)}function K4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function VE(e,n){e.k8_1=e.j8_1,e.a8_1=!1,e.state=e.q7_1.clone(e.g8_1),e.y7_1.z5(),e.x7_1.z5(),Il(e).reset(),p3(e).reset(),eh(e),n&&Y4(e).clear()}function h3(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Jo){var t=s;e.t7_1.n8([t]),e.s7_1.errorHandler(t),r=n}else throw s;d=r}return d}function Q4(e,n){e.s7_1.featureFlags.isVerboseLoggingEnabled&&e.t7_1.a7([n])}function iU(e){return function(){return Il(e).isReady()}}function tU(e,n,i,d){return function(){e.t7_1.a7(["Signpost: Initializing Dispatcher",n,i]),e.d8_1=n,e.e8_1=i,e.f8_1=d;var r=e,t;return e.s7_1.featureFlags.isUsingEverythingAssembler?t=new j8(e.t7_1,d):t=new Q8(e.t7_1,d),r.w7_1=t,e.o8(),qe}}function nh(e,n){this.p8_1=e,this.q8_1=n}p(nh).unsubscribe=function(){this.p8_1.c8_1.j(this.q8_1)};function rU(e,n){return function(){var i=typeof e=="function"?e:an();return n.c8_1.i(i),new nh(n,i)}}function dU(e,n,i,d,r,t,s,f){return function(c){e.t7_1.a7(["Signpost: Response success for "+K4(e,n,i)+" request"]),Q4(e,c),d.u8(),WE(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q()),e.b8_1.j1(t);var v;if(n.equals(Fd())&&e.i8_1!==s)return e.t7_1.a7(["throwing away stale speculative results"]),qe;e.t7_1.a7(["Responding to "+K4(e,n,i)+" runtime result subscriptions"]);for(var w=e.c8_1.l();w.m();){var b=w.o();b(new $i(f,c,n))}var g;n.equals(Ld())?(e.state=e.q7_1.merge(e.state,c.state),e.a8_1=!1,g=qe):n.equals(Fd())&&(e.h8_1=e.q7_1.merge(e.h8_1,c.state),g=qe),e.v8(U8(c.replay),n);var _;return n.equals(Ld())&&e.j8_1&&(UE(e),_=qe),e.o8(),qe}}function oU(e,n,i,d,r,t){return function(s){e.t7_1.a7(["Signpost: Response error for "+K4(e,n,i)+" request",s]),d.u8(),WE(e.s7_1.performanceAnalyticsDelegate,d,i,"",r.q());var f=e.s7_1.performanceAnalyticsDelegate,c=s.message;hU(f,c??"",i,""),e.b8_1.j1(t);var v;n.equals(Ld())&&(e.a8_1=!1,v=qe);var w;if(n.equals(Fd()))return eh(e),e.o8(),qe;for(var b=r,g=t3(),_=b.l();_.m();){var Y=_.o(),Ce=Y.scope.equals(gu())?!1:Y.retry!==!0,De=g.r1(Ce),Ri;if(De==null){var Ni=Vo();g.i1(Ce,Ni),Ri=Ni}else Ri=De;var Tt=Ri;Tt.i(Y)}var Rt=g,qd,ld=Rt.r1(!1);if(!(ld==null||ld.t())){var sd=Rt.r1(!1),Er=sd??td(),Jd=$0(Er);e.t7_1.a7(X0([["unretryable events",s],Jd])),qd=e.s7_1.errorHandler(s)}var Hd,fd=Rt.r1(!0);if(!(fd==null||fd.t())){var _u=Rt.r1(!0);if(_u!=null)for(var Fl=_u.l();Fl.m();){var Ul=Fl.o();Ul.retry=!0,Ul.scope=gu()}var Zl=Rt.r1(!0);e.v8(Zl??td(),n),n.equals(Ld())&&e.j8_1&&UE(e),e.o8(),Hd=qe}return qe}}function aU(e,n){return function(){e.t7_1.a7(X0([["Signpost: Submitted events"],n]));for(var i=e.v7_1.w8(U8(n)),d=i.l();d.m();){var r=d.o();r.async===!0?e.y7_1.i(r):(e.x7_1.i(r),e.a8_1&&e.k8_1&&e.z7_1.i(r))}return e.o8(),qe}}function uU(e){return function(){return VE(e,!0),qe}}function lU(e,n){return function(){e.state=e.q7_1.clone(n.state),e.y7_1.z5();var i=n.asyncQueue;z8(e.y7_1,H0(i)?i:an()),e.x7_1.z5();var d=n.syncQueue;return z8(e.x7_1,H0(d)?d:an()),eh(e),Il(e).resume(n.localSnapshot),p3(e).resume(n.remoteSnapshot),Y4(e).resumeAll(n.timerSnapshot),qe}}function gi(e,n,i,d,r){d=d===U?"RenderPostContent":d,r=r===U?new Wi:r,this.o7_1=e,this.p7_1=n,this.q7_1=i,this.r7_1=d,this.s7_1=r,this.t7_1=new y3(this.s7_1.logger),this.u7_1=0;var t=this;t.v7_1=new ih(iU(this),this.t7_1),this.x7_1=u3(),this.y7_1=u3(),this.z7_1=u3(),this.a8_1=!1;var s=this;s.b8_1=t3();var f=this;f.c8_1=Vo(),this.g8_1=this.q7_1.clone(this.state),this.h8_1=this.q7_1.clone(this.g8_1),this.i8_1=0,this.j8_1=this.s7_1.featureFlags.isSpeculativeExecutionEnabled,this.k8_1=this.j8_1,this.t7_1.a7(["Signpost: Constructed KMP Dispatcher"])}p(gi).x8=function(e){this.o7_1=e};p(gi).y8=function(){return this.o7_1};p(gi).z8=function(){return this.x7_1};p(gi).a9=function(){return this.y7_1};p(gi).b9=function(){return this.z7_1};p(gi).init=function(e,n,i){h3(this,qe,tU(this,e,n,i))};p(gi).subscribe=function(e){var n=DE;return h3(this,n,rU(e,this))};p(gi).o8=function(){if(this.t7_1.a7(["ticking","syncInFlight "+this.a8_1,"asyncQueue.size "+this.y7_1.r5_1,"syncQueue.size "+this.x7_1.r5_1,"speculativeQueue.size "+this.z7_1.r5_1]),!Il(this).isReady()&&!p3(this).isReady()&&!(this.x7_1.t()&&this.y7_1.t()))return this.t7_1.c9(["ticking with events and no runtime, deferring..."]),qe;if(this.a8_1){if(this.k8_1){var n=X8(this).y6(this.z7_1,Fd());Y8(this,n,Fd())}}else{var e=X8(this).y6(this.x7_1,Ld());Y8(this,e,Ld())}if(!this.y7_1.t()){for(;!this.y7_1.t();){var i=X8(this).y6(this.y7_1,s3());Y8(this,i,s3())}this.o8()}};p(gi).v8=function(e,n){if(e.t()||n.equals(Fd()))return qe;this.t7_1.a7(["replaying "+e.q()+" events"]),Q4(this,e);for(var i=t3(),d=e.l();d.m();){var r=d.o(),t=new Ct(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var c=Vo();i.i1(t,c),f=c}else f=s;var v=f;v.i(r)}var w=i,b=w.r1(new Ct(!0,!0));this.y7_1.y5(0,b??td());var g=w.r1(new Ct(!0,!1));this.y7_1.p(g??td());var _=w.r1(new Ct(!1,!0));this.x7_1.y5(0,_??td());var Y=w.r1(new Ct(!1,!1));this.x7_1.p(Y??td())};p(gi).submit=function(e){h3(this,qe,aU(this,e))};p(gi).reset=function(){h3(this,qe,uU(this))};p(gi).snapshot=function(){var e=this.q7_1.clone(this.state),n=this.x7_1,i=$0(n),d=this.y7_1,r=$0(d);return new Ln(e,i,r,Il(this).snapshot(),p3(this).snapshot(),Y4(this).list())};p(gi).pause=function(){var e=this.snapshot();return Y4(this).pauseAll(),VE(this,!1),e};p(gi).resume=function(e){h3(this,qe,lU(this,e))};function sU(e){return qe}function Wi(){this.d9_1=new bu;var e=this;e.e9_1=sU,this.f9_1=zE,this.g9_1=new f3}p(Wi).h9=function(e){this.d9_1=e};p(Wi).i9=function(){return this.d9_1};p(Wi).j9=function(e){this.e9_1=e};p(Wi).k9=function(){return this.e9_1};p(Wi).l9=function(e){this.f9_1=e};p(Wi).m9=function(){return this.f9_1};p(Wi).n9=function(e){this.g9_1=e};p(Wi).o9=function(){return this.g9_1};function Ln(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}p(Ln).y8=function(){return this.state};p(Ln).z8=function(){return this.syncQueue};p(Ln).a9=function(){return this.asyncQueue};p(Ln).p9=function(){return this.localSnapshot};p(Ln).q9=function(){return this.remoteSnapshot};p(Ln).r9=function(){return this.timerSnapshot};p(Ln).g7=function(){return this.state};p(Ln).h7=function(){return this.syncQueue};p(Ln).i7=function(){return this.asyncQueue};p(Ln).s9=function(){return this.localSnapshot};p(Ln).t9=function(){return this.remoteSnapshot};p(Ln).u9=function(){return this.timerSnapshot};p(Ln).v9=function(e,n,i,d,r,t){return new Ln(e,n,i,d,r,t)};p(Ln).copy=function(e,n,i,d,r,t,s){return e=e===U?this.state:e,n=n===U?this.syncQueue:n,i=i===U?this.asyncQueue:i,d=d===U?this.localSnapshot:d,r=r===U?this.remoteSnapshot:r,t=t===U?this.timerSnapshot:t,this.v9(e,n,i,d,r,t)};p(Ln).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+nd(this.syncQueue)+", asyncQueue="+nd(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};p(Ln).hashCode=function(){var e=this.state==null?0:Jn(this.state);return e=Do(e,31)+Jn(this.syncQueue)|0,e=Do(e,31)+Jn(this.asyncQueue)|0,e=Do(e,31)+(this.localSnapshot==null?0:Jn(this.localSnapshot))|0,e=Do(e,31)+(this.remoteSnapshot==null?0:Jn(this.remoteSnapshot))|0,e=Do(e,31)+(this.timerSnapshot==null?0:Jn(this.timerSnapshot))|0,e};p(Ln).equals=function(e){if(this===e)return!0;if(!(e instanceof Ln))return!1;var n=e instanceof Ln?e:an();return!(!Je(this.state,n.state)||!Je(this.syncQueue,n.syncQueue)||!Je(this.asyncQueue,n.asyncQueue)||!Je(this.localSnapshot,n.localSnapshot)||!Je(this.remoteSnapshot,n.remoteSnapshot)||!Je(this.timerSnapshot,n.timerSnapshot))};var qE,JE,HE;function fU(){return[e6(),n6(),gu()]}function cU(e){switch(e){case"ALL":return e6();case"LOCAL":return n6();case"REMOTE":return gu();default:j4(),V8("No enum constant value.");break}}var PE;function j4(){if(PE)return qe;PE=!0,qE=new ai("ALL",0),JE=new ai("LOCAL",1),HE=new ai("REMOTE",2)}function ai(e,n){gt.call(this,e,n)}function pU(e){return e.equals(gu())?!0:e.equals(e6())}function e6(){return j4(),qE}function n6(){return j4(),JE}function gu(){return j4(),HE}function ih(e,n){this.y9_1=e,this.z9_1=n}p(ih).w8=function(e){var n;if(this.y9_1())n=e;else{for(var i=Vo(),d=Vo(),r=e.l();r.m();){var t=r.o();t.scope.equals(n6())?d.i(t):i.i(t)}var s=new Ct(i,d);if(!s.v6_1.t()){var f=["Dropping "+s.v6_1.q()+" local events",s.v6_1];this.z9_1.a7([f])}n=s.u6_1}return n};function th(){}p(th).unsubscribe=function(){};var DE;function v3(e,n){this.spanName=e,this.durationMs=n}p(v3).aa=function(){return this.spanName};p(v3).ba=function(){return this.durationMs};function m3(e,n,i){this.message=e,this.origin=n,this.version=i}p(m3).l5=function(){return this.message};p(m3).ca=function(){return this.origin};p(m3).da=function(){return this.version};function $E(){}function f3(){}p(f3).logRuntimeTrace=function(e){};p(f3).logRuntimeError=function(e){};function WE(e,n,i,d,r){e.logRuntimeTrace(new k3(n.r8_1,n.ea().toString(),d,GE(i),r))}function hU(e,n,i,d){e.logRuntimeError(new m3(n,GE(i),d))}function GE(e){return e?"remote":"local"}function k3(e,n,i,d,r){v3.call(this,e,n),this.intent=i,this.target=d,this.eventCount=r}p(k3).fa=function(){return this.intent};p(k3).ga=function(){return this.target};p(k3).ha=function(){return this.eventCount};function Tu(){this.ia_1=!1,this.ja_1=!1,this.ka_1=!1}p(Tu).la=function(){return this.ia_1};p(Tu).ma=function(){return this.ja_1};p(Tu).na=function(){return this.ka_1};var zE;function y3(e){this.z6_1=e}p(y3).n8=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.error(n)};p(y3).c9=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.warn(n)};p(y3).a7=function(e){var n=X0([[this.z6_1.tag()],e]);this.z6_1.debug(n)};function bu(){}p(bu).info=function(e){};p(bu).error=function(e){};p(bu).warn=function(e){};p(bu).debug=function(e){};p(bu).tag=function(){return""};function dt(e,n){this.id=e,this.duration=n}p(dt).oa=function(){return this.id};p(dt).pa=function(){return this.duration};p(dt).g7=function(){return this.id};p(dt).h7=function(){return this.duration};p(dt).qa=function(e,n){return new dt(e,n)};p(dt).copy=function(e,n,i){return e=e===U?this.id:e,n=n===U?this.duration:n,this.qa(e,n)};p(dt).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};p(dt).hashCode=function(){var e=Z8(this.id);return e=Do(e,31)+this.duration|0,e};p(dt).equals=function(e){if(this===e)return!0;if(!(e instanceof dt))return!1;var n=e instanceof dt?e:an();return!(this.id!==n.id||this.duration!==n.duration)};function i6(e,n){this.r8_1=e,this.s8_1=n,this.t8_1=new Me(0,0)}p(i6).u8=function(){this.t8_1=XE()};p(i6).ea=function(){return this.t8_1.g5(this.s8_1)};function rh(){}p(rh).m8=function(e){return new i6(e,XE())};var KE;function t6(e,n,i,d){i=i===U?"RenderPostContent":i,d=d===U?new Wi:d,gi.call(this,e,new r6(n),new c3,i,d),this.ob_1=i,this.pb_1=d}function r6(e){this.qb_1=e}p(r6).rb=function(e,n){var i=$0(n);return this.qb_1.build(e,i)};p(r6).l8=function(e,n){return this.rb(e!=null&&e!=null?e:an(),n)};function ME(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:an())(e),d=M8(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],c=EE(f!=null&&typeof f=="string"?f:an(),s[1]);d.i(c)}return d}function c3(){}p(c3).clone=function(e){return JSON.parse(JSON.stringify(e))};p(c3).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:an(),r=ME(e).l();r.m();){var t=r.o();d[t.u6_1]=t.v6_1}for(var s=ME(n).l();s.m();){var f=s.o();d[f.u6_1]=f.v6_1}return d};function XE(){return tE(new Date().getTime())}Qn(p(ir),"name",p(ir).r4);Qn(p(ir),"ordinal",p(ir).s4);Qn(p(gi),"state",function(){return this.y8()},function(e){this.x8(e)});Qn(p(Wi),"logger",function(){return this.i9()},function(e){this.h9(e)});Qn(p(Wi),"errorHandler",function(){return this.k9()},function(e){this.j9(e)});Qn(p(Wi),"featureFlags",function(){return this.m9()},function(e){this.l9(e)});Qn(p(Wi),"performanceAnalyticsDelegate",function(){return this.o9()},function(e){this.n9(e)});Qn(p(ai),"name",p(ai).r4);Qn(p(ai),"ordinal",p(ai).s4);Qn(p(Tu),"isSpeculativeExecutionEnabled",function(){return this.la()});Qn(p(Tu),"isVerboseLoggingEnabled",function(){return this.ma()});Qn(p(Tu),"isUsingEverythingAssembler",function(){return this.na()});Qn(p(t6),"state",function(){return this.y8()},function(e){this.x8(e)});DE=new th;zE=new Tu;KE=new rh;ir.values=eU;ir.valueOf=nU;Qn(ir,"SYNC",Ld);Qn(ir,"ASYNC",s3);Qn(ir,"SPEC",Fd);ai.values=fU;ai.valueOf=cU;Qn(ai,"ALL",e6);Qn(ai,"LOCAL",n6);Qn(ai,"REMOTE",gu);var rr=P(F(),1);var El=P(F(),1);var Ud;(function(e){e[e.ENVIRONMENT_UNSPECIFIED=0]="ENVIRONMENT_UNSPECIFIED",e[e.ENVIRONMENT_SANDBOX=1]="ENVIRONMENT_SANDBOX",e[e.ENVIRONMENT_PRODUCTION=2]="ENVIRONMENT_PRODUCTION",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ud||(Ud={}));function d6(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Ud.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Ud.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Ud.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Ud.UNRECOGNIZED}}function o6(e){switch(e){case Ud.ENVIRONMENT_UNSPECIFIED:return 0;case Ud.ENVIRONMENT_SANDBOX:return 1;case Ud.ENVIRONMENT_PRODUCTION:return 2;case Ud.UNRECOGNIZED:default:return-1}}var tr=P(F(),1);var Nu;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Nu||(Nu={}));function vU(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return Nu.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return Nu.GOLD;case-1:case"UNRECOGNIZED":default:return Nu.UNRECOGNIZED}}function mU(e){switch(e){case Nu.CURRENCY_UNSPECIFIED:return 0;case Nu.GOLD:return 200;case Nu.UNRECOGNIZED:default:return-1}}var jn;(function(e){e[e.ACCOUNTING_TYPE_UNSPECIFIED=0]="ACCOUNTING_TYPE_UNSPECIFIED",e[e.ACCOUNTING_TYPE_INSTANT=1]="ACCOUNTING_TYPE_INSTANT",e[e.ACCOUNTING_TYPE_DURABLE=2]="ACCOUNTING_TYPE_DURABLE",e[e.ACCOUNTING_TYPE_CONSUMABLE=3]="ACCOUNTING_TYPE_CONSUMABLE",e[e.ACCOUNTING_TYPE_VALID_FOR_1D=4]="ACCOUNTING_TYPE_VALID_FOR_1D",e[e.ACCOUNTING_TYPE_VALID_FOR_7D=5]="ACCOUNTING_TYPE_VALID_FOR_7D",e[e.ACCOUNTING_TYPE_VALID_FOR_30D=6]="ACCOUNTING_TYPE_VALID_FOR_30D",e[e.ACCOUNTING_TYPE_VALID_FOR_1Y=7]="ACCOUNTING_TYPE_VALID_FOR_1Y",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(jn||(jn={}));function kU(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return jn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return jn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return jn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return jn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return jn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return jn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return jn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return jn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return jn.UNRECOGNIZED}}function yU(e){switch(e){case jn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case jn.ACCOUNTING_TYPE_INSTANT:return 1;case jn.ACCOUNTING_TYPE_DURABLE:return 2;case jn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case jn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case jn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case jn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case jn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case jn.UNRECOGNIZED:default:return-1}}function YE(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var ot={$type:"devvit.payments.v1alpha.Product",encode(e,n=tr.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&Ru.encode(e.price,n.uint32(42).fork()).ldelim(),e.environment!==0&&n.uint32(160).int32(e.environment),e.description!==""&&n.uint32(170).string(e.description),e.accountingType!==0&&n.uint32(184).int32(e.accountingType),Object.entries(e.productMetadata).forEach(([i,d])=>{S3.encode({key:i,value:d},n.uint32(8018).fork()).ldelim()}),Object.entries(e.images).forEach(([i,d])=>{w3.encode({key:i,value:d},n.uint32(8026).fork()).ldelim()}),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=YE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1001:if(t!==8010)break;r.sku=i.string();continue;case 3:if(t!==26)break;r.name=i.string();continue;case 5:if(t!==42)break;r.price=Ru.decode(i,i.uint32());continue;case 20:if(t!==160)break;r.environment=i.int32();continue;case 21:if(t!==170)break;r.description=i.string();continue;case 23:if(t!==184)break;r.accountingType=i.int32();continue;case 1002:if(t!==8018)break;let s=S3.decode(i,i.uint32());s.value!==void 0&&(r.productMetadata[s.key]=s.value);continue;case 1003:if(t!==8026)break;let f=w3.decode(i,i.uint32());f.value!==void 0&&(r.images[f.key]=f.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{sku:Nr(e.sku)?globalThis.String(e.sku):"",name:Nr(e.name)?globalThis.String(e.name):"",price:Nr(e.price)?Ru.fromJSON(e.price):void 0,environment:Nr(e.environment)?d6(e.environment):0,description:Nr(e.description)?globalThis.String(e.description):"",accountingType:Nr(e.accountingType)?kU(e.accountingType):0,productMetadata:nO(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:nO(e.images)?Object.entries(e.images).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.sku!==""&&(n.sku=e.sku),e.name!==""&&(n.name=e.name),e.price!==void 0&&(n.price=Ru.toJSON(e.price)),e.environment!==0&&(n.environment=o6(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=yU(e.accountingType)),e.productMetadata){let i=Object.entries(e.productMetadata);i.length>0&&(n.productMetadata={},i.forEach(([d,r])=>{n.productMetadata[d]=r}))}if(e.images){let i=Object.entries(e.images);i.length>0&&(n.images={},i.forEach(([d,r])=>{n.images[d]=r}))}return n},create(e){return ot.fromPartial(e??{})},fromPartial(e){let n=YE();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?Ru.fromPartial(e.price):void 0,n.environment=e.environment??0,n.description=e.description??"",n.accountingType=e.accountingType??0,n.productMetadata=Object.entries(e.productMetadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.images=Object.entries(e.images??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ot.$type,ot);function QE(){return{key:"",value:""}}var S3={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=tr.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=QE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Nr(e.key)?globalThis.String(e.key):"",value:Nr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return S3.fromPartial(e??{})},fromPartial(e){let n=QE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(S3.$type,S3);function jE(){return{key:"",value:""}}var w3={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=tr.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=jE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Nr(e.key)?globalThis.String(e.key):"",value:Nr(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return w3.fromPartial(e??{})},fromPartial(e){let n=jE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(w3.$type,w3);function eO(){return{amount:0,currency:0}}var Ru={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=tr.default.Writer.create()){return e.amount!==0&&n.uint32(8).int32(e.amount),e.currency!==0&&n.uint32(16).int32(e.currency),n},decode(e,n){let i=e instanceof tr.default.Reader?e:tr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=eO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.amount=i.int32();continue;case 2:if(t!==16)break;r.currency=i.int32();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{amount:Nr(e.amount)?globalThis.Number(e.amount):0,currency:Nr(e.currency)?vU(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=mU(e.currency)),n},create(e){return Ru.fromPartial(e??{})},fromPartial(e){let n=eO();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(Ru.$type,Ru);function nO(e){return typeof e=="object"&&e!==null}function Nr(e){return e!=null}var bi;(function(e){e[e.ORDER_STATUS_UNSPECIFIED=0]="ORDER_STATUS_UNSPECIFIED",e[e.ORDER_STATUS_NEW=1]="ORDER_STATUS_NEW",e[e.ORDER_STATUS_CREATED=2]="ORDER_STATUS_CREATED",e[e.ORDER_STATUS_PAID=3]="ORDER_STATUS_PAID",e[e.ORDER_STATUS_DELIVERED=4]="ORDER_STATUS_DELIVERED",e[e.ORDER_STATUS_CANCELED=5]="ORDER_STATUS_CANCELED",e[e.ORDER_STATUS_REVERTED=6]="ORDER_STATUS_REVERTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(bi||(bi={}));function oh(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return bi.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return bi.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return bi.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return bi.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return bi.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return bi.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return bi.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return bi.UNRECOGNIZED}}function ah(e){switch(e){case bi.ORDER_STATUS_UNSPECIFIED:return 0;case bi.ORDER_STATUS_NEW:return 1;case bi.ORDER_STATUS_CREATED:return 2;case bi.ORDER_STATUS_PAID:return 3;case bi.ORDER_STATUS_DELIVERED:return 4;case bi.ORDER_STATUS_CANCELED:return 5;case bi.ORDER_STATUS_REVERTED:return 6;case bi.UNRECOGNIZED:default:return-1}}function iO(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var ei={$type:"devvit.payments.v1alpha.Order",encode(e,n=El.default.Writer.create()){e.id!==""&&n.uint32(10).string(e.id),e.status!==0&&n.uint32(16).int32(e.status),e.createdAt!==void 0&&de.encode(rO(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&de.encode(rO(e.updatedAt),n.uint32(34).fork()).ldelim();for(let i of e.products)ot.encode(i,n.uint32(42).fork()).ldelim();return e.environment!==0&&n.uint32(64).int32(e.environment),Object.entries(e.metadata).forEach(([i,d])=>{A3.encode({key:i,value:d},n.uint32(8010).fork()).ldelim()}),n},decode(e,n){let i=e instanceof El.default.Reader?e:El.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=iO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.id=i.string();continue;case 2:if(t!==16)break;r.status=i.int32();continue;case 3:if(t!==26)break;r.createdAt=dh(de.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=dh(de.decode(i,i.uint32()));continue;case 5:if(t!==42)break;r.products.push(ot.decode(i,i.uint32()));continue;case 8:if(t!==64)break;r.environment=i.int32();continue;case 1001:if(t!==8010)break;let s=A3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{id:xl(e.id)?globalThis.String(e.id):"",status:xl(e.status)?oh(e.status):0,createdAt:xl(e.createdAt)?dO(e.createdAt):void 0,updatedAt:xl(e.updatedAt)?dO(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[],environment:xl(e.environment)?d6(e.environment):0,metadata:SU(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.id!==""&&(n.id=e.id),e.status!==0&&(n.status=ah(e.status)),e.createdAt!==void 0&&(n.createdAt=e.createdAt.toISOString()),e.updatedAt!==void 0&&(n.updatedAt=e.updatedAt.toISOString()),e.products?.length&&(n.products=e.products.map(i=>ot.toJSON(i))),e.environment!==0&&(n.environment=o6(e.environment)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return ei.fromPartial(e??{})},fromPartial(e){let n=iO();return n.id=e.id??"",n.status=e.status??0,n.createdAt=e.createdAt??void 0,n.updatedAt=e.updatedAt??void 0,n.products=e.products?.map(i=>ot.fromPartial(i))||[],n.environment=e.environment??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ei.$type,ei);function tO(){return{key:"",value:""}}var A3={$type:"devvit.payments.v1alpha.Order.MetadataEntry",encode(e,n=El.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof El.default.Reader?e:El.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=tO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:xl(e.key)?globalThis.String(e.key):"",value:xl(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return A3.fromPartial(e??{})},fromPartial(e){let n=tO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(A3.$type,A3);function rO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function dh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function dO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):dh(de.fromJSON(e))}function SU(e){return typeof e=="object"&&e!==null}function xl(e){return e!=null}function oO(){return{order:void 0}}var uh={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=rr.default.Writer.create()){return e.order!==void 0&&ei.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=oO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=ei.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:a6(e.order)?ei.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=ei.toJSON(e.order)),n},create(e){return uh.fromPartial(e??{})},fromPartial(e){let n=oO();return n.order=e.order!==void 0&&e.order!==null?ei.fromPartial(e.order):void 0,n}};l.set(uh.$type,uh);function aO(){return{order:void 0}}var lh={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=rr.default.Writer.create()){return e.order!==void 0&&ei.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=aO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=ei.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:a6(e.order)?ei.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=ei.toJSON(e.order)),n},create(e){return lh.fromPartial(e??{})},fromPartial(e){let n=aO();return n.order=e.order!==void 0&&e.order!==null?ei.fromPartial(e.order):void 0,n}};l.set(lh.$type,lh);function uO(){return{acknowledged:void 0,rejectionReason:void 0}}var sh={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=rr.default.Writer.create()){return e.acknowledged!==void 0&&n.uint32(8).bool(e.acknowledged),e.rejectionReason!==void 0&&n.uint32(18).string(e.rejectionReason),n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=uO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.acknowledged=i.bool();continue;case 2:if(t!==18)break;r.rejectionReason=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{acknowledged:a6(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:a6(e.rejectionReason)?globalThis.String(e.rejectionReason):void 0}},toJSON(e){let n={};return e.acknowledged!==void 0&&(n.acknowledged=e.acknowledged),e.rejectionReason!==void 0&&(n.rejectionReason=e.rejectionReason),n},create(e){return sh.fromPartial(e??{})},fromPartial(e){let n=uO();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(sh.$type,sh);function lO(){return{}}var fh={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=rr.default.Writer.create()){return n},decode(e,n){let i=e instanceof rr.default.Reader?e:rr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=lO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return fh.fromPartial(e??{})},fromPartial(e){return lO()}};l.set(fh.$type,fh);function a6(e){return e!=null}var dn=P(F(),1);function sO(){return{skus:[],metadata:{}}}var ch={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=dn.default.Writer.create()){for(let i of e.skus)n.uint32(10).string(i);return Object.entries(e.metadata).forEach(([i,d])=>{C3.encode({key:i,value:d},n.uint32(18).fork()).ldelim()}),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=sO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.skus.push(i.string());continue;case 2:if(t!==18)break;let s=C3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{skus:globalThis.Array.isArray(e?.skus)?e.skus.map(n=>globalThis.String(n)):[],metadata:AO(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{}}},toJSON(e){let n={};if(e.skus?.length&&(n.skus=e.skus),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return n},create(e){return ch.fromPartial(e??{})},fromPartial(e){let n=sO();return n.skus=e.skus?.map(i=>i)||[],n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n}};l.set(ch.$type,ch);function fO(){return{key:"",value:""}}var C3={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=dn.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=fO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ei(e.key)?globalThis.String(e.key):"",value:Ei(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return C3.fromPartial(e??{})},fromPartial(e){let n=fO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(C3.$type,C3);function cO(){return{products:[]}}var ph={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=dn.default.Writer.create()){for(let i of e.products)ot.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=cO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.products.push(ot.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[]}},toJSON(e){let n={};return e.products?.length&&(n.products=e.products.map(i=>ot.toJSON(i))),n},create(e){return ph.fromPartial(e??{})},fromPartial(e){let n=cO();return n.products=e.products?.map(i=>ot.fromPartial(i))||[],n}};l.set(ph.$type,ph);function pO(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var hh={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=dn.default.Writer.create()){return e.start!==void 0&&de.encode(SO(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&de.encode(SO(e.end),n.uint32(18).fork()).ldelim(),e.limit!==0&&n.uint32(24).int32(e.limit),e.sku!==""&&n.uint32(34).string(e.sku),e.buyer!==""&&n.uint32(42).string(e.buyer),e.status!==0&&n.uint32(48).int32(e.status),Object.entries(e.metadata).forEach(([i,d])=>{g3.encode({key:i,value:d},n.uint32(58).fork()).ldelim()}),e.cursor!==""&&n.uint32(66).string(e.cursor),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=pO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=yh(de.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=yh(de.decode(i,i.uint32()));continue;case 3:if(t!==24)break;r.limit=i.int32();continue;case 4:if(t!==34)break;r.sku=i.string();continue;case 5:if(t!==42)break;r.buyer=i.string();continue;case 6:if(t!==48)break;r.status=i.int32();continue;case 7:if(t!==58)break;let s=g3.decode(i,i.uint32());s.value!==void 0&&(r.metadata[s.key]=s.value);continue;case 8:if(t!==66)break;r.cursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{start:Ei(e.start)?wO(e.start):void 0,end:Ei(e.end)?wO(e.end):void 0,limit:Ei(e.limit)?globalThis.Number(e.limit):0,sku:Ei(e.sku)?globalThis.String(e.sku):"",buyer:Ei(e.buyer)?globalThis.String(e.buyer):"",status:Ei(e.status)?oh(e.status):0,metadata:AO(e.metadata)?Object.entries(e.metadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},cursor:Ei(e.cursor)?globalThis.String(e.cursor):""}},toJSON(e){let n={};if(e.start!==void 0&&(n.start=e.start.toISOString()),e.end!==void 0&&(n.end=e.end.toISOString()),e.limit!==0&&(n.limit=Math.round(e.limit)),e.sku!==""&&(n.sku=e.sku),e.buyer!==""&&(n.buyer=e.buyer),e.status!==0&&(n.status=ah(e.status)),e.metadata){let i=Object.entries(e.metadata);i.length>0&&(n.metadata={},i.forEach(([d,r])=>{n.metadata[d]=r}))}return e.cursor!==""&&(n.cursor=e.cursor),n},create(e){return hh.fromPartial(e??{})},fromPartial(e){let n=pO();return n.start=e.start??void 0,n.end=e.end??void 0,n.limit=e.limit??0,n.sku=e.sku??"",n.buyer=e.buyer??"",n.status=e.status??0,n.metadata=Object.entries(e.metadata??{}).reduce((i,[d,r])=>(r!==void 0&&(i[d]=globalThis.String(r)),i),{}),n.cursor=e.cursor??"",n}};l.set(hh.$type,hh);function hO(){return{key:"",value:""}}var g3={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=dn.default.Writer.create()){return e.key!==""&&n.uint32(10).string(e.key),e.value!==""&&n.uint32(18).string(e.value),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=hO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.key=i.string();continue;case 2:if(t!==18)break;r.value=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{key:Ei(e.key)?globalThis.String(e.key):"",value:Ei(e.value)?globalThis.String(e.value):""}},toJSON(e){let n={};return e.key!==""&&(n.key=e.key),e.value!==""&&(n.value=e.value),n},create(e){return g3.fromPartial(e??{})},fromPartial(e){let n=hO();return n.key=e.key??"",n.value=e.value??"",n}};l.set(g3.$type,g3);function vO(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var Iu={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=dn.default.Writer.create()){return e.hasNextPage!==!1&&n.uint32(8).bool(e.hasNextPage),e.endCursor!==""&&n.uint32(18).string(e.endCursor),e.hasPreviousPage!==!1&&n.uint32(24).bool(e.hasPreviousPage),e.startCursor!==""&&n.uint32(34).string(e.startCursor),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=vO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==8)break;r.hasNextPage=i.bool();continue;case 2:if(t!==18)break;r.endCursor=i.string();continue;case 3:if(t!==24)break;r.hasPreviousPage=i.bool();continue;case 4:if(t!==34)break;r.startCursor=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{hasNextPage:Ei(e.hasNextPage)?globalThis.Boolean(e.hasNextPage):!1,endCursor:Ei(e.endCursor)?globalThis.String(e.endCursor):"",hasPreviousPage:Ei(e.hasPreviousPage)?globalThis.Boolean(e.hasPreviousPage):!1,startCursor:Ei(e.startCursor)?globalThis.String(e.startCursor):""}},toJSON(e){let n={};return e.hasNextPage!==!1&&(n.hasNextPage=e.hasNextPage),e.endCursor!==""&&(n.endCursor=e.endCursor),e.hasPreviousPage!==!1&&(n.hasPreviousPage=e.hasPreviousPage),e.startCursor!==""&&(n.startCursor=e.startCursor),n},create(e){return Iu.fromPartial(e??{})},fromPartial(e){let n=vO();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(Iu.$type,Iu);function mO(){return{orders:[],pageInfo:void 0}}var vh={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=dn.default.Writer.create()){for(let i of e.orders)ei.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&Iu.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=mO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orders.push(ei.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=Iu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orders:globalThis.Array.isArray(e?.orders)?e.orders.map(n=>ei.fromJSON(n)):[],pageInfo:Ei(e.pageInfo)?Iu.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>ei.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=Iu.toJSON(e.pageInfo)),n},create(e){return vh.fromPartial(e??{})},fromPartial(e){let n=mO();return n.orders=e.orders?.map(i=>ei.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?Iu.fromPartial(e.pageInfo):void 0,n}};l.set(vh.$type,vh);function kO(){return{orderId:""}}var mh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=dn.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=kO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.orderId=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{orderId:Ei(e.orderId)?globalThis.String(e.orderId):""}},toJSON(e){let n={};return e.orderId!==""&&(n.orderId=e.orderId),n},create(e){return mh.fromPartial(e??{})},fromPartial(e){let n=kO();return n.orderId=e.orderId??"",n}};l.set(mh.$type,mh);function yO(){return{}}var kh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=dn.default.Writer.create()){return n},decode(e,n){let i=e instanceof dn.default.Reader?e:dn.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=yO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return kh.fromPartial(e??{})},fromPartial(e){return yO()}};l.set(kh.$type,kh);function SO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function yh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function wO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):yh(de.fromJSON(e))}function AO(e){return typeof e=="object"&&e!==null}function Ei(e){return e!=null}var wU=e=>{switch(e){case Mn.ALL:return ai.ALL;case Mn.REMOTE:return ai.REMOTE;case Mn.LOCAL:return ai.LOCAL;case Mn.UNRECOGNIZED:return ai.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},dd=class{constructor(n){this.scope=n.scope?wU(n.scope):ai.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},u6=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new dd(i)),n.state&&(this.state=n.state)}},b3=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new dd(i)),n.state&&(this.state=n.state)}};function CO(){var r,t;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(r=globalThis.devvit).debug??(r.debug={});let n={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},i={};for(let s in n)i[s.toLowerCase()]=s;let d=[...e.searchParams].find(([s])=>s.toLowerCase()==="devvitdebug")?.[1];if(d!=null){d===""&&(d=Object.keys(n).filter(s=>s!=="emitSnapshots"&&s!=="emitState").join());for(let s of d.split(",")??[]){let[f,c]=s.split("=");f&&(f.toLowerCase()in i?f=i[f.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${f}"`),(t=globalThis.devvit.debug)[f]??(t[f]=c||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var od;(function(e){e.ENABLE_APP_LOGGING="enableAppLogging",e.ENABLE_DEBUG_LOGGING="enableDebugLogging",e.ENABLE_PLUGINS="enablePlugins",e.LOAD_BUNDLE="loadBundle",e.CALL="call",e.PLUGIN_RESPONSE="pluginResponse",e.QUIT="quit"})(od||(od={}));var Ir;(function(e){e.READY="ready",e.PLUGINS_CONFIGURED="pluginsConfigured",e.BUNDLE_LOADED="bundleLoaded",e.BUNDLE_LOAD_FAILED="bundleLoadFailed",e.RETURN="return",e.ERROR="error",e.CIRCUIT_BREAKER="circuitBreaker",e.PLUGIN_CALL="pluginCall",e.UNHANDLED_REJECTION="unhandledRejection"})(Ir||(Ir={}));function Sh(e){return e.hostname.split(".")[1]??e.hostname}function gO(e){return`${Sh(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Gi=P(F(),1);function bO(){return{callState:void 0,connect:void 0}}var wh={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Gi.default.Writer.create()){return e.callState!==void 0&&Eu.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&Ou.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=bO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=Eu.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=Ou.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:l6(e.callState)?Eu.fromJSON(e.callState):void 0,connect:l6(e.connect)?Ou.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=Eu.toJSON(e.callState)),e.connect!==void 0&&(n.connect=Ou.toJSON(e.connect)),n},create(e){return wh.fromPartial(e??{})},fromPartial(e){let n=bO();return n.callState=e.callState!==void 0&&e.callState!==null?Eu.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?Ou.fromPartial(e.connect):void 0,n}};l.set(wh.$type,wh);function TO(){return{appInstalled:void 0}}var T3={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Gi.default.Writer.create()){return e.appInstalled!==void 0&&xu.encode(e.appInstalled,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=TO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.appInstalled=xu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:l6(e.appInstalled)?xu.fromJSON(e.appInstalled):void 0}},toJSON(e){let n={};return e.appInstalled!==void 0&&(n.appInstalled=xu.toJSON(e.appInstalled)),n},create(e){return T3.fromPartial(e??{})},fromPartial(e){let n=TO();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?xu.fromPartial(e.appInstalled):void 0,n}};l.set(T3.$type,T3);function RO(){return{}}var xu={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Gi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=RO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return xu.fromPartial(e??{})},fromPartial(e){return RO()}};l.set(xu.$type,xu);function NO(){return{logs:[]}}var Eu={$type:"devvit.cli.PlaytestCallState",encode(e,n=Gi.default.Writer.create()){for(let i of e.logs)mt.encode(i,n.uint32(10).fork()).ldelim();return n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=NO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.logs.push(mt.decode(i,i.uint32()));continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(n=>mt.fromJSON(n)):[]}},toJSON(e){let n={};return e.logs?.length&&(n.logs=e.logs.map(i=>mt.toJSON(i))),n},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let n=NO();return n.logs=e.logs?.map(i=>mt.fromPartial(i))||[],n}};l.set(Eu.$type,Eu);function IO(){return{url:""}}var Ou={$type:"devvit.cli.PlaytestConnect",encode(e,n=Gi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Gi.default.Reader?e:Gi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=IO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.url=i.string();continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{url:l6(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return Ou.fromPartial(e??{})},fromPartial(e){let n=IO();return n.url=e.url??"",n}};l.set(Ou.$type,Ou);function l6(e){return e!=null}var Ah="playtest",xO="ws://localhost:5678";function EO(e){let n=Ch();return n===""||n===e}function Ch(){return globalThis.location?new URL(location.href).searchParams.get(Ah)??void 0:void 0}var Dn=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},R3=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},N3,Hn,gh,OO,bh,Th,Rh,Nh,AU=15e3,s6=class{constructor(){N3.add(this),Hn.set(this,{type:"Init"}),bh.set(this,()=>{Dn(this,Hn,"f").type==="Opened"&&this.onState?.("Closed"),R3(this,Hn,Dn(this,N3,"m",OO).call(this),"f")}),Th.set(this,n=>{let i=T3.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),Rh.set(this,()=>{if(Dn(this,Hn,"f").type!=="Opening")throw Error(`invalid transition from ${Dn(this,Hn,"f").type}`);this.onState?.("Opened"),R3(this,Hn,{sock:Dn(this,Hn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),Nh.set(this,()=>{R3(this,Hn,Dn(this,N3,"m",gh).call(this),"f")})}close(){"timer"in Dn(this,Hn,"f")&&clearTimeout(Dn(this,Hn,"f").timer),"sock"in Dn(this,Hn,"f")&&(Dn(this,Hn,"f").sock.onopen=null,Dn(this,Hn,"f").sock.onmessage=null,Dn(this,Hn,"f").sock.onclose=null,Dn(this,Hn,"f").sock.close()),R3(this,Hn,{type:"Init"},"f")}open(){Dn(this,Hn,"f").type==="Init"&&R3(this,Hn,Dn(this,N3,"m",gh).call(this),"f")}send(n){"sock"in Dn(this,Hn,"f")?Dn(this,Hn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Hn=new WeakMap,bh=new WeakMap,Th=new WeakMap,Rh=new WeakMap,Nh=new WeakMap,N3=new WeakSet,gh=function(){let n=new WebSocket(xO);return n.onclose=Dn(this,bh,"f"),n.onmessage=Dn(this,Th,"f"),n.onopen=Dn(this,Rh,"f"),{sock:n,type:"Opening"}},OO=function(){return{timer:setTimeout(Dn(this,Nh,"f"),AU),type:"Retrying"}};var ui=function(e,n,i,d,r){if(d==="m")throw new TypeError("Private method is not writable");if(d==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof n=="function"?e!==n||!r:!n.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return d==="a"?r.call(e,i):r?r.value=i:n.set(e,i),i},ve=function(e,n,i,d){if(i==="a"&&!d)throw new TypeError("Private accessor was defined without a getter");if(typeof n=="function"?e!==n||!d:!n.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?d:i==="a"?d.call(e):d?d.value:n.get(e)},Zd,f6,li,ds,c6,x3,ad,$o,os,us,Wo,Ih,I3,p6,xh,PO,as,Eh,Oh,CU={debug:En.DEBUG,error:En.ERROR,info:En.INFO,log:En.DEBUG,trace:En.DEBUG,warn:En.WARN},h6=class{constructor(n,i,d){Zd.add(this),f6.set(this,void 0),li.set(this,void 0),ds.set(this,!1),c6.set(this,0),x3.set(this,void 0),ad.set(this,{}),$o.set(this,void 0),os.set(this,()=>{}),us.set(this,void 0),Wo.set(this,void 0),Ih.set(this,Ch()),I3.set(this,!1),p6.set(this,void 0),xh.set(this,r=>{let t=r.data,[s]=t;switch(s){case Ir.READY:{let[,f]=t;ui(this,p6,f,"f"),ve(this,us,"f")?.plugins?ve(this,Zd,"m",PO).call(this):ve(this,Zd,"m",Eh).call(this);break}case Ir.PLUGINS_CONFIGURED:ve(this,Zd,"m",Eh).call(this);break;case Ir.BUNDLE_LOADED:{let[,f,c]=t;ve(this,Zd,"m",as).call(this,f),ui(this,ds,!0,"f"),ve(this,$o,"f")?.resolve({metrics:{init:ve(this,p6,"f"),loadBundle:c}}),ui(this,$o,void 0,"f");break}case Ir.BUNDLE_LOAD_FAILED:{let[,,f,c]=t;ve(this,Zd,"m",as).call(this,c),ve(this,$o,"f")?.reject(f),ui(this,$o,void 0,"f");break}case Ir.RETURN:{let[,f,c,v]=t;ve(this,Zd,"m",as).call(this,v),ve(this,ad,"f")[f]?.resolve(c),delete ve(this,ad,"f")[f];break}case Ir.ERROR:{let[,f,c,v]=t;ve(this,Zd,"m",as).call(this,v),ve(this,ad,"f")[f]?.reject(c),delete ve(this,ad,"f")[f];break}case Ir.CIRCUIT_BREAKER:{let[,f,c,v]=t;ve(this,ad,"f")[f]?.reject(new b4(c,v)),delete ve(this,ad,"f")[f];break}case Ir.PLUGIN_CALL:{let[,f,c,v,w,b]=t;ve(this,us,"f")?.callback(f,c,v,w,b);break}case Ir.UNHANDLED_REJECTION:{let[,,f,c]=t;ve(this,Zd,"m",as).call(this,c),ve(this,os,"f").call(this,"UnhandledRejection",f);break}}}),Oh.set(this,r=>{switch(r){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),ve(this,Wo,"f")?.close();let t=new URL(location.href);t.searchParams.set(Ah,ve(this,Ih,"f")??""),location.assign(t),location.reload();break}}}),ui(this,f6,n,"f"),i&&ui(this,os,i,"f"),d&&ui(this,us,d,"f")}get ready(){return ve(this,ds,"f")}get runtimeDebugLogging(){return ve(this,I3,"f")}set runtimeDebugLogging(n){n!==ve(this,I3,"f")&&(ui(this,I3,n,"f"),this.runtimeDebugLogging&&ve(this,li,"f")?.postMessage([od.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(ve(this,li,"f"))throw new Error("Bundle already loaded");let i=EO(Sh(n));i&&(ui(this,Wo,new s6,"f"),ve(this,Wo,"f").onState=ve(this,Oh,"f")),ve(this,Wo,"f")?.open();let d=new Worker(URL.createObjectURL(ve(this,f6,"f")),{name:`App: ${gO(n)}`,type:"module"});return d.onerror=r=>ve(this,os,"f").call(this,"Error",r.error),d.onmessageerror=r=>ve(this,os,"f").call(this,"MessageError",r.data),d.onmessage=ve(this,xh,"f"),ui(this,li,d,"f"),ui(this,x3,n,"f"),this.runtimeDebugLogging&&ve(this,li,"f").postMessage([od.ENABLE_DEBUG_LOGGING]),i&&ve(this,li,"f").postMessage([od.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ui(this,$o,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!ve(this,ds,"f")||!ve(this,li,"f"))throw new Error("No bundle loaded");let t=ui(this,c6,(r=ve(this,c6,"f"),++r),"f"),s=new Promise((f,c)=>{ve(this,ad,"f")[t]={resolve:f,reject:c}});return ve(this,li,"f").postMessage([od.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){ve(this,li,"f")?.postMessage([od.PLUGIN_RESPONSE,n,i])}quit(){ve(this,Wo,"f")?.close(),ui(this,Wo,void 0,"f"),ui(this,ds,!1,"f"),ve(this,li,"f")&&(ve(this,li,"f").postMessage([od.QUIT]),ve(this,li,"f").onerror=null,ve(this,li,"f").onmessageerror=null,ve(this,li,"f").onmessage=null,ve(this,li,"f").terminate()),ui(this,li,void 0,"f");for(let{reject:n}of Object.values(ve(this,ad,"f")))n(Error("worker terminated"));ui(this,ad,{},"f"),ve(this,$o,"f")?.reject(Error("worker terminated")),ui(this,$o,void 0,"f")}};f6=new WeakMap,li=new WeakMap,ds=new WeakMap,c6=new WeakMap,x3=new WeakMap,ad=new WeakMap,$o=new WeakMap,os=new WeakMap,us=new WeakMap,Wo=new WeakMap,Ih=new WeakMap,I3=new WeakMap,p6=new WeakMap,xh=new WeakMap,Oh=new WeakMap,Zd=new WeakSet,PO=function(){ve(this,li,"f")?.postMessage([od.ENABLE_PLUGINS,ve(this,us,"f")?.plugins??[]])},as=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:CU[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};ve(this,Wo,"f")?.send({callState:d})},Eh=function(){ve(this,li,"f")?.postMessage([od.LOAD_BUNDLE,ve(this,x3,"f")]),ui(this,x3,void 0,"f")};var Ph="RenderPostContent",gU=new Set([Ph]);function MO(e){if(gU.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var ls,E3,v6=class{constructor(n){we(this,ls);we(this,E3);Be(this,ls,n)}set env(n){Be(this,ls,n)}set props(n){Be(this,E3,n)}build(n,i){return new u6({state:n,events:i.map(d=>d.uiEvent),env:N(this,ls),props:N(this,E3)})}};ls=new WeakMap,E3=new WeakMap;var bt,O3,y6,m6=class{constructor(){we(this,bt);we(this,O3,!1);we(this,y6,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===nl.fullName&&d===nl.methods.send.name&&N(this,bt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!N(this,bt)?.ready}set runtimeDebugLogging(n){Be(this,O3,n),N(this,bt)&&(N(this,bt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),Be(this,bt,n?new h6(n,(i,d)=>console.error(i,d),{callback:N(this,y6),plugins:[]}):void 0),N(this,bt)&&(N(this,bt).runtimeDebugLogging=N(this,O3))}unload(){N(this,bt)?.quit()}async load(n){this.unload();try{return await N(this,bt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!N(this,bt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),N(this,bt)?.call(MO(n),i.uiRequest,this.metadata).then(t=>d(new b3(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};bt=new WeakMap,O3=new WeakMap,y6=new WeakMap;var k6=class{isReady(){return!!this.remote}load(n){this.remote=n}handle(n,i,d,r){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[MO(n)](i.uiRequest,this.metadata).then(t=>d(new b3(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var Go,zo,P3,S6=class{constructor(n){we(this,Go,new Map);we(this,zo,new Map);we(this,P3);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),Be(this,P3,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),N(this,zo).set(n.id,n),N(this,Go).set(n.id,window.setInterval(()=>{N(this,P3).submit([new dd({scope:Mn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(N(this,zo));n.forEach(d=>{i.delete(d.id),N(this,zo).has(d.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",d),this.add(d))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",i);for(let[d]of i)this.remove(d)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let n of N(this,Go).values())clearInterval(n);N(this,Go).clear(),N(this,zo).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...N(this,zo).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of N(this,Go).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),N(this,zo).delete(n),clearInterval(N(this,Go).get(n)),N(this,Go).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};Go=new WeakMap,zo=new WeakMap,P3=new WeakMap;var _O=e=>e.message==="ServerCallRequired",Mh=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){_O(n[0])||console.error(this.tag(),...n)}info(n){console.info(this.tag(),...n)}warn(n){console.warn(this.tag(),...n)}tag(){return"[kmp-dispatcher]"}},M3,_3,_h=class{constructor(n,i){we(this,M3);we(this,_3);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};Be(this,M3,n),Be(this,_3,i)}logRuntimeError(n){var i;_O(n)||(console.error("[kmp-dispatcher-perf-analytics] error",n),(i=N(this,_3))==null||i.call(this,n))}logRuntimeTrace(n){var i;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n),(i=N(this,M3))==null||i.call(this,n)}};M3=new WeakMap,_3=new WeakMap;CO();var bU=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},TU=["showToast","showForm","navigateToUrl","createOrder"],Ol,Pl,xr,B3,Ml,ud,ss,w6=class{constructor(n,i,d){we(this,Ol);we(this,Pl);we(this,xr);we(this,B3);this.hasRendered=!1;we(this,Ml);we(this,ud);we(this,ss);Be(this,Ol,new v6(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),Be(this,xr,new t6(n??{},N(this,Ol),Ph,{logger:new Mh,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new _h(d.performanceTracker,d.errorTracker),errorHandler:r=>this.onError?.(r)})),Be(this,Pl,new S6(N(this,xr))),Be(this,Ml,new k6),Be(this,ud,new m6),this.init()}get state(){return N(this,xr).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[ku.Debug]={values:d}),N(this,ud).metadata=i,N(this,Ml).metadata=i}set onPluginCall(n){N(this,ud).onPluginCall=n}set runtimeDebugLogging(n){N(this,ud).runtimeDebugLogging=n}subscribe(n){Be(this,B3,N(this,xr).subscribe((...i)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",i[0]);let[{response:d}]=i;d.uiResponse.effects.forEach(r=>{if(TU.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&N(this,Pl).clear(),N(this,Pl).apply(t.map(([s,f])=>new dt(s,bU(f.duration))));return}if(r.webView){this.onWebViewMessage?.(r);return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(r,null,2)}`)}),n(...i)}))}submit(...n){N(this,xr).submit(...n)}unsubscribe(){N(this,B3)?.unsubscribe()}init(){N(this,xr).init(N(this,ud),N(this,Ml),N(this,Pl))}togglePause(n){n?Be(this,ss,N(this,xr).pause()):N(this,ss)&&N(this,xr).resume(N(this,ss))}resetAppState(){this.hasRendered=!1,N(this,xr).reset()}setEnv(n){N(this,Ol).env=n}setProps(n){N(this,Ol).props=n}remoteLoad(...n){N(this,Ml).load(...n)}async localLoad(...n){return N(this,ud).reset(),await N(this,ud).load(...n)}localLoadWorker(...n){N(this,ud).setLocalSrc(...n)}};Ol=new WeakMap,Pl=new WeakMap,xr=new WeakMap,B3=new WeakMap,Ml=new WeakMap,ud=new WeakMap,ss=new WeakMap;function BO(e,n,i,d){let r=d.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(r.length<3)return"";let[t,s,f]=r;if(!n||!s||!f)return"";let c=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",c).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var _l,Bl,Ll,Mu,L3,cn,A6,C6,g6,b6,Vd,Pu,T6,R6,Ti=class extends dr{constructor(){super();we(this,Vd);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.disableAssetSandbox=!1;we(this,_l);we(this,Bl);we(this,Ll);we(this,Mu,"");we(this,L3,!1);we(this,cn);we(this,A6,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:i=>this.disableAssetSandbox?i:BO(this.webViewUrlTemplate,this.metadata?.[ku.Subreddit]?.values?.[0],N(this,Mu),i),onAction:i=>{let d={};i.type===Bi.ACTION_CLICK||N(this,L3)?d.userAction={actionId:i.id,data:i.data??{}}:i.type===Bi.ACTION_WEBVIEW&&(d.webView={postMessage:{message:i.data}}),N(this,cn)?.submit([new dd({scope:Mn.ALL,hook:i.id,...d})])},stackDirection:Te.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));we(this,C6,i=>{TI(i)||console.error(i),pn(this,Vd,Pu).call(this,"devvit-ui-error",{err:i,type:"Error"})});we(this,g6,(i,d,r,t,s)=>{d===nl.fullName&&r===nl.methods.send.name&&pn(this,Vd,Pu).call(this,"devvit-realtime-send",{event:t})});we(this,b6,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,N(this,_l)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=N(this,_l)):Be(this,_l,this._rootBlock.config?.rootConfig?.height||r8))});we(this,T6,i=>{pn(this,Vd,Pu).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>N(this,cn)?.submit([new dd(d)]),metadata:this.metadata})});we(this,R6,async i=>{if(await this.updateComplete,i.webView?.postMessage?.app){let d=[];if(i.webView.postMessage.webViewId){let r=this._blocksRenderer?.findBlockById(i.webView.postMessage.webViewId);r?.blockType!=="web-view"||!r?.element?console.error("Invalid postMessage request: could not find block with ID",i.webView.postMessage.webViewId):d.push(r)}else{let r=this._blocksRenderer?.findBlocksByType("web-view")??[];r.length===0?console.error("Invalid postMessage request: could not find a WebView"):d.push(...r)}for(let r of d)r?.element?.postMessage(i.webView.postMessage.app)}});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[v4]}async connectedCallback(){super.connectedCallback(),Be(this,cn,new w6({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[ku.Language]?.values?.[0],timezone:this.metadata?.[ku.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:i=>{pn(this,Vd,Pu).call(this,gN,{name:i.spanName,duration:parseInt(i.durationMs),target:i.target,intent:i.intent,eventCount:i.eventCount})},errorTracker:i=>{pn(this,Vd,Pu).call(this,bN,{message:i.message,origin:i.origin,version:i.version})}})),N(this,cn).onPluginCall=N(this,g6),N(this,cn).onError=N(this,C6),N(this,cn).onUserAction=N(this,T6),N(this,cn).onWebViewMessage=N(this,R6),N(this,cn).subscribe(i=>{N(this,b6).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),Be(this,Bl,new ResizeObserver(NI(i=>{i.length!==0&&(this.dimensions=ex(i[0],window,document.body))},600))),N(this,Bl).observe(this,{box:"content-box"}),Be(this,Ll,new IntersectionObserver(i=>{i.forEach(d=>{N(this,cn)?.togglePause(!d.isIntersecting)})})),N(this,Ll).observe(this)}disconnectedCallback(){N(this,Bl)?.unobserve(this),N(this,Bl)?.disconnect(),N(this,Ll)?.unobserve(this),N(this,Ll)?.disconnect(),N(this,cn)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?Nt`<div class="relative">
626
626
  <devvit-blocks-renderer
627
627
  class="${this.scheme??""}"
628
628
  .block="${this._rootBlock}"