@devvit/ui-renderer 0.11.6-next-2025-01-13-6cc27b78a.0 → 0.11.6-next-2025-01-15-1caf0b617.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`},bN=e=>{let{createElement:n}=Ke(),{attributes:i,selected:d,r
622
622
  style="${d(t)}"
623
623
  >
624
624
  ${r===me?"":r}
625
- </div>`}else return r}var zc,Kc,C4,Cl=class extends rr{constructor(){super(...arguments);Se(this,zc,window.matchMedia("(prefers-color-scheme: dark)"));Se(this,Kc,()=>this.requestUpdate());Se(this,C4,()=>({stackDirection:Ce.UNRECOGNIZED}))}static get styles(){return[h4]}connectedCallback(){super.connectedCallback(),x(this,zc)?.addEventListener("change",x(this,Kc))}disconnectedCallback(){super.disconnectedCallback(),x(this,zc)?.removeEventListener("change",x(this,Kc))}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===fe.BLOCK_ROOT){let i={...x(this,C4).call(this),...this.renderContext?.()??{}},d=new p4,r=t8(this.block,i);return d.finish(),this.dispatchEvent(I0(Vc,{name:"blocks_layout",timeStart:d.timeStart,timeEnd:d.timeEnd})),Tt` <div class="${Xo(this.class)}">${r}</div>`}return Tt`${gN({creative:Tt`<slot name="empty-state-image"></slot>`,title:Wp("Whoops!",{desc:"Header for message to display when rendering fails"}),description:Wp("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};zc=new WeakMap,Kc=new WeakMap,C4=new WeakMap,He([bn({attribute:!1})],Cl.prototype,"block",2),He([bn({attribute:!1})],Cl.prototype,"renderContext",2),He([bn()],Cl.prototype,"class",2),Cl=He([CN(),E0("devvit-blocks-renderer")],Cl);var Rx="ServerCallRequired";var b4=class extends Error{constructor(n,i){super(Rx),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function Nx(e){return e?.message===Rx}var _o=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",Username:"devvit-user-name",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",AppDependencies:"devvit-app-dependencies"}),xx;(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"})(xx||(xx={}));function Ix(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 Ex(e,n){if(!e)throw Error(n)}var g4;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(g4||(g4={}));function Q_(e){return e.startsWith(g4.LINK)}function j_(e){Ex(Q_(e),`Expected link id to start with ${g4.LINK}, got ${e}}`)}function Ox(e){return j_(e),e}var eB=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,M0=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let n=e.match(eB);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},Px=e=>e==="*"||e==="x"||e==="X",Mx=e=>{let n=parseInt(e,10);return isNaN(n)?e:n},nB=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],iB=(e,n)=>{if(Px(e)||Px(n))return 0;let[i,d]=nB(Mx(e),Mx(n));return i>d?1:i<d?-1:0},r8=(e,n)=>{for(let i=0;i<Math.max(e.length,n.length);i++){let d=iB(e[i]||"0",n[i]||"0");if(d!==0)return d}return 0};var _x=(e,n)=>{let i=M0(e),d=M0(n),r=i.pop(),t=d.pop(),s=r8(i,d);return s!==0?s:r&&t?r8(r.split("."),t.split(".")):r||t?r?-1:1:0};var d8=(e,n,i)=>{tB(i);let d=_x(e,n);return Lx[i].includes(d)},Lx={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Bx=Object.keys(Lx),tB=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Bx.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Bx.join("|")}`)};function Fx(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,p=f<0?Math.max(i+f,0):Math.min(f,i);t<p;)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 eI=Math.clz32,f8=ArrayBuffer.isView,kn=Math.imul;V(b8,"CharSequence",Jo);V(g8,"Number",te);V(T8,"Unit",di);V(U0,"IntCompanionObject",di);V(gi,"Collection",Jo);V(Zo,"AbstractCollection",te,U,[gi]);V(Qr,"AbstractMutableCollection",te,Zo,[Zo,gi]);V(n3,"IteratorImpl",te);V(V0,"List",Jo,U,[gi]);V(br,"AbstractMutableList",te,Qr,[Qr,gi,V0]);V(Uo,"Map",Jo);V(gr,"AbstractMap",te,U,[Uo]);V(_0,"AbstractMutableMap",te,gr,[gr,Uo]);V(d3,"Set",Jo,U,[gi]);V(Lo,"AbstractMutableSet",te,Qr,[Qr,gi,d3]);V(rI,"Companion",di);V(Kn,"ArrayList",te,br,[br,gi,V0],rt);V(jr,"HashMap",te,_0,[_0,Uo],kB);V(Tr,"HashMapEntrySetBase",te,Lo,[gi,d3,Lo]);V(x8,"HashMapEntrySet",te,Tr);V(wu,"HashSet",te,Lo,[Lo,gi,d3],I8);V(sI,"Companion",di);V(Vo,"Itr",te);V(M8,"KeysItr",te,Vo);V(t3,"EntriesItr",te,Vo);V(Fo,"Entry",Jo);V(gl,"EntryRef",te,U,[Fo]);function rB(e){var n;e:{var i;if(On(e,gi)?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&&On(t,Fo)?s=this.c4(t):s=!1,!s){n=!1;break e}}n=!0}return n}V(fI,"InternalMap",Jo);V(Ii,"InternalHashMap",te,U,[fI],E8);V(B4,"LinkedHashMap",te,jr,[jr,Uo],r3);V(nd,"StringBuilder",te,U,[b8],_8);V(yI,"Companion",di);V(SI,"Char",te);V(wI,"Companion",di);V(Ct,"Enum",te);V(L4,U,te);V(OI,"Companion",di);V(Ve,"Long",te,g8);V(Ho,"Exception",te,Error,U,qI);V(qi,"RuntimeException",te,Ho,U,zI);V($0,"IllegalArgumentException",te,qi,U,$I);V(G0,"IndexOutOfBoundsException",te,qi,U,WI);V(z0,"IllegalStateException",te,qi,U,GI);V(U4,"UnsupportedOperationException",te,qi,U,K0);V(X0,"NoSuchElementException",te,qi,U,qo);V(Z4,"ConcurrentModificationException",te,qi,U,V8);V(Y0,"ArithmeticException",te,qi,U,XI);V(V4,"NullPointerException",te,qi,U,J8);V(J4,"ClassCastException",te,qi,U,H8);V(Q0,"UninitializedPropertyAccessException",te,qi,U,QI);V(Au,"Companion",di);V(nE,"Companion",di);V(H4,"Companion",di);V(tE,"Companion",di);V(Pn,"ArrayDeque",te,br,U,s3);V(rd,"EmptyList",di,U,[V0]);V(q4,"EmptyIterator",di);V(Do,"ArrayAsCollection",te,U,[gi]);V(D4,"IntIterator",te);V(oE,"Companion",di);V(_d,"IntProgression",te);V(Su,"IntRange",te,_d);V($4,"IntProgressionIterator",te,D4);V(W8,"Companion",di);V(bi,"Pair",te);function b8(){}function g8(){}function T8(){}c(T8).toString=function(){return"kotlin.Unit"};var Ie;function U0(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}c(U0).c=function(){return this.MIN_VALUE};c(U0).d=function(){return this.MAX_VALUE};c(U0).e=function(){return this.SIZE_BYTES};c(U0).f=function(){return this.SIZE_BITS};var R8;function dB(e){return e!==e}function oB(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-eI(e)|0)}return n}function nI(e){return tF(e)}function aB(e,n){return n}function uB(e,n){return J0(Array(n),null)}function O4(e){return oF([e])}function Z0(e){var n;return e.toArray!==void 0?n=e.toArray():n=nI(e),n}function Ue(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),f8(n)&&f8(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 p=f;f=f+1|0,n[i+p|0]=e[d+p|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var y=v;v=v+-1|0,n[i+y|0]=e[d+y|0]}while(0<=v)}}function lB(e){return e<0&&aF(),e}function Qr(){Zo.call(this)}c(Qr).j=function(e){this.k();for(var n=this.l();n.m();)if(Ze(n.o(),e))return n.n(),!0;return!1};c(Qr).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};c(Qr).toJSON=function(){return this.toArray()};c(Qr).k=function(){};function n3(e){this.w_1=e,this.u_1=0,this.v_1=-1}c(n3).m=function(){return this.u_1<this.w_1.q()};c(n3).o=function(){if(!this.m())throw qo();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)};c(n3).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw u3(id(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function br(){Qr.call(this),this.y_1=0}c(br).i=function(e){return this.k(),this.a1(this.q(),e),!0};c(br).l=function(){return new n3(this)};c(br).r=function(e){return this.b1(e)>=0};c(br).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=i;break e}i=i+1|0}n=-1}return n};c(br).equals=function(e){return e===this?!0:e!=null&&On(e,V0)?tt.c1(this,e):!1};c(br).hashCode=function(){return tt.d1(this)};function _0(){gr.call(this),this.g1_1=null,this.h1_1=null}c(_0).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Ze(e,d)){var r=i.m1();return n.n(),r}}return null};c(_0).k=function(){};function Lo(){Qr.call(this)}c(Lo).equals=function(e){return e===this?!0:e!=null&&On(e,d3)?q8.s1(this,e):!1};c(Lo).hashCode=function(){return q8.t1(this)};function iI(e){if(!(e>=0)){var n="capacity must be non-negative.";throw ed(id(n))}return J0(Array(e),null)}function tI(e,n){e[n]=null}function Ux(e,n,i){e.fill(null,n,i)}function Zx(e,n){return _L(e,n)}function rI(){c8=this;var e=this,n=P4(0);n.w1_1=!0,e.x1_1=n}var c8;function sB(){return c8==null&&new rI,c8}function fB(e){var n=[];return Kn.call(e,n),e}function rt(){return fB(Ge(c(Kn)))}function cB(e,n){var i=[];if(Kn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw ed(id(d))}return n}function P4(e){return cB(e,Ge(c(Kn)))}function pB(e,n){var i=Z0(e);return Kn.call(n,i),n}function N8(e){return pB(e,Ge(c(Kn)))}function hB(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function dI(e,n){return tt.y1(n,e.q()),n}function vB(e,n){return tt.z1(n,e.q()),n}function Kn(e){sB(),br.call(this),this.v1_1=e,this.w1_1=!1}c(Kn).q=function(){return this.v1_1.length};c(Kn).x=function(e){var n=this.v1_1[dI(this,e)];return n==null||n!=null?n:rn()};c(Kn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};c(Kn).a1=function(e,n){this.k(),this.v1_1.splice(vB(this,e),0,n),this.y_1=this.y_1+1|0};c(Kn).p=function(e){if(this.k(),e.t())return!1;for(var n=hB(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=lB(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};c(Kn).z=function(e){this.k(),dI(this,e),this.y_1=this.y_1+1|0;var n;return e===E4(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};c(Kn).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,Ze(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};c(Kn).b1=function(e){return hI(this.v1_1,e)};c(Kn).toString=function(){return QB(this.v1_1)};c(Kn).a2=function(){return[].slice.call(this.v1_1)};c(Kn).toArray=function(){return this.a2()};c(Kn).k=function(){if(this.w1_1)throw K0()};function mB(e,n){return _0.call(n),jr.call(n),n.f2_1=e,n}function oI(e){return mB(E8(),e),e}function kB(){return oI(Ge(c(jr)))}c(jr).p1=function(e){return this.f2_1.h2(e)};c(jr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new x8(this.f2_1);this.g2_1=i,n=i}else n=e;return n};c(jr).r1=function(e){return this.f2_1.r1(e)};c(jr).i1=function(e,n){return this.f2_1.i1(e,n)};c(jr).j1=function(e){return this.f2_1.j1(e)};c(jr).q=function(){return this.f2_1.q()};function jr(){this.g2_1=null}function x8(e){Tr.call(this,e)}c(x8).l=function(){return this.j2_1.k2()};function Tr(e){Lo.call(this),this.j2_1=e}c(Tr).q=function(){return this.j2_1.q()};c(Tr).t=function(){return this.j2_1.q()===0};c(Tr).l2=function(e){return this.j2_1.n2(e)};c(Tr).r=function(e){return e!=null&&On(e,Fo)?this.l2(e!=null&&On(e,Fo)?e:rn()):!1};c(Tr).m2=function(e){throw K0()};c(Tr).i=function(e){return this.m2(e!=null&&On(e,Fo)?e:rn())};c(Tr).p=function(e){throw K0()};c(Tr).s=function(e){return this.j2_1.o2(e)};c(Tr).k=function(){return this.j2_1.k()};function yB(e,n){return Lo.call(n),wu.call(n),n.p2_1=e,n}function SB(e){return yB(E8(),e),e}function I8(){return SB(Ge(c(wu)))}c(wu).i=function(e){return this.p2_1.i1(e,!0)==null};c(wu).r=function(e){return this.p2_1.h2(e)};c(wu).t=function(){return this.p2_1.q()===0};c(wu).l=function(){return this.p2_1.q2()};c(wu).q=function(){return this.p2_1.q()};function wu(){}function aI(e,n){return oB(kn(R4(n,1),3))}function uI(e,n){return eI(n)+1|0}function wB(e){return AB(8,e),e}function E8(){return wB(Ge(c(Ii)))}function AB(e,n){return Ii.call(n,iI(e),null,new Int32Array(e),new Int32Array(aI(i3,e)),2,0),n}function B0(e){return e.r2_1.length}function Qt(e){return e.u2_1.length}function O8(e){e.y2_1=e.y2_1+1|0}function CB(e,n){bB(e,n)?P8(e,Qt(e)):gB(e,e.w2_1+n|0)}function bB(e,n){var i=B0(e)-e.w2_1|0,d=e.w2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(B0(e)/4|0):!1}function gB(e,n){if(n<0)throw KI("too many elements");if(n>B0(e)){var i=tt.b3(B0(e),n);e.r2_1=Zx(e.r2_1,i);var d=e,r=e.s2_1;d.s2_1=r==null?null:Zx(r,i),e.t2_1=ML(e.t2_1,i);var t=aI(i3,i);t>Qt(e)&&P8(e,t)}}function TB(e){var n=e.s2_1;if(n!=null)return n;var i=iI(B0(e));return e.s2_1=i,i}function M4(e,n){return n==null?0:kn(Zn(n),-1640531527)>>>e.x2_1|0}function RB(e){for(var n=0,i=0,d=e.s2_1;n<e.w2_1;)e.t2_1[n]>=0&&(e.r2_1[i]=e.r2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;Ux(e.r2_1,i,e.w2_1),d==null||Ux(d,i,e.w2_1),e.w2_1=i}function P8(e,n){O8(e),e.w2_1>e.z2_1&&RB(e),n!==Qt(e)?(e.u2_1=new Int32Array(n),e.x2_1=uI(i3,n)):PL(e.u2_1,0,0,Qt(e));for(var i=0;i<e.w2_1;){var d=i;if(i=d+1|0,!NB(e,d))throw u3("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function NB(e,n){for(var i=M4(e,e.r2_1[n]),d=e.v2_1;;){var r=e.u2_1[i];if(r===0)return e.u2_1[i]=n+1|0,e.t2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=Qt(e)-1|0)}}function _4(e,n){for(var i=M4(e,n),d=e.v2_1;;){var r=e.u2_1[i];if(r===0)return-1;if(r>0&&Ze(e.r2_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=Qt(e)-1|0)}}function xB(e,n){e.k();e:for(;;)for(var i=M4(e,n),d=N4(kn(e.v2_1,2),Qt(e)/2|0),r=0;;){var t=e.u2_1[i];if(t<=0){if(e.w2_1>=B0(e)){CB(e,1);continue e}var s=e.w2_1;e.w2_1=s+1|0;var f=s;return e.r2_1[f]=n,e.t2_1[f]=i,e.u2_1[i]=f+1|0,e.z2_1=e.z2_1+1|0,O8(e),r>e.v2_1&&(e.v2_1=r),f}if(Ze(e.r2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){P8(e,kn(Qt(e),2));continue e}var p=i;i=p-1|0,p===0&&(i=Qt(e)-1|0)}}function IB(e,n){e.k();var i=_4(e,n);return i<0?-1:(lI(e,i),i)}function lI(e,n){tI(e.r2_1,n),EB(e,e.t2_1[n]),e.t2_1[n]=-1,e.z2_1=e.z2_1-1|0,O8(e)}function EB(e,n){for(var i=n,d=n,r=0,t=N4(kn(e.v2_1,2),Qt(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=Qt(e)-1|0),r=r+1|0,r>e.v2_1)return e.u2_1[d]=0,Ie;var f=e.u2_1[i];if(f===0)return e.u2_1[d]=0,Ie;if(f<0)e.u2_1[d]=-1,d=i,r=0;else{var p=M4(e,e.r2_1[f-1|0]);((p-i|0)&(Qt(e)-1|0))>=r&&(e.u2_1[d]=f,e.t2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.u2_1[d]=-1,Ie}}function OB(e,n){return e.z2_1===n.q()?e.o2(n.k1()):!1}function sI(){this.c3_1=-1640531527,this.d3_1=8,this.e3_1=2,this.f3_1=-1}var i3;function Vo(e){this.g3_1=e,this.h3_1=0,this.i3_1=-1,this.j3_1=this.g3_1.y2_1,this.k3()}c(Vo).k3=function(){for(;this.h3_1<this.g3_1.w2_1&&this.g3_1.t2_1[this.h3_1]<0;)this.h3_1=this.h3_1+1|0};c(Vo).m=function(){return this.h3_1<this.g3_1.w2_1};c(Vo).n=function(){if(this.l3(),this.i3_1===-1){var e="Call next() before removing element from the iterator.";throw u3(id(e))}this.g3_1.k(),lI(this.g3_1,this.i3_1),this.i3_1=-1,this.j3_1=this.g3_1.y2_1};c(Vo).l3=function(){if(this.g3_1.y2_1!==this.j3_1)throw V8()};function M8(e){Vo.call(this,e)}c(M8).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=this.g3_1.r2_1[this.i3_1];return this.k3(),i};function t3(e){Vo.call(this,e)}c(t3).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=new gl(this.g3_1,this.i3_1);return this.k3(),i};c(t3).u3=function(){if(this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=this.g3_1.r2_1[this.i3_1],d=i==null?null:Zn(i),r=d??0,t=q0(this.g3_1.s2_1)[this.i3_1],s=t==null?null:Zn(t),f=r^(s??0);return this.k3(),f};c(t3).v3=function(e){if(this.h3_1>=this.g3_1.w2_1)throw qo();var n=this,i=this.h3_1;this.h3_1=i+1|0,n.i3_1=i;var d=this.g3_1.r2_1[this.i3_1];Ze(d,this.g3_1)?e.y3("(this Map)"):e.x3(d),e.z3(61);var r=q0(this.g3_1.s2_1)[this.i3_1];Ze(r,this.g3_1)?e.y3("(this Map)"):e.x3(r),this.k3()};function gl(e,n){this.a4_1=e,this.b4_1=n}c(gl).l1=function(){return this.a4_1.r2_1[this.b4_1]};c(gl).m1=function(){return q0(this.a4_1.s2_1)[this.b4_1]};c(gl).equals=function(e){var n,i;return e!=null&&On(e,Fo)?i=Ze(e.l1(),this.l1()):i=!1,i?n=Ze(e.m1(),this.m1()):n=!1,n};c(gl).hashCode=function(){var e=this.l1(),n=e==null?null:Zn(e),i=n??0,d=this.m1(),r=d==null?null:Zn(d);return i^(r??0)};c(gl).toString=function(){return""+this.l1()+"="+this.m1()};function Ii(e,n,i,d,r,t){this.r2_1=e,this.s2_1=n,this.t2_1=i,this.u2_1=d,this.v2_1=r,this.w2_1=t,this.x2_1=uI(i3,Qt(this)),this.y2_1=0,this.z2_1=0,this.a3_1=!1}c(Ii).q=function(){return this.z2_1};c(Ii).r1=function(e){var n=_4(this,e);return n<0?null:q0(this.s2_1)[n]};c(Ii).h2=function(e){return _4(this,e)>=0};c(Ii).i1=function(e,n){var i=xB(this,e),d=TB(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};c(Ii).j1=function(e){var n=IB(this,e);if(n<0)return null;var i=q0(this.s2_1),d=i[n];return tI(i,n),d};c(Ii).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&On(e,Uo)?i=OB(this,e):i=!1,n=i}return n};c(Ii).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.u3()|0;return e};c(Ii).toString=function(){var e=_B(2+kn(this.z2_1,3)|0);e.y3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.y3(", "),i.v3(e),n=n+1|0;return e.y3("}"),e.toString()};c(Ii).k=function(){if(this.a3_1)throw K0()};c(Ii).n2=function(e){var n=_4(this,e.l1());return n<0?!1:Ze(q0(this.s2_1)[n],e.m1())};c(Ii).c4=function(e){return this.n2(On(e,Fo)?e:rn())};c(Ii).q2=function(){return new M8(this)};c(Ii).k2=function(){return new t3(this)};function fI(){}function PB(e){return oI(e),B4.call(e),e}function r3(){return PB(Ge(c(B4)))}c(B4).k=function(){return this.f2_1.k()};function B4(){}function MB(e,n){return cI(n),n}function _B(e){return MB(e,Ge(c(nd)))}function cI(e){return nd.call(e,""),e}function _8(){return cI(Ge(c(nd)))}function nd(e){this.w3_1=e!==void 0?e:""}c(nd).a=function(){return this.w3_1.length};c(nd).b=function(e){var n=this.w3_1,i;if(e>=0&&e<=lE(n))i=L0(n,e);else throw W0("index: "+e+", length: "+this.a()+"}");return i};c(nd).z3=function(e){return this.w3_1=this.w3_1+x4(e),this};c(nd).j4=function(e){return this.w3_1=this.w3_1+o3(e),this};c(nd).x3=function(e){return this.w3_1=this.w3_1+o3(e),this};c(nd).y3=function(e){var n=this,i=this.w3_1;return n.w3_1=i+(e??"null"),this};c(nd).toString=function(){return this.w3_1};function Vx(e){var n=x4(e).toUpperCase();return n.length>1?e:L0(n,0)}function BB(e,n,i,d,r,t){return t=t===U?!1:t,fE(e,n,i,d,r,t)}function B8(e){switch(e.length){case 0:return Rr();case 1:return O4(e[0]);default:return LB(e)}}function pI(e){return e.length-1|0}function LB(e){return N8(dF(e))}function hI(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,Ze(n,e[f]))return f}while(t<=s)}return-1}function FB(e,n){return hI(e,n)>=0}function UB(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,ZB(e,_8(),n,i,d,r,t,s).toString()}function ZB(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.j4(d);var p=0,v=0,y=e.length;e:for(;v<y;){var g=e[v];if(v=v+1|0,p=p+1|0,p>1&&n.j4(i),t<0||p<=t)uE(n,g,f);else break e}return t>=0&&p>t&&n.j4(s),n.j4(r),n}function vI(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,VB(e,_8(),n,i,d,r,t,s).toString()}function VB(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.j4(d);var p=0,v=e.l();e:for(;v.m();){var y=v.o();if(p=p+1|0,p>1&&n.j4(i),t<0||p<=t)uE(n,y,f);else break e}return t>=0&&p>t&&n.j4(s),n.j4(r),n}function mI(e){if(e.t())throw l3("List is empty.");return e.x(0)}function kI(e,n){if(On(n,gi)){var i=P4(e.q()+n.q()|0);return i.p(e),i.p(n),i}else{var d=N8(e);return uF(d,n),d}}function R4(e,n){return e<n?n:e}function JB(e,n){return aE.k4(e,n,-1)}function N4(e,n){return e>n?n:e}function HB(e){var n=e&65535;return n}function Jx(e){return e}function x4(e){return String.fromCharCode(e)}function yI(){p8=this,this.l4_1=0,this.m4_1=65535,this.n4_1=55296,this.o4_1=56319,this.p4_1=56320,this.q4_1=57343,this.r4_1=55296,this.s4_1=57343,this.t4_1=2,this.u4_1=16}var p8;function Hx(){return p8==null&&new yI,p8}function SI(){}function V0(){}function gi(){}function Fo(){}function Uo(){}function d3(){}function wI(){}var qB;function Ct(e,n){this.v4_1=e,this.w4_1=n}c(Ct).x4=function(){return this.v4_1};c(Ct).y4=function(){return this.w4_1};c(Ct).z4=function(e){return eL(this.w4_1,e.w4_1)};c(Ct).a5=function(e){return this.z4(e instanceof Ct?e:rn())};c(Ct).equals=function(e){return this===e};c(Ct).hashCode=function(){return iL(this)};c(Ct).toString=function(){return this.v4_1};function o3(e){var n=e==null?null:id(e);return n??"null"}function DB(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$,p=f??t.$imask$;p!=null&&(i.push(p),s=p.length);var v=t.$metadata$.iid,y;v==null?y=null:y=$B(v);var g=y;g!=null&&(i.push(g),s=Math.max(s,g.length)),s>n&&(n=s)}return WB(n,i)}function $B(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 WB(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 p=n[s];s=s+1|0,r<p.length&&(t=t|p[r])}d[r]=t,i=i+1|0}return d}function GB(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function J0(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 zB(e){return new L4(e)}function L4(e){this.c5_1=e,this.b5_1=0}c(L4).m=function(){return this.b5_1!==this.c5_1.length};c(L4).o=function(){var e;if(this.b5_1!==this.c5_1.length){var n=this.b5_1;this.b5_1=n+1|0,e=this.c5_1[n]}else throw l3(""+this.b5_1);return e};function o8(){return H0(),AI}var AI;function CI(){return H0(),bI}var bI,KB;function h8(){return H0(),gI}var gI;function TI(){return H0(),RI}var RI;function XB(){return H0(),NI}var NI;function YB(e){return H0(),(e|0)===e?UI(e):(CI()[0]=e,kn(h8()[XB()],31)+h8()[TI()]|0)}var qx;function H0(){qx||(qx=!0,AI=new ArrayBuffer(8),bI=new Float64Array(o8()),KB=new Float32Array(o8()),gI=new Int32Array(o8()),CI()[0]=-1,RI=h8()[0]!==0?1:0,NI=1-TI()|0)}function L0(e,n){var i;if(xI(e)){var d=e.charCodeAt(n),r;Hx();var t=0;if(d<Jx(t))r=!0;else{Hx();var s=65535;r=d>Jx(s)}if(r)throw ed("Invalid Char code: "+d);i=RL(d)}else i=e.b(n);return i}function xI(e){return typeof e=="string"}function ku(e){var n;return xI(e)?n=e.length:n=e.a(),n}function QB(e){return UB(e,", ","[","]",U,U,jB)}function jB(e){return id(e)}function eL(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=Dx(e,n):n instanceof Ve?d=Dx(e,n.f5()):d=$x(e,n),i=d;break;case"string":case"boolean":i=$x(e,n);break;default:i=nL(e,n);break}return i}function Dx(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 $x(e,n){return e<n?-1:e>n?1:0}function nL(e,n){return e.a5(n)}function iL(e){return v8(e)}function v8(e){if(!("kotlinHashCodeValue$"in e)){var n=II(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function II(){return Math.random()*4294967296|0}function id(e){var n;return e==null?n="null":xL(e)?n="[...]":typeof e.toString!="function"?n=tL(e):n=e.toString(),n}function tL(e){return Object.prototype.toString.call(e)}function Zn(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():v8(e);break;case"function":i=v8(e);break;case"number":i=YB(e);break;case"boolean":i=rL(e);break;case"string":i=L8(String(e));break;case"bigint":i=dL(e);break;case"symbol":i=oL(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function rL(e){return e?1231:1237}function L8(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=kn(n,31)+s|0}while(t!==r);return n}function dL(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=kn(31,r)+s|0,d=d>>n}return kn(r,t)}function oL(e){var n=aL(e)?uL():lL(),i=n.get(e);if(i!==U)return i;var d=II();return n.set(e,d),d}function aL(e){return Symbol.keyFor(e)!=U}function uL(){return a8===U&&(a8=new Map),a8}function lL(){return u8===U&&(u8=new WeakMap),u8}var a8,u8;function Ze(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 Je(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function c(e){return e.prototype}function Xn(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function Ge(e){return Object.create(e)}function EI(e,n,i){Error.call(e),sL(e,n,i)}function sL(e,n,i){var d=VI(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 q0(e){var n;return e==null?fL():n=e,n}function fL(){throw J8()}function rn(){throw H8()}function a3(e){throw jI("lateinit property "+e+" has not been initialized")}function F8(e){throw ed(e)}function cL(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 pL(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 OI(){m8=this,this.g5_1=new Ve(0,-2147483648),this.h5_1=new Ve(-1,2147483647),this.i5_1=8,this.j5_1=64}var m8;function hL(){return m8==null&&new OI,m8}function Ve(e,n){hL(),g8.call(this),this.d5_1=e,this.e5_1=n}c(Ve).k5=function(e){return F4(this,e)};c(Ve).a5=function(e){return this.k5(e instanceof Ve?e:rn())};c(Ve).l5=function(e){return I4(this,e)};c(Ve).m5=function(e){return mL(this,e)};c(Ve).n5=function(){return this.o5().l5(new Ve(1,0))};c(Ve).o5=function(){return new Ve(~this.d5_1,~this.e5_1)};c(Ve).p5=function(){return this.d5_1};c(Ve).f5=function(){return jc(this)};c(Ve).valueOf=function(){return this.f5()};c(Ve).equals=function(e){var n;return e instanceof Ve?n=Yr(this,e):n=!1,n};c(Ve).hashCode=function(){return SL(this)};c(Ve).toString=function(){return k8(this,10)};function Bo(){return dn(),PI}var PI;function T4(){return dn(),MI}var MI;function Wx(){return dn(),_I}var _I;function vL(){return dn(),BI}var BI;function Md(){return dn(),LI}var LI;function Gx(){return dn(),FI}var FI;function F4(e,n){if(dn(),Yr(e,n))return 0;var i=Cr(e),d=Cr(n);return i&&!d?-1:!i&&d?1:Cr(Qc(e,n))?-1:1}function I4(e,n){dn();var i=e.e5_1>>>16|0,d=e.e5_1&65535,r=e.d5_1>>>16|0,t=e.d5_1&65535,s=n.e5_1>>>16|0,f=n.e5_1&65535,p=n.d5_1>>>16|0,v=n.d5_1&65535,y=0,g=0,b=0,P=0;return P=P+(t+v|0)|0,b=b+(P>>>16|0)|0,P=P&65535,b=b+(r+p|0)|0,g=g+(b>>>16|0)|0,b=b&65535,g=g+(d+f|0)|0,y=y+(g>>>16|0)|0,g=g&65535,y=y+(i+s|0)|0,y=y&65535,new Ve(b<<16|P,y<<16|g)}function Qc(e,n){return dn(),I4(e,n.n5())}function yu(e,n){if(dn(),bl(e))return Bo();if(bl(n))return Bo();if(Yr(e,Md()))return zx(n)?Md():Bo();if(Yr(n,Md()))return zx(e)?Md():Bo();if(Cr(e)){var i;return Cr(n)?i=yu(At(e),At(n)):i=At(yu(At(e),n)),i}else if(Cr(n))return At(yu(e,At(n)));if(Kx(e,Gx())&&Kx(n,Gx()))return e3(jc(e)*jc(n));var d=e.e5_1>>>16|0,r=e.e5_1&65535,t=e.d5_1>>>16|0,s=e.d5_1&65535,f=n.e5_1>>>16|0,p=n.e5_1&65535,v=n.d5_1>>>16|0,y=n.d5_1&65535,g=0,b=0,P=0,X=0;return X=X+kn(s,y)|0,P=P+(X>>>16|0)|0,X=X&65535,P=P+kn(t,y)|0,b=b+(P>>>16|0)|0,P=P&65535,P=P+kn(s,v)|0,b=b+(P>>>16|0)|0,P=P&65535,b=b+kn(r,y)|0,g=g+(b>>>16|0)|0,b=b&65535,b=b+kn(t,v)|0,g=g+(b>>>16|0)|0,b=b&65535,b=b+kn(s,p)|0,g=g+(b>>>16|0)|0,b=b&65535,g=g+(((kn(d,y)+kn(r,v)|0)+kn(t,p)|0)+kn(s,f)|0)|0,g=g&65535,new Ve(P<<16|X,g<<16|b)}function mL(e,n){if(dn(),bl(n))throw Z8("division by zero");if(bl(e))return Bo();if(Yr(e,Md())){if(Yr(n,T4())||Yr(n,Wx()))return Md();if(Yr(n,Md()))return T4();var i=yL(e,1),d=kL(i.m5(n),1);if(Yr(d,Bo()))return Cr(n)?T4():Wx();var r=Qc(e,yu(n,d));return I4(d,r.m5(n))}else if(Yr(n,Md()))return Bo();if(Cr(e)){var t;return Cr(n)?t=At(e).m5(At(n)):t=At(At(e).m5(n)),t}else if(Cr(n))return At(e.m5(At(n)));for(var s=Bo(),f=e;AL(f,n);){for(var p=jc(f)/jc(n),v=Math.max(1,Math.floor(p)),y=Math.ceil(Math.log(v)/Math.LN2),g=y<=48?1:Math.pow(2,y-48),b=e3(v),P=yu(b,n);Cr(P)||wL(P,f);)v=v-g,b=e3(v),P=yu(b,n);bl(b)&&(b=T4()),s=I4(s,b),f=Qc(f,P)}return s}function kL(e,n){dn();var i=n&63;return i===0?e:i<32?new Ve(e.d5_1<<i,e.e5_1<<i|(e.d5_1>>>(32-i|0)|0)):new Ve(0,e.d5_1<<(i-32|0))}function yL(e,n){dn();var i=n&63;return i===0?e:i<32?new Ve(e.d5_1>>>i|0|e.e5_1<<(32-i|0),e.e5_1>>i):new Ve(e.e5_1>>(i-32|0),e.e5_1>=0?0:-1)}function jc(e){return dn(),e.e5_1*4294967296+CL(e)}function Yr(e,n){return dn(),e.e5_1===n.e5_1?e.d5_1===n.d5_1:!1}function SL(e){return dn(),e.d5_1^e.e5_1}function k8(e,n){if(dn(),n<2||36<n)throw Z8("radix out of range: "+n);if(bl(e))return"0";if(Cr(e))if(Yr(e,Md())){var i=Yc(n),d=e.m5(i),r=Qc(yu(d,i),e).p5(),t=k8(d,n);return t+r.toString(n)}else return"-"+k8(At(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=e3(Math.pow(n,s)),p=e,v="";;){var y=p.m5(f),g=Qc(p,yu(y,f)).p5(),b=g.toString(n);if(p=y,bl(p))return b+v;for(;b.length<s;)b="0"+b;v=b+v}}function Yc(e){return dn(),new Ve(e,e<0?-1:0)}function Cr(e){return dn(),e.e5_1<0}function bl(e){return dn(),e.e5_1===0?e.d5_1===0:!1}function zx(e){return dn(),(e.d5_1&1)===1}function At(e){return dn(),e.n5()}function Kx(e,n){return dn(),F4(e,n)<0}function e3(e){if(dn(),dB(e))return Bo();if(e<=-9223372036854776e3)return Md();if(e+1>=9223372036854776e3)return vL();if(e<0)return At(e3(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Ve(i,d)}function wL(e,n){return dn(),F4(e,n)>0}function AL(e,n){return dn(),F4(e,n)>=0}function CL(e){return dn(),e.d5_1>=0?e.d5_1:4294967296+e.d5_1}var Xx;function dn(){Xx||(Xx=!0,PI=Yc(0),MI=Yc(1),_I=Yc(-1),BI=new Ve(-1,2147483647),LI=new Ve(0,-2147483648),FI=Yc(16777216))}function te(e,n,i,d,r){return U8("class",e,n,i,d,r,null)}function U8(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 V(e,n,i,d,r,t,s,f,p){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,p??[]);if(e.$metadata$=v,r!=null){var y=v.iid!=null?e:e.prototype;y.$imask$=DB(r)}}function Jo(e,n,i,d,r){return U8("interface",e,n,i,d,r,bL())}function bL(){return Xc===U&&(Xc=0),Xc=Xc+1|0,Xc}var Xc;function di(e,n,i,d,r){return U8("object",e,n,i,d,r,null)}function D0(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&&F0(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function UI(e){var n;return e instanceof Ve?n=e.p5():n=gL(e),n}function gL(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function TL(e){return e<<16>>16}function RL(e){var n=UI(e),i=TL(n);return HB(i)}function NL(e,n){return new Su(e,n)}function xL(e){return ZI(e)?!0:f8(e)}function ZI(e){return Array.isArray(e)}function On(e,n){return IL(e,n.$metadata$.iid)}function IL(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return GB(r,n)}function F0(e){var n;return ZI(e)?n=!e.$type$:n=!1,n}function EL(e){return typeof e=="string"?!0:On(e,b8)}function VI(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(Yx(e,"message")&&(r=r|1),Yx(e,"cause")&&(r=r|2),r!==3){var t=OL(e);t!=Error.prototype&&(r=r|VI(t))}return i!=null&&(i.errorInfo=r),r}function Yx(e,n){return e.hasOwnProperty(n)}function OL(e){return Object.getPrototypeOf(e)}var U;function PL(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 l8(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 JI(e){return new Kn(e)}function ML(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw ed(id(i))}return cL(e,new Int32Array(n))}function _L(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw ed(id(i))}return pL(e,n,null)}function HI(e){return EI(e),Ho.call(e),e}function qI(){var e=HI(Ge(c(Ho)));return Je(e,qI),e}function DI(e,n){return EI(n,e),Ho.call(n),n}function Z8(e){var n=DI(e,Ge(c(Ho)));return Je(n,Z8),n}function Ho(){Je(this,Ho)}function BL(e){return td(e),$0.call(e),e}function $I(){var e=BL(Ge(c($0)));return Je(e,$I),e}function LL(e,n){return Tl(e,n),$0.call(n),n}function ed(e){var n=LL(e,Ge(c($0)));return Je(n,ed),n}function $0(){Je(this,$0)}function FL(e){return td(e),G0.call(e),e}function WI(){var e=FL(Ge(c(G0)));return Je(e,WI),e}function UL(e,n){return Tl(e,n),G0.call(n),n}function W0(e){var n=UL(e,Ge(c(G0)));return Je(n,W0),n}function G0(){Je(this,G0)}function ZL(e){return td(e),z0.call(e),e}function GI(){var e=ZL(Ge(c(z0)));return Je(e,GI),e}function VL(e,n){return Tl(e,n),z0.call(n),n}function u3(e){var n=VL(e,Ge(c(z0)));return Je(n,u3),n}function z0(){Je(this,z0)}function JL(e){return td(e),U4.call(e),e}function K0(){var e=JL(Ge(c(U4)));return Je(e,K0),e}function U4(){Je(this,U4)}function td(e){return HI(e),qi.call(e),e}function zI(){var e=td(Ge(c(qi)));return Je(e,zI),e}function Tl(e,n){return DI(e,n),qi.call(n),n}function KI(e){var n=Tl(e,Ge(c(qi)));return Je(n,KI),n}function qi(){Je(this,qi)}function HL(e){return td(e),X0.call(e),e}function qo(){var e=HL(Ge(c(X0)));return Je(e,qo),e}function qL(e,n){return Tl(e,n),X0.call(n),n}function l3(e){var n=qL(e,Ge(c(X0)));return Je(n,l3),n}function X0(){Je(this,X0)}function DL(e){return td(e),Z4.call(e),e}function V8(){var e=DL(Ge(c(Z4)));return Je(e,V8),e}function Z4(){Je(this,Z4)}function $L(e){return td(e),Y0.call(e),e}function XI(){var e=$L(Ge(c(Y0)));return Je(e,XI),e}function WL(e,n){return Tl(e,n),Y0.call(n),n}function YI(e){var n=WL(e,Ge(c(Y0)));return Je(n,YI),n}function Y0(){Je(this,Y0)}function GL(e){return td(e),V4.call(e),e}function J8(){var e=GL(Ge(c(V4)));return Je(e,J8),e}function V4(){Je(this,V4)}function zL(e){return td(e),J4.call(e),e}function H8(){var e=zL(Ge(c(J4)));return Je(e,H8),e}function J4(){Je(this,J4)}function KL(e){return td(e),Q0.call(e),e}function QI(){var e=KL(Ge(c(Q0)));return Je(e,QI),e}function XL(e,n){return Tl(e,n),Q0.call(n),n}function jI(e){var n=XL(e,Ge(c(Q0)));return Je(n,jI),n}function Q0(){Je(this,Q0)}function YL(e){return function(n){return n===e?"(this Collection)":o3(n)}}function Zo(){}c(Zo).r=function(e){var n;e:{var i;if(On(this,gi)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=!0;break e}}n=!1}return n};c(Zo).s=function(e){var n;e:{var i;if(On(e,gi)?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};c(Zo).t=function(){return this.q()===0};c(Zo).toString=function(){return vI(this,", ","[","]",U,U,YL(this))};c(Zo).toArray=function(){return nI(this)};function Au(){this.g_1=2147483639}c(Au).y1=function(e,n){if(e<0||e>=n)throw W0("index: "+e+", size: "+n)};c(Au).z1=function(e,n){if(e<0||e>n)throw W0("index: "+e+", size: "+n)};c(Au).h=function(e,n,i){if(e<0||n>i)throw W0("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw ed("fromIndex: "+e+" > toIndex: "+n)};c(Au).b3=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?R8.MAX_VALUE:2147483639),i};c(Au).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=kn(31,n),t=d==null?null:Zn(d);n=r+(t??0)|0}return n};c(Au).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(!Ze(r,t))return!1}return!0};var tt;function Qx(e,n){return n===e?"(this Map)":o3(n)}function eE(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Ze(r.l1(),n)){i=r;break e}}i=null}return i}function nE(){}var QL;function jL(e){return function(n){return e.s5(n)}}function gr(){this.n1_1=null,this.o1_1=null}c(gr).p1=function(e){return eE(this,e)!=null};c(gr).q1=function(e){if(!(e!=null&&On(e,Fo)))return!1;var n=e.l1(),i=e.m1(),d=(On(this,Uo)?this:rn()).r1(n);if(!Ze(i,d))return!1;var r;return d==null?r=!(On(this,Uo)?this:rn()).p1(n):r=!1,!r};c(gr).equals=function(e){if(e===this)return!0;if(!(e!=null&&On(e,Uo))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(On(i,gi)?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};c(gr).r1=function(e){var n=eE(this,e);return n==null?null:n.m1()};c(gr).hashCode=function(){return Zn(this.k1())};c(gr).q=function(){return this.k1().q()};c(gr).toString=function(){var e=this.k1();return vI(e,", ","{","}",U,U,jL(this))};c(gr).s5=function(e){return Qx(this,e.l1())+"="+Qx(this,e.m1())};function H4(){}c(H4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:Zn(d);n=r+(t??0)|0}return n};c(H4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var q8;function eF(e){return br.call(e),Pn.call(e),e.v5_1=D8().x5_1,e}function s3(){return eF(Ge(c(Pn)))}function f3(e,n){if(n<0)throw u3("Deque is too big.");if(n<=e.v5_1.length)return Ie;if(e.v5_1===D8().x5_1){var i=e,d=R4(n,10);return i.v5_1=J0(Array(d),null),Ie}var r=tt.b3(e.v5_1.length,n);nF(e,r)}function nF(e,n){var i=J0(Array(n),null),d=e.v5_1,r=e.u5_1,t=e.v5_1.length;Ue(d,i,0,r,t);var s=e.v5_1,f=e.v5_1.length-e.u5_1|0,p=e.u5_1;Ue(s,i,f,0,p),e.u5_1=0,e.v5_1=i}function jt(e,n){return n>=e.v5_1.length?n-e.v5_1.length|0:n}function iF(e,n){return n<0?n+e.v5_1.length|0:n}function iE(e,n){return n===pI(e.v5_1)?0:n+1|0}function y8(e,n){return n===0?pI(e.v5_1):n-1|0}function S8(e,n,i){var d=i.l(),r=n,t=e.v5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.v5_1[s]=d.o()}while(r<t);var f=0,p=e.u5_1;if(f<p)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.v5_1[v]=d.o()}while(f<p);e.w5_1=e.w5_1+i.q()|0}function tE(){w8=this;var e=this;e.x5_1=[],this.y5_1=10}var w8;function D8(){return w8==null&&new tE,w8}c(Pn).q=function(){return this.w5_1};c(Pn).t=function(){return this.w5_1===0};c(Pn).z5=function(e){f3(this,this.w5_1+1|0),this.u5_1=y8(this,this.u5_1),this.v5_1[this.u5_1]=e,this.w5_1=this.w5_1+1|0};c(Pn).a6=function(e){f3(this,this.w5_1+1|0);var n=this.v5_1,i=this.w5_1;n[jt(this,this.u5_1+i|0)]=e,this.w5_1=this.w5_1+1|0};c(Pn).b6=function(){if(this.t())throw l3("ArrayDeque is empty.");var e=this.u5_1,n=this.v5_1[e],i=n==null||n!=null?n:rn();return this.v5_1[this.u5_1]=null,this.u5_1=iE(this,this.u5_1),this.w5_1=this.w5_1-1|0,i};c(Pn).c6=function(){if(this.t())throw l3("ArrayDeque is empty.");var e=E4(this),n=jt(this,this.u5_1+e|0),i=this.v5_1[n],d=i==null||i!=null?i:rn();return this.v5_1[n]=null,this.w5_1=this.w5_1-1|0,d};c(Pn).i=function(e){return this.a6(e),!0};c(Pn).a1=function(e,n){if(tt.z1(e,this.w5_1),e===this.w5_1)return this.a6(n),Ie;if(e===0)return this.z5(n),Ie;f3(this,this.w5_1+1|0);var i=jt(this,this.u5_1+e|0);if(e<(this.w5_1+1|0)>>1){var d=y8(this,i),r=y8(this,this.u5_1);if(d>=this.u5_1){this.v5_1[r]=this.v5_1[this.u5_1];var t=this.v5_1,s=this.v5_1,f=this.u5_1,p=this.u5_1+1|0,v=d+1|0;Ue(t,s,f,p,v)}else{var y=this.v5_1,g=this.v5_1,b=this.u5_1-1|0,P=this.u5_1,X=this.v5_1.length;Ue(y,g,b,P,X),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var he=this.v5_1,Me=this.v5_1,Hn=d+1|0;Ue(he,Me,0,1,Hn)}this.v5_1[d]=n,this.u5_1=r}else{var qn=this.w5_1,Gi=jt(this,this.u5_1+qn|0);if(i<Gi){var gt=this.v5_1,Zd=this.v5_1,ud=i+1|0;Ue(gt,Zd,ud,i,Gi)}else{var ld=this.v5_1,Or=this.v5_1;Ue(ld,Or,1,0,Gi),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var Vd=this.v5_1,Jd=this.v5_1,sd=i+1|0,Pu=this.v5_1.length-1|0;Ue(Vd,Jd,sd,i,Pu)}this.v5_1[i]=n}this.w5_1=this.w5_1+1|0};c(Pn).p=function(e){if(e.t())return!1;f3(this,this.w5_1+e.q()|0);var n=this.w5_1,i=jt(this,this.u5_1+n|0);return S8(this,i,e),!0};c(Pn).d6=function(e,n){if(tt.z1(e,this.w5_1),n.t())return!1;if(e===this.w5_1)return this.p(n);f3(this,this.w5_1+n.q()|0);var i=this.w5_1,d=jt(this,this.u5_1+i|0),r=jt(this,this.u5_1+e|0),t=n.q();if(e<(this.w5_1+1|0)>>1){var s=this.u5_1-t|0;if(r>=this.u5_1)if(s>=0){var f=this.v5_1,p=this.v5_1,v=s,y=this.u5_1;Ue(f,p,v,y,r)}else{s=s+this.v5_1.length|0;var g=r-this.u5_1|0,b=this.v5_1.length-s|0;if(b>=g){var P=this.v5_1,X=this.v5_1,he=s,Me=this.u5_1;Ue(P,X,he,Me,r)}else{var Hn=this.v5_1,qn=this.v5_1,Gi=s,gt=this.u5_1,Zd=this.u5_1+b|0;Ue(Hn,qn,Gi,gt,Zd);var ud=this.v5_1,ld=this.v5_1,Or=this.u5_1+b|0;Ue(ud,ld,0,Or,r)}}else{var Vd=this.v5_1,Jd=this.v5_1,sd=s,Pu=this.u5_1,Fl=this.v5_1.length;if(Ue(Vd,Jd,sd,Pu,Fl),t>=r){var Ul=this.v5_1,Zl=this.v5_1,mO=this.v5_1.length-t|0;Ue(Ul,Zl,mO,0,r)}else{var kO=this.v5_1,yO=this.v5_1,SO=this.v5_1.length-t|0;Ue(kO,yO,SO,0,t);var wO=this.v5_1,AO=this.v5_1;Ue(wO,AO,0,t,r)}}this.u5_1=s,S8(this,iF(this,r-t|0),n)}else{var Mu=r+t|0;if(r<d)if((d+t|0)<=this.v5_1.length){var CO=this.v5_1,bO=this.v5_1;Ue(CO,bO,Mu,r,d)}else if(Mu>=this.v5_1.length){var gO=this.v5_1,TO=this.v5_1,RO=Mu-this.v5_1.length|0;Ue(gO,TO,RO,r,d)}else{var Lh=(d+t|0)-this.v5_1.length|0,NO=this.v5_1,xO=this.v5_1,IO=d-Lh|0;Ue(NO,xO,0,IO,d);var EO=this.v5_1,OO=this.v5_1,PO=d-Lh|0;Ue(EO,OO,Mu,r,PO)}else{var MO=this.v5_1,_O=this.v5_1;if(Ue(MO,_O,t,0,d),Mu>=this.v5_1.length){var BO=this.v5_1,LO=this.v5_1,FO=Mu-this.v5_1.length|0,UO=this.v5_1.length;Ue(BO,LO,FO,r,UO)}else{var ZO=this.v5_1,VO=this.v5_1,JO=this.v5_1.length-t|0,HO=this.v5_1.length;Ue(ZO,VO,0,JO,HO);var qO=this.v5_1,DO=this.v5_1,$O=this.v5_1.length-t|0;Ue(qO,DO,Mu,r,$O)}}S8(this,r,n)}return!0};c(Pn).x=function(e){tt.y1(e,this.w5_1);var n=jt(this,this.u5_1+e|0),i=this.v5_1[n];return i==null||i!=null?i:rn()};c(Pn).r=function(e){return this.b1(e)!==-1};c(Pn).b1=function(e){var n=this.w5_1,i=jt(this,this.u5_1+n|0);if(this.u5_1<i){var d=this.u5_1;if(d<i)do{var r=d;if(d=d+1|0,Ze(e,this.v5_1[r]))return r-this.u5_1|0}while(d<i)}else if(this.u5_1>=i){var t=this.u5_1,s=this.v5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Ze(e,this.v5_1[f]))return f-this.u5_1|0}while(t<s);var p=0;if(p<i)do{var v=p;if(p=p+1|0,Ze(e,this.v5_1[v]))return(v+this.v5_1.length|0)-this.u5_1|0}while(p<i)}return-1};c(Pn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};c(Pn).z=function(e){if(tt.y1(e,this.w5_1),e===E4(this))return this.c6();if(e===0)return this.b6();var n=jt(this,this.u5_1+e|0),i=this.v5_1[n],d=i==null||i!=null?i:rn();if(e<this.w5_1>>1){if(n>=this.u5_1){var r=this.v5_1,t=this.v5_1,s=this.u5_1+1|0,f=this.u5_1;Ue(r,t,s,f,n)}else{var p=this.v5_1,v=this.v5_1;Ue(p,v,1,0,n),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var y=this.v5_1,g=this.v5_1,b=this.u5_1+1|0,P=this.u5_1,X=this.v5_1.length-1|0;Ue(y,g,b,P,X)}this.v5_1[this.u5_1]=null,this.u5_1=iE(this,this.u5_1)}else{var he=E4(this),Me=jt(this,this.u5_1+he|0);if(n<=Me){var Hn=this.v5_1,qn=this.v5_1,Gi=n+1|0,gt=Me+1|0;Ue(Hn,qn,n,Gi,gt)}else{var Zd=this.v5_1,ud=this.v5_1,ld=n+1|0,Or=this.v5_1.length;Ue(Zd,ud,n,ld,Or),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var Vd=this.v5_1,Jd=this.v5_1,sd=Me+1|0;Ue(Vd,Jd,0,1,sd)}this.v5_1[Me]=null}return this.w5_1=this.w5_1-1|0,d};c(Pn).e6=function(){var e=this.w5_1,n=jt(this,this.u5_1+e|0);this.u5_1<n?l8(this.v5_1,null,this.u5_1,n):this.t()||(l8(this.v5_1,null,this.u5_1,this.v5_1.length),l8(this.v5_1,null,0,n)),this.u5_1=0,this.w5_1=0};c(Pn).f6=function(e){var n=e.length>=this.w5_1?e:uB(e,this.w5_1),i=F0(n)?n:rn(),d=this.w5_1,r=jt(this,this.u5_1+d|0);if(this.u5_1<r){var t=this.v5_1,s=this.u5_1;Ue(t,i,0,s,r)}else if(!this.t()){var f=this.v5_1,p=this.u5_1,v=this.v5_1.length;Ue(f,i,0,p,v);var y=this.v5_1,g=this.v5_1.length-this.u5_1|0;Ue(y,i,g,0,r)}var b=aB(this.w5_1,i);return F0(b)?b:rn()};c(Pn).a2=function(){var e=this.w5_1,n=J0(Array(e),null);return this.f6(n)};c(Pn).toArray=function(){return this.a2()};function Pn(){D8(),this.u5_1=0,this.w5_1=0}function tF(e){if(e.t())return[];for(var n=e.q(),i=J0(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function Rr(){return rF()}function rE(e){return e.length>0?JI(e):Rr()}function E4(e){return e.q()-1|0}function rd(){A8=this,this.g6_1=new Ve(-1478467534,-1720727600)}c(rd).equals=function(e){var n;return e!=null&&On(e,V0)?n=e.t():n=!1,n};c(rd).hashCode=function(){return 1};c(rd).toString=function(){return"[]"};c(rd).q=function(){return 0};c(rd).t=function(){return!0};c(rd).h6=function(e){return e.t()};c(rd).s=function(e){return this.h6(e)};c(rd).x=function(e){throw W0("Empty list doesn't contain element at index "+e+".")};c(rd).l=function(){return dE};var A8;function rF(){return A8==null&&new rd,A8}function q4(){}c(q4).m=function(){return!1};c(q4).o=function(){throw qo()};var dE;function dF(e){return new Do(e,!1)}function oF(e){return e.length===0?rt():N8(new Do(e,!0))}function Do(e,n){this.i6_1=e,this.j6_1=n}c(Do).q=function(){return this.i6_1.length};c(Do).t=function(){return this.i6_1.length===0};c(Do).k6=function(e){return FB(this.i6_1,e)};c(Do).l6=function(e){var n;e:{var i;if(On(e,gi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.k6(r)){n=!1;break e}}n=!0}return n};c(Do).s=function(e){return this.l6(e)};c(Do).l=function(){return zB(this.i6_1)};function aF(){throw YI("Index overflow has happened.")}function $8(e,n){return e.p(JI(n))}function uF(e,n){if(On(n,gi))return e.p(n);for(var i=!1,d=n.l();d.m();){var r=d.o();e.i(r)&&(i=!0)}return i}function D4(){}c(D4).o=function(){return this.m6()};function lF(e,n,i){var d;if(i>0)d=e>=n?n:n-jx(n,e,i)|0;else if(i<0)d=e<=n?n:n+jx(e,n,-i|0)|0;else throw ed("Step is zero.");return d}function jx(e,n,i){return s8(s8(e,i)-s8(n,i)|0,i)}function s8(e,n){var i=e%n|0;return i>=0?i:i+n|0}function oE(){C8=this,this.n6_1=new Su(1,0)}var C8;function sF(){return C8==null&&new oE,C8}function Su(e,n){sF(),_d.call(this,e,n,1)}c(Su).t=function(){return this.r6_1>this.s6_1};c(Su).equals=function(e){var n;return e instanceof Su?n=this.t()&&e.t()?!0:this.r6_1===e.r6_1?this.s6_1===e.s6_1:!1:n=!1,n};c(Su).hashCode=function(){return this.t()?-1:kn(31,this.r6_1)+this.s6_1|0};c(Su).toString=function(){return""+this.r6_1+".."+this.s6_1};function $4(e,n,i){D4.call(this),this.u6_1=i,this.v6_1=n,this.w6_1=this.u6_1>0?e<=n:e>=n,this.x6_1=this.w6_1?e:this.v6_1}c($4).m=function(){return this.w6_1};c($4).m6=function(){var e=this.x6_1;if(e===this.v6_1){if(!this.w6_1)throw qo();this.w6_1=!1}else this.x6_1=this.x6_1+this.u6_1|0;return e};function W8(){}c(W8).k4=function(e,n,i){return new _d(e,n,i)};var aE;function _d(e,n,i){if(i===0)throw ed("Step must be non-zero.");if(i===R8.MIN_VALUE)throw ed("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.r6_1=e,this.s6_1=lF(e,n,i),this.t6_1=i}c(_d).l=function(){return new $4(this.r6_1,this.s6_1,this.t6_1)};c(_d).t=function(){return this.t6_1>0?this.r6_1>this.s6_1:this.r6_1<this.s6_1};c(_d).equals=function(e){var n;return e instanceof _d?n=this.t()&&e.t()?!0:this.r6_1===e.r6_1&&this.s6_1===e.s6_1?this.t6_1===e.t6_1:!1:n=!1,n};c(_d).hashCode=function(){return this.t()?-1:kn(31,kn(31,this.r6_1)+this.s6_1|0)+this.t6_1|0};c(_d).toString=function(){return this.t6_1>0?""+this.r6_1+".."+this.s6_1+" step "+this.t6_1:""+this.r6_1+" downTo "+this.s6_1+" step "+(-this.t6_1|0)};function uE(e,n,i){i!=null?e.j4(i(n)):n==null||EL(n)?e.j4(n):n instanceof SI?e.z3(n.y6_1):e.j4(o3(n))}function fF(e,n,i){if(i=i===U?!1:i,e===n)return!0;if(!i)return!1;var d=Vx(e),r=Vx(n),t;if(d===r)t=!0;else{var s=x4(d).toLowerCase(),f=L0(s,0),p=x4(r).toLowerCase();t=f===L0(p,0)}return t}function lE(e){return ku(e)-1|0}function G8(e,n,i){i=i===U?!1:i;var d;return typeof n=="string"?d=cF(e,n,U,i)>=0:d=sE(e,n,0,ku(e),i)>=0,d}function cF(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=sE(e,n,i,ku(e),d):r=e.indexOf(n,i),r}function sE(e,n,i,d,r,t){t=t===U?!1:t;var s=t?JB(N4(i,lE(e)),R4(d,0)):NL(R4(i,0),N4(d,ku(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var p=s.r6_1,v=s.s6_1,y=s.t6_1;if(y>0&&p<=v||y<0&&v<=p)do{var g=p;if(p=p+y|0,BB(n,0,e,g,ku(n),r))return g}while(g!==v)}else{var b=s.r6_1,P=s.s6_1,X=s.t6_1;if(X>0&&b<=P||X<0&&P<=b)do{var he=b;if(b=b+X|0,fE(n,0,e,he,ku(n),r))return he}while(he!==P)}return-1}function fE(e,n,i,d,r,t){if(d<0||n<0||n>(ku(e)-r|0)||d>(ku(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!fF(L0(e,n+f|0),L0(i,d+f|0),t))return!1}while(s<r);return!0}function bi(e,n){this.z6_1=e,this.a7_1=n}c(bi).toString=function(){return"("+this.z6_1+", "+this.a7_1+")"};c(bi).b7=function(){return this.z6_1};c(bi).c7=function(){return this.a7_1};c(bi).hashCode=function(){var e=this.z6_1==null?0:Zn(this.z6_1);return e=kn(e,31)+(this.a7_1==null?0:Zn(this.a7_1))|0,e};c(bi).equals=function(e){if(this===e)return!0;if(!(e instanceof bi))return!1;var n=e instanceof bi?e:rn();return!(!Ze(this.z6_1,n.z6_1)||!Ze(this.a7_1,n.a7_1))};function cE(e,n){return new bi(e,n)}c(Ii).o2=rB;Ie=new T8;R8=new U0;i3=new sI;qB=new wI;tt=new Au;QL=new nE;q8=new H4;dE=new q4;aE=new W8;var $o=Math.imul;V(X8,"OneAtATimeAssembler",te);V(Y8,"AllAtOnceAssembler",te);V(Di,"SubscribeCallbackParams",te);V(er,"Mode",te,Ct);V(Rl,"Callback",te);V(j8,U,te);V(Ti,"DispatcherImpl",te);V($i,"EmptyOptions",te,U,U,$i);V(Mn,"DispatcherSnapshot",te);V(oi,"EventScope",te,Ct);V(eh,"NoOpUnsubscriber",di);V(j0,"BaseTrace",te);V(m3,"ErrorInfo",te);V(NE,"PerformanceAnalyticsDelegate",Jo);V(p3,"NoOpPerformanceAnalyticsDelegate",te,U,[NE],p3);V(k3,"RuntimeTrace",te,j0);V(gu,"Disabled",di);V(y3,"NiceLogger",te);V(bu,"NoOpLogger",te,U,U,bu);V(nh,"IntervalEventDeduper",te);V(ih,"LocalEventsDeduper",te);V(dt,"TimerDefinition",te);V(j4,"Span",te);V(th,"Tracer",di);V(e6,"JsDispatcherImpl",te,Ti);V(n6,"JsRequestBuilderAdapter",te);V(h3,"JsonStateOperations",te,U,U,h3);function X8(e,n){this.d7_1=e,this.e7_1=n}c(X8).f7=function(e,n){var i;if(e.t())i=Rr();else{for(var d=this.e7_1.list(),r=e.b6();mE(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.d7_1.h7([""+n+" building batch of ",r]),O4(r)}if(!e.t())r=e.b6();else return Rr()}this.d7_1.h7([""+n+" building batch of ",r]),i=O4(r)}return i};function Y8(e,n){this.i7_1=e,this.j7_1=n}c(Y8).f7=function(e,n){var i;if(e.t())i=Rr();else{for(var d=this.j7_1.list(),r=rt(),t=e.l();t.m();){var s=t.o(),f;if(mE(s)){var p;if(d.length===0)p=!1;else{var v;e:{for(var y=0,g=d.length;y<g;){var b=d[y];if(y=y+1|0,b.id===s.hook){v=b;break e}}v=null}p=v!=null}f=p}else f=!0;f&&r.i(s)}var P=r;e.e6(),this.i7_1.h7([""+n+" building batch of ",P]),i=P}return i};function mE(e){var n=e.hook;return(n==null?null:G8(n,"useInterval"))===!0}function Di(e,n,i){this.request=e,this.response=n,this.mode=i}c(Di).k7=function(){return this.request};c(Di).l7=function(){return this.response};c(Di).m7=function(){return this.mode};c(Di).b7=function(){return this.request};c(Di).c7=function(){return this.response};c(Di).n7=function(){return this.mode};c(Di).o7=function(e,n,i){return new Di(e,n,i)};c(Di).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.o7(e,n,i)};c(Di).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};c(Di).hashCode=function(){var e=this.request==null?0:Zn(this.request);return e=$o(e,31)+(this.response==null?0:Zn(this.response))|0,e=$o(e,31)+this.mode.hashCode()|0,e};c(Di).equals=function(e){if(this===e)return!0;if(!(e instanceof Di))return!1;var n=e instanceof Di?e:rn();return!(!Ze(this.request,n.request)||!Ze(this.response,n.response)||!this.mode.equals(n.mode))};var kE,yE,SE;function pF(){return[Bd(),c3(),Ld()]}function hF(e){switch(e){case"SYNC":return Bd();case"ASYNC":return c3();case"SPEC":return Ld();default:G4(),F8("No enum constant value.");break}}var pE;function G4(){if(pE)return Ie;pE=!0,kE=new er("SYNC",0),yE=new er("ASYNC",1),SE=new er("SPEC",2)}function er(e,n){Ct.call(this,e,n)}function Bd(){return G4(),kE}function c3(){return G4(),yE}function Ld(){return G4(),SE}function Rl(e,n){this.r7_1=e,this.s7_1=n}c(Rl).toString=function(){return"Callback(success="+this.r7_1+", failure="+this.s7_1+")"};c(Rl).hashCode=function(){var e=Zn(this.r7_1);return e=$o(e,31)+Zn(this.s7_1)|0,e};c(Rl).equals=function(e){if(this===e)return!0;if(!(e instanceof Rl))return!1;var n=e instanceof Rl?e:rn();return!(!Ze(this.r7_1,n.r7_1)||!Ze(this.s7_1,n.s7_1))};function z8(e){var n=e.b8_1;if(n!=null)return n;a3("assembler")}function Nl(e){var n=e.i8_1;if(n!=null)return n;a3("local")}function v3(e){var n=e.j8_1;if(n!=null)return n;a3("remote")}function z4(e){var n=e.k8_1;if(n!=null)return n;a3("timers")}function wE(e){AE(e),e.p8_1=!0,e.y7_1.h7(["recalculateSpeculativeWork"]);var n=e.c8_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(Cu()))continue e;if(e.e8_1.w5_1>10)break e;e.e8_1.i(r)}e.y7_1.h7(["Speculative queue size: "+e.e8_1.w5_1]),K4(e,e.e8_1)}function Q8(e){e.y7_1.h7(["cancelSpeculation"]),e.p8_1=!1,AE(e)}function AE(e){e.e8_1.e6(),e.m8_1=e.v7_1.clone(e.state),e.n8_1=e.n8_1+1|0}function K8(e,n,i){if(n.t())return Ie;var d=mI(n),r=d.scope.equals(Cu())?!0:IF(d.scope)?!Nl(e).isReady():!1;i.equals(Bd())&&(e.f8_1=!0);var t=e.u7_1.q8(i.equals(Ld())?e.m8_1:e.state,n),s=r?v3(e):Nl(e),f=e.z7_1;e.z7_1=f+1|0;var p=f,v=e.n8_1,y=EE.r8("runtime_trace"),g=wF(e,i,r,y,n,p,v,t),b=new Rl(g,CF(e,i,r,y,p,n));e.g8_1.i1(p,b),e.y7_1.h7(["Signpost: Handling "+W4(e,i,r)+" request"]),K4(e,t),s.handle(e.w7_1,t,b.r7_1,b.s7_1)}function W4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function CE(e,n){e.p8_1=e.o8_1,e.f8_1=!1,e.state=e.v7_1.clone(e.l8_1),e.d8_1.e6(),e.c8_1.e6(),Nl(e).reset(),v3(e).reset(),Q8(e),n&&z4(e).clear()}function xl(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Ho){var t=s;e.y7_1.s8([t]),e.x7_1.errorHandler(t),r=n}else throw s;d=r}return d}function K4(e,n){e.x7_1.featureFlags.isVerboseLoggingEnabled&&e.y7_1.h7([n])}function vF(e){return function(){return Nl(e).isReady()}}function mF(e){return function(n){var i,d;e:{for(var r=e.c8_1.l();r.m();){var t=r.o();if(t.hook===n){d=t;break e}}d=null}if(d!=null)i=!0;else{var s;e:{for(var f=e.d8_1.l();f.m();){var p=f.o();if(p.hook===n){s=p;break e}}s=null}i=s!=null}return i}}function kF(e,n,i,d){return function(){e.y7_1.h7(["Signpost: Initializing Dispatcher",n,i]),e.i8_1=n,e.j8_1=i,e.k8_1=d;var r=e,t;return e.x7_1.featureFlags.isUsingEverythingAssembler?t=new Y8(e.y7_1,d):t=new X8(e.y7_1,d),r.b8_1=t,e.t8(),Ie}}function j8(e,n){this.u8_1=e,this.v8_1=n}c(j8).unsubscribe=function(){this.u8_1.h8_1.j(this.v8_1)};function yF(e,n){return function(){var i=typeof e=="function"?e:rn();return n.h8_1.i(i),new j8(n,i)}}function SF(e,n,i,d,r,t,s,f,p){return function(){e.y7_1.h7(["Signpost: Response success for "+W4(e,n,i)+" request"]),K4(e,d),r.z8(),EF(e.x7_1.performanceAnalyticsDelegate,r,i,"",t.q()),e.g8_1.j1(s);var v;if(n.equals(Ld())&&e.n8_1!==f)return e.y7_1.h7(["throwing away stale speculative results"]),Ie;e.y7_1.h7(["Responding to "+W4(e,n,i)+" runtime result subscriptions"]);for(var y=e.h8_1.l();y.m();){var g=y.o();g(new Di(p,d,n))}var b;n.equals(Bd())?(e.state=e.v7_1.merge(e.state,d.state),e.f8_1=!1,b=Ie):n.equals(Ld())&&(e.m8_1=e.v7_1.merge(e.m8_1,d.state),b=Ie),e.a9(B8(d.replay),n);var P;return n.equals(Bd())&&e.o8_1&&(wE(e),P=Ie),e.t8(),Ie}}function wF(e,n,i,d,r,t,s,f){return function(p){return xl(e,Ie,SF(e,n,i,p,d,r,t,s,f)),Ie}}function AF(e,n,i,d,r,t,s){return function(){e.y7_1.h7(["Signpost: Response error for "+W4(e,n,i)+" request",d]),r.z8();var f=e.x7_1.performanceAnalyticsDelegate,p=d.message;OF(f,p??"Request Response Error"+(" with a duration of "+r.b9()+"ms"),i,""),e.g8_1.j1(t);var v;n.equals(Bd())&&(e.f8_1=!1,v=Ie);var y;if(n.equals(Ld()))return Q8(e),e.t8(),Ie;for(var g=s,b=r3(),P=g.l();P.m();){var X=P.o(),he=X.scope.equals(Cu())?!1:X.retry!==!0,Me=b.r1(he),Hn;if(Me==null){var qn=rt();b.i1(he,qn),Hn=qn}else Hn=Me;var Gi=Hn;Gi.i(X)}var gt=b,Zd,ud=gt.r1(!1);if(!(ud==null||ud.t())){var ld=gt.r1(!1),Or=ld??Rr(),Vd=Z0(Or);e.y7_1.h7(D0([["unretryable events",d],Vd])),Zd=e.x7_1.errorHandler(d)}var Jd,sd=gt.r1(!0);if(!(sd==null||sd.t())){var Pu=gt.r1(!0);if(Pu!=null)for(var Fl=Pu.l();Fl.m();){var Ul=Fl.o();Ul.retry=!0,Ul.scope=Cu()}var Zl=gt.r1(!0);e.a9(Zl??Rr(),n),n.equals(Bd())&&e.o8_1&&wE(e),e.t8(),Jd=Ie}return Ie}}function CF(e,n,i,d,r,t){return function(s){return xl(e,Ie,AF(e,n,i,s,d,r,t)),Ie}}function bF(e,n){return function(){e.y7_1.h7(D0([["Signpost: Submitted events"],n]));for(var i=e.a8_1,d=B8(n),r=i.l();r.m();){var t=r.o(),s=d;d=t.c9(s)}for(var f=d,p=rt(),v=rt(),y=f.l();y.m();){var g=y.o();g.async===!0?p.i(g):v.i(g)}var b=new bi(p,v),P=b.b7(),X=b.c7();e.d8_1.p(P),e.c8_1.p(X);var he;return e.f8_1&&e.p8_1&&(e.e8_1.p(X),he=Ie),e.t8(),Ie}}function gF(e){return function(){return CE(e,!0),Ie}}function TF(e,n){return function(){e.state=e.v7_1.clone(n.state),e.d8_1.e6();var i=n.asyncQueue;$8(e.d8_1,F0(i)?i:rn()),e.c8_1.e6();var d=n.syncQueue;return $8(e.c8_1,F0(d)?d:rn()),Q8(e),Nl(e).resume(n.localSnapshot),v3(e).resume(n.remoteSnapshot),z4(e).resumeAll(n.timerSnapshot),Ie}}function Ti(e,n,i,d,r){d=d===U?"RenderPostContent":d,r=r===U?new $i:r,this.t7_1=e,this.u7_1=n,this.v7_1=i,this.w7_1=d,this.x7_1=r,this.y7_1=new y3(this.x7_1.logger),this.z7_1=0;var t=this,s=new ih(vF(this),this.y7_1);t.a8_1=rE([s,new nh(mF(this))]),this.c8_1=s3(),this.d8_1=s3(),this.e8_1=s3(),this.f8_1=!1;var f=this;f.g8_1=r3();var p=this;p.h8_1=rt(),this.l8_1=this.v7_1.clone(this.state),this.m8_1=this.v7_1.clone(this.l8_1),this.n8_1=0,this.o8_1=this.x7_1.featureFlags.isSpeculativeExecutionEnabled,this.p8_1=this.o8_1,this.y7_1.h7(["Signpost: Constructed KMP Dispatcher"])}c(Ti).d9=function(e){this.t7_1=e};c(Ti).e9=function(){return this.t7_1};c(Ti).f9=function(){return this.c8_1};c(Ti).g9=function(){return this.d8_1};c(Ti).h9=function(){return this.e8_1};c(Ti).init=function(e,n,i){xl(this,Ie,kF(this,e,n,i))};c(Ti).subscribe=function(e){var n=RE;return xl(this,n,yF(e,this))};c(Ti).t8=function(){if(this.y7_1.h7(["ticking","syncInFlight "+this.f8_1,"asyncQueue.size "+this.d8_1.w5_1,"syncQueue.size "+this.c8_1.w5_1,"speculativeQueue.size "+this.e8_1.w5_1]),!Nl(this).isReady()&&!v3(this).isReady()&&!(this.c8_1.t()&&this.d8_1.t()))return this.y7_1.i9(["ticking with events and no runtime, deferring..."]),Ie;if(this.f8_1){if(this.p8_1){var n=z8(this).f7(this.e8_1,Ld());K8(this,n,Ld())}}else{var e=z8(this).f7(this.c8_1,Bd());K8(this,e,Bd())}if(!this.d8_1.t()){for(;!this.d8_1.t();){var i=z8(this).f7(this.d8_1,c3());K8(this,i,c3())}this.t8()}};c(Ti).a9=function(e,n){if(e.t()||n.equals(Ld()))return Ie;this.y7_1.h7(["replaying "+e.q()+" events"]),K4(this,e);for(var i=r3(),d=e.l();d.m();){var r=d.o(),t=new bi(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var p=rt();i.i1(t,p),f=p}else f=s;var v=f;v.i(r)}var y=i,g=y.r1(new bi(!0,!0));this.d8_1.d6(0,g??Rr());var b=y.r1(new bi(!0,!1));this.d8_1.p(b??Rr());var P=y.r1(new bi(!1,!0));this.c8_1.d6(0,P??Rr());var X=y.r1(new bi(!1,!1));this.c8_1.p(X??Rr())};c(Ti).submit=function(e){xl(this,Ie,bF(this,e))};c(Ti).reset=function(){xl(this,Ie,gF(this))};c(Ti).snapshot=function(){var e=this.v7_1.clone(this.state),n=this.c8_1,i=Z0(n),d=this.d8_1,r=Z0(d);return new Mn(e,i,r,Nl(this).snapshot(),v3(this).snapshot(),z4(this).list())};c(Ti).pause=function(){var e=this.snapshot();return z4(this).pauseAll(),CE(this,!1),e};c(Ti).resume=function(e){xl(this,Ie,TF(this,e))};function RF(e){return Ie}function $i(){this.j9_1=new bu;var e=this;e.k9_1=RF,this.l9_1=IE,this.m9_1=new p3}c($i).n9=function(e){this.j9_1=e};c($i).o9=function(){return this.j9_1};c($i).p9=function(e){this.k9_1=e};c($i).q9=function(){return this.k9_1};c($i).r9=function(e){this.l9_1=e};c($i).s9=function(){return this.l9_1};c($i).t9=function(e){this.m9_1=e};c($i).u9=function(){return this.m9_1};function Mn(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}c(Mn).e9=function(){return this.state};c(Mn).f9=function(){return this.syncQueue};c(Mn).g9=function(){return this.asyncQueue};c(Mn).v9=function(){return this.localSnapshot};c(Mn).w9=function(){return this.remoteSnapshot};c(Mn).x9=function(){return this.timerSnapshot};c(Mn).b7=function(){return this.state};c(Mn).c7=function(){return this.syncQueue};c(Mn).n7=function(){return this.asyncQueue};c(Mn).y9=function(){return this.localSnapshot};c(Mn).z9=function(){return this.remoteSnapshot};c(Mn).aa=function(){return this.timerSnapshot};c(Mn).ba=function(e,n,i,d,r,t){return new Mn(e,n,i,d,r,t)};c(Mn).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.ba(e,n,i,d,r,t)};c(Mn).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+id(this.syncQueue)+", asyncQueue="+id(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};c(Mn).hashCode=function(){var e=this.state==null?0:Zn(this.state);return e=$o(e,31)+Zn(this.syncQueue)|0,e=$o(e,31)+Zn(this.asyncQueue)|0,e=$o(e,31)+(this.localSnapshot==null?0:Zn(this.localSnapshot))|0,e=$o(e,31)+(this.remoteSnapshot==null?0:Zn(this.remoteSnapshot))|0,e=$o(e,31)+(this.timerSnapshot==null?0:Zn(this.timerSnapshot))|0,e};c(Mn).equals=function(e){if(this===e)return!0;if(!(e instanceof Mn))return!1;var n=e instanceof Mn?e:rn();return!(!Ze(this.state,n.state)||!Ze(this.syncQueue,n.syncQueue)||!Ze(this.asyncQueue,n.asyncQueue)||!Ze(this.localSnapshot,n.localSnapshot)||!Ze(this.remoteSnapshot,n.remoteSnapshot)||!Ze(this.timerSnapshot,n.timerSnapshot))};var bE,gE,TE;function NF(){return[Y4(),Q4(),Cu()]}function xF(e){switch(e){case"ALL":return Y4();case"LOCAL":return Q4();case"REMOTE":return Cu();default:X4(),F8("No enum constant value.");break}}var hE;function X4(){if(hE)return Ie;hE=!0,bE=new oi("ALL",0),gE=new oi("LOCAL",1),TE=new oi("REMOTE",2)}function oi(e,n){Ct.call(this,e,n)}function IF(e){return e.equals(Cu())?!0:e.equals(Y4())}function Y4(){return X4(),bE}function Q4(){return X4(),gE}function Cu(){return X4(),TE}function eh(){}c(eh).unsubscribe=function(){};var RE;function j0(e,n,i){this.spanName=e,this.startTimeMs=n,this.endTimeMs=i}c(j0).ea=function(){return this.spanName};c(j0).fa=function(){return this.startTimeMs};c(j0).ga=function(){return this.endTimeMs};function m3(e,n,i){this.message=e,this.origin=n,this.version=i}c(m3).q5=function(){return this.message};c(m3).ha=function(){return this.origin};c(m3).ia=function(){return this.version};function NE(){}function p3(){}c(p3).logRuntimeTrace=function(e){};c(p3).logRuntimeError=function(e){};function EF(e,n,i,d,r){e.logRuntimeTrace(new k3(n.w8_1,n.x8_1,n.y8_1,d,xE(i),r))}function OF(e,n,i,d){e.logRuntimeError(new m3(n,xE(i),d))}function xE(e){return e?"remote":"local"}function k3(e,n,i,d,r,t){j0.call(this,e,n,i),this.intent=d,this.target=r,this.eventCount=t}c(k3).ja=function(){return this.intent};c(k3).ka=function(){return this.target};c(k3).la=function(){return this.eventCount};function gu(){this.ma_1=!1,this.na_1=!1,this.oa_1=!1}c(gu).pa=function(){return this.ma_1};c(gu).qa=function(){return this.na_1};c(gu).ra=function(){return this.oa_1};var IE;function y3(e){this.g7_1=e}c(y3).s8=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.error(n)};c(y3).i9=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.warn(n)};c(y3).h7=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.debug(n)};function bu(){}c(bu).info=function(e){};c(bu).error=function(e){};c(bu).warn=function(e){};c(bu).debug=function(e){};c(bu).tag=function(){return""};function nh(e){this.sa_1=e}c(nh).c9=function(e){for(var n=rt(),i=rt(),d=e.l();d.m();){var r=d.o(),t=r.hook;(t==null?null:G8(t,"useInterval"))===!0?n.i(r):i.i(r)}for(var s=new bi(n,i),f=s.b7(),p=s.c7(),v=I8(),y=rt(),g=f.l();g.m();){var b=g.o(),P=b.hook;v.i(P)&&y.i(b)}for(var X=y,he=rt(),Me=X.l();Me.m();){var Hn=Me.o(),qn=Hn.hook;this.sa_1(qn??"")||he.i(Hn)}var Gi=he;return kI(Gi,p)};function ih(e,n){this.ta_1=e,this.ua_1=n}c(ih).c9=function(e){var n;if(this.ta_1())n=e;else{for(var i=rt(),d=rt(),r=e.l();r.m();){var t=r.o();t.scope.equals(Q4())?d.i(t):i.i(t)}var s=new bi(i,d);if(!s.a7_1.t()){var f=["Dropping "+s.a7_1.q()+" local events",s.a7_1];this.ua_1.h7([f])}n=s.z6_1}return n};function dt(e,n){this.id=e,this.duration=n}c(dt).va=function(){return this.id};c(dt).wa=function(){return this.duration};c(dt).b7=function(){return this.id};c(dt).c7=function(){return this.duration};c(dt).xa=function(e,n){return new dt(e,n)};c(dt).copy=function(e,n,i){return e=e===U?this.id:e,n=n===U?this.duration:n,this.xa(e,n)};c(dt).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};c(dt).hashCode=function(){var e=L8(this.id);return e=$o(e,31)+this.duration|0,e};c(dt).equals=function(e){if(this===e)return!0;if(!(e instanceof dt))return!1;var n=e instanceof dt?e:rn();return!(this.id!==n.id||this.duration!==n.duration)};function j4(e,n){this.w8_1=e,this.x8_1=n,this.y8_1=0}c(j4).z8=function(){this.y8_1=OE()};c(j4).b9=function(){return this.y8_1-this.x8_1};function th(){}c(th).r8=function(e){return new j4(e,OE())};var EE;function e6(e,n,i,d){i=i===U?"RenderPostContent":i,d=d===U?new $i:d,Ti.call(this,e,new n6(n),new h3,i,d),this.vb_1=i,this.wb_1=d}function n6(e){this.xb_1=e}c(n6).yb=function(e,n){var i=Z0(n);return this.xb_1.build(e,i)};c(n6).q8=function(e,n){return this.yb(e!=null&&e!=null?e:rn(),n)};function vE(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:rn())(e),d=P4(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],p=cE(f!=null&&typeof f=="string"?f:rn(),s[1]);d.i(p)}return d}function h3(){}c(h3).clone=function(e){return JSON.parse(JSON.stringify(e))};c(h3).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:rn(),r=vE(e).l();r.m();){var t=r.o();d[t.z6_1]=t.a7_1}for(var s=vE(n).l();s.m();){var f=s.o();d[f.z6_1]=f.a7_1}return d};function OE(){return new Date().getTime()}Xn(c(er),"name",c(er).x4);Xn(c(er),"ordinal",c(er).y4);Xn(c(Ti),"state",function(){return this.e9()},function(e){this.d9(e)});Xn(c($i),"logger",function(){return this.o9()},function(e){this.n9(e)});Xn(c($i),"errorHandler",function(){return this.q9()},function(e){this.p9(e)});Xn(c($i),"featureFlags",function(){return this.s9()},function(e){this.r9(e)});Xn(c($i),"performanceAnalyticsDelegate",function(){return this.u9()},function(e){this.t9(e)});Xn(c(oi),"name",c(oi).x4);Xn(c(oi),"ordinal",c(oi).y4);Xn(c(gu),"isSpeculativeExecutionEnabled",function(){return this.pa()});Xn(c(gu),"isVerboseLoggingEnabled",function(){return this.qa()});Xn(c(gu),"isUsingEverythingAssembler",function(){return this.ra()});Xn(c(e6),"state",function(){return this.e9()},function(e){this.d9(e)});RE=new eh;IE=new gu;EE=new th;er.values=pF;er.valueOf=hF;Xn(er,"SYNC",Bd);Xn(er,"ASYNC",c3);Xn(er,"SPEC",Ld);oi.values=NF;oi.valueOf=xF;Xn(oi,"ALL",Y4);Xn(oi,"LOCAL",Q4);Xn(oi,"REMOTE",Cu);var ir=B(F(),1);var El=B(F(),1);var Fd;(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"})(Fd||(Fd={}));function i6(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Fd.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Fd.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Fd.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Fd.UNRECOGNIZED}}function t6(e){switch(e){case Fd.ENVIRONMENT_UNSPECIFIED:return 0;case Fd.ENVIRONMENT_SANDBOX:return 1;case Fd.ENVIRONMENT_PRODUCTION:return 2;case Fd.UNRECOGNIZED:default:return-1}}var nr=B(F(),1);var Ru;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ru||(Ru={}));function PF(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return Ru.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return Ru.GOLD;case-1:case"UNRECOGNIZED":default:return Ru.UNRECOGNIZED}}function MF(e){switch(e){case Ru.CURRENCY_UNSPECIFIED:return 0;case Ru.GOLD:return 200;case Ru.UNRECOGNIZED:default:return-1}}var Yn;(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"})(Yn||(Yn={}));function _F(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return Yn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return Yn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return Yn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return Yn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return Yn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return Yn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return Yn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return Yn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return Yn.UNRECOGNIZED}}function BF(e){switch(e){case Yn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case Yn.ACCOUNTING_TYPE_INSTANT:return 1;case Yn.ACCOUNTING_TYPE_DURABLE:return 2;case Yn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case Yn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case Yn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case Yn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case Yn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case Yn.UNRECOGNIZED:default:return-1}}function PE(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var ot={$type:"devvit.payments.v1alpha.Product",encode(e,n=nr.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&Tu.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=PE();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=Tu.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)?Tu.fromJSON(e.price):void 0,environment:Nr(e.environment)?i6(e.environment):0,description:Nr(e.description)?globalThis.String(e.description):"",accountingType:Nr(e.accountingType)?_F(e.accountingType):0,productMetadata:LE(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:LE(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=Tu.toJSON(e.price)),e.environment!==0&&(n.environment=t6(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=BF(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=PE();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?Tu.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 ME(){return{key:"",value:""}}var S3={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=ME();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=ME();return n.key=e.key??"",n.value=e.value??"",n}};l.set(S3.$type,S3);function _E(){return{key:"",value:""}}var w3={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=_E();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=_E();return n.key=e.key??"",n.value=e.value??"",n}};l.set(w3.$type,w3);function BE(){return{amount:0,currency:0}}var Tu={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=BE();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)?PF(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=MF(e.currency)),n},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let n=BE();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(Tu.$type,Tu);function LE(e){return typeof e=="object"&&e!==null}function Nr(e){return e!=null}var Ri;(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"})(Ri||(Ri={}));function dh(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return Ri.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return Ri.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return Ri.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return Ri.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return Ri.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return Ri.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return Ri.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return Ri.UNRECOGNIZED}}function oh(e){switch(e){case Ri.ORDER_STATUS_UNSPECIFIED:return 0;case Ri.ORDER_STATUS_NEW:return 1;case Ri.ORDER_STATUS_CREATED:return 2;case Ri.ORDER_STATUS_PAID:return 3;case Ri.ORDER_STATUS_DELIVERED:return 4;case Ri.ORDER_STATUS_CANCELED:return 5;case Ri.ORDER_STATUS_REVERTED:return 6;case Ri.UNRECOGNIZED:default:return-1}}function FE(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var Qn={$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&&re.encode(ZE(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&re.encode(ZE(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=FE();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=rh(re.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=rh(re.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:Il(e.id)?globalThis.String(e.id):"",status:Il(e.status)?dh(e.status):0,createdAt:Il(e.createdAt)?VE(e.createdAt):void 0,updatedAt:Il(e.updatedAt)?VE(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[],environment:Il(e.environment)?i6(e.environment):0,metadata:LF(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=oh(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=t6(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 Qn.fromPartial(e??{})},fromPartial(e){let n=FE();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(Qn.$type,Qn);function UE(){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=UE();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:Il(e.key)?globalThis.String(e.key):"",value:Il(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=UE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(A3.$type,A3);function ZE(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function rh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function VE(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):rh(re.fromJSON(e))}function LF(e){return typeof e=="object"&&e!==null}function Il(e){return e!=null}function JE(){return{order:void 0}}var ah={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=ir.default.Writer.create()){return e.order!==void 0&&Qn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.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.order=Qn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:r6(e.order)?Qn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Qn.toJSON(e.order)),n},create(e){return ah.fromPartial(e??{})},fromPartial(e){let n=JE();return n.order=e.order!==void 0&&e.order!==null?Qn.fromPartial(e.order):void 0,n}};l.set(ah.$type,ah);function HE(){return{order:void 0}}var uh={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=ir.default.Writer.create()){return e.order!==void 0&&Qn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=HE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Qn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:r6(e.order)?Qn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Qn.toJSON(e.order)),n},create(e){return uh.fromPartial(e??{})},fromPartial(e){let n=HE();return n.order=e.order!==void 0&&e.order!==null?Qn.fromPartial(e.order):void 0,n}};l.set(uh.$type,uh);function qE(){return{acknowledged:void 0,rejectionReason:void 0}}var lh={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=ir.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 ir.default.Reader?e:ir.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!==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:r6(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:r6(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 lh.fromPartial(e??{})},fromPartial(e){let n=qE();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(lh.$type,lh);function DE(){return{}}var sh={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=ir.default.Writer.create()){return n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=DE();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 sh.fromPartial(e??{})},fromPartial(e){return DE()}};l.set(sh.$type,sh);function r6(e){return e!=null}var en=B(F(),1);function $E(){return{skus:[],metadata:{}}}var fh={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=$E();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:iO(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 fh.fromPartial(e??{})},fromPartial(e){let n=$E();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(fh.$type,fh);function WE(){return{key:"",value:""}}var C3={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=WE();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=WE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(C3.$type,C3);function GE(){return{products:[]}}var ch={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=GE();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 ch.fromPartial(e??{})},fromPartial(e){let n=GE();return n.products=e.products?.map(i=>ot.fromPartial(i))||[],n}};l.set(ch.$type,ch);function zE(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var ph={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=en.default.Writer.create()){return e.start!==void 0&&re.encode(eO(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&re.encode(eO(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])=>{b3.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=zE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=kh(re.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=kh(re.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=b3.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)?nO(e.start):void 0,end:Ei(e.end)?nO(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)?dh(e.status):0,metadata:iO(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=oh(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 ph.fromPartial(e??{})},fromPartial(e){let n=zE();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(ph.$type,ph);function KE(){return{key:"",value:""}}var b3={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=KE();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 b3.fromPartial(e??{})},fromPartial(e){let n=KE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(b3.$type,b3);function XE(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var Nu={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=XE();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 Nu.fromPartial(e??{})},fromPartial(e){let n=XE();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(Nu.$type,Nu);function YE(){return{orders:[],pageInfo:void 0}}var hh={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=en.default.Writer.create()){for(let i of e.orders)Qn.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&Nu.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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 1:if(t!==10)break;r.orders.push(Qn.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=Nu.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=>Qn.fromJSON(n)):[],pageInfo:Ei(e.pageInfo)?Nu.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>Qn.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=Nu.toJSON(e.pageInfo)),n},create(e){return hh.fromPartial(e??{})},fromPartial(e){let n=YE();return n.orders=e.orders?.map(i=>Qn.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?Nu.fromPartial(e.pageInfo):void 0,n}};l.set(hh.$type,hh);function QE(){return{orderId:""}}var vh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=en.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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.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 vh.fromPartial(e??{})},fromPartial(e){let n=QE();return n.orderId=e.orderId??"",n}};l.set(vh.$type,vh);function jE(){return{}}var mh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=en.default.Writer.create()){return n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return mh.fromPartial(e??{})},fromPartial(e){return jE()}};l.set(mh.$type,mh);function eO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function kh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function nO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):kh(re.fromJSON(e))}function iO(e){return typeof e=="object"&&e!==null}function Ei(e){return e!=null}var FF=e=>{switch(e){case Cn.ALL:return oi.ALL;case Cn.REMOTE:return oi.REMOTE;case Cn.LOCAL:return oi.LOCAL;case Cn.UNRECOGNIZED:return oi.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},xr=class{constructor(n){this.scope=n.scope?FF(n.scope):oi.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},d6=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new xr(i)),n.state&&(this.state=n.state)}},g3=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new xr(i)),n.state&&(this.state=n.state)}};function tO(){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,p]=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]=p||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var dd;(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"})(dd||(dd={}));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 yh(e){return e.hostname.split(".")[1]??e.hostname}function rO(e){return`${yh(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Wi=B(F(),1);function dO(){return{callState:void 0,connect:void 0}}var Sh={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Wi.default.Writer.create()){return e.callState!==void 0&&Iu.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&Eu.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=dO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=Iu.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=Eu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:o6(e.callState)?Iu.fromJSON(e.callState):void 0,connect:o6(e.connect)?Eu.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=Iu.toJSON(e.callState)),e.connect!==void 0&&(n.connect=Eu.toJSON(e.connect)),n},create(e){return Sh.fromPartial(e??{})},fromPartial(e){let n=dO();return n.callState=e.callState!==void 0&&e.callState!==null?Iu.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?Eu.fromPartial(e.connect):void 0,n}};l.set(Sh.$type,Sh);function oO(){return{appInstalled:void 0}}var T3={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Wi.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 Wi.default.Reader?e:Wi.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.appInstalled=xu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:o6(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=oO();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?xu.fromPartial(e.appInstalled):void 0,n}};l.set(T3.$type,T3);function aO(){return{}}var xu={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Wi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.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){}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 aO()}};l.set(xu.$type,xu);function uO(){return{logs:[]}}var Iu={$type:"devvit.cli.PlaytestCallState",encode(e,n=Wi.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 Wi.default.Reader?e:Wi.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!==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 Iu.fromPartial(e??{})},fromPartial(e){let n=uO();return n.logs=e.logs?.map(i=>mt.fromPartial(i))||[],n}};l.set(Iu.$type,Iu);function lO(){return{url:""}}var Eu={$type:"devvit.cli.PlaytestConnect",encode(e,n=Wi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.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){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:o6(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let n=lO();return n.url=e.url??"",n}};l.set(Eu.$type,Eu);function o6(e){return e!=null}var wh="playtest",sO="ws://localhost:5678";function fO(e){let n=Ah();return n===""||n===e}function Ah(){return globalThis.location?new URL(location.href).searchParams.get(wh)??void 0:void 0}var Jn=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,Vn,Ch,cO,bh,gh,Th,Rh,UF=15e3,a6=class{constructor(){N3.add(this),Vn.set(this,{type:"Init"}),bh.set(this,()=>{Jn(this,Vn,"f").type==="Opened"&&this.onState?.("Closed"),R3(this,Vn,Jn(this,N3,"m",cO).call(this),"f")}),gh.set(this,n=>{let i=T3.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),Th.set(this,()=>{if(Jn(this,Vn,"f").type!=="Opening")throw Error(`invalid transition from ${Jn(this,Vn,"f").type}`);this.onState?.("Opened"),R3(this,Vn,{sock:Jn(this,Vn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),Rh.set(this,()=>{R3(this,Vn,Jn(this,N3,"m",Ch).call(this),"f")})}close(){"timer"in Jn(this,Vn,"f")&&clearTimeout(Jn(this,Vn,"f").timer),"sock"in Jn(this,Vn,"f")&&(Jn(this,Vn,"f").sock.onopen=null,Jn(this,Vn,"f").sock.onmessage=null,Jn(this,Vn,"f").sock.onclose=null,Jn(this,Vn,"f").sock.close()),R3(this,Vn,{type:"Init"},"f")}open(){Jn(this,Vn,"f").type==="Init"&&R3(this,Vn,Jn(this,N3,"m",Ch).call(this),"f")}send(n){"sock"in Jn(this,Vn,"f")?Jn(this,Vn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Vn=new WeakMap,bh=new WeakMap,gh=new WeakMap,Th=new WeakMap,Rh=new WeakMap,N3=new WeakSet,Ch=function(){let n=new WebSocket(sO);return n.onclose=Jn(this,bh,"f"),n.onmessage=Jn(this,gh,"f"),n.onopen=Jn(this,Th,"f"),{sock:n,type:"Opening"}},cO=function(){return{timer:setTimeout(Jn(this,Rh,"f"),UF),type:"Retrying"}};var ai=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},pe=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)},Ud,u6,ui,es,l6,I3,od,Wo,ns,ts,Go,Nh,x3,s6,xh,pO,is,Ih,Eh,ZF={debug:xn.DEBUG,error:xn.ERROR,info:xn.INFO,log:xn.DEBUG,trace:xn.DEBUG,warn:xn.WARN},f6=class{constructor(n,i,d){Ud.add(this),u6.set(this,void 0),ui.set(this,void 0),es.set(this,!1),l6.set(this,0),I3.set(this,void 0),od.set(this,{}),Wo.set(this,void 0),ns.set(this,()=>{}),ts.set(this,void 0),Go.set(this,void 0),Nh.set(this,Ah()),x3.set(this,!1),s6.set(this,void 0),xh.set(this,r=>{let t=r.data,[s]=t;switch(s){case Ir.READY:{let[,f]=t;ai(this,s6,f,"f"),pe(this,ts,"f")?.plugins?pe(this,Ud,"m",pO).call(this):pe(this,Ud,"m",Ih).call(this);break}case Ir.PLUGINS_CONFIGURED:pe(this,Ud,"m",Ih).call(this);break;case Ir.BUNDLE_LOADED:{let[,f,p]=t;pe(this,Ud,"m",is).call(this,f),ai(this,es,!0,"f"),pe(this,Wo,"f")?.resolve({metrics:{init:pe(this,s6,"f"),loadBundle:p}}),ai(this,Wo,void 0,"f");break}case Ir.BUNDLE_LOAD_FAILED:{let[,,f,p]=t;pe(this,Ud,"m",is).call(this,p),pe(this,Wo,"f")?.reject(f),ai(this,Wo,void 0,"f");break}case Ir.RETURN:{let[,f,p,v]=t;pe(this,Ud,"m",is).call(this,v),pe(this,od,"f")[f]?.resolve(p),delete pe(this,od,"f")[f];break}case Ir.ERROR:{let[,f,p,v]=t;pe(this,Ud,"m",is).call(this,v),pe(this,od,"f")[f]?.reject(p),delete pe(this,od,"f")[f];break}case Ir.CIRCUIT_BREAKER:{let[,f,p,v]=t;pe(this,od,"f")[f]?.reject(new b4(p,v)),delete pe(this,od,"f")[f];break}case Ir.PLUGIN_CALL:{let[,f,p,v,y,g]=t;pe(this,ts,"f")?.callback(f,p,v,y,g);break}case Ir.UNHANDLED_REJECTION:{let[,,f,p]=t;pe(this,Ud,"m",is).call(this,p),pe(this,ns,"f").call(this,"UnhandledRejection",f);break}}}),Eh.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"),pe(this,Go,"f")?.close();let t=new URL(location.href);t.searchParams.set(wh,pe(this,Nh,"f")??""),location.assign(t),location.reload();break}}}),ai(this,u6,n,"f"),i&&ai(this,ns,i,"f"),d&&ai(this,ts,d,"f")}get ready(){return pe(this,es,"f")}get runtimeDebugLogging(){return pe(this,x3,"f")}set runtimeDebugLogging(n){n!==pe(this,x3,"f")&&(ai(this,x3,n,"f"),this.runtimeDebugLogging&&pe(this,ui,"f")?.postMessage([dd.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(pe(this,ui,"f"))throw new Error("Bundle already loaded");let i=fO(yh(n));i&&(ai(this,Go,new a6,"f"),pe(this,Go,"f").onState=pe(this,Eh,"f")),pe(this,Go,"f")?.open();let d=new Worker(URL.createObjectURL(pe(this,u6,"f")),{name:`App: ${rO(n)}`,type:"module"});return d.onerror=r=>pe(this,ns,"f").call(this,"Error",r.error),d.onmessageerror=r=>pe(this,ns,"f").call(this,"MessageError",r.data),d.onmessage=pe(this,xh,"f"),ai(this,ui,d,"f"),ai(this,I3,n,"f"),this.runtimeDebugLogging&&pe(this,ui,"f").postMessage([dd.ENABLE_DEBUG_LOGGING]),i&&pe(this,ui,"f").postMessage([dd.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ai(this,Wo,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!pe(this,es,"f")||!pe(this,ui,"f"))throw new Error("No bundle loaded");let t=ai(this,l6,(r=pe(this,l6,"f"),++r),"f"),s=new Promise((f,p)=>{pe(this,od,"f")[t]={resolve:f,reject:p}});return pe(this,ui,"f").postMessage([dd.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){pe(this,ui,"f")?.postMessage([dd.PLUGIN_RESPONSE,n,i])}quit(){pe(this,Go,"f")?.close(),ai(this,Go,void 0,"f"),ai(this,es,!1,"f"),pe(this,ui,"f")&&(pe(this,ui,"f").postMessage([dd.QUIT]),pe(this,ui,"f").onerror=null,pe(this,ui,"f").onmessageerror=null,pe(this,ui,"f").onmessage=null,pe(this,ui,"f").terminate()),ai(this,ui,void 0,"f");for(let{reject:n}of Object.values(pe(this,od,"f")))n(Error("worker terminated"));ai(this,od,{},"f"),pe(this,Wo,"f")?.reject(Error("worker terminated")),ai(this,Wo,void 0,"f")}};u6=new WeakMap,ui=new WeakMap,es=new WeakMap,l6=new WeakMap,I3=new WeakMap,od=new WeakMap,Wo=new WeakMap,ns=new WeakMap,ts=new WeakMap,Go=new WeakMap,Nh=new WeakMap,x3=new WeakMap,s6=new WeakMap,xh=new WeakMap,Eh=new WeakMap,Ud=new WeakSet,pO=function(){pe(this,ui,"f")?.postMessage([dd.ENABLE_PLUGINS,pe(this,ts,"f")?.plugins??[]])},is=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:ZF[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};pe(this,Go,"f")?.send({callState:d})},Ih=function(){pe(this,ui,"f")?.postMessage([dd.LOAD_BUNDLE,pe(this,I3,"f")]),ai(this,I3,void 0,"f")};var Oh="RenderPostContent",VF=new Set([Oh]);function hO(e){if(VF.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var rs,E3,c6=class{constructor(n){Se(this,rs);Se(this,E3);Oe(this,rs,n)}set env(n){Oe(this,rs,n)}set props(n){Oe(this,E3,n)}build(n,i){return new d6({state:n,events:i.map(d=>d.uiEvent),env:x(this,rs),props:x(this,E3)})}};rs=new WeakMap,E3=new WeakMap;var bt,O3,v6,p6=class{constructor(){Se(this,bt);Se(this,O3,!1);Se(this,v6,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===nl.fullName&&d===nl.methods.send.name&&x(this,bt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!x(this,bt)?.ready}set runtimeDebugLogging(n){Oe(this,O3,n),x(this,bt)&&(x(this,bt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),Oe(this,bt,n?new f6(n,(i,d)=>console.error(i,d),{callback:x(this,v6),plugins:[]}):void 0),x(this,bt)&&(x(this,bt).runtimeDebugLogging=x(this,O3))}unload(){x(this,bt)?.quit()}async load(n){this.unload();try{return await x(this,bt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!x(this,bt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),x(this,bt)?.call(hO(n),i.uiRequest,this.metadata).then(t=>d(new g3(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};bt=new WeakMap,O3=new WeakMap,v6=new WeakMap;var h6=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[hO(n)](i.uiRequest,this.metadata).then(t=>d(new g3(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var zo,Ko,P3,m6=class{constructor(n){Se(this,zo,new Map);Se(this,Ko,new Map);Se(this,P3);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),Oe(this,P3,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),x(this,Ko).set(n.id,n),x(this,zo).set(n.id,window.setInterval(()=>{x(this,P3).submit([new xr({scope:Cn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(x(this,Ko));n.forEach(d=>{i.delete(d.id),x(this,Ko).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 x(this,zo).values())clearInterval(n);x(this,zo).clear(),x(this,Ko).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...x(this,Ko).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of x(this,zo).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),x(this,Ko).delete(n),clearInterval(x(this,zo).get(n)),x(this,zo).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};zo=new WeakMap,Ko=new WeakMap,P3=new WeakMap;var vO=e=>e.message==="ServerCallRequired",Ph=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){vO(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,Mh=class{constructor(n,i){Se(this,M3);Se(this,_3);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};Oe(this,M3,n),Oe(this,_3,i)}logRuntimeError(n){var i;vO(n)||(console.error("[kmp-dispatcher-perf-analytics] error",n),(i=x(this,_3))==null||i.call(this,n))}logRuntimeTrace(n){var i;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n),(i=x(this,M3))==null||i.call(this,n)}};M3=new WeakMap,_3=new WeakMap;tO();var JF=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},HF=["showToast","showForm","navigateToUrl","createOrder"],Ol,Pl,Er,B3,Ml,ad,ds,k6=class{constructor(n,i,d){Se(this,Ol);Se(this,Pl);Se(this,Er);Se(this,B3);this.hasRendered=!1;Se(this,Ml);Se(this,ad);Se(this,ds);Oe(this,Ol,new c6(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),Oe(this,Er,new e6(n??{},x(this,Ol),Oh,{logger:new Ph,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new Mh(d.performanceTracker,d.errorTracker),errorHandler:r=>this.onError?.(r)})),Oe(this,Pl,new m6(x(this,Er))),Oe(this,Ml,new h6),Oe(this,ad,new p6),this.init()}get state(){return x(this,Er).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[_o.Debug]={values:d}),x(this,ad).metadata=i,x(this,Ml).metadata=i}set onPluginCall(n){x(this,ad).onPluginCall=n}set runtimeDebugLogging(n){x(this,ad).runtimeDebugLogging=n}subscribe(n){Oe(this,B3,x(this,Er).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(HF.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&x(this,Pl).clear(),x(this,Pl).apply(t.map(([s,f])=>new dt(s,JF(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){x(this,Er).submit(...n)}unsubscribe(){x(this,B3)?.unsubscribe()}init(){x(this,Er).init(x(this,ad),x(this,Ml),x(this,Pl))}togglePause(n){n?Oe(this,ds,x(this,Er).pause()):x(this,ds)&&x(this,Er).resume(x(this,ds))}resetAppState(){this.hasRendered=!1,x(this,Er).reset()}setEnv(n){x(this,Ol).env=n}setProps(n){x(this,Ol).props=n}remoteLoad(...n){x(this,Ml).load(...n)}async localLoad(...n){return x(this,ad).reset(),await x(this,ad).load(...n)}localLoadWorker(...n){x(this,ad).setLocalSrc(...n)}};Ol=new WeakMap,Pl=new WeakMap,Er=new WeakMap,B3=new WeakMap,Ml=new WeakMap,ad=new WeakMap,ds=new WeakMap;function _h(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 p=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",p).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var _l,Bl,Ll,os,as,on,y6,S6,tr,Bh,w6,A6,Ou,us,C6,li=class extends rr{constructor(){super();Se(this,tr);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.appPublicApiVersion="";this.disableAssetSandbox=!1;Se(this,_l);Se(this,Bl);Se(this,Ll);Se(this,os,!1);Se(this,as,"");Se(this,on);Se(this,y6,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:i=>this.disableAssetSandbox?i:_h(this.webViewUrlTemplate,this.metadata?.[_o.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",i),onAction:i=>{let d={};i.type===Bi.ACTION_CLICK||x(this,os)?d.userAction={actionId:i.id,data:i.data??{}}:i.type===Bi.ACTION_WEBVIEW&&(d.webView={postMessage:{message:i.data}}),x(this,on)?.submit([new xr({scope:Cn.ALL,hook:i.id,...d})])},stackDirection:Ce.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));Se(this,S6,i=>{Nx(i)||console.error(i),nn(this,tr,Ou).call(this,"devvit-ui-error",{err:i,type:"Error"})});Se(this,w6,(i,d,r,t,s)=>{d===nl.fullName&&r===nl.methods.send.name&&nn(this,tr,Ou).call(this,"devvit-realtime-send",{event:t})});Se(this,A6,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,x(this,_l)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=x(this,_l)):Oe(this,_l,this._rootBlock.config?.rootConfig?.height||i8))});Se(this,us,i=>{nn(this,tr,Ou).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>d.webView?.postMessage?x(this,on)?.submit([new xr({scope:Cn.ALL,hook:d.hook,webView:{...d.webView}})]):x(this,on)?.submit([new xr(d)]),metadata:this.metadata})});Se(this,C6,async i=>{if(await this.updateComplete,i.webView?.fullscreen){let d=_h(this.webViewUrlTemplate,this.metadata?.[_o.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",i.webView.fullscreen.url);devvit?.debug.surface&&console.debug("[surface] fullscreen web view asset,",i.webView.fullscreen.url,"resolved to",d),i.webView.fullscreen.url=d,x(this,us).call(this,i)}else if(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?x(this,us).call(this,i):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[h4]}async connectedCallback(){super.connectedCallback(),Oe(this,on,new k6({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[_o.Language]?.values?.[0],timezone:this.metadata?.[_o.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:i=>{nn(this,tr,Ou).call(this,TN,{name:i.spanName,timeStart:i.startTimeMs,timeEnd:i.endTimeMs,target:i.target,intent:i.intent,eventCount:i.eventCount})},errorTracker:i=>{nn(this,tr,Ou).call(this,RN,{message:i.message,origin:i.origin,version:i.version})}})),x(this,on).onPluginCall=x(this,w6),x(this,on).onError=x(this,S6),x(this,on).onUserAction=x(this,us),x(this,on).onWebViewMessage=x(this,C6),x(this,on).subscribe(i=>{x(this,A6).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),Oe(this,Bl,new ResizeObserver(Ix(i=>{i.length!==0&&(this.dimensions=Fx(i[0],window,document.body))},600))),x(this,Bl).observe(this,{box:"content-box"}),Oe(this,Ll,new IntersectionObserver(i=>{i.forEach(d=>{x(this,on)?.togglePause(!d.isIntersecting)})})),x(this,Ll).observe(this)}disconnectedCallback(){x(this,Bl)?.unobserve(this),x(this,Bl)?.disconnect(),x(this,Ll)?.unobserve(this),x(this,Ll)?.disconnect(),x(this,on)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?Tt`<div class="relative">
625
+ </div>`}else return r}var zc,Kc,C4,Cl=class extends rr{constructor(){super(...arguments);Se(this,zc,window.matchMedia("(prefers-color-scheme: dark)"));Se(this,Kc,()=>this.requestUpdate());Se(this,C4,()=>({stackDirection:Ce.UNRECOGNIZED}))}static get styles(){return[h4]}connectedCallback(){super.connectedCallback(),x(this,zc)?.addEventListener("change",x(this,Kc))}disconnectedCallback(){super.disconnectedCallback(),x(this,zc)?.removeEventListener("change",x(this,Kc))}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===fe.BLOCK_ROOT){let i={...x(this,C4).call(this),...this.renderContext?.()??{}},d=new p4,r=t8(this.block,i);return d.finish(),this.dispatchEvent(I0(Vc,{name:"blocks_layout",timeStart:d.timeStart,timeEnd:d.timeEnd})),Tt` <div class="${Xo(this.class)}">${r}</div>`}return Tt`${gN({creative:Tt`<slot name="empty-state-image"></slot>`,title:Wp("Whoops!",{desc:"Header for message to display when rendering fails"}),description:Wp("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};zc=new WeakMap,Kc=new WeakMap,C4=new WeakMap,He([bn({attribute:!1})],Cl.prototype,"block",2),He([bn({attribute:!1})],Cl.prototype,"renderContext",2),He([bn()],Cl.prototype,"class",2),Cl=He([CN(),E0("devvit-blocks-renderer")],Cl);var Rx="ServerCallRequired";var b4=class extends Error{constructor(n,i){super(Rx),this.response=n,this.cause=i,this.name="CircuitBreakerResponse"}};function Nx(e){return e?.message===Rx}var _o=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",Username:"devvit-user-name",UserAgent:"devvit-user-agent",Version:"devvit-version",Language:"devvit-accept-language",Timezone:"devvit-accept-timezone",Traceparent:"traceparent",AppDependencies:"devvit-app-dependencies"}),xx;(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"})(xx||(xx={}));function Ix(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 Ex(e,n){if(!e)throw Error(n)}var g4;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(g4||(g4={}));function Q_(e){return e.startsWith(g4.LINK)}function j_(e){Ex(Q_(e),`Expected link id to start with ${g4.LINK}, got ${e}}`)}function Ox(e){return j_(e),e}var eB=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,M0=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let n=e.match(eB);if(!n)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return n.shift(),n},Px=e=>e==="*"||e==="x"||e==="X",Mx=e=>{let n=parseInt(e,10);return isNaN(n)?e:n},nB=(e,n)=>typeof e!=typeof n?[String(e),String(n)]:[e,n],iB=(e,n)=>{if(Px(e)||Px(n))return 0;let[i,d]=nB(Mx(e),Mx(n));return i>d?1:i<d?-1:0},r8=(e,n)=>{for(let i=0;i<Math.max(e.length,n.length);i++){let d=iB(e[i]||"0",n[i]||"0");if(d!==0)return d}return 0};var _x=(e,n)=>{let i=M0(e),d=M0(n),r=i.pop(),t=d.pop(),s=r8(i,d);return s!==0?s:r&&t?r8(r.split("."),t.split(".")):r||t?r?-1:1:0};var d8=(e,n,i)=>{tB(i);let d=_x(e,n);return Lx[i].includes(d)},Lx={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},Bx=Object.keys(Lx),tB=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(Bx.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${Bx.join("|")}`)};function Fx(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,p=f<0?Math.max(i+f,0):Math.min(f,i);t<p;)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 eI=Math.clz32,f8=ArrayBuffer.isView,kn=Math.imul;V(b8,"CharSequence",Jo);V(g8,"Number",te);V(T8,"Unit",di);V(U0,"IntCompanionObject",di);V(gi,"Collection",Jo);V(Zo,"AbstractCollection",te,U,[gi]);V(Qr,"AbstractMutableCollection",te,Zo,[Zo,gi]);V(n3,"IteratorImpl",te);V(V0,"List",Jo,U,[gi]);V(br,"AbstractMutableList",te,Qr,[Qr,gi,V0]);V(Uo,"Map",Jo);V(gr,"AbstractMap",te,U,[Uo]);V(_0,"AbstractMutableMap",te,gr,[gr,Uo]);V(d3,"Set",Jo,U,[gi]);V(Lo,"AbstractMutableSet",te,Qr,[Qr,gi,d3]);V(rI,"Companion",di);V(Kn,"ArrayList",te,br,[br,gi,V0],rt);V(jr,"HashMap",te,_0,[_0,Uo],kB);V(Tr,"HashMapEntrySetBase",te,Lo,[gi,d3,Lo]);V(x8,"HashMapEntrySet",te,Tr);V(wu,"HashSet",te,Lo,[Lo,gi,d3],I8);V(sI,"Companion",di);V(Vo,"Itr",te);V(M8,"KeysItr",te,Vo);V(t3,"EntriesItr",te,Vo);V(Fo,"Entry",Jo);V(gl,"EntryRef",te,U,[Fo]);function rB(e){var n;e:{var i;if(On(e,gi)?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&&On(t,Fo)?s=this.c4(t):s=!1,!s){n=!1;break e}}n=!0}return n}V(fI,"InternalMap",Jo);V(Ii,"InternalHashMap",te,U,[fI],E8);V(B4,"LinkedHashMap",te,jr,[jr,Uo],r3);V(nd,"StringBuilder",te,U,[b8],_8);V(yI,"Companion",di);V(SI,"Char",te);V(wI,"Companion",di);V(Ct,"Enum",te);V(L4,U,te);V(OI,"Companion",di);V(Ve,"Long",te,g8);V(Ho,"Exception",te,Error,U,qI);V(qi,"RuntimeException",te,Ho,U,zI);V($0,"IllegalArgumentException",te,qi,U,$I);V(G0,"IndexOutOfBoundsException",te,qi,U,WI);V(z0,"IllegalStateException",te,qi,U,GI);V(U4,"UnsupportedOperationException",te,qi,U,K0);V(X0,"NoSuchElementException",te,qi,U,qo);V(Z4,"ConcurrentModificationException",te,qi,U,V8);V(Y0,"ArithmeticException",te,qi,U,XI);V(V4,"NullPointerException",te,qi,U,J8);V(J4,"ClassCastException",te,qi,U,H8);V(Q0,"UninitializedPropertyAccessException",te,qi,U,QI);V(Au,"Companion",di);V(nE,"Companion",di);V(H4,"Companion",di);V(tE,"Companion",di);V(Pn,"ArrayDeque",te,br,U,s3);V(rd,"EmptyList",di,U,[V0]);V(q4,"EmptyIterator",di);V(Do,"ArrayAsCollection",te,U,[gi]);V(D4,"IntIterator",te);V(oE,"Companion",di);V(_d,"IntProgression",te);V(Su,"IntRange",te,_d);V($4,"IntProgressionIterator",te,D4);V(W8,"Companion",di);V(bi,"Pair",te);function b8(){}function g8(){}function T8(){}c(T8).toString=function(){return"kotlin.Unit"};var Ie;function U0(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}c(U0).c=function(){return this.MIN_VALUE};c(U0).d=function(){return this.MAX_VALUE};c(U0).e=function(){return this.SIZE_BYTES};c(U0).f=function(){return this.SIZE_BITS};var R8;function dB(e){return e!==e}function oB(e){var n;if(e===0)n=0;else{var i=31;n=1<<(i-eI(e)|0)}return n}function nI(e){return tF(e)}function aB(e,n){return n}function uB(e,n){return J0(Array(n),null)}function O4(e){return oF([e])}function Z0(e){var n;return e.toArray!==void 0?n=e.toArray():n=nI(e),n}function Ue(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),f8(n)&&f8(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 p=f;f=f+1|0,n[i+p|0]=e[d+p|0]}while(f<t)}else{var v=t-1|0;if(0<=v)do{var y=v;v=v+-1|0,n[i+y|0]=e[d+y|0]}while(0<=v)}}function lB(e){return e<0&&aF(),e}function Qr(){Zo.call(this)}c(Qr).j=function(e){this.k();for(var n=this.l();n.m();)if(Ze(n.o(),e))return n.n(),!0;return!1};c(Qr).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};c(Qr).toJSON=function(){return this.toArray()};c(Qr).k=function(){};function n3(e){this.w_1=e,this.u_1=0,this.v_1=-1}c(n3).m=function(){return this.u_1<this.w_1.q()};c(n3).o=function(){if(!this.m())throw qo();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)};c(n3).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw u3(id(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function br(){Qr.call(this),this.y_1=0}c(br).i=function(e){return this.k(),this.a1(this.q(),e),!0};c(br).l=function(){return new n3(this)};c(br).r=function(e){return this.b1(e)>=0};c(br).b1=function(e){var n;e:{for(var i=0,d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=i;break e}i=i+1|0}n=-1}return n};c(br).equals=function(e){return e===this?!0:e!=null&&On(e,V0)?tt.c1(this,e):!1};c(br).hashCode=function(){return tt.d1(this)};function _0(){gr.call(this),this.g1_1=null,this.h1_1=null}c(_0).j1=function(e){this.k();for(var n=this.k1().l();n.m();){var i=n.o(),d=i.l1();if(Ze(e,d)){var r=i.m1();return n.n(),r}}return null};c(_0).k=function(){};function Lo(){Qr.call(this)}c(Lo).equals=function(e){return e===this?!0:e!=null&&On(e,d3)?q8.s1(this,e):!1};c(Lo).hashCode=function(){return q8.t1(this)};function iI(e){if(!(e>=0)){var n="capacity must be non-negative.";throw ed(id(n))}return J0(Array(e),null)}function tI(e,n){e[n]=null}function Ux(e,n,i){e.fill(null,n,i)}function Zx(e,n){return _L(e,n)}function rI(){c8=this;var e=this,n=P4(0);n.w1_1=!0,e.x1_1=n}var c8;function sB(){return c8==null&&new rI,c8}function fB(e){var n=[];return Kn.call(e,n),e}function rt(){return fB(Ge(c(Kn)))}function cB(e,n){var i=[];if(Kn.call(n,i),!(e>=0)){var d="Negative initial capacity: "+e;throw ed(id(d))}return n}function P4(e){return cB(e,Ge(c(Kn)))}function pB(e,n){var i=Z0(e);return Kn.call(n,i),n}function N8(e){return pB(e,Ge(c(Kn)))}function hB(e,n){var i=e.q();return e.v1_1.length=e.q()+n|0,i}function dI(e,n){return tt.y1(n,e.q()),n}function vB(e,n){return tt.z1(n,e.q()),n}function Kn(e){sB(),br.call(this),this.v1_1=e,this.w1_1=!1}c(Kn).q=function(){return this.v1_1.length};c(Kn).x=function(e){var n=this.v1_1[dI(this,e)];return n==null||n!=null?n:rn()};c(Kn).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};c(Kn).a1=function(e,n){this.k(),this.v1_1.splice(vB(this,e),0,n),this.y_1=this.y_1+1|0};c(Kn).p=function(e){if(this.k(),e.t())return!1;for(var n=hB(this,e.q()),i=0,d=e.l();d.m();){var r=d.o(),t=i;i=t+1|0;var s=lB(t);this.v1_1[n+s|0]=r}return this.y_1=this.y_1+1|0,!0};c(Kn).z=function(e){this.k(),dI(this,e),this.y_1=this.y_1+1|0;var n;return e===E4(this)?n=this.v1_1.pop():n=this.v1_1.splice(e,1)[0],n};c(Kn).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,Ze(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};c(Kn).b1=function(e){return hI(this.v1_1,e)};c(Kn).toString=function(){return QB(this.v1_1)};c(Kn).a2=function(){return[].slice.call(this.v1_1)};c(Kn).toArray=function(){return this.a2()};c(Kn).k=function(){if(this.w1_1)throw K0()};function mB(e,n){return _0.call(n),jr.call(n),n.f2_1=e,n}function oI(e){return mB(E8(),e),e}function kB(){return oI(Ge(c(jr)))}c(jr).p1=function(e){return this.f2_1.h2(e)};c(jr).k1=function(){var e=this.g2_1,n;if(e==null){var i=new x8(this.f2_1);this.g2_1=i,n=i}else n=e;return n};c(jr).r1=function(e){return this.f2_1.r1(e)};c(jr).i1=function(e,n){return this.f2_1.i1(e,n)};c(jr).j1=function(e){return this.f2_1.j1(e)};c(jr).q=function(){return this.f2_1.q()};function jr(){this.g2_1=null}function x8(e){Tr.call(this,e)}c(x8).l=function(){return this.j2_1.k2()};function Tr(e){Lo.call(this),this.j2_1=e}c(Tr).q=function(){return this.j2_1.q()};c(Tr).t=function(){return this.j2_1.q()===0};c(Tr).l2=function(e){return this.j2_1.n2(e)};c(Tr).r=function(e){return e!=null&&On(e,Fo)?this.l2(e!=null&&On(e,Fo)?e:rn()):!1};c(Tr).m2=function(e){throw K0()};c(Tr).i=function(e){return this.m2(e!=null&&On(e,Fo)?e:rn())};c(Tr).p=function(e){throw K0()};c(Tr).s=function(e){return this.j2_1.o2(e)};c(Tr).k=function(){return this.j2_1.k()};function yB(e,n){return Lo.call(n),wu.call(n),n.p2_1=e,n}function SB(e){return yB(E8(),e),e}function I8(){return SB(Ge(c(wu)))}c(wu).i=function(e){return this.p2_1.i1(e,!0)==null};c(wu).r=function(e){return this.p2_1.h2(e)};c(wu).t=function(){return this.p2_1.q()===0};c(wu).l=function(){return this.p2_1.q2()};c(wu).q=function(){return this.p2_1.q()};function wu(){}function aI(e,n){return oB(kn(R4(n,1),3))}function uI(e,n){return eI(n)+1|0}function wB(e){return AB(8,e),e}function E8(){return wB(Ge(c(Ii)))}function AB(e,n){return Ii.call(n,iI(e),null,new Int32Array(e),new Int32Array(aI(i3,e)),2,0),n}function B0(e){return e.r2_1.length}function Qt(e){return e.u2_1.length}function O8(e){e.y2_1=e.y2_1+1|0}function CB(e,n){bB(e,n)?P8(e,Qt(e)):gB(e,e.w2_1+n|0)}function bB(e,n){var i=B0(e)-e.w2_1|0,d=e.w2_1-e.q()|0;return i<n&&(d+i|0)>=n?d>=(B0(e)/4|0):!1}function gB(e,n){if(n<0)throw KI("too many elements");if(n>B0(e)){var i=tt.b3(B0(e),n);e.r2_1=Zx(e.r2_1,i);var d=e,r=e.s2_1;d.s2_1=r==null?null:Zx(r,i),e.t2_1=ML(e.t2_1,i);var t=aI(i3,i);t>Qt(e)&&P8(e,t)}}function TB(e){var n=e.s2_1;if(n!=null)return n;var i=iI(B0(e));return e.s2_1=i,i}function M4(e,n){return n==null?0:kn(Zn(n),-1640531527)>>>e.x2_1|0}function RB(e){for(var n=0,i=0,d=e.s2_1;n<e.w2_1;)e.t2_1[n]>=0&&(e.r2_1[i]=e.r2_1[n],d!=null&&(d[i]=d[n]),i=i+1|0),n=n+1|0;Ux(e.r2_1,i,e.w2_1),d==null||Ux(d,i,e.w2_1),e.w2_1=i}function P8(e,n){O8(e),e.w2_1>e.z2_1&&RB(e),n!==Qt(e)?(e.u2_1=new Int32Array(n),e.x2_1=uI(i3,n)):PL(e.u2_1,0,0,Qt(e));for(var i=0;i<e.w2_1;){var d=i;if(i=d+1|0,!NB(e,d))throw u3("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function NB(e,n){for(var i=M4(e,e.r2_1[n]),d=e.v2_1;;){var r=e.u2_1[i];if(r===0)return e.u2_1[i]=n+1|0,e.t2_1[n]=i,!0;if(d=d-1|0,d<0)return!1;var t=i;i=t-1|0,t===0&&(i=Qt(e)-1|0)}}function _4(e,n){for(var i=M4(e,n),d=e.v2_1;;){var r=e.u2_1[i];if(r===0)return-1;if(r>0&&Ze(e.r2_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=Qt(e)-1|0)}}function xB(e,n){e.k();e:for(;;)for(var i=M4(e,n),d=N4(kn(e.v2_1,2),Qt(e)/2|0),r=0;;){var t=e.u2_1[i];if(t<=0){if(e.w2_1>=B0(e)){CB(e,1);continue e}var s=e.w2_1;e.w2_1=s+1|0;var f=s;return e.r2_1[f]=n,e.t2_1[f]=i,e.u2_1[i]=f+1|0,e.z2_1=e.z2_1+1|0,O8(e),r>e.v2_1&&(e.v2_1=r),f}if(Ze(e.r2_1[t-1|0],n))return-t|0;if(r=r+1|0,r>d){P8(e,kn(Qt(e),2));continue e}var p=i;i=p-1|0,p===0&&(i=Qt(e)-1|0)}}function IB(e,n){e.k();var i=_4(e,n);return i<0?-1:(lI(e,i),i)}function lI(e,n){tI(e.r2_1,n),EB(e,e.t2_1[n]),e.t2_1[n]=-1,e.z2_1=e.z2_1-1|0,O8(e)}function EB(e,n){for(var i=n,d=n,r=0,t=N4(kn(e.v2_1,2),Qt(e)/2|0);;){var s=i;if(i=s-1|0,s===0&&(i=Qt(e)-1|0),r=r+1|0,r>e.v2_1)return e.u2_1[d]=0,Ie;var f=e.u2_1[i];if(f===0)return e.u2_1[d]=0,Ie;if(f<0)e.u2_1[d]=-1,d=i,r=0;else{var p=M4(e,e.r2_1[f-1|0]);((p-i|0)&(Qt(e)-1|0))>=r&&(e.u2_1[d]=f,e.t2_1[f-1|0]=d,d=i,r=0)}if(t=t-1|0,t<0)return e.u2_1[d]=-1,Ie}}function OB(e,n){return e.z2_1===n.q()?e.o2(n.k1()):!1}function sI(){this.c3_1=-1640531527,this.d3_1=8,this.e3_1=2,this.f3_1=-1}var i3;function Vo(e){this.g3_1=e,this.h3_1=0,this.i3_1=-1,this.j3_1=this.g3_1.y2_1,this.k3()}c(Vo).k3=function(){for(;this.h3_1<this.g3_1.w2_1&&this.g3_1.t2_1[this.h3_1]<0;)this.h3_1=this.h3_1+1|0};c(Vo).m=function(){return this.h3_1<this.g3_1.w2_1};c(Vo).n=function(){if(this.l3(),this.i3_1===-1){var e="Call next() before removing element from the iterator.";throw u3(id(e))}this.g3_1.k(),lI(this.g3_1,this.i3_1),this.i3_1=-1,this.j3_1=this.g3_1.y2_1};c(Vo).l3=function(){if(this.g3_1.y2_1!==this.j3_1)throw V8()};function M8(e){Vo.call(this,e)}c(M8).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=this.g3_1.r2_1[this.i3_1];return this.k3(),i};function t3(e){Vo.call(this,e)}c(t3).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=new gl(this.g3_1,this.i3_1);return this.k3(),i};c(t3).u3=function(){if(this.h3_1>=this.g3_1.w2_1)throw qo();var e=this,n=this.h3_1;this.h3_1=n+1|0,e.i3_1=n;var i=this.g3_1.r2_1[this.i3_1],d=i==null?null:Zn(i),r=d??0,t=q0(this.g3_1.s2_1)[this.i3_1],s=t==null?null:Zn(t),f=r^(s??0);return this.k3(),f};c(t3).v3=function(e){if(this.h3_1>=this.g3_1.w2_1)throw qo();var n=this,i=this.h3_1;this.h3_1=i+1|0,n.i3_1=i;var d=this.g3_1.r2_1[this.i3_1];Ze(d,this.g3_1)?e.y3("(this Map)"):e.x3(d),e.z3(61);var r=q0(this.g3_1.s2_1)[this.i3_1];Ze(r,this.g3_1)?e.y3("(this Map)"):e.x3(r),this.k3()};function gl(e,n){this.a4_1=e,this.b4_1=n}c(gl).l1=function(){return this.a4_1.r2_1[this.b4_1]};c(gl).m1=function(){return q0(this.a4_1.s2_1)[this.b4_1]};c(gl).equals=function(e){var n,i;return e!=null&&On(e,Fo)?i=Ze(e.l1(),this.l1()):i=!1,i?n=Ze(e.m1(),this.m1()):n=!1,n};c(gl).hashCode=function(){var e=this.l1(),n=e==null?null:Zn(e),i=n??0,d=this.m1(),r=d==null?null:Zn(d);return i^(r??0)};c(gl).toString=function(){return""+this.l1()+"="+this.m1()};function Ii(e,n,i,d,r,t){this.r2_1=e,this.s2_1=n,this.t2_1=i,this.u2_1=d,this.v2_1=r,this.w2_1=t,this.x2_1=uI(i3,Qt(this)),this.y2_1=0,this.z2_1=0,this.a3_1=!1}c(Ii).q=function(){return this.z2_1};c(Ii).r1=function(e){var n=_4(this,e);return n<0?null:q0(this.s2_1)[n]};c(Ii).h2=function(e){return _4(this,e)>=0};c(Ii).i1=function(e,n){var i=xB(this,e),d=TB(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};c(Ii).j1=function(e){var n=IB(this,e);if(n<0)return null;var i=q0(this.s2_1),d=i[n];return tI(i,n),d};c(Ii).equals=function(e){var n;if(e===this)n=!0;else{var i;e!=null&&On(e,Uo)?i=OB(this,e):i=!1,n=i}return n};c(Ii).hashCode=function(){for(var e=0,n=this.k2();n.m();)e=e+n.u3()|0;return e};c(Ii).toString=function(){var e=_B(2+kn(this.z2_1,3)|0);e.y3("{");for(var n=0,i=this.k2();i.m();)n>0&&e.y3(", "),i.v3(e),n=n+1|0;return e.y3("}"),e.toString()};c(Ii).k=function(){if(this.a3_1)throw K0()};c(Ii).n2=function(e){var n=_4(this,e.l1());return n<0?!1:Ze(q0(this.s2_1)[n],e.m1())};c(Ii).c4=function(e){return this.n2(On(e,Fo)?e:rn())};c(Ii).q2=function(){return new M8(this)};c(Ii).k2=function(){return new t3(this)};function fI(){}function PB(e){return oI(e),B4.call(e),e}function r3(){return PB(Ge(c(B4)))}c(B4).k=function(){return this.f2_1.k()};function B4(){}function MB(e,n){return cI(n),n}function _B(e){return MB(e,Ge(c(nd)))}function cI(e){return nd.call(e,""),e}function _8(){return cI(Ge(c(nd)))}function nd(e){this.w3_1=e!==void 0?e:""}c(nd).a=function(){return this.w3_1.length};c(nd).b=function(e){var n=this.w3_1,i;if(e>=0&&e<=lE(n))i=L0(n,e);else throw W0("index: "+e+", length: "+this.a()+"}");return i};c(nd).z3=function(e){return this.w3_1=this.w3_1+x4(e),this};c(nd).j4=function(e){return this.w3_1=this.w3_1+o3(e),this};c(nd).x3=function(e){return this.w3_1=this.w3_1+o3(e),this};c(nd).y3=function(e){var n=this,i=this.w3_1;return n.w3_1=i+(e??"null"),this};c(nd).toString=function(){return this.w3_1};function Vx(e){var n=x4(e).toUpperCase();return n.length>1?e:L0(n,0)}function BB(e,n,i,d,r,t){return t=t===U?!1:t,fE(e,n,i,d,r,t)}function B8(e){switch(e.length){case 0:return Rr();case 1:return O4(e[0]);default:return LB(e)}}function pI(e){return e.length-1|0}function LB(e){return N8(dF(e))}function hI(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,Ze(n,e[f]))return f}while(t<=s)}return-1}function FB(e,n){return hI(e,n)>=0}function UB(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,ZB(e,_8(),n,i,d,r,t,s).toString()}function ZB(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.j4(d);var p=0,v=0,y=e.length;e:for(;v<y;){var g=e[v];if(v=v+1|0,p=p+1|0,p>1&&n.j4(i),t<0||p<=t)uE(n,g,f);else break e}return t>=0&&p>t&&n.j4(s),n.j4(r),n}function vI(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,VB(e,_8(),n,i,d,r,t,s).toString()}function VB(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.j4(d);var p=0,v=e.l();e:for(;v.m();){var y=v.o();if(p=p+1|0,p>1&&n.j4(i),t<0||p<=t)uE(n,y,f);else break e}return t>=0&&p>t&&n.j4(s),n.j4(r),n}function mI(e){if(e.t())throw l3("List is empty.");return e.x(0)}function kI(e,n){if(On(n,gi)){var i=P4(e.q()+n.q()|0);return i.p(e),i.p(n),i}else{var d=N8(e);return uF(d,n),d}}function R4(e,n){return e<n?n:e}function JB(e,n){return aE.k4(e,n,-1)}function N4(e,n){return e>n?n:e}function HB(e){var n=e&65535;return n}function Jx(e){return e}function x4(e){return String.fromCharCode(e)}function yI(){p8=this,this.l4_1=0,this.m4_1=65535,this.n4_1=55296,this.o4_1=56319,this.p4_1=56320,this.q4_1=57343,this.r4_1=55296,this.s4_1=57343,this.t4_1=2,this.u4_1=16}var p8;function Hx(){return p8==null&&new yI,p8}function SI(){}function V0(){}function gi(){}function Fo(){}function Uo(){}function d3(){}function wI(){}var qB;function Ct(e,n){this.v4_1=e,this.w4_1=n}c(Ct).x4=function(){return this.v4_1};c(Ct).y4=function(){return this.w4_1};c(Ct).z4=function(e){return eL(this.w4_1,e.w4_1)};c(Ct).a5=function(e){return this.z4(e instanceof Ct?e:rn())};c(Ct).equals=function(e){return this===e};c(Ct).hashCode=function(){return iL(this)};c(Ct).toString=function(){return this.v4_1};function o3(e){var n=e==null?null:id(e);return n??"null"}function DB(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$,p=f??t.$imask$;p!=null&&(i.push(p),s=p.length);var v=t.$metadata$.iid,y;v==null?y=null:y=$B(v);var g=y;g!=null&&(i.push(g),s=Math.max(s,g.length)),s>n&&(n=s)}return WB(n,i)}function $B(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 WB(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 p=n[s];s=s+1|0,r<p.length&&(t=t|p[r])}d[r]=t,i=i+1|0}return d}function GB(e,n){var i=n>>5;if(i>e.length)return!1;var d=n&31,r=1<<d;return!!(e[i]&r)}function J0(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 zB(e){return new L4(e)}function L4(e){this.c5_1=e,this.b5_1=0}c(L4).m=function(){return this.b5_1!==this.c5_1.length};c(L4).o=function(){var e;if(this.b5_1!==this.c5_1.length){var n=this.b5_1;this.b5_1=n+1|0,e=this.c5_1[n]}else throw l3(""+this.b5_1);return e};function o8(){return H0(),AI}var AI;function CI(){return H0(),bI}var bI,KB;function h8(){return H0(),gI}var gI;function TI(){return H0(),RI}var RI;function XB(){return H0(),NI}var NI;function YB(e){return H0(),(e|0)===e?UI(e):(CI()[0]=e,kn(h8()[XB()],31)+h8()[TI()]|0)}var qx;function H0(){qx||(qx=!0,AI=new ArrayBuffer(8),bI=new Float64Array(o8()),KB=new Float32Array(o8()),gI=new Int32Array(o8()),CI()[0]=-1,RI=h8()[0]!==0?1:0,NI=1-TI()|0)}function L0(e,n){var i;if(xI(e)){var d=e.charCodeAt(n),r;Hx();var t=0;if(d<Jx(t))r=!0;else{Hx();var s=65535;r=d>Jx(s)}if(r)throw ed("Invalid Char code: "+d);i=RL(d)}else i=e.b(n);return i}function xI(e){return typeof e=="string"}function ku(e){var n;return xI(e)?n=e.length:n=e.a(),n}function QB(e){return UB(e,", ","[","]",U,U,jB)}function jB(e){return id(e)}function eL(e,n){var i;switch(typeof e){case"number":var d;typeof n=="number"?d=Dx(e,n):n instanceof Ve?d=Dx(e,n.f5()):d=$x(e,n),i=d;break;case"string":case"boolean":i=$x(e,n);break;default:i=nL(e,n);break}return i}function Dx(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 $x(e,n){return e<n?-1:e>n?1:0}function nL(e,n){return e.a5(n)}function iL(e){return v8(e)}function v8(e){if(!("kotlinHashCodeValue$"in e)){var n=II(),i=new Object;i.value=n,i.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",i)}return e.kotlinHashCodeValue$}function II(){return Math.random()*4294967296|0}function id(e){var n;return e==null?n="null":xL(e)?n="[...]":typeof e.toString!="function"?n=tL(e):n=e.toString(),n}function tL(e){return Object.prototype.toString.call(e)}function Zn(e){if(e==null)return 0;var n=typeof e,i;switch(n){case"object":i=typeof e.hashCode=="function"?e.hashCode():v8(e);break;case"function":i=v8(e);break;case"number":i=YB(e);break;case"boolean":i=rL(e);break;case"string":i=L8(String(e));break;case"bigint":i=dL(e);break;case"symbol":i=oL(e);break;default:i=function(){throw new Error("Unexpected typeof `"+n+"`")}();break}return i}function rL(e){return e?1231:1237}function L8(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=kn(n,31)+s|0}while(t!==r);return n}function dL(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=kn(31,r)+s|0,d=d>>n}return kn(r,t)}function oL(e){var n=aL(e)?uL():lL(),i=n.get(e);if(i!==U)return i;var d=II();return n.set(e,d),d}function aL(e){return Symbol.keyFor(e)!=U}function uL(){return a8===U&&(a8=new Map),a8}function lL(){return u8===U&&(u8=new WeakMap),u8}var a8,u8;function Ze(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 Je(e,n){Error.captureStackTrace!=null?Error.captureStackTrace(e,n):e.stack=new Error().stack}function c(e){return e.prototype}function Xn(e,n,i,d){return Object.defineProperty(e,n,{configurable:!0,get:i,set:d})}function Ge(e){return Object.create(e)}function EI(e,n,i){Error.call(e),sL(e,n,i)}function sL(e,n,i){var d=VI(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 q0(e){var n;return e==null?fL():n=e,n}function fL(){throw J8()}function rn(){throw H8()}function a3(e){throw jI("lateinit property "+e+" has not been initialized")}function F8(e){throw ed(e)}function cL(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 pL(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 OI(){m8=this,this.g5_1=new Ve(0,-2147483648),this.h5_1=new Ve(-1,2147483647),this.i5_1=8,this.j5_1=64}var m8;function hL(){return m8==null&&new OI,m8}function Ve(e,n){hL(),g8.call(this),this.d5_1=e,this.e5_1=n}c(Ve).k5=function(e){return F4(this,e)};c(Ve).a5=function(e){return this.k5(e instanceof Ve?e:rn())};c(Ve).l5=function(e){return I4(this,e)};c(Ve).m5=function(e){return mL(this,e)};c(Ve).n5=function(){return this.o5().l5(new Ve(1,0))};c(Ve).o5=function(){return new Ve(~this.d5_1,~this.e5_1)};c(Ve).p5=function(){return this.d5_1};c(Ve).f5=function(){return jc(this)};c(Ve).valueOf=function(){return this.f5()};c(Ve).equals=function(e){var n;return e instanceof Ve?n=Yr(this,e):n=!1,n};c(Ve).hashCode=function(){return SL(this)};c(Ve).toString=function(){return k8(this,10)};function Bo(){return dn(),PI}var PI;function T4(){return dn(),MI}var MI;function Wx(){return dn(),_I}var _I;function vL(){return dn(),BI}var BI;function Md(){return dn(),LI}var LI;function Gx(){return dn(),FI}var FI;function F4(e,n){if(dn(),Yr(e,n))return 0;var i=Cr(e),d=Cr(n);return i&&!d?-1:!i&&d?1:Cr(Qc(e,n))?-1:1}function I4(e,n){dn();var i=e.e5_1>>>16|0,d=e.e5_1&65535,r=e.d5_1>>>16|0,t=e.d5_1&65535,s=n.e5_1>>>16|0,f=n.e5_1&65535,p=n.d5_1>>>16|0,v=n.d5_1&65535,y=0,g=0,b=0,P=0;return P=P+(t+v|0)|0,b=b+(P>>>16|0)|0,P=P&65535,b=b+(r+p|0)|0,g=g+(b>>>16|0)|0,b=b&65535,g=g+(d+f|0)|0,y=y+(g>>>16|0)|0,g=g&65535,y=y+(i+s|0)|0,y=y&65535,new Ve(b<<16|P,y<<16|g)}function Qc(e,n){return dn(),I4(e,n.n5())}function yu(e,n){if(dn(),bl(e))return Bo();if(bl(n))return Bo();if(Yr(e,Md()))return zx(n)?Md():Bo();if(Yr(n,Md()))return zx(e)?Md():Bo();if(Cr(e)){var i;return Cr(n)?i=yu(At(e),At(n)):i=At(yu(At(e),n)),i}else if(Cr(n))return At(yu(e,At(n)));if(Kx(e,Gx())&&Kx(n,Gx()))return e3(jc(e)*jc(n));var d=e.e5_1>>>16|0,r=e.e5_1&65535,t=e.d5_1>>>16|0,s=e.d5_1&65535,f=n.e5_1>>>16|0,p=n.e5_1&65535,v=n.d5_1>>>16|0,y=n.d5_1&65535,g=0,b=0,P=0,X=0;return X=X+kn(s,y)|0,P=P+(X>>>16|0)|0,X=X&65535,P=P+kn(t,y)|0,b=b+(P>>>16|0)|0,P=P&65535,P=P+kn(s,v)|0,b=b+(P>>>16|0)|0,P=P&65535,b=b+kn(r,y)|0,g=g+(b>>>16|0)|0,b=b&65535,b=b+kn(t,v)|0,g=g+(b>>>16|0)|0,b=b&65535,b=b+kn(s,p)|0,g=g+(b>>>16|0)|0,b=b&65535,g=g+(((kn(d,y)+kn(r,v)|0)+kn(t,p)|0)+kn(s,f)|0)|0,g=g&65535,new Ve(P<<16|X,g<<16|b)}function mL(e,n){if(dn(),bl(n))throw Z8("division by zero");if(bl(e))return Bo();if(Yr(e,Md())){if(Yr(n,T4())||Yr(n,Wx()))return Md();if(Yr(n,Md()))return T4();var i=yL(e,1),d=kL(i.m5(n),1);if(Yr(d,Bo()))return Cr(n)?T4():Wx();var r=Qc(e,yu(n,d));return I4(d,r.m5(n))}else if(Yr(n,Md()))return Bo();if(Cr(e)){var t;return Cr(n)?t=At(e).m5(At(n)):t=At(At(e).m5(n)),t}else if(Cr(n))return At(e.m5(At(n)));for(var s=Bo(),f=e;AL(f,n);){for(var p=jc(f)/jc(n),v=Math.max(1,Math.floor(p)),y=Math.ceil(Math.log(v)/Math.LN2),g=y<=48?1:Math.pow(2,y-48),b=e3(v),P=yu(b,n);Cr(P)||wL(P,f);)v=v-g,b=e3(v),P=yu(b,n);bl(b)&&(b=T4()),s=I4(s,b),f=Qc(f,P)}return s}function kL(e,n){dn();var i=n&63;return i===0?e:i<32?new Ve(e.d5_1<<i,e.e5_1<<i|(e.d5_1>>>(32-i|0)|0)):new Ve(0,e.d5_1<<(i-32|0))}function yL(e,n){dn();var i=n&63;return i===0?e:i<32?new Ve(e.d5_1>>>i|0|e.e5_1<<(32-i|0),e.e5_1>>i):new Ve(e.e5_1>>(i-32|0),e.e5_1>=0?0:-1)}function jc(e){return dn(),e.e5_1*4294967296+CL(e)}function Yr(e,n){return dn(),e.e5_1===n.e5_1?e.d5_1===n.d5_1:!1}function SL(e){return dn(),e.d5_1^e.e5_1}function k8(e,n){if(dn(),n<2||36<n)throw Z8("radix out of range: "+n);if(bl(e))return"0";if(Cr(e))if(Yr(e,Md())){var i=Yc(n),d=e.m5(i),r=Qc(yu(d,i),e).p5(),t=k8(d,n);return t+r.toString(n)}else return"-"+k8(At(e),n);for(var s=n===2?31:n<=10?9:n<=21?7:n<=35?6:5,f=e3(Math.pow(n,s)),p=e,v="";;){var y=p.m5(f),g=Qc(p,yu(y,f)).p5(),b=g.toString(n);if(p=y,bl(p))return b+v;for(;b.length<s;)b="0"+b;v=b+v}}function Yc(e){return dn(),new Ve(e,e<0?-1:0)}function Cr(e){return dn(),e.e5_1<0}function bl(e){return dn(),e.e5_1===0?e.d5_1===0:!1}function zx(e){return dn(),(e.d5_1&1)===1}function At(e){return dn(),e.n5()}function Kx(e,n){return dn(),F4(e,n)<0}function e3(e){if(dn(),dB(e))return Bo();if(e<=-9223372036854776e3)return Md();if(e+1>=9223372036854776e3)return vL();if(e<0)return At(e3(-e));var n=4294967296,i=e%n|0,d=e/n|0;return new Ve(i,d)}function wL(e,n){return dn(),F4(e,n)>0}function AL(e,n){return dn(),F4(e,n)>=0}function CL(e){return dn(),e.d5_1>=0?e.d5_1:4294967296+e.d5_1}var Xx;function dn(){Xx||(Xx=!0,PI=Yc(0),MI=Yc(1),_I=Yc(-1),BI=new Ve(-1,2147483647),LI=new Ve(0,-2147483648),FI=Yc(16777216))}function te(e,n,i,d,r){return U8("class",e,n,i,d,r,null)}function U8(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 V(e,n,i,d,r,t,s,f,p){d!=null&&(e.prototype=Object.create(d.prototype),e.prototype.constructor=e);var v=i(n,t,s,f,p??[]);if(e.$metadata$=v,r!=null){var y=v.iid!=null?e:e.prototype;y.$imask$=DB(r)}}function Jo(e,n,i,d,r){return U8("interface",e,n,i,d,r,bL())}function bL(){return Xc===U&&(Xc=0),Xc=Xc+1|0,Xc}var Xc;function di(e,n,i,d,r){return U8("object",e,n,i,d,r,null)}function D0(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&&F0(s)?i[t]=s:i[t]=[].slice.call(s)}while(t!==r);return[].concat.apply([],i)}function UI(e){var n;return e instanceof Ve?n=e.p5():n=gL(e),n}function gL(e){var n;return e>2147483647?n=2147483647:e<-2147483648?n=-2147483648:n=e|0,n}function TL(e){return e<<16>>16}function RL(e){var n=UI(e),i=TL(n);return HB(i)}function NL(e,n){return new Su(e,n)}function xL(e){return ZI(e)?!0:f8(e)}function ZI(e){return Array.isArray(e)}function On(e,n){return IL(e,n.$metadata$.iid)}function IL(e,n){var i=e.$imask$,d;if(i==null)return!1;d=i;var r=d;return GB(r,n)}function F0(e){var n;return ZI(e)?n=!e.$type$:n=!1,n}function EL(e){return typeof e=="string"?!0:On(e,b8)}function VI(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(Yx(e,"message")&&(r=r|1),Yx(e,"cause")&&(r=r|2),r!==3){var t=OL(e);t!=Error.prototype&&(r=r|VI(t))}return i!=null&&(i.errorInfo=r),r}function Yx(e,n){return e.hasOwnProperty(n)}function OL(e){return Object.getPrototypeOf(e)}var U;function PL(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 l8(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 JI(e){return new Kn(e)}function ML(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw ed(id(i))}return cL(e,new Int32Array(n))}function _L(e,n){if(!(n>=0)){var i="Invalid new array size: "+n+".";throw ed(id(i))}return pL(e,n,null)}function HI(e){return EI(e),Ho.call(e),e}function qI(){var e=HI(Ge(c(Ho)));return Je(e,qI),e}function DI(e,n){return EI(n,e),Ho.call(n),n}function Z8(e){var n=DI(e,Ge(c(Ho)));return Je(n,Z8),n}function Ho(){Je(this,Ho)}function BL(e){return td(e),$0.call(e),e}function $I(){var e=BL(Ge(c($0)));return Je(e,$I),e}function LL(e,n){return Tl(e,n),$0.call(n),n}function ed(e){var n=LL(e,Ge(c($0)));return Je(n,ed),n}function $0(){Je(this,$0)}function FL(e){return td(e),G0.call(e),e}function WI(){var e=FL(Ge(c(G0)));return Je(e,WI),e}function UL(e,n){return Tl(e,n),G0.call(n),n}function W0(e){var n=UL(e,Ge(c(G0)));return Je(n,W0),n}function G0(){Je(this,G0)}function ZL(e){return td(e),z0.call(e),e}function GI(){var e=ZL(Ge(c(z0)));return Je(e,GI),e}function VL(e,n){return Tl(e,n),z0.call(n),n}function u3(e){var n=VL(e,Ge(c(z0)));return Je(n,u3),n}function z0(){Je(this,z0)}function JL(e){return td(e),U4.call(e),e}function K0(){var e=JL(Ge(c(U4)));return Je(e,K0),e}function U4(){Je(this,U4)}function td(e){return HI(e),qi.call(e),e}function zI(){var e=td(Ge(c(qi)));return Je(e,zI),e}function Tl(e,n){return DI(e,n),qi.call(n),n}function KI(e){var n=Tl(e,Ge(c(qi)));return Je(n,KI),n}function qi(){Je(this,qi)}function HL(e){return td(e),X0.call(e),e}function qo(){var e=HL(Ge(c(X0)));return Je(e,qo),e}function qL(e,n){return Tl(e,n),X0.call(n),n}function l3(e){var n=qL(e,Ge(c(X0)));return Je(n,l3),n}function X0(){Je(this,X0)}function DL(e){return td(e),Z4.call(e),e}function V8(){var e=DL(Ge(c(Z4)));return Je(e,V8),e}function Z4(){Je(this,Z4)}function $L(e){return td(e),Y0.call(e),e}function XI(){var e=$L(Ge(c(Y0)));return Je(e,XI),e}function WL(e,n){return Tl(e,n),Y0.call(n),n}function YI(e){var n=WL(e,Ge(c(Y0)));return Je(n,YI),n}function Y0(){Je(this,Y0)}function GL(e){return td(e),V4.call(e),e}function J8(){var e=GL(Ge(c(V4)));return Je(e,J8),e}function V4(){Je(this,V4)}function zL(e){return td(e),J4.call(e),e}function H8(){var e=zL(Ge(c(J4)));return Je(e,H8),e}function J4(){Je(this,J4)}function KL(e){return td(e),Q0.call(e),e}function QI(){var e=KL(Ge(c(Q0)));return Je(e,QI),e}function XL(e,n){return Tl(e,n),Q0.call(n),n}function jI(e){var n=XL(e,Ge(c(Q0)));return Je(n,jI),n}function Q0(){Je(this,Q0)}function YL(e){return function(n){return n===e?"(this Collection)":o3(n)}}function Zo(){}c(Zo).r=function(e){var n;e:{var i;if(On(this,gi)?i=this.t():i=!1,i){n=!1;break e}for(var d=this.l();d.m();){var r=d.o();if(Ze(r,e)){n=!0;break e}}n=!1}return n};c(Zo).s=function(e){var n;e:{var i;if(On(e,gi)?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};c(Zo).t=function(){return this.q()===0};c(Zo).toString=function(){return vI(this,", ","[","]",U,U,YL(this))};c(Zo).toArray=function(){return nI(this)};function Au(){this.g_1=2147483639}c(Au).y1=function(e,n){if(e<0||e>=n)throw W0("index: "+e+", size: "+n)};c(Au).z1=function(e,n){if(e<0||e>n)throw W0("index: "+e+", size: "+n)};c(Au).h=function(e,n,i){if(e<0||n>i)throw W0("fromIndex: "+e+", toIndex: "+n+", size: "+i);if(e>n)throw ed("fromIndex: "+e+" > toIndex: "+n)};c(Au).b3=function(e,n){var i=e+(e>>1)|0;return(i-n|0)<0&&(i=n),(i-2147483639|0)>0&&(i=n>2147483639?R8.MAX_VALUE:2147483639),i};c(Au).d1=function(e){for(var n=1,i=e.l();i.m();){var d=i.o(),r=kn(31,n),t=d==null?null:Zn(d);n=r+(t??0)|0}return n};c(Au).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(!Ze(r,t))return!1}return!0};var tt;function Qx(e,n){return n===e?"(this Map)":o3(n)}function eE(e,n){var i;e:{for(var d=e.k1().l();d.m();){var r=d.o();if(Ze(r.l1(),n)){i=r;break e}}i=null}return i}function nE(){}var QL;function jL(e){return function(n){return e.s5(n)}}function gr(){this.n1_1=null,this.o1_1=null}c(gr).p1=function(e){return eE(this,e)!=null};c(gr).q1=function(e){if(!(e!=null&&On(e,Fo)))return!1;var n=e.l1(),i=e.m1(),d=(On(this,Uo)?this:rn()).r1(n);if(!Ze(i,d))return!1;var r;return d==null?r=!(On(this,Uo)?this:rn()).p1(n):r=!1,!r};c(gr).equals=function(e){if(e===this)return!0;if(!(e!=null&&On(e,Uo))||this.q()!==e.q())return!1;var n;e:{var i=e.k1(),d;if(On(i,gi)?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};c(gr).r1=function(e){var n=eE(this,e);return n==null?null:n.m1()};c(gr).hashCode=function(){return Zn(this.k1())};c(gr).q=function(){return this.k1().q()};c(gr).toString=function(){var e=this.k1();return vI(e,", ","{","}",U,U,jL(this))};c(gr).s5=function(e){return Qx(this,e.l1())+"="+Qx(this,e.m1())};function H4(){}c(H4).t1=function(e){for(var n=0,i=e.l();i.m();){var d=i.o(),r=n,t=d==null?null:Zn(d);n=r+(t??0)|0}return n};c(H4).s1=function(e,n){return e.q()!==n.q()?!1:e.s(n)};var q8;function eF(e){return br.call(e),Pn.call(e),e.v5_1=D8().x5_1,e}function s3(){return eF(Ge(c(Pn)))}function f3(e,n){if(n<0)throw u3("Deque is too big.");if(n<=e.v5_1.length)return Ie;if(e.v5_1===D8().x5_1){var i=e,d=R4(n,10);return i.v5_1=J0(Array(d),null),Ie}var r=tt.b3(e.v5_1.length,n);nF(e,r)}function nF(e,n){var i=J0(Array(n),null),d=e.v5_1,r=e.u5_1,t=e.v5_1.length;Ue(d,i,0,r,t);var s=e.v5_1,f=e.v5_1.length-e.u5_1|0,p=e.u5_1;Ue(s,i,f,0,p),e.u5_1=0,e.v5_1=i}function jt(e,n){return n>=e.v5_1.length?n-e.v5_1.length|0:n}function iF(e,n){return n<0?n+e.v5_1.length|0:n}function iE(e,n){return n===pI(e.v5_1)?0:n+1|0}function y8(e,n){return n===0?pI(e.v5_1):n-1|0}function S8(e,n,i){var d=i.l(),r=n,t=e.v5_1.length;if(r<t)e:do{var s=r;if(r=r+1|0,!d.m())break e;e.v5_1[s]=d.o()}while(r<t);var f=0,p=e.u5_1;if(f<p)e:do{var v=f;if(f=f+1|0,!d.m())break e;e.v5_1[v]=d.o()}while(f<p);e.w5_1=e.w5_1+i.q()|0}function tE(){w8=this;var e=this;e.x5_1=[],this.y5_1=10}var w8;function D8(){return w8==null&&new tE,w8}c(Pn).q=function(){return this.w5_1};c(Pn).t=function(){return this.w5_1===0};c(Pn).z5=function(e){f3(this,this.w5_1+1|0),this.u5_1=y8(this,this.u5_1),this.v5_1[this.u5_1]=e,this.w5_1=this.w5_1+1|0};c(Pn).a6=function(e){f3(this,this.w5_1+1|0);var n=this.v5_1,i=this.w5_1;n[jt(this,this.u5_1+i|0)]=e,this.w5_1=this.w5_1+1|0};c(Pn).b6=function(){if(this.t())throw l3("ArrayDeque is empty.");var e=this.u5_1,n=this.v5_1[e],i=n==null||n!=null?n:rn();return this.v5_1[this.u5_1]=null,this.u5_1=iE(this,this.u5_1),this.w5_1=this.w5_1-1|0,i};c(Pn).c6=function(){if(this.t())throw l3("ArrayDeque is empty.");var e=E4(this),n=jt(this,this.u5_1+e|0),i=this.v5_1[n],d=i==null||i!=null?i:rn();return this.v5_1[n]=null,this.w5_1=this.w5_1-1|0,d};c(Pn).i=function(e){return this.a6(e),!0};c(Pn).a1=function(e,n){if(tt.z1(e,this.w5_1),e===this.w5_1)return this.a6(n),Ie;if(e===0)return this.z5(n),Ie;f3(this,this.w5_1+1|0);var i=jt(this,this.u5_1+e|0);if(e<(this.w5_1+1|0)>>1){var d=y8(this,i),r=y8(this,this.u5_1);if(d>=this.u5_1){this.v5_1[r]=this.v5_1[this.u5_1];var t=this.v5_1,s=this.v5_1,f=this.u5_1,p=this.u5_1+1|0,v=d+1|0;Ue(t,s,f,p,v)}else{var y=this.v5_1,g=this.v5_1,b=this.u5_1-1|0,P=this.u5_1,X=this.v5_1.length;Ue(y,g,b,P,X),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var he=this.v5_1,Me=this.v5_1,Hn=d+1|0;Ue(he,Me,0,1,Hn)}this.v5_1[d]=n,this.u5_1=r}else{var qn=this.w5_1,Gi=jt(this,this.u5_1+qn|0);if(i<Gi){var gt=this.v5_1,Zd=this.v5_1,ud=i+1|0;Ue(gt,Zd,ud,i,Gi)}else{var ld=this.v5_1,Or=this.v5_1;Ue(ld,Or,1,0,Gi),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var Vd=this.v5_1,Jd=this.v5_1,sd=i+1|0,Pu=this.v5_1.length-1|0;Ue(Vd,Jd,sd,i,Pu)}this.v5_1[i]=n}this.w5_1=this.w5_1+1|0};c(Pn).p=function(e){if(e.t())return!1;f3(this,this.w5_1+e.q()|0);var n=this.w5_1,i=jt(this,this.u5_1+n|0);return S8(this,i,e),!0};c(Pn).d6=function(e,n){if(tt.z1(e,this.w5_1),n.t())return!1;if(e===this.w5_1)return this.p(n);f3(this,this.w5_1+n.q()|0);var i=this.w5_1,d=jt(this,this.u5_1+i|0),r=jt(this,this.u5_1+e|0),t=n.q();if(e<(this.w5_1+1|0)>>1){var s=this.u5_1-t|0;if(r>=this.u5_1)if(s>=0){var f=this.v5_1,p=this.v5_1,v=s,y=this.u5_1;Ue(f,p,v,y,r)}else{s=s+this.v5_1.length|0;var g=r-this.u5_1|0,b=this.v5_1.length-s|0;if(b>=g){var P=this.v5_1,X=this.v5_1,he=s,Me=this.u5_1;Ue(P,X,he,Me,r)}else{var Hn=this.v5_1,qn=this.v5_1,Gi=s,gt=this.u5_1,Zd=this.u5_1+b|0;Ue(Hn,qn,Gi,gt,Zd);var ud=this.v5_1,ld=this.v5_1,Or=this.u5_1+b|0;Ue(ud,ld,0,Or,r)}}else{var Vd=this.v5_1,Jd=this.v5_1,sd=s,Pu=this.u5_1,Fl=this.v5_1.length;if(Ue(Vd,Jd,sd,Pu,Fl),t>=r){var Ul=this.v5_1,Zl=this.v5_1,mO=this.v5_1.length-t|0;Ue(Ul,Zl,mO,0,r)}else{var kO=this.v5_1,yO=this.v5_1,SO=this.v5_1.length-t|0;Ue(kO,yO,SO,0,t);var wO=this.v5_1,AO=this.v5_1;Ue(wO,AO,0,t,r)}}this.u5_1=s,S8(this,iF(this,r-t|0),n)}else{var Mu=r+t|0;if(r<d)if((d+t|0)<=this.v5_1.length){var CO=this.v5_1,bO=this.v5_1;Ue(CO,bO,Mu,r,d)}else if(Mu>=this.v5_1.length){var gO=this.v5_1,TO=this.v5_1,RO=Mu-this.v5_1.length|0;Ue(gO,TO,RO,r,d)}else{var Lh=(d+t|0)-this.v5_1.length|0,NO=this.v5_1,xO=this.v5_1,IO=d-Lh|0;Ue(NO,xO,0,IO,d);var EO=this.v5_1,OO=this.v5_1,PO=d-Lh|0;Ue(EO,OO,Mu,r,PO)}else{var MO=this.v5_1,_O=this.v5_1;if(Ue(MO,_O,t,0,d),Mu>=this.v5_1.length){var BO=this.v5_1,LO=this.v5_1,FO=Mu-this.v5_1.length|0,UO=this.v5_1.length;Ue(BO,LO,FO,r,UO)}else{var ZO=this.v5_1,VO=this.v5_1,JO=this.v5_1.length-t|0,HO=this.v5_1.length;Ue(ZO,VO,0,JO,HO);var qO=this.v5_1,DO=this.v5_1,$O=this.v5_1.length-t|0;Ue(qO,DO,Mu,r,$O)}}S8(this,r,n)}return!0};c(Pn).x=function(e){tt.y1(e,this.w5_1);var n=jt(this,this.u5_1+e|0),i=this.v5_1[n];return i==null||i!=null?i:rn()};c(Pn).r=function(e){return this.b1(e)!==-1};c(Pn).b1=function(e){var n=this.w5_1,i=jt(this,this.u5_1+n|0);if(this.u5_1<i){var d=this.u5_1;if(d<i)do{var r=d;if(d=d+1|0,Ze(e,this.v5_1[r]))return r-this.u5_1|0}while(d<i)}else if(this.u5_1>=i){var t=this.u5_1,s=this.v5_1.length;if(t<s)do{var f=t;if(t=t+1|0,Ze(e,this.v5_1[f]))return f-this.u5_1|0}while(t<s);var p=0;if(p<i)do{var v=p;if(p=p+1|0,Ze(e,this.v5_1[v]))return(v+this.v5_1.length|0)-this.u5_1|0}while(p<i)}return-1};c(Pn).j=function(e){var n=this.b1(e);return n===-1?!1:(this.z(n),!0)};c(Pn).z=function(e){if(tt.y1(e,this.w5_1),e===E4(this))return this.c6();if(e===0)return this.b6();var n=jt(this,this.u5_1+e|0),i=this.v5_1[n],d=i==null||i!=null?i:rn();if(e<this.w5_1>>1){if(n>=this.u5_1){var r=this.v5_1,t=this.v5_1,s=this.u5_1+1|0,f=this.u5_1;Ue(r,t,s,f,n)}else{var p=this.v5_1,v=this.v5_1;Ue(p,v,1,0,n),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var y=this.v5_1,g=this.v5_1,b=this.u5_1+1|0,P=this.u5_1,X=this.v5_1.length-1|0;Ue(y,g,b,P,X)}this.v5_1[this.u5_1]=null,this.u5_1=iE(this,this.u5_1)}else{var he=E4(this),Me=jt(this,this.u5_1+he|0);if(n<=Me){var Hn=this.v5_1,qn=this.v5_1,Gi=n+1|0,gt=Me+1|0;Ue(Hn,qn,n,Gi,gt)}else{var Zd=this.v5_1,ud=this.v5_1,ld=n+1|0,Or=this.v5_1.length;Ue(Zd,ud,n,ld,Or),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var Vd=this.v5_1,Jd=this.v5_1,sd=Me+1|0;Ue(Vd,Jd,0,1,sd)}this.v5_1[Me]=null}return this.w5_1=this.w5_1-1|0,d};c(Pn).e6=function(){var e=this.w5_1,n=jt(this,this.u5_1+e|0);this.u5_1<n?l8(this.v5_1,null,this.u5_1,n):this.t()||(l8(this.v5_1,null,this.u5_1,this.v5_1.length),l8(this.v5_1,null,0,n)),this.u5_1=0,this.w5_1=0};c(Pn).f6=function(e){var n=e.length>=this.w5_1?e:uB(e,this.w5_1),i=F0(n)?n:rn(),d=this.w5_1,r=jt(this,this.u5_1+d|0);if(this.u5_1<r){var t=this.v5_1,s=this.u5_1;Ue(t,i,0,s,r)}else if(!this.t()){var f=this.v5_1,p=this.u5_1,v=this.v5_1.length;Ue(f,i,0,p,v);var y=this.v5_1,g=this.v5_1.length-this.u5_1|0;Ue(y,i,g,0,r)}var b=aB(this.w5_1,i);return F0(b)?b:rn()};c(Pn).a2=function(){var e=this.w5_1,n=J0(Array(e),null);return this.f6(n)};c(Pn).toArray=function(){return this.a2()};function Pn(){D8(),this.u5_1=0,this.w5_1=0}function tF(e){if(e.t())return[];for(var n=e.q(),i=J0(Array(n),null),d=e.l(),r=0;d.m();){var t=r;r=t+1|0,i[t]=d.o()}return i}function Rr(){return rF()}function rE(e){return e.length>0?JI(e):Rr()}function E4(e){return e.q()-1|0}function rd(){A8=this,this.g6_1=new Ve(-1478467534,-1720727600)}c(rd).equals=function(e){var n;return e!=null&&On(e,V0)?n=e.t():n=!1,n};c(rd).hashCode=function(){return 1};c(rd).toString=function(){return"[]"};c(rd).q=function(){return 0};c(rd).t=function(){return!0};c(rd).h6=function(e){return e.t()};c(rd).s=function(e){return this.h6(e)};c(rd).x=function(e){throw W0("Empty list doesn't contain element at index "+e+".")};c(rd).l=function(){return dE};var A8;function rF(){return A8==null&&new rd,A8}function q4(){}c(q4).m=function(){return!1};c(q4).o=function(){throw qo()};var dE;function dF(e){return new Do(e,!1)}function oF(e){return e.length===0?rt():N8(new Do(e,!0))}function Do(e,n){this.i6_1=e,this.j6_1=n}c(Do).q=function(){return this.i6_1.length};c(Do).t=function(){return this.i6_1.length===0};c(Do).k6=function(e){return FB(this.i6_1,e)};c(Do).l6=function(e){var n;e:{var i;if(On(e,gi)?i=e.t():i=!1,i){n=!0;break e}for(var d=e.l();d.m();){var r=d.o();if(!this.k6(r)){n=!1;break e}}n=!0}return n};c(Do).s=function(e){return this.l6(e)};c(Do).l=function(){return zB(this.i6_1)};function aF(){throw YI("Index overflow has happened.")}function $8(e,n){return e.p(JI(n))}function uF(e,n){if(On(n,gi))return e.p(n);for(var i=!1,d=n.l();d.m();){var r=d.o();e.i(r)&&(i=!0)}return i}function D4(){}c(D4).o=function(){return this.m6()};function lF(e,n,i){var d;if(i>0)d=e>=n?n:n-jx(n,e,i)|0;else if(i<0)d=e<=n?n:n+jx(e,n,-i|0)|0;else throw ed("Step is zero.");return d}function jx(e,n,i){return s8(s8(e,i)-s8(n,i)|0,i)}function s8(e,n){var i=e%n|0;return i>=0?i:i+n|0}function oE(){C8=this,this.n6_1=new Su(1,0)}var C8;function sF(){return C8==null&&new oE,C8}function Su(e,n){sF(),_d.call(this,e,n,1)}c(Su).t=function(){return this.r6_1>this.s6_1};c(Su).equals=function(e){var n;return e instanceof Su?n=this.t()&&e.t()?!0:this.r6_1===e.r6_1?this.s6_1===e.s6_1:!1:n=!1,n};c(Su).hashCode=function(){return this.t()?-1:kn(31,this.r6_1)+this.s6_1|0};c(Su).toString=function(){return""+this.r6_1+".."+this.s6_1};function $4(e,n,i){D4.call(this),this.u6_1=i,this.v6_1=n,this.w6_1=this.u6_1>0?e<=n:e>=n,this.x6_1=this.w6_1?e:this.v6_1}c($4).m=function(){return this.w6_1};c($4).m6=function(){var e=this.x6_1;if(e===this.v6_1){if(!this.w6_1)throw qo();this.w6_1=!1}else this.x6_1=this.x6_1+this.u6_1|0;return e};function W8(){}c(W8).k4=function(e,n,i){return new _d(e,n,i)};var aE;function _d(e,n,i){if(i===0)throw ed("Step must be non-zero.");if(i===R8.MIN_VALUE)throw ed("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.r6_1=e,this.s6_1=lF(e,n,i),this.t6_1=i}c(_d).l=function(){return new $4(this.r6_1,this.s6_1,this.t6_1)};c(_d).t=function(){return this.t6_1>0?this.r6_1>this.s6_1:this.r6_1<this.s6_1};c(_d).equals=function(e){var n;return e instanceof _d?n=this.t()&&e.t()?!0:this.r6_1===e.r6_1&&this.s6_1===e.s6_1?this.t6_1===e.t6_1:!1:n=!1,n};c(_d).hashCode=function(){return this.t()?-1:kn(31,kn(31,this.r6_1)+this.s6_1|0)+this.t6_1|0};c(_d).toString=function(){return this.t6_1>0?""+this.r6_1+".."+this.s6_1+" step "+this.t6_1:""+this.r6_1+" downTo "+this.s6_1+" step "+(-this.t6_1|0)};function uE(e,n,i){i!=null?e.j4(i(n)):n==null||EL(n)?e.j4(n):n instanceof SI?e.z3(n.y6_1):e.j4(o3(n))}function fF(e,n,i){if(i=i===U?!1:i,e===n)return!0;if(!i)return!1;var d=Vx(e),r=Vx(n),t;if(d===r)t=!0;else{var s=x4(d).toLowerCase(),f=L0(s,0),p=x4(r).toLowerCase();t=f===L0(p,0)}return t}function lE(e){return ku(e)-1|0}function G8(e,n,i){i=i===U?!1:i;var d;return typeof n=="string"?d=cF(e,n,U,i)>=0:d=sE(e,n,0,ku(e),i)>=0,d}function cF(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=sE(e,n,i,ku(e),d):r=e.indexOf(n,i),r}function sE(e,n,i,d,r,t){t=t===U?!1:t;var s=t?JB(N4(i,lE(e)),R4(d,0)):NL(R4(i,0),N4(d,ku(e))),f;if(typeof e=="string"?f=typeof n=="string":f=!1,f){var p=s.r6_1,v=s.s6_1,y=s.t6_1;if(y>0&&p<=v||y<0&&v<=p)do{var g=p;if(p=p+y|0,BB(n,0,e,g,ku(n),r))return g}while(g!==v)}else{var b=s.r6_1,P=s.s6_1,X=s.t6_1;if(X>0&&b<=P||X<0&&P<=b)do{var he=b;if(b=b+X|0,fE(n,0,e,he,ku(n),r))return he}while(he!==P)}return-1}function fE(e,n,i,d,r,t){if(d<0||n<0||n>(ku(e)-r|0)||d>(ku(i)-r|0))return!1;var s=0;if(s<r)do{var f=s;if(s=s+1|0,!fF(L0(e,n+f|0),L0(i,d+f|0),t))return!1}while(s<r);return!0}function bi(e,n){this.z6_1=e,this.a7_1=n}c(bi).toString=function(){return"("+this.z6_1+", "+this.a7_1+")"};c(bi).b7=function(){return this.z6_1};c(bi).c7=function(){return this.a7_1};c(bi).hashCode=function(){var e=this.z6_1==null?0:Zn(this.z6_1);return e=kn(e,31)+(this.a7_1==null?0:Zn(this.a7_1))|0,e};c(bi).equals=function(e){if(this===e)return!0;if(!(e instanceof bi))return!1;var n=e instanceof bi?e:rn();return!(!Ze(this.z6_1,n.z6_1)||!Ze(this.a7_1,n.a7_1))};function cE(e,n){return new bi(e,n)}c(Ii).o2=rB;Ie=new T8;R8=new U0;i3=new sI;qB=new wI;tt=new Au;QL=new nE;q8=new H4;dE=new q4;aE=new W8;var $o=Math.imul;V(X8,"OneAtATimeAssembler",te);V(Y8,"AllAtOnceAssembler",te);V(Di,"SubscribeCallbackParams",te);V(er,"Mode",te,Ct);V(Rl,"Callback",te);V(j8,U,te);V(Ti,"DispatcherImpl",te);V($i,"EmptyOptions",te,U,U,$i);V(Mn,"DispatcherSnapshot",te);V(oi,"EventScope",te,Ct);V(eh,"NoOpUnsubscriber",di);V(j0,"BaseTrace",te);V(m3,"ErrorInfo",te);V(NE,"PerformanceAnalyticsDelegate",Jo);V(p3,"NoOpPerformanceAnalyticsDelegate",te,U,[NE],p3);V(k3,"RuntimeTrace",te,j0);V(gu,"Disabled",di);V(y3,"NiceLogger",te);V(bu,"NoOpLogger",te,U,U,bu);V(nh,"IntervalEventDeduper",te);V(ih,"LocalEventsDeduper",te);V(dt,"TimerDefinition",te);V(j4,"Span",te);V(th,"Tracer",di);V(e6,"JsDispatcherImpl",te,Ti);V(n6,"JsRequestBuilderAdapter",te);V(h3,"JsonStateOperations",te,U,U,h3);function X8(e,n){this.d7_1=e,this.e7_1=n}c(X8).f7=function(e,n){var i;if(e.t())i=Rr();else{for(var d=this.e7_1.list(),r=e.b6();mE(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.d7_1.h7([""+n+" building batch of ",r]),O4(r)}if(!e.t())r=e.b6();else return Rr()}this.d7_1.h7([""+n+" building batch of ",r]),i=O4(r)}return i};function Y8(e,n){this.i7_1=e,this.j7_1=n}c(Y8).f7=function(e,n){var i;if(e.t())i=Rr();else{for(var d=this.j7_1.list(),r=rt(),t=e.l();t.m();){var s=t.o(),f;if(mE(s)){var p;if(d.length===0)p=!1;else{var v;e:{for(var y=0,g=d.length;y<g;){var b=d[y];if(y=y+1|0,b.id===s.hook){v=b;break e}}v=null}p=v!=null}f=p}else f=!0;f&&r.i(s)}var P=r;e.e6(),this.i7_1.h7([""+n+" building batch of ",P]),i=P}return i};function mE(e){var n=e.hook;return(n==null?null:G8(n,"useInterval"))===!0}function Di(e,n,i){this.request=e,this.response=n,this.mode=i}c(Di).k7=function(){return this.request};c(Di).l7=function(){return this.response};c(Di).m7=function(){return this.mode};c(Di).b7=function(){return this.request};c(Di).c7=function(){return this.response};c(Di).n7=function(){return this.mode};c(Di).o7=function(e,n,i){return new Di(e,n,i)};c(Di).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.o7(e,n,i)};c(Di).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};c(Di).hashCode=function(){var e=this.request==null?0:Zn(this.request);return e=$o(e,31)+(this.response==null?0:Zn(this.response))|0,e=$o(e,31)+this.mode.hashCode()|0,e};c(Di).equals=function(e){if(this===e)return!0;if(!(e instanceof Di))return!1;var n=e instanceof Di?e:rn();return!(!Ze(this.request,n.request)||!Ze(this.response,n.response)||!this.mode.equals(n.mode))};var kE,yE,SE;function pF(){return[Bd(),c3(),Ld()]}function hF(e){switch(e){case"SYNC":return Bd();case"ASYNC":return c3();case"SPEC":return Ld();default:G4(),F8("No enum constant value.");break}}var pE;function G4(){if(pE)return Ie;pE=!0,kE=new er("SYNC",0),yE=new er("ASYNC",1),SE=new er("SPEC",2)}function er(e,n){Ct.call(this,e,n)}function Bd(){return G4(),kE}function c3(){return G4(),yE}function Ld(){return G4(),SE}function Rl(e,n){this.r7_1=e,this.s7_1=n}c(Rl).toString=function(){return"Callback(success="+this.r7_1+", failure="+this.s7_1+")"};c(Rl).hashCode=function(){var e=Zn(this.r7_1);return e=$o(e,31)+Zn(this.s7_1)|0,e};c(Rl).equals=function(e){if(this===e)return!0;if(!(e instanceof Rl))return!1;var n=e instanceof Rl?e:rn();return!(!Ze(this.r7_1,n.r7_1)||!Ze(this.s7_1,n.s7_1))};function z8(e){var n=e.b8_1;if(n!=null)return n;a3("assembler")}function Nl(e){var n=e.i8_1;if(n!=null)return n;a3("local")}function v3(e){var n=e.j8_1;if(n!=null)return n;a3("remote")}function z4(e){var n=e.k8_1;if(n!=null)return n;a3("timers")}function wE(e){AE(e),e.p8_1=!0,e.y7_1.h7(["recalculateSpeculativeWork"]);var n=e.c8_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(Cu()))continue e;if(e.e8_1.w5_1>10)break e;e.e8_1.i(r)}e.y7_1.h7(["Speculative queue size: "+e.e8_1.w5_1]),K4(e,e.e8_1)}function Q8(e){e.y7_1.h7(["cancelSpeculation"]),e.p8_1=!1,AE(e)}function AE(e){e.e8_1.e6(),e.m8_1=e.v7_1.clone(e.state),e.n8_1=e.n8_1+1|0}function K8(e,n,i){if(n.t())return Ie;var d=mI(n),r=d.scope.equals(Cu())?!0:IF(d.scope)?!Nl(e).isReady():!1;i.equals(Bd())&&(e.f8_1=!0);var t=e.u7_1.q8(i.equals(Ld())?e.m8_1:e.state,n),s=r?v3(e):Nl(e),f=e.z7_1;e.z7_1=f+1|0;var p=f,v=e.n8_1,y=EE.r8("runtime_trace"),g=wF(e,i,r,y,n,p,v,t),b=new Rl(g,CF(e,i,r,y,p,n));e.g8_1.i1(p,b),e.y7_1.h7(["Signpost: Handling "+W4(e,i,r)+" request"]),K4(e,t),s.handle(e.w7_1,t,b.r7_1,b.s7_1)}function W4(e,n,i){return(i?"remote":"local")+" "+n+" runtime"}function CE(e,n){e.p8_1=e.o8_1,e.f8_1=!1,e.state=e.v7_1.clone(e.l8_1),e.d8_1.e6(),e.c8_1.e6(),Nl(e).reset(),v3(e).reset(),Q8(e),n&&z4(e).clear()}function xl(e,n,i){var d;try{d=i()}catch(s){var r;if(s instanceof Ho){var t=s;e.y7_1.s8([t]),e.x7_1.errorHandler(t),r=n}else throw s;d=r}return d}function K4(e,n){e.x7_1.featureFlags.isVerboseLoggingEnabled&&e.y7_1.h7([n])}function vF(e){return function(){return Nl(e).isReady()}}function mF(e){return function(n){var i,d;e:{for(var r=e.c8_1.l();r.m();){var t=r.o();if(t.hook===n){d=t;break e}}d=null}if(d!=null)i=!0;else{var s;e:{for(var f=e.d8_1.l();f.m();){var p=f.o();if(p.hook===n){s=p;break e}}s=null}i=s!=null}return i}}function kF(e,n,i,d){return function(){e.y7_1.h7(["Signpost: Initializing Dispatcher",n,i]),e.i8_1=n,e.j8_1=i,e.k8_1=d;var r=e,t;return e.x7_1.featureFlags.isUsingEverythingAssembler?t=new Y8(e.y7_1,d):t=new X8(e.y7_1,d),r.b8_1=t,e.t8(),Ie}}function j8(e,n){this.u8_1=e,this.v8_1=n}c(j8).unsubscribe=function(){this.u8_1.h8_1.j(this.v8_1)};function yF(e,n){return function(){var i=typeof e=="function"?e:rn();return n.h8_1.i(i),new j8(n,i)}}function SF(e,n,i,d,r,t,s,f,p){return function(){e.y7_1.h7(["Signpost: Response success for "+W4(e,n,i)+" request"]),K4(e,d),r.z8(),EF(e.x7_1.performanceAnalyticsDelegate,r,i,"",t.q()),e.g8_1.j1(s);var v;if(n.equals(Ld())&&e.n8_1!==f)return e.y7_1.h7(["throwing away stale speculative results"]),Ie;e.y7_1.h7(["Responding to "+W4(e,n,i)+" runtime result subscriptions"]);for(var y=e.h8_1.l();y.m();){var g=y.o();g(new Di(p,d,n))}var b;n.equals(Bd())?(e.state=e.v7_1.merge(e.state,d.state),e.f8_1=!1,b=Ie):n.equals(Ld())&&(e.m8_1=e.v7_1.merge(e.m8_1,d.state),b=Ie),e.a9(B8(d.replay),n);var P;return n.equals(Bd())&&e.o8_1&&(wE(e),P=Ie),e.t8(),Ie}}function wF(e,n,i,d,r,t,s,f){return function(p){return xl(e,Ie,SF(e,n,i,p,d,r,t,s,f)),Ie}}function AF(e,n,i,d,r,t,s){return function(){e.y7_1.h7(["Signpost: Response error for "+W4(e,n,i)+" request",d]),r.z8();var f=e.x7_1.performanceAnalyticsDelegate,p=d.message;OF(f,p??"Request Response Error"+(" with a duration of "+r.b9()+"ms"),i,""),e.g8_1.j1(t);var v;n.equals(Bd())&&(e.f8_1=!1,v=Ie);var y;if(n.equals(Ld()))return Q8(e),e.t8(),Ie;for(var g=s,b=r3(),P=g.l();P.m();){var X=P.o(),he=X.scope.equals(Cu())?!1:X.retry!==!0,Me=b.r1(he),Hn;if(Me==null){var qn=rt();b.i1(he,qn),Hn=qn}else Hn=Me;var Gi=Hn;Gi.i(X)}var gt=b,Zd,ud=gt.r1(!1);if(!(ud==null||ud.t())){var ld=gt.r1(!1),Or=ld??Rr(),Vd=Z0(Or);e.y7_1.h7(D0([["unretryable events",d],Vd])),Zd=e.x7_1.errorHandler(d)}var Jd,sd=gt.r1(!0);if(!(sd==null||sd.t())){var Pu=gt.r1(!0);if(Pu!=null)for(var Fl=Pu.l();Fl.m();){var Ul=Fl.o();Ul.retry=!0,Ul.scope=Cu()}var Zl=gt.r1(!0);e.a9(Zl??Rr(),n),n.equals(Bd())&&e.o8_1&&wE(e),e.t8(),Jd=Ie}return Ie}}function CF(e,n,i,d,r,t){return function(s){return xl(e,Ie,AF(e,n,i,s,d,r,t)),Ie}}function bF(e,n){return function(){e.y7_1.h7(D0([["Signpost: Submitted events"],n]));for(var i=e.a8_1,d=B8(n),r=i.l();r.m();){var t=r.o(),s=d;d=t.c9(s)}for(var f=d,p=rt(),v=rt(),y=f.l();y.m();){var g=y.o();g.async===!0?p.i(g):v.i(g)}var b=new bi(p,v),P=b.b7(),X=b.c7();e.d8_1.p(P),e.c8_1.p(X);var he;return e.f8_1&&e.p8_1&&(e.e8_1.p(X),he=Ie),e.t8(),Ie}}function gF(e){return function(){return CE(e,!0),Ie}}function TF(e,n){return function(){e.state=e.v7_1.clone(n.state),e.d8_1.e6();var i=n.asyncQueue;$8(e.d8_1,F0(i)?i:rn()),e.c8_1.e6();var d=n.syncQueue;return $8(e.c8_1,F0(d)?d:rn()),Q8(e),Nl(e).resume(n.localSnapshot),v3(e).resume(n.remoteSnapshot),z4(e).resumeAll(n.timerSnapshot),Ie}}function Ti(e,n,i,d,r){d=d===U?"RenderPostContent":d,r=r===U?new $i:r,this.t7_1=e,this.u7_1=n,this.v7_1=i,this.w7_1=d,this.x7_1=r,this.y7_1=new y3(this.x7_1.logger),this.z7_1=0;var t=this,s=new ih(vF(this),this.y7_1);t.a8_1=rE([s,new nh(mF(this))]),this.c8_1=s3(),this.d8_1=s3(),this.e8_1=s3(),this.f8_1=!1;var f=this;f.g8_1=r3();var p=this;p.h8_1=rt(),this.l8_1=this.v7_1.clone(this.state),this.m8_1=this.v7_1.clone(this.l8_1),this.n8_1=0,this.o8_1=this.x7_1.featureFlags.isSpeculativeExecutionEnabled,this.p8_1=this.o8_1,this.y7_1.h7(["Signpost: Constructed KMP Dispatcher"])}c(Ti).d9=function(e){this.t7_1=e};c(Ti).e9=function(){return this.t7_1};c(Ti).f9=function(){return this.c8_1};c(Ti).g9=function(){return this.d8_1};c(Ti).h9=function(){return this.e8_1};c(Ti).init=function(e,n,i){xl(this,Ie,kF(this,e,n,i))};c(Ti).subscribe=function(e){var n=RE;return xl(this,n,yF(e,this))};c(Ti).t8=function(){if(this.y7_1.h7(["ticking","syncInFlight "+this.f8_1,"asyncQueue.size "+this.d8_1.w5_1,"syncQueue.size "+this.c8_1.w5_1,"speculativeQueue.size "+this.e8_1.w5_1]),!Nl(this).isReady()&&!v3(this).isReady()&&!(this.c8_1.t()&&this.d8_1.t()))return this.y7_1.i9(["ticking with events and no runtime, deferring..."]),Ie;if(this.f8_1){if(this.p8_1){var n=z8(this).f7(this.e8_1,Ld());K8(this,n,Ld())}}else{var e=z8(this).f7(this.c8_1,Bd());K8(this,e,Bd())}if(!this.d8_1.t()){for(;!this.d8_1.t();){var i=z8(this).f7(this.d8_1,c3());K8(this,i,c3())}this.t8()}};c(Ti).a9=function(e,n){if(e.t()||n.equals(Ld()))return Ie;this.y7_1.h7(["replaying "+e.q()+" events"]),K4(this,e);for(var i=r3(),d=e.l();d.m();){var r=d.o(),t=new bi(r.async===!0,r.retry===!0),s=i.r1(t),f;if(s==null){var p=rt();i.i1(t,p),f=p}else f=s;var v=f;v.i(r)}var y=i,g=y.r1(new bi(!0,!0));this.d8_1.d6(0,g??Rr());var b=y.r1(new bi(!0,!1));this.d8_1.p(b??Rr());var P=y.r1(new bi(!1,!0));this.c8_1.d6(0,P??Rr());var X=y.r1(new bi(!1,!1));this.c8_1.p(X??Rr())};c(Ti).submit=function(e){xl(this,Ie,bF(this,e))};c(Ti).reset=function(){xl(this,Ie,gF(this))};c(Ti).snapshot=function(){var e=this.v7_1.clone(this.state),n=this.c8_1,i=Z0(n),d=this.d8_1,r=Z0(d);return new Mn(e,i,r,Nl(this).snapshot(),v3(this).snapshot(),z4(this).list())};c(Ti).pause=function(){var e=this.snapshot();return z4(this).pauseAll(),CE(this,!1),e};c(Ti).resume=function(e){xl(this,Ie,TF(this,e))};function RF(e){return Ie}function $i(){this.j9_1=new bu;var e=this;e.k9_1=RF,this.l9_1=IE,this.m9_1=new p3}c($i).n9=function(e){this.j9_1=e};c($i).o9=function(){return this.j9_1};c($i).p9=function(e){this.k9_1=e};c($i).q9=function(){return this.k9_1};c($i).r9=function(e){this.l9_1=e};c($i).s9=function(){return this.l9_1};c($i).t9=function(e){this.m9_1=e};c($i).u9=function(){return this.m9_1};function Mn(e,n,i,d,r,t){this.state=e,this.syncQueue=n,this.asyncQueue=i,this.localSnapshot=d,this.remoteSnapshot=r,this.timerSnapshot=t}c(Mn).e9=function(){return this.state};c(Mn).f9=function(){return this.syncQueue};c(Mn).g9=function(){return this.asyncQueue};c(Mn).v9=function(){return this.localSnapshot};c(Mn).w9=function(){return this.remoteSnapshot};c(Mn).x9=function(){return this.timerSnapshot};c(Mn).b7=function(){return this.state};c(Mn).c7=function(){return this.syncQueue};c(Mn).n7=function(){return this.asyncQueue};c(Mn).y9=function(){return this.localSnapshot};c(Mn).z9=function(){return this.remoteSnapshot};c(Mn).aa=function(){return this.timerSnapshot};c(Mn).ba=function(e,n,i,d,r,t){return new Mn(e,n,i,d,r,t)};c(Mn).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.ba(e,n,i,d,r,t)};c(Mn).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+id(this.syncQueue)+", asyncQueue="+id(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};c(Mn).hashCode=function(){var e=this.state==null?0:Zn(this.state);return e=$o(e,31)+Zn(this.syncQueue)|0,e=$o(e,31)+Zn(this.asyncQueue)|0,e=$o(e,31)+(this.localSnapshot==null?0:Zn(this.localSnapshot))|0,e=$o(e,31)+(this.remoteSnapshot==null?0:Zn(this.remoteSnapshot))|0,e=$o(e,31)+(this.timerSnapshot==null?0:Zn(this.timerSnapshot))|0,e};c(Mn).equals=function(e){if(this===e)return!0;if(!(e instanceof Mn))return!1;var n=e instanceof Mn?e:rn();return!(!Ze(this.state,n.state)||!Ze(this.syncQueue,n.syncQueue)||!Ze(this.asyncQueue,n.asyncQueue)||!Ze(this.localSnapshot,n.localSnapshot)||!Ze(this.remoteSnapshot,n.remoteSnapshot)||!Ze(this.timerSnapshot,n.timerSnapshot))};var bE,gE,TE;function NF(){return[Y4(),Q4(),Cu()]}function xF(e){switch(e){case"ALL":return Y4();case"LOCAL":return Q4();case"REMOTE":return Cu();default:X4(),F8("No enum constant value.");break}}var hE;function X4(){if(hE)return Ie;hE=!0,bE=new oi("ALL",0),gE=new oi("LOCAL",1),TE=new oi("REMOTE",2)}function oi(e,n){Ct.call(this,e,n)}function IF(e){return e.equals(Cu())?!0:e.equals(Y4())}function Y4(){return X4(),bE}function Q4(){return X4(),gE}function Cu(){return X4(),TE}function eh(){}c(eh).unsubscribe=function(){};var RE;function j0(e,n,i){this.spanName=e,this.startTimeMs=n,this.endTimeMs=i}c(j0).ea=function(){return this.spanName};c(j0).fa=function(){return this.startTimeMs};c(j0).ga=function(){return this.endTimeMs};function m3(e,n,i){this.message=e,this.origin=n,this.version=i}c(m3).q5=function(){return this.message};c(m3).ha=function(){return this.origin};c(m3).ia=function(){return this.version};function NE(){}function p3(){}c(p3).logRuntimeTrace=function(e){};c(p3).logRuntimeError=function(e){};function EF(e,n,i,d,r){e.logRuntimeTrace(new k3(n.w8_1,n.x8_1,n.y8_1,d,xE(i),r))}function OF(e,n,i,d){e.logRuntimeError(new m3(n,xE(i),d))}function xE(e){return e?"remote":"local"}function k3(e,n,i,d,r,t){j0.call(this,e,n,i),this.intent=d,this.target=r,this.eventCount=t}c(k3).ja=function(){return this.intent};c(k3).ka=function(){return this.target};c(k3).la=function(){return this.eventCount};function gu(){this.ma_1=!1,this.na_1=!1,this.oa_1=!1}c(gu).pa=function(){return this.ma_1};c(gu).qa=function(){return this.na_1};c(gu).ra=function(){return this.oa_1};var IE;function y3(e){this.g7_1=e}c(y3).s8=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.error(n)};c(y3).i9=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.warn(n)};c(y3).h7=function(e){var n=D0([[this.g7_1.tag()],e]);this.g7_1.debug(n)};function bu(){}c(bu).info=function(e){};c(bu).error=function(e){};c(bu).warn=function(e){};c(bu).debug=function(e){};c(bu).tag=function(){return""};function nh(e){this.sa_1=e}c(nh).c9=function(e){for(var n=rt(),i=rt(),d=e.l();d.m();){var r=d.o(),t=r.hook;(t==null?null:G8(t,"useInterval"))===!0?n.i(r):i.i(r)}for(var s=new bi(n,i),f=s.b7(),p=s.c7(),v=I8(),y=rt(),g=f.l();g.m();){var b=g.o(),P=b.hook;v.i(P)&&y.i(b)}for(var X=y,he=rt(),Me=X.l();Me.m();){var Hn=Me.o(),qn=Hn.hook;this.sa_1(qn??"")||he.i(Hn)}var Gi=he;return kI(Gi,p)};function ih(e,n){this.ta_1=e,this.ua_1=n}c(ih).c9=function(e){var n;if(this.ta_1())n=e;else{for(var i=rt(),d=rt(),r=e.l();r.m();){var t=r.o();t.scope.equals(Q4())?d.i(t):i.i(t)}var s=new bi(i,d);if(!s.a7_1.t()){var f=["Dropping "+s.a7_1.q()+" local events",s.a7_1];this.ua_1.h7([f])}n=s.z6_1}return n};function dt(e,n){this.id=e,this.duration=n}c(dt).va=function(){return this.id};c(dt).wa=function(){return this.duration};c(dt).b7=function(){return this.id};c(dt).c7=function(){return this.duration};c(dt).xa=function(e,n){return new dt(e,n)};c(dt).copy=function(e,n,i){return e=e===U?this.id:e,n=n===U?this.duration:n,this.xa(e,n)};c(dt).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};c(dt).hashCode=function(){var e=L8(this.id);return e=$o(e,31)+this.duration|0,e};c(dt).equals=function(e){if(this===e)return!0;if(!(e instanceof dt))return!1;var n=e instanceof dt?e:rn();return!(this.id!==n.id||this.duration!==n.duration)};function j4(e,n){this.w8_1=e,this.x8_1=n,this.y8_1=0}c(j4).z8=function(){this.y8_1=OE()};c(j4).b9=function(){return this.y8_1-this.x8_1};function th(){}c(th).r8=function(e){return new j4(e,OE())};var EE;function e6(e,n,i,d){i=i===U?"RenderPostContent":i,d=d===U?new $i:d,Ti.call(this,e,new n6(n),new h3,i,d),this.vb_1=i,this.wb_1=d}function n6(e){this.xb_1=e}c(n6).yb=function(e,n){var i=Z0(n);return this.xb_1.build(e,i)};c(n6).q8=function(e,n){return this.yb(e!=null&&e!=null?e:rn(),n)};function vE(e){for(var n=Object.entries,i=(n!=null&&typeof n=="function"?n:rn())(e),d=P4(i.length),r=0,t=i.length;r<t;){var s=i[r];r=r+1|0;var f=s[0],p=cE(f!=null&&typeof f=="string"?f:rn(),s[1]);d.i(p)}return d}function h3(){}c(h3).clone=function(e){return JSON.parse(JSON.stringify(e))};c(h3).merge=function(e,n){for(var i={},d=i!=null&&i!=null?i:rn(),r=vE(e).l();r.m();){var t=r.o();d[t.z6_1]=t.a7_1}for(var s=vE(n).l();s.m();){var f=s.o();d[f.z6_1]=f.a7_1}return d};function OE(){return new Date().getTime()}Xn(c(er),"name",c(er).x4);Xn(c(er),"ordinal",c(er).y4);Xn(c(Ti),"state",function(){return this.e9()},function(e){this.d9(e)});Xn(c($i),"logger",function(){return this.o9()},function(e){this.n9(e)});Xn(c($i),"errorHandler",function(){return this.q9()},function(e){this.p9(e)});Xn(c($i),"featureFlags",function(){return this.s9()},function(e){this.r9(e)});Xn(c($i),"performanceAnalyticsDelegate",function(){return this.u9()},function(e){this.t9(e)});Xn(c(oi),"name",c(oi).x4);Xn(c(oi),"ordinal",c(oi).y4);Xn(c(gu),"isSpeculativeExecutionEnabled",function(){return this.pa()});Xn(c(gu),"isVerboseLoggingEnabled",function(){return this.qa()});Xn(c(gu),"isUsingEverythingAssembler",function(){return this.ra()});Xn(c(e6),"state",function(){return this.e9()},function(e){this.d9(e)});RE=new eh;IE=new gu;EE=new th;er.values=pF;er.valueOf=hF;Xn(er,"SYNC",Bd);Xn(er,"ASYNC",c3);Xn(er,"SPEC",Ld);oi.values=NF;oi.valueOf=xF;Xn(oi,"ALL",Y4);Xn(oi,"LOCAL",Q4);Xn(oi,"REMOTE",Cu);var ir=B(F(),1);var El=B(F(),1);var Fd;(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"})(Fd||(Fd={}));function i6(e){switch(e){case 0:case"ENVIRONMENT_UNSPECIFIED":return Fd.ENVIRONMENT_UNSPECIFIED;case 1:case"ENVIRONMENT_SANDBOX":return Fd.ENVIRONMENT_SANDBOX;case 2:case"ENVIRONMENT_PRODUCTION":return Fd.ENVIRONMENT_PRODUCTION;case-1:case"UNRECOGNIZED":default:return Fd.UNRECOGNIZED}}function t6(e){switch(e){case Fd.ENVIRONMENT_UNSPECIFIED:return 0;case Fd.ENVIRONMENT_SANDBOX:return 1;case Fd.ENVIRONMENT_PRODUCTION:return 2;case Fd.UNRECOGNIZED:default:return-1}}var nr=B(F(),1);var Ru;(function(e){e[e.CURRENCY_UNSPECIFIED=0]="CURRENCY_UNSPECIFIED",e[e.GOLD=200]="GOLD",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Ru||(Ru={}));function PF(e){switch(e){case 0:case"CURRENCY_UNSPECIFIED":return Ru.CURRENCY_UNSPECIFIED;case 200:case"GOLD":return Ru.GOLD;case-1:case"UNRECOGNIZED":default:return Ru.UNRECOGNIZED}}function MF(e){switch(e){case Ru.CURRENCY_UNSPECIFIED:return 0;case Ru.GOLD:return 200;case Ru.UNRECOGNIZED:default:return-1}}var Yn;(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"})(Yn||(Yn={}));function _F(e){switch(e){case 0:case"ACCOUNTING_TYPE_UNSPECIFIED":return Yn.ACCOUNTING_TYPE_UNSPECIFIED;case 1:case"ACCOUNTING_TYPE_INSTANT":return Yn.ACCOUNTING_TYPE_INSTANT;case 2:case"ACCOUNTING_TYPE_DURABLE":return Yn.ACCOUNTING_TYPE_DURABLE;case 3:case"ACCOUNTING_TYPE_CONSUMABLE":return Yn.ACCOUNTING_TYPE_CONSUMABLE;case 4:case"ACCOUNTING_TYPE_VALID_FOR_1D":return Yn.ACCOUNTING_TYPE_VALID_FOR_1D;case 5:case"ACCOUNTING_TYPE_VALID_FOR_7D":return Yn.ACCOUNTING_TYPE_VALID_FOR_7D;case 6:case"ACCOUNTING_TYPE_VALID_FOR_30D":return Yn.ACCOUNTING_TYPE_VALID_FOR_30D;case 7:case"ACCOUNTING_TYPE_VALID_FOR_1Y":return Yn.ACCOUNTING_TYPE_VALID_FOR_1Y;case-1:case"UNRECOGNIZED":default:return Yn.UNRECOGNIZED}}function BF(e){switch(e){case Yn.ACCOUNTING_TYPE_UNSPECIFIED:return 0;case Yn.ACCOUNTING_TYPE_INSTANT:return 1;case Yn.ACCOUNTING_TYPE_DURABLE:return 2;case Yn.ACCOUNTING_TYPE_CONSUMABLE:return 3;case Yn.ACCOUNTING_TYPE_VALID_FOR_1D:return 4;case Yn.ACCOUNTING_TYPE_VALID_FOR_7D:return 5;case Yn.ACCOUNTING_TYPE_VALID_FOR_30D:return 6;case Yn.ACCOUNTING_TYPE_VALID_FOR_1Y:return 7;case Yn.UNRECOGNIZED:default:return-1}}function PE(){return{sku:"",name:"",price:void 0,environment:0,description:"",accountingType:0,productMetadata:{},images:{}}}var ot={$type:"devvit.payments.v1alpha.Product",encode(e,n=nr.default.Writer.create()){return e.sku!==""&&n.uint32(8010).string(e.sku),e.name!==""&&n.uint32(26).string(e.name),e.price!==void 0&&Tu.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=PE();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=Tu.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)?Tu.fromJSON(e.price):void 0,environment:Nr(e.environment)?i6(e.environment):0,description:Nr(e.description)?globalThis.String(e.description):"",accountingType:Nr(e.accountingType)?_F(e.accountingType):0,productMetadata:LE(e.productMetadata)?Object.entries(e.productMetadata).reduce((n,[i,d])=>(n[i]=String(d),n),{}):{},images:LE(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=Tu.toJSON(e.price)),e.environment!==0&&(n.environment=t6(e.environment)),e.description!==""&&(n.description=e.description),e.accountingType!==0&&(n.accountingType=BF(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=PE();return n.sku=e.sku??"",n.name=e.name??"",n.price=e.price!==void 0&&e.price!==null?Tu.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 ME(){return{key:"",value:""}}var S3={$type:"devvit.payments.v1alpha.Product.ProductMetadataEntry",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=ME();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=ME();return n.key=e.key??"",n.value=e.value??"",n}};l.set(S3.$type,S3);function _E(){return{key:"",value:""}}var w3={$type:"devvit.payments.v1alpha.Product.ImagesEntry",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=_E();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=_E();return n.key=e.key??"",n.value=e.value??"",n}};l.set(w3.$type,w3);function BE(){return{amount:0,currency:0}}var Tu={$type:"devvit.payments.v1alpha.ProductPrice",encode(e,n=nr.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 nr.default.Reader?e:nr.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=BE();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)?PF(e.currency):0}},toJSON(e){let n={};return e.amount!==0&&(n.amount=Math.round(e.amount)),e.currency!==0&&(n.currency=MF(e.currency)),n},create(e){return Tu.fromPartial(e??{})},fromPartial(e){let n=BE();return n.amount=e.amount??0,n.currency=e.currency??0,n}};l.set(Tu.$type,Tu);function LE(e){return typeof e=="object"&&e!==null}function Nr(e){return e!=null}var Ri;(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"})(Ri||(Ri={}));function dh(e){switch(e){case 0:case"ORDER_STATUS_UNSPECIFIED":return Ri.ORDER_STATUS_UNSPECIFIED;case 1:case"ORDER_STATUS_NEW":return Ri.ORDER_STATUS_NEW;case 2:case"ORDER_STATUS_CREATED":return Ri.ORDER_STATUS_CREATED;case 3:case"ORDER_STATUS_PAID":return Ri.ORDER_STATUS_PAID;case 4:case"ORDER_STATUS_DELIVERED":return Ri.ORDER_STATUS_DELIVERED;case 5:case"ORDER_STATUS_CANCELED":return Ri.ORDER_STATUS_CANCELED;case 6:case"ORDER_STATUS_REVERTED":return Ri.ORDER_STATUS_REVERTED;case-1:case"UNRECOGNIZED":default:return Ri.UNRECOGNIZED}}function oh(e){switch(e){case Ri.ORDER_STATUS_UNSPECIFIED:return 0;case Ri.ORDER_STATUS_NEW:return 1;case Ri.ORDER_STATUS_CREATED:return 2;case Ri.ORDER_STATUS_PAID:return 3;case Ri.ORDER_STATUS_DELIVERED:return 4;case Ri.ORDER_STATUS_CANCELED:return 5;case Ri.ORDER_STATUS_REVERTED:return 6;case Ri.UNRECOGNIZED:default:return-1}}function FE(){return{id:"",status:0,createdAt:void 0,updatedAt:void 0,products:[],environment:0,metadata:{}}}var Qn={$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&&re.encode(ZE(e.createdAt),n.uint32(26).fork()).ldelim(),e.updatedAt!==void 0&&re.encode(ZE(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=FE();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=rh(re.decode(i,i.uint32()));continue;case 4:if(t!==34)break;r.updatedAt=rh(re.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:Il(e.id)?globalThis.String(e.id):"",status:Il(e.status)?dh(e.status):0,createdAt:Il(e.createdAt)?VE(e.createdAt):void 0,updatedAt:Il(e.updatedAt)?VE(e.updatedAt):void 0,products:globalThis.Array.isArray(e?.products)?e.products.map(n=>ot.fromJSON(n)):[],environment:Il(e.environment)?i6(e.environment):0,metadata:LF(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=oh(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=t6(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 Qn.fromPartial(e??{})},fromPartial(e){let n=FE();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(Qn.$type,Qn);function UE(){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=UE();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:Il(e.key)?globalThis.String(e.key):"",value:Il(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=UE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(A3.$type,A3);function ZE(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function rh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function VE(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):rh(re.fromJSON(e))}function LF(e){return typeof e=="object"&&e!==null}function Il(e){return e!=null}function JE(){return{order:void 0}}var ah={$type:"devvit.actor.payments.v1alpha.FulfillOrderRequest",encode(e,n=ir.default.Writer.create()){return e.order!==void 0&&Qn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.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.order=Qn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:r6(e.order)?Qn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Qn.toJSON(e.order)),n},create(e){return ah.fromPartial(e??{})},fromPartial(e){let n=JE();return n.order=e.order!==void 0&&e.order!==null?Qn.fromPartial(e.order):void 0,n}};l.set(ah.$type,ah);function HE(){return{order:void 0}}var uh={$type:"devvit.actor.payments.v1alpha.RefundOrderRequest",encode(e,n=ir.default.Writer.create()){return e.order!==void 0&&Qn.encode(e.order,n.uint32(10).fork()).ldelim(),n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=HE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.order=Qn.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{order:r6(e.order)?Qn.fromJSON(e.order):void 0}},toJSON(e){let n={};return e.order!==void 0&&(n.order=Qn.toJSON(e.order)),n},create(e){return uh.fromPartial(e??{})},fromPartial(e){let n=HE();return n.order=e.order!==void 0&&e.order!==null?Qn.fromPartial(e.order):void 0,n}};l.set(uh.$type,uh);function qE(){return{acknowledged:void 0,rejectionReason:void 0}}var lh={$type:"devvit.actor.payments.v1alpha.FulfillOrderResponse",encode(e,n=ir.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 ir.default.Reader?e:ir.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!==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:r6(e.acknowledged)?globalThis.Boolean(e.acknowledged):void 0,rejectionReason:r6(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 lh.fromPartial(e??{})},fromPartial(e){let n=qE();return n.acknowledged=e.acknowledged??void 0,n.rejectionReason=e.rejectionReason??void 0,n}};l.set(lh.$type,lh);function DE(){return{}}var sh={$type:"devvit.actor.payments.v1alpha.RefundOrderResponse",encode(e,n=ir.default.Writer.create()){return n},decode(e,n){let i=e instanceof ir.default.Reader?e:ir.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=DE();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 sh.fromPartial(e??{})},fromPartial(e){return DE()}};l.set(sh.$type,sh);function r6(e){return e!=null}var en=B(F(),1);function $E(){return{skus:[],metadata:{}}}var fh={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=$E();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:iO(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 fh.fromPartial(e??{})},fromPartial(e){let n=$E();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(fh.$type,fh);function WE(){return{key:"",value:""}}var C3={$type:"devvit.plugin.payments.v1alpha.GetProductsRequest.MetadataEntry",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=WE();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=WE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(C3.$type,C3);function GE(){return{products:[]}}var ch={$type:"devvit.plugin.payments.v1alpha.GetProductsResponse",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=GE();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 ch.fromPartial(e??{})},fromPartial(e){let n=GE();return n.products=e.products?.map(i=>ot.fromPartial(i))||[],n}};l.set(ch.$type,ch);function zE(){return{start:void 0,end:void 0,limit:0,sku:"",buyer:"",status:0,metadata:{},cursor:""}}var ph={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest",encode(e,n=en.default.Writer.create()){return e.start!==void 0&&re.encode(eO(e.start),n.uint32(10).fork()).ldelim(),e.end!==void 0&&re.encode(eO(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])=>{b3.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=zE();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.start=kh(re.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.end=kh(re.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=b3.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)?nO(e.start):void 0,end:Ei(e.end)?nO(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)?dh(e.status):0,metadata:iO(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=oh(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 ph.fromPartial(e??{})},fromPartial(e){let n=zE();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(ph.$type,ph);function KE(){return{key:"",value:""}}var b3={$type:"devvit.plugin.payments.v1alpha.GetOrdersRequest.MetadataEntry",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=KE();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 b3.fromPartial(e??{})},fromPartial(e){let n=KE();return n.key=e.key??"",n.value=e.value??"",n}};l.set(b3.$type,b3);function XE(){return{hasNextPage:!1,endCursor:"",hasPreviousPage:!1,startCursor:""}}var Nu={$type:"devvit.plugin.payments.v1alpha.PageInfo",encode(e,n=en.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 en.default.Reader?e:en.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=XE();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 Nu.fromPartial(e??{})},fromPartial(e){let n=XE();return n.hasNextPage=e.hasNextPage??!1,n.endCursor=e.endCursor??"",n.hasPreviousPage=e.hasPreviousPage??!1,n.startCursor=e.startCursor??"",n}};l.set(Nu.$type,Nu);function YE(){return{orders:[],pageInfo:void 0}}var hh={$type:"devvit.plugin.payments.v1alpha.GetOrdersResponse",encode(e,n=en.default.Writer.create()){for(let i of e.orders)Qn.encode(i,n.uint32(10).fork()).ldelim();return e.pageInfo!==void 0&&Nu.encode(e.pageInfo,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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 1:if(t!==10)break;r.orders.push(Qn.decode(i,i.uint32()));continue;case 2:if(t!==18)break;r.pageInfo=Nu.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=>Qn.fromJSON(n)):[],pageInfo:Ei(e.pageInfo)?Nu.fromJSON(e.pageInfo):void 0}},toJSON(e){let n={};return e.orders?.length&&(n.orders=e.orders.map(i=>Qn.toJSON(i))),e.pageInfo!==void 0&&(n.pageInfo=Nu.toJSON(e.pageInfo)),n},create(e){return hh.fromPartial(e??{})},fromPartial(e){let n=YE();return n.orders=e.orders?.map(i=>Qn.fromPartial(i))||[],n.pageInfo=e.pageInfo!==void 0&&e.pageInfo!==null?Nu.fromPartial(e.pageInfo):void 0,n}};l.set(hh.$type,hh);function QE(){return{orderId:""}}var vh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryRequest",encode(e,n=en.default.Writer.create()){return e.orderId!==""&&n.uint32(10).string(e.orderId),n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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.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 vh.fromPartial(e??{})},fromPartial(e){let n=QE();return n.orderId=e.orderId??"",n}};l.set(vh.$type,vh);function jE(){return{}}var mh={$type:"devvit.plugin.payments.v1alpha.AcknowledgeOrderDeliveryResponse",encode(e,n=en.default.Writer.create()){return n},decode(e,n){let i=e instanceof en.default.Reader?e:en.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){}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{}},toJSON(e){return{}},create(e){return mh.fromPartial(e??{})},fromPartial(e){return jE()}};l.set(mh.$type,mh);function eO(e){let n=Math.trunc(e.getTime()/1e3),i=e.getTime()%1e3*1e6;return{seconds:n,nanos:i}}function kh(e){let n=(e.seconds||0)*1e3;return n+=(e.nanos||0)/1e6,new globalThis.Date(n)}function nO(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):kh(re.fromJSON(e))}function iO(e){return typeof e=="object"&&e!==null}function Ei(e){return e!=null}var FF=e=>{switch(e){case Cn.ALL:return oi.ALL;case Cn.REMOTE:return oi.REMOTE;case Cn.LOCAL:return oi.LOCAL;case Cn.UNRECOGNIZED:return oi.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},xr=class{constructor(n){this.scope=n.scope?FF(n.scope):oi.ALL,this.async=n.async,this.hook=n.hook,this.retry=n.retry,this.uiEvent=n}},d6=class{constructor(n){this.uiRequest=n,this.events=n.events.map(i=>new xr(i)),n.state&&(this.state=n.state)}},g3=class{constructor(n){this.uiResponse=n,this.replay=n.events.map(i=>new xr(i)),n.state&&(this.state=n.state)}};function tO(){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,p]=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]=p||"true"),console.info(`[devvit] set devvitdebug ${f}=${globalThis.devvit.debug[f]}`))}}}var dd;(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"})(dd||(dd={}));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 yh(e){return e.hostname.split(".")[1]??e.hostname}function rO(e){return`${yh(e)}@${e.actor?.version} by ${e.actor?.owner}`}var Wi=B(F(),1);function dO(){return{callState:void 0,connect:void 0}}var Sh={$type:"devvit.cli.PlaytestProviderMessage",encode(e,n=Wi.default.Writer.create()){return e.callState!==void 0&&Iu.encode(e.callState,n.uint32(10).fork()).ldelim(),e.connect!==void 0&&Eu.encode(e.connect,n.uint32(18).fork()).ldelim(),n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.default.Reader.create(e),d=n===void 0?i.len:i.pos+n,r=dO();for(;i.pos<d;){let t=i.uint32();switch(t>>>3){case 1:if(t!==10)break;r.callState=Iu.decode(i,i.uint32());continue;case 2:if(t!==18)break;r.connect=Eu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{callState:o6(e.callState)?Iu.fromJSON(e.callState):void 0,connect:o6(e.connect)?Eu.fromJSON(e.connect):void 0}},toJSON(e){let n={};return e.callState!==void 0&&(n.callState=Iu.toJSON(e.callState)),e.connect!==void 0&&(n.connect=Eu.toJSON(e.connect)),n},create(e){return Sh.fromPartial(e??{})},fromPartial(e){let n=dO();return n.callState=e.callState!==void 0&&e.callState!==null?Iu.fromPartial(e.callState):void 0,n.connect=e.connect!==void 0&&e.connect!==null?Eu.fromPartial(e.connect):void 0,n}};l.set(Sh.$type,Sh);function oO(){return{appInstalled:void 0}}var T3={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,n=Wi.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 Wi.default.Reader?e:Wi.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.appInstalled=xu.decode(i,i.uint32());continue}if((t&7)===4||t===0)break;i.skipType(t&7)}return r},fromJSON(e){return{appInstalled:o6(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=oO();return n.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?xu.fromPartial(e.appInstalled):void 0,n}};l.set(T3.$type,T3);function aO(){return{}}var xu={$type:"devvit.cli.PlaytestAppInstalled",encode(e,n=Wi.default.Writer.create()){return n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.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){}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 aO()}};l.set(xu.$type,xu);function uO(){return{logs:[]}}var Iu={$type:"devvit.cli.PlaytestCallState",encode(e,n=Wi.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 Wi.default.Reader?e:Wi.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!==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 Iu.fromPartial(e??{})},fromPartial(e){let n=uO();return n.logs=e.logs?.map(i=>mt.fromPartial(i))||[],n}};l.set(Iu.$type,Iu);function lO(){return{url:""}}var Eu={$type:"devvit.cli.PlaytestConnect",encode(e,n=Wi.default.Writer.create()){return e.url!==""&&n.uint32(10).string(e.url),n},decode(e,n){let i=e instanceof Wi.default.Reader?e:Wi.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){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:o6(e.url)?globalThis.String(e.url):""}},toJSON(e){let n={};return e.url!==""&&(n.url=e.url),n},create(e){return Eu.fromPartial(e??{})},fromPartial(e){let n=lO();return n.url=e.url??"",n}};l.set(Eu.$type,Eu);function o6(e){return e!=null}var wh="playtest",sO="ws://localhost:5678";function fO(e){let n=Ah();return n===""||n===e}function Ah(){return globalThis.location?new URL(location.href).searchParams.get(wh)??void 0:void 0}var Jn=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,Vn,Ch,cO,bh,gh,Th,Rh,UF=15e3,a6=class{constructor(){N3.add(this),Vn.set(this,{type:"Init"}),bh.set(this,()=>{Jn(this,Vn,"f").type==="Opened"&&this.onState?.("Closed"),R3(this,Vn,Jn(this,N3,"m",cO).call(this),"f")}),gh.set(this,n=>{let i=T3.fromJSON(JSON.parse(n.data));switch(!0){case i.appInstalled!=null:this.onState?.("Reloading");break}}),Th.set(this,()=>{if(Jn(this,Vn,"f").type!=="Opening")throw Error(`invalid transition from ${Jn(this,Vn,"f").type}`);this.onState?.("Opened"),R3(this,Vn,{sock:Jn(this,Vn,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),Rh.set(this,()=>{R3(this,Vn,Jn(this,N3,"m",Ch).call(this),"f")})}close(){"timer"in Jn(this,Vn,"f")&&clearTimeout(Jn(this,Vn,"f").timer),"sock"in Jn(this,Vn,"f")&&(Jn(this,Vn,"f").sock.onopen=null,Jn(this,Vn,"f").sock.onmessage=null,Jn(this,Vn,"f").sock.onclose=null,Jn(this,Vn,"f").sock.close()),R3(this,Vn,{type:"Init"},"f")}open(){Jn(this,Vn,"f").type==="Init"&&R3(this,Vn,Jn(this,N3,"m",Ch).call(this),"f")}send(n){"sock"in Jn(this,Vn,"f")?Jn(this,Vn,"f").sock.send(JSON.stringify(n)):console.warn("devvit playtest message dropped",n)}};Vn=new WeakMap,bh=new WeakMap,gh=new WeakMap,Th=new WeakMap,Rh=new WeakMap,N3=new WeakSet,Ch=function(){let n=new WebSocket(sO);return n.onclose=Jn(this,bh,"f"),n.onmessage=Jn(this,gh,"f"),n.onopen=Jn(this,Th,"f"),{sock:n,type:"Opening"}},cO=function(){return{timer:setTimeout(Jn(this,Rh,"f"),UF),type:"Retrying"}};var ai=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},pe=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)},Ud,u6,ui,es,l6,I3,od,Wo,ns,ts,Go,Nh,x3,s6,xh,pO,is,Ih,Eh,ZF={debug:xn.DEBUG,error:xn.ERROR,info:xn.INFO,log:xn.DEBUG,trace:xn.DEBUG,warn:xn.WARN},f6=class{constructor(n,i,d){Ud.add(this),u6.set(this,void 0),ui.set(this,void 0),es.set(this,!1),l6.set(this,0),I3.set(this,void 0),od.set(this,{}),Wo.set(this,void 0),ns.set(this,()=>{}),ts.set(this,void 0),Go.set(this,void 0),Nh.set(this,Ah()),x3.set(this,!1),s6.set(this,void 0),xh.set(this,r=>{let t=r.data,[s]=t;switch(s){case Ir.READY:{let[,f]=t;ai(this,s6,f,"f"),pe(this,ts,"f")?.plugins?pe(this,Ud,"m",pO).call(this):pe(this,Ud,"m",Ih).call(this);break}case Ir.PLUGINS_CONFIGURED:pe(this,Ud,"m",Ih).call(this);break;case Ir.BUNDLE_LOADED:{let[,f,p]=t;pe(this,Ud,"m",is).call(this,f),ai(this,es,!0,"f"),pe(this,Wo,"f")?.resolve({metrics:{init:pe(this,s6,"f"),loadBundle:p}}),ai(this,Wo,void 0,"f");break}case Ir.BUNDLE_LOAD_FAILED:{let[,,f,p]=t;pe(this,Ud,"m",is).call(this,p),pe(this,Wo,"f")?.reject(f),ai(this,Wo,void 0,"f");break}case Ir.RETURN:{let[,f,p,v]=t;pe(this,Ud,"m",is).call(this,v),pe(this,od,"f")[f]?.resolve(p),delete pe(this,od,"f")[f];break}case Ir.ERROR:{let[,f,p,v]=t;pe(this,Ud,"m",is).call(this,v),pe(this,od,"f")[f]?.reject(p),delete pe(this,od,"f")[f];break}case Ir.CIRCUIT_BREAKER:{let[,f,p,v]=t;pe(this,od,"f")[f]?.reject(new b4(p,v)),delete pe(this,od,"f")[f];break}case Ir.PLUGIN_CALL:{let[,f,p,v,y,g]=t;pe(this,ts,"f")?.callback(f,p,v,y,g);break}case Ir.UNHANDLED_REJECTION:{let[,,f,p]=t;pe(this,Ud,"m",is).call(this,p),pe(this,ns,"f").call(this,"UnhandledRejection",f);break}}}),Eh.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"),pe(this,Go,"f")?.close();let t=new URL(location.href);t.searchParams.set(wh,pe(this,Nh,"f")??""),location.assign(t),location.reload();break}}}),ai(this,u6,n,"f"),i&&ai(this,ns,i,"f"),d&&ai(this,ts,d,"f")}get ready(){return pe(this,es,"f")}get runtimeDebugLogging(){return pe(this,x3,"f")}set runtimeDebugLogging(n){n!==pe(this,x3,"f")&&(ai(this,x3,n,"f"),this.runtimeDebugLogging&&pe(this,ui,"f")?.postMessage([dd.ENABLE_DEBUG_LOGGING]))}async loadBundle(n){if(pe(this,ui,"f"))throw new Error("Bundle already loaded");let i=fO(yh(n));i&&(ai(this,Go,new a6,"f"),pe(this,Go,"f").onState=pe(this,Eh,"f")),pe(this,Go,"f")?.open();let d=new Worker(URL.createObjectURL(pe(this,u6,"f")),{name:`App: ${rO(n)}`,type:"module"});return d.onerror=r=>pe(this,ns,"f").call(this,"Error",r.error),d.onmessageerror=r=>pe(this,ns,"f").call(this,"MessageError",r.data),d.onmessage=pe(this,xh,"f"),ai(this,ui,d,"f"),ai(this,I3,n,"f"),this.runtimeDebugLogging&&pe(this,ui,"f").postMessage([dd.ENABLE_DEBUG_LOGGING]),i&&pe(this,ui,"f").postMessage([dd.ENABLE_APP_LOGGING]),new Promise((r,t)=>{ai(this,Wo,{resolve:r,reject:t},"f")})}async call(n,i,d){var r;if(!pe(this,es,"f")||!pe(this,ui,"f"))throw new Error("No bundle loaded");let t=ai(this,l6,(r=pe(this,l6,"f"),++r),"f"),s=new Promise((f,p)=>{pe(this,od,"f")[t]={resolve:f,reject:p}});return pe(this,ui,"f").postMessage([dd.CALL,t,n,i,d,!1]),s}onPluginResponse(n,i){pe(this,ui,"f")?.postMessage([dd.PLUGIN_RESPONSE,n,i])}quit(){pe(this,Go,"f")?.close(),ai(this,Go,void 0,"f"),ai(this,es,!1,"f"),pe(this,ui,"f")&&(pe(this,ui,"f").postMessage([dd.QUIT]),pe(this,ui,"f").onerror=null,pe(this,ui,"f").onmessageerror=null,pe(this,ui,"f").onmessage=null,pe(this,ui,"f").terminate()),ai(this,ui,void 0,"f");for(let{reject:n}of Object.values(pe(this,od,"f")))n(Error("worker terminated"));ai(this,od,{},"f"),pe(this,Wo,"f")?.reject(Error("worker terminated")),ai(this,Wo,void 0,"f")}};u6=new WeakMap,ui=new WeakMap,es=new WeakMap,l6=new WeakMap,I3=new WeakMap,od=new WeakMap,Wo=new WeakMap,ns=new WeakMap,ts=new WeakMap,Go=new WeakMap,Nh=new WeakMap,x3=new WeakMap,s6=new WeakMap,xh=new WeakMap,Eh=new WeakMap,Ud=new WeakSet,pO=function(){pe(this,ui,"f")?.postMessage([dd.ENABLE_PLUGINS,pe(this,ts,"f")?.plugins??[]])},is=function(n){if(!n.length)return;let i=new Date,d={logs:n.map(r=>({severity:ZF[r.method],message:r.args.join(" "),tags:[],timestamp:i}))};pe(this,Go,"f")?.send({callState:d})},Ih=function(){pe(this,ui,"f")?.postMessage([dd.LOAD_BUNDLE,pe(this,I3,"f")]),ai(this,I3,void 0,"f")};var Oh="RenderPostContent",VF=new Set([Oh]);function hO(e){if(VF.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var rs,E3,c6=class{constructor(n){Se(this,rs);Se(this,E3);Oe(this,rs,n)}set env(n){Oe(this,rs,n)}set props(n){Oe(this,E3,n)}build(n,i){return new d6({state:n,events:i.map(d=>d.uiEvent),env:x(this,rs),props:x(this,E3)})}};rs=new WeakMap,E3=new WeakMap;var bt,O3,v6,p6=class{constructor(){Se(this,bt);Se(this,O3,!1);Se(this,v6,(n,i,d,r,t)=>{this.onPluginCall?.(n,i,d,r,t),i===nl.fullName&&d===nl.methods.send.name&&x(this,bt)?.onPluginResponse(n,{error:void 0,success:!0,value:{}})})}isReady(){return!!x(this,bt)?.ready}set runtimeDebugLogging(n){Oe(this,O3,n),x(this,bt)&&(x(this,bt).runtimeDebugLogging=n)}setLocalSrc(n){this.unload(),Oe(this,bt,n?new f6(n,(i,d)=>console.error(i,d),{callback:x(this,v6),plugins:[]}):void 0),x(this,bt)&&(x(this,bt).runtimeDebugLogging=x(this,O3))}unload(){x(this,bt)?.quit()}async load(n){this.unload();try{return await x(this,bt)?.loadBundle(n)}catch(i){console.error(i)}}handle(n,i,d,r){if(!this.isReady()||!x(this,bt))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",i,this.metadata),x(this,bt)?.call(hO(n),i.uiRequest,this.metadata).then(t=>d(new g3(t))).catch(t=>r(t))}pause(){}reset(){}resume(){}snapshot(){return{}}};bt=new WeakMap,O3=new WeakMap,v6=new WeakMap;var h6=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[hO(n)](i.uiRequest,this.metadata).then(t=>d(new g3(t))).catch(r)}pause(){}reset(){}resume(){}snapshot(){return{}}};var zo,Ko,P3,m6=class{constructor(n){Se(this,zo,new Map);Se(this,Ko,new Map);Se(this,P3);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),Oe(this,P3,n)}add(n){devvit?.debug.runtime&&console.debug("[runtime] timers: add",n),x(this,Ko).set(n.id,n),x(this,zo).set(n.id,window.setInterval(()=>{x(this,P3).submit([new xr({scope:Cn.ALL,timer:{},hook:n.id})])},n.duration))}apply(n){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",n);let i=new Map(x(this,Ko));n.forEach(d=>{i.delete(d.id),x(this,Ko).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 x(this,zo).values())clearInterval(n);x(this,zo).clear(),x(this,Ko).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...x(this,Ko).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let n of x(this,zo).values())clearInterval(n);return this.list()}remove(n){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),x(this,Ko).delete(n),clearInterval(x(this,zo).get(n)),x(this,zo).delete(n)}resumeAll(n){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(n)}};zo=new WeakMap,Ko=new WeakMap,P3=new WeakMap;var vO=e=>e.message==="ServerCallRequired",Ph=class{debug(n){devvit?.debug.runtime&&console.debug(this.tag(),...n)}error(n){vO(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,Mh=class{constructor(n,i){Se(this,M3);Se(this,_3);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};Oe(this,M3,n),Oe(this,_3,i)}logRuntimeError(n){var i;vO(n)||(console.error("[kmp-dispatcher-perf-analytics] error",n),(i=x(this,_3))==null||i.call(this,n))}logRuntimeTrace(n){var i;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",n),(i=x(this,M3))==null||i.call(this,n)}};M3=new WeakMap,_3=new WeakMap;tO();var JF=({nanos:e,seconds:n})=>{let i=n*1e3,d=e/1e6;return Math.floor(i+d)},HF=["showToast","showForm","navigateToUrl","createOrder"],Ol,Pl,Er,B3,Ml,ad,ds,k6=class{constructor(n,i,d){Se(this,Ol);Se(this,Pl);Se(this,Er);Se(this,B3);this.hasRendered=!1;Se(this,Ml);Se(this,ad);Se(this,ds);Oe(this,Ol,new c6(i)),d.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),Oe(this,Er,new e6(n??{},x(this,Ol),Oh,{logger:new Ph,featureFlags:{isSpeculativeExecutionEnabled:d.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new Mh(d.performanceTracker,d.errorTracker),errorHandler:r=>this.onError?.(r)})),Oe(this,Pl,new m6(x(this,Er))),Oe(this,Ml,new h6),Oe(this,ad,new p6),this.init()}get state(){return x(this,Er).state}set metadata(n){let i={...n},d=[];for(let[r,t]of Object.entries(devvit?.debug??{}))d.push(`${r}=${t}`);d.length&&(i[_o.Debug]={values:d}),x(this,ad).metadata=i,x(this,Ml).metadata=i}set onPluginCall(n){x(this,ad).onPluginCall=n}set runtimeDebugLogging(n){x(this,ad).runtimeDebugLogging=n}subscribe(n){Oe(this,B3,x(this,Er).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(HF.some(t=>r[t])||r.realtimeSubscriptions){this.onUserAction?.(r);return}if(r.interval){let t=Object.entries(r.interval.intervals);t.length===0&&x(this,Pl).clear(),x(this,Pl).apply(t.map(([s,f])=>new dt(s,JF(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){x(this,Er).submit(...n)}unsubscribe(){x(this,B3)?.unsubscribe()}init(){x(this,Er).init(x(this,ad),x(this,Ml),x(this,Pl))}togglePause(n){n?Oe(this,ds,x(this,Er).pause()):x(this,ds)&&x(this,Er).resume(x(this,ds))}resetAppState(){this.hasRendered=!1,x(this,Er).reset()}setEnv(n){x(this,Ol).env=n}setProps(n){x(this,Ol).props=n}remoteLoad(...n){x(this,Ml).load(...n)}async localLoad(...n){return x(this,ad).reset(),await x(this,ad).load(...n)}localLoadWorker(...n){x(this,ad).setLocalSrc(...n)}};Ol=new WeakMap,Pl=new WeakMap,Er=new WeakMap,B3=new WeakMap,Ml=new WeakMap,ad=new WeakMap,ds=new WeakMap;function _h(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 p=n.replace(/^t[0-9]_/,""),v=e.replace("{{location}}",p).replace("{{app}}",s).replace("{{path}}",f);return new URL(v).toString()}var _l,Bl,Ll,os,as,on,y6,S6,tr,Bh,w6,A6,Ou,us,C6,li=class extends rr{constructor(){super();Se(this,tr);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.appPublicApiVersion="";this.disableAssetSandbox=!1;Se(this,_l);Se(this,Bl);Se(this,Ll);Se(this,os,!1);Se(this,as,"");Se(this,on);Se(this,y6,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:i=>this.disableAssetSandbox?i:_h(this.webViewUrlTemplate,this.metadata?.[_o.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",i),onAction:i=>{let d={};i.type===Bi.ACTION_CLICK||x(this,os)?d.userAction={actionId:i.id,data:i.data??{}}:i.type===Bi.ACTION_WEBVIEW&&(d.webView={postMessage:{message:i.data}}),x(this,on)?.submit([new xr({scope:Cn.ALL,hook:i.id,...d})])},stackDirection:Ce.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));Se(this,S6,i=>{Nx(i)||console.error(i),nn(this,tr,Ou).call(this,"devvit-ui-error",{err:i,type:"Error"})});Se(this,w6,(i,d,r,t,s)=>{d===nl.fullName&&r===nl.methods.send.name&&nn(this,tr,Ou).call(this,"devvit-realtime-send",{event:t})});Se(this,A6,({response:i})=>{var d,r;this.renderResponse=i,i?.blocks&&(this._rootBlock=i.blocks,x(this,_l)?((d=this._rootBlock).config??(d.config={}),(r=this._rootBlock.config).rootConfig??(r.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=x(this,_l)):Oe(this,_l,this._rootBlock.config?.rootConfig?.height||i8))});Se(this,us,i=>{nn(this,tr,Ou).call(this,"devvit-ui-effect",{effect:i,onEvent:d=>d.webView?.postMessage?x(this,on)?.submit([new xr({scope:Cn.ALL,hook:d.hook,webView:{...d.webView}})]):x(this,on)?.submit([new xr(d)]),metadata:this.metadata})});Se(this,C6,async i=>{if(await this.updateComplete,i.webView?.fullscreen){let d=_h(this.webViewUrlTemplate,this.metadata?.[_o.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",i.webView.fullscreen.url);devvit?.debug.surface&&console.debug("[surface] fullscreen web view asset,",i.webView.fullscreen.url,"resolved to",d),i.webView.fullscreen.url=d,x(this,us).call(this,i)}else if(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?x(this,us).call(this,i):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[h4]}async connectedCallback(){super.connectedCallback(),Oe(this,on,new k6({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[_o.Language]?.values?.[0],timezone:this.metadata?.[_o.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:i=>{nn(this,tr,Ou).call(this,TN,{name:i.spanName,timeStart:i.startTimeMs,timeEnd:i.endTimeMs,target:i.target,intent:i.intent,eventCount:i.eventCount})},errorTracker:i=>{nn(this,tr,Ou).call(this,RN,{message:i.message,origin:i.origin,version:i.version})}})),x(this,on).onPluginCall=x(this,w6),x(this,on).onError=x(this,S6),x(this,on).onUserAction=x(this,us),x(this,on).onWebViewMessage=x(this,C6),x(this,on).subscribe(i=>{x(this,A6).call(this,{request:i.request.uiRequest,response:i.response.uiResponse})}),Oe(this,Bl,new ResizeObserver(Ix(i=>{i.length!==0&&(this.dimensions=Fx(i[0],window,document.body))},600))),x(this,Bl).observe(this,{box:"content-box"}),Oe(this,Ll,new IntersectionObserver(i=>{i.forEach(d=>{x(this,on)?.togglePause(!d.isIntersecting)})})),x(this,Ll).observe(this)}disconnectedCallback(){x(this,Bl)?.unobserve(this),x(this,Bl)?.disconnect(),x(this,Ll)?.unobserve(this),x(this,Ll)?.disconnect(),x(this,on)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?Tt`<div class="relative">
626
626
  <devvit-blocks-renderer
627
627
  class="${this.scheme??""}"
628
628
  .block="${this._rootBlock}"