@devvit/ui-renderer 0.11.12-next-2025-03-24-54ee926e7.0 → 0.11.12-next-2025-03-25-a702f8e8f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/devvit-surface.min.js
CHANGED
|
@@ -622,7 +622,7 @@ button inline-flex`},da=e=>{let{createElement:t}=W(),{attributes:r,selected:n,ro
|
|
|
622
622
|
style="${n(i)}"
|
|
623
623
|
>
|
|
624
624
|
${a===M?"":a}
|
|
625
|
-
</div>`}else return a}var rt,nt,M6,w5=class extends m0{constructor(){super(...arguments);L(this,rt,window.matchMedia("(prefers-color-scheme: dark)"));L(this,nt,()=>this.requestUpdate());L(this,M6,()=>({stackDirection:H.UNRECOGNIZED}))}static get styles(){return[l6]}connectedCallback(){super.connectedCallback(),f(this,rt)?.addEventListener("change",f(this,nt))}disconnectedCallback(){super.disconnectedCallback(),f(this,rt)?.removeEventListener("change",f(this,nt))}async getUpdateComplete(){let r=await super.getUpdateComplete(),n=this.renderRoot.querySelectorAll("[data-block-type]");for(let a=0;a<n.length;a++)await n.item(a).updateComplete;return r}reset(){this.renderRoot.querySelectorAll("[data-block-type]").forEach(n=>{n.reset?.()})}findBlockById(r){let n=this.renderRoot.querySelector(`#${r}[data-block-type]`);if(n)return{blockType:n.dataset.blockType,element:n}}findBlocksByType(r){return Array.from(this.renderRoot.querySelectorAll(`[data-block-type=${r}]`)).map(n=>({blockType:r,element:n}))}render(){if(this.block&&this.block.type===N.BLOCK_ROOT){let r={...f(this,M6).call(this),...this.renderContext?.()??{}},n=new o6,a=kr(this.block,r);return n.finish(),this.dispatchEvent(P5($3,{name:"blocks_layout",timeStart:n.timeStart,timeEnd:n.timeEnd})),n0` <div class="${Q2(this.class)}">${a}</div>`}return n0`${fa({creative:n0`<slot name="empty-state-image"></slot>`,title:X7("Whoops!",{desc:"Header for message to display when rendering fails"}),description:X7("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};rt=new WeakMap,nt=new WeakMap,M6=new WeakMap,O([j({attribute:!1})],w5.prototype,"block",2),O([j({attribute:!1})],w5.prototype,"renderContext",2),O([j()],w5.prototype,"class",2),w5=O([ha(),D5("devvit-blocks-renderer")],w5);var y6=s1(w1(),1);function Vo(){return{height:0,width:0,scale:0,fontScale:void 0}}var $r={$type:"devvit.ui.common.v1alpha.UIDimensions",encode(e,t=y6.default.Writer.create()){return e.height!==0&&t.uint32(8).int32(e.height),e.width!==0&&t.uint32(16).int32(e.width),e.scale!==0&&t.uint32(29).float(e.scale),e.fontScale!==void 0&&t.uint32(37).float(e.fontScale),t},decode(e,t){let r=e instanceof y6.default.Reader?e:y6.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Vo();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.height=r.int32();continue;case 2:if(i!==16)break;a.width=r.int32();continue;case 3:if(i!==29)break;a.scale=r.float();continue;case 4:if(i!==37)break;a.fontScale=r.float();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{height:L6(e.height)?globalThis.Number(e.height):0,width:L6(e.width)?globalThis.Number(e.width):0,scale:L6(e.scale)?globalThis.Number(e.scale):0,fontScale:L6(e.fontScale)?globalThis.Number(e.fontScale):void 0}},toJSON(e){let t={};return e.height!==0&&(t.height=Math.round(e.height)),e.width!==0&&(t.width=Math.round(e.width)),e.scale!==0&&(t.scale=e.scale),e.fontScale!==void 0&&(t.fontScale=e.fontScale),t},create(e){return $r.fromPartial(e??{})},fromPartial(e){let t=Vo();return t.height=e.height??0,t.width=e.width??0,t.scale=e.scale??0,t.fontScale=e.fontScale??void 0,t}};g.set($r.$type,$r);function L6(e){return e!=null}var No="ServerCallRequired";var S6=class extends Error{constructor(t,r){super(No),this.response=t,this.cause=r,this.name="CircuitBreakerResponse"}};function Io(e){return e?.message===No}var h2=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"}),To;(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"})(To||(To={}));function Ho(e,t){let r,n=0,a;return function(...i){return a=i,r??(r=setTimeout(()=>{n=Date.now(),r=void 0;let o=a;a=void 0,e.apply(this,o)},Math.max(0,t-(Date.now()-n)))),()=>{r!=null&&clearTimeout(r),r=void 0,a=void 0}}}function bo(e,t){if(!e)throw Error(t)}var V6;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(V6||(V6={}));function Eu(e){return e.startsWith(V6.LINK)}function xu(e){bo(Eu(e),`Expected link id to start with ${V6.LINK}, got ${e}}`)}function Ro(e){return xu(e),e}var Cu=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Q5=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(Cu);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Oo=e=>e==="*"||e==="x"||e==="X",Bo=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Mu=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Lu=(e,t)=>{if(Oo(e)||Oo(t))return 0;let[r,n]=Mu(Bo(e),Bo(t));return r>n?1:r<n?-1:0},Ur=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=Lu(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var ko=(e,t)=>{let r=Q5(e),n=Q5(t),a=r.pop(),i=n.pop(),o=Ur(r,n);return o!==0?o:a&&i?Ur(a.split("."),i.split(".")):a||i?a?-1:1:0};var Pr=(e,t,r)=>{yu(r);let n=ko(e,t);return Uo[r].includes(n)},Uo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$o=Object.keys(Uo),yu=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($o.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$o.join("|")}`)};var Su=1,Vu=16;function Po(e,t,r){let{width:n,height:a}=e.contentRect,o=t.getComputedStyle(r).fontSize.split("px")[0],c=o?parseFloat(o)/Vu:Su;return{width:Math.round(n),height:Math.round(a),scale:t.devicePixelRatio,fontScale:c}}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 t=Object(this),r=t.length>>>0,n=arguments[1],a=n>>0,i=a<0?Math.max(r+a,0):Math.min(a,r),o=arguments[2],c=o===void 0?r:o>>0,l=c<0?Math.max(r+c,0):Math.min(c,r);i<l;)t[i]=e,i++;return t}});[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,t){return function(r){var n=r>>>0;return n===0?32:31-(e(n)/t|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(t,r){return(t&4294901760)*(r&65535)+(t&65535)*(r|0)|0});var al=Math.clz32,Jr=ArrayBuffer.isView,Q=Math.imul;w(i4,"CharSequence",F2);w(o4,"Number",Z);w(l4,"Unit",x1);w(n3,"IntCompanionObject",x1);w(N1,"Collection",F2);w(P2,"AbstractCollection",Z,m,[N1]);w(F0,"AbstractMutableCollection",Z,P2,[P2,N1]);w(ct,"IteratorImpl",Z);w(i3,"List",F2,m,[N1]);w(M0,"AbstractMutableList",Z,F0,[F0,N1,i3]);w(U2,"Map",F2);w(L0,"AbstractMap",Z,m,[U2]);w(j5,"AbstractMutableMap",Z,L0,[L0,U2]);w(dt,"Set",F2,m,[N1]);w(k2,"AbstractMutableSet",Z,F0,[F0,N1,dt]);w(sl,"Companion",x1);w(_1,"ArrayList",Z,M0,[M0,N1,i3],q1);w(G0,"HashMap",Z,j5,[j5,U2],Fu);w(y0,"HashMapEntrySetBase",Z,k2,[N1,dt,k2]);w(u4,"HashMapEntrySet",Z,y0);w(Pe,"HashSet",Z,k2,[k2,N1,dt],v4);w(fl,"Companion",x1);w(D2,"Itr",Z);w(p4,"KeysItr",Z,D2);w(vt,"EntriesItr",Z,D2);w($2,"Entry",F2);w(_5,"EntryRef",Z,m,[$2]);function Nu(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o(),i=a,o;if(i!=null&&a1(i,$2)?o=this.c4(i):o=!1,!o){t=!1;break e}}t=!0}return t}w(pl,"InternalMap",F2);w(H1,"InternalHashMap",Z,m,[pl],h4);w(U6,"LinkedHashMap",Z,G0,[G0,U2],ht);w(q0,"StringBuilder",Z,m,[i4],m4);w(El,"Companion",x1);w(xl,"Char",Z);w(Cl,"Companion",x1);w(e0,"Enum",Z);w(P6,m,Z);w(Rl,"Companion",x1);w(k,"Long",Z,o4);w(G2,"Exception",Z,Error,m,Jl);w(k1,"RuntimeException",Z,G2,m,Ql);w(u3,"IllegalArgumentException",Z,k1,m,zl);w(h3,"IndexOutOfBoundsException",Z,k1,m,Kl);w(d3,"IllegalStateException",Z,k1,m,Yl);w(F6,"UnsupportedOperationException",Z,k1,m,f3);w(p3,"NoSuchElementException",Z,k1,m,W2);w(G6,"ConcurrentModificationException",Z,k1,m,E4);w(m3,"ArithmeticException",Z,k1,m,es);w(W6,"NullPointerException",Z,k1,m,x4);w(q6,"ClassCastException",Z,k1,m,C4);w(g3,"UninitializedPropertyAccessException",Z,k1,m,rs);w(De,"Companion",x1);w(is,"Companion",x1);w(J6,"Companion",x1);w(ls,"Companion",x1);w(i1,"ArrayDeque",Z,M0,m,wt);w(z0,"EmptyList",x1,m,[i3]);w(X6,"EmptyIterator",x1);w(q2,"ArrayAsCollection",Z,m,[N1]);w(z6,"IntIterator",Z);w(us,"Companion",x1);w(f2,"IntProgression",Z);w(Ue,"IntRange",Z,f2);w(K6,"IntProgressionIterator",Z,z6);w(S4,"Companion",x1);w(V1,"Pair",Z);function i4(){}function o4(){}function l4(){}s(l4).toString=function(){return"kotlin.Unit"};var y;function n3(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}s(n3).c=function(){return this.MIN_VALUE};s(n3).d=function(){return this.MAX_VALUE};s(n3).e=function(){return this.SIZE_BYTES};s(n3).f=function(){return this.SIZE_BITS};var s4;function Iu(e){return e!==e}function Tu(e){var t;if(e===0)t=0;else{var r=31;t=1<<(r-al(e)|0)}return t}function il(e){return Vh(e)}function Hu(e,t){return t}function bu(e,t){return o3(Array(t),null)}function O6(e){return Th([e])}function a3(e){var t;return e.toArray!==void 0?t=e.toArray():t=il(e),t}function R(e,t,r,n,a){W1.h(n,a,e.length);var i=a-n|0;if(W1.h(r,r+i|0,t.length),Jr(t)&&Jr(e)){var o=e.subarray(n,a);t.set(o,r)}else if(e!==t||r<=n){var c=0;if(c<i)do{var l=c;c=c+1|0,t[r+l|0]=e[n+l|0]}while(c<i)}else{var u=i-1|0;if(0<=u)do{var v=u;u=u+-1|0,t[r+v|0]=e[n+v|0]}while(0<=u)}}function Ru(e){return e<0&&Hh(),e}function F0(){P2.call(this)}s(F0).j=function(e){this.k();for(var t=this.l();t.m();)if(B(t.o(),e))return t.n(),!0;return!1};s(F0).p=function(e){this.k();for(var t=!1,r=e.l();r.m();){var n=r.o();this.i(n)&&(t=!0)}return t};s(F0).toJSON=function(){return this.toArray()};s(F0).k=function(){};function ct(e){this.w_1=e,this.u_1=0,this.v_1=-1}s(ct).m=function(){return this.u_1<this.w_1.q()};s(ct).o=function(){if(!this.m())throw W2();var e=this,t=this.u_1;return this.u_1=t+1|0,e.v_1=t,this.w_1.x(this.v_1)};s(ct).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw mt(J0(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function M0(){F0.call(this),this.y_1=0}s(M0).i=function(e){return this.k(),this.a1(this.q(),e),!0};s(M0).l=function(){return new ct(this)};s(M0).r=function(e){return this.b1(e)>=0};s(M0).b1=function(e){var t;e:{for(var r=0,n=this.l();n.m();){var a=n.o();if(B(a,e)){t=r;break e}r=r+1|0}t=-1}return t};s(M0).equals=function(e){return e===this?!0:e!=null&&a1(e,i3)?W1.c1(this,e):!1};s(M0).hashCode=function(){return W1.d1(this)};function j5(){L0.call(this),this.g1_1=null,this.h1_1=null}s(j5).j1=function(e){this.k();for(var t=this.k1().l();t.m();){var r=t.o(),n=r.l1();if(B(e,n)){var a=r.m1();return t.n(),a}}return null};s(j5).k=function(){};function k2(){F0.call(this)}s(k2).equals=function(e){return e===this?!0:e!=null&&a1(e,dt)?M4.s1(this,e):!1};s(k2).hashCode=function(){return M4.t1(this)};function ol(e){if(!(e>=0)){var t="capacity must be non-negative.";throw W0(J0(t))}return o3(Array(e),null)}function ll(e,t){e[t]=null}function Do(e,t,r){e.fill(null,t,r)}function Fo(e,t){return oh(e,t)}function sl(){Xr=this;var e=this,t=B6(0);t.w1_1=!0,e.x1_1=t}var Xr;function Ou(){return Xr==null&&new sl,Xr}function Bu(e){var t=[];return _1.call(e,t),e}function q1(){return Bu(F(s(_1)))}function ku(e,t){var r=[];if(_1.call(t,r),!(e>=0)){var n="Negative initial capacity: "+e;throw W0(J0(n))}return t}function B6(e){return ku(e,F(s(_1)))}function $u(e,t){var r=a3(e);return _1.call(t,r),t}function c4(e){return $u(e,F(s(_1)))}function Uu(e,t){var r=e.q();return e.v1_1.length=e.q()+t|0,r}function cl(e,t){return W1.y1(t,e.q()),t}function Pu(e,t){return W1.z1(t,e.q()),t}function _1(e){Ou(),M0.call(this),this.v1_1=e,this.w1_1=!1}s(_1).q=function(){return this.v1_1.length};s(_1).x=function(e){var t=this.v1_1[cl(this,e)];return t==null||t!=null?t:J()};s(_1).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};s(_1).a1=function(e,t){this.k(),this.v1_1.splice(Pu(this,e),0,t),this.y_1=this.y_1+1|0};s(_1).p=function(e){if(this.k(),e.t())return!1;for(var t=Uu(this,e.q()),r=0,n=e.l();n.m();){var a=n.o(),i=r;r=i+1|0;var o=Ru(i);this.v1_1[t+o|0]=a}return this.y_1=this.y_1+1|0,!0};s(_1).z=function(e){this.k(),cl(this,e),this.y_1=this.y_1+1|0;var t;return e===R6(this)?t=this.v1_1.pop():t=this.v1_1.splice(e,1)[0],t};s(_1).j=function(e){this.k();var t=0,r=this.v1_1.length-1|0;if(t<=r)do{var n=t;if(t=t+1|0,B(this.v1_1[n],e))return this.v1_1.splice(n,1),this.y_1=this.y_1+1|0,!0}while(t<=r);return!1};s(_1).b1=function(e){return wl(this.v1_1,e)};s(_1).toString=function(){return Cv(this.v1_1)};s(_1).a2=function(){return[].slice.call(this.v1_1)};s(_1).toArray=function(){return this.a2()};s(_1).k=function(){if(this.w1_1)throw f3()};function Du(e,t){return j5.call(t),G0.call(t),t.f2_1=e,t}function ul(e){return Du(h4(),e),e}function Fu(){return ul(F(s(G0)))}s(G0).p1=function(e){return this.f2_1.h2(e)};s(G0).k1=function(){var e=this.g2_1,t;if(e==null){var r=new u4(this.f2_1);this.g2_1=r,t=r}else t=e;return t};s(G0).r1=function(e){return this.f2_1.r1(e)};s(G0).i1=function(e,t){return this.f2_1.i1(e,t)};s(G0).j1=function(e){return this.f2_1.j1(e)};s(G0).q=function(){return this.f2_1.q()};function G0(){this.g2_1=null}function u4(e){y0.call(this,e)}s(u4).l=function(){return this.j2_1.k2()};function y0(e){k2.call(this),this.j2_1=e}s(y0).q=function(){return this.j2_1.q()};s(y0).t=function(){return this.j2_1.q()===0};s(y0).l2=function(e){return this.j2_1.n2(e)};s(y0).r=function(e){return e!=null&&a1(e,$2)?this.l2(e!=null&&a1(e,$2)?e:J()):!1};s(y0).m2=function(e){throw f3()};s(y0).i=function(e){return this.m2(e!=null&&a1(e,$2)?e:J())};s(y0).p=function(e){throw f3()};s(y0).s=function(e){return this.j2_1.o2(e)};s(y0).k=function(){return this.j2_1.k()};function Gu(e,t){return k2.call(t),Pe.call(t),t.p2_1=e,t}function Wu(e){return Gu(h4(),e),e}function v4(){return Wu(F(s(Pe)))}s(Pe).i=function(e){return this.p2_1.i1(e,!0)==null};s(Pe).r=function(e){return this.p2_1.h2(e)};s(Pe).t=function(){return this.p2_1.q()===0};s(Pe).l=function(){return this.p2_1.q2()};s(Pe).q=function(){return this.p2_1.q()};function Pe(){}function vl(e,t){return Tu(Q(I6(t,1),3))}function hl(e,t){return al(t)+1|0}function qu(e){return Ju(8,e),e}function h4(){return qu(F(s(H1)))}function Ju(e,t){return H1.call(t,ol(e),null,new Int32Array(e),new Int32Array(vl(ut,e)),2,0),t}function e3(e){return e.r2_1.length}function d0(e){return e.u2_1.length}function d4(e){e.y2_1=e.y2_1+1|0}function Xu(e,t){zu(e,t)?f4(e,d0(e)):Ku(e,e.w2_1+t|0)}function zu(e,t){var r=e3(e)-e.w2_1|0,n=e.w2_1-e.q()|0;return r<t&&(n+r|0)>=t?n>=(e3(e)/4|0):!1}function Ku(e,t){if(t<0)throw jl("too many elements");if(t>e3(e)){var r=W1.b3(e3(e),t);e.r2_1=Fo(e.r2_1,r);var n=e,a=e.s2_1;n.s2_1=a==null?null:Fo(a,r),e.t2_1=ih(e.t2_1,r);var i=vl(ut,r);i>d0(e)&&f4(e,i)}}function Yu(e){var t=e.s2_1;if(t!=null)return t;var r=ol(e3(e));return e.s2_1=r,r}function k6(e,t){return t==null?0:Q(h1(t),-1640531527)>>>e.x2_1|0}function Qu(e){for(var t=0,r=0,n=e.s2_1;t<e.w2_1;)e.t2_1[t]>=0&&(e.r2_1[r]=e.r2_1[t],n!=null&&(n[r]=n[t]),r=r+1|0),t=t+1|0;Do(e.r2_1,r,e.w2_1),n==null||Do(n,r,e.w2_1),e.w2_1=r}function f4(e,t){d4(e),e.w2_1>e.z2_1&&Qu(e),t!==d0(e)?(e.u2_1=new Int32Array(t),e.x2_1=hl(ut,t)):ah(e.u2_1,0,0,d0(e));for(var r=0;r<e.w2_1;){var n=r;if(r=n+1|0,!ju(e,n))throw mt("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function ju(e,t){for(var r=k6(e,e.r2_1[t]),n=e.v2_1;;){var a=e.u2_1[r];if(a===0)return e.u2_1[r]=t+1|0,e.t2_1[t]=r,!0;if(n=n-1|0,n<0)return!1;var i=r;r=i-1|0,i===0&&(r=d0(e)-1|0)}}function $6(e,t){for(var r=k6(e,t),n=e.v2_1;;){var a=e.u2_1[r];if(a===0)return-1;if(a>0&&B(e.r2_1[a-1|0],t))return a-1|0;if(n=n-1|0,n<0)return-1;var i=r;r=i-1|0,i===0&&(r=d0(e)-1|0)}}function ev(e,t){e.k();e:for(;;)for(var r=k6(e,t),n=T6(Q(e.v2_1,2),d0(e)/2|0),a=0;;){var i=e.u2_1[r];if(i<=0){if(e.w2_1>=e3(e)){Xu(e,1);continue e}var o=e.w2_1;e.w2_1=o+1|0;var c=o;return e.r2_1[c]=t,e.t2_1[c]=r,e.u2_1[r]=c+1|0,e.z2_1=e.z2_1+1|0,d4(e),a>e.v2_1&&(e.v2_1=a),c}if(B(e.r2_1[i-1|0],t))return-i|0;if(a=a+1|0,a>n){f4(e,Q(d0(e),2));continue e}var l=r;r=l-1|0,l===0&&(r=d0(e)-1|0)}}function tv(e,t){e.k();var r=$6(e,t);return r<0?-1:(dl(e,r),r)}function dl(e,t){ll(e.r2_1,t),rv(e,e.t2_1[t]),e.t2_1[t]=-1,e.z2_1=e.z2_1-1|0,d4(e)}function rv(e,t){for(var r=t,n=t,a=0,i=T6(Q(e.v2_1,2),d0(e)/2|0);;){var o=r;if(r=o-1|0,o===0&&(r=d0(e)-1|0),a=a+1|0,a>e.v2_1)return e.u2_1[n]=0,y;var c=e.u2_1[r];if(c===0)return e.u2_1[n]=0,y;if(c<0)e.u2_1[n]=-1,n=r,a=0;else{var l=k6(e,e.r2_1[c-1|0]);((l-r|0)&(d0(e)-1|0))>=a&&(e.u2_1[n]=c,e.t2_1[c-1|0]=n,n=r,a=0)}if(i=i-1|0,i<0)return e.u2_1[n]=-1,y}}function nv(e,t){return e.z2_1===t.q()?e.o2(t.k1()):!1}function fl(){this.c3_1=-1640531527,this.d3_1=8,this.e3_1=2,this.f3_1=-1}var ut;function D2(e){this.g3_1=e,this.h3_1=0,this.i3_1=-1,this.j3_1=this.g3_1.y2_1,this.k3()}s(D2).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};s(D2).m=function(){return this.h3_1<this.g3_1.w2_1};s(D2).n=function(){if(this.l3(),this.i3_1===-1){var e="Call next() before removing element from the iterator.";throw mt(J0(e))}this.g3_1.k(),dl(this.g3_1,this.i3_1),this.i3_1=-1,this.j3_1=this.g3_1.y2_1};s(D2).l3=function(){if(this.g3_1.y2_1!==this.j3_1)throw E4()};function p4(e){D2.call(this,e)}s(p4).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=this.g3_1.r2_1[this.i3_1];return this.k3(),r};function vt(e){D2.call(this,e)}s(vt).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=new _5(this.g3_1,this.i3_1);return this.k3(),r};s(vt).u3=function(){if(this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=this.g3_1.r2_1[this.i3_1],n=r==null?null:h1(r),a=n??0,i=s3(this.g3_1.s2_1)[this.i3_1],o=i==null?null:h1(i),c=a^(o??0);return this.k3(),c};s(vt).v3=function(e){if(this.h3_1>=this.g3_1.w2_1)throw W2();var t=this,r=this.h3_1;this.h3_1=r+1|0,t.i3_1=r;var n=this.g3_1.r2_1[this.i3_1];B(n,this.g3_1)?e.y3("(this Map)"):e.x3(n),e.z3(61);var a=s3(this.g3_1.s2_1)[this.i3_1];B(a,this.g3_1)?e.y3("(this Map)"):e.x3(a),this.k3()};function _5(e,t){this.a4_1=e,this.b4_1=t}s(_5).l1=function(){return this.a4_1.r2_1[this.b4_1]};s(_5).m1=function(){return s3(this.a4_1.s2_1)[this.b4_1]};s(_5).equals=function(e){var t,r;return e!=null&&a1(e,$2)?r=B(e.l1(),this.l1()):r=!1,r?t=B(e.m1(),this.m1()):t=!1,t};s(_5).hashCode=function(){var e=this.l1(),t=e==null?null:h1(e),r=t??0,n=this.m1(),a=n==null?null:h1(n);return r^(a??0)};s(_5).toString=function(){return""+this.l1()+"="+this.m1()};function H1(e,t,r,n,a,i){this.r2_1=e,this.s2_1=t,this.t2_1=r,this.u2_1=n,this.v2_1=a,this.w2_1=i,this.x2_1=hl(ut,d0(this)),this.y2_1=0,this.z2_1=0,this.a3_1=!1}s(H1).q=function(){return this.z2_1};s(H1).r1=function(e){var t=$6(this,e);return t<0?null:s3(this.s2_1)[t]};s(H1).h2=function(e){return $6(this,e)>=0};s(H1).i1=function(e,t){var r=ev(this,e),n=Yu(this);if(r<0){var a=n[(-r|0)-1|0];return n[(-r|0)-1|0]=t,a}else return n[r]=t,null};s(H1).j1=function(e){var t=tv(this,e);if(t<0)return null;var r=s3(this.s2_1),n=r[t];return ll(r,t),n};s(H1).equals=function(e){var t;if(e===this)t=!0;else{var r;e!=null&&a1(e,U2)?r=nv(this,e):r=!1,t=r}return t};s(H1).hashCode=function(){for(var e=0,t=this.k2();t.m();)e=e+t.u3()|0;return e};s(H1).toString=function(){var e=ov(2+Q(this.z2_1,3)|0);e.y3("{");for(var t=0,r=this.k2();r.m();)t>0&&e.y3(", "),r.v3(e),t=t+1|0;return e.y3("}"),e.toString()};s(H1).k=function(){if(this.a3_1)throw f3()};s(H1).n2=function(e){var t=$6(this,e.l1());return t<0?!1:B(s3(this.s2_1)[t],e.m1())};s(H1).c4=function(e){return this.n2(a1(e,$2)?e:J())};s(H1).q2=function(){return new p4(this)};s(H1).k2=function(){return new vt(this)};function pl(){}function av(e){return ul(e),U6.call(e),e}function ht(){return av(F(s(U6)))}s(U6).k=function(){return this.f2_1.k()};function U6(){}function iv(e,t){return ml(t),t}function ov(e){return iv(e,F(s(q0)))}function ml(e){return q0.call(e,""),e}function m4(){return ml(F(s(q0)))}function q0(e){this.w3_1=e!==void 0?e:""}s(q0).a=function(){return this.w3_1.length};s(q0).b=function(e){var t=this.w3_1,r;if(e>=0&&e<=ds(t))r=t3(t,e);else throw v3("index: "+e+", length: "+this.a()+"}");return r};s(q0).z3=function(e){return this.w3_1=this.w3_1+H6(e),this};s(q0).j4=function(e){return this.w3_1=this.w3_1+ft(e),this};s(q0).x3=function(e){return this.w3_1=this.w3_1+ft(e),this};s(q0).y3=function(e){var t=this,r=this.w3_1;return t.w3_1=r+(e??"null"),this};s(q0).toString=function(){return this.w3_1};function Go(e){var t=H6(e).toUpperCase();return t.length>1?e:t3(t,0)}function lv(e,t,r,n,a,i){return i=i===m?!1:i,ps(e,t,r,n,a,i)}function g4(e){switch(e.length){case 0:return S0();case 1:return O6(e[0]);default:return sv(e)}}function gl(e){return e.length-1|0}function sv(e){return c4(Ih(e))}function wl(e,t){if(t==null){var r=0,n=e.length-1|0;if(r<=n)do{var a=r;if(r=r+1|0,e[a]==null)return a}while(r<=n)}else{var i=0,o=e.length-1|0;if(i<=o)do{var c=i;if(i=i+1|0,B(t,e[c]))return c}while(i<=o)}return-1}function cv(e,t){return wl(e,t)>=0}function uv(e,t,r,n,a,i,o){return t=t===m?", ":t,r=r===m?"":r,n=n===m?"":n,a=a===m?-1:a,i=i===m?"...":i,o=o===m?null:o,vv(e,m4(),t,r,n,a,i,o).toString()}function vv(e,t,r,n,a,i,o,c){r=r===m?", ":r,n=n===m?"":n,a=a===m?"":a,i=i===m?-1:i,o=o===m?"...":o,c=c===m?null:c,t.j4(n);var l=0,u=0,v=e.length;e:for(;u<v;){var d=e[u];if(u=u+1|0,l=l+1|0,l>1&&t.j4(r),i<0||l<=i)hs(t,d,c);else break e}return i>=0&&l>i&&t.j4(o),t.j4(a),t}function Al(e,t,r,n,a,i,o){return t=t===m?", ":t,r=r===m?"":r,n=n===m?"":n,a=a===m?-1:a,i=i===m?"...":i,o=o===m?null:o,hv(e,m4(),t,r,n,a,i,o).toString()}function hv(e,t,r,n,a,i,o,c){r=r===m?", ":r,n=n===m?"":n,a=a===m?"":a,i=i===m?-1:i,o=o===m?"...":o,c=c===m?null:c,t.j4(n);var l=0,u=e.l();e:for(;u.m();){var v=u.o();if(l=l+1|0,l>1&&t.j4(r),i<0||l<=i)hs(t,v,c);else break e}return i>=0&&l>i&&t.j4(o),t.j4(a),t}function _l(e){if(e.t())throw gt("List is empty.");return e.x(0)}function Zl(e,t){if(a1(t,N1)){var r=B6(e.q()+t.q()|0);return r.p(e),r.p(t),r}else{var n=c4(e);return bh(n,t),n}}function I6(e,t){return e<t?t:e}function dv(e,t){return vs.k4(e,t,-1)}function T6(e,t){return e>t?t:e}function fv(e){var t=e&65535;return t}function Wo(e){return e}function H6(e){return String.fromCharCode(e)}function El(){zr=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 zr;function qo(){return zr==null&&new El,zr}function xl(){}function i3(){}function N1(){}function $2(){}function U2(){}function dt(){}function Cl(){}var pv;function e0(e,t){this.v4_1=e,this.w4_1=t}s(e0).x4=function(){return this.v4_1};s(e0).y4=function(){return this.w4_1};s(e0).z4=function(e){return Lv(this.w4_1,e.w4_1)};s(e0).a5=function(e){return this.z4(e instanceof e0?e:J())};s(e0).equals=function(e){return this===e};s(e0).hashCode=function(){return Sv(this)};s(e0).toString=function(){return this.v4_1};function ft(e){var t=e==null?null:J0(e);return t??"null"}function mv(e){for(var t=1,r=[],n=0,a=e.length;n<a;){var i=e[n];n=n+1|0;var o=t,c=i.prototype.$imask$,l=c??i.$imask$;l!=null&&(r.push(l),o=l.length);var u=i.$metadata$.iid,v;u==null?v=null:v=gv(u);var d=v;d!=null&&(r.push(d),o=Math.max(o,d.length)),o>t&&(t=o)}return wv(t,r)}function gv(e){var t=e>>5,r=new Int32Array(t+1|0),n=e&31,a=1<<n;return r[t]=r[t]|a,r}function wv(e,t){for(var r=0,n=new Int32Array(e);r<e;){for(var a=r,i=0,o=0,c=t.length;o<c;){var l=t[o];o=o+1|0,a<l.length&&(i=i|l[a])}n[a]=i,r=r+1|0}return n}function Av(e,t){var r=t>>5;if(r>e.length)return!1;var n=t&31,a=1<<n;return!!(e[r]&a)}function o3(e,t){var r=0,n=e.length-1|0;if(r<=n)do{var a=r;r=r+1|0,e[a]=t}while(a!==n);return e}function _v(e){return new P6(e)}function P6(e){this.c5_1=e,this.b5_1=0}s(P6).m=function(){return this.b5_1!==this.c5_1.length};s(P6).o=function(){var e;if(this.b5_1!==this.c5_1.length){var t=this.b5_1;this.b5_1=t+1|0,e=this.c5_1[t]}else throw gt(""+this.b5_1);return e};function Dr(){return l3(),Ml}var Ml;function Ll(){return l3(),yl}var yl,Zv;function Kr(){return l3(),Sl}var Sl;function Vl(){return l3(),Nl}var Nl;function Ev(){return l3(),Il}var Il;function xv(e){return l3(),(e|0)===e?Dl(e):(Ll()[0]=e,Q(Kr()[Ev()],31)+Kr()[Vl()]|0)}var Jo;function l3(){Jo||(Jo=!0,Ml=new ArrayBuffer(8),yl=new Float64Array(Dr()),Zv=new Float32Array(Dr()),Sl=new Int32Array(Dr()),Ll()[0]=-1,Nl=Kr()[0]!==0?1:0,Il=1-Vl()|0)}function t3(e,t){var r;if(Tl(e)){var n=e.charCodeAt(t),a;qo();var i=0;if(n<Wo(i))a=!0;else{qo();var o=65535;a=n>Wo(o)}if(a)throw W0("Invalid Char code: "+n);r=Qv(n)}else r=e.b(t);return r}function Tl(e){return typeof e=="string"}function ke(e){var t;return Tl(e)?t=e.length:t=e.a(),t}function Cv(e){return uv(e,", ","[","]",m,m,Mv)}function Mv(e){return J0(e)}function Lv(e,t){var r;switch(typeof e){case"number":var n;typeof t=="number"?n=Xo(e,t):t instanceof k?n=Xo(e,t.f5()):n=zo(e,t),r=n;break;case"string":case"boolean":r=zo(e,t);break;default:r=yv(e,t);break}return r}function Xo(e,t){var r;if(e<t)r=-1;else if(e>t)r=1;else if(e===t){var n;if(e!==0)n=0;else{var a=1/e,i;a===1/t?i=0:a<0?i=-1:i=1,n=i}r=n}else e!==e?r=t!==t?0:1:r=-1;return r}function zo(e,t){return e<t?-1:e>t?1:0}function yv(e,t){return e.a5(t)}function Sv(e){return Yr(e)}function Yr(e){if(!("kotlinHashCodeValue$"in e)){var t=Hl(),r=new Object;r.value=t,r.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",r)}return e.kotlinHashCodeValue$}function Hl(){return Math.random()*4294967296|0}function J0(e){var t;return e==null?t="null":eh(e)?t="[...]":typeof e.toString!="function"?t=Vv(e):t=e.toString(),t}function Vv(e){return Object.prototype.toString.call(e)}function h1(e){if(e==null)return 0;var t=typeof e,r;switch(t){case"object":r=typeof e.hashCode=="function"?e.hashCode():Yr(e);break;case"function":r=Yr(e);break;case"number":r=xv(e);break;case"boolean":r=Nv(e);break;case"string":r=w4(String(e));break;case"bigint":r=Iv(e);break;case"symbol":r=Tv(e);break;default:r=function(){throw new Error("Unexpected typeof `"+t+"`")}();break}return r}function Nv(e){return e?1231:1237}function w4(e){var t=0,r=e.length,n=0,a=r-1|0;if(n<=a)do{var i=n;n=n+1|0;var o=e.charCodeAt(i);t=Q(t,31)+o|0}while(i!==a);return t}function Iv(e){for(var t=BigInt(32),r=BigInt(4294967295),n=e<0?-e:e,a=0,i=e<0?-1:1;n!=0;){var o=Number(n&r);a=Q(31,a)+o|0,n=n>>t}return Q(a,i)}function Tv(e){var t=Hv(e)?bv():Rv(),r=t.get(e);if(r!==m)return r;var n=Hl();return t.set(e,n),n}function Hv(e){return Symbol.keyFor(e)!=m}function bv(){return Fr===m&&(Fr=new Map),Fr}function Rv(){return Gr===m&&(Gr=new WeakMap),Gr}var Fr,Gr;function B(e,t){if(e==null)return t==null;if(t==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(t);if(e!==e)return t!==t;if(typeof e=="number"&&typeof t=="number"){var r;if(e===t){var n;if(e!==0)n=!0;else{var a=1/e;n=a===1/t}r=n}else r=!1;return r}return e===t}function $(e,t){Error.captureStackTrace!=null?Error.captureStackTrace(e,t):e.stack=new Error().stack}function s(e){return e.prototype}function Z1(e,t,r,n){return Object.defineProperty(e,t,{configurable:!0,get:r,set:n})}function F(e){return Object.create(e)}function bl(e,t,r){Error.call(e),Ov(e,t,r)}function Ov(e,t,r){var n=Gl(Object.getPrototypeOf(e));if(!(n&1)){var a;if(t==null){var i;if(t!==null){var o=r==null?null:r.toString();i=o??m}else i=m;a=i}else a=t;e.message=a}n&2||(e.cause=r),e.name=Object.getPrototypeOf(e).constructor.name}function s3(e){var t;return e==null?Bv():t=e,t}function Bv(){throw x4()}function J(){throw C4()}function pt(e){throw ns("lateinit property "+e+" has not been initialized")}function A4(e){throw W0(e)}function kv(e,t){for(var r=e.length,n=t.length,a=0,i=t;a<r&&a<n;){var o=a,c=a;a=c+1|0,i[o]=e[c]}return t}function $v(e,t,r){var n=e.slice(0,t);e.$type$!==void 0&&(n.$type$=e.$type$);var a=e.length;if(t>a)for(n.length=t;a<t;){var i=a;a=i+1|0,n[i]=r}return n}function Rl(){Qr=this,this.g5_1=new k(0,-2147483648),this.h5_1=new k(-1,2147483647),this.i5_1=8,this.j5_1=64}var Qr;function Uv(){return Qr==null&&new Rl,Qr}function k(e,t){Uv(),o4.call(this),this.d5_1=e,this.e5_1=t}s(k).k5=function(e){return D6(this,e)};s(k).a5=function(e){return this.k5(e instanceof k?e:J())};s(k).l5=function(e){return b6(this,e)};s(k).m5=function(e){return Dv(this,e)};s(k).n5=function(){return this.o5().l5(new k(1,0))};s(k).o5=function(){return new k(~this.d5_1,~this.e5_1)};s(k).p5=function(){return this.d5_1};s(k).f5=function(){return lt(this)};s(k).valueOf=function(){return this.f5()};s(k).equals=function(e){var t;return e instanceof k?t=D0(this,e):t=!1,t};s(k).hashCode=function(){return Wv(this)};s(k).toString=function(){return jr(this,10)};function B2(){return X(),Ol}var Ol;function N6(){return X(),Bl}var Bl;function Ko(){return X(),kl}var kl;function Pv(){return X(),$l}var $l;function d2(){return X(),Ul}var Ul;function Yo(){return X(),Pl}var Pl;function D6(e,t){if(X(),D0(e,t))return 0;var r=C0(e),n=C0(t);return r&&!n?-1:!r&&n?1:C0(ot(e,t))?-1:1}function b6(e,t){X();var r=e.e5_1>>>16|0,n=e.e5_1&65535,a=e.d5_1>>>16|0,i=e.d5_1&65535,o=t.e5_1>>>16|0,c=t.e5_1&65535,l=t.d5_1>>>16|0,u=t.d5_1&65535,v=0,d=0,h=0,p=0;return p=p+(i+u|0)|0,h=h+(p>>>16|0)|0,p=p&65535,h=h+(a+l|0)|0,d=d+(h>>>16|0)|0,h=h&65535,d=d+(n+c|0)|0,v=v+(d>>>16|0)|0,d=d&65535,v=v+(r+o|0)|0,v=v&65535,new k(h<<16|p,v<<16|d)}function ot(e,t){return X(),b6(e,t.n5())}function $e(e,t){if(X(),A5(e))return B2();if(A5(t))return B2();if(D0(e,d2()))return Qo(t)?d2():B2();if(D0(t,d2()))return Qo(e)?d2():B2();if(C0(e)){var r;return C0(t)?r=$e(j1(e),j1(t)):r=j1($e(j1(e),t)),r}else if(C0(t))return j1($e(e,j1(t)));if(jo(e,Yo())&&jo(t,Yo()))return st(lt(e)*lt(t));var n=e.e5_1>>>16|0,a=e.e5_1&65535,i=e.d5_1>>>16|0,o=e.d5_1&65535,c=t.e5_1>>>16|0,l=t.e5_1&65535,u=t.d5_1>>>16|0,v=t.d5_1&65535,d=0,h=0,p=0,_=0;return _=_+Q(o,v)|0,p=p+(_>>>16|0)|0,_=_&65535,p=p+Q(i,v)|0,h=h+(p>>>16|0)|0,p=p&65535,p=p+Q(o,u)|0,h=h+(p>>>16|0)|0,p=p&65535,h=h+Q(a,v)|0,d=d+(h>>>16|0)|0,h=h&65535,h=h+Q(i,u)|0,d=d+(h>>>16|0)|0,h=h&65535,h=h+Q(o,l)|0,d=d+(h>>>16|0)|0,h=h&65535,d=d+(((Q(n,v)+Q(a,u)|0)+Q(i,l)|0)+Q(o,c)|0)|0,d=d&65535,new k(p<<16|_,d<<16|h)}function Dv(e,t){if(X(),A5(t))throw Z4("division by zero");if(A5(e))return B2();if(D0(e,d2())){if(D0(t,N6())||D0(t,Ko()))return d2();if(D0(t,d2()))return N6();var r=Gv(e,1),n=Fv(r.m5(t),1);if(D0(n,B2()))return C0(t)?N6():Ko();var a=ot(e,$e(t,n));return b6(n,a.m5(t))}else if(D0(t,d2()))return B2();if(C0(e)){var i;return C0(t)?i=j1(e).m5(j1(t)):i=j1(j1(e).m5(t)),i}else if(C0(t))return j1(e.m5(j1(t)));for(var o=B2(),c=e;Jv(c,t);){for(var l=lt(c)/lt(t),u=Math.max(1,Math.floor(l)),v=Math.ceil(Math.log(u)/Math.LN2),d=v<=48?1:Math.pow(2,v-48),h=st(u),p=$e(h,t);C0(p)||qv(p,c);)u=u-d,h=st(u),p=$e(h,t);A5(h)&&(h=N6()),o=b6(o,h),c=ot(c,p)}return o}function Fv(e,t){X();var r=t&63;return r===0?e:r<32?new k(e.d5_1<<r,e.e5_1<<r|(e.d5_1>>>(32-r|0)|0)):new k(0,e.d5_1<<(r-32|0))}function Gv(e,t){X();var r=t&63;return r===0?e:r<32?new k(e.d5_1>>>r|0|e.e5_1<<(32-r|0),e.e5_1>>r):new k(e.e5_1>>(r-32|0),e.e5_1>=0?0:-1)}function lt(e){return X(),e.e5_1*4294967296+Xv(e)}function D0(e,t){return X(),e.e5_1===t.e5_1?e.d5_1===t.d5_1:!1}function Wv(e){return X(),e.d5_1^e.e5_1}function jr(e,t){if(X(),t<2||36<t)throw Z4("radix out of range: "+t);if(A5(e))return"0";if(C0(e))if(D0(e,d2())){var r=it(t),n=e.m5(r),a=ot($e(n,r),e).p5(),i=jr(n,t);return i+a.toString(t)}else return"-"+jr(j1(e),t);for(var o=t===2?31:t<=10?9:t<=21?7:t<=35?6:5,c=st(Math.pow(t,o)),l=e,u="";;){var v=l.m5(c),d=ot(l,$e(v,c)).p5(),h=d.toString(t);if(l=v,A5(l))return h+u;for(;h.length<o;)h="0"+h;u=h+u}}function it(e){return X(),new k(e,e<0?-1:0)}function C0(e){return X(),e.e5_1<0}function A5(e){return X(),e.e5_1===0?e.d5_1===0:!1}function Qo(e){return X(),(e.d5_1&1)===1}function j1(e){return X(),e.n5()}function jo(e,t){return X(),D6(e,t)<0}function st(e){if(X(),Iu(e))return B2();if(e<=-9223372036854776e3)return d2();if(e+1>=9223372036854776e3)return Pv();if(e<0)return j1(st(-e));var t=4294967296,r=e%t|0,n=e/t|0;return new k(r,n)}function qv(e,t){return X(),D6(e,t)>0}function Jv(e,t){return X(),D6(e,t)>=0}function Xv(e){return X(),e.d5_1>=0?e.d5_1:4294967296+e.d5_1}var el;function X(){el||(el=!0,Ol=it(0),Bl=it(1),kl=it(-1),$l=new k(-1,2147483647),Ul=new k(0,-2147483648),Pl=it(16777216))}function Z(e,t,r,n,a){return _4("class",e,t,r,n,a,null)}function _4(e,t,r,n,a,i,o){var c=m;return{kind:e,simpleName:t,associatedObjectKey:n,associatedObjects:a,suspendArity:i,$kClass$:c,defaultConstructor:r,iid:o}}function w(e,t,r,n,a,i,o,c,l){n!=null&&(e.prototype=Object.create(n.prototype),e.prototype.constructor=e);var u=r(t,i,o,c,l??[]);if(e.$metadata$=u,a!=null){var v=u.iid!=null?e:e.prototype;v.$imask$=mv(a)}}function F2(e,t,r,n,a){return _4("interface",e,t,r,n,a,zv())}function zv(){return at===m&&(at=0),at=at+1|0,at}var at;function x1(e,t,r,n,a){return _4("object",e,t,r,n,a,null)}function c3(e){var t=e.length,r=Array(t),n=0,a=t-1|0;if(n<=a)do{var i=n;n=n+1|0;var o=e[i];o!=null&&r3(o)?r[i]=o:r[i]=[].slice.call(o)}while(i!==a);return[].concat.apply([],r)}function Dl(e){var t;return e instanceof k?t=e.p5():t=Kv(e),t}function Kv(e){var t;return e>2147483647?t=2147483647:e<-2147483648?t=-2147483648:t=e|0,t}function Yv(e){return e<<16>>16}function Qv(e){var t=Dl(e),r=Yv(t);return fv(r)}function jv(e,t){return new Ue(e,t)}function eh(e){return Fl(e)?!0:Jr(e)}function Fl(e){return Array.isArray(e)}function a1(e,t){return th(e,t.$metadata$.iid)}function th(e,t){var r=e.$imask$,n;if(r==null)return!1;n=r;var a=n;return Av(a,t)}function r3(e){var t;return Fl(e)?t=!e.$type$:t=!1,t}function rh(e){return typeof e=="string"?!0:a1(e,i4)}function Gl(e){var t=e.constructor,r=t==null?null:t.$metadata$,n=r==null?null:r.errorInfo;if(n!=null)return n;var a=0;if(tl(e,"message")&&(a=a|1),tl(e,"cause")&&(a=a|2),a!==3){var i=nh(e);i!=Error.prototype&&(a=a|Gl(i))}return r!=null&&(r.errorInfo=a),a}function tl(e,t){return e.hasOwnProperty(t)}function nh(e){return Object.getPrototypeOf(e)}var m;function ah(e,t,r,n){r=r===m?0:r,n=n===m?e.length:n,W1.h(r,n,e.length),e.fill(t,r,n)}function Wr(e,t,r,n){r=r===m?0:r,n=n===m?e.length:n,W1.h(r,n,e.length),e.fill(t,r,n)}function Wl(e){return new _1(e)}function ih(e,t){if(!(t>=0)){var r="Invalid new array size: "+t+".";throw W0(J0(r))}return kv(e,new Int32Array(t))}function oh(e,t){if(!(t>=0)){var r="Invalid new array size: "+t+".";throw W0(J0(r))}return $v(e,t,null)}function ql(e){return bl(e),G2.call(e),e}function Jl(){var e=ql(F(s(G2)));return $(e,Jl),e}function Xl(e,t){return bl(t,e),G2.call(t),t}function Z4(e){var t=Xl(e,F(s(G2)));return $(t,Z4),t}function G2(){$(this,G2)}function lh(e){return X0(e),u3.call(e),e}function zl(){var e=lh(F(s(u3)));return $(e,zl),e}function sh(e,t){return Z5(e,t),u3.call(t),t}function W0(e){var t=sh(e,F(s(u3)));return $(t,W0),t}function u3(){$(this,u3)}function ch(e){return X0(e),h3.call(e),e}function Kl(){var e=ch(F(s(h3)));return $(e,Kl),e}function uh(e,t){return Z5(e,t),h3.call(t),t}function v3(e){var t=uh(e,F(s(h3)));return $(t,v3),t}function h3(){$(this,h3)}function vh(e){return X0(e),d3.call(e),e}function Yl(){var e=vh(F(s(d3)));return $(e,Yl),e}function hh(e,t){return Z5(e,t),d3.call(t),t}function mt(e){var t=hh(e,F(s(d3)));return $(t,mt),t}function d3(){$(this,d3)}function dh(e){return X0(e),F6.call(e),e}function f3(){var e=dh(F(s(F6)));return $(e,f3),e}function F6(){$(this,F6)}function X0(e){return ql(e),k1.call(e),e}function Ql(){var e=X0(F(s(k1)));return $(e,Ql),e}function Z5(e,t){return Xl(e,t),k1.call(t),t}function jl(e){var t=Z5(e,F(s(k1)));return $(t,jl),t}function k1(){$(this,k1)}function fh(e){return X0(e),p3.call(e),e}function W2(){var e=fh(F(s(p3)));return $(e,W2),e}function ph(e,t){return Z5(e,t),p3.call(t),t}function gt(e){var t=ph(e,F(s(p3)));return $(t,gt),t}function p3(){$(this,p3)}function mh(e){return X0(e),G6.call(e),e}function E4(){var e=mh(F(s(G6)));return $(e,E4),e}function G6(){$(this,G6)}function gh(e){return X0(e),m3.call(e),e}function es(){var e=gh(F(s(m3)));return $(e,es),e}function wh(e,t){return Z5(e,t),m3.call(t),t}function ts(e){var t=wh(e,F(s(m3)));return $(t,ts),t}function m3(){$(this,m3)}function Ah(e){return X0(e),W6.call(e),e}function x4(){var e=Ah(F(s(W6)));return $(e,x4),e}function W6(){$(this,W6)}function _h(e){return X0(e),q6.call(e),e}function C4(){var e=_h(F(s(q6)));return $(e,C4),e}function q6(){$(this,q6)}function Zh(e){return X0(e),g3.call(e),e}function rs(){var e=Zh(F(s(g3)));return $(e,rs),e}function Eh(e,t){return Z5(e,t),g3.call(t),t}function ns(e){var t=Eh(e,F(s(g3)));return $(t,ns),t}function g3(){$(this,g3)}function xh(e){return function(t){return t===e?"(this Collection)":ft(t)}}function P2(){}s(P2).r=function(e){var t;e:{var r;if(a1(this,N1)?r=this.t():r=!1,r){t=!1;break e}for(var n=this.l();n.m();){var a=n.o();if(B(a,e)){t=!0;break e}}t=!1}return t};s(P2).s=function(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o();if(!this.r(a)){t=!1;break e}}t=!0}return t};s(P2).t=function(){return this.q()===0};s(P2).toString=function(){return Al(this,", ","[","]",m,m,xh(this))};s(P2).toArray=function(){return il(this)};function De(){this.g_1=2147483639}s(De).y1=function(e,t){if(e<0||e>=t)throw v3("index: "+e+", size: "+t)};s(De).z1=function(e,t){if(e<0||e>t)throw v3("index: "+e+", size: "+t)};s(De).h=function(e,t,r){if(e<0||t>r)throw v3("fromIndex: "+e+", toIndex: "+t+", size: "+r);if(e>t)throw W0("fromIndex: "+e+" > toIndex: "+t)};s(De).b3=function(e,t){var r=e+(e>>1)|0;return(r-t|0)<0&&(r=t),(r-2147483639|0)>0&&(r=t>2147483639?s4.MAX_VALUE:2147483639),r};s(De).d1=function(e){for(var t=1,r=e.l();r.m();){var n=r.o(),a=Q(31,t),i=n==null?null:h1(n);t=a+(i??0)|0}return t};s(De).c1=function(e,t){if(e.q()!==t.q())return!1;for(var r=t.l(),n=e.l();n.m();){var a=n.o(),i=r.o();if(!B(a,i))return!1}return!0};var W1;function rl(e,t){return t===e?"(this Map)":ft(t)}function as(e,t){var r;e:{for(var n=e.k1().l();n.m();){var a=n.o();if(B(a.l1(),t)){r=a;break e}}r=null}return r}function is(){}var Ch;function Mh(e){return function(t){return e.s5(t)}}function L0(){this.n1_1=null,this.o1_1=null}s(L0).p1=function(e){return as(this,e)!=null};s(L0).q1=function(e){if(!(e!=null&&a1(e,$2)))return!1;var t=e.l1(),r=e.m1(),n=(a1(this,U2)?this:J()).r1(t);if(!B(r,n))return!1;var a;return n==null?a=!(a1(this,U2)?this:J()).p1(t):a=!1,!a};s(L0).equals=function(e){if(e===this)return!0;if(!(e!=null&&a1(e,U2))||this.q()!==e.q())return!1;var t;e:{var r=e.k1(),n;if(a1(r,N1)?n=r.t():n=!1,n){t=!0;break e}for(var a=r.l();a.m();){var i=a.o();if(!this.q1(i)){t=!1;break e}}t=!0}return t};s(L0).r1=function(e){var t=as(this,e);return t==null?null:t.m1()};s(L0).hashCode=function(){return h1(this.k1())};s(L0).q=function(){return this.k1().q()};s(L0).toString=function(){var e=this.k1();return Al(e,", ","{","}",m,m,Mh(this))};s(L0).s5=function(e){return rl(this,e.l1())+"="+rl(this,e.m1())};function J6(){}s(J6).t1=function(e){for(var t=0,r=e.l();r.m();){var n=r.o(),a=t,i=n==null?null:h1(n);t=a+(i??0)|0}return t};s(J6).s1=function(e,t){return e.q()!==t.q()?!1:e.s(t)};var M4;function Lh(e){return M0.call(e),i1.call(e),e.v5_1=L4().x5_1,e}function wt(){return Lh(F(s(i1)))}function At(e,t){if(t<0)throw mt("Deque is too big.");if(t<=e.v5_1.length)return y;if(e.v5_1===L4().x5_1){var r=e,n=I6(t,10);return r.v5_1=o3(Array(n),null),y}var a=W1.b3(e.v5_1.length,t);yh(e,a)}function yh(e,t){var r=o3(Array(t),null),n=e.v5_1,a=e.u5_1,i=e.v5_1.length;R(n,r,0,a,i);var o=e.v5_1,c=e.v5_1.length-e.u5_1|0,l=e.u5_1;R(o,r,c,0,l),e.u5_1=0,e.v5_1=r}function f0(e,t){return t>=e.v5_1.length?t-e.v5_1.length|0:t}function Sh(e,t){return t<0?t+e.v5_1.length|0:t}function os(e,t){return t===gl(e.v5_1)?0:t+1|0}function e4(e,t){return t===0?gl(e.v5_1):t-1|0}function t4(e,t,r){var n=r.l(),a=t,i=e.v5_1.length;if(a<i)e:do{var o=a;if(a=a+1|0,!n.m())break e;e.v5_1[o]=n.o()}while(a<i);var c=0,l=e.u5_1;if(c<l)e:do{var u=c;if(c=c+1|0,!n.m())break e;e.v5_1[u]=n.o()}while(c<l);e.w5_1=e.w5_1+r.q()|0}function ls(){r4=this;var e=this;e.x5_1=[],this.y5_1=10}var r4;function L4(){return r4==null&&new ls,r4}s(i1).q=function(){return this.w5_1};s(i1).t=function(){return this.w5_1===0};s(i1).z5=function(e){At(this,this.w5_1+1|0),this.u5_1=e4(this,this.u5_1),this.v5_1[this.u5_1]=e,this.w5_1=this.w5_1+1|0};s(i1).a6=function(e){At(this,this.w5_1+1|0);var t=this.v5_1,r=this.w5_1;t[f0(this,this.u5_1+r|0)]=e,this.w5_1=this.w5_1+1|0};s(i1).b6=function(){if(this.t())throw gt("ArrayDeque is empty.");var e=this.u5_1,t=this.v5_1[e],r=t==null||t!=null?t:J();return this.v5_1[this.u5_1]=null,this.u5_1=os(this,this.u5_1),this.w5_1=this.w5_1-1|0,r};s(i1).c6=function(){if(this.t())throw gt("ArrayDeque is empty.");var e=R6(this),t=f0(this,this.u5_1+e|0),r=this.v5_1[t],n=r==null||r!=null?r:J();return this.v5_1[t]=null,this.w5_1=this.w5_1-1|0,n};s(i1).i=function(e){return this.a6(e),!0};s(i1).a1=function(e,t){if(W1.z1(e,this.w5_1),e===this.w5_1)return this.a6(t),y;if(e===0)return this.z5(t),y;At(this,this.w5_1+1|0);var r=f0(this,this.u5_1+e|0);if(e<(this.w5_1+1|0)>>1){var n=e4(this,r),a=e4(this,this.u5_1);if(n>=this.u5_1){this.v5_1[a]=this.v5_1[this.u5_1];var i=this.v5_1,o=this.v5_1,c=this.u5_1,l=this.u5_1+1|0,u=n+1|0;R(i,o,c,l,u)}else{var v=this.v5_1,d=this.v5_1,h=this.u5_1-1|0,p=this.u5_1,_=this.v5_1.length;R(v,d,h,p,_),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var C=this.v5_1,I=this.v5_1,m1=n+1|0;R(C,I,0,1,m1)}this.v5_1[n]=t,this.u5_1=a}else{var g1=this.w5_1,F1=f0(this,this.u5_1+g1|0);if(r<F1){var r0=this.v5_1,g2=this.v5_1,t2=r+1|0;R(r0,g2,t2,r,F1)}else{var r2=this.v5_1,T0=this.v5_1;R(r2,T0,1,0,F1),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var w2=this.v5_1,A2=this.v5_1,n2=r+1|0,Ke=this.v5_1.length-1|0;R(w2,A2,n2,r,Ke)}this.v5_1[r]=t}this.w5_1=this.w5_1+1|0};s(i1).p=function(e){if(e.t())return!1;At(this,this.w5_1+e.q()|0);var t=this.w5_1,r=f0(this,this.u5_1+t|0);return t4(this,r,e),!0};s(i1).d6=function(e,t){if(W1.z1(e,this.w5_1),t.t())return!1;if(e===this.w5_1)return this.p(t);At(this,this.w5_1+t.q()|0);var r=this.w5_1,n=f0(this,this.u5_1+r|0),a=f0(this,this.u5_1+e|0),i=t.q();if(e<(this.w5_1+1|0)>>1){var o=this.u5_1-i|0;if(a>=this.u5_1)if(o>=0){var c=this.v5_1,l=this.v5_1,u=o,v=this.u5_1;R(c,l,u,v,a)}else{o=o+this.v5_1.length|0;var d=a-this.u5_1|0,h=this.v5_1.length-o|0;if(h>=d){var p=this.v5_1,_=this.v5_1,C=o,I=this.u5_1;R(p,_,C,I,a)}else{var m1=this.v5_1,g1=this.v5_1,F1=o,r0=this.u5_1,g2=this.u5_1+h|0;R(m1,g1,F1,r0,g2);var t2=this.v5_1,r2=this.v5_1,T0=this.u5_1+h|0;R(t2,r2,0,T0,a)}}else{var w2=this.v5_1,A2=this.v5_1,n2=o,Ke=this.u5_1,H5=this.v5_1.length;if(R(w2,A2,n2,Ke,H5),i>=a){var b5=this.v5_1,R5=this.v5_1,s9=this.v5_1.length-i|0;R(b5,R5,s9,0,a)}else{var c9=this.v5_1,u9=this.v5_1,v9=this.v5_1.length-i|0;R(c9,u9,v9,0,i);var h9=this.v5_1,d9=this.v5_1;R(h9,d9,0,i,a)}}this.u5_1=o,t4(this,Sh(this,a-i|0),t)}else{var Ye=a+i|0;if(a<n)if((n+i|0)<=this.v5_1.length){var f9=this.v5_1,p9=this.v5_1;R(f9,p9,Ye,a,n)}else if(Ye>=this.v5_1.length){var m9=this.v5_1,g9=this.v5_1,w9=Ye-this.v5_1.length|0;R(m9,g9,w9,a,n)}else{var dn=(n+i|0)-this.v5_1.length|0,A9=this.v5_1,_9=this.v5_1,Z9=n-dn|0;R(A9,_9,0,Z9,n);var E9=this.v5_1,x9=this.v5_1,C9=n-dn|0;R(E9,x9,Ye,a,C9)}else{var M9=this.v5_1,L9=this.v5_1;if(R(M9,L9,i,0,n),Ye>=this.v5_1.length){var y9=this.v5_1,S9=this.v5_1,V9=Ye-this.v5_1.length|0,N9=this.v5_1.length;R(y9,S9,V9,a,N9)}else{var I9=this.v5_1,T9=this.v5_1,H9=this.v5_1.length-i|0,b9=this.v5_1.length;R(I9,T9,0,H9,b9);var R9=this.v5_1,O9=this.v5_1,B9=this.v5_1.length-i|0;R(R9,O9,Ye,a,B9)}}t4(this,a,t)}return!0};s(i1).x=function(e){W1.y1(e,this.w5_1);var t=f0(this,this.u5_1+e|0),r=this.v5_1[t];return r==null||r!=null?r:J()};s(i1).r=function(e){return this.b1(e)!==-1};s(i1).b1=function(e){var t=this.w5_1,r=f0(this,this.u5_1+t|0);if(this.u5_1<r){var n=this.u5_1;if(n<r)do{var a=n;if(n=n+1|0,B(e,this.v5_1[a]))return a-this.u5_1|0}while(n<r)}else if(this.u5_1>=r){var i=this.u5_1,o=this.v5_1.length;if(i<o)do{var c=i;if(i=i+1|0,B(e,this.v5_1[c]))return c-this.u5_1|0}while(i<o);var l=0;if(l<r)do{var u=l;if(l=l+1|0,B(e,this.v5_1[u]))return(u+this.v5_1.length|0)-this.u5_1|0}while(l<r)}return-1};s(i1).j=function(e){var t=this.b1(e);return t===-1?!1:(this.z(t),!0)};s(i1).z=function(e){if(W1.y1(e,this.w5_1),e===R6(this))return this.c6();if(e===0)return this.b6();var t=f0(this,this.u5_1+e|0),r=this.v5_1[t],n=r==null||r!=null?r:J();if(e<this.w5_1>>1){if(t>=this.u5_1){var a=this.v5_1,i=this.v5_1,o=this.u5_1+1|0,c=this.u5_1;R(a,i,o,c,t)}else{var l=this.v5_1,u=this.v5_1;R(l,u,1,0,t),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var v=this.v5_1,d=this.v5_1,h=this.u5_1+1|0,p=this.u5_1,_=this.v5_1.length-1|0;R(v,d,h,p,_)}this.v5_1[this.u5_1]=null,this.u5_1=os(this,this.u5_1)}else{var C=R6(this),I=f0(this,this.u5_1+C|0);if(t<=I){var m1=this.v5_1,g1=this.v5_1,F1=t+1|0,r0=I+1|0;R(m1,g1,t,F1,r0)}else{var g2=this.v5_1,t2=this.v5_1,r2=t+1|0,T0=this.v5_1.length;R(g2,t2,t,r2,T0),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var w2=this.v5_1,A2=this.v5_1,n2=I+1|0;R(w2,A2,0,1,n2)}this.v5_1[I]=null}return this.w5_1=this.w5_1-1|0,n};s(i1).e6=function(){var e=this.w5_1,t=f0(this,this.u5_1+e|0);this.u5_1<t?Wr(this.v5_1,null,this.u5_1,t):this.t()||(Wr(this.v5_1,null,this.u5_1,this.v5_1.length),Wr(this.v5_1,null,0,t)),this.u5_1=0,this.w5_1=0};s(i1).f6=function(e){var t=e.length>=this.w5_1?e:bu(e,this.w5_1),r=r3(t)?t:J(),n=this.w5_1,a=f0(this,this.u5_1+n|0);if(this.u5_1<a){var i=this.v5_1,o=this.u5_1;R(i,r,0,o,a)}else if(!this.t()){var c=this.v5_1,l=this.u5_1,u=this.v5_1.length;R(c,r,0,l,u);var v=this.v5_1,d=this.v5_1.length-this.u5_1|0;R(v,r,d,0,a)}var h=Hu(this.w5_1,r);return r3(h)?h:J()};s(i1).a2=function(){var e=this.w5_1,t=o3(Array(e),null);return this.f6(t)};s(i1).toArray=function(){return this.a2()};function i1(){L4(),this.u5_1=0,this.w5_1=0}function Vh(e){if(e.t())return[];for(var t=e.q(),r=o3(Array(t),null),n=e.l(),a=0;n.m();){var i=a;a=i+1|0,r[i]=n.o()}return r}function S0(){return Nh()}function ss(e){return e.length>0?Wl(e):S0()}function R6(e){return e.q()-1|0}function z0(){n4=this,this.g6_1=new k(-1478467534,-1720727600)}s(z0).equals=function(e){var t;return e!=null&&a1(e,i3)?t=e.t():t=!1,t};s(z0).hashCode=function(){return 1};s(z0).toString=function(){return"[]"};s(z0).q=function(){return 0};s(z0).t=function(){return!0};s(z0).h6=function(e){return e.t()};s(z0).s=function(e){return this.h6(e)};s(z0).x=function(e){throw v3("Empty list doesn't contain element at index "+e+".")};s(z0).l=function(){return cs};var n4;function Nh(){return n4==null&&new z0,n4}function X6(){}s(X6).m=function(){return!1};s(X6).o=function(){throw W2()};var cs;function Ih(e){return new q2(e,!1)}function Th(e){return e.length===0?q1():c4(new q2(e,!0))}function q2(e,t){this.i6_1=e,this.j6_1=t}s(q2).q=function(){return this.i6_1.length};s(q2).t=function(){return this.i6_1.length===0};s(q2).k6=function(e){return cv(this.i6_1,e)};s(q2).l6=function(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o();if(!this.k6(a)){t=!1;break e}}t=!0}return t};s(q2).s=function(e){return this.l6(e)};s(q2).l=function(){return _v(this.i6_1)};function Hh(){throw ts("Index overflow has happened.")}function y4(e,t){return e.p(Wl(t))}function bh(e,t){if(a1(t,N1))return e.p(t);for(var r=!1,n=t.l();n.m();){var a=n.o();e.i(a)&&(r=!0)}return r}function z6(){}s(z6).o=function(){return this.m6()};function Rh(e,t,r){var n;if(r>0)n=e>=t?t:t-nl(t,e,r)|0;else if(r<0)n=e<=t?t:t+nl(e,t,-r|0)|0;else throw W0("Step is zero.");return n}function nl(e,t,r){return qr(qr(e,r)-qr(t,r)|0,r)}function qr(e,t){var r=e%t|0;return r>=0?r:r+t|0}function us(){a4=this,this.n6_1=new Ue(1,0)}var a4;function Oh(){return a4==null&&new us,a4}function Ue(e,t){Oh(),f2.call(this,e,t,1)}s(Ue).t=function(){return this.r6_1>this.s6_1};s(Ue).equals=function(e){var t;return e instanceof Ue?t=this.t()&&e.t()?!0:this.r6_1===e.r6_1?this.s6_1===e.s6_1:!1:t=!1,t};s(Ue).hashCode=function(){return this.t()?-1:Q(31,this.r6_1)+this.s6_1|0};s(Ue).toString=function(){return""+this.r6_1+".."+this.s6_1};function K6(e,t,r){z6.call(this),this.u6_1=r,this.v6_1=t,this.w6_1=this.u6_1>0?e<=t:e>=t,this.x6_1=this.w6_1?e:this.v6_1}s(K6).m=function(){return this.w6_1};s(K6).m6=function(){var e=this.x6_1;if(e===this.v6_1){if(!this.w6_1)throw W2();this.w6_1=!1}else this.x6_1=this.x6_1+this.u6_1|0;return e};function S4(){}s(S4).k4=function(e,t,r){return new f2(e,t,r)};var vs;function f2(e,t,r){if(r===0)throw W0("Step must be non-zero.");if(r===s4.MIN_VALUE)throw W0("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.r6_1=e,this.s6_1=Rh(e,t,r),this.t6_1=r}s(f2).l=function(){return new K6(this.r6_1,this.s6_1,this.t6_1)};s(f2).t=function(){return this.t6_1>0?this.r6_1>this.s6_1:this.r6_1<this.s6_1};s(f2).equals=function(e){var t;return e instanceof f2?t=this.t()&&e.t()?!0:this.r6_1===e.r6_1&&this.s6_1===e.s6_1?this.t6_1===e.t6_1:!1:t=!1,t};s(f2).hashCode=function(){return this.t()?-1:Q(31,Q(31,this.r6_1)+this.s6_1|0)+this.t6_1|0};s(f2).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 hs(e,t,r){r!=null?e.j4(r(t)):t==null||rh(t)?e.j4(t):t instanceof xl?e.z3(t.y6_1):e.j4(ft(t))}function Bh(e,t,r){if(r=r===m?!1:r,e===t)return!0;if(!r)return!1;var n=Go(e),a=Go(t),i;if(n===a)i=!0;else{var o=H6(n).toLowerCase(),c=t3(o,0),l=H6(a).toLowerCase();i=c===t3(l,0)}return i}function ds(e){return ke(e)-1|0}function V4(e,t,r){r=r===m?!1:r;var n;return typeof t=="string"?n=kh(e,t,m,r)>=0:n=fs(e,t,0,ke(e),r)>=0,n}function kh(e,t,r,n){r=r===m?0:r,n=n===m?!1:n;var a,i;return n?i=!0:i=typeof e!="string",i?a=fs(e,t,r,ke(e),n):a=e.indexOf(t,r),a}function fs(e,t,r,n,a,i){i=i===m?!1:i;var o=i?dv(T6(r,ds(e)),I6(n,0)):jv(I6(r,0),T6(n,ke(e))),c;if(typeof e=="string"?c=typeof t=="string":c=!1,c){var l=o.r6_1,u=o.s6_1,v=o.t6_1;if(v>0&&l<=u||v<0&&u<=l)do{var d=l;if(l=l+v|0,lv(t,0,e,d,ke(t),a))return d}while(d!==u)}else{var h=o.r6_1,p=o.s6_1,_=o.t6_1;if(_>0&&h<=p||_<0&&p<=h)do{var C=h;if(h=h+_|0,ps(t,0,e,C,ke(t),a))return C}while(C!==p)}return-1}function ps(e,t,r,n,a,i){if(n<0||t<0||t>(ke(e)-a|0)||n>(ke(r)-a|0))return!1;var o=0;if(o<a)do{var c=o;if(o=o+1|0,!Bh(t3(e,t+c|0),t3(r,n+c|0),i))return!1}while(o<a);return!0}function V1(e,t){this.z6_1=e,this.a7_1=t}s(V1).toString=function(){return"("+this.z6_1+", "+this.a7_1+")"};s(V1).b7=function(){return this.z6_1};s(V1).c7=function(){return this.a7_1};s(V1).hashCode=function(){var e=this.z6_1==null?0:h1(this.z6_1);return e=Q(e,31)+(this.a7_1==null?0:h1(this.a7_1))|0,e};s(V1).equals=function(e){if(this===e)return!0;if(!(e instanceof V1))return!1;var t=e instanceof V1?e:J();return!(!B(this.z6_1,t.z6_1)||!B(this.a7_1,t.a7_1))};function ms(e,t){return new V1(e,t)}s(H1).o2=Nu;y=new l4;s4=new n3;ut=new fl;pv=new Cl;W1=new De;Ch=new is;M4=new J6;cs=new X6;vs=new S4;var J2=Math.imul;w(T4,"OneAtATimeAssembler",Z);w(H4,"AllAtOnceAssembler",Z);w($1,"SubscribeCallbackParams",Z);w(p0,"Mode",Z,e0);w(E5,"Callback",Z);w(R4,m,Z);w(I1,"DispatcherImpl",Z);w(U1,"EmptyOptions",Z,m,m,U1);w(o1,"DispatcherSnapshot",Z);w(C1,"EventScope",Z,e0);w(O4,"NoOpUnsubscriber",x1);w(w3,"BaseTrace",Z);w(Ct,"ErrorInfo",Z);w(Is,"PerformanceAnalyticsDelegate",F2);w(Zt,"NoOpPerformanceAnalyticsDelegate",Z,m,[Is],Zt);w(Mt,"RuntimeTrace",Z,w3);w(We,"Disabled",x1);w(Lt,"NiceLogger",Z);w(Ge,"NoOpLogger",Z,m,m,Ge);w(B4,"IntervalEventDeduper",Z);w(k4,"LocalEventsDeduper",Z);w(J1,"TimerDefinition",Z);w(a7,"Span",Z);w($4,"Tracer",x1);w(i7,"JsDispatcherImpl",Z,I1);w(o7,"JsRequestBuilderAdapter",Z);w(Et,"JsonStateOperations",Z,m,m,Et);function T4(e,t){this.d7_1=e,this.e7_1=t}s(T4).f7=function(e,t){var r;if(e.t())r=S0();else{for(var n=this.e7_1.list(),a=e.b6();_s(a);){for(var i=0,o=n.length;i<o;){var c=n[i];if(i=i+1|0,c.id===a.hook)return this.d7_1.h7([""+t+" building batch of ",a]),O6(a)}if(!e.t())a=e.b6();else return S0()}this.d7_1.h7([""+t+" building batch of ",a]),r=O6(a)}return r};function H4(e,t){this.i7_1=e,this.j7_1=t}s(H4).f7=function(e,t){var r;if(e.t())r=S0();else{for(var n=this.j7_1.list(),a=q1(),i=e.l();i.m();){var o=i.o(),c;if(_s(o)){var l;if(n.length===0)l=!1;else{var u;e:{for(var v=0,d=n.length;v<d;){var h=n[v];if(v=v+1|0,h.id===o.hook){u=h;break e}}u=null}l=u!=null}c=l}else c=!0;c&&a.i(o)}var p=a;e.e6(),this.i7_1.h7([""+t+" building batch of ",p]),r=p}return r};function _s(e){var t=e.hook;return(t==null?null:V4(t,"useInterval"))===!0}function $1(e,t,r){this.request=e,this.response=t,this.mode=r}s($1).k7=function(){return this.request};s($1).l7=function(){return this.response};s($1).m7=function(){return this.mode};s($1).b7=function(){return this.request};s($1).c7=function(){return this.response};s($1).n7=function(){return this.mode};s($1).o7=function(e,t,r){return new $1(e,t,r)};s($1).copy=function(e,t,r,n){return e=e===m?this.request:e,t=t===m?this.response:t,r=r===m?this.mode:r,this.o7(e,t,r)};s($1).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};s($1).hashCode=function(){var e=this.request==null?0:h1(this.request);return e=J2(e,31)+(this.response==null?0:h1(this.response))|0,e=J2(e,31)+this.mode.hashCode()|0,e};s($1).equals=function(e){if(this===e)return!0;if(!(e instanceof $1))return!1;var t=e instanceof $1?e:J();return!(!B(this.request,t.request)||!B(this.response,t.response)||!this.mode.equals(t.mode))};var Zs,Es,xs;function $h(){return[p2(),_t(),m2()]}function Uh(e){switch(e){case"SYNC":return p2();case"ASYNC":return _t();case"SPEC":return m2();default:Q6(),A4("No enum constant value.");break}}var gs;function Q6(){if(gs)return y;gs=!0,Zs=new p0("SYNC",0),Es=new p0("ASYNC",1),xs=new p0("SPEC",2)}function p0(e,t){e0.call(this,e,t)}function p2(){return Q6(),Zs}function _t(){return Q6(),Es}function m2(){return Q6(),xs}function E5(e,t){this.r7_1=e,this.s7_1=t}s(E5).toString=function(){return"Callback(success="+this.r7_1+", failure="+this.s7_1+")"};s(E5).hashCode=function(){var e=h1(this.r7_1);return e=J2(e,31)+h1(this.s7_1)|0,e};s(E5).equals=function(e){if(this===e)return!0;if(!(e instanceof E5))return!1;var t=e instanceof E5?e:J();return!(!B(this.r7_1,t.r7_1)||!B(this.s7_1,t.s7_1))};function N4(e){var t=e.b8_1;if(t!=null)return t;pt("assembler")}function x5(e){var t=e.i8_1;if(t!=null)return t;pt("local")}function xt(e){var t=e.j8_1;if(t!=null)return t;pt("remote")}function j6(e){var t=e.k8_1;if(t!=null)return t;pt("timers")}function Cs(e){Ms(e),e.p8_1=!0,e.y7_1.h7(["recalculateSpeculativeWork"]);var t=e.c8_1.l(),r=0;e:for(;t.m();){var n=r;r=r+1|0;var a=t.o();if(n===0||a.retry===!0||a.async===!0||a.scope.equals(Fe()))continue e;if(e.e8_1.w5_1>10)break e;e.e8_1.i(a)}e.y7_1.h7(["Speculative queue size: "+e.e8_1.w5_1]),e7(e,e.e8_1)}function b4(e){e.y7_1.h7(["cancelSpeculation"]),e.p8_1=!1,Ms(e)}function Ms(e){e.e8_1.e6(),e.m8_1=e.v7_1.clone(e.state),e.n8_1=e.n8_1+1|0}function I4(e,t,r){if(t.t())return y;var n=_l(t),a=n.scope.equals(Fe())?!0:td(n.scope)?!x5(e).isReady():!1;r.equals(p2())&&(e.f8_1=!0);var i=e.u7_1.q8(r.equals(m2())?e.m8_1:e.state,t),o=a?xt(e):x5(e),c=e.z7_1;e.z7_1=c+1|0;var l=c,u=e.n8_1,v=bs.r8("runtime_trace"),d=qh(e,r,a,v,t,l,u,i),h=new E5(d,Xh(e,r,a,v,l,t));e.g8_1.i1(l,h),e.y7_1.h7(["Signpost: Handling "+Y6(e,r,a)+" request"]),e7(e,i),o.handle(e.w7_1,i,h.r7_1,h.s7_1)}function Y6(e,t,r){return(r?"remote":"local")+" "+t+" runtime"}function Ls(e,t){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(),x5(e).reset(),xt(e).reset(),b4(e),t&&j6(e).clear()}function C5(e,t,r){var n;try{n=r()}catch(o){var a;if(o instanceof G2){var i=o;e.y7_1.s8([i]),e.x7_1.errorHandler(i),a=t}else throw o;n=a}return n}function e7(e,t){e.x7_1.featureFlags.isVerboseLoggingEnabled&&e.y7_1.h7([t])}function Ph(e){return function(){return x5(e).isReady()}}function Dh(e){return function(t){var r,n;e:{for(var a=e.c8_1.l();a.m();){var i=a.o();if(i.hook===t){n=i;break e}}n=null}if(n!=null)r=!0;else{var o;e:{for(var c=e.d8_1.l();c.m();){var l=c.o();if(l.hook===t){o=l;break e}}o=null}r=o!=null}return r}}function Fh(e,t,r,n){return function(){e.y7_1.h7(["Signpost: Initializing Dispatcher",t,r]),e.i8_1=t,e.j8_1=r,e.k8_1=n;var a=e,i;return e.x7_1.featureFlags.isUsingEverythingAssembler?i=new H4(e.y7_1,n):i=new T4(e.y7_1,n),a.b8_1=i,e.t8(),y}}function R4(e,t){this.u8_1=e,this.v8_1=t}s(R4).unsubscribe=function(){this.u8_1.h8_1.j(this.v8_1)};function Gh(e,t){return function(){var r=typeof e=="function"?e:J();return t.h8_1.i(r),new R4(t,r)}}function Wh(e,t,r,n,a,i,o,c,l){return function(){e.y7_1.h7(["Signpost: Response success for "+Y6(e,t,r)+" request"]),e7(e,n),a.z8(),rd(e.x7_1.performanceAnalyticsDelegate,a,r,"",i.q()),e.g8_1.j1(o);var u;if(t.equals(m2())&&e.n8_1!==c)return e.y7_1.h7(["throwing away stale speculative results"]),y;var v;t.equals(p2())?(e.state=e.v7_1.merge(e.state,n.state),e.f8_1=!1,v=y):t.equals(m2())&&(e.m8_1=e.v7_1.merge(e.m8_1,n.state),v=y),e.y7_1.h7(["Responding to "+Y6(e,t,r)+" runtime result subscriptions"]);for(var d=e.h8_1.l();d.m();){var h=d.o();h(new $1(l,n,t))}e.a9(g4(n.replay),t);var p;return t.equals(p2())&&e.o8_1&&(Cs(e),p=y),e.t8(),y}}function qh(e,t,r,n,a,i,o,c){return function(l){return C5(e,y,Wh(e,t,r,l,n,a,i,o,c)),y}}function Jh(e,t,r,n,a,i,o){return function(){e.y7_1.h7(["Signpost: Response error for "+Y6(e,t,r)+" request",n]),a.z8();var c=e.x7_1.performanceAnalyticsDelegate,l=n.message;nd(c,l??"Request Response Error"+(" with a duration of "+a.b9()+"ms"),r,""),e.g8_1.j1(i);var u;t.equals(p2())&&(e.f8_1=!1,u=y);var v;if(t.equals(m2()))return b4(e),e.t8(),y;for(var d=o,h=ht(),p=d.l();p.m();){var _=p.o(),C=_.scope.equals(Fe())?!1:_.retry!==!0,I=h.r1(C),m1;if(I==null){var g1=q1();h.i1(C,g1),m1=g1}else m1=I;var F1=m1;F1.i(_)}var r0=h,g2,t2=r0.r1(!1);if(!(t2==null||t2.t())){var r2=r0.r1(!1),T0=r2??S0(),w2=a3(T0);e.y7_1.h7(c3([["unretryable events",n],w2])),g2=e.x7_1.errorHandler(n)}var A2,n2=r0.r1(!0);if(!(n2==null||n2.t())){var Ke=r0.r1(!0);if(Ke!=null)for(var H5=Ke.l();H5.m();){var b5=H5.o();b5.retry=!0,b5.scope=Fe()}var R5=r0.r1(!0);e.a9(R5??S0(),t),t.equals(p2())&&e.o8_1&&Cs(e),e.t8(),A2=y}return y}}function Xh(e,t,r,n,a,i){return function(o){return C5(e,y,Jh(e,t,r,o,n,a,i)),y}}function zh(e,t){return function(){e.y7_1.h7(c3([["Signpost: Submitted events"],t]));for(var r=e.a8_1,n=g4(t),a=r.l();a.m();){var i=a.o(),o=n;n=i.c9(o)}for(var c=n,l=q1(),u=q1(),v=c.l();v.m();){var d=v.o();d.async===!0?l.i(d):u.i(d)}var h=new V1(l,u),p=h.b7(),_=h.c7();e.d8_1.p(p),e.c8_1.p(_);var C;return e.f8_1&&e.p8_1&&(e.e8_1.p(_),C=y),e.t8(),y}}function Kh(e){return function(){return Ls(e,!0),y}}function Yh(e,t){return function(){e.state=e.v7_1.clone(t.state),e.d8_1.e6();var r=t.asyncQueue;y4(e.d8_1,r3(r)?r:J()),e.c8_1.e6();var n=t.syncQueue;return y4(e.c8_1,r3(n)?n:J()),b4(e),x5(e).resume(t.localSnapshot),xt(e).resume(t.remoteSnapshot),j6(e).resumeAll(t.timerSnapshot),y}}function I1(e,t,r,n,a){n=n===m?"RenderPostContent":n,a=a===m?new U1:a,this.t7_1=e,this.u7_1=t,this.v7_1=r,this.w7_1=n,this.x7_1=a,this.y7_1=new Lt(this.x7_1.logger),this.z7_1=0;var i=this,o=new k4(Ph(this),this.y7_1);i.a8_1=ss([o,new B4(Dh(this))]),this.c8_1=wt(),this.d8_1=wt(),this.e8_1=wt(),this.f8_1=!1;var c=this;c.g8_1=ht();var l=this;l.h8_1=q1(),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"])}s(I1).d9=function(e){this.t7_1=e};s(I1).e9=function(){return this.t7_1};s(I1).f9=function(){return this.c8_1};s(I1).g9=function(){return this.d8_1};s(I1).h9=function(){return this.e8_1};s(I1).init=function(e,t,r){C5(this,y,Fh(this,e,t,r))};s(I1).subscribe=function(e){var t=Ns;return C5(this,t,Gh(e,this))};s(I1).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]),!x5(this).isReady()&&!xt(this).isReady()&&!(this.c8_1.t()&&this.d8_1.t()))return this.y7_1.i9(["ticking with events and no runtime, deferring..."]),y;if(this.f8_1){if(this.p8_1){var t=N4(this).f7(this.e8_1,m2());I4(this,t,m2())}}else{var e=N4(this).f7(this.c8_1,p2());I4(this,e,p2())}if(!this.d8_1.t()){for(;!this.d8_1.t();){var r=N4(this).f7(this.d8_1,_t());I4(this,r,_t())}this.t8()}};s(I1).a9=function(e,t){if(e.t()||t.equals(m2()))return y;this.y7_1.h7(["replaying "+e.q()+" events"]),e7(this,e);for(var r=ht(),n=e.l();n.m();){var a=n.o(),i=new V1(a.async===!0,a.retry===!0),o=r.r1(i),c;if(o==null){var l=q1();r.i1(i,l),c=l}else c=o;var u=c;u.i(a)}var v=r,d=v.r1(new V1(!0,!0));this.d8_1.d6(0,d??S0());var h=v.r1(new V1(!0,!1));this.d8_1.p(h??S0());var p=v.r1(new V1(!1,!0));this.c8_1.d6(0,p??S0());var _=v.r1(new V1(!1,!1));this.c8_1.p(_??S0())};s(I1).submit=function(e){C5(this,y,zh(this,e))};s(I1).reset=function(){C5(this,y,Kh(this))};s(I1).snapshot=function(){var e=this.v7_1.clone(this.state),t=this.c8_1,r=a3(t),n=this.d8_1,a=a3(n);return new o1(e,r,a,x5(this).snapshot(),xt(this).snapshot(),j6(this).list())};s(I1).pause=function(){var e=this.snapshot();return j6(this).pauseAll(),Ls(this,!1),e};s(I1).resume=function(e){C5(this,y,Yh(this,e))};function Qh(e){return y}function U1(){this.j9_1=new Ge;var e=this;e.k9_1=Qh,this.l9_1=Hs,this.m9_1=new Zt}s(U1).n9=function(e){this.j9_1=e};s(U1).o9=function(){return this.j9_1};s(U1).p9=function(e){this.k9_1=e};s(U1).q9=function(){return this.k9_1};s(U1).r9=function(e){this.l9_1=e};s(U1).s9=function(){return this.l9_1};s(U1).t9=function(e){this.m9_1=e};s(U1).u9=function(){return this.m9_1};function o1(e,t,r,n,a,i){this.state=e,this.syncQueue=t,this.asyncQueue=r,this.localSnapshot=n,this.remoteSnapshot=a,this.timerSnapshot=i}s(o1).e9=function(){return this.state};s(o1).f9=function(){return this.syncQueue};s(o1).g9=function(){return this.asyncQueue};s(o1).v9=function(){return this.localSnapshot};s(o1).w9=function(){return this.remoteSnapshot};s(o1).x9=function(){return this.timerSnapshot};s(o1).b7=function(){return this.state};s(o1).c7=function(){return this.syncQueue};s(o1).n7=function(){return this.asyncQueue};s(o1).y9=function(){return this.localSnapshot};s(o1).z9=function(){return this.remoteSnapshot};s(o1).aa=function(){return this.timerSnapshot};s(o1).ba=function(e,t,r,n,a,i){return new o1(e,t,r,n,a,i)};s(o1).copy=function(e,t,r,n,a,i,o){return e=e===m?this.state:e,t=t===m?this.syncQueue:t,r=r===m?this.asyncQueue:r,n=n===m?this.localSnapshot:n,a=a===m?this.remoteSnapshot:a,i=i===m?this.timerSnapshot:i,this.ba(e,t,r,n,a,i)};s(o1).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+J0(this.syncQueue)+", asyncQueue="+J0(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};s(o1).hashCode=function(){var e=this.state==null?0:h1(this.state);return e=J2(e,31)+h1(this.syncQueue)|0,e=J2(e,31)+h1(this.asyncQueue)|0,e=J2(e,31)+(this.localSnapshot==null?0:h1(this.localSnapshot))|0,e=J2(e,31)+(this.remoteSnapshot==null?0:h1(this.remoteSnapshot))|0,e=J2(e,31)+(this.timerSnapshot==null?0:h1(this.timerSnapshot))|0,e};s(o1).equals=function(e){if(this===e)return!0;if(!(e instanceof o1))return!1;var t=e instanceof o1?e:J();return!(!B(this.state,t.state)||!B(this.syncQueue,t.syncQueue)||!B(this.asyncQueue,t.asyncQueue)||!B(this.localSnapshot,t.localSnapshot)||!B(this.remoteSnapshot,t.remoteSnapshot)||!B(this.timerSnapshot,t.timerSnapshot))};var ys,Ss,Vs;function jh(){return[r7(),n7(),Fe()]}function ed(e){switch(e){case"ALL":return r7();case"LOCAL":return n7();case"REMOTE":return Fe();default:t7(),A4("No enum constant value.");break}}var ws;function t7(){if(ws)return y;ws=!0,ys=new C1("ALL",0),Ss=new C1("LOCAL",1),Vs=new C1("REMOTE",2)}function C1(e,t){e0.call(this,e,t)}function td(e){return e.equals(Fe())?!0:e.equals(r7())}function r7(){return t7(),ys}function n7(){return t7(),Ss}function Fe(){return t7(),Vs}function O4(){}s(O4).unsubscribe=function(){};var Ns;function w3(e,t,r){this.spanName=e,this.startTimeMs=t,this.endTimeMs=r}s(w3).ea=function(){return this.spanName};s(w3).fa=function(){return this.startTimeMs};s(w3).ga=function(){return this.endTimeMs};function Ct(e,t,r){this.message=e,this.origin=t,this.version=r}s(Ct).q5=function(){return this.message};s(Ct).ha=function(){return this.origin};s(Ct).ia=function(){return this.version};function Is(){}function Zt(){}s(Zt).logRuntimeTrace=function(e){};s(Zt).logRuntimeError=function(e){};function rd(e,t,r,n,a){e.logRuntimeTrace(new Mt(t.w8_1,t.x8_1,t.y8_1,n,Ts(r),a))}function nd(e,t,r,n){e.logRuntimeError(new Ct(t,Ts(r),n))}function Ts(e){return e?"remote":"local"}function Mt(e,t,r,n,a,i){w3.call(this,e,t,r),this.intent=n,this.target=a,this.eventCount=i}s(Mt).ja=function(){return this.intent};s(Mt).ka=function(){return this.target};s(Mt).la=function(){return this.eventCount};function We(){this.ma_1=!1,this.na_1=!1,this.oa_1=!1}s(We).pa=function(){return this.ma_1};s(We).qa=function(){return this.na_1};s(We).ra=function(){return this.oa_1};var Hs;function Lt(e){this.g7_1=e}s(Lt).s8=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.error(t)};s(Lt).i9=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.warn(t)};s(Lt).h7=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.debug(t)};function Ge(){}s(Ge).info=function(e){};s(Ge).error=function(e){};s(Ge).warn=function(e){};s(Ge).debug=function(e){};s(Ge).tag=function(){return""};function B4(e){this.sa_1=e}s(B4).c9=function(e){for(var t=q1(),r=q1(),n=e.l();n.m();){var a=n.o(),i=a.hook;(i==null?null:V4(i,"useInterval"))===!0?t.i(a):r.i(a)}for(var o=new V1(t,r),c=o.b7(),l=o.c7(),u=v4(),v=q1(),d=c.l();d.m();){var h=d.o(),p=h.hook;u.i(p)&&v.i(h)}for(var _=v,C=q1(),I=_.l();I.m();){var m1=I.o(),g1=m1.hook;this.sa_1(g1??"")||C.i(m1)}var F1=C;return Zl(F1,l)};function k4(e,t){this.ta_1=e,this.ua_1=t}s(k4).c9=function(e){var t;if(this.ta_1())t=e;else{for(var r=q1(),n=q1(),a=e.l();a.m();){var i=a.o();i.scope.equals(n7())?n.i(i):r.i(i)}var o=new V1(r,n);if(!o.a7_1.t()){var c=["Dropping "+o.a7_1.q()+" local events",o.a7_1];this.ua_1.h7([c])}t=o.z6_1}return t};function J1(e,t){this.id=e,this.duration=t}s(J1).va=function(){return this.id};s(J1).wa=function(){return this.duration};s(J1).b7=function(){return this.id};s(J1).c7=function(){return this.duration};s(J1).xa=function(e,t){return new J1(e,t)};s(J1).copy=function(e,t,r){return e=e===m?this.id:e,t=t===m?this.duration:t,this.xa(e,t)};s(J1).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};s(J1).hashCode=function(){var e=w4(this.id);return e=J2(e,31)+this.duration|0,e};s(J1).equals=function(e){if(this===e)return!0;if(!(e instanceof J1))return!1;var t=e instanceof J1?e:J();return!(this.id!==t.id||this.duration!==t.duration)};function a7(e,t){this.w8_1=e,this.x8_1=t,this.y8_1=0}s(a7).z8=function(){this.y8_1=Rs()};s(a7).b9=function(){return this.y8_1-this.x8_1};function $4(){}s($4).r8=function(e){return new a7(e,Rs())};var bs;function i7(e,t,r,n){r=r===m?"RenderPostContent":r,n=n===m?new U1:n,I1.call(this,e,new o7(t),new Et,r,n),this.vb_1=r,this.wb_1=n}function o7(e){this.xb_1=e}s(o7).yb=function(e,t){var r=a3(t);return this.xb_1.build(e,r)};s(o7).q8=function(e,t){return this.yb(e!=null&&e!=null?e:J(),t)};function As(e){for(var t=Object.entries,r=(t!=null&&typeof t=="function"?t:J())(e),n=B6(r.length),a=0,i=r.length;a<i;){var o=r[a];a=a+1|0;var c=o[0],l=ms(c!=null&&typeof c=="string"?c:J(),o[1]);n.i(l)}return n}function Et(){}s(Et).clone=function(e){return JSON.parse(JSON.stringify(e))};s(Et).merge=function(e,t){for(var r={},n=r!=null&&r!=null?r:J(),a=As(e).l();a.m();){var i=a.o();n[i.z6_1]=i.a7_1}for(var o=As(t).l();o.m();){var c=o.o();n[c.z6_1]=c.a7_1}return n};function Rs(){return new Date().getTime()}Z1(s(p0),"name",s(p0).x4);Z1(s(p0),"ordinal",s(p0).y4);Z1(s(I1),"state",function(){return this.e9()},function(e){this.d9(e)});Z1(s(U1),"logger",function(){return this.o9()},function(e){this.n9(e)});Z1(s(U1),"errorHandler",function(){return this.q9()},function(e){this.p9(e)});Z1(s(U1),"featureFlags",function(){return this.s9()},function(e){this.r9(e)});Z1(s(U1),"performanceAnalyticsDelegate",function(){return this.u9()},function(e){this.t9(e)});Z1(s(C1),"name",s(C1).x4);Z1(s(C1),"ordinal",s(C1).y4);Z1(s(We),"isSpeculativeExecutionEnabled",function(){return this.pa()});Z1(s(We),"isVerboseLoggingEnabled",function(){return this.qa()});Z1(s(We),"isUsingEverythingAssembler",function(){return this.ra()});Z1(s(i7),"state",function(){return this.e9()},function(e){this.d9(e)});Ns=new O4;Hs=new We;bs=new $4;p0.values=$h;p0.valueOf=Uh;Z1(p0,"SYNC",p2);Z1(p0,"ASYNC",_t);Z1(p0,"SPEC",m2);C1.values=jh;C1.valueOf=ed;Z1(C1,"ALL",r7);Z1(C1,"LOCAL",n7);Z1(C1,"REMOTE",Fe);var ad=e=>{switch(e){case n1.ALL:return C1.ALL;case n1.REMOTE:return C1.REMOTE;case n1.LOCAL:return C1.LOCAL;case n1.UNRECOGNIZED:return C1.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},V0=class{constructor(t){this.scope=t.scope?ad(t.scope):C1.ALL,this.async=t.async,this.hook=t.hook,this.retry=t.retry,this.uiEvent=t}},l7=class{constructor(t){this.uiRequest=t,this.events=t.events.map(r=>new V0(r)),t.state&&(this.state=t.state)}},yt=class{constructor(t){this.uiResponse=t,this.replay=t.events.map(r=>new V0(r)),t.state&&(this.state=t.state)}};function Os(){var a,i;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(a=globalThis.devvit).debug??(a.debug={});let t={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},r={};for(let o in t)r[o.toLowerCase()]=o;let n=[...e.searchParams].find(([o])=>o.toLowerCase()==="devvitdebug")?.[1];if(n!=null){n===""&&(n=Object.keys(t).filter(o=>o!=="emitSnapshots"&&o!=="emitState").join());for(let o of n.split(",")??[]){let[c,l]=o.split("=");c&&(c.toLowerCase()in r?c=r[c.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${c}"`),(i=globalThis.devvit.debug)[c]??(i[c]=l||"true"),console.info(`[devvit] set devvitdebug ${c}=${globalThis.devvit.debug[c]}`))}}}var q=s1(w1(),1);var U4=s1(Er(),1),M5=s1(w1(),1);function Bs(){return{seconds:0,nanos:0}}var K0={$type:"google.protobuf.Timestamp",encode(e,t=M5.default.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let r=e instanceof M5.default.Reader?e:M5.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Bs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.seconds=id(r.int64());continue;case 2:if(i!==16)break;a.nanos=r.int32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{seconds:ks(e.seconds)?globalThis.Number(e.seconds):0,nanos:ks(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==0&&(t.seconds=Math.round(e.seconds)),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return K0.fromPartial(e??{})},fromPartial(e){let t=Bs();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};g.set(K0.$type,K0);function id(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}M5.default.util.Long!==U4.default&&(M5.default.util.Long=U4.default,M5.default.configure());function ks(e){return e!=null}var d1;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.VERBOSE=4]="VERBOSE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(d1||(d1={}));function od(e){switch(e){case 0:case"DEBUG":return d1.DEBUG;case 1:case"INFO":return d1.INFO;case 2:case"WARN":return d1.WARN;case 3:case"ERROR":return d1.ERROR;case 4:case"VERBOSE":return d1.VERBOSE;case-1:case"UNRECOGNIZED":default:return d1.UNRECOGNIZED}}function ld(e){switch(e){case d1.DEBUG:return 0;case d1.INFO:return 1;case d1.WARN:return 2;case d1.ERROR:return 3;case d1.VERBOSE:return 4;case d1.UNRECOGNIZED:default:return-1}}function $s(){return{message:"",name:"",fileName:void 0,lineNumber:void 0,columnNumber:void 0,stack:void 0,timestamp:void 0,tags:[]}}var P4={$type:"devvit.plugin.logger.LogErrorMessage",encode(e,t=q.default.Writer.create()){e.message!==""&&t.uint32(10).string(e.message),e.name!==""&&t.uint32(18).string(e.name),e.fileName!==void 0&&U0.encode({value:e.fileName},t.uint32(26).fork()).ldelim(),e.lineNumber!==void 0&&oe.encode({value:e.lineNumber},t.uint32(34).fork()).ldelim(),e.columnNumber!==void 0&&oe.encode({value:e.columnNumber},t.uint32(42).fork()).ldelim(),e.stack!==void 0&&U0.encode({value:e.stack},t.uint32(50).fork()).ldelim(),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(58).fork()).ldelim();for(let r of e.tags)t.uint32(66).string(r);return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=$s();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.message=r.string();continue;case 2:if(i!==18)break;a.name=r.string();continue;case 3:if(i!==26)break;a.fileName=U0.decode(r,r.uint32()).value;continue;case 4:if(i!==34)break;a.lineNumber=oe.decode(r,r.uint32()).value;continue;case 5:if(i!==42)break;a.columnNumber=oe.decode(r,r.uint32()).value;continue;case 6:if(i!==50)break;a.stack=U0.decode(r,r.uint32()).value;continue;case 7:if(i!==58)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 8:if(i!==66)break;a.tags.push(r.string());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{message:P1(e.message)?globalThis.String(e.message):"",name:P1(e.name)?globalThis.String(e.name):"",fileName:P1(e.fileName)?String(e.fileName):void 0,lineNumber:P1(e.lineNumber)?Number(e.lineNumber):void 0,columnNumber:P1(e.columnNumber)?Number(e.columnNumber):void 0,stack:P1(e.stack)?String(e.stack):void 0,timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.message!==""&&(t.message=e.message),e.name!==""&&(t.name=e.name),e.fileName!==void 0&&(t.fileName=e.fileName),e.lineNumber!==void 0&&(t.lineNumber=e.lineNumber),e.columnNumber!==void 0&&(t.columnNumber=e.columnNumber),e.stack!==void 0&&(t.stack=e.stack),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.tags?.length&&(t.tags=e.tags),t},create(e){return P4.fromPartial(e??{})},fromPartial(e){let t=$s();return t.message=e.message??"",t.name=e.name??"",t.fileName=e.fileName??void 0,t.lineNumber=e.lineNumber??void 0,t.columnNumber=e.columnNumber??void 0,t.stack=e.stack??void 0,t.timestamp=e.timestamp??void 0,t.tags=e.tags?.map(r=>r)||[],t}};g.set(P4.$type,P4);function Us(){return{type:"",timestamp:void 0,labels:{},data:{}}}var D4={$type:"devvit.plugin.logger.LogEventMessage",encode(e,t=q.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(18).fork()).ldelim(),Object.entries(e.labels).forEach(([r,n])=>{St.encode({key:r,value:n},t.uint32(26).fork()).ldelim()}),Object.entries(e.data).forEach(([r,n])=>{Vt.encode({key:r,value:n},t.uint32(34).fork()).ldelim()}),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Us();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.type=r.string();continue;case 2:if(i!==18)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 3:if(i!==26)break;let o=St.decode(r,r.uint32());o.value!==void 0&&(a.labels[o.key]=o.value);continue;case 4:if(i!==34)break;let c=Vt.decode(r,r.uint32());c.value!==void 0&&(a.data[c.key]=c.value);continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{type:P1(e.type)?globalThis.String(e.type):"",timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,labels:Xs(e.labels)?Object.entries(e.labels).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{},data:Xs(e.data)?Object.entries(e.data).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.type!==""&&(t.type=e.type),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.labels){let r=Object.entries(e.labels);r.length>0&&(t.labels={},r.forEach(([n,a])=>{t.labels[n]=a}))}if(e.data){let r=Object.entries(e.data);r.length>0&&(t.data={},r.forEach(([n,a])=>{t.data[n]=a}))}return t},create(e){return D4.fromPartial(e??{})},fromPartial(e){let t=Us();return t.type=e.type??"",t.timestamp=e.timestamp??void 0,t.labels=Object.entries(e.labels??{}).reduce((r,[n,a])=>(a!==void 0&&(r[n]=globalThis.String(a)),r),{}),t.data=Object.entries(e.data??{}).reduce((r,[n,a])=>(a!==void 0&&(r[n]=globalThis.String(a)),r),{}),t}};g.set(D4.$type,D4);function Ps(){return{key:"",value:""}}var St={$type:"devvit.plugin.logger.LogEventMessage.LabelsEntry",encode(e,t=q.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ps();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=r.string();continue;case 2:if(i!==18)break;a.value=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{key:P1(e.key)?globalThis.String(e.key):"",value:P1(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return St.fromPartial(e??{})},fromPartial(e){let t=Ps();return t.key=e.key??"",t.value=e.value??"",t}};g.set(St.$type,St);function Ds(){return{key:"",value:""}}var Vt={$type:"devvit.plugin.logger.LogEventMessage.DataEntry",encode(e,t=q.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ds();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=r.string();continue;case 2:if(i!==18)break;a.value=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{key:P1(e.key)?globalThis.String(e.key):"",value:P1(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return Vt.fromPartial(e??{})},fromPartial(e){let t=Ds();return t.key=e.key??"",t.value=e.value??"",t}};g.set(Vt.$type,Vt);function Fs(){return{severity:0,message:"",timestamp:void 0,tags:[]}}var t0={$type:"devvit.plugin.logger.LogMessage",encode(e,t=q.default.Writer.create()){e.severity!==0&&t.uint32(8).int32(e.severity),e.message!==""&&t.uint32(18).string(e.message),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(26).fork()).ldelim();for(let r of e.tags)t.uint32(34).string(r);return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Fs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.severity=r.int32();continue;case 2:if(i!==18)break;a.message=r.string();continue;case 3:if(i!==26)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 4:if(i!==34)break;a.tags.push(r.string());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{severity:P1(e.severity)?od(e.severity):0,message:P1(e.message)?globalThis.String(e.message):"",timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.severity!==0&&(t.severity=ld(e.severity)),e.message!==""&&(t.message=e.message),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.tags?.length&&(t.tags=e.tags),t},create(e){return t0.fromPartial(e??{})},fromPartial(e){let t=Fs();return t.severity=e.severity??0,t.message=e.message??"",t.timestamp=e.timestamp??void 0,t.tags=e.tags?.map(r=>r)||[],t}};g.set(t0.$type,t0);function Gs(){return{messages:[]}}var F4={$type:"devvit.plugin.logger.LogMessages",encode(e,t=q.default.Writer.create()){for(let r of e.messages)t0.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Gs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.messages.push(t0.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{messages:globalThis.Array.isArray(e?.messages)?e.messages.map(t=>t0.fromJSON(t)):[]}},toJSON(e){let t={};return e.messages?.length&&(t.messages=e.messages.map(r=>t0.toJSON(r))),t},create(e){return F4.fromPartial(e??{})},fromPartial(e){let t=Gs();return t.messages=e.messages?.map(r=>t0.fromPartial(r))||[],t}};g.set(F4.$type,F4);function Ws(){return{}}var G4={$type:"devvit.plugin.logger.LogErrorResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ws();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return G4.fromPartial(e??{})},fromPartial(e){return Ws()}};g.set(G4.$type,G4);function qs(){return{}}var W4={$type:"devvit.plugin.logger.LogEventResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=qs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return W4.fromPartial(e??{})},fromPartial(e){return qs()}};g.set(W4.$type,W4);function Js(){return{}}var q4={$type:"devvit.plugin.logger.LogResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Js();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return q4.fromPartial(e??{})},fromPartial(e){return Js()}};g.set(q4.$type,q4);function J4(e){let t=Math.trunc(e.getTime()/1e3),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}function s7(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function X4(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):s7(K0.fromJSON(e))}function Xs(e){return typeof e=="object"&&e!==null}function P1(e){return e!=null}var Y0;(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"})(Y0||(Y0={}));var N0;(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"})(N0||(N0={}));function zs(e){return e.hostname.split(".")[1]??e.hostname}var D1=s1(w1(),1);function Ks(){return{callState:void 0,connect:void 0}}var z4={$type:"devvit.cli.PlaytestProviderMessage",encode(e,t=D1.default.Writer.create()){return e.callState!==void 0&&Je.encode(e.callState,t.uint32(10).fork()).ldelim(),e.connect!==void 0&&Xe.encode(e.connect,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ks();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.callState=Je.decode(r,r.uint32());continue;case 2:if(i!==18)break;a.connect=Xe.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{callState:c7(e.callState)?Je.fromJSON(e.callState):void 0,connect:c7(e.connect)?Xe.fromJSON(e.connect):void 0}},toJSON(e){let t={};return e.callState!==void 0&&(t.callState=Je.toJSON(e.callState)),e.connect!==void 0&&(t.connect=Xe.toJSON(e.connect)),t},create(e){return z4.fromPartial(e??{})},fromPartial(e){let t=Ks();return t.callState=e.callState!==void 0&&e.callState!==null?Je.fromPartial(e.callState):void 0,t.connect=e.connect!==void 0&&e.connect!==null?Xe.fromPartial(e.connect):void 0,t}};g.set(z4.$type,z4);function Ys(){return{appInstalled:void 0}}var Nt={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,t=D1.default.Writer.create()){return e.appInstalled!==void 0&&qe.encode(e.appInstalled,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ys();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.appInstalled=qe.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{appInstalled:c7(e.appInstalled)?qe.fromJSON(e.appInstalled):void 0}},toJSON(e){let t={};return e.appInstalled!==void 0&&(t.appInstalled=qe.toJSON(e.appInstalled)),t},create(e){return Nt.fromPartial(e??{})},fromPartial(e){let t=Ys();return t.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?qe.fromPartial(e.appInstalled):void 0,t}};g.set(Nt.$type,Nt);function Qs(){return{}}var qe={$type:"devvit.cli.PlaytestAppInstalled",encode(e,t=D1.default.Writer.create()){return t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Qs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return qe.fromPartial(e??{})},fromPartial(e){return Qs()}};g.set(qe.$type,qe);function js(){return{logs:[]}}var Je={$type:"devvit.cli.PlaytestCallState",encode(e,t=D1.default.Writer.create()){for(let r of e.logs)t0.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=js();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.logs.push(t0.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(t=>t0.fromJSON(t)):[]}},toJSON(e){let t={};return e.logs?.length&&(t.logs=e.logs.map(r=>t0.toJSON(r))),t},create(e){return Je.fromPartial(e??{})},fromPartial(e){let t=js();return t.logs=e.logs?.map(r=>t0.fromPartial(r))||[],t}};g.set(Je.$type,Je);function e9(){return{url:""}}var Xe={$type:"devvit.cli.PlaytestConnect",encode(e,t=D1.default.Writer.create()){return e.url!==""&&t.uint32(10).string(e.url),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=e9();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.url=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{url:c7(e.url)?globalThis.String(e.url):""}},toJSON(e){let t={};return e.url!==""&&(t.url=e.url),t},create(e){return Xe.fromPartial(e??{})},fromPartial(e){let t=e9();return t.url=e.url??"",t}};g.set(Xe.$type,Xe);function c7(e){return e!=null}var K4="playtest",t9="ws://localhost:5678";function r9(e){let t=Y4();return t===""||t===e}function Y4(){return globalThis.location?new URL(location.href).searchParams.get(K4)??void 0:void 0}var p1=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},It=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},Tt,f1,Q4,n9,j4,en,tn,rn,sd=15e3,u7=class{constructor(){Tt.add(this),f1.set(this,{type:"Init"}),j4.set(this,()=>{p1(this,f1,"f").type==="Opened"&&this.onState?.("Closed"),It(this,f1,p1(this,Tt,"m",n9).call(this),"f")}),en.set(this,t=>{let r=Nt.fromJSON(JSON.parse(t.data));switch(!0){case r.appInstalled!=null:this.onState?.("Reloading");break}}),tn.set(this,()=>{if(p1(this,f1,"f").type!=="Opening")throw Error(`invalid transition from ${p1(this,f1,"f").type}`);this.onState?.("Opened"),It(this,f1,{sock:p1(this,f1,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),rn.set(this,()=>{It(this,f1,p1(this,Tt,"m",Q4).call(this),"f")})}close(){"timer"in p1(this,f1,"f")&&clearTimeout(p1(this,f1,"f").timer),"sock"in p1(this,f1,"f")&&(p1(this,f1,"f").sock.onopen=null,p1(this,f1,"f").sock.onmessage=null,p1(this,f1,"f").sock.onclose=null,p1(this,f1,"f").sock.close()),It(this,f1,{type:"Init"},"f")}open(){p1(this,f1,"f").type==="Init"&&It(this,f1,p1(this,Tt,"m",Q4).call(this),"f")}send(t){"sock"in p1(this,f1,"f")?p1(this,f1,"f").sock.send(JSON.stringify(t)):console.warn("devvit playtest message dropped",t)}};f1=new WeakMap,j4=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,Tt=new WeakSet,Q4=function(){let t=new WebSocket(t9);return t.onclose=p1(this,j4,"f"),t.onmessage=p1(this,en,"f"),t.onopen=p1(this,tn,"f"),{sock:t,type:"Opening"}},n9=function(){return{timer:setTimeout(p1(this,rn,"f"),sd),type:"Retrying"}};var r1=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},E=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Q0,v7,h7,l1,A3,Ht,bt,d7,L5,j0,X2,_3,E3,z2,nn,Rt,f7,an,a9,Z3,p7,on,cd={debug:d1.DEBUG,error:d1.ERROR,info:d1.INFO,log:d1.DEBUG,trace:d1.DEBUG,warn:d1.WARN},m7=class{constructor(t,r,n,a){Q0.add(this),v7.set(this,void 0),h7.set(this,void 0),l1.set(this,void 0),A3.set(this,!1),Ht.set(this,!1),bt.set(this,!1),d7.set(this,0),L5.set(this,void 0),j0.set(this,{}),X2.set(this,void 0),_3.set(this,()=>{}),E3.set(this,void 0),z2.set(this,void 0),nn.set(this,Y4()),Rt.set(this,!1),f7.set(this,void 0),an.set(this,i=>{let o=i.data,[c]=o;switch(c){case N0.READY:{let[,l]=o;r1(this,f7,l,"f"),r1(this,Ht,!0,"f"),E(this,E3,"f")?.plugins?E(this,Q0,"m",a9).call(this):E(this,Q0,"m",p7).call(this);break}case N0.PLUGINS_CONFIGURED:E(this,Q0,"m",p7).call(this);break;case N0.BUNDLE_LOADED:{let[,l,u]=o;E(this,Q0,"m",Z3).call(this,l),r1(this,A3,!0,"f"),r1(this,bt,!0,"f"),E(this,X2,"f")?.resolve({metrics:{init:E(this,f7,"f"),loadBundle:u}}),r1(this,X2,void 0,"f");break}case N0.BUNDLE_LOAD_FAILED:{let[,,l,u]=o;E(this,Q0,"m",Z3).call(this,u),E(this,X2,"f")?.reject(l),r1(this,X2,void 0,"f");break}case N0.RETURN:{let[,l,u,v]=o;E(this,Q0,"m",Z3).call(this,v),E(this,j0,"f")[l]?.resolve(u),delete E(this,j0,"f")[l];break}case N0.ERROR:{let[,l,u,v]=o;E(this,Q0,"m",Z3).call(this,v),E(this,j0,"f")[l]?.reject(u),delete E(this,j0,"f")[l];break}case N0.CIRCUIT_BREAKER:{let[,l,u,v]=o;E(this,j0,"f")[l]?.reject(new S6(u,v)),delete E(this,j0,"f")[l];break}case N0.PLUGIN_CALL:{let[,l,u,v,d,h]=o;E(this,E3,"f")?.callback(l,u,v,d,h);break}case N0.UNHANDLED_REJECTION:{let[,,l,u]=o;E(this,Q0,"m",Z3).call(this,u),E(this,_3,"f").call(this,"UnhandledRejection",l);break}}}),on.set(this,i=>{switch(i){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),E(this,z2,"f")?.close();let o=new URL(location.href);o.searchParams.set(K4,E(this,nn,"f")??""),location.assign(o),location.reload();break}}}),r1(this,v7,typeof t=="string"?t:URL.createObjectURL(t),"f"),r1(this,h7,r,"f"),n&&r1(this,_3,n,"f"),a&&r1(this,E3,a,"f")}initializeWorker(){r1(this,l1,new Worker(E(this,v7,"f"),{name:E(this,h7,"f"),type:"module"}),"f"),E(this,l1,"f").onerror=t=>{E(this,_3,"f").call(this,"Error",t)},E(this,l1,"f").onmessageerror=t=>{E(this,_3,"f").call(this,"MessageError",t.data)},E(this,l1,"f").onmessage=E(this,an,"f"),this.runtimeDebugLogging&&E(this,l1,"f").postMessage([Y0.ENABLE_DEBUG_LOGGING])}get ready(){return E(this,A3,"f")}get runtimeDebugLogging(){return E(this,Rt,"f")}set runtimeDebugLogging(t){t!==E(this,Rt,"f")&&(r1(this,Rt,t,"f"),this.runtimeDebugLogging&&E(this,l1,"f")?.postMessage([Y0.ENABLE_DEBUG_LOGGING]))}async loadBundle(t){return r1(this,L5,t,"f"),E(this,l1,"f")?E(this,Ht,"f")&&!E(this,bt,"f")&&E(this,Q0,"m",p7).call(this):this.initializeWorker(),new Promise((r,n)=>{r1(this,X2,{resolve:r,reject:n},"f")})}async call(t,r,n){var a;if(!E(this,A3,"f")||!E(this,l1,"f"))throw new Error("No bundle loaded");let i=r1(this,d7,(a=E(this,d7,"f"),++a),"f"),o=new Promise((c,l)=>{E(this,j0,"f")[i]={resolve:c,reject:l}});return E(this,l1,"f").postMessage([Y0.CALL,i,t,r,n,!1]),o}onPluginResponse(t,r){E(this,l1,"f")?.postMessage([Y0.PLUGIN_RESPONSE,t,r])}quit(){if(E(this,L5,"f")){E(this,z2,"f")?.close(),r1(this,z2,void 0,"f"),r1(this,A3,!1,"f"),E(this,l1,"f")&&(E(this,l1,"f").postMessage([Y0.QUIT]),E(this,l1,"f").onerror=null,E(this,l1,"f").onmessageerror=null,E(this,l1,"f").onmessage=null,E(this,l1,"f").terminate()),r1(this,l1,void 0,"f"),r1(this,bt,!1,"f"),r1(this,Ht,!1,"f");for(let{reject:t}of Object.values(E(this,j0,"f")))t(Error("worker terminated"));r1(this,j0,{},"f"),E(this,X2,"f")?.reject(Error("worker terminated")),r1(this,X2,void 0,"f")}}};v7=new WeakMap,h7=new WeakMap,l1=new WeakMap,A3=new WeakMap,Ht=new WeakMap,bt=new WeakMap,d7=new WeakMap,L5=new WeakMap,j0=new WeakMap,X2=new WeakMap,_3=new WeakMap,E3=new WeakMap,z2=new WeakMap,nn=new WeakMap,Rt=new WeakMap,f7=new WeakMap,an=new WeakMap,on=new WeakMap,Q0=new WeakSet,a9=function(){E(this,l1,"f")?.postMessage([Y0.ENABLE_PLUGINS,E(this,E3,"f")?.plugins??[]])},Z3=function(t){if(!t.length)return;let r=new Date,n={logs:t.map(a=>({severity:cd[a.method],message:a.args.join(" "),tags:[],timestamp:r}))};E(this,z2,"f")?.send({callState:n})},p7=function(){if(!E(this,L5,"f"))return;let t=r9(zs(E(this,L5,"f")));t&&(r1(this,z2,new u7,"f"),E(this,z2,"f").onState=E(this,on,"f")),E(this,z2,"f")?.open(),t&&E(this,l1,"f").postMessage([Y0.ENABLE_APP_LOGGING]),E(this,l1,"f")?.postMessage([Y0.LOAD_BUNDLE,E(this,L5,"f")])};var ln="RenderPostContent",ud=new Set([ln]);function i9(e){if(ud.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var x3,Ot,g7=class{constructor(t){L(this,x3);L(this,Ot);S(this,x3,t)}set env(t){S(this,x3,t)}set props(t){S(this,Ot,t)}build(t,r){return new l7({state:t,events:r.map(n=>n.uiEvent),env:f(this,x3),props:f(this,Ot)})}};x3=new WeakMap,Ot=new WeakMap;var X1,Bt,_7,w7=class{constructor(){L(this,X1);L(this,Bt,!1);L(this,_7,(t,r,n,a,i)=>{this.onPluginCall?.(t,r,n,a,i),r===z5.fullName&&n===z5.methods.send.name&&f(this,X1)?.onPluginResponse(t,{error:void 0,success:!0,value:{}})})}isReady(){return!!f(this,X1)?.ready}set runtimeDebugLogging(t){S(this,Bt,t),f(this,X1)&&(f(this,X1).runtimeDebugLogging=t)}setLocalSrc(t,r){if(this.unload(),!t){S(this,X1,void 0);return}S(this,X1,new m7(t,r,(n,a)=>console.error(n,a),{callback:f(this,_7),plugins:[]})),f(this,X1).runtimeDebugLogging=f(this,Bt),f(this,X1).initializeWorker()}unload(){f(this,X1)?.quit()}async load(t){this.unload();try{return await f(this,X1)?.loadBundle(t)}catch(r){console.error(r)}}handle(t,r,n,a){if(!this.isReady()||!f(this,X1))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",r,this.metadata),f(this,X1)?.call(i9(t),r.uiRequest,this.metadata).then(i=>n(new yt(i))).catch(i=>a(i))}pause(){}reset(){}resume(){}snapshot(){return{}}};X1=new WeakMap,Bt=new WeakMap,_7=new WeakMap;var A7=class{isReady(){return!!this.remote}load(t){this.remote=t}handle(t,r,n,a){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[i9(t)](r.uiRequest,this.metadata).then(i=>n(new yt(i))).catch(a)}pause(){}reset(){}resume(){}snapshot(){return{}}};var K2,Y2,kt,Z7=class{constructor(t){L(this,K2,new Map);L(this,Y2,new Map);L(this,kt);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),S(this,kt,t)}add(t){devvit?.debug.runtime&&console.debug("[runtime] timers: add",t),f(this,Y2).set(t.id,t),f(this,K2).set(t.id,window.setInterval(()=>{f(this,kt).submit([new V0({scope:n1.ALL,timer:{},hook:t.id})])},t.duration))}apply(t){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",t);let r=new Map(f(this,Y2));t.forEach(n=>{r.delete(n.id),f(this,Y2).has(n.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",n),this.add(n))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",r);for(let[n]of r)this.remove(n)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let t of f(this,K2).values())clearInterval(t);f(this,K2).clear(),f(this,Y2).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...f(this,Y2).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let t of f(this,K2).values())clearInterval(t);return this.list()}remove(t){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),f(this,Y2).delete(t),clearInterval(f(this,K2).get(t)),f(this,K2).delete(t)}resumeAll(t){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(t)}};K2=new WeakMap,Y2=new WeakMap,kt=new WeakMap;var o9=e=>e.message==="ServerCallRequired",sn=class{debug(t){devvit?.debug.runtime&&console.debug(this.tag(),...t)}error(t){o9(t[0])||console.error(this.tag(),...t)}info(t){console.info(this.tag(),...t)}warn(t){console.warn(this.tag(),...t)}tag(){return"[kmp-dispatcher]"}},$t,Ut,cn=class{constructor(t,r){L(this,$t);L(this,Ut);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};S(this,$t,t),S(this,Ut,r)}logRuntimeError(t){var r;o9(t)||(devvit?.debug.runtime&&console.error("[kmp-dispatcher-perf-analytics] error",t),(r=f(this,Ut))==null||r.call(this,t))}logRuntimeTrace(t){var r;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",t),(r=f(this,$t))==null||r.call(this,t)}};$t=new WeakMap,Ut=new WeakMap;Os();var vd=({nanos:e,seconds:t})=>{let r=t*1e3,n=e/1e6;return Math.floor(r+n)},hd=["showToast","showForm","navigateToUrl","createOrder"],y5,S5,I0,Pt,V5,e2,C3,E7=class{constructor(t,r,n){L(this,y5);L(this,S5);L(this,I0);L(this,Pt);this.hasRendered=!1;L(this,V5);L(this,e2);L(this,C3);S(this,y5,new g7(r)),n.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),S(this,I0,new i7(t??{},f(this,y5),ln,{logger:new sn,featureFlags:{isSpeculativeExecutionEnabled:n.useSpeculativeExecution,isUsingEverythingAssembler:!1,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new cn(n.performanceTracker,n.errorTracker),errorHandler:a=>this.onError?.(a)})),S(this,S5,new Z7(f(this,I0))),S(this,V5,new A7),S(this,e2,new w7),this.init()}get state(){return f(this,I0).state}set metadata(t){let r={...t},n=[];for(let[a,i]of Object.entries(devvit?.debug??{}))n.push(`${a}=${i}`);n.length&&(r[h2.Debug]={values:n}),f(this,e2).metadata=r,f(this,V5).metadata=r}set onPluginCall(t){f(this,e2).onPluginCall=t}set runtimeDebugLogging(t){f(this,e2).runtimeDebugLogging=t}subscribe(t){S(this,Pt,f(this,I0).subscribe((...r)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",r[0]);let[{response:n}]=r;n.uiResponse.effects.forEach(a=>{if(hd.some(i=>a[i])||a.realtimeSubscriptions){this.onUserAction?.(a);return}if(a.interval){let i=Object.entries(a.interval.intervals);i.length===0&&f(this,S5).clear(),f(this,S5).apply(i.map(([o,c])=>new J1(o,vd(c.duration))));return}if(a.webView){this.onWebViewMessage?.(a);return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(a,null,2)}`)}),t(...r)}))}submit(...t){f(this,I0).submit(...t)}unsubscribe(){f(this,Pt)?.unsubscribe()}init(){f(this,I0).init(f(this,e2),f(this,V5),f(this,S5))}togglePause(t){t?S(this,C3,f(this,I0).pause()):f(this,C3)&&f(this,I0).resume(f(this,C3))}resetAppState(){this.hasRendered=!1,f(this,I0).reset()}setEnv(t){f(this,y5).env=t}setProps(t){f(this,y5).props=t}remoteLoad(...t){f(this,V5).load(...t)}async localLoad(...t){return f(this,e2).reset(),await f(this,e2).load(...t)}localLoadWorker(...t){f(this,e2).setLocalSrc(...t)}};y5=new WeakMap,S5=new WeakMap,I0=new WeakMap,Pt=new WeakMap,V5=new WeakMap,e2=new WeakMap,C3=new WeakMap;function un(e,t,r,n,a){let i=n.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(i.length<3)return"";let[o,c,l]=i;if(!t||!c||!l)return"";let u=r.replace(/[^0-9]+/g,"-"),v=t.replace(/^t[0-9]_/,""),d=a.split(".")[0],h=e.replace("{{location}}",v).replace("{{app}}",c).replace("{{installation}}",d).replace("{{version}}",u).replace("{{path}}",l);return new URL(h).toString()}var N5,I5,T5,M3,L3,G,T1,l9,vn,x7,C7,hn,M7,L7,ze,y3,y7,M1=class extends m0{constructor(){super();L(this,T1);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.appPublicApiVersion="";this.disableAssetSandbox=!1;L(this,N5);L(this,I5);L(this,T5);L(this,M3,!1);L(this,L3,"");L(this,G);L(this,x7,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:r=>this.disableAssetSandbox?r:un(this.webViewUrlTemplate,this.metadata?.[h2.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",r,this.bundle?.hostname??""),onAction:r=>{let n={};r.type===E2.ACTION_CLICK||f(this,M3)?n.userAction={actionId:r.id,data:r.data??{}}:r.type===E2.ACTION_WEBVIEW&&(n.webView={postMessage:{message:r.data}}),f(this,G)?.submit([new V0({scope:n1.ALL,hook:r.id,...n})])},stackDirection:H.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));L(this,C7,r=>{Io(r)||console.error(r),D(this,T1,ze).call(this,"devvit-ui-error",{err:r,type:"Error"})});L(this,M7,(r,n,a,i,o)=>{n===z5.fullName&&a===z5.methods.send.name&&D(this,T1,ze).call(this,"devvit-realtime-send",{event:i})});L(this,L7,({response:r})=>{var n,a;this.renderResponse=r,r?.blocks&&(this._rootBlock=r.blocks,f(this,N5)?((n=this._rootBlock).config??(n.config={}),(a=this._rootBlock.config).rootConfig??(a.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=f(this,N5)):S(this,N5,this._rootBlock.config?.rootConfig?.height||Br))});L(this,y3,r=>{D(this,T1,ze).call(this,"devvit-ui-effect",{effect:r,onEvent:n=>n.webView?.postMessage?f(this,G)?.submit([new V0({scope:n1.ALL,hook:n.hook,webView:{...n.webView}})]):f(this,G)?.submit([new V0(n)]),metadata:this.metadata})});L(this,y7,async r=>{if(await this.updateComplete,r.webView?.fullscreen){let n=un(this.webViewUrlTemplate,this.metadata?.[h2.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",r.webView.fullscreen.url,this.bundle?.hostname??"");devvit?.debug.surface&&console.debug("[surface] fullscreen web view asset,",r.webView.fullscreen.url,"resolved to",n),r.webView.fullscreen.url=n,f(this,y3).call(this,r)}else if(r.webView?.postMessage?.app){let n=[];if(r.webView.postMessage.webViewId){let a=this._blocksRenderer?.findBlockById(r.webView.postMessage.webViewId);a?.blockType!=="web-view"||!a?.element?f(this,y3).call(this,r):n.push(a)}else{let a=this._blocksRenderer?.findBlocksByType("web-view")??[];a.length===0?console.error("Invalid postMessage request: could not find a WebView"):n.push(...a)}for(let a of n)a?.element?.postMessage(r.webView.postMessage.app)}});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[l6]}async connectedCallback(){super.connectedCallback(),S(this,G,new E7({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[h2.Language]?.values?.[0],timezone:this.metadata?.[h2.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:r=>{D(this,T1,ze).call(this,pa,{name:r.spanName,timeStart:r.startTimeMs,timeEnd:r.endTimeMs,target:r.target,intent:r.intent,eventCount:r.eventCount})},errorTracker:r=>{D(this,T1,ze).call(this,ma,{message:r.message,origin:r.origin,version:r.version})}})),f(this,G).onPluginCall=f(this,M7),f(this,G).onError=f(this,C7),f(this,G).onUserAction=f(this,y3),f(this,G).onWebViewMessage=f(this,y7),f(this,G).subscribe(r=>{f(this,L7).call(this,{request:r.request.uiRequest,response:r.response.uiResponse})}),S(this,I5,new ResizeObserver(Ho(r=>{r.length!==0&&(this.dimensions=Po(r[0],window,document.body))},600))),f(this,I5).observe(this,{box:"content-box"}),S(this,T5,new IntersectionObserver(r=>{r.forEach(n=>{f(this,G)?.togglePause(!n.isIntersecting)})})),f(this,T5).observe(this)}disconnectedCallback(){f(this,I5)?.unobserve(this),f(this,I5)?.disconnect(),f(this,T5)?.unobserve(this),f(this,T5)?.disconnect(),f(this,G)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?n0`<div class="relative">
|
|
625
|
+
</div>`}else return a}var rt,nt,M6,w5=class extends m0{constructor(){super(...arguments);L(this,rt,window.matchMedia("(prefers-color-scheme: dark)"));L(this,nt,()=>this.requestUpdate());L(this,M6,()=>({stackDirection:H.UNRECOGNIZED}))}static get styles(){return[l6]}connectedCallback(){super.connectedCallback(),f(this,rt)?.addEventListener("change",f(this,nt))}disconnectedCallback(){super.disconnectedCallback(),f(this,rt)?.removeEventListener("change",f(this,nt))}async getUpdateComplete(){let r=await super.getUpdateComplete(),n=this.renderRoot.querySelectorAll("[data-block-type]");for(let a=0;a<n.length;a++)await n.item(a).updateComplete;return r}reset(){this.renderRoot.querySelectorAll("[data-block-type]").forEach(n=>{n.reset?.()})}findBlockById(r){let n=this.renderRoot.querySelector(`#${r}[data-block-type]`);if(n)return{blockType:n.dataset.blockType,element:n}}findBlocksByType(r){return Array.from(this.renderRoot.querySelectorAll(`[data-block-type=${r}]`)).map(n=>({blockType:r,element:n}))}render(){if(this.block&&this.block.type===N.BLOCK_ROOT){let r={...f(this,M6).call(this),...this.renderContext?.()??{}},n=new o6,a=kr(this.block,r);return n.finish(),this.dispatchEvent(P5($3,{name:"blocks_layout",timeStart:n.timeStart,timeEnd:n.timeEnd})),n0` <div class="${Q2(this.class)}">${a}</div>`}return n0`${fa({creative:n0`<slot name="empty-state-image"></slot>`,title:X7("Whoops!",{desc:"Header for message to display when rendering fails"}),description:X7("Something went wrong while attempting to display this content.",{desc:"Message for users to display when rendering fails"})})}`}};rt=new WeakMap,nt=new WeakMap,M6=new WeakMap,O([j({attribute:!1})],w5.prototype,"block",2),O([j({attribute:!1})],w5.prototype,"renderContext",2),O([j()],w5.prototype,"class",2),w5=O([ha(),D5("devvit-blocks-renderer")],w5);var y6=s1(w1(),1);function Vo(){return{height:0,width:0,scale:0,fontScale:void 0}}var $r={$type:"devvit.ui.common.v1alpha.UIDimensions",encode(e,t=y6.default.Writer.create()){return e.height!==0&&t.uint32(8).int32(e.height),e.width!==0&&t.uint32(16).int32(e.width),e.scale!==0&&t.uint32(29).float(e.scale),e.fontScale!==void 0&&t.uint32(37).float(e.fontScale),t},decode(e,t){let r=e instanceof y6.default.Reader?e:y6.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Vo();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.height=r.int32();continue;case 2:if(i!==16)break;a.width=r.int32();continue;case 3:if(i!==29)break;a.scale=r.float();continue;case 4:if(i!==37)break;a.fontScale=r.float();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{height:L6(e.height)?globalThis.Number(e.height):0,width:L6(e.width)?globalThis.Number(e.width):0,scale:L6(e.scale)?globalThis.Number(e.scale):0,fontScale:L6(e.fontScale)?globalThis.Number(e.fontScale):void 0}},toJSON(e){let t={};return e.height!==0&&(t.height=Math.round(e.height)),e.width!==0&&(t.width=Math.round(e.width)),e.scale!==0&&(t.scale=e.scale),e.fontScale!==void 0&&(t.fontScale=e.fontScale),t},create(e){return $r.fromPartial(e??{})},fromPartial(e){let t=Vo();return t.height=e.height??0,t.width=e.width??0,t.scale=e.scale??0,t.fontScale=e.fontScale??void 0,t}};g.set($r.$type,$r);function L6(e){return e!=null}var No="ServerCallRequired";var S6=class extends Error{constructor(t,r){super(No),this.response=t,this.cause=r,this.name="CircuitBreakerResponse"}};function Io(e){return e?.message===No}var h2=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"}),To;(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"})(To||(To={}));function Ho(e,t){let r,n=0,a;return function(...i){return a=i,r??(r=setTimeout(()=>{n=Date.now(),r=void 0;let o=a;a=void 0,e.apply(this,o)},Math.max(0,t-(Date.now()-n)))),()=>{r!=null&&clearTimeout(r),r=void 0,a=void 0}}}function bo(e,t){if(!e)throw Error(t)}var V6;(function(e){e.COMMENT="t1_",e.ACCOUNT="t2_",e.LINK="t3_",e.MESSAGE="t4_",e.SUBREDDIT="t5_",e.AWARD="t6_"})(V6||(V6={}));function Eu(e){return e.startsWith(V6.LINK)}function xu(e){bo(Eu(e),`Expected link id to start with ${V6.LINK}, got ${e}}`)}function Ro(e){return xu(e),e}var Cu=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,Q5=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");let t=e.match(Cu);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},Oo=e=>e==="*"||e==="x"||e==="X",Bo=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},Mu=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Lu=(e,t)=>{if(Oo(e)||Oo(t))return 0;let[r,n]=Mu(Bo(e),Bo(t));return r>n?1:r<n?-1:0},Ur=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){let n=Lu(e[r]||"0",t[r]||"0");if(n!==0)return n}return 0};var ko=(e,t)=>{let r=Q5(e),n=Q5(t),a=r.pop(),i=n.pop(),o=Ur(r,n);return o!==0?o:a&&i?Ur(a.split("."),i.split(".")):a||i?a?-1:1:0};var Pr=(e,t,r)=>{yu(r);let n=ko(e,t);return Uo[r].includes(n)},Uo={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},$o=Object.keys(Uo),yu=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if($o.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${$o.join("|")}`)};var Su=1,Vu=16;function Po(e,t,r){let{width:n,height:a}=e.contentRect,o=t.getComputedStyle(r).fontSize.split("px")[0],c=o?parseFloat(o)/Vu:Su;return{width:Math.round(n),height:Math.round(a),scale:t.devicePixelRatio,fontScale:c}}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 t=Object(this),r=t.length>>>0,n=arguments[1],a=n>>0,i=a<0?Math.max(r+a,0):Math.min(a,r),o=arguments[2],c=o===void 0?r:o>>0,l=c<0?Math.max(r+c,0):Math.min(c,r);i<l;)t[i]=e,i++;return t}});[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,t){return function(r){var n=r>>>0;return n===0?32:31-(e(n)/t|0)|0}}(Math.log,Math.LN2));typeof Math.imul>"u"&&(Math.imul=function(t,r){return(t&4294901760)*(r&65535)+(t&65535)*(r|0)|0});var al=Math.clz32,Jr=ArrayBuffer.isView,Q=Math.imul;w(i4,"CharSequence",F2);w(o4,"Number",Z);w(l4,"Unit",x1);w(n3,"IntCompanionObject",x1);w(N1,"Collection",F2);w(P2,"AbstractCollection",Z,m,[N1]);w(F0,"AbstractMutableCollection",Z,P2,[P2,N1]);w(ct,"IteratorImpl",Z);w(i3,"List",F2,m,[N1]);w(M0,"AbstractMutableList",Z,F0,[F0,N1,i3]);w(U2,"Map",F2);w(L0,"AbstractMap",Z,m,[U2]);w(j5,"AbstractMutableMap",Z,L0,[L0,U2]);w(dt,"Set",F2,m,[N1]);w(k2,"AbstractMutableSet",Z,F0,[F0,N1,dt]);w(sl,"Companion",x1);w(_1,"ArrayList",Z,M0,[M0,N1,i3],q1);w(G0,"HashMap",Z,j5,[j5,U2],Fu);w(y0,"HashMapEntrySetBase",Z,k2,[N1,dt,k2]);w(u4,"HashMapEntrySet",Z,y0);w(Pe,"HashSet",Z,k2,[k2,N1,dt],v4);w(fl,"Companion",x1);w(D2,"Itr",Z);w(p4,"KeysItr",Z,D2);w(vt,"EntriesItr",Z,D2);w($2,"Entry",F2);w(_5,"EntryRef",Z,m,[$2]);function Nu(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o(),i=a,o;if(i!=null&&a1(i,$2)?o=this.c4(i):o=!1,!o){t=!1;break e}}t=!0}return t}w(pl,"InternalMap",F2);w(H1,"InternalHashMap",Z,m,[pl],h4);w(U6,"LinkedHashMap",Z,G0,[G0,U2],ht);w(q0,"StringBuilder",Z,m,[i4],m4);w(El,"Companion",x1);w(xl,"Char",Z);w(Cl,"Companion",x1);w(e0,"Enum",Z);w(P6,m,Z);w(Rl,"Companion",x1);w(k,"Long",Z,o4);w(G2,"Exception",Z,Error,m,Jl);w(k1,"RuntimeException",Z,G2,m,Ql);w(u3,"IllegalArgumentException",Z,k1,m,zl);w(h3,"IndexOutOfBoundsException",Z,k1,m,Kl);w(d3,"IllegalStateException",Z,k1,m,Yl);w(F6,"UnsupportedOperationException",Z,k1,m,f3);w(p3,"NoSuchElementException",Z,k1,m,W2);w(G6,"ConcurrentModificationException",Z,k1,m,E4);w(m3,"ArithmeticException",Z,k1,m,es);w(W6,"NullPointerException",Z,k1,m,x4);w(q6,"ClassCastException",Z,k1,m,C4);w(g3,"UninitializedPropertyAccessException",Z,k1,m,rs);w(De,"Companion",x1);w(is,"Companion",x1);w(J6,"Companion",x1);w(ls,"Companion",x1);w(i1,"ArrayDeque",Z,M0,m,wt);w(z0,"EmptyList",x1,m,[i3]);w(X6,"EmptyIterator",x1);w(q2,"ArrayAsCollection",Z,m,[N1]);w(z6,"IntIterator",Z);w(us,"Companion",x1);w(f2,"IntProgression",Z);w(Ue,"IntRange",Z,f2);w(K6,"IntProgressionIterator",Z,z6);w(S4,"Companion",x1);w(V1,"Pair",Z);function i4(){}function o4(){}function l4(){}s(l4).toString=function(){return"kotlin.Unit"};var y;function n3(){this.MIN_VALUE=-2147483648,this.MAX_VALUE=2147483647,this.SIZE_BYTES=4,this.SIZE_BITS=32}s(n3).c=function(){return this.MIN_VALUE};s(n3).d=function(){return this.MAX_VALUE};s(n3).e=function(){return this.SIZE_BYTES};s(n3).f=function(){return this.SIZE_BITS};var s4;function Iu(e){return e!==e}function Tu(e){var t;if(e===0)t=0;else{var r=31;t=1<<(r-al(e)|0)}return t}function il(e){return Vh(e)}function Hu(e,t){return t}function bu(e,t){return o3(Array(t),null)}function O6(e){return Th([e])}function a3(e){var t;return e.toArray!==void 0?t=e.toArray():t=il(e),t}function R(e,t,r,n,a){W1.h(n,a,e.length);var i=a-n|0;if(W1.h(r,r+i|0,t.length),Jr(t)&&Jr(e)){var o=e.subarray(n,a);t.set(o,r)}else if(e!==t||r<=n){var c=0;if(c<i)do{var l=c;c=c+1|0,t[r+l|0]=e[n+l|0]}while(c<i)}else{var u=i-1|0;if(0<=u)do{var v=u;u=u+-1|0,t[r+v|0]=e[n+v|0]}while(0<=u)}}function Ru(e){return e<0&&Hh(),e}function F0(){P2.call(this)}s(F0).j=function(e){this.k();for(var t=this.l();t.m();)if(B(t.o(),e))return t.n(),!0;return!1};s(F0).p=function(e){this.k();for(var t=!1,r=e.l();r.m();){var n=r.o();this.i(n)&&(t=!0)}return t};s(F0).toJSON=function(){return this.toArray()};s(F0).k=function(){};function ct(e){this.w_1=e,this.u_1=0,this.v_1=-1}s(ct).m=function(){return this.u_1<this.w_1.q()};s(ct).o=function(){if(!this.m())throw W2();var e=this,t=this.u_1;return this.u_1=t+1|0,e.v_1=t,this.w_1.x(this.v_1)};s(ct).n=function(){if(this.v_1===-1){var e="Call next() or previous() before removing element from the iterator.";throw mt(J0(e))}this.w_1.z(this.v_1),this.u_1=this.v_1,this.v_1=-1};function M0(){F0.call(this),this.y_1=0}s(M0).i=function(e){return this.k(),this.a1(this.q(),e),!0};s(M0).l=function(){return new ct(this)};s(M0).r=function(e){return this.b1(e)>=0};s(M0).b1=function(e){var t;e:{for(var r=0,n=this.l();n.m();){var a=n.o();if(B(a,e)){t=r;break e}r=r+1|0}t=-1}return t};s(M0).equals=function(e){return e===this?!0:e!=null&&a1(e,i3)?W1.c1(this,e):!1};s(M0).hashCode=function(){return W1.d1(this)};function j5(){L0.call(this),this.g1_1=null,this.h1_1=null}s(j5).j1=function(e){this.k();for(var t=this.k1().l();t.m();){var r=t.o(),n=r.l1();if(B(e,n)){var a=r.m1();return t.n(),a}}return null};s(j5).k=function(){};function k2(){F0.call(this)}s(k2).equals=function(e){return e===this?!0:e!=null&&a1(e,dt)?M4.s1(this,e):!1};s(k2).hashCode=function(){return M4.t1(this)};function ol(e){if(!(e>=0)){var t="capacity must be non-negative.";throw W0(J0(t))}return o3(Array(e),null)}function ll(e,t){e[t]=null}function Do(e,t,r){e.fill(null,t,r)}function Fo(e,t){return oh(e,t)}function sl(){Xr=this;var e=this,t=B6(0);t.w1_1=!0,e.x1_1=t}var Xr;function Ou(){return Xr==null&&new sl,Xr}function Bu(e){var t=[];return _1.call(e,t),e}function q1(){return Bu(F(s(_1)))}function ku(e,t){var r=[];if(_1.call(t,r),!(e>=0)){var n="Negative initial capacity: "+e;throw W0(J0(n))}return t}function B6(e){return ku(e,F(s(_1)))}function $u(e,t){var r=a3(e);return _1.call(t,r),t}function c4(e){return $u(e,F(s(_1)))}function Uu(e,t){var r=e.q();return e.v1_1.length=e.q()+t|0,r}function cl(e,t){return W1.y1(t,e.q()),t}function Pu(e,t){return W1.z1(t,e.q()),t}function _1(e){Ou(),M0.call(this),this.v1_1=e,this.w1_1=!1}s(_1).q=function(){return this.v1_1.length};s(_1).x=function(e){var t=this.v1_1[cl(this,e)];return t==null||t!=null?t:J()};s(_1).i=function(e){return this.k(),this.v1_1.push(e),this.y_1=this.y_1+1|0,!0};s(_1).a1=function(e,t){this.k(),this.v1_1.splice(Pu(this,e),0,t),this.y_1=this.y_1+1|0};s(_1).p=function(e){if(this.k(),e.t())return!1;for(var t=Uu(this,e.q()),r=0,n=e.l();n.m();){var a=n.o(),i=r;r=i+1|0;var o=Ru(i);this.v1_1[t+o|0]=a}return this.y_1=this.y_1+1|0,!0};s(_1).z=function(e){this.k(),cl(this,e),this.y_1=this.y_1+1|0;var t;return e===R6(this)?t=this.v1_1.pop():t=this.v1_1.splice(e,1)[0],t};s(_1).j=function(e){this.k();var t=0,r=this.v1_1.length-1|0;if(t<=r)do{var n=t;if(t=t+1|0,B(this.v1_1[n],e))return this.v1_1.splice(n,1),this.y_1=this.y_1+1|0,!0}while(t<=r);return!1};s(_1).b1=function(e){return wl(this.v1_1,e)};s(_1).toString=function(){return Cv(this.v1_1)};s(_1).a2=function(){return[].slice.call(this.v1_1)};s(_1).toArray=function(){return this.a2()};s(_1).k=function(){if(this.w1_1)throw f3()};function Du(e,t){return j5.call(t),G0.call(t),t.f2_1=e,t}function ul(e){return Du(h4(),e),e}function Fu(){return ul(F(s(G0)))}s(G0).p1=function(e){return this.f2_1.h2(e)};s(G0).k1=function(){var e=this.g2_1,t;if(e==null){var r=new u4(this.f2_1);this.g2_1=r,t=r}else t=e;return t};s(G0).r1=function(e){return this.f2_1.r1(e)};s(G0).i1=function(e,t){return this.f2_1.i1(e,t)};s(G0).j1=function(e){return this.f2_1.j1(e)};s(G0).q=function(){return this.f2_1.q()};function G0(){this.g2_1=null}function u4(e){y0.call(this,e)}s(u4).l=function(){return this.j2_1.k2()};function y0(e){k2.call(this),this.j2_1=e}s(y0).q=function(){return this.j2_1.q()};s(y0).t=function(){return this.j2_1.q()===0};s(y0).l2=function(e){return this.j2_1.n2(e)};s(y0).r=function(e){return e!=null&&a1(e,$2)?this.l2(e!=null&&a1(e,$2)?e:J()):!1};s(y0).m2=function(e){throw f3()};s(y0).i=function(e){return this.m2(e!=null&&a1(e,$2)?e:J())};s(y0).p=function(e){throw f3()};s(y0).s=function(e){return this.j2_1.o2(e)};s(y0).k=function(){return this.j2_1.k()};function Gu(e,t){return k2.call(t),Pe.call(t),t.p2_1=e,t}function Wu(e){return Gu(h4(),e),e}function v4(){return Wu(F(s(Pe)))}s(Pe).i=function(e){return this.p2_1.i1(e,!0)==null};s(Pe).r=function(e){return this.p2_1.h2(e)};s(Pe).t=function(){return this.p2_1.q()===0};s(Pe).l=function(){return this.p2_1.q2()};s(Pe).q=function(){return this.p2_1.q()};function Pe(){}function vl(e,t){return Tu(Q(I6(t,1),3))}function hl(e,t){return al(t)+1|0}function qu(e){return Ju(8,e),e}function h4(){return qu(F(s(H1)))}function Ju(e,t){return H1.call(t,ol(e),null,new Int32Array(e),new Int32Array(vl(ut,e)),2,0),t}function e3(e){return e.r2_1.length}function d0(e){return e.u2_1.length}function d4(e){e.y2_1=e.y2_1+1|0}function Xu(e,t){zu(e,t)?f4(e,d0(e)):Ku(e,e.w2_1+t|0)}function zu(e,t){var r=e3(e)-e.w2_1|0,n=e.w2_1-e.q()|0;return r<t&&(n+r|0)>=t?n>=(e3(e)/4|0):!1}function Ku(e,t){if(t<0)throw jl("too many elements");if(t>e3(e)){var r=W1.b3(e3(e),t);e.r2_1=Fo(e.r2_1,r);var n=e,a=e.s2_1;n.s2_1=a==null?null:Fo(a,r),e.t2_1=ih(e.t2_1,r);var i=vl(ut,r);i>d0(e)&&f4(e,i)}}function Yu(e){var t=e.s2_1;if(t!=null)return t;var r=ol(e3(e));return e.s2_1=r,r}function k6(e,t){return t==null?0:Q(h1(t),-1640531527)>>>e.x2_1|0}function Qu(e){for(var t=0,r=0,n=e.s2_1;t<e.w2_1;)e.t2_1[t]>=0&&(e.r2_1[r]=e.r2_1[t],n!=null&&(n[r]=n[t]),r=r+1|0),t=t+1|0;Do(e.r2_1,r,e.w2_1),n==null||Do(n,r,e.w2_1),e.w2_1=r}function f4(e,t){d4(e),e.w2_1>e.z2_1&&Qu(e),t!==d0(e)?(e.u2_1=new Int32Array(t),e.x2_1=hl(ut,t)):ah(e.u2_1,0,0,d0(e));for(var r=0;r<e.w2_1;){var n=r;if(r=n+1|0,!ju(e,n))throw mt("This cannot happen with fixed magic multiplier and grow-only hash array. Have object hashCodes changed?")}}function ju(e,t){for(var r=k6(e,e.r2_1[t]),n=e.v2_1;;){var a=e.u2_1[r];if(a===0)return e.u2_1[r]=t+1|0,e.t2_1[t]=r,!0;if(n=n-1|0,n<0)return!1;var i=r;r=i-1|0,i===0&&(r=d0(e)-1|0)}}function $6(e,t){for(var r=k6(e,t),n=e.v2_1;;){var a=e.u2_1[r];if(a===0)return-1;if(a>0&&B(e.r2_1[a-1|0],t))return a-1|0;if(n=n-1|0,n<0)return-1;var i=r;r=i-1|0,i===0&&(r=d0(e)-1|0)}}function ev(e,t){e.k();e:for(;;)for(var r=k6(e,t),n=T6(Q(e.v2_1,2),d0(e)/2|0),a=0;;){var i=e.u2_1[r];if(i<=0){if(e.w2_1>=e3(e)){Xu(e,1);continue e}var o=e.w2_1;e.w2_1=o+1|0;var c=o;return e.r2_1[c]=t,e.t2_1[c]=r,e.u2_1[r]=c+1|0,e.z2_1=e.z2_1+1|0,d4(e),a>e.v2_1&&(e.v2_1=a),c}if(B(e.r2_1[i-1|0],t))return-i|0;if(a=a+1|0,a>n){f4(e,Q(d0(e),2));continue e}var l=r;r=l-1|0,l===0&&(r=d0(e)-1|0)}}function tv(e,t){e.k();var r=$6(e,t);return r<0?-1:(dl(e,r),r)}function dl(e,t){ll(e.r2_1,t),rv(e,e.t2_1[t]),e.t2_1[t]=-1,e.z2_1=e.z2_1-1|0,d4(e)}function rv(e,t){for(var r=t,n=t,a=0,i=T6(Q(e.v2_1,2),d0(e)/2|0);;){var o=r;if(r=o-1|0,o===0&&(r=d0(e)-1|0),a=a+1|0,a>e.v2_1)return e.u2_1[n]=0,y;var c=e.u2_1[r];if(c===0)return e.u2_1[n]=0,y;if(c<0)e.u2_1[n]=-1,n=r,a=0;else{var l=k6(e,e.r2_1[c-1|0]);((l-r|0)&(d0(e)-1|0))>=a&&(e.u2_1[n]=c,e.t2_1[c-1|0]=n,n=r,a=0)}if(i=i-1|0,i<0)return e.u2_1[n]=-1,y}}function nv(e,t){return e.z2_1===t.q()?e.o2(t.k1()):!1}function fl(){this.c3_1=-1640531527,this.d3_1=8,this.e3_1=2,this.f3_1=-1}var ut;function D2(e){this.g3_1=e,this.h3_1=0,this.i3_1=-1,this.j3_1=this.g3_1.y2_1,this.k3()}s(D2).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};s(D2).m=function(){return this.h3_1<this.g3_1.w2_1};s(D2).n=function(){if(this.l3(),this.i3_1===-1){var e="Call next() before removing element from the iterator.";throw mt(J0(e))}this.g3_1.k(),dl(this.g3_1,this.i3_1),this.i3_1=-1,this.j3_1=this.g3_1.y2_1};s(D2).l3=function(){if(this.g3_1.y2_1!==this.j3_1)throw E4()};function p4(e){D2.call(this,e)}s(p4).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=this.g3_1.r2_1[this.i3_1];return this.k3(),r};function vt(e){D2.call(this,e)}s(vt).o=function(){if(this.l3(),this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=new _5(this.g3_1,this.i3_1);return this.k3(),r};s(vt).u3=function(){if(this.h3_1>=this.g3_1.w2_1)throw W2();var e=this,t=this.h3_1;this.h3_1=t+1|0,e.i3_1=t;var r=this.g3_1.r2_1[this.i3_1],n=r==null?null:h1(r),a=n??0,i=s3(this.g3_1.s2_1)[this.i3_1],o=i==null?null:h1(i),c=a^(o??0);return this.k3(),c};s(vt).v3=function(e){if(this.h3_1>=this.g3_1.w2_1)throw W2();var t=this,r=this.h3_1;this.h3_1=r+1|0,t.i3_1=r;var n=this.g3_1.r2_1[this.i3_1];B(n,this.g3_1)?e.y3("(this Map)"):e.x3(n),e.z3(61);var a=s3(this.g3_1.s2_1)[this.i3_1];B(a,this.g3_1)?e.y3("(this Map)"):e.x3(a),this.k3()};function _5(e,t){this.a4_1=e,this.b4_1=t}s(_5).l1=function(){return this.a4_1.r2_1[this.b4_1]};s(_5).m1=function(){return s3(this.a4_1.s2_1)[this.b4_1]};s(_5).equals=function(e){var t,r;return e!=null&&a1(e,$2)?r=B(e.l1(),this.l1()):r=!1,r?t=B(e.m1(),this.m1()):t=!1,t};s(_5).hashCode=function(){var e=this.l1(),t=e==null?null:h1(e),r=t??0,n=this.m1(),a=n==null?null:h1(n);return r^(a??0)};s(_5).toString=function(){return""+this.l1()+"="+this.m1()};function H1(e,t,r,n,a,i){this.r2_1=e,this.s2_1=t,this.t2_1=r,this.u2_1=n,this.v2_1=a,this.w2_1=i,this.x2_1=hl(ut,d0(this)),this.y2_1=0,this.z2_1=0,this.a3_1=!1}s(H1).q=function(){return this.z2_1};s(H1).r1=function(e){var t=$6(this,e);return t<0?null:s3(this.s2_1)[t]};s(H1).h2=function(e){return $6(this,e)>=0};s(H1).i1=function(e,t){var r=ev(this,e),n=Yu(this);if(r<0){var a=n[(-r|0)-1|0];return n[(-r|0)-1|0]=t,a}else return n[r]=t,null};s(H1).j1=function(e){var t=tv(this,e);if(t<0)return null;var r=s3(this.s2_1),n=r[t];return ll(r,t),n};s(H1).equals=function(e){var t;if(e===this)t=!0;else{var r;e!=null&&a1(e,U2)?r=nv(this,e):r=!1,t=r}return t};s(H1).hashCode=function(){for(var e=0,t=this.k2();t.m();)e=e+t.u3()|0;return e};s(H1).toString=function(){var e=ov(2+Q(this.z2_1,3)|0);e.y3("{");for(var t=0,r=this.k2();r.m();)t>0&&e.y3(", "),r.v3(e),t=t+1|0;return e.y3("}"),e.toString()};s(H1).k=function(){if(this.a3_1)throw f3()};s(H1).n2=function(e){var t=$6(this,e.l1());return t<0?!1:B(s3(this.s2_1)[t],e.m1())};s(H1).c4=function(e){return this.n2(a1(e,$2)?e:J())};s(H1).q2=function(){return new p4(this)};s(H1).k2=function(){return new vt(this)};function pl(){}function av(e){return ul(e),U6.call(e),e}function ht(){return av(F(s(U6)))}s(U6).k=function(){return this.f2_1.k()};function U6(){}function iv(e,t){return ml(t),t}function ov(e){return iv(e,F(s(q0)))}function ml(e){return q0.call(e,""),e}function m4(){return ml(F(s(q0)))}function q0(e){this.w3_1=e!==void 0?e:""}s(q0).a=function(){return this.w3_1.length};s(q0).b=function(e){var t=this.w3_1,r;if(e>=0&&e<=ds(t))r=t3(t,e);else throw v3("index: "+e+", length: "+this.a()+"}");return r};s(q0).z3=function(e){return this.w3_1=this.w3_1+H6(e),this};s(q0).j4=function(e){return this.w3_1=this.w3_1+ft(e),this};s(q0).x3=function(e){return this.w3_1=this.w3_1+ft(e),this};s(q0).y3=function(e){var t=this,r=this.w3_1;return t.w3_1=r+(e??"null"),this};s(q0).toString=function(){return this.w3_1};function Go(e){var t=H6(e).toUpperCase();return t.length>1?e:t3(t,0)}function lv(e,t,r,n,a,i){return i=i===m?!1:i,ps(e,t,r,n,a,i)}function g4(e){switch(e.length){case 0:return S0();case 1:return O6(e[0]);default:return sv(e)}}function gl(e){return e.length-1|0}function sv(e){return c4(Ih(e))}function wl(e,t){if(t==null){var r=0,n=e.length-1|0;if(r<=n)do{var a=r;if(r=r+1|0,e[a]==null)return a}while(r<=n)}else{var i=0,o=e.length-1|0;if(i<=o)do{var c=i;if(i=i+1|0,B(t,e[c]))return c}while(i<=o)}return-1}function cv(e,t){return wl(e,t)>=0}function uv(e,t,r,n,a,i,o){return t=t===m?", ":t,r=r===m?"":r,n=n===m?"":n,a=a===m?-1:a,i=i===m?"...":i,o=o===m?null:o,vv(e,m4(),t,r,n,a,i,o).toString()}function vv(e,t,r,n,a,i,o,c){r=r===m?", ":r,n=n===m?"":n,a=a===m?"":a,i=i===m?-1:i,o=o===m?"...":o,c=c===m?null:c,t.j4(n);var l=0,u=0,v=e.length;e:for(;u<v;){var d=e[u];if(u=u+1|0,l=l+1|0,l>1&&t.j4(r),i<0||l<=i)hs(t,d,c);else break e}return i>=0&&l>i&&t.j4(o),t.j4(a),t}function Al(e,t,r,n,a,i,o){return t=t===m?", ":t,r=r===m?"":r,n=n===m?"":n,a=a===m?-1:a,i=i===m?"...":i,o=o===m?null:o,hv(e,m4(),t,r,n,a,i,o).toString()}function hv(e,t,r,n,a,i,o,c){r=r===m?", ":r,n=n===m?"":n,a=a===m?"":a,i=i===m?-1:i,o=o===m?"...":o,c=c===m?null:c,t.j4(n);var l=0,u=e.l();e:for(;u.m();){var v=u.o();if(l=l+1|0,l>1&&t.j4(r),i<0||l<=i)hs(t,v,c);else break e}return i>=0&&l>i&&t.j4(o),t.j4(a),t}function _l(e){if(e.t())throw gt("List is empty.");return e.x(0)}function Zl(e,t){if(a1(t,N1)){var r=B6(e.q()+t.q()|0);return r.p(e),r.p(t),r}else{var n=c4(e);return bh(n,t),n}}function I6(e,t){return e<t?t:e}function dv(e,t){return vs.k4(e,t,-1)}function T6(e,t){return e>t?t:e}function fv(e){var t=e&65535;return t}function Wo(e){return e}function H6(e){return String.fromCharCode(e)}function El(){zr=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 zr;function qo(){return zr==null&&new El,zr}function xl(){}function i3(){}function N1(){}function $2(){}function U2(){}function dt(){}function Cl(){}var pv;function e0(e,t){this.v4_1=e,this.w4_1=t}s(e0).x4=function(){return this.v4_1};s(e0).y4=function(){return this.w4_1};s(e0).z4=function(e){return Lv(this.w4_1,e.w4_1)};s(e0).a5=function(e){return this.z4(e instanceof e0?e:J())};s(e0).equals=function(e){return this===e};s(e0).hashCode=function(){return Sv(this)};s(e0).toString=function(){return this.v4_1};function ft(e){var t=e==null?null:J0(e);return t??"null"}function mv(e){for(var t=1,r=[],n=0,a=e.length;n<a;){var i=e[n];n=n+1|0;var o=t,c=i.prototype.$imask$,l=c??i.$imask$;l!=null&&(r.push(l),o=l.length);var u=i.$metadata$.iid,v;u==null?v=null:v=gv(u);var d=v;d!=null&&(r.push(d),o=Math.max(o,d.length)),o>t&&(t=o)}return wv(t,r)}function gv(e){var t=e>>5,r=new Int32Array(t+1|0),n=e&31,a=1<<n;return r[t]=r[t]|a,r}function wv(e,t){for(var r=0,n=new Int32Array(e);r<e;){for(var a=r,i=0,o=0,c=t.length;o<c;){var l=t[o];o=o+1|0,a<l.length&&(i=i|l[a])}n[a]=i,r=r+1|0}return n}function Av(e,t){var r=t>>5;if(r>e.length)return!1;var n=t&31,a=1<<n;return!!(e[r]&a)}function o3(e,t){var r=0,n=e.length-1|0;if(r<=n)do{var a=r;r=r+1|0,e[a]=t}while(a!==n);return e}function _v(e){return new P6(e)}function P6(e){this.c5_1=e,this.b5_1=0}s(P6).m=function(){return this.b5_1!==this.c5_1.length};s(P6).o=function(){var e;if(this.b5_1!==this.c5_1.length){var t=this.b5_1;this.b5_1=t+1|0,e=this.c5_1[t]}else throw gt(""+this.b5_1);return e};function Dr(){return l3(),Ml}var Ml;function Ll(){return l3(),yl}var yl,Zv;function Kr(){return l3(),Sl}var Sl;function Vl(){return l3(),Nl}var Nl;function Ev(){return l3(),Il}var Il;function xv(e){return l3(),(e|0)===e?Dl(e):(Ll()[0]=e,Q(Kr()[Ev()],31)+Kr()[Vl()]|0)}var Jo;function l3(){Jo||(Jo=!0,Ml=new ArrayBuffer(8),yl=new Float64Array(Dr()),Zv=new Float32Array(Dr()),Sl=new Int32Array(Dr()),Ll()[0]=-1,Nl=Kr()[0]!==0?1:0,Il=1-Vl()|0)}function t3(e,t){var r;if(Tl(e)){var n=e.charCodeAt(t),a;qo();var i=0;if(n<Wo(i))a=!0;else{qo();var o=65535;a=n>Wo(o)}if(a)throw W0("Invalid Char code: "+n);r=Qv(n)}else r=e.b(t);return r}function Tl(e){return typeof e=="string"}function ke(e){var t;return Tl(e)?t=e.length:t=e.a(),t}function Cv(e){return uv(e,", ","[","]",m,m,Mv)}function Mv(e){return J0(e)}function Lv(e,t){var r;switch(typeof e){case"number":var n;typeof t=="number"?n=Xo(e,t):t instanceof k?n=Xo(e,t.f5()):n=zo(e,t),r=n;break;case"string":case"boolean":r=zo(e,t);break;default:r=yv(e,t);break}return r}function Xo(e,t){var r;if(e<t)r=-1;else if(e>t)r=1;else if(e===t){var n;if(e!==0)n=0;else{var a=1/e,i;a===1/t?i=0:a<0?i=-1:i=1,n=i}r=n}else e!==e?r=t!==t?0:1:r=-1;return r}function zo(e,t){return e<t?-1:e>t?1:0}function yv(e,t){return e.a5(t)}function Sv(e){return Yr(e)}function Yr(e){if(!("kotlinHashCodeValue$"in e)){var t=Hl(),r=new Object;r.value=t,r.enumerable=!1,Object.defineProperty(e,"kotlinHashCodeValue$",r)}return e.kotlinHashCodeValue$}function Hl(){return Math.random()*4294967296|0}function J0(e){var t;return e==null?t="null":eh(e)?t="[...]":typeof e.toString!="function"?t=Vv(e):t=e.toString(),t}function Vv(e){return Object.prototype.toString.call(e)}function h1(e){if(e==null)return 0;var t=typeof e,r;switch(t){case"object":r=typeof e.hashCode=="function"?e.hashCode():Yr(e);break;case"function":r=Yr(e);break;case"number":r=xv(e);break;case"boolean":r=Nv(e);break;case"string":r=w4(String(e));break;case"bigint":r=Iv(e);break;case"symbol":r=Tv(e);break;default:r=function(){throw new Error("Unexpected typeof `"+t+"`")}();break}return r}function Nv(e){return e?1231:1237}function w4(e){var t=0,r=e.length,n=0,a=r-1|0;if(n<=a)do{var i=n;n=n+1|0;var o=e.charCodeAt(i);t=Q(t,31)+o|0}while(i!==a);return t}function Iv(e){for(var t=BigInt(32),r=BigInt(4294967295),n=e<0?-e:e,a=0,i=e<0?-1:1;n!=0;){var o=Number(n&r);a=Q(31,a)+o|0,n=n>>t}return Q(a,i)}function Tv(e){var t=Hv(e)?bv():Rv(),r=t.get(e);if(r!==m)return r;var n=Hl();return t.set(e,n),n}function Hv(e){return Symbol.keyFor(e)!=m}function bv(){return Fr===m&&(Fr=new Map),Fr}function Rv(){return Gr===m&&(Gr=new WeakMap),Gr}var Fr,Gr;function B(e,t){if(e==null)return t==null;if(t==null)return!1;if(typeof e=="object"&&typeof e.equals=="function")return e.equals(t);if(e!==e)return t!==t;if(typeof e=="number"&&typeof t=="number"){var r;if(e===t){var n;if(e!==0)n=!0;else{var a=1/e;n=a===1/t}r=n}else r=!1;return r}return e===t}function $(e,t){Error.captureStackTrace!=null?Error.captureStackTrace(e,t):e.stack=new Error().stack}function s(e){return e.prototype}function Z1(e,t,r,n){return Object.defineProperty(e,t,{configurable:!0,get:r,set:n})}function F(e){return Object.create(e)}function bl(e,t,r){Error.call(e),Ov(e,t,r)}function Ov(e,t,r){var n=Gl(Object.getPrototypeOf(e));if(!(n&1)){var a;if(t==null){var i;if(t!==null){var o=r==null?null:r.toString();i=o??m}else i=m;a=i}else a=t;e.message=a}n&2||(e.cause=r),e.name=Object.getPrototypeOf(e).constructor.name}function s3(e){var t;return e==null?Bv():t=e,t}function Bv(){throw x4()}function J(){throw C4()}function pt(e){throw ns("lateinit property "+e+" has not been initialized")}function A4(e){throw W0(e)}function kv(e,t){for(var r=e.length,n=t.length,a=0,i=t;a<r&&a<n;){var o=a,c=a;a=c+1|0,i[o]=e[c]}return t}function $v(e,t,r){var n=e.slice(0,t);e.$type$!==void 0&&(n.$type$=e.$type$);var a=e.length;if(t>a)for(n.length=t;a<t;){var i=a;a=i+1|0,n[i]=r}return n}function Rl(){Qr=this,this.g5_1=new k(0,-2147483648),this.h5_1=new k(-1,2147483647),this.i5_1=8,this.j5_1=64}var Qr;function Uv(){return Qr==null&&new Rl,Qr}function k(e,t){Uv(),o4.call(this),this.d5_1=e,this.e5_1=t}s(k).k5=function(e){return D6(this,e)};s(k).a5=function(e){return this.k5(e instanceof k?e:J())};s(k).l5=function(e){return b6(this,e)};s(k).m5=function(e){return Dv(this,e)};s(k).n5=function(){return this.o5().l5(new k(1,0))};s(k).o5=function(){return new k(~this.d5_1,~this.e5_1)};s(k).p5=function(){return this.d5_1};s(k).f5=function(){return lt(this)};s(k).valueOf=function(){return this.f5()};s(k).equals=function(e){var t;return e instanceof k?t=D0(this,e):t=!1,t};s(k).hashCode=function(){return Wv(this)};s(k).toString=function(){return jr(this,10)};function B2(){return X(),Ol}var Ol;function N6(){return X(),Bl}var Bl;function Ko(){return X(),kl}var kl;function Pv(){return X(),$l}var $l;function d2(){return X(),Ul}var Ul;function Yo(){return X(),Pl}var Pl;function D6(e,t){if(X(),D0(e,t))return 0;var r=C0(e),n=C0(t);return r&&!n?-1:!r&&n?1:C0(ot(e,t))?-1:1}function b6(e,t){X();var r=e.e5_1>>>16|0,n=e.e5_1&65535,a=e.d5_1>>>16|0,i=e.d5_1&65535,o=t.e5_1>>>16|0,c=t.e5_1&65535,l=t.d5_1>>>16|0,u=t.d5_1&65535,v=0,d=0,h=0,p=0;return p=p+(i+u|0)|0,h=h+(p>>>16|0)|0,p=p&65535,h=h+(a+l|0)|0,d=d+(h>>>16|0)|0,h=h&65535,d=d+(n+c|0)|0,v=v+(d>>>16|0)|0,d=d&65535,v=v+(r+o|0)|0,v=v&65535,new k(h<<16|p,v<<16|d)}function ot(e,t){return X(),b6(e,t.n5())}function $e(e,t){if(X(),A5(e))return B2();if(A5(t))return B2();if(D0(e,d2()))return Qo(t)?d2():B2();if(D0(t,d2()))return Qo(e)?d2():B2();if(C0(e)){var r;return C0(t)?r=$e(j1(e),j1(t)):r=j1($e(j1(e),t)),r}else if(C0(t))return j1($e(e,j1(t)));if(jo(e,Yo())&&jo(t,Yo()))return st(lt(e)*lt(t));var n=e.e5_1>>>16|0,a=e.e5_1&65535,i=e.d5_1>>>16|0,o=e.d5_1&65535,c=t.e5_1>>>16|0,l=t.e5_1&65535,u=t.d5_1>>>16|0,v=t.d5_1&65535,d=0,h=0,p=0,_=0;return _=_+Q(o,v)|0,p=p+(_>>>16|0)|0,_=_&65535,p=p+Q(i,v)|0,h=h+(p>>>16|0)|0,p=p&65535,p=p+Q(o,u)|0,h=h+(p>>>16|0)|0,p=p&65535,h=h+Q(a,v)|0,d=d+(h>>>16|0)|0,h=h&65535,h=h+Q(i,u)|0,d=d+(h>>>16|0)|0,h=h&65535,h=h+Q(o,l)|0,d=d+(h>>>16|0)|0,h=h&65535,d=d+(((Q(n,v)+Q(a,u)|0)+Q(i,l)|0)+Q(o,c)|0)|0,d=d&65535,new k(p<<16|_,d<<16|h)}function Dv(e,t){if(X(),A5(t))throw Z4("division by zero");if(A5(e))return B2();if(D0(e,d2())){if(D0(t,N6())||D0(t,Ko()))return d2();if(D0(t,d2()))return N6();var r=Gv(e,1),n=Fv(r.m5(t),1);if(D0(n,B2()))return C0(t)?N6():Ko();var a=ot(e,$e(t,n));return b6(n,a.m5(t))}else if(D0(t,d2()))return B2();if(C0(e)){var i;return C0(t)?i=j1(e).m5(j1(t)):i=j1(j1(e).m5(t)),i}else if(C0(t))return j1(e.m5(j1(t)));for(var o=B2(),c=e;Jv(c,t);){for(var l=lt(c)/lt(t),u=Math.max(1,Math.floor(l)),v=Math.ceil(Math.log(u)/Math.LN2),d=v<=48?1:Math.pow(2,v-48),h=st(u),p=$e(h,t);C0(p)||qv(p,c);)u=u-d,h=st(u),p=$e(h,t);A5(h)&&(h=N6()),o=b6(o,h),c=ot(c,p)}return o}function Fv(e,t){X();var r=t&63;return r===0?e:r<32?new k(e.d5_1<<r,e.e5_1<<r|(e.d5_1>>>(32-r|0)|0)):new k(0,e.d5_1<<(r-32|0))}function Gv(e,t){X();var r=t&63;return r===0?e:r<32?new k(e.d5_1>>>r|0|e.e5_1<<(32-r|0),e.e5_1>>r):new k(e.e5_1>>(r-32|0),e.e5_1>=0?0:-1)}function lt(e){return X(),e.e5_1*4294967296+Xv(e)}function D0(e,t){return X(),e.e5_1===t.e5_1?e.d5_1===t.d5_1:!1}function Wv(e){return X(),e.d5_1^e.e5_1}function jr(e,t){if(X(),t<2||36<t)throw Z4("radix out of range: "+t);if(A5(e))return"0";if(C0(e))if(D0(e,d2())){var r=it(t),n=e.m5(r),a=ot($e(n,r),e).p5(),i=jr(n,t);return i+a.toString(t)}else return"-"+jr(j1(e),t);for(var o=t===2?31:t<=10?9:t<=21?7:t<=35?6:5,c=st(Math.pow(t,o)),l=e,u="";;){var v=l.m5(c),d=ot(l,$e(v,c)).p5(),h=d.toString(t);if(l=v,A5(l))return h+u;for(;h.length<o;)h="0"+h;u=h+u}}function it(e){return X(),new k(e,e<0?-1:0)}function C0(e){return X(),e.e5_1<0}function A5(e){return X(),e.e5_1===0?e.d5_1===0:!1}function Qo(e){return X(),(e.d5_1&1)===1}function j1(e){return X(),e.n5()}function jo(e,t){return X(),D6(e,t)<0}function st(e){if(X(),Iu(e))return B2();if(e<=-9223372036854776e3)return d2();if(e+1>=9223372036854776e3)return Pv();if(e<0)return j1(st(-e));var t=4294967296,r=e%t|0,n=e/t|0;return new k(r,n)}function qv(e,t){return X(),D6(e,t)>0}function Jv(e,t){return X(),D6(e,t)>=0}function Xv(e){return X(),e.d5_1>=0?e.d5_1:4294967296+e.d5_1}var el;function X(){el||(el=!0,Ol=it(0),Bl=it(1),kl=it(-1),$l=new k(-1,2147483647),Ul=new k(0,-2147483648),Pl=it(16777216))}function Z(e,t,r,n,a){return _4("class",e,t,r,n,a,null)}function _4(e,t,r,n,a,i,o){var c=m;return{kind:e,simpleName:t,associatedObjectKey:n,associatedObjects:a,suspendArity:i,$kClass$:c,defaultConstructor:r,iid:o}}function w(e,t,r,n,a,i,o,c,l){n!=null&&(e.prototype=Object.create(n.prototype),e.prototype.constructor=e);var u=r(t,i,o,c,l??[]);if(e.$metadata$=u,a!=null){var v=u.iid!=null?e:e.prototype;v.$imask$=mv(a)}}function F2(e,t,r,n,a){return _4("interface",e,t,r,n,a,zv())}function zv(){return at===m&&(at=0),at=at+1|0,at}var at;function x1(e,t,r,n,a){return _4("object",e,t,r,n,a,null)}function c3(e){var t=e.length,r=Array(t),n=0,a=t-1|0;if(n<=a)do{var i=n;n=n+1|0;var o=e[i];o!=null&&r3(o)?r[i]=o:r[i]=[].slice.call(o)}while(i!==a);return[].concat.apply([],r)}function Dl(e){var t;return e instanceof k?t=e.p5():t=Kv(e),t}function Kv(e){var t;return e>2147483647?t=2147483647:e<-2147483648?t=-2147483648:t=e|0,t}function Yv(e){return e<<16>>16}function Qv(e){var t=Dl(e),r=Yv(t);return fv(r)}function jv(e,t){return new Ue(e,t)}function eh(e){return Fl(e)?!0:Jr(e)}function Fl(e){return Array.isArray(e)}function a1(e,t){return th(e,t.$metadata$.iid)}function th(e,t){var r=e.$imask$,n;if(r==null)return!1;n=r;var a=n;return Av(a,t)}function r3(e){var t;return Fl(e)?t=!e.$type$:t=!1,t}function rh(e){return typeof e=="string"?!0:a1(e,i4)}function Gl(e){var t=e.constructor,r=t==null?null:t.$metadata$,n=r==null?null:r.errorInfo;if(n!=null)return n;var a=0;if(tl(e,"message")&&(a=a|1),tl(e,"cause")&&(a=a|2),a!==3){var i=nh(e);i!=Error.prototype&&(a=a|Gl(i))}return r!=null&&(r.errorInfo=a),a}function tl(e,t){return e.hasOwnProperty(t)}function nh(e){return Object.getPrototypeOf(e)}var m;function ah(e,t,r,n){r=r===m?0:r,n=n===m?e.length:n,W1.h(r,n,e.length),e.fill(t,r,n)}function Wr(e,t,r,n){r=r===m?0:r,n=n===m?e.length:n,W1.h(r,n,e.length),e.fill(t,r,n)}function Wl(e){return new _1(e)}function ih(e,t){if(!(t>=0)){var r="Invalid new array size: "+t+".";throw W0(J0(r))}return kv(e,new Int32Array(t))}function oh(e,t){if(!(t>=0)){var r="Invalid new array size: "+t+".";throw W0(J0(r))}return $v(e,t,null)}function ql(e){return bl(e),G2.call(e),e}function Jl(){var e=ql(F(s(G2)));return $(e,Jl),e}function Xl(e,t){return bl(t,e),G2.call(t),t}function Z4(e){var t=Xl(e,F(s(G2)));return $(t,Z4),t}function G2(){$(this,G2)}function lh(e){return X0(e),u3.call(e),e}function zl(){var e=lh(F(s(u3)));return $(e,zl),e}function sh(e,t){return Z5(e,t),u3.call(t),t}function W0(e){var t=sh(e,F(s(u3)));return $(t,W0),t}function u3(){$(this,u3)}function ch(e){return X0(e),h3.call(e),e}function Kl(){var e=ch(F(s(h3)));return $(e,Kl),e}function uh(e,t){return Z5(e,t),h3.call(t),t}function v3(e){var t=uh(e,F(s(h3)));return $(t,v3),t}function h3(){$(this,h3)}function vh(e){return X0(e),d3.call(e),e}function Yl(){var e=vh(F(s(d3)));return $(e,Yl),e}function hh(e,t){return Z5(e,t),d3.call(t),t}function mt(e){var t=hh(e,F(s(d3)));return $(t,mt),t}function d3(){$(this,d3)}function dh(e){return X0(e),F6.call(e),e}function f3(){var e=dh(F(s(F6)));return $(e,f3),e}function F6(){$(this,F6)}function X0(e){return ql(e),k1.call(e),e}function Ql(){var e=X0(F(s(k1)));return $(e,Ql),e}function Z5(e,t){return Xl(e,t),k1.call(t),t}function jl(e){var t=Z5(e,F(s(k1)));return $(t,jl),t}function k1(){$(this,k1)}function fh(e){return X0(e),p3.call(e),e}function W2(){var e=fh(F(s(p3)));return $(e,W2),e}function ph(e,t){return Z5(e,t),p3.call(t),t}function gt(e){var t=ph(e,F(s(p3)));return $(t,gt),t}function p3(){$(this,p3)}function mh(e){return X0(e),G6.call(e),e}function E4(){var e=mh(F(s(G6)));return $(e,E4),e}function G6(){$(this,G6)}function gh(e){return X0(e),m3.call(e),e}function es(){var e=gh(F(s(m3)));return $(e,es),e}function wh(e,t){return Z5(e,t),m3.call(t),t}function ts(e){var t=wh(e,F(s(m3)));return $(t,ts),t}function m3(){$(this,m3)}function Ah(e){return X0(e),W6.call(e),e}function x4(){var e=Ah(F(s(W6)));return $(e,x4),e}function W6(){$(this,W6)}function _h(e){return X0(e),q6.call(e),e}function C4(){var e=_h(F(s(q6)));return $(e,C4),e}function q6(){$(this,q6)}function Zh(e){return X0(e),g3.call(e),e}function rs(){var e=Zh(F(s(g3)));return $(e,rs),e}function Eh(e,t){return Z5(e,t),g3.call(t),t}function ns(e){var t=Eh(e,F(s(g3)));return $(t,ns),t}function g3(){$(this,g3)}function xh(e){return function(t){return t===e?"(this Collection)":ft(t)}}function P2(){}s(P2).r=function(e){var t;e:{var r;if(a1(this,N1)?r=this.t():r=!1,r){t=!1;break e}for(var n=this.l();n.m();){var a=n.o();if(B(a,e)){t=!0;break e}}t=!1}return t};s(P2).s=function(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o();if(!this.r(a)){t=!1;break e}}t=!0}return t};s(P2).t=function(){return this.q()===0};s(P2).toString=function(){return Al(this,", ","[","]",m,m,xh(this))};s(P2).toArray=function(){return il(this)};function De(){this.g_1=2147483639}s(De).y1=function(e,t){if(e<0||e>=t)throw v3("index: "+e+", size: "+t)};s(De).z1=function(e,t){if(e<0||e>t)throw v3("index: "+e+", size: "+t)};s(De).h=function(e,t,r){if(e<0||t>r)throw v3("fromIndex: "+e+", toIndex: "+t+", size: "+r);if(e>t)throw W0("fromIndex: "+e+" > toIndex: "+t)};s(De).b3=function(e,t){var r=e+(e>>1)|0;return(r-t|0)<0&&(r=t),(r-2147483639|0)>0&&(r=t>2147483639?s4.MAX_VALUE:2147483639),r};s(De).d1=function(e){for(var t=1,r=e.l();r.m();){var n=r.o(),a=Q(31,t),i=n==null?null:h1(n);t=a+(i??0)|0}return t};s(De).c1=function(e,t){if(e.q()!==t.q())return!1;for(var r=t.l(),n=e.l();n.m();){var a=n.o(),i=r.o();if(!B(a,i))return!1}return!0};var W1;function rl(e,t){return t===e?"(this Map)":ft(t)}function as(e,t){var r;e:{for(var n=e.k1().l();n.m();){var a=n.o();if(B(a.l1(),t)){r=a;break e}}r=null}return r}function is(){}var Ch;function Mh(e){return function(t){return e.s5(t)}}function L0(){this.n1_1=null,this.o1_1=null}s(L0).p1=function(e){return as(this,e)!=null};s(L0).q1=function(e){if(!(e!=null&&a1(e,$2)))return!1;var t=e.l1(),r=e.m1(),n=(a1(this,U2)?this:J()).r1(t);if(!B(r,n))return!1;var a;return n==null?a=!(a1(this,U2)?this:J()).p1(t):a=!1,!a};s(L0).equals=function(e){if(e===this)return!0;if(!(e!=null&&a1(e,U2))||this.q()!==e.q())return!1;var t;e:{var r=e.k1(),n;if(a1(r,N1)?n=r.t():n=!1,n){t=!0;break e}for(var a=r.l();a.m();){var i=a.o();if(!this.q1(i)){t=!1;break e}}t=!0}return t};s(L0).r1=function(e){var t=as(this,e);return t==null?null:t.m1()};s(L0).hashCode=function(){return h1(this.k1())};s(L0).q=function(){return this.k1().q()};s(L0).toString=function(){var e=this.k1();return Al(e,", ","{","}",m,m,Mh(this))};s(L0).s5=function(e){return rl(this,e.l1())+"="+rl(this,e.m1())};function J6(){}s(J6).t1=function(e){for(var t=0,r=e.l();r.m();){var n=r.o(),a=t,i=n==null?null:h1(n);t=a+(i??0)|0}return t};s(J6).s1=function(e,t){return e.q()!==t.q()?!1:e.s(t)};var M4;function Lh(e){return M0.call(e),i1.call(e),e.v5_1=L4().x5_1,e}function wt(){return Lh(F(s(i1)))}function At(e,t){if(t<0)throw mt("Deque is too big.");if(t<=e.v5_1.length)return y;if(e.v5_1===L4().x5_1){var r=e,n=I6(t,10);return r.v5_1=o3(Array(n),null),y}var a=W1.b3(e.v5_1.length,t);yh(e,a)}function yh(e,t){var r=o3(Array(t),null),n=e.v5_1,a=e.u5_1,i=e.v5_1.length;R(n,r,0,a,i);var o=e.v5_1,c=e.v5_1.length-e.u5_1|0,l=e.u5_1;R(o,r,c,0,l),e.u5_1=0,e.v5_1=r}function f0(e,t){return t>=e.v5_1.length?t-e.v5_1.length|0:t}function Sh(e,t){return t<0?t+e.v5_1.length|0:t}function os(e,t){return t===gl(e.v5_1)?0:t+1|0}function e4(e,t){return t===0?gl(e.v5_1):t-1|0}function t4(e,t,r){var n=r.l(),a=t,i=e.v5_1.length;if(a<i)e:do{var o=a;if(a=a+1|0,!n.m())break e;e.v5_1[o]=n.o()}while(a<i);var c=0,l=e.u5_1;if(c<l)e:do{var u=c;if(c=c+1|0,!n.m())break e;e.v5_1[u]=n.o()}while(c<l);e.w5_1=e.w5_1+r.q()|0}function ls(){r4=this;var e=this;e.x5_1=[],this.y5_1=10}var r4;function L4(){return r4==null&&new ls,r4}s(i1).q=function(){return this.w5_1};s(i1).t=function(){return this.w5_1===0};s(i1).z5=function(e){At(this,this.w5_1+1|0),this.u5_1=e4(this,this.u5_1),this.v5_1[this.u5_1]=e,this.w5_1=this.w5_1+1|0};s(i1).a6=function(e){At(this,this.w5_1+1|0);var t=this.v5_1,r=this.w5_1;t[f0(this,this.u5_1+r|0)]=e,this.w5_1=this.w5_1+1|0};s(i1).b6=function(){if(this.t())throw gt("ArrayDeque is empty.");var e=this.u5_1,t=this.v5_1[e],r=t==null||t!=null?t:J();return this.v5_1[this.u5_1]=null,this.u5_1=os(this,this.u5_1),this.w5_1=this.w5_1-1|0,r};s(i1).c6=function(){if(this.t())throw gt("ArrayDeque is empty.");var e=R6(this),t=f0(this,this.u5_1+e|0),r=this.v5_1[t],n=r==null||r!=null?r:J();return this.v5_1[t]=null,this.w5_1=this.w5_1-1|0,n};s(i1).i=function(e){return this.a6(e),!0};s(i1).a1=function(e,t){if(W1.z1(e,this.w5_1),e===this.w5_1)return this.a6(t),y;if(e===0)return this.z5(t),y;At(this,this.w5_1+1|0);var r=f0(this,this.u5_1+e|0);if(e<(this.w5_1+1|0)>>1){var n=e4(this,r),a=e4(this,this.u5_1);if(n>=this.u5_1){this.v5_1[a]=this.v5_1[this.u5_1];var i=this.v5_1,o=this.v5_1,c=this.u5_1,l=this.u5_1+1|0,u=n+1|0;R(i,o,c,l,u)}else{var v=this.v5_1,d=this.v5_1,h=this.u5_1-1|0,p=this.u5_1,_=this.v5_1.length;R(v,d,h,p,_),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var C=this.v5_1,I=this.v5_1,m1=n+1|0;R(C,I,0,1,m1)}this.v5_1[n]=t,this.u5_1=a}else{var g1=this.w5_1,F1=f0(this,this.u5_1+g1|0);if(r<F1){var r0=this.v5_1,g2=this.v5_1,t2=r+1|0;R(r0,g2,t2,r,F1)}else{var r2=this.v5_1,T0=this.v5_1;R(r2,T0,1,0,F1),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var w2=this.v5_1,A2=this.v5_1,n2=r+1|0,Ke=this.v5_1.length-1|0;R(w2,A2,n2,r,Ke)}this.v5_1[r]=t}this.w5_1=this.w5_1+1|0};s(i1).p=function(e){if(e.t())return!1;At(this,this.w5_1+e.q()|0);var t=this.w5_1,r=f0(this,this.u5_1+t|0);return t4(this,r,e),!0};s(i1).d6=function(e,t){if(W1.z1(e,this.w5_1),t.t())return!1;if(e===this.w5_1)return this.p(t);At(this,this.w5_1+t.q()|0);var r=this.w5_1,n=f0(this,this.u5_1+r|0),a=f0(this,this.u5_1+e|0),i=t.q();if(e<(this.w5_1+1|0)>>1){var o=this.u5_1-i|0;if(a>=this.u5_1)if(o>=0){var c=this.v5_1,l=this.v5_1,u=o,v=this.u5_1;R(c,l,u,v,a)}else{o=o+this.v5_1.length|0;var d=a-this.u5_1|0,h=this.v5_1.length-o|0;if(h>=d){var p=this.v5_1,_=this.v5_1,C=o,I=this.u5_1;R(p,_,C,I,a)}else{var m1=this.v5_1,g1=this.v5_1,F1=o,r0=this.u5_1,g2=this.u5_1+h|0;R(m1,g1,F1,r0,g2);var t2=this.v5_1,r2=this.v5_1,T0=this.u5_1+h|0;R(t2,r2,0,T0,a)}}else{var w2=this.v5_1,A2=this.v5_1,n2=o,Ke=this.u5_1,H5=this.v5_1.length;if(R(w2,A2,n2,Ke,H5),i>=a){var b5=this.v5_1,R5=this.v5_1,s9=this.v5_1.length-i|0;R(b5,R5,s9,0,a)}else{var c9=this.v5_1,u9=this.v5_1,v9=this.v5_1.length-i|0;R(c9,u9,v9,0,i);var h9=this.v5_1,d9=this.v5_1;R(h9,d9,0,i,a)}}this.u5_1=o,t4(this,Sh(this,a-i|0),t)}else{var Ye=a+i|0;if(a<n)if((n+i|0)<=this.v5_1.length){var f9=this.v5_1,p9=this.v5_1;R(f9,p9,Ye,a,n)}else if(Ye>=this.v5_1.length){var m9=this.v5_1,g9=this.v5_1,w9=Ye-this.v5_1.length|0;R(m9,g9,w9,a,n)}else{var dn=(n+i|0)-this.v5_1.length|0,A9=this.v5_1,_9=this.v5_1,Z9=n-dn|0;R(A9,_9,0,Z9,n);var E9=this.v5_1,x9=this.v5_1,C9=n-dn|0;R(E9,x9,Ye,a,C9)}else{var M9=this.v5_1,L9=this.v5_1;if(R(M9,L9,i,0,n),Ye>=this.v5_1.length){var y9=this.v5_1,S9=this.v5_1,V9=Ye-this.v5_1.length|0,N9=this.v5_1.length;R(y9,S9,V9,a,N9)}else{var I9=this.v5_1,T9=this.v5_1,H9=this.v5_1.length-i|0,b9=this.v5_1.length;R(I9,T9,0,H9,b9);var R9=this.v5_1,O9=this.v5_1,B9=this.v5_1.length-i|0;R(R9,O9,Ye,a,B9)}}t4(this,a,t)}return!0};s(i1).x=function(e){W1.y1(e,this.w5_1);var t=f0(this,this.u5_1+e|0),r=this.v5_1[t];return r==null||r!=null?r:J()};s(i1).r=function(e){return this.b1(e)!==-1};s(i1).b1=function(e){var t=this.w5_1,r=f0(this,this.u5_1+t|0);if(this.u5_1<r){var n=this.u5_1;if(n<r)do{var a=n;if(n=n+1|0,B(e,this.v5_1[a]))return a-this.u5_1|0}while(n<r)}else if(this.u5_1>=r){var i=this.u5_1,o=this.v5_1.length;if(i<o)do{var c=i;if(i=i+1|0,B(e,this.v5_1[c]))return c-this.u5_1|0}while(i<o);var l=0;if(l<r)do{var u=l;if(l=l+1|0,B(e,this.v5_1[u]))return(u+this.v5_1.length|0)-this.u5_1|0}while(l<r)}return-1};s(i1).j=function(e){var t=this.b1(e);return t===-1?!1:(this.z(t),!0)};s(i1).z=function(e){if(W1.y1(e,this.w5_1),e===R6(this))return this.c6();if(e===0)return this.b6();var t=f0(this,this.u5_1+e|0),r=this.v5_1[t],n=r==null||r!=null?r:J();if(e<this.w5_1>>1){if(t>=this.u5_1){var a=this.v5_1,i=this.v5_1,o=this.u5_1+1|0,c=this.u5_1;R(a,i,o,c,t)}else{var l=this.v5_1,u=this.v5_1;R(l,u,1,0,t),this.v5_1[0]=this.v5_1[this.v5_1.length-1|0];var v=this.v5_1,d=this.v5_1,h=this.u5_1+1|0,p=this.u5_1,_=this.v5_1.length-1|0;R(v,d,h,p,_)}this.v5_1[this.u5_1]=null,this.u5_1=os(this,this.u5_1)}else{var C=R6(this),I=f0(this,this.u5_1+C|0);if(t<=I){var m1=this.v5_1,g1=this.v5_1,F1=t+1|0,r0=I+1|0;R(m1,g1,t,F1,r0)}else{var g2=this.v5_1,t2=this.v5_1,r2=t+1|0,T0=this.v5_1.length;R(g2,t2,t,r2,T0),this.v5_1[this.v5_1.length-1|0]=this.v5_1[0];var w2=this.v5_1,A2=this.v5_1,n2=I+1|0;R(w2,A2,0,1,n2)}this.v5_1[I]=null}return this.w5_1=this.w5_1-1|0,n};s(i1).e6=function(){var e=this.w5_1,t=f0(this,this.u5_1+e|0);this.u5_1<t?Wr(this.v5_1,null,this.u5_1,t):this.t()||(Wr(this.v5_1,null,this.u5_1,this.v5_1.length),Wr(this.v5_1,null,0,t)),this.u5_1=0,this.w5_1=0};s(i1).f6=function(e){var t=e.length>=this.w5_1?e:bu(e,this.w5_1),r=r3(t)?t:J(),n=this.w5_1,a=f0(this,this.u5_1+n|0);if(this.u5_1<a){var i=this.v5_1,o=this.u5_1;R(i,r,0,o,a)}else if(!this.t()){var c=this.v5_1,l=this.u5_1,u=this.v5_1.length;R(c,r,0,l,u);var v=this.v5_1,d=this.v5_1.length-this.u5_1|0;R(v,r,d,0,a)}var h=Hu(this.w5_1,r);return r3(h)?h:J()};s(i1).a2=function(){var e=this.w5_1,t=o3(Array(e),null);return this.f6(t)};s(i1).toArray=function(){return this.a2()};function i1(){L4(),this.u5_1=0,this.w5_1=0}function Vh(e){if(e.t())return[];for(var t=e.q(),r=o3(Array(t),null),n=e.l(),a=0;n.m();){var i=a;a=i+1|0,r[i]=n.o()}return r}function S0(){return Nh()}function ss(e){return e.length>0?Wl(e):S0()}function R6(e){return e.q()-1|0}function z0(){n4=this,this.g6_1=new k(-1478467534,-1720727600)}s(z0).equals=function(e){var t;return e!=null&&a1(e,i3)?t=e.t():t=!1,t};s(z0).hashCode=function(){return 1};s(z0).toString=function(){return"[]"};s(z0).q=function(){return 0};s(z0).t=function(){return!0};s(z0).h6=function(e){return e.t()};s(z0).s=function(e){return this.h6(e)};s(z0).x=function(e){throw v3("Empty list doesn't contain element at index "+e+".")};s(z0).l=function(){return cs};var n4;function Nh(){return n4==null&&new z0,n4}function X6(){}s(X6).m=function(){return!1};s(X6).o=function(){throw W2()};var cs;function Ih(e){return new q2(e,!1)}function Th(e){return e.length===0?q1():c4(new q2(e,!0))}function q2(e,t){this.i6_1=e,this.j6_1=t}s(q2).q=function(){return this.i6_1.length};s(q2).t=function(){return this.i6_1.length===0};s(q2).k6=function(e){return cv(this.i6_1,e)};s(q2).l6=function(e){var t;e:{var r;if(a1(e,N1)?r=e.t():r=!1,r){t=!0;break e}for(var n=e.l();n.m();){var a=n.o();if(!this.k6(a)){t=!1;break e}}t=!0}return t};s(q2).s=function(e){return this.l6(e)};s(q2).l=function(){return _v(this.i6_1)};function Hh(){throw ts("Index overflow has happened.")}function y4(e,t){return e.p(Wl(t))}function bh(e,t){if(a1(t,N1))return e.p(t);for(var r=!1,n=t.l();n.m();){var a=n.o();e.i(a)&&(r=!0)}return r}function z6(){}s(z6).o=function(){return this.m6()};function Rh(e,t,r){var n;if(r>0)n=e>=t?t:t-nl(t,e,r)|0;else if(r<0)n=e<=t?t:t+nl(e,t,-r|0)|0;else throw W0("Step is zero.");return n}function nl(e,t,r){return qr(qr(e,r)-qr(t,r)|0,r)}function qr(e,t){var r=e%t|0;return r>=0?r:r+t|0}function us(){a4=this,this.n6_1=new Ue(1,0)}var a4;function Oh(){return a4==null&&new us,a4}function Ue(e,t){Oh(),f2.call(this,e,t,1)}s(Ue).t=function(){return this.r6_1>this.s6_1};s(Ue).equals=function(e){var t;return e instanceof Ue?t=this.t()&&e.t()?!0:this.r6_1===e.r6_1?this.s6_1===e.s6_1:!1:t=!1,t};s(Ue).hashCode=function(){return this.t()?-1:Q(31,this.r6_1)+this.s6_1|0};s(Ue).toString=function(){return""+this.r6_1+".."+this.s6_1};function K6(e,t,r){z6.call(this),this.u6_1=r,this.v6_1=t,this.w6_1=this.u6_1>0?e<=t:e>=t,this.x6_1=this.w6_1?e:this.v6_1}s(K6).m=function(){return this.w6_1};s(K6).m6=function(){var e=this.x6_1;if(e===this.v6_1){if(!this.w6_1)throw W2();this.w6_1=!1}else this.x6_1=this.x6_1+this.u6_1|0;return e};function S4(){}s(S4).k4=function(e,t,r){return new f2(e,t,r)};var vs;function f2(e,t,r){if(r===0)throw W0("Step must be non-zero.");if(r===s4.MIN_VALUE)throw W0("Step must be greater than Int.MIN_VALUE to avoid overflow on negation.");this.r6_1=e,this.s6_1=Rh(e,t,r),this.t6_1=r}s(f2).l=function(){return new K6(this.r6_1,this.s6_1,this.t6_1)};s(f2).t=function(){return this.t6_1>0?this.r6_1>this.s6_1:this.r6_1<this.s6_1};s(f2).equals=function(e){var t;return e instanceof f2?t=this.t()&&e.t()?!0:this.r6_1===e.r6_1&&this.s6_1===e.s6_1?this.t6_1===e.t6_1:!1:t=!1,t};s(f2).hashCode=function(){return this.t()?-1:Q(31,Q(31,this.r6_1)+this.s6_1|0)+this.t6_1|0};s(f2).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 hs(e,t,r){r!=null?e.j4(r(t)):t==null||rh(t)?e.j4(t):t instanceof xl?e.z3(t.y6_1):e.j4(ft(t))}function Bh(e,t,r){if(r=r===m?!1:r,e===t)return!0;if(!r)return!1;var n=Go(e),a=Go(t),i;if(n===a)i=!0;else{var o=H6(n).toLowerCase(),c=t3(o,0),l=H6(a).toLowerCase();i=c===t3(l,0)}return i}function ds(e){return ke(e)-1|0}function V4(e,t,r){r=r===m?!1:r;var n;return typeof t=="string"?n=kh(e,t,m,r)>=0:n=fs(e,t,0,ke(e),r)>=0,n}function kh(e,t,r,n){r=r===m?0:r,n=n===m?!1:n;var a,i;return n?i=!0:i=typeof e!="string",i?a=fs(e,t,r,ke(e),n):a=e.indexOf(t,r),a}function fs(e,t,r,n,a,i){i=i===m?!1:i;var o=i?dv(T6(r,ds(e)),I6(n,0)):jv(I6(r,0),T6(n,ke(e))),c;if(typeof e=="string"?c=typeof t=="string":c=!1,c){var l=o.r6_1,u=o.s6_1,v=o.t6_1;if(v>0&&l<=u||v<0&&u<=l)do{var d=l;if(l=l+v|0,lv(t,0,e,d,ke(t),a))return d}while(d!==u)}else{var h=o.r6_1,p=o.s6_1,_=o.t6_1;if(_>0&&h<=p||_<0&&p<=h)do{var C=h;if(h=h+_|0,ps(t,0,e,C,ke(t),a))return C}while(C!==p)}return-1}function ps(e,t,r,n,a,i){if(n<0||t<0||t>(ke(e)-a|0)||n>(ke(r)-a|0))return!1;var o=0;if(o<a)do{var c=o;if(o=o+1|0,!Bh(t3(e,t+c|0),t3(r,n+c|0),i))return!1}while(o<a);return!0}function V1(e,t){this.z6_1=e,this.a7_1=t}s(V1).toString=function(){return"("+this.z6_1+", "+this.a7_1+")"};s(V1).b7=function(){return this.z6_1};s(V1).c7=function(){return this.a7_1};s(V1).hashCode=function(){var e=this.z6_1==null?0:h1(this.z6_1);return e=Q(e,31)+(this.a7_1==null?0:h1(this.a7_1))|0,e};s(V1).equals=function(e){if(this===e)return!0;if(!(e instanceof V1))return!1;var t=e instanceof V1?e:J();return!(!B(this.z6_1,t.z6_1)||!B(this.a7_1,t.a7_1))};function ms(e,t){return new V1(e,t)}s(H1).o2=Nu;y=new l4;s4=new n3;ut=new fl;pv=new Cl;W1=new De;Ch=new is;M4=new J6;cs=new X6;vs=new S4;var J2=Math.imul;w(T4,"OneAtATimeAssembler",Z);w(H4,"AllAtOnceAssembler",Z);w($1,"SubscribeCallbackParams",Z);w(p0,"Mode",Z,e0);w(E5,"Callback",Z);w(R4,m,Z);w(I1,"DispatcherImpl",Z);w(U1,"EmptyOptions",Z,m,m,U1);w(o1,"DispatcherSnapshot",Z);w(C1,"EventScope",Z,e0);w(O4,"NoOpUnsubscriber",x1);w(w3,"BaseTrace",Z);w(Ct,"ErrorInfo",Z);w(Is,"PerformanceAnalyticsDelegate",F2);w(Zt,"NoOpPerformanceAnalyticsDelegate",Z,m,[Is],Zt);w(Mt,"RuntimeTrace",Z,w3);w(We,"Disabled",x1);w(Lt,"NiceLogger",Z);w(Ge,"NoOpLogger",Z,m,m,Ge);w(B4,"IntervalEventDeduper",Z);w(k4,"LocalEventsDeduper",Z);w(J1,"TimerDefinition",Z);w(a7,"Span",Z);w($4,"Tracer",x1);w(i7,"JsDispatcherImpl",Z,I1);w(o7,"JsRequestBuilderAdapter",Z);w(Et,"JsonStateOperations",Z,m,m,Et);function T4(e,t){this.d7_1=e,this.e7_1=t}s(T4).f7=function(e,t){var r;if(e.t())r=S0();else{for(var n=this.e7_1.list(),a=e.b6();_s(a);){for(var i=0,o=n.length;i<o;){var c=n[i];if(i=i+1|0,c.id===a.hook)return this.d7_1.h7([""+t+" building batch of ",a]),O6(a)}if(!e.t())a=e.b6();else return S0()}this.d7_1.h7([""+t+" building batch of ",a]),r=O6(a)}return r};function H4(e,t){this.i7_1=e,this.j7_1=t}s(H4).f7=function(e,t){var r;if(e.t())r=S0();else{for(var n=this.j7_1.list(),a=q1(),i=e.l();i.m();){var o=i.o(),c;if(_s(o)){var l;if(n.length===0)l=!1;else{var u;e:{for(var v=0,d=n.length;v<d;){var h=n[v];if(v=v+1|0,h.id===o.hook){u=h;break e}}u=null}l=u!=null}c=l}else c=!0;c&&a.i(o)}var p=a;e.e6(),this.i7_1.h7([""+t+" building batch of ",p]),r=p}return r};function _s(e){var t=e.hook;return(t==null?null:V4(t,"useInterval"))===!0}function $1(e,t,r){this.request=e,this.response=t,this.mode=r}s($1).k7=function(){return this.request};s($1).l7=function(){return this.response};s($1).m7=function(){return this.mode};s($1).b7=function(){return this.request};s($1).c7=function(){return this.response};s($1).n7=function(){return this.mode};s($1).o7=function(e,t,r){return new $1(e,t,r)};s($1).copy=function(e,t,r,n){return e=e===m?this.request:e,t=t===m?this.response:t,r=r===m?this.mode:r,this.o7(e,t,r)};s($1).toString=function(){return"SubscribeCallbackParams(request="+this.request+", response="+this.response+", mode="+this.mode+")"};s($1).hashCode=function(){var e=this.request==null?0:h1(this.request);return e=J2(e,31)+(this.response==null?0:h1(this.response))|0,e=J2(e,31)+this.mode.hashCode()|0,e};s($1).equals=function(e){if(this===e)return!0;if(!(e instanceof $1))return!1;var t=e instanceof $1?e:J();return!(!B(this.request,t.request)||!B(this.response,t.response)||!this.mode.equals(t.mode))};var Zs,Es,xs;function $h(){return[p2(),_t(),m2()]}function Uh(e){switch(e){case"SYNC":return p2();case"ASYNC":return _t();case"SPEC":return m2();default:Q6(),A4("No enum constant value.");break}}var gs;function Q6(){if(gs)return y;gs=!0,Zs=new p0("SYNC",0),Es=new p0("ASYNC",1),xs=new p0("SPEC",2)}function p0(e,t){e0.call(this,e,t)}function p2(){return Q6(),Zs}function _t(){return Q6(),Es}function m2(){return Q6(),xs}function E5(e,t){this.r7_1=e,this.s7_1=t}s(E5).toString=function(){return"Callback(success="+this.r7_1+", failure="+this.s7_1+")"};s(E5).hashCode=function(){var e=h1(this.r7_1);return e=J2(e,31)+h1(this.s7_1)|0,e};s(E5).equals=function(e){if(this===e)return!0;if(!(e instanceof E5))return!1;var t=e instanceof E5?e:J();return!(!B(this.r7_1,t.r7_1)||!B(this.s7_1,t.s7_1))};function N4(e){var t=e.b8_1;if(t!=null)return t;pt("assembler")}function x5(e){var t=e.i8_1;if(t!=null)return t;pt("local")}function xt(e){var t=e.j8_1;if(t!=null)return t;pt("remote")}function j6(e){var t=e.k8_1;if(t!=null)return t;pt("timers")}function Cs(e){Ms(e),e.p8_1=!0,e.y7_1.h7(["recalculateSpeculativeWork"]);var t=e.c8_1.l(),r=0;e:for(;t.m();){var n=r;r=r+1|0;var a=t.o();if(n===0||a.retry===!0||a.async===!0||a.scope.equals(Fe()))continue e;if(e.e8_1.w5_1>10)break e;e.e8_1.i(a)}e.y7_1.h7(["Speculative queue size: "+e.e8_1.w5_1]),e7(e,e.e8_1)}function b4(e){e.y7_1.h7(["cancelSpeculation"]),e.p8_1=!1,Ms(e)}function Ms(e){e.e8_1.e6(),e.m8_1=e.v7_1.clone(e.state),e.n8_1=e.n8_1+1|0}function I4(e,t,r){if(t.t())return y;var n=_l(t),a=n.scope.equals(Fe())?!0:td(n.scope)?!x5(e).isReady():!1;r.equals(p2())&&(e.f8_1=!0);var i=e.u7_1.q8(r.equals(m2())?e.m8_1:e.state,t),o=a?xt(e):x5(e),c=e.z7_1;e.z7_1=c+1|0;var l=c,u=e.n8_1,v=bs.r8("runtime_trace"),d=qh(e,r,a,v,t,l,u,i),h=new E5(d,Xh(e,r,a,v,l,t));e.g8_1.i1(l,h),e.y7_1.h7(["Signpost: Handling "+Y6(e,r,a)+" request"]),e7(e,i),o.handle(e.w7_1,i,h.r7_1,h.s7_1)}function Y6(e,t,r){return(r?"remote":"local")+" "+t+" runtime"}function Ls(e,t){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(),x5(e).reset(),xt(e).reset(),b4(e),t&&j6(e).clear()}function C5(e,t,r){var n;try{n=r()}catch(o){var a;if(o instanceof G2){var i=o;e.y7_1.s8([i]),e.x7_1.errorHandler(i),a=t}else throw o;n=a}return n}function e7(e,t){e.x7_1.featureFlags.isVerboseLoggingEnabled&&e.y7_1.h7([t])}function Ph(e){return function(){return x5(e).isReady()}}function Dh(e){return function(t){var r,n;e:{for(var a=e.c8_1.l();a.m();){var i=a.o();if(i.hook===t){n=i;break e}}n=null}if(n!=null)r=!0;else{var o;e:{for(var c=e.d8_1.l();c.m();){var l=c.o();if(l.hook===t){o=l;break e}}o=null}r=o!=null}return r}}function Fh(e,t,r,n){return function(){e.y7_1.h7(["Signpost: Initializing Dispatcher",t,r]),e.i8_1=t,e.j8_1=r,e.k8_1=n;var a=e,i;return e.x7_1.featureFlags.isUsingEverythingAssembler?i=new H4(e.y7_1,n):i=new T4(e.y7_1,n),a.b8_1=i,e.t8(),y}}function R4(e,t){this.u8_1=e,this.v8_1=t}s(R4).unsubscribe=function(){this.u8_1.h8_1.j(this.v8_1)};function Gh(e,t){return function(){var r=typeof e=="function"?e:J();return t.h8_1.i(r),new R4(t,r)}}function Wh(e,t,r,n,a,i,o,c,l){return function(){e.y7_1.h7(["Signpost: Response success for "+Y6(e,t,r)+" request"]),e7(e,n),a.z8(),rd(e.x7_1.performanceAnalyticsDelegate,a,r,"",i.q()),e.g8_1.j1(o);var u;if(t.equals(m2())&&e.n8_1!==c)return e.y7_1.h7(["throwing away stale speculative results"]),y;var v;t.equals(p2())?(e.state=e.v7_1.merge(e.state,n.state),e.f8_1=!1,v=y):t.equals(m2())&&(e.m8_1=e.v7_1.merge(e.m8_1,n.state),v=y),e.y7_1.h7(["Responding to "+Y6(e,t,r)+" runtime result subscriptions"]);for(var d=e.h8_1.l();d.m();){var h=d.o();h(new $1(l,n,t))}e.a9(g4(n.replay),t);var p;return t.equals(p2())&&e.o8_1&&(Cs(e),p=y),e.t8(),y}}function qh(e,t,r,n,a,i,o,c){return function(l){return C5(e,y,Wh(e,t,r,l,n,a,i,o,c)),y}}function Jh(e,t,r,n,a,i,o){return function(){e.y7_1.h7(["Signpost: Response error for "+Y6(e,t,r)+" request",n]),a.z8();var c=e.x7_1.performanceAnalyticsDelegate,l=n.message;nd(c,l??"Request Response Error"+(" with a duration of "+a.b9()+"ms"),r,""),e.g8_1.j1(i);var u;t.equals(p2())&&(e.f8_1=!1,u=y);var v;if(t.equals(m2()))return b4(e),e.t8(),y;for(var d=o,h=ht(),p=d.l();p.m();){var _=p.o(),C=_.scope.equals(Fe())?!1:_.retry!==!0,I=h.r1(C),m1;if(I==null){var g1=q1();h.i1(C,g1),m1=g1}else m1=I;var F1=m1;F1.i(_)}var r0=h,g2,t2=r0.r1(!1);if(!(t2==null||t2.t())){var r2=r0.r1(!1),T0=r2??S0(),w2=a3(T0);e.y7_1.h7(c3([["unretryable events",n],w2])),g2=e.x7_1.errorHandler(n)}var A2,n2=r0.r1(!0);if(!(n2==null||n2.t())){var Ke=r0.r1(!0);if(Ke!=null)for(var H5=Ke.l();H5.m();){var b5=H5.o();b5.retry=!0,b5.scope=Fe()}var R5=r0.r1(!0);e.a9(R5??S0(),t),t.equals(p2())&&e.o8_1&&Cs(e),e.t8(),A2=y}return y}}function Xh(e,t,r,n,a,i){return function(o){return C5(e,y,Jh(e,t,r,o,n,a,i)),y}}function zh(e,t){return function(){e.y7_1.h7(c3([["Signpost: Submitted events"],t]));for(var r=e.a8_1,n=g4(t),a=r.l();a.m();){var i=a.o(),o=n;n=i.c9(o)}for(var c=n,l=q1(),u=q1(),v=c.l();v.m();){var d=v.o();d.async===!0?l.i(d):u.i(d)}var h=new V1(l,u),p=h.b7(),_=h.c7();e.d8_1.p(p),e.c8_1.p(_);var C;return e.f8_1&&e.p8_1&&(e.e8_1.p(_),C=y),e.t8(),y}}function Kh(e){return function(){return Ls(e,!0),y}}function Yh(e,t){return function(){e.state=e.v7_1.clone(t.state),e.d8_1.e6();var r=t.asyncQueue;y4(e.d8_1,r3(r)?r:J()),e.c8_1.e6();var n=t.syncQueue;return y4(e.c8_1,r3(n)?n:J()),b4(e),x5(e).resume(t.localSnapshot),xt(e).resume(t.remoteSnapshot),j6(e).resumeAll(t.timerSnapshot),y}}function I1(e,t,r,n,a){n=n===m?"RenderPostContent":n,a=a===m?new U1:a,this.t7_1=e,this.u7_1=t,this.v7_1=r,this.w7_1=n,this.x7_1=a,this.y7_1=new Lt(this.x7_1.logger),this.z7_1=0;var i=this,o=new k4(Ph(this),this.y7_1);i.a8_1=ss([o,new B4(Dh(this))]),this.c8_1=wt(),this.d8_1=wt(),this.e8_1=wt(),this.f8_1=!1;var c=this;c.g8_1=ht();var l=this;l.h8_1=q1(),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"])}s(I1).d9=function(e){this.t7_1=e};s(I1).e9=function(){return this.t7_1};s(I1).f9=function(){return this.c8_1};s(I1).g9=function(){return this.d8_1};s(I1).h9=function(){return this.e8_1};s(I1).init=function(e,t,r){C5(this,y,Fh(this,e,t,r))};s(I1).subscribe=function(e){var t=Ns;return C5(this,t,Gh(e,this))};s(I1).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]),!x5(this).isReady()&&!xt(this).isReady()&&!(this.c8_1.t()&&this.d8_1.t()))return this.y7_1.i9(["ticking with events and no runtime, deferring..."]),y;if(this.f8_1){if(this.p8_1){var t=N4(this).f7(this.e8_1,m2());I4(this,t,m2())}}else{var e=N4(this).f7(this.c8_1,p2());I4(this,e,p2())}if(!this.d8_1.t()){for(;!this.d8_1.t();){var r=N4(this).f7(this.d8_1,_t());I4(this,r,_t())}this.t8()}};s(I1).a9=function(e,t){if(e.t()||t.equals(m2()))return y;this.y7_1.h7(["replaying "+e.q()+" events"]),e7(this,e);for(var r=ht(),n=e.l();n.m();){var a=n.o(),i=new V1(a.async===!0,a.retry===!0),o=r.r1(i),c;if(o==null){var l=q1();r.i1(i,l),c=l}else c=o;var u=c;u.i(a)}var v=r,d=v.r1(new V1(!0,!0));this.d8_1.d6(0,d??S0());var h=v.r1(new V1(!0,!1));this.d8_1.p(h??S0());var p=v.r1(new V1(!1,!0));this.c8_1.d6(0,p??S0());var _=v.r1(new V1(!1,!1));this.c8_1.p(_??S0())};s(I1).submit=function(e){C5(this,y,zh(this,e))};s(I1).reset=function(){C5(this,y,Kh(this))};s(I1).snapshot=function(){var e=this.v7_1.clone(this.state),t=this.c8_1,r=a3(t),n=this.d8_1,a=a3(n);return new o1(e,r,a,x5(this).snapshot(),xt(this).snapshot(),j6(this).list())};s(I1).pause=function(){var e=this.snapshot();return j6(this).pauseAll(),Ls(this,!1),e};s(I1).resume=function(e){C5(this,y,Yh(this,e))};function Qh(e){return y}function U1(){this.j9_1=new Ge;var e=this;e.k9_1=Qh,this.l9_1=Hs,this.m9_1=new Zt}s(U1).n9=function(e){this.j9_1=e};s(U1).o9=function(){return this.j9_1};s(U1).p9=function(e){this.k9_1=e};s(U1).q9=function(){return this.k9_1};s(U1).r9=function(e){this.l9_1=e};s(U1).s9=function(){return this.l9_1};s(U1).t9=function(e){this.m9_1=e};s(U1).u9=function(){return this.m9_1};function o1(e,t,r,n,a,i){this.state=e,this.syncQueue=t,this.asyncQueue=r,this.localSnapshot=n,this.remoteSnapshot=a,this.timerSnapshot=i}s(o1).e9=function(){return this.state};s(o1).f9=function(){return this.syncQueue};s(o1).g9=function(){return this.asyncQueue};s(o1).v9=function(){return this.localSnapshot};s(o1).w9=function(){return this.remoteSnapshot};s(o1).x9=function(){return this.timerSnapshot};s(o1).b7=function(){return this.state};s(o1).c7=function(){return this.syncQueue};s(o1).n7=function(){return this.asyncQueue};s(o1).y9=function(){return this.localSnapshot};s(o1).z9=function(){return this.remoteSnapshot};s(o1).aa=function(){return this.timerSnapshot};s(o1).ba=function(e,t,r,n,a,i){return new o1(e,t,r,n,a,i)};s(o1).copy=function(e,t,r,n,a,i,o){return e=e===m?this.state:e,t=t===m?this.syncQueue:t,r=r===m?this.asyncQueue:r,n=n===m?this.localSnapshot:n,a=a===m?this.remoteSnapshot:a,i=i===m?this.timerSnapshot:i,this.ba(e,t,r,n,a,i)};s(o1).toString=function(){return"DispatcherSnapshot(state="+this.state+", syncQueue="+J0(this.syncQueue)+", asyncQueue="+J0(this.asyncQueue)+", localSnapshot="+this.localSnapshot+", remoteSnapshot="+this.remoteSnapshot+", timerSnapshot="+this.timerSnapshot+")"};s(o1).hashCode=function(){var e=this.state==null?0:h1(this.state);return e=J2(e,31)+h1(this.syncQueue)|0,e=J2(e,31)+h1(this.asyncQueue)|0,e=J2(e,31)+(this.localSnapshot==null?0:h1(this.localSnapshot))|0,e=J2(e,31)+(this.remoteSnapshot==null?0:h1(this.remoteSnapshot))|0,e=J2(e,31)+(this.timerSnapshot==null?0:h1(this.timerSnapshot))|0,e};s(o1).equals=function(e){if(this===e)return!0;if(!(e instanceof o1))return!1;var t=e instanceof o1?e:J();return!(!B(this.state,t.state)||!B(this.syncQueue,t.syncQueue)||!B(this.asyncQueue,t.asyncQueue)||!B(this.localSnapshot,t.localSnapshot)||!B(this.remoteSnapshot,t.remoteSnapshot)||!B(this.timerSnapshot,t.timerSnapshot))};var ys,Ss,Vs;function jh(){return[r7(),n7(),Fe()]}function ed(e){switch(e){case"ALL":return r7();case"LOCAL":return n7();case"REMOTE":return Fe();default:t7(),A4("No enum constant value.");break}}var ws;function t7(){if(ws)return y;ws=!0,ys=new C1("ALL",0),Ss=new C1("LOCAL",1),Vs=new C1("REMOTE",2)}function C1(e,t){e0.call(this,e,t)}function td(e){return e.equals(Fe())?!0:e.equals(r7())}function r7(){return t7(),ys}function n7(){return t7(),Ss}function Fe(){return t7(),Vs}function O4(){}s(O4).unsubscribe=function(){};var Ns;function w3(e,t,r){this.spanName=e,this.startTimeMs=t,this.endTimeMs=r}s(w3).ea=function(){return this.spanName};s(w3).fa=function(){return this.startTimeMs};s(w3).ga=function(){return this.endTimeMs};function Ct(e,t,r){this.message=e,this.origin=t,this.version=r}s(Ct).q5=function(){return this.message};s(Ct).ha=function(){return this.origin};s(Ct).ia=function(){return this.version};function Is(){}function Zt(){}s(Zt).logRuntimeTrace=function(e){};s(Zt).logRuntimeError=function(e){};function rd(e,t,r,n,a){e.logRuntimeTrace(new Mt(t.w8_1,t.x8_1,t.y8_1,n,Ts(r),a))}function nd(e,t,r,n){e.logRuntimeError(new Ct(t,Ts(r),n))}function Ts(e){return e?"remote":"local"}function Mt(e,t,r,n,a,i){w3.call(this,e,t,r),this.intent=n,this.target=a,this.eventCount=i}s(Mt).ja=function(){return this.intent};s(Mt).ka=function(){return this.target};s(Mt).la=function(){return this.eventCount};function We(){this.ma_1=!1,this.na_1=!1,this.oa_1=!1}s(We).pa=function(){return this.ma_1};s(We).qa=function(){return this.na_1};s(We).ra=function(){return this.oa_1};var Hs;function Lt(e){this.g7_1=e}s(Lt).s8=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.error(t)};s(Lt).i9=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.warn(t)};s(Lt).h7=function(e){var t=c3([[this.g7_1.tag()],e]);this.g7_1.debug(t)};function Ge(){}s(Ge).info=function(e){};s(Ge).error=function(e){};s(Ge).warn=function(e){};s(Ge).debug=function(e){};s(Ge).tag=function(){return""};function B4(e){this.sa_1=e}s(B4).c9=function(e){for(var t=q1(),r=q1(),n=e.l();n.m();){var a=n.o(),i=a.hook;(i==null?null:V4(i,"useInterval"))===!0?t.i(a):r.i(a)}for(var o=new V1(t,r),c=o.b7(),l=o.c7(),u=v4(),v=q1(),d=c.l();d.m();){var h=d.o(),p=h.hook;u.i(p)&&v.i(h)}for(var _=v,C=q1(),I=_.l();I.m();){var m1=I.o(),g1=m1.hook;this.sa_1(g1??"")||C.i(m1)}var F1=C;return Zl(F1,l)};function k4(e,t){this.ta_1=e,this.ua_1=t}s(k4).c9=function(e){var t;if(this.ta_1())t=e;else{for(var r=q1(),n=q1(),a=e.l();a.m();){var i=a.o();i.scope.equals(n7())?n.i(i):r.i(i)}var o=new V1(r,n);if(!o.a7_1.t()){var c=["Dropping "+o.a7_1.q()+" local events",o.a7_1];this.ua_1.h7([c])}t=o.z6_1}return t};function J1(e,t){this.id=e,this.duration=t}s(J1).va=function(){return this.id};s(J1).wa=function(){return this.duration};s(J1).b7=function(){return this.id};s(J1).c7=function(){return this.duration};s(J1).xa=function(e,t){return new J1(e,t)};s(J1).copy=function(e,t,r){return e=e===m?this.id:e,t=t===m?this.duration:t,this.xa(e,t)};s(J1).toString=function(){return"TimerDefinition(id="+this.id+", duration="+this.duration+")"};s(J1).hashCode=function(){var e=w4(this.id);return e=J2(e,31)+this.duration|0,e};s(J1).equals=function(e){if(this===e)return!0;if(!(e instanceof J1))return!1;var t=e instanceof J1?e:J();return!(this.id!==t.id||this.duration!==t.duration)};function a7(e,t){this.w8_1=e,this.x8_1=t,this.y8_1=0}s(a7).z8=function(){this.y8_1=Rs()};s(a7).b9=function(){return this.y8_1-this.x8_1};function $4(){}s($4).r8=function(e){return new a7(e,Rs())};var bs;function i7(e,t,r,n){r=r===m?"RenderPostContent":r,n=n===m?new U1:n,I1.call(this,e,new o7(t),new Et,r,n),this.vb_1=r,this.wb_1=n}function o7(e){this.xb_1=e}s(o7).yb=function(e,t){var r=a3(t);return this.xb_1.build(e,r)};s(o7).q8=function(e,t){return this.yb(e!=null&&e!=null?e:J(),t)};function As(e){for(var t=Object.entries,r=(t!=null&&typeof t=="function"?t:J())(e),n=B6(r.length),a=0,i=r.length;a<i;){var o=r[a];a=a+1|0;var c=o[0],l=ms(c!=null&&typeof c=="string"?c:J(),o[1]);n.i(l)}return n}function Et(){}s(Et).clone=function(e){return JSON.parse(JSON.stringify(e))};s(Et).merge=function(e,t){for(var r={},n=r!=null&&r!=null?r:J(),a=As(e).l();a.m();){var i=a.o();n[i.z6_1]=i.a7_1}for(var o=As(t).l();o.m();){var c=o.o();n[c.z6_1]=c.a7_1}return n};function Rs(){return new Date().getTime()}Z1(s(p0),"name",s(p0).x4);Z1(s(p0),"ordinal",s(p0).y4);Z1(s(I1),"state",function(){return this.e9()},function(e){this.d9(e)});Z1(s(U1),"logger",function(){return this.o9()},function(e){this.n9(e)});Z1(s(U1),"errorHandler",function(){return this.q9()},function(e){this.p9(e)});Z1(s(U1),"featureFlags",function(){return this.s9()},function(e){this.r9(e)});Z1(s(U1),"performanceAnalyticsDelegate",function(){return this.u9()},function(e){this.t9(e)});Z1(s(C1),"name",s(C1).x4);Z1(s(C1),"ordinal",s(C1).y4);Z1(s(We),"isSpeculativeExecutionEnabled",function(){return this.pa()});Z1(s(We),"isVerboseLoggingEnabled",function(){return this.qa()});Z1(s(We),"isUsingEverythingAssembler",function(){return this.ra()});Z1(s(i7),"state",function(){return this.e9()},function(e){this.d9(e)});Ns=new O4;Hs=new We;bs=new $4;p0.values=$h;p0.valueOf=Uh;Z1(p0,"SYNC",p2);Z1(p0,"ASYNC",_t);Z1(p0,"SPEC",m2);C1.values=jh;C1.valueOf=ed;Z1(C1,"ALL",r7);Z1(C1,"LOCAL",n7);Z1(C1,"REMOTE",Fe);var ad=e=>{switch(e){case n1.ALL:return C1.ALL;case n1.REMOTE:return C1.REMOTE;case n1.LOCAL:return C1.LOCAL;case n1.UNRECOGNIZED:return C1.ALL;default:throw new Error(`Unknown UIEventScope: ${e}`)}},V0=class{constructor(t){this.scope=t.scope?ad(t.scope):C1.ALL,this.async=t.async,this.hook=t.hook,this.retry=t.retry,this.uiEvent=t}},l7=class{constructor(t){this.uiRequest=t,this.events=t.events.map(r=>new V0(r)),t.state&&(this.state=t.state)}},yt=class{constructor(t){this.uiResponse=t,this.replay=t.events.map(r=>new V0(r)),t.state&&(this.state=t.state)}};function Os(){var a,i;let e=new URL(globalThis.location?location.href:"file://");if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(a=globalThis.devvit).debug??(a.debug={});let t={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},r={};for(let o in t)r[o.toLowerCase()]=o;let n=[...e.searchParams].find(([o])=>o.toLowerCase()==="devvitdebug")?.[1];if(n!=null){n===""&&(n=Object.keys(t).filter(o=>o!=="emitSnapshots"&&o!=="emitState").join());for(let o of n.split(",")??[]){let[c,l]=o.split("=");c&&(c.toLowerCase()in r?c=r[c.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${c}"`),(i=globalThis.devvit.debug)[c]??(i[c]=l||"true"),console.info(`[devvit] set devvitdebug ${c}=${globalThis.devvit.debug[c]}`))}}}var q=s1(w1(),1);var U4=s1(Er(),1),M5=s1(w1(),1);function Bs(){return{seconds:0,nanos:0}}var K0={$type:"google.protobuf.Timestamp",encode(e,t=M5.default.Writer.create()){return e.seconds!==0&&t.uint32(8).int64(e.seconds),e.nanos!==0&&t.uint32(16).int32(e.nanos),t},decode(e,t){let r=e instanceof M5.default.Reader?e:M5.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Bs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.seconds=id(r.int64());continue;case 2:if(i!==16)break;a.nanos=r.int32();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{seconds:ks(e.seconds)?globalThis.Number(e.seconds):0,nanos:ks(e.nanos)?globalThis.Number(e.nanos):0}},toJSON(e){let t={};return e.seconds!==0&&(t.seconds=Math.round(e.seconds)),e.nanos!==0&&(t.nanos=Math.round(e.nanos)),t},create(e){return K0.fromPartial(e??{})},fromPartial(e){let t=Bs();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};g.set(K0.$type,K0);function id(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}M5.default.util.Long!==U4.default&&(M5.default.util.Long=U4.default,M5.default.configure());function ks(e){return e!=null}var d1;(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.VERBOSE=4]="VERBOSE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(d1||(d1={}));function od(e){switch(e){case 0:case"DEBUG":return d1.DEBUG;case 1:case"INFO":return d1.INFO;case 2:case"WARN":return d1.WARN;case 3:case"ERROR":return d1.ERROR;case 4:case"VERBOSE":return d1.VERBOSE;case-1:case"UNRECOGNIZED":default:return d1.UNRECOGNIZED}}function ld(e){switch(e){case d1.DEBUG:return 0;case d1.INFO:return 1;case d1.WARN:return 2;case d1.ERROR:return 3;case d1.VERBOSE:return 4;case d1.UNRECOGNIZED:default:return-1}}function $s(){return{message:"",name:"",fileName:void 0,lineNumber:void 0,columnNumber:void 0,stack:void 0,timestamp:void 0,tags:[]}}var P4={$type:"devvit.plugin.logger.LogErrorMessage",encode(e,t=q.default.Writer.create()){e.message!==""&&t.uint32(10).string(e.message),e.name!==""&&t.uint32(18).string(e.name),e.fileName!==void 0&&U0.encode({value:e.fileName},t.uint32(26).fork()).ldelim(),e.lineNumber!==void 0&&oe.encode({value:e.lineNumber},t.uint32(34).fork()).ldelim(),e.columnNumber!==void 0&&oe.encode({value:e.columnNumber},t.uint32(42).fork()).ldelim(),e.stack!==void 0&&U0.encode({value:e.stack},t.uint32(50).fork()).ldelim(),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(58).fork()).ldelim();for(let r of e.tags)t.uint32(66).string(r);return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=$s();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.message=r.string();continue;case 2:if(i!==18)break;a.name=r.string();continue;case 3:if(i!==26)break;a.fileName=U0.decode(r,r.uint32()).value;continue;case 4:if(i!==34)break;a.lineNumber=oe.decode(r,r.uint32()).value;continue;case 5:if(i!==42)break;a.columnNumber=oe.decode(r,r.uint32()).value;continue;case 6:if(i!==50)break;a.stack=U0.decode(r,r.uint32()).value;continue;case 7:if(i!==58)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 8:if(i!==66)break;a.tags.push(r.string());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{message:P1(e.message)?globalThis.String(e.message):"",name:P1(e.name)?globalThis.String(e.name):"",fileName:P1(e.fileName)?String(e.fileName):void 0,lineNumber:P1(e.lineNumber)?Number(e.lineNumber):void 0,columnNumber:P1(e.columnNumber)?Number(e.columnNumber):void 0,stack:P1(e.stack)?String(e.stack):void 0,timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.message!==""&&(t.message=e.message),e.name!==""&&(t.name=e.name),e.fileName!==void 0&&(t.fileName=e.fileName),e.lineNumber!==void 0&&(t.lineNumber=e.lineNumber),e.columnNumber!==void 0&&(t.columnNumber=e.columnNumber),e.stack!==void 0&&(t.stack=e.stack),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.tags?.length&&(t.tags=e.tags),t},create(e){return P4.fromPartial(e??{})},fromPartial(e){let t=$s();return t.message=e.message??"",t.name=e.name??"",t.fileName=e.fileName??void 0,t.lineNumber=e.lineNumber??void 0,t.columnNumber=e.columnNumber??void 0,t.stack=e.stack??void 0,t.timestamp=e.timestamp??void 0,t.tags=e.tags?.map(r=>r)||[],t}};g.set(P4.$type,P4);function Us(){return{type:"",timestamp:void 0,labels:{},data:{}}}var D4={$type:"devvit.plugin.logger.LogEventMessage",encode(e,t=q.default.Writer.create()){return e.type!==""&&t.uint32(10).string(e.type),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(18).fork()).ldelim(),Object.entries(e.labels).forEach(([r,n])=>{St.encode({key:r,value:n},t.uint32(26).fork()).ldelim()}),Object.entries(e.data).forEach(([r,n])=>{Vt.encode({key:r,value:n},t.uint32(34).fork()).ldelim()}),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Us();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.type=r.string();continue;case 2:if(i!==18)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 3:if(i!==26)break;let o=St.decode(r,r.uint32());o.value!==void 0&&(a.labels[o.key]=o.value);continue;case 4:if(i!==34)break;let c=Vt.decode(r,r.uint32());c.value!==void 0&&(a.data[c.key]=c.value);continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{type:P1(e.type)?globalThis.String(e.type):"",timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,labels:Xs(e.labels)?Object.entries(e.labels).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{},data:Xs(e.data)?Object.entries(e.data).reduce((t,[r,n])=>(t[r]=String(n),t),{}):{}}},toJSON(e){let t={};if(e.type!==""&&(t.type=e.type),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.labels){let r=Object.entries(e.labels);r.length>0&&(t.labels={},r.forEach(([n,a])=>{t.labels[n]=a}))}if(e.data){let r=Object.entries(e.data);r.length>0&&(t.data={},r.forEach(([n,a])=>{t.data[n]=a}))}return t},create(e){return D4.fromPartial(e??{})},fromPartial(e){let t=Us();return t.type=e.type??"",t.timestamp=e.timestamp??void 0,t.labels=Object.entries(e.labels??{}).reduce((r,[n,a])=>(a!==void 0&&(r[n]=globalThis.String(a)),r),{}),t.data=Object.entries(e.data??{}).reduce((r,[n,a])=>(a!==void 0&&(r[n]=globalThis.String(a)),r),{}),t}};g.set(D4.$type,D4);function Ps(){return{key:"",value:""}}var St={$type:"devvit.plugin.logger.LogEventMessage.LabelsEntry",encode(e,t=q.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ps();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=r.string();continue;case 2:if(i!==18)break;a.value=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{key:P1(e.key)?globalThis.String(e.key):"",value:P1(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return St.fromPartial(e??{})},fromPartial(e){let t=Ps();return t.key=e.key??"",t.value=e.value??"",t}};g.set(St.$type,St);function Ds(){return{key:"",value:""}}var Vt={$type:"devvit.plugin.logger.LogEventMessage.DataEntry",encode(e,t=q.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==""&&t.uint32(18).string(e.value),t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ds();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.key=r.string();continue;case 2:if(i!==18)break;a.value=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{key:P1(e.key)?globalThis.String(e.key):"",value:P1(e.value)?globalThis.String(e.value):""}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==""&&(t.value=e.value),t},create(e){return Vt.fromPartial(e??{})},fromPartial(e){let t=Ds();return t.key=e.key??"",t.value=e.value??"",t}};g.set(Vt.$type,Vt);function Fs(){return{severity:0,message:"",timestamp:void 0,tags:[]}}var t0={$type:"devvit.plugin.logger.LogMessage",encode(e,t=q.default.Writer.create()){e.severity!==0&&t.uint32(8).int32(e.severity),e.message!==""&&t.uint32(18).string(e.message),e.timestamp!==void 0&&K0.encode(J4(e.timestamp),t.uint32(26).fork()).ldelim();for(let r of e.tags)t.uint32(34).string(r);return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Fs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==8)break;a.severity=r.int32();continue;case 2:if(i!==18)break;a.message=r.string();continue;case 3:if(i!==26)break;a.timestamp=s7(K0.decode(r,r.uint32()));continue;case 4:if(i!==34)break;a.tags.push(r.string());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{severity:P1(e.severity)?od(e.severity):0,message:P1(e.message)?globalThis.String(e.message):"",timestamp:P1(e.timestamp)?X4(e.timestamp):void 0,tags:globalThis.Array.isArray(e?.tags)?e.tags.map(t=>globalThis.String(t)):[]}},toJSON(e){let t={};return e.severity!==0&&(t.severity=ld(e.severity)),e.message!==""&&(t.message=e.message),e.timestamp!==void 0&&(t.timestamp=e.timestamp.toISOString()),e.tags?.length&&(t.tags=e.tags),t},create(e){return t0.fromPartial(e??{})},fromPartial(e){let t=Fs();return t.severity=e.severity??0,t.message=e.message??"",t.timestamp=e.timestamp??void 0,t.tags=e.tags?.map(r=>r)||[],t}};g.set(t0.$type,t0);function Gs(){return{messages:[]}}var F4={$type:"devvit.plugin.logger.LogMessages",encode(e,t=q.default.Writer.create()){for(let r of e.messages)t0.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Gs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.messages.push(t0.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{messages:globalThis.Array.isArray(e?.messages)?e.messages.map(t=>t0.fromJSON(t)):[]}},toJSON(e){let t={};return e.messages?.length&&(t.messages=e.messages.map(r=>t0.toJSON(r))),t},create(e){return F4.fromPartial(e??{})},fromPartial(e){let t=Gs();return t.messages=e.messages?.map(r=>t0.fromPartial(r))||[],t}};g.set(F4.$type,F4);function Ws(){return{}}var G4={$type:"devvit.plugin.logger.LogErrorResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ws();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return G4.fromPartial(e??{})},fromPartial(e){return Ws()}};g.set(G4.$type,G4);function qs(){return{}}var W4={$type:"devvit.plugin.logger.LogEventResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=qs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return W4.fromPartial(e??{})},fromPartial(e){return qs()}};g.set(W4.$type,W4);function Js(){return{}}var q4={$type:"devvit.plugin.logger.LogResponse",encode(e,t=q.default.Writer.create()){return t},decode(e,t){let r=e instanceof q.default.Reader?e:q.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Js();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return q4.fromPartial(e??{})},fromPartial(e){return Js()}};g.set(q4.$type,q4);function J4(e){let t=Math.trunc(e.getTime()/1e3),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}function s7(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function X4(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):s7(K0.fromJSON(e))}function Xs(e){return typeof e=="object"&&e!==null}function P1(e){return e!=null}var Y0;(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"})(Y0||(Y0={}));var N0;(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"})(N0||(N0={}));function zs(e){return e.hostname.split(".")[1]??e.hostname}var D1=s1(w1(),1);function Ks(){return{callState:void 0,connect:void 0}}var z4={$type:"devvit.cli.PlaytestProviderMessage",encode(e,t=D1.default.Writer.create()){return e.callState!==void 0&&Je.encode(e.callState,t.uint32(10).fork()).ldelim(),e.connect!==void 0&&Xe.encode(e.connect,t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ks();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.callState=Je.decode(r,r.uint32());continue;case 2:if(i!==18)break;a.connect=Xe.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{callState:c7(e.callState)?Je.fromJSON(e.callState):void 0,connect:c7(e.connect)?Xe.fromJSON(e.connect):void 0}},toJSON(e){let t={};return e.callState!==void 0&&(t.callState=Je.toJSON(e.callState)),e.connect!==void 0&&(t.connect=Xe.toJSON(e.connect)),t},create(e){return z4.fromPartial(e??{})},fromPartial(e){let t=Ks();return t.callState=e.callState!==void 0&&e.callState!==null?Je.fromPartial(e.callState):void 0,t.connect=e.connect!==void 0&&e.connect!==null?Xe.fromPartial(e.connect):void 0,t}};g.set(z4.$type,z4);function Ys(){return{appInstalled:void 0}}var Nt={$type:"devvit.cli.PlaytestSubscriberMessage",encode(e,t=D1.default.Writer.create()){return e.appInstalled!==void 0&&qe.encode(e.appInstalled,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Ys();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.appInstalled=qe.decode(r,r.uint32());continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{appInstalled:c7(e.appInstalled)?qe.fromJSON(e.appInstalled):void 0}},toJSON(e){let t={};return e.appInstalled!==void 0&&(t.appInstalled=qe.toJSON(e.appInstalled)),t},create(e){return Nt.fromPartial(e??{})},fromPartial(e){let t=Ys();return t.appInstalled=e.appInstalled!==void 0&&e.appInstalled!==null?qe.fromPartial(e.appInstalled):void 0,t}};g.set(Nt.$type,Nt);function Qs(){return{}}var qe={$type:"devvit.cli.PlaytestAppInstalled",encode(e,t=D1.default.Writer.create()){return t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=Qs();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{}},toJSON(e){return{}},create(e){return qe.fromPartial(e??{})},fromPartial(e){return Qs()}};g.set(qe.$type,qe);function js(){return{logs:[]}}var Je={$type:"devvit.cli.PlaytestCallState",encode(e,t=D1.default.Writer.create()){for(let r of e.logs)t0.encode(r,t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=js();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.logs.push(t0.decode(r,r.uint32()));continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{logs:globalThis.Array.isArray(e?.logs)?e.logs.map(t=>t0.fromJSON(t)):[]}},toJSON(e){let t={};return e.logs?.length&&(t.logs=e.logs.map(r=>t0.toJSON(r))),t},create(e){return Je.fromPartial(e??{})},fromPartial(e){let t=js();return t.logs=e.logs?.map(r=>t0.fromPartial(r))||[],t}};g.set(Je.$type,Je);function e9(){return{url:""}}var Xe={$type:"devvit.cli.PlaytestConnect",encode(e,t=D1.default.Writer.create()){return e.url!==""&&t.uint32(10).string(e.url),t},decode(e,t){let r=e instanceof D1.default.Reader?e:D1.default.Reader.create(e),n=t===void 0?r.len:r.pos+t,a=e9();for(;r.pos<n;){let i=r.uint32();switch(i>>>3){case 1:if(i!==10)break;a.url=r.string();continue}if((i&7)===4||i===0)break;r.skipType(i&7)}return a},fromJSON(e){return{url:c7(e.url)?globalThis.String(e.url):""}},toJSON(e){let t={};return e.url!==""&&(t.url=e.url),t},create(e){return Xe.fromPartial(e??{})},fromPartial(e){let t=e9();return t.url=e.url??"",t}};g.set(Xe.$type,Xe);function c7(e){return e!=null}var K4="playtest",t9="ws://localhost:5678";function r9(e){let t=Y4();return t===""||t===e}function Y4(){return globalThis.location?new URL(location.href).searchParams.get(K4)??void 0:void 0}var p1=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},It=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},Tt,f1,Q4,n9,j4,en,tn,rn,sd=15e3,u7=class{constructor(){Tt.add(this),f1.set(this,{type:"Init"}),j4.set(this,()=>{p1(this,f1,"f").type==="Opened"&&this.onState?.("Closed"),It(this,f1,p1(this,Tt,"m",n9).call(this),"f")}),en.set(this,t=>{let r=Nt.fromJSON(JSON.parse(t.data));switch(!0){case r.appInstalled!=null:this.onState?.("Reloading");break}}),tn.set(this,()=>{if(p1(this,f1,"f").type!=="Opening")throw Error(`invalid transition from ${p1(this,f1,"f").type}`);this.onState?.("Opened"),It(this,f1,{sock:p1(this,f1,"f").sock,type:"Opened"},"f"),this.send({connect:{url:location.href}})}),rn.set(this,()=>{It(this,f1,p1(this,Tt,"m",Q4).call(this),"f")})}close(){"timer"in p1(this,f1,"f")&&clearTimeout(p1(this,f1,"f").timer),"sock"in p1(this,f1,"f")&&(p1(this,f1,"f").sock.onopen=null,p1(this,f1,"f").sock.onmessage=null,p1(this,f1,"f").sock.onclose=null,p1(this,f1,"f").sock.close()),It(this,f1,{type:"Init"},"f")}open(){p1(this,f1,"f").type==="Init"&&It(this,f1,p1(this,Tt,"m",Q4).call(this),"f")}send(t){"sock"in p1(this,f1,"f")?p1(this,f1,"f").sock.send(JSON.stringify(t)):console.warn("devvit playtest message dropped",t)}};f1=new WeakMap,j4=new WeakMap,en=new WeakMap,tn=new WeakMap,rn=new WeakMap,Tt=new WeakSet,Q4=function(){let t=new WebSocket(t9);return t.onclose=p1(this,j4,"f"),t.onmessage=p1(this,en,"f"),t.onopen=p1(this,tn,"f"),{sock:t,type:"Opening"}},n9=function(){return{timer:setTimeout(p1(this,rn,"f"),sd),type:"Retrying"}};var r1=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},E=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Q0,v7,h7,l1,A3,Ht,bt,d7,L5,j0,X2,_3,E3,z2,nn,Rt,f7,an,a9,Z3,p7,on,cd={debug:d1.DEBUG,error:d1.ERROR,info:d1.INFO,log:d1.DEBUG,trace:d1.DEBUG,warn:d1.WARN},m7=class{constructor(t,r,n,a){Q0.add(this),v7.set(this,void 0),h7.set(this,void 0),l1.set(this,void 0),A3.set(this,!1),Ht.set(this,!1),bt.set(this,!1),d7.set(this,0),L5.set(this,void 0),j0.set(this,{}),X2.set(this,void 0),_3.set(this,()=>{}),E3.set(this,void 0),z2.set(this,void 0),nn.set(this,Y4()),Rt.set(this,!1),f7.set(this,void 0),an.set(this,i=>{let o=i.data,[c]=o;switch(c){case N0.READY:{let[,l]=o;r1(this,f7,l,"f"),r1(this,Ht,!0,"f"),E(this,E3,"f")?.plugins?E(this,Q0,"m",a9).call(this):E(this,Q0,"m",p7).call(this);break}case N0.PLUGINS_CONFIGURED:E(this,Q0,"m",p7).call(this);break;case N0.BUNDLE_LOADED:{let[,l,u]=o;E(this,Q0,"m",Z3).call(this,l),r1(this,A3,!0,"f"),r1(this,bt,!0,"f"),E(this,X2,"f")?.resolve({metrics:{init:E(this,f7,"f"),loadBundle:u}}),r1(this,X2,void 0,"f");break}case N0.BUNDLE_LOAD_FAILED:{let[,,l,u]=o;E(this,Q0,"m",Z3).call(this,u),E(this,X2,"f")?.reject(l),r1(this,X2,void 0,"f");break}case N0.RETURN:{let[,l,u,v]=o;E(this,Q0,"m",Z3).call(this,v),E(this,j0,"f")[l]?.resolve(u),delete E(this,j0,"f")[l];break}case N0.ERROR:{let[,l,u,v]=o;E(this,Q0,"m",Z3).call(this,v),E(this,j0,"f")[l]?.reject(u),delete E(this,j0,"f")[l];break}case N0.CIRCUIT_BREAKER:{let[,l,u,v]=o;E(this,j0,"f")[l]?.reject(new S6(u,v)),delete E(this,j0,"f")[l];break}case N0.PLUGIN_CALL:{let[,l,u,v,d,h]=o;E(this,E3,"f")?.callback(l,u,v,d,h);break}case N0.UNHANDLED_REJECTION:{let[,,l,u]=o;E(this,Q0,"m",Z3).call(this,u),E(this,_3,"f").call(this,"UnhandledRejection",l);break}}}),on.set(this,i=>{switch(i){case"Opened":console.info("devvit playtest connected");break;case"Closed":console.info("devvit playtest disconnected");break;case"Reloading":{console.info("devvit playtest reloading"),E(this,z2,"f")?.close();let o=new URL(location.href);o.searchParams.set(K4,E(this,nn,"f")??""),location.assign(o),location.reload();break}}}),r1(this,v7,typeof t=="string"?t:URL.createObjectURL(t),"f"),r1(this,h7,r,"f"),n&&r1(this,_3,n,"f"),a&&r1(this,E3,a,"f")}initializeWorker(){r1(this,l1,new Worker(E(this,v7,"f"),{name:E(this,h7,"f"),type:"module"}),"f"),E(this,l1,"f").onerror=t=>{E(this,_3,"f").call(this,"Error",t)},E(this,l1,"f").onmessageerror=t=>{E(this,_3,"f").call(this,"MessageError",t.data)},E(this,l1,"f").onmessage=E(this,an,"f"),this.runtimeDebugLogging&&E(this,l1,"f").postMessage([Y0.ENABLE_DEBUG_LOGGING])}get ready(){return E(this,A3,"f")}get runtimeDebugLogging(){return E(this,Rt,"f")}set runtimeDebugLogging(t){t!==E(this,Rt,"f")&&(r1(this,Rt,t,"f"),this.runtimeDebugLogging&&E(this,l1,"f")?.postMessage([Y0.ENABLE_DEBUG_LOGGING]))}async loadBundle(t){return r1(this,L5,t,"f"),E(this,l1,"f")?E(this,Ht,"f")&&!E(this,bt,"f")&&E(this,Q0,"m",p7).call(this):this.initializeWorker(),new Promise((r,n)=>{r1(this,X2,{resolve:r,reject:n},"f")})}async call(t,r,n){var a;if(!E(this,A3,"f")||!E(this,l1,"f"))throw new Error("No bundle loaded");let i=r1(this,d7,(a=E(this,d7,"f"),++a),"f"),o=new Promise((c,l)=>{E(this,j0,"f")[i]={resolve:c,reject:l}});return E(this,l1,"f").postMessage([Y0.CALL,i,t,r,n,!1]),o}onPluginResponse(t,r){E(this,l1,"f")?.postMessage([Y0.PLUGIN_RESPONSE,t,r])}quit(){if(E(this,L5,"f")){E(this,z2,"f")?.close(),r1(this,z2,void 0,"f"),r1(this,A3,!1,"f"),E(this,l1,"f")&&(E(this,l1,"f").postMessage([Y0.QUIT]),E(this,l1,"f").onerror=null,E(this,l1,"f").onmessageerror=null,E(this,l1,"f").onmessage=null,E(this,l1,"f").terminate()),r1(this,l1,void 0,"f"),r1(this,bt,!1,"f"),r1(this,Ht,!1,"f");for(let{reject:t}of Object.values(E(this,j0,"f")))t(Error("worker terminated"));r1(this,j0,{},"f"),E(this,X2,"f")?.reject(Error("worker terminated")),r1(this,X2,void 0,"f")}}};v7=new WeakMap,h7=new WeakMap,l1=new WeakMap,A3=new WeakMap,Ht=new WeakMap,bt=new WeakMap,d7=new WeakMap,L5=new WeakMap,j0=new WeakMap,X2=new WeakMap,_3=new WeakMap,E3=new WeakMap,z2=new WeakMap,nn=new WeakMap,Rt=new WeakMap,f7=new WeakMap,an=new WeakMap,on=new WeakMap,Q0=new WeakSet,a9=function(){E(this,l1,"f")?.postMessage([Y0.ENABLE_PLUGINS,E(this,E3,"f")?.plugins??[]])},Z3=function(t){if(!t.length)return;let r=new Date,n={logs:t.map(a=>({severity:cd[a.method],message:a.args.join(" "),tags:[],timestamp:r}))};E(this,z2,"f")?.send({callState:n})},p7=function(){if(!E(this,L5,"f"))return;let t=r9(zs(E(this,L5,"f")));t&&(r1(this,z2,new u7,"f"),E(this,z2,"f").onState=E(this,on,"f")),E(this,z2,"f")?.open(),t&&E(this,l1,"f").postMessage([Y0.ENABLE_APP_LOGGING]),E(this,l1,"f")?.postMessage([Y0.LOAD_BUNDLE,E(this,L5,"f")])};var ln="RenderPostContent",ud=new Set([ln]);function i9(e){if(ud.has(e.split("/").at(-1)))return e;throw Error(`Unsupported RPC ${e}`)}var x3,Ot,g7=class{constructor(t){L(this,x3);L(this,Ot);S(this,x3,t)}set env(t){S(this,x3,t)}set props(t){S(this,Ot,t)}build(t,r){return new l7({state:t,events:r.map(n=>n.uiEvent),env:f(this,x3),props:f(this,Ot)})}};x3=new WeakMap,Ot=new WeakMap;var X1,Bt,_7,w7=class{constructor(){L(this,X1);L(this,Bt,!1);L(this,_7,(t,r,n,a,i)=>{this.onPluginCall?.(t,r,n,a,i),r===z5.fullName&&n===z5.methods.send.name&&f(this,X1)?.onPluginResponse(t,{error:void 0,success:!0,value:{}})})}isReady(){return!!f(this,X1)?.ready}set runtimeDebugLogging(t){S(this,Bt,t),f(this,X1)&&(f(this,X1).runtimeDebugLogging=t)}setLocalSrc(t,r){if(this.unload(),!t){S(this,X1,void 0);return}S(this,X1,new m7(t,r,(n,a)=>console.error(n,a),{callback:f(this,_7),plugins:[]})),f(this,X1).runtimeDebugLogging=f(this,Bt),f(this,X1).initializeWorker()}unload(){f(this,X1)?.quit()}async load(t){this.unload();try{return await f(this,X1)?.loadBundle(t)}catch(r){console.error(r)}}handle(t,r,n,a){if(!this.isReady()||!f(this,X1))throw new Error("local runtime handle called before isReady");devvit?.debug.runtime&&console.debug("[runtime] Local request",r,this.metadata),f(this,X1)?.call(i9(t),r.uiRequest,this.metadata).then(i=>n(new yt(i))).catch(i=>a(i))}pause(){}reset(){}resume(){}snapshot(){return{}}};X1=new WeakMap,Bt=new WeakMap,_7=new WeakMap;var A7=class{isReady(){return!!this.remote}load(t){this.remote=t}handle(t,r,n,a){if(!this.isReady()||!this.remote)throw new Error("remote runtime called remote before isReady()");this.remote[i9(t)](r.uiRequest,this.metadata).then(i=>n(new yt(i))).catch(a)}pause(){}reset(){}resume(){}snapshot(){return{}}};var K2,Y2,kt,Z7=class{constructor(t){L(this,K2,new Map);L(this,Y2,new Map);L(this,kt);devvit?.debug.runtime&&console.debug("[runtime] timers: constructor"),S(this,kt,t)}add(t){devvit?.debug.runtime&&console.debug("[runtime] timers: add",t),f(this,Y2).set(t.id,t),f(this,K2).set(t.id,window.setInterval(()=>{f(this,kt).submit([new V0({scope:n1.ALL,timer:{},hook:t.id})])},t.duration))}apply(t){devvit?.debug.runtime&&console.debug("[runtime] timers: apply",t);let r=new Map(f(this,Y2));t.forEach(n=>{r.delete(n.id),f(this,Y2).has(n.id)||(devvit?.debug.runtime&&console.debug("[runtime] timers: apply - adding definition",n),this.add(n))}),devvit?.debug.runtime&&console.debug("[runtime] timers: apply - removing the following definitions",r);for(let[n]of r)this.remove(n)}clear(){devvit?.debug.runtime&&console.debug("[runtime] timers: clear");for(let t of f(this,K2).values())clearInterval(t);f(this,K2).clear(),f(this,Y2).clear()}list(){return devvit?.debug.runtime&&console.debug("[runtime] timers: list"),[...f(this,Y2).values()]}pauseAll(){devvit?.debug.runtime&&console.debug("[runtime] timers: pauseAll");for(let t of f(this,K2).values())clearInterval(t);return this.list()}remove(t){devvit?.debug.runtime&&console.debug("[runtime] timers: remove"),f(this,Y2).delete(t),clearInterval(f(this,K2).get(t)),f(this,K2).delete(t)}resumeAll(t){devvit?.debug.runtime&&console.debug("[runtime] timers: resumeAll"),this.apply(t)}};K2=new WeakMap,Y2=new WeakMap,kt=new WeakMap;var o9=e=>e.message==="ServerCallRequired",sn=class{debug(t){devvit?.debug.runtime&&console.debug(this.tag(),...t)}error(t){o9(t[0])||console.error(this.tag(),...t)}info(t){console.info(this.tag(),...t)}warn(t){console.warn(this.tag(),...t)}tag(){return"[kmp-dispatcher]"}},$t,Ut,cn=class{constructor(t,r){L(this,$t);L(this,Ut);this.__doNotUseOrImplementIt={"net.devvit.analytics.PerformanceAnalyticsDelegate":Symbol("net.devvit.analytics.PerformanceAnalyticsDelegate")};S(this,$t,t),S(this,Ut,r)}logRuntimeError(t){var r;o9(t)||(devvit?.debug.runtime&&console.error("[kmp-dispatcher-perf-analytics] error",t),(r=f(this,Ut))==null||r.call(this,t))}logRuntimeTrace(t){var r;devvit?.debug.runtime&&console.debug("[kmp-dispatcher-perf-analytics]",t),(r=f(this,$t))==null||r.call(this,t)}};$t=new WeakMap,Ut=new WeakMap;Os();var vd=({nanos:e,seconds:t})=>{let r=t*1e3,n=e/1e6;return Math.floor(r+n)},hd=["showToast","showForm","navigateToUrl","createOrder"],y5,S5,I0,Pt,V5,e2,C3,E7=class{constructor(t,r,n){L(this,y5);L(this,S5);L(this,I0);L(this,Pt);this.hasRendered=!1;L(this,V5);L(this,e2);L(this,C3);S(this,y5,new g7(r)),n.useSpeculativeExecution&&devvit?.debug.runtime&&console.debug("[webDispatcher] Using speculative execution mode!"),S(this,I0,new i7(t??{},f(this,y5),ln,{logger:new sn,featureFlags:{isSpeculativeExecutionEnabled:n.useSpeculativeExecution,isUsingEverythingAssembler:!0,isVerboseLoggingEnabled:!!devvit?.debug.runtime},performanceAnalyticsDelegate:new cn(n.performanceTracker,n.errorTracker),errorHandler:a=>this.onError?.(a)})),S(this,S5,new Z7(f(this,I0))),S(this,V5,new A7),S(this,e2,new w7),this.init()}get state(){return f(this,I0).state}set metadata(t){let r={...t},n=[];for(let[a,i]of Object.entries(devvit?.debug??{}))n.push(`${a}=${i}`);n.length&&(r[h2.Debug]={values:n}),f(this,e2).metadata=r,f(this,V5).metadata=r}set onPluginCall(t){f(this,e2).onPluginCall=t}set runtimeDebugLogging(t){f(this,e2).runtimeDebugLogging=t}subscribe(t){S(this,Pt,f(this,I0).subscribe((...r)=>{devvit?.debug.runtime&&console.debug("[runtime] dispatcher got a new event from subscribe",r[0]);let[{response:n}]=r;n.uiResponse.effects.forEach(a=>{if(hd.some(i=>a[i])||a.realtimeSubscriptions){this.onUserAction?.(a);return}if(a.interval){let i=Object.entries(a.interval.intervals);i.length===0&&f(this,S5).clear(),f(this,S5).apply(i.map(([o,c])=>new J1(o,vd(c.duration))));return}if(a.webView){this.onWebViewMessage?.(a);return}console.warn(`Received an effect that is not implemented! Please add an effect handler to the web dispatcher. Effect: ${JSON.stringify(a,null,2)}`)}),t(...r)}))}submit(...t){f(this,I0).submit(...t)}unsubscribe(){f(this,Pt)?.unsubscribe()}init(){f(this,I0).init(f(this,e2),f(this,V5),f(this,S5))}togglePause(t){t?S(this,C3,f(this,I0).pause()):f(this,C3)&&f(this,I0).resume(f(this,C3))}resetAppState(){this.hasRendered=!1,f(this,I0).reset()}setEnv(t){f(this,y5).env=t}setProps(t){f(this,y5).props=t}remoteLoad(...t){f(this,V5).load(...t)}async localLoad(...t){return f(this,e2).reset(),await f(this,e2).load(...t)}localLoadWorker(...t){f(this,e2).setLocalSrc(...t)}};y5=new WeakMap,S5=new WeakMap,I0=new WeakMap,Pt=new WeakMap,V5=new WeakMap,e2=new WeakMap,C3=new WeakMap;function un(e,t,r,n,a){let i=n.match(/([a-zA-Z0-9-]+)\/(.*)/)??[];if(i.length<3)return"";let[o,c,l]=i;if(!t||!c||!l)return"";let u=r.replace(/[^0-9]+/g,"-"),v=t.replace(/^t[0-9]_/,""),d=a.split(".")[0],h=e.replace("{{location}}",v).replace("{{app}}",c).replace("{{installation}}",d).replace("{{version}}",u).replace("{{path}}",l);return new URL(h).toString()}var N5,I5,T5,M3,L3,G,T1,l9,vn,x7,C7,hn,M7,L7,ze,y3,y7,M1=class extends m0{constructor(){super();L(this,T1);this.runtimeDebugLogging=!1;this.useExperimentalBlocks=!1;this.useSpeculativeExecution=!1;this.webViewUrlTemplate="";this.appPublicApiVersion="";this.disableAssetSandbox=!1;L(this,N5);L(this,I5);L(this,T5);L(this,M3,!1);L(this,L3,"");L(this,G);L(this,x7,()=>({experimental:this.useExperimentalBlocks,resolveWebViewUrl:r=>this.disableAssetSandbox?r:un(this.webViewUrlTemplate,this.metadata?.[h2.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",r,this.bundle?.hostname??""),onAction:r=>{let n={};r.type===E2.ACTION_CLICK||f(this,M3)?n.userAction={actionId:r.id,data:r.data??{}}:r.type===E2.ACTION_WEBVIEW&&(n.webView={postMessage:{message:r.data}}),f(this,G)?.submit([new V0({scope:n1.ALL,hook:r.id,...n})])},stackDirection:H.UNRECOGNIZED,disableAssetSandbox:this.disableAssetSandbox}));L(this,C7,r=>{Io(r)||console.error(r),D(this,T1,ze).call(this,"devvit-ui-error",{err:r,type:"Error"})});L(this,M7,(r,n,a,i,o)=>{n===z5.fullName&&a===z5.methods.send.name&&D(this,T1,ze).call(this,"devvit-realtime-send",{event:i})});L(this,L7,({response:r})=>{var n,a;this.renderResponse=r,r?.blocks&&(this._rootBlock=r.blocks,f(this,N5)?((n=this._rootBlock).config??(n.config={}),(a=this._rootBlock.config).rootConfig??(a.rootConfig={children:[],height:0}),this._rootBlock.config.rootConfig.height=f(this,N5)):S(this,N5,this._rootBlock.config?.rootConfig?.height||Br))});L(this,y3,r=>{D(this,T1,ze).call(this,"devvit-ui-effect",{effect:r,onEvent:n=>n.webView?.postMessage?f(this,G)?.submit([new V0({scope:n1.ALL,hook:n.hook,webView:{...n.webView}})]):f(this,G)?.submit([new V0(n)]),metadata:this.metadata})});L(this,y7,async r=>{if(await this.updateComplete,r.webView?.fullscreen){let n=un(this.webViewUrlTemplate,this.metadata?.[h2.Subreddit]?.values?.[0],this.bundle?.actor?.version??"",r.webView.fullscreen.url,this.bundle?.hostname??"");devvit?.debug.surface&&console.debug("[surface] fullscreen web view asset,",r.webView.fullscreen.url,"resolved to",n),r.webView.fullscreen.url=n,f(this,y3).call(this,r)}else if(r.webView?.postMessage?.app){let n=[];if(r.webView.postMessage.webViewId){let a=this._blocksRenderer?.findBlockById(r.webView.postMessage.webViewId);a?.blockType!=="web-view"||!a?.element?f(this,y3).call(this,r):n.push(a)}else{let a=this._blocksRenderer?.findBlocksByType("web-view")??[];a.length===0?console.error("Invalid postMessage request: could not find a WebView"):n.push(...a)}for(let a of n)a?.element?.postMessage(r.webView.postMessage.app)}});devvit?.debug.surface&&console.debug("[surface] Using devvit-surface and KMP!")}static get styles(){return[l6]}async connectedCallback(){super.connectedCallback(),S(this,G,new E7({},{colorScheme:this.scheme,dimensions:this.dimensions,locale:this.metadata?.[h2.Language]?.values?.[0],timezone:this.metadata?.[h2.Timezone]?.values?.[0]},{useSpeculativeExecution:this.useSpeculativeExecution,performanceTracker:r=>{D(this,T1,ze).call(this,pa,{name:r.spanName,timeStart:r.startTimeMs,timeEnd:r.endTimeMs,target:r.target,intent:r.intent,eventCount:r.eventCount})},errorTracker:r=>{D(this,T1,ze).call(this,ma,{message:r.message,origin:r.origin,version:r.version})}})),f(this,G).onPluginCall=f(this,M7),f(this,G).onError=f(this,C7),f(this,G).onUserAction=f(this,y3),f(this,G).onWebViewMessage=f(this,y7),f(this,G).subscribe(r=>{f(this,L7).call(this,{request:r.request.uiRequest,response:r.response.uiResponse})}),S(this,I5,new ResizeObserver(Ho(r=>{r.length!==0&&(this.dimensions=Po(r[0],window,document.body))},600))),f(this,I5).observe(this,{box:"content-box"}),S(this,T5,new IntersectionObserver(r=>{r.forEach(n=>{f(this,G)?.togglePause(!n.isIntersecting)})})),f(this,T5).observe(this)}disconnectedCallback(){f(this,I5)?.unobserve(this),f(this,I5)?.disconnect(),f(this,T5)?.unobserve(this),f(this,T5)?.disconnect(),f(this,G)?.unsubscribe(),super.disconnectedCallback()}render(){return this.renderResponse?n0`<div class="relative">
|
|
626
626
|
<devvit-blocks-renderer
|
|
627
627
|
class="${this.scheme??""}"
|
|
628
628
|
.block="${this._rootBlock}"
|