@devvit/ui-renderer 0.12.6-next-2025-12-12-15-48-48-e26bafd4c.0 → 0.12.6-next-2025-12-12-16-16-45-de498961d.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.
@@ -1675,7 +1675,7 @@
1675
1675
  "format": "esm"
1676
1676
  },
1677
1677
  "../protos/dist/types/devvit/ui/effects/web_view/v1alpha/context.js": {
1678
- "bytes": 44641,
1678
+ "bytes": 45251,
1679
1679
  "imports": [
1680
1680
  {
1681
1681
  "path": "../../node_modules/protobufjs/minimal.js",
@@ -7145,7 +7145,7 @@
7145
7145
  "imports": [],
7146
7146
  "exports": [],
7147
7147
  "inputs": {},
7148
- "bytes": 2004148
7148
+ "bytes": 2005036
7149
7149
  },
7150
7150
  "dist/devvit-custom-post.min.js": {
7151
7151
  "imports": [
@@ -7487,7 +7487,7 @@
7487
7487
  "bytesInOutput": 94
7488
7488
  },
7489
7489
  "../protos/dist/types/devvit/ui/effects/web_view/v1alpha/context.js": {
7490
- "bytesInOutput": 19035
7490
+ "bytesInOutput": 19308
7491
7491
  },
7492
7492
  "../protos/dist/types/google/protobuf/struct.js": {
7493
7493
  "bytesInOutput": 6273
@@ -7658,7 +7658,7 @@
7658
7658
  "bytesInOutput": 5931
7659
7659
  }
7660
7660
  },
7661
- "bytes": 791784
7661
+ "bytes": 792057
7662
7662
  }
7663
7663
  }
7664
7664
  }
@@ -597,7 +597,7 @@ button inline-flex`},L4=e=>{let{createElement:t}=B(),{attributes:r,selected:i,ro
597
597
  ${Ze(de,"color")}
598
598
  ${lr(f)}
599
599
  >${n}</span
600
- >`}var N3;(function(e){e[e.EFFECT_REALTIME_SUB=0]="EFFECT_REALTIME_SUB",e[e.EFFECT_RERENDER_UI=1]="EFFECT_RERENDER_UI",e[e.EFFECT_RELOAD_PART=2]="EFFECT_RELOAD_PART",e[e.EFFECT_SHOW_FORM=3]="EFFECT_SHOW_FORM",e[e.EFFECT_SHOW_TOAST=4]="EFFECT_SHOW_TOAST",e[e.EFFECT_NAVIGATE_TO_URL=5]="EFFECT_NAVIGATE_TO_URL",e[e.EFFECT_SET_INTERVALS=7]="EFFECT_SET_INTERVALS",e[e.EFFECT_CREATE_ORDER=8]="EFFECT_CREATE_ORDER",e[e.EFFECT_WEB_VIEW=9]="EFFECT_WEB_VIEW",e[e.EFFECT_CAN_RUN_AS_USER=11]="EFFECT_CAN_RUN_AS_USER",e[e.EFFECT_TELEMETRY=12]="EFFECT_TELEMETRY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N3||(N3={}));var Sr;(function(e){e[e.CLIENT=0]="CLIENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Sr||(Sr={}));var R=G(F(),1);var F1=G(F(),1);var u=new Map;var Me;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Me||(Me={}));function Wo(e){switch(e){case 0:case"NULL_VALUE":return Me.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Me.UNRECOGNIZED}}function qo(e){switch(e){case Me.NULL_VALUE:return 0;case Me.UNRECOGNIZED:default:return-1}}function Z6(){return{fields:{}}}var L={$type:"google.protobuf.Struct",encode(e,t=F1.default.Writer.create()){return Object.entries(e.fields).forEach(([r,i])=>{i!==void 0&&R3.encode({key:r,value:i},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Z6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;let o=R3.decode(r,r.uint32());o.value!==void 0&&(a.fields[o.key]=o.value);continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{fields:_n(e.fields)?Object.entries(e.fields).reduce((t,[r,i])=>(t[r]=i,t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([i,a])=>{t.fields[i]=a}))}return t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=Z6();return t.fields=Object.entries(e.fields??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=a),r),{}),t},wrap(e){let t=Z6();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};u.set(L.$type,L);function Mn(){return{key:"",value:void 0}}var R3={$type:"google.protobuf.Struct.FieldsEntry",encode(e,t=F1.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&m1.encode(m1.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Mn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=m1.unwrap(m1.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:ze(e.key)?globalThis.String(e.key):"",value:ze(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return R3.fromPartial(e??{})},fromPartial(e){let t=Mn();return t.key=e.key??"",t.value=e.value??void 0,t}};u.set(R3.$type,R3);function E6(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var m1={$type:"google.protobuf.Value",encode(e,t=F1.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&L.encode(L.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Ce.encode(Ce.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=E6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.nullValue=r.int32();continue;case 2:if(n!==17)break;a.numberValue=r.double();continue;case 3:if(n!==26)break;a.stringValue=r.string();continue;case 4:if(n!==32)break;a.boolValue=r.bool();continue;case 5:if(n!==42)break;a.structValue=L.unwrap(L.decode(r,r.uint32()));continue;case 6:if(n!==50)break;a.listValue=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{nullValue:ze(e.nullValue)?Wo(e.nullValue):void 0,numberValue:ze(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:ze(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:ze(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:_n(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=qo(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return m1.fromPartial(e??{})},fromPartial(e){let t=E6();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=E6();if(e===null)t.nullValue=Me.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};u.set(m1.$type,m1);function x6(){return{values:[]}}var Ce={$type:"google.protobuf.ListValue",encode(e,t=F1.default.Writer.create()){for(let r of e.values)m1.encode(m1.wrap(r),t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=x6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.values.push(m1.unwrap(m1.decode(r,r.uint32())));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=x6();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=x6();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};u.set(Ce.$type,Ce);function _n(e){return typeof e=="object"&&e!==null}function ze(e){return e!=null}var k=G(F(),1);var n0=null;try{n0=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function b(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}b.prototype.__isLong__;Object.defineProperty(b.prototype,"__isLong__",{value:!0});function g1(e){return(e&&e.__isLong__)===!0}function Sn(e){var t=Math.clz32(e&-e);return e?31-t:t}b.isLong=g1;var yn={},Ln={};function _e(e,t){var r,i,a;return t?(e>>>=0,(a=0<=e&&e<256)&&(i=Ln[e],i)?i:(r=T(e,0,!0),a&&(Ln[e]=r),r)):(e|=0,(a=-128<=e&&e<128)&&(i=yn[e],i)?i:(r=T(e,e<0?-1:0,!1),a&&(yn[e]=r),r))}b.fromInt=_e;function a0(e,t){if(isNaN(e))return t?U0:m0;if(t){if(e<0)return U0;if(e>=Tn)return Hn}else{if(e<=-Vn)return O1;if(e+1>=Vn)return On}return e<0?a0(-e,t).neg():T(e%Ye|0,e/Ye|0,t)}b.fromNumber=a0;function T(e,t,r){return new b(e,t,r)}b.fromBits=T;var J5=Math.pow;function M6(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?U0:m0;if(r=r||10,r<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return M6(e.substring(1),t,r).neg();for(var a=a0(J5(r,8)),n=m0,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),r);if(s<8){var c=a0(J5(r,s));n=n.mul(c).add(a0(l))}else n=n.mul(a),n=n.add(a0(l))}return n.unsigned=t,n}b.fromString=M6;function i0(e,t){return typeof e=="number"?a0(e,t):typeof e=="string"?M6(e,t):T(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}b.fromValue=i0;var Nn=65536,Xo=1<<24,Ye=Nn*Nn,Tn=Ye*Ye,Vn=Tn/2,In=_e(Xo),m0=_e(0);b.ZERO=m0;var U0=_e(0,!0);b.UZERO=U0;var Qe=_e(1);b.ONE=Qe;var Rn=_e(1,!0);b.UONE=Rn;var C6=_e(-1);b.NEG_ONE=C6;var On=T(-1,2147483647,!1);b.MAX_VALUE=On;var Hn=T(-1,-1,!0);b.MAX_UNSIGNED_VALUE=Hn;var O1=T(0,-2147483648,!1);b.MIN_VALUE=O1;var h=b.prototype;h.toInt=function(){return this.unsigned?this.low>>>0:this.low};h.toNumber=function(){return this.unsigned?(this.high>>>0)*Ye+(this.low>>>0):this.high*Ye+(this.low>>>0)};h.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(O1)){var r=a0(t),i=this.div(r),a=i.mul(r).sub(this);return i.toString(t)+a.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var n=a0(J5(t,6),this.unsigned),o=this,s="";;){var l=o.div(n),c=o.sub(l.mul(n)).toInt()>>>0,d=c.toString(t);if(o=l,o.isZero())return d+s;for(;d.length<6;)d="0"+d;s=""+d+s}};h.getHighBits=function(){return this.high};h.getHighBitsUnsigned=function(){return this.high>>>0};h.getLowBits=function(){return this.low};h.getLowBitsUnsigned=function(){return this.low>>>0};h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O1)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return this.high!=0?r+33:r+1};h.isSafeInteger=function(){var t=this.high>>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};h.isZero=function(){return this.high===0&&this.low===0};h.eqz=h.isZero;h.isNegative=function(){return!this.unsigned&&this.high<0};h.isPositive=function(){return this.unsigned||this.high>=0};h.isOdd=function(){return(this.low&1)===1};h.isEven=function(){return(this.low&1)===0};h.equals=function(t){return g1(t)||(t=i0(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};h.eq=h.equals;h.notEquals=function(t){return!this.eq(t)};h.neq=h.notEquals;h.ne=h.notEquals;h.lessThan=function(t){return this.comp(t)<0};h.lt=h.lessThan;h.lessThanOrEqual=function(t){return this.comp(t)<=0};h.lte=h.lessThanOrEqual;h.le=h.lessThanOrEqual;h.greaterThan=function(t){return this.comp(t)>0};h.gt=h.greaterThan;h.greaterThanOrEqual=function(t){return this.comp(t)>=0};h.gte=h.greaterThanOrEqual;h.ge=h.greaterThanOrEqual;h.compare=function(t){if(g1(t)||(t=i0(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};h.comp=h.compare;h.negate=function(){return!this.unsigned&&this.eq(O1)?O1:this.not().add(Qe)};h.neg=h.negate;h.add=function(t){g1(t)||(t=i0(t));var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,n=this.low&65535,o=t.high>>>16,s=t.high&65535,l=t.low>>>16,c=t.low&65535,d=0,v=0,f=0,g=0;return g+=n+c,f+=g>>>16,g&=65535,f+=a+l,v+=f>>>16,f&=65535,v+=i+s,d+=v>>>16,v&=65535,d+=r+o,d&=65535,T(f<<16|g,d<<16|v,this.unsigned)};h.subtract=function(t){return g1(t)||(t=i0(t)),this.add(t.neg())};h.sub=h.subtract;h.multiply=function(t){if(this.isZero())return this;if(g1(t)||(t=i0(t)),n0){var r=n0.mul(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?U0:m0;if(this.eq(O1))return t.isOdd()?O1:m0;if(t.eq(O1))return this.isOdd()?O1:m0;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(In)&&t.lt(In))return a0(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,a=this.high&65535,n=this.low>>>16,o=this.low&65535,s=t.high>>>16,l=t.high&65535,c=t.low>>>16,d=t.low&65535,v=0,f=0,g=0,E=0;return E+=o*d,g+=E>>>16,E&=65535,g+=n*d,f+=g>>>16,g&=65535,g+=o*c,f+=g>>>16,g&=65535,f+=a*d,v+=f>>>16,f&=65535,f+=n*c,v+=f>>>16,f&=65535,f+=o*l,v+=f>>>16,f&=65535,v+=i*d+a*c+n*l+o*s,v&=65535,T(g<<16|E,v<<16|f,this.unsigned)};h.mul=h.multiply;h.divide=function(t){if(g1(t)||(t=i0(t)),t.isZero())throw Error("division by zero");if(n0){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?n0.div_u:n0.div_s)(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?U0:m0;var i,a,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return U0;if(t.gt(this.shru(1)))return Rn;n=U0}else{if(this.eq(O1)){if(t.eq(Qe)||t.eq(C6))return O1;if(t.eq(O1))return Qe;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(m0)?t.isNegative()?Qe:C6:(a=this.sub(t.mul(i)),n=i.add(a.div(t)),n)}else if(t.eq(O1))return this.unsigned?U0:m0;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=m0}for(a=this;a.gte(t);){i=Math.max(1,Math.floor(a.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),l=s<=48?1:J5(2,s-48),c=a0(i),d=c.mul(t);d.isNegative()||d.gt(a);)i-=l,c=a0(i,this.unsigned),d=c.mul(t);c.isZero()&&(c=Qe),n=n.add(c),a=a.sub(d)}return n};h.div=h.divide;h.modulo=function(t){if(g1(t)||(t=i0(t)),n0){var r=(this.unsigned?n0.rem_u:n0.rem_s)(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};h.mod=h.modulo;h.rem=h.modulo;h.not=function(){return T(~this.low,~this.high,this.unsigned)};h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};h.clz=h.countLeadingZeros;h.countTrailingZeros=function(){return this.low?Sn(this.low):Sn(this.high)+32};h.ctz=h.countTrailingZeros;h.and=function(t){return g1(t)||(t=i0(t)),T(this.low&t.low,this.high&t.high,this.unsigned)};h.or=function(t){return g1(t)||(t=i0(t)),T(this.low|t.low,this.high|t.high,this.unsigned)};h.xor=function(t){return g1(t)||(t=i0(t)),T(this.low^t.low,this.high^t.high,this.unsigned)};h.shiftLeft=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):T(0,this.low<<t-32,this.unsigned)};h.shl=h.shiftLeft;h.shiftRight=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):T(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};h.shr=h.shiftRight;h.shiftRightUnsigned=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?T(this.high,0,this.unsigned):T(this.high>>>t-32,0,this.unsigned)};h.shru=h.shiftRightUnsigned;h.shr_u=h.shiftRightUnsigned;h.rotateLeft=function(t){var r;return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?T(this.high,this.low,this.unsigned):t<32?(r=32-t,T(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,T(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};h.rotl=h.rotateLeft;h.rotateRight=function(t){var r;return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?T(this.high,this.low,this.unsigned):t<32?(r=32-t,T(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,T(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};h.rotr=h.rotateRight;h.toSigned=function(){return this.unsigned?T(this.low,this.high,!1):this};h.toUnsigned=function(){return this.unsigned?this:T(this.low,this.high,!0)};h.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};h.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};h.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};b.fromBytes=function(t,r,i){return i?b.fromBytesLE(t,r):b.fromBytesBE(t,r)};b.fromBytesLE=function(t,r){return new b(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};b.fromBytesBE=function(t,r){return new b(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};typeof BigInt=="function"&&(b.fromBigInt=function(t,r){var i=Number(BigInt.asIntN(32,t)),a=Number(BigInt.asIntN(32,t>>BigInt(32)));return T(i,a,r)},b.fromValue=function(t,r){return typeof t=="bigint"?b.fromBigInt(t,r):i0(t,r)},h.toBigInt=function(){var t=BigInt(this.low>>>0),r=BigInt(this.unsigned?this.high>>>0:this.high);return r<<BigInt(32)|t});var je=b;var Se=G(F(),1);function bn(){return{seconds:0,nanos:0}}var _1={$type:"google.protobuf.Timestamp",encode(e,t=Se.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 Se.default.Reader?e:Se.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=bn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.seconds=Ko(r.int64());continue;case 2:if(n!==16)break;a.nanos=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{seconds:Bn(e.seconds)?globalThis.Number(e.seconds):0,nanos:Bn(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 _1.fromPartial(e??{})},fromPartial(e){let t=bn();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};u.set(_1.$type,_1);function Ko(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}Se.default.util.Long!==je&&(Se.default.util.Long=je,Se.default.configure());function Bn(e){return e!=null}var y0;(function(e){e[e.CONSENT_STATUS_UNKNOWN=0]="CONSENT_STATUS_UNKNOWN",e[e.REVOKED=1]="REVOKED",e[e.GRANTED=2]="GRANTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(y0||(y0={}));function O3(e){switch(e){case 0:case"CONSENT_STATUS_UNKNOWN":return y0.CONSENT_STATUS_UNKNOWN;case 1:case"REVOKED":return y0.REVOKED;case 2:case"GRANTED":return y0.GRANTED;case-1:case"UNRECOGNIZED":default:return y0.UNRECOGNIZED}}function H3(e){switch(e){case y0.CONSENT_STATUS_UNKNOWN:return 0;case y0.REVOKED:return 1;case y0.GRANTED:return 2;case y0.UNRECOGNIZED:default:return-1}}var o0;(function(e){e[e.SCOPE_UNKNOWN=0]="SCOPE_UNKNOWN",e[e.SUBMIT_POST=1]="SUBMIT_POST",e[e.SUBMIT_COMMENT=2]="SUBMIT_COMMENT",e[e.SUBSCRIBE_TO_SUBREDDIT=3]="SUBSCRIBE_TO_SUBREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o0||(o0={}));function ye(e){switch(e){case 0:case"SCOPE_UNKNOWN":return o0.SCOPE_UNKNOWN;case 1:case"SUBMIT_POST":return o0.SUBMIT_POST;case 2:case"SUBMIT_COMMENT":return o0.SUBMIT_COMMENT;case 3:case"SUBSCRIBE_TO_SUBREDDIT":return o0.SUBSCRIBE_TO_SUBREDDIT;case-1:case"UNRECOGNIZED":default:return o0.UNRECOGNIZED}}function Le(e){switch(e){case o0.SCOPE_UNKNOWN:return 0;case o0.SUBMIT_POST:return 1;case o0.SUBMIT_COMMENT:return 2;case o0.SUBSCRIBE_TO_SUBREDDIT:return 3;case o0.UNRECOGNIZED:default:return-1}}function kn(){return{appSlug:"",subredditId:"",scopes:[],consentStatus:0,updatedAt:void 0}}var c2={$type:"reddit.devvit.app_permission.v1.AppPermission",encode(e,t=k.default.Writer.create()){e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.subredditId!==""&&t.uint32(18).string(e.subredditId),t.uint32(26).fork();for(let r of e.scopes)t.int32(r);return t.ldelim(),e.consentStatus!==0&&t.uint32(32).int32(e.consentStatus),e.updatedAt!==void 0&&_1.encode(zo(e.updatedAt),t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=kn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.subredditId=r.string();continue;case 3:if(n===24){a.scopes.push(r.int32());continue}if(n===26){let o=r.uint32()+r.pos;for(;r.pos<o;)a.scopes.push(r.int32());continue}break;case 4:if(n!==32)break;a.consentStatus=r.int32();continue;case 5:if(n!==42)break;a.updatedAt=qn(_1.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):"",scopes:globalThis.Array.isArray(e?.scopes)?e.scopes.map(t=>ye(t)):[],consentStatus:w1(e.consentStatus)?O3(e.consentStatus):0,updatedAt:w1(e.updatedAt)?Qo(e.updatedAt):void 0}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.subredditId!==""&&(t.subredditId=e.subredditId),e.scopes?.length&&(t.scopes=e.scopes.map(r=>Le(r))),e.consentStatus!==0&&(t.consentStatus=H3(e.consentStatus)),e.updatedAt!==void 0&&(t.updatedAt=e.updatedAt.toISOString()),t},create(e){return c2.fromPartial(e??{})},fromPartial(e){let t=kn();return t.appSlug=e.appSlug??"",t.subredditId=e.subredditId??"",t.scopes=e.scopes?.map(r=>r)||[],t.consentStatus=e.consentStatus??0,t.updatedAt=e.updatedAt??void 0,t}};u.set(c2.$type,c2);function Pn(){return{appSlug:"",appName:""}}var d2={$type:"reddit.devvit.app_permission.v1.DevvitApp",encode(e,t=k.default.Writer.create()){return e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.appName!==""&&t.uint32(18).string(e.appName),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Pn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.appName=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",appName:w1(e.appName)?globalThis.String(e.appName):""}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.appName!==""&&(t.appName=e.appName),t},create(e){return d2.fromPartial(e??{})},fromPartial(e){let t=Pn();return t.appSlug=e.appSlug??"",t.appName=e.appName??"",t}};u.set(d2.$type,d2);function $n(){return{userId:""}}var _6={$type:"reddit.devvit.app_permission.v1.GetAppPermissionsByUserIdRequest",encode(e,t=k.default.Writer.create()){return e.userId!==""&&t.uint32(10).string(e.userId),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=$n();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:w1(e.userId)?globalThis.String(e.userId):""}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),t},create(e){return _6.fromPartial(e??{})},fromPartial(e){let t=$n();return t.userId=e.userId??"",t}};u.set(_6.$type,_6);function Un(){return{appPermissions:[],devvitApps:[]}}var S6={$type:"reddit.devvit.app_permission.v1.GetAppPermissionsByUserIdResponse",encode(e,t=k.default.Writer.create()){for(let r of e.appPermissions)c2.encode(r,t.uint32(10).fork()).ldelim();for(let r of e.devvitApps)d2.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Un();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appPermissions.push(c2.decode(r,r.uint32()));continue;case 2:if(n!==18)break;a.devvitApps.push(d2.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appPermissions:globalThis.Array.isArray(e?.appPermissions)?e.appPermissions.map(t=>c2.fromJSON(t)):[],devvitApps:globalThis.Array.isArray(e?.devvitApps)?e.devvitApps.map(t=>d2.fromJSON(t)):[]}},toJSON(e){let t={};return e.appPermissions?.length&&(t.appPermissions=e.appPermissions.map(r=>c2.toJSON(r))),e.devvitApps?.length&&(t.devvitApps=e.devvitApps.map(r=>d2.toJSON(r))),t},create(e){return S6.fromPartial(e??{})},fromPartial(e){let t=Un();return t.appPermissions=e.appPermissions?.map(r=>c2.fromPartial(r))||[],t.devvitApps=e.devvitApps?.map(r=>d2.fromPartial(r))||[],t}};u.set(S6.$type,S6);function Dn(){return{userId:"",appSlug:"",subredditId:"",scopes:[]}}var y6={$type:"reddit.devvit.app_permission.v1.GrantAppPermissionRequest",encode(e,t=k.default.Writer.create()){e.userId!==""&&t.uint32(10).string(e.userId),e.appSlug!==""&&t.uint32(18).string(e.appSlug),e.subredditId!==""&&t.uint32(26).string(e.subredditId),t.uint32(34).fork();for(let r of e.scopes)t.int32(r);return t.ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Dn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue;case 2:if(n!==18)break;a.appSlug=r.string();continue;case 3:if(n!==26)break;a.subredditId=r.string();continue;case 4:if(n===32){a.scopes.push(r.int32());continue}if(n===34){let o=r.uint32()+r.pos;for(;r.pos<o;)a.scopes.push(r.int32());continue}break}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:w1(e.userId)?globalThis.String(e.userId):"",appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):"",scopes:globalThis.Array.isArray(e?.scopes)?e.scopes.map(t=>ye(t)):[]}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),e.appSlug!==""&&(t.appSlug=e.appSlug),e.subredditId!==""&&(t.subredditId=e.subredditId),e.scopes?.length&&(t.scopes=e.scopes.map(r=>Le(r))),t},create(e){return y6.fromPartial(e??{})},fromPartial(e){let t=Dn();return t.userId=e.userId??"",t.appSlug=e.appSlug??"",t.subredditId=e.subredditId??"",t.scopes=e.scopes?.map(r=>r)||[],t}};u.set(y6.$type,y6);function Gn(){return{error:void 0}}var L6={$type:"reddit.devvit.app_permission.v1.GrantAppPermissionResponse",encode(e,t=k.default.Writer.create()){return e.error!==void 0&&J1.encode(e.error,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Gn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.error=J1.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{error:w1(e.error)?J1.fromJSON(e.error):void 0}},toJSON(e){let t={};return e.error!==void 0&&(t.error=J1.toJSON(e.error)),t},create(e){return L6.fromPartial(e??{})},fromPartial(e){let t=Gn();return t.error=e.error!==void 0&&e.error!==null?J1.fromPartial(e.error):void 0,t}};u.set(L6.$type,L6);function Fn(){return{appSlug:"",userId:"",subredditId:""}}var N6={$type:"reddit.devvit.app_permission.v1.RevokeAppPermissionRequest",encode(e,t=k.default.Writer.create()){return e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.userId!==""&&t.uint32(18).string(e.userId),e.subredditId!==""&&t.uint32(26).string(e.subredditId),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Fn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.userId=r.string();continue;case 3:if(n!==26)break;a.subredditId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",userId:w1(e.userId)?globalThis.String(e.userId):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):""}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.userId!==""&&(t.userId=e.userId),e.subredditId!==""&&(t.subredditId=e.subredditId),t},create(e){return N6.fromPartial(e??{})},fromPartial(e){let t=Fn();return t.appSlug=e.appSlug??"",t.userId=e.userId??"",t.subredditId=e.subredditId??"",t}};u.set(N6.$type,N6);function Jn(){return{error:void 0}}var V6={$type:"reddit.devvit.app_permission.v1.RevokeAppPermissionResponse",encode(e,t=k.default.Writer.create()){return e.error!==void 0&&J1.encode(e.error,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Jn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.error=J1.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{error:w1(e.error)?J1.fromJSON(e.error):void 0}},toJSON(e){let t={};return e.error!==void 0&&(t.error=J1.toJSON(e.error)),t},create(e){return V6.fromPartial(e??{})},fromPartial(e){let t=Jn();return t.error=e.error!==void 0&&e.error!==null?J1.fromPartial(e.error):void 0,t}};u.set(V6.$type,V6);function Wn(){return{message:""}}var J1={$type:"reddit.devvit.app_permission.v1.ErrorMessage",encode(e,t=k.default.Writer.create()){return e.message!==""&&t.uint32(10).string(e.message),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Wn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.message=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{message:w1(e.message)?globalThis.String(e.message):""}},toJSON(e){let t={};return e.message!==""&&(t.message=e.message),t},create(e){return J1.fromPartial(e??{})},fromPartial(e){let t=Wn();return t.message=e.message??"",t}};u.set(J1.$type,J1);function zo(e){let t=Math.trunc(e.getTime()/1e3),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}function qn(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function Qo(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):qn(_1.fromJSON(e))}function w1(e){return e!=null}var W1=G(F(),1);var W5=G(F(),1);var u2;(function(e){e[e.APS_UNSPECIFIED=0]="APS_UNSPECIFIED",e[e.APS_REDDIT_PROMOTED=1]="APS_REDDIT_PROMOTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(u2||(u2={}));function Yo(e){switch(e){case 0:case"APS_UNSPECIFIED":return u2.APS_UNSPECIFIED;case 1:case"APS_REDDIT_PROMOTED":return u2.APS_REDDIT_PROMOTED;case-1:case"UNRECOGNIZED":default:return u2.UNRECOGNIZED}}function jo(e){switch(e){case u2.APS_UNSPECIFIED:return 0;case u2.APS_REDDIT_PROMOTED:return 1;case u2.UNRECOGNIZED:default:return-1}}function Xn(){return{promoStatus:0}}var D0={$type:"reddit.devvit.ads.v1.AdsConfig",encode(e,t=W5.default.Writer.create()){return e.promoStatus!==0&&t.uint32(8).int32(e.promoStatus),t},decode(e,t){let r=e instanceof W5.default.Reader?e:W5.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Xn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.promoStatus=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{promoStatus:el(e.promoStatus)?Yo(e.promoStatus):0}},toJSON(e){let t={};return e.promoStatus!==0&&(t.promoStatus=jo(e.promoStatus)),t},create(e){return D0.fromPartial(e??{})},fromPartial(e){let t=Xn();return t.promoStatus=e.promoStatus??0,t}};u.set(D0.$type,D0);function el(e){return e!=null}var L0;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNLISTED=2]="UNLISTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(L0||(L0={}));function tl(e){switch(e){case 0:case"PUBLIC":return L0.PUBLIC;case 1:case"PRIVATE":return L0.PRIVATE;case 2:case"UNLISTED":return L0.UNLISTED;case-1:case"UNRECOGNIZED":default:return L0.UNRECOGNIZED}}function rl(e){switch(e){case L0.PUBLIC:return 0;case L0.PRIVATE:return 1;case L0.UNLISTED:return 2;case L0.UNRECOGNIZED:default:return-1}}var Kn;(function(e){e[e.RENDER_VERSION_UNSPECIFIED=0]="RENDER_VERSION_UNSPECIFIED",e[e.NO_DEVVIT_JSON=256]="NO_DEVVIT_JSON",e[e.WEBBIT_BLOCKS=512]="WEBBIT_BLOCKS",e[e.WEBBIT_PURE_NO_ENTRYPOINT=1024]="WEBBIT_PURE_NO_ENTRYPOINT",e[e.WEBBIT_PURE_NO_INLINE=1040]="WEBBIT_PURE_NO_INLINE",e[e.WEBBIT_PURE_INLINE=1056]="WEBBIT_PURE_INLINE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Kn||(Kn={}));function zn(){return{id:"",slug:"",name:"",visibility:0,owner:void 0,version:"",adsConfig:void 0,termsAndConditions:"",privacyPolicy:"",requestedPermissionScopes:[],renderVersion:void 0}}var I6={$type:"reddit.devvit.common.v1.App",encode(e,t=W1.default.Writer.create()){e.id!==""&&t.uint32(10).string(e.id),e.slug!==""&&t.uint32(18).string(e.slug),e.name!==""&&t.uint32(26).string(e.name),e.visibility!==0&&t.uint32(32).int32(e.visibility),e.owner!==void 0&&v2.encode(e.owner,t.uint32(42).fork()).ldelim(),e.version!==""&&t.uint32(50).string(e.version),e.adsConfig!==void 0&&D0.encode(e.adsConfig,t.uint32(58).fork()).ldelim(),e.termsAndConditions!==""&&t.uint32(66).string(e.termsAndConditions),e.privacyPolicy!==""&&t.uint32(74).string(e.privacyPolicy),t.uint32(82).fork();for(let r of e.requestedPermissionScopes)t.int32(r);return t.ldelim(),e.renderVersion!==void 0&&t.uint32(88).int32(e.renderVersion),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=zn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.id=r.string();continue;case 2:if(n!==18)break;a.slug=r.string();continue;case 3:if(n!==26)break;a.name=r.string();continue;case 4:if(n!==32)break;a.visibility=r.int32();continue;case 5:if(n!==42)break;a.owner=v2.decode(r,r.uint32());continue;case 6:if(n!==50)break;a.version=r.string();continue;case 7:if(n!==58)break;a.adsConfig=D0.decode(r,r.uint32());continue;case 8:if(n!==66)break;a.termsAndConditions=r.string();continue;case 9:if(n!==74)break;a.privacyPolicy=r.string();continue;case 10:if(n===80){a.requestedPermissionScopes.push(r.int32());continue}if(n===82){let o=r.uint32()+r.pos;for(;r.pos<o;)a.requestedPermissionScopes.push(r.int32());continue}break;case 11:if(n!==88)break;a.renderVersion=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{id:H1(e.id)?globalThis.String(e.id):"",slug:H1(e.slug)?globalThis.String(e.slug):"",name:H1(e.name)?globalThis.String(e.name):"",visibility:H1(e.visibility)?tl(e.visibility):0,owner:H1(e.owner)?v2.fromJSON(e.owner):void 0,version:H1(e.version)?globalThis.String(e.version):"",adsConfig:H1(e.adsConfig)?D0.fromJSON(e.adsConfig):void 0,termsAndConditions:H1(e.termsAndConditions)?globalThis.String(e.termsAndConditions):"",privacyPolicy:H1(e.privacyPolicy)?globalThis.String(e.privacyPolicy):"",requestedPermissionScopes:globalThis.Array.isArray(e?.requestedPermissionScopes)?e.requestedPermissionScopes.map(t=>ye(t)):[],renderVersion:H1(e.renderVersion)?globalThis.Number(e.renderVersion):void 0}},toJSON(e){let t={};return e.id!==""&&(t.id=e.id),e.slug!==""&&(t.slug=e.slug),e.name!==""&&(t.name=e.name),e.visibility!==0&&(t.visibility=rl(e.visibility)),e.owner!==void 0&&(t.owner=v2.toJSON(e.owner)),e.version!==""&&(t.version=e.version),e.adsConfig!==void 0&&(t.adsConfig=D0.toJSON(e.adsConfig)),e.termsAndConditions!==""&&(t.termsAndConditions=e.termsAndConditions),e.privacyPolicy!==""&&(t.privacyPolicy=e.privacyPolicy),e.requestedPermissionScopes?.length&&(t.requestedPermissionScopes=e.requestedPermissionScopes.map(r=>Le(r))),e.renderVersion!==void 0&&(t.renderVersion=Math.round(e.renderVersion)),t},create(e){return I6.fromPartial(e??{})},fromPartial(e){let t=zn();return t.id=e.id??"",t.slug=e.slug??"",t.name=e.name??"",t.visibility=e.visibility??0,t.owner=e.owner!==void 0&&e.owner!==null?v2.fromPartial(e.owner):void 0,t.version=e.version??"",t.adsConfig=e.adsConfig!==void 0&&e.adsConfig!==null?D0.fromPartial(e.adsConfig):void 0,t.termsAndConditions=e.termsAndConditions??"",t.privacyPolicy=e.privacyPolicy??"",t.requestedPermissionScopes=e.requestedPermissionScopes?.map(r=>r)||[],t.renderVersion=e.renderVersion??void 0,t}};u.set(I6.$type,I6);function Qn(){return{userId:"",userName:""}}var v2={$type:"reddit.devvit.common.v1.AppOwner",encode(e,t=W1.default.Writer.create()){return e.userId!==""&&t.uint32(10).string(e.userId),e.userName!==""&&t.uint32(18).string(e.userName),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Qn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue;case 2:if(n!==18)break;a.userName=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:H1(e.userId)?globalThis.String(e.userId):"",userName:H1(e.userName)?globalThis.String(e.userName):""}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),e.userName!==""&&(t.userName=e.userName),t},create(e){return v2.fromPartial(e??{})},fromPartial(e){let t=Qn();return t.userId=e.userId??"",t.userName=e.userName??"",t}};u.set(v2.$type,v2);function Yn(){return{entrypoints:{}}}var G0={$type:"reddit.devvit.common.v1.AppConfig",encode(e,t=W1.default.Writer.create()){return Object.entries(e.entrypoints).forEach(([r,i])=>{b3.encode({key:r,value:i},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Yn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;let o=b3.decode(r,r.uint32());o.value!==void 0&&(a.entrypoints[o.key]=o.value);continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{entrypoints:nl(e.entrypoints)?Object.entries(e.entrypoints).reduce((t,[r,i])=>(t[r]=String(i),t),{}):{}}},toJSON(e){let t={};if(e.entrypoints){let r=Object.entries(e.entrypoints);r.length>0&&(t.entrypoints={},r.forEach(([i,a])=>{t.entrypoints[i]=a}))}return t},create(e){return G0.fromPartial(e??{})},fromPartial(e){let t=Yn();return t.entrypoints=Object.entries(e.entrypoints??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=globalThis.String(a)),r),{}),t}};u.set(G0.$type,G0);function jn(){return{key:"",value:""}}var b3={$type:"reddit.devvit.common.v1.AppConfig.EntrypointsEntry",encode(e,t=W1.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 W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=jn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:H1(e.key)?globalThis.String(e.key):"",value:H1(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 b3.fromPartial(e??{})},fromPartial(e){let t=jn();return t.key=e.key??"",t.value=e.value??"",t}};u.set(b3.$type,b3);function nl(e){return typeof e=="object"&&e!==null}function H1(e){return e!=null}var q5=G(F(),1);var N0;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.INLINE_MODE=1]="INLINE_MODE",e[e.IMMERSIVE_MODE=2]="IMMERSIVE_MODE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N0||(N0={}));function B3(e){switch(e){case 0:case"UNSPECIFIED":return N0.UNSPECIFIED;case 1:case"INLINE_MODE":return N0.INLINE_MODE;case 2:case"IMMERSIVE_MODE":return N0.IMMERSIVE_MODE;case-1:case"UNRECOGNIZED":default:return N0.UNRECOGNIZED}}function k3(e){switch(e){case N0.UNSPECIFIED:return 0;case N0.INLINE_MODE:return 1;case N0.IMMERSIVE_MODE:return 2;case N0.UNRECOGNIZED:default:return-1}}function ea(){return{immersiveMode:0,entryUrl:void 0}}var T6={$type:"devvit.ui.effects.web_view.v1alpha.WebViewImmersiveModeEffect",encode(e,t=q5.default.Writer.create()){return e.immersiveMode!==0&&t.uint32(8).int32(e.immersiveMode),e.entryUrl!==void 0&&t.uint32(18).string(e.entryUrl),t},decode(e,t){let r=e instanceof q5.default.Reader?e:q5.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ea();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.immersiveMode=r.int32();continue;case 2:if(n!==18)break;a.entryUrl=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{immersiveMode:ta(e.immersiveMode)?B3(e.immersiveMode):0,entryUrl:ta(e.entryUrl)?globalThis.String(e.entryUrl):void 0}},toJSON(e){let t={};return e.immersiveMode!==0&&(t.immersiveMode=k3(e.immersiveMode)),e.entryUrl!==void 0&&(t.entryUrl=e.entryUrl),t},create(e){return T6.fromPartial(e??{})},fromPartial(e){let t=ea();return t.immersiveMode=e.immersiveMode??0,t.entryUrl=e.entryUrl??void 0,t}};u.set(T6.$type,T6);function ta(e){return e!=null}var l0;(function(e){e[e.CLIENT_UNSPECIFIED=0]="CLIENT_UNSPECIFIED",e[e.ANDROID=1]="ANDROID",e[e.IOS=2]="IOS",e[e.SHREDDIT=3]="SHREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(l0||(l0={}));function al(e){switch(e){case 0:case"CLIENT_UNSPECIFIED":return l0.CLIENT_UNSPECIFIED;case 1:case"ANDROID":return l0.ANDROID;case 2:case"IOS":return l0.IOS;case 3:case"SHREDDIT":return l0.SHREDDIT;case-1:case"UNRECOGNIZED":default:return l0.UNRECOGNIZED}}function il(e){switch(e){case l0.CLIENT_UNSPECIFIED:return 0;case l0.ANDROID:return 1;case l0.IOS:return 2;case l0.SHREDDIT:return 3;case l0.UNRECOGNIZED:default:return-1}}var ra;(function(e){e[e.HEIGHT_UNSPECIFIED=0]="HEIGHT_UNSPECIFIED",e[e.REGULAR=1]="REGULAR",e[e.TALL=2]="TALL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ra||(ra={}));function na(){return{postData:void 0,shareParam:void 0,webViewContext:void 0,webbitToken:"",devvitDebug:"",client:0,nativeVersion:void 0,shredditVersion:void 0,appPermissionState:void 0,viewMode:void 0,signedRequestContext:void 0,webViewClientData:void 0}}var R6={$type:"devvit.ui.effects.web_view.v1alpha.BridgeContext",encode(e,t=R.default.Writer.create()){return e.postData!==void 0&&p2.encode(e.postData,t.uint32(10).fork()).ldelim(),e.shareParam!==void 0&&m2.encode(e.shareParam,t.uint32(18).fork()).ldelim(),e.webViewContext!==void 0&&V0.encode(e.webViewContext,t.uint32(26).fork()).ldelim(),e.webbitToken!==""&&t.uint32(34).string(e.webbitToken),e.devvitDebug!==""&&t.uint32(42).string(e.devvitDebug),e.client!==0&&t.uint32(48).int32(e.client),e.nativeVersion!==void 0&&h2.encode(e.nativeVersion,t.uint32(58).fork()).ldelim(),e.shredditVersion!==void 0&&f2.encode(e.shredditVersion,t.uint32(66).fork()).ldelim(),e.appPermissionState!==void 0&&w2.encode(e.appPermissionState,t.uint32(74).fork()).ldelim(),e.viewMode!==void 0&&t.uint32(80).int32(e.viewMode),e.signedRequestContext!==void 0&&t.uint32(98).string(e.signedRequestContext),e.webViewClientData!==void 0&&L.encode(L.wrap(e.webViewClientData),t.uint32(106).fork()).ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=na();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.postData=p2.decode(r,r.uint32());continue;case 2:if(n!==18)break;a.shareParam=m2.decode(r,r.uint32());continue;case 3:if(n!==26)break;a.webViewContext=V0.decode(r,r.uint32());continue;case 4:if(n!==34)break;a.webbitToken=r.string();continue;case 5:if(n!==42)break;a.devvitDebug=r.string();continue;case 6:if(n!==48)break;a.client=r.int32();continue;case 7:if(n!==58)break;a.nativeVersion=h2.decode(r,r.uint32());continue;case 8:if(n!==66)break;a.shredditVersion=f2.decode(r,r.uint32());continue;case 9:if(n!==74)break;a.appPermissionState=w2.decode(r,r.uint32());continue;case 10:if(n!==80)break;a.viewMode=r.int32();continue;case 12:if(n!==98)break;a.signedRequestContext=r.string();continue;case 13:if(n!==106)break;a.webViewClientData=L.unwrap(L.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{postData:C(e.postData)?p2.fromJSON(e.postData):void 0,shareParam:C(e.shareParam)?m2.fromJSON(e.shareParam):void 0,webViewContext:C(e.webViewContext)?V0.fromJSON(e.webViewContext):void 0,webbitToken:C(e.webbitToken)?globalThis.String(e.webbitToken):"",devvitDebug:C(e.devvitDebug)?globalThis.String(e.devvitDebug):"",client:C(e.client)?al(e.client):0,nativeVersion:C(e.nativeVersion)?h2.fromJSON(e.nativeVersion):void 0,shredditVersion:C(e.shredditVersion)?f2.fromJSON(e.shredditVersion):void 0,appPermissionState:C(e.appPermissionState)?w2.fromJSON(e.appPermissionState):void 0,viewMode:C(e.viewMode)?B3(e.viewMode):void 0,signedRequestContext:C(e.signedRequestContext)?globalThis.String(e.signedRequestContext):void 0,webViewClientData:H6(e.webViewClientData)?e.webViewClientData:void 0}},toJSON(e){let t={};return e.postData!==void 0&&(t.postData=p2.toJSON(e.postData)),e.shareParam!==void 0&&(t.shareParam=m2.toJSON(e.shareParam)),e.webViewContext!==void 0&&(t.webViewContext=V0.toJSON(e.webViewContext)),e.webbitToken!==""&&(t.webbitToken=e.webbitToken),e.devvitDebug!==""&&(t.devvitDebug=e.devvitDebug),e.client!==0&&(t.client=il(e.client)),e.nativeVersion!==void 0&&(t.nativeVersion=h2.toJSON(e.nativeVersion)),e.shredditVersion!==void 0&&(t.shredditVersion=f2.toJSON(e.shredditVersion)),e.appPermissionState!==void 0&&(t.appPermissionState=w2.toJSON(e.appPermissionState)),e.viewMode!==void 0&&(t.viewMode=k3(e.viewMode)),e.signedRequestContext!==void 0&&(t.signedRequestContext=e.signedRequestContext),e.webViewClientData!==void 0&&(t.webViewClientData=e.webViewClientData),t},create(e){return R6.fromPartial(e??{})},fromPartial(e){let t=na();return t.postData=e.postData!==void 0&&e.postData!==null?p2.fromPartial(e.postData):void 0,t.shareParam=e.shareParam!==void 0&&e.shareParam!==null?m2.fromPartial(e.shareParam):void 0,t.webViewContext=e.webViewContext!==void 0&&e.webViewContext!==null?V0.fromPartial(e.webViewContext):void 0,t.webbitToken=e.webbitToken??"",t.devvitDebug=e.devvitDebug??"",t.client=e.client??0,t.nativeVersion=e.nativeVersion!==void 0&&e.nativeVersion!==null?h2.fromPartial(e.nativeVersion):void 0,t.shredditVersion=e.shredditVersion!==void 0&&e.shredditVersion!==null?f2.fromPartial(e.shredditVersion):void 0,t.appPermissionState=e.appPermissionState!==void 0&&e.appPermissionState!==null?w2.fromPartial(e.appPermissionState):void 0,t.viewMode=e.viewMode??void 0,t.signedRequestContext=e.signedRequestContext??void 0,t.webViewClientData=e.webViewClientData??void 0,t}};u.set(R6.$type,R6);function aa(){return{yyyy:0,release:0,attempt:0,number:0}}var h2={$type:"devvit.ui.effects.web_view.v1alpha.NativeClientVersion",encode(e,t=R.default.Writer.create()){return e.yyyy!==0&&t.uint32(8).int32(e.yyyy),e.release!==0&&t.uint32(16).int32(e.release),e.attempt!==0&&t.uint32(24).int32(e.attempt),e.number!==0&&t.uint32(32).int32(e.number),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=aa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.yyyy=r.int32();continue;case 2:if(n!==16)break;a.release=r.int32();continue;case 3:if(n!==24)break;a.attempt=r.int32();continue;case 4:if(n!==32)break;a.number=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{yyyy:C(e.yyyy)?globalThis.Number(e.yyyy):0,release:C(e.release)?globalThis.Number(e.release):0,attempt:C(e.attempt)?globalThis.Number(e.attempt):0,number:C(e.number)?globalThis.Number(e.number):0}},toJSON(e){let t={};return e.yyyy!==0&&(t.yyyy=Math.round(e.yyyy)),e.release!==0&&(t.release=Math.round(e.release)),e.attempt!==0&&(t.attempt=Math.round(e.attempt)),e.number!==0&&(t.number=Math.round(e.number)),t},create(e){return h2.fromPartial(e??{})},fromPartial(e){let t=aa();return t.yyyy=e.yyyy??0,t.release=e.release??0,t.attempt=e.attempt??0,t.number=e.number??0,t}};u.set(h2.$type,h2);function ia(){return{major:0,minor:0,patch:0,version:""}}var f2={$type:"devvit.ui.effects.web_view.v1alpha.SemVer",encode(e,t=R.default.Writer.create()){return e.major!==0&&t.uint32(8).int32(e.major),e.minor!==0&&t.uint32(16).int32(e.minor),e.patch!==0&&t.uint32(24).int32(e.patch),e.version!==""&&t.uint32(34).string(e.version),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ia();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.major=r.int32();continue;case 2:if(n!==16)break;a.minor=r.int32();continue;case 3:if(n!==24)break;a.patch=r.int32();continue;case 4:if(n!==34)break;a.version=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{major:C(e.major)?globalThis.Number(e.major):0,minor:C(e.minor)?globalThis.Number(e.minor):0,patch:C(e.patch)?globalThis.Number(e.patch):0,version:C(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.major!==0&&(t.major=Math.round(e.major)),e.minor!==0&&(t.minor=Math.round(e.minor)),e.patch!==0&&(t.patch=Math.round(e.patch)),e.version!==""&&(t.version=e.version),t},create(e){return f2.fromPartial(e??{})},fromPartial(e){let t=ia();return t.major=e.major??0,t.minor=e.minor??0,t.patch=e.patch??0,t.version=e.version??"",t}};u.set(f2.$type,f2);function oa(){return{appConfig:void 0}}var O6={$type:"devvit.ui.effects.web_view.v1alpha.WebViewClientData",encode(e,t=R.default.Writer.create()){return e.appConfig!==void 0&&G0.encode(e.appConfig,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=oa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appConfig=G0.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appConfig:C(e.appConfig)?G0.fromJSON(e.appConfig):void 0}},toJSON(e){let t={};return e.appConfig!==void 0&&(t.appConfig=G0.toJSON(e.appConfig)),t},create(e){return O6.fromPartial(e??{})},fromPartial(e){let t=oa();return t.appConfig=e.appConfig!==void 0&&e.appConfig!==null?G0.fromPartial(e.appConfig):void 0,t}};u.set(O6.$type,O6);function la(){return{subredditId:"",subredditName:"",userId:"",appName:"",appVersion:"",postId:""}}var V0={$type:"devvit.ui.effects.web_view.v1alpha.WebViewContext",encode(e,t=R.default.Writer.create()){return e.subredditId!==""&&t.uint32(10).string(e.subredditId),e.subredditName!==""&&t.uint32(18).string(e.subredditName),e.userId!==""&&t.uint32(26).string(e.userId),e.appName!==""&&t.uint32(34).string(e.appName),e.appVersion!==""&&t.uint32(42).string(e.appVersion),e.postId!==""&&t.uint32(50).string(e.postId),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=la();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.subredditId=r.string();continue;case 2:if(n!==18)break;a.subredditName=r.string();continue;case 3:if(n!==26)break;a.userId=r.string();continue;case 4:if(n!==34)break;a.appName=r.string();continue;case 5:if(n!==42)break;a.appVersion=r.string();continue;case 6:if(n!==50)break;a.postId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{subredditId:C(e.subredditId)?globalThis.String(e.subredditId):"",subredditName:C(e.subredditName)?globalThis.String(e.subredditName):"",userId:C(e.userId)?globalThis.String(e.userId):"",appName:C(e.appName)?globalThis.String(e.appName):"",appVersion:C(e.appVersion)?globalThis.String(e.appVersion):"",postId:C(e.postId)?globalThis.String(e.postId):""}},toJSON(e){let t={};return e.subredditId!==""&&(t.subredditId=e.subredditId),e.subredditName!==""&&(t.subredditName=e.subredditName),e.userId!==""&&(t.userId=e.userId),e.appName!==""&&(t.appName=e.appName),e.appVersion!==""&&(t.appVersion=e.appVersion),e.postId!==""&&(t.postId=e.postId),t},create(e){return V0.fromPartial(e??{})},fromPartial(e){let t=la();return t.subredditId=e.subredditId??"",t.subredditName=e.subredditName??"",t.userId=e.userId??"",t.appName=e.appName??"",t.appVersion=e.appVersion??"",t.postId=e.postId??"",t}};u.set(V0.$type,V0);function sa(){return{splash:void 0,developerData:void 0}}var p2={$type:"devvit.ui.effects.web_view.v1alpha.DevvitPostData",encode(e,t=R.default.Writer.create()){return e.splash!==void 0&&g2.encode(e.splash,t.uint32(26).fork()).ldelim(),e.developerData!==void 0&&L.encode(L.wrap(e.developerData),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=sa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 3:if(n!==26)break;a.splash=g2.decode(r,r.uint32());continue;case 2:if(n!==18)break;a.developerData=L.unwrap(L.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{splash:C(e.splash)?g2.fromJSON(e.splash):void 0,developerData:H6(e.developerData)?e.developerData:void 0}},toJSON(e){let t={};return e.splash!==void 0&&(t.splash=g2.toJSON(e.splash)),e.developerData!==void 0&&(t.developerData=e.developerData),t},create(e){return p2.fromPartial(e??{})},fromPartial(e){let t=sa();return t.splash=e.splash!==void 0&&e.splash!==null?g2.fromPartial(e.splash):void 0,t.developerData=e.developerData??void 0,t}};u.set(p2.$type,p2);function ca(){return{path:"",params:{},hash:"",userData:void 0}}var m2={$type:"devvit.ui.effects.web_view.v1alpha.ShareParam",encode(e,t=R.default.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),Object.entries(e.params).forEach(([r,i])=>{P3.encode({key:r,value:i},t.uint32(18).fork()).ldelim()}),e.hash!==""&&t.uint32(26).string(e.hash),e.userData!==void 0&&t.uint32(34).string(e.userData),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ca();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.path=r.string();continue;case 2:if(n!==18)break;let o=P3.decode(r,r.uint32());o.value!==void 0&&(a.params[o.key]=o.value);continue;case 3:if(n!==26)break;a.hash=r.string();continue;case 4:if(n!==34)break;a.userData=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{path:C(e.path)?globalThis.String(e.path):"",params:H6(e.params)?Object.entries(e.params).reduce((t,[r,i])=>(t[r]=String(i),t),{}):{},hash:C(e.hash)?globalThis.String(e.hash):"",userData:C(e.userData)?globalThis.String(e.userData):void 0}},toJSON(e){let t={};if(e.path!==""&&(t.path=e.path),e.params){let r=Object.entries(e.params);r.length>0&&(t.params={},r.forEach(([i,a])=>{t.params[i]=a}))}return e.hash!==""&&(t.hash=e.hash),e.userData!==void 0&&(t.userData=e.userData),t},create(e){return m2.fromPartial(e??{})},fromPartial(e){let t=ca();return t.path=e.path??"",t.params=Object.entries(e.params??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=globalThis.String(a)),r),{}),t.hash=e.hash??"",t.userData=e.userData??void 0,t}};u.set(m2.$type,m2);function da(){return{key:"",value:""}}var P3={$type:"devvit.ui.effects.web_view.v1alpha.ShareParam.ParamsEntry",encode(e,t=R.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 R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=da();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:C(e.key)?globalThis.String(e.key):"",value:C(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 P3.fromPartial(e??{})},fromPartial(e){let t=da();return t.key=e.key??"",t.value=e.value??"",t}};u.set(P3.$type,P3);function ua(){return{appDisplayName:void 0,appIconUri:void 0,backgroundUri:void 0,buttonLabel:void 0,description:void 0,entry:void 0,title:void 0}}var g2={$type:"devvit.ui.effects.web_view.v1alpha.SplashPostData",encode(e,t=R.default.Writer.create()){return e.appDisplayName!==void 0&&t.uint32(10).string(e.appDisplayName),e.appIconUri!==void 0&&t.uint32(18).string(e.appIconUri),e.backgroundUri!==void 0&&t.uint32(26).string(e.backgroundUri),e.buttonLabel!==void 0&&t.uint32(34).string(e.buttonLabel),e.description!==void 0&&t.uint32(42).string(e.description),e.entry!==void 0&&t.uint32(74).string(e.entry),e.title!==void 0&&t.uint32(58).string(e.title),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ua();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appDisplayName=r.string();continue;case 2:if(n!==18)break;a.appIconUri=r.string();continue;case 3:if(n!==26)break;a.backgroundUri=r.string();continue;case 4:if(n!==34)break;a.buttonLabel=r.string();continue;case 5:if(n!==42)break;a.description=r.string();continue;case 9:if(n!==74)break;a.entry=r.string();continue;case 7:if(n!==58)break;a.title=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appDisplayName:C(e.appDisplayName)?globalThis.String(e.appDisplayName):void 0,appIconUri:C(e.appIconUri)?globalThis.String(e.appIconUri):void 0,backgroundUri:C(e.backgroundUri)?globalThis.String(e.backgroundUri):void 0,buttonLabel:C(e.buttonLabel)?globalThis.String(e.buttonLabel):void 0,description:C(e.description)?globalThis.String(e.description):void 0,entry:C(e.entry)?globalThis.String(e.entry):void 0,title:C(e.title)?globalThis.String(e.title):void 0}},toJSON(e){let t={};return e.appDisplayName!==void 0&&(t.appDisplayName=e.appDisplayName),e.appIconUri!==void 0&&(t.appIconUri=e.appIconUri),e.backgroundUri!==void 0&&(t.backgroundUri=e.backgroundUri),e.buttonLabel!==void 0&&(t.buttonLabel=e.buttonLabel),e.description!==void 0&&(t.description=e.description),e.entry!==void 0&&(t.entry=e.entry),e.title!==void 0&&(t.title=e.title),t},create(e){return g2.fromPartial(e??{})},fromPartial(e){let t=ua();return t.appDisplayName=e.appDisplayName??void 0,t.appIconUri=e.appIconUri??void 0,t.backgroundUri=e.backgroundUri??void 0,t.buttonLabel=e.buttonLabel??void 0,t.description=e.description??void 0,t.entry=e.entry??void 0,t.title=e.title??void 0,t}};u.set(g2.$type,g2);function va(){return{consentStatus:0,grantedScopes:[],requestedScopes:[]}}var w2={$type:"devvit.ui.effects.web_view.v1alpha.AppPermissionState",encode(e,t=R.default.Writer.create()){e.consentStatus!==0&&t.uint32(8).int32(e.consentStatus),t.uint32(18).fork();for(let r of e.grantedScopes)t.int32(r);t.ldelim(),t.uint32(26).fork();for(let r of e.requestedScopes)t.int32(r);return t.ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=va();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.consentStatus=r.int32();continue;case 2:if(n===16){a.grantedScopes.push(r.int32());continue}if(n===18){let o=r.uint32()+r.pos;for(;r.pos<o;)a.grantedScopes.push(r.int32());continue}break;case 3:if(n===24){a.requestedScopes.push(r.int32());continue}if(n===26){let o=r.uint32()+r.pos;for(;r.pos<o;)a.requestedScopes.push(r.int32());continue}break}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{consentStatus:C(e.consentStatus)?O3(e.consentStatus):0,grantedScopes:globalThis.Array.isArray(e?.grantedScopes)?e.grantedScopes.map(t=>ye(t)):[],requestedScopes:globalThis.Array.isArray(e?.requestedScopes)?e.requestedScopes.map(t=>ye(t)):[]}},toJSON(e){let t={};return e.consentStatus!==0&&(t.consentStatus=H3(e.consentStatus)),e.grantedScopes?.length&&(t.grantedScopes=e.grantedScopes.map(r=>Le(r))),e.requestedScopes?.length&&(t.requestedScopes=e.requestedScopes.map(r=>Le(r))),t},create(e){return w2.fromPartial(e??{})},fromPartial(e){let t=va();return t.consentStatus=e.consentStatus??0,t.grantedScopes=e.grantedScopes?.map(r=>r)||[],t.requestedScopes=e.requestedScopes?.map(r=>r)||[],t}};u.set(w2.$type,w2);function H6(e){return typeof e=="object"&&e!==null}function C(e){return e!=null}function ha(e){if(e.appIconUri&&!new URL(e.appIconUri).host.endsWith("devvit.net")){console.warn(`invalid app icon "${e.appIconUri}"`);return}let t;if(e.userData){let r={hash:"",params:{},path:"",userData:e.userData};t=JSON.stringify(r)}return{appIconUri:e.appIconUri,devvitShare:t,text:e.text,title:e.title}}function Ne(e){return e?.toLowerCase()||""}function ol(e){return e=Ne(e),e.includes("chrome")||e.includes("crios")}function ll(e){return Ne(e).includes("edg")}function sl(e){return e=Ne(e),e.includes("firefox")||e.includes("fxios")}function cl(e,t){return/(iPad)/i.test(Ne(e))||/(Mac)/i.test(Ne(e))&&t&&t>1}function dl(e,t){return cl(e,t)||/(iPhone|iPod)/i.test(Ne(e))}function fa(e){return!ol(e)&&!ll(e)&&!sl(e)&&(Ne(e).includes("safari")||dl(e))}function b6(e,t){return new CustomEvent(e,{bubbles:!0,composed:!0,detail:t})}var pa=e=>e===null||typeof e!="object"?!1:"scope"in e&&e.scope===0&&"type"in e&&e.type==="devvit-internal";var ul="devvitdebug",vl="devvitshare";function B6(){return ga(ul)}function ma(){return ga(vl)}function X5(){var i,a;if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(i=globalThis.devvit).debug??(i.debug={});let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},t={};for(let n in e)t[n.toLowerCase()]=n;let r=B6();if(r!=null){r==="all"&&(r=Object.keys(e).filter(n=>n!=="emitSnapshots"&&n!=="emitState").join());for(let n of r.split(",")??[]){let[o,s]=n.split("=");o&&(o.toLowerCase()in t?o=t[o.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${o}"`),(a=globalThis.devvit.debug)[o]??(a[o]=s||"true"),console.info(`[devvit] set devvitdebug ${o}=${globalThis.devvit.debug[o]}`))}}}function ga(e){return[...new URL(globalThis.location?location.href:"file://").searchParams].find(([r])=>r.toLowerCase()===e)?.[1]}X5();var Z2,E2,$3,U3,$,k6,D3,wa,P6,Aa,Ve,A2,S1=class extends j1{constructor(){super(...arguments);M(this,$);this.devMode=!1;this.autoFocus=!1;this.focusable=!1;this._originDiffers=!1;M(this,Z2,!1);M(this,E2,[]);M(this,$3);M(this,U3,()=>{});M(this,D3,r=>{if(r.source===this._iframe?.contentWindow){if(x(this,$,A2).call(this,"Got message from iframe:",r.data),pa(r.data)){x(this,$,wa).call(this,r.data);return}r.preventDefault(),r.stopImmediatePropagation(),this.onReceivedPostMessage?this.onReceivedPostMessage(r.data):this.dispatchEvent(P0("devvit-web-view-message",r.data))}})}static get styles(){return[p3`
600
+ >`}var N3;(function(e){e[e.EFFECT_REALTIME_SUB=0]="EFFECT_REALTIME_SUB",e[e.EFFECT_RERENDER_UI=1]="EFFECT_RERENDER_UI",e[e.EFFECT_RELOAD_PART=2]="EFFECT_RELOAD_PART",e[e.EFFECT_SHOW_FORM=3]="EFFECT_SHOW_FORM",e[e.EFFECT_SHOW_TOAST=4]="EFFECT_SHOW_TOAST",e[e.EFFECT_NAVIGATE_TO_URL=5]="EFFECT_NAVIGATE_TO_URL",e[e.EFFECT_SET_INTERVALS=7]="EFFECT_SET_INTERVALS",e[e.EFFECT_CREATE_ORDER=8]="EFFECT_CREATE_ORDER",e[e.EFFECT_WEB_VIEW=9]="EFFECT_WEB_VIEW",e[e.EFFECT_CAN_RUN_AS_USER=11]="EFFECT_CAN_RUN_AS_USER",e[e.EFFECT_TELEMETRY=12]="EFFECT_TELEMETRY",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N3||(N3={}));var Sr;(function(e){e[e.CLIENT=0]="CLIENT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Sr||(Sr={}));var R=G(F(),1);var F1=G(F(),1);var u=new Map;var Me;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Me||(Me={}));function Wo(e){switch(e){case 0:case"NULL_VALUE":return Me.NULL_VALUE;case-1:case"UNRECOGNIZED":default:return Me.UNRECOGNIZED}}function qo(e){switch(e){case Me.NULL_VALUE:return 0;case Me.UNRECOGNIZED:default:return-1}}function Z6(){return{fields:{}}}var L={$type:"google.protobuf.Struct",encode(e,t=F1.default.Writer.create()){return Object.entries(e.fields).forEach(([r,i])=>{i!==void 0&&R3.encode({key:r,value:i},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Z6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;let o=R3.decode(r,r.uint32());o.value!==void 0&&(a.fields[o.key]=o.value);continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{fields:_n(e.fields)?Object.entries(e.fields).reduce((t,[r,i])=>(t[r]=i,t),{}):{}}},toJSON(e){let t={};if(e.fields){let r=Object.entries(e.fields);r.length>0&&(t.fields={},r.forEach(([i,a])=>{t.fields[i]=a}))}return t},create(e){return L.fromPartial(e??{})},fromPartial(e){let t=Z6();return t.fields=Object.entries(e.fields??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=a),r),{}),t},wrap(e){let t=Z6();if(e!==void 0)for(let r of Object.keys(e))t.fields[r]=e[r];return t},unwrap(e){let t={};if(e.fields)for(let r of Object.keys(e.fields))t[r]=e.fields[r];return t}};u.set(L.$type,L);function Mn(){return{key:"",value:void 0}}var R3={$type:"google.protobuf.Struct.FieldsEntry",encode(e,t=F1.default.Writer.create()){return e.key!==""&&t.uint32(10).string(e.key),e.value!==void 0&&m1.encode(m1.wrap(e.value),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Mn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=m1.unwrap(m1.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:ze(e.key)?globalThis.String(e.key):"",value:ze(e?.value)?e.value:void 0}},toJSON(e){let t={};return e.key!==""&&(t.key=e.key),e.value!==void 0&&(t.value=e.value),t},create(e){return R3.fromPartial(e??{})},fromPartial(e){let t=Mn();return t.key=e.key??"",t.value=e.value??void 0,t}};u.set(R3.$type,R3);function E6(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var m1={$type:"google.protobuf.Value",encode(e,t=F1.default.Writer.create()){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&L.encode(L.wrap(e.structValue),t.uint32(42).fork()).ldelim(),e.listValue!==void 0&&Ce.encode(Ce.wrap(e.listValue),t.uint32(50).fork()).ldelim(),t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=E6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.nullValue=r.int32();continue;case 2:if(n!==17)break;a.numberValue=r.double();continue;case 3:if(n!==26)break;a.stringValue=r.string();continue;case 4:if(n!==32)break;a.boolValue=r.bool();continue;case 5:if(n!==42)break;a.structValue=L.unwrap(L.decode(r,r.uint32()));continue;case 6:if(n!==50)break;a.listValue=Ce.unwrap(Ce.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{nullValue:ze(e.nullValue)?Wo(e.nullValue):void 0,numberValue:ze(e.numberValue)?globalThis.Number(e.numberValue):void 0,stringValue:ze(e.stringValue)?globalThis.String(e.stringValue):void 0,boolValue:ze(e.boolValue)?globalThis.Boolean(e.boolValue):void 0,structValue:_n(e.structValue)?e.structValue:void 0,listValue:globalThis.Array.isArray(e.listValue)?[...e.listValue]:void 0}},toJSON(e){let t={};return e.nullValue!==void 0&&(t.nullValue=qo(e.nullValue)),e.numberValue!==void 0&&(t.numberValue=e.numberValue),e.stringValue!==void 0&&(t.stringValue=e.stringValue),e.boolValue!==void 0&&(t.boolValue=e.boolValue),e.structValue!==void 0&&(t.structValue=e.structValue),e.listValue!==void 0&&(t.listValue=e.listValue),t},create(e){return m1.fromPartial(e??{})},fromPartial(e){let t=E6();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=E6();if(e===null)t.nullValue=Me.NULL_VALUE;else if(typeof e=="boolean")t.boolValue=e;else if(typeof e=="number")t.numberValue=e;else if(typeof e=="string")t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e=="object")t.structValue=e;else if(typeof e<"u")throw new globalThis.Error("Unsupported any value type: "+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};u.set(m1.$type,m1);function x6(){return{values:[]}}var Ce={$type:"google.protobuf.ListValue",encode(e,t=F1.default.Writer.create()){for(let r of e.values)m1.encode(m1.wrap(r),t.uint32(10).fork()).ldelim();return t},decode(e,t){let r=e instanceof F1.default.Reader?e:F1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=x6();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.values.push(m1.unwrap(m1.decode(r,r.uint32())));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{values:globalThis.Array.isArray(e?.values)?[...e.values]:[]}},toJSON(e){let t={};return e.values?.length&&(t.values=e.values),t},create(e){return Ce.fromPartial(e??{})},fromPartial(e){let t=x6();return t.values=e.values?.map(r=>r)||[],t},wrap(e){let t=x6();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty("values")&&globalThis.Array.isArray(e.values)?e.values:e}};u.set(Ce.$type,Ce);function _n(e){return typeof e=="object"&&e!==null}function ze(e){return e!=null}var k=G(F(),1);var n0=null;try{n0=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function b(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}b.prototype.__isLong__;Object.defineProperty(b.prototype,"__isLong__",{value:!0});function g1(e){return(e&&e.__isLong__)===!0}function Sn(e){var t=Math.clz32(e&-e);return e?31-t:t}b.isLong=g1;var yn={},Ln={};function _e(e,t){var r,i,a;return t?(e>>>=0,(a=0<=e&&e<256)&&(i=Ln[e],i)?i:(r=T(e,0,!0),a&&(Ln[e]=r),r)):(e|=0,(a=-128<=e&&e<128)&&(i=yn[e],i)?i:(r=T(e,e<0?-1:0,!1),a&&(yn[e]=r),r))}b.fromInt=_e;function a0(e,t){if(isNaN(e))return t?U0:m0;if(t){if(e<0)return U0;if(e>=Tn)return Hn}else{if(e<=-Vn)return O1;if(e+1>=Vn)return On}return e<0?a0(-e,t).neg():T(e%Ye|0,e/Ye|0,t)}b.fromNumber=a0;function T(e,t,r){return new b(e,t,r)}b.fromBits=T;var J5=Math.pow;function M6(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?U0:m0;if(r=r||10,r<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return M6(e.substring(1),t,r).neg();for(var a=a0(J5(r,8)),n=m0,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),l=parseInt(e.substring(o,o+s),r);if(s<8){var c=a0(J5(r,s));n=n.mul(c).add(a0(l))}else n=n.mul(a),n=n.add(a0(l))}return n.unsigned=t,n}b.fromString=M6;function i0(e,t){return typeof e=="number"?a0(e,t):typeof e=="string"?M6(e,t):T(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}b.fromValue=i0;var Nn=65536,Xo=1<<24,Ye=Nn*Nn,Tn=Ye*Ye,Vn=Tn/2,In=_e(Xo),m0=_e(0);b.ZERO=m0;var U0=_e(0,!0);b.UZERO=U0;var Qe=_e(1);b.ONE=Qe;var Rn=_e(1,!0);b.UONE=Rn;var C6=_e(-1);b.NEG_ONE=C6;var On=T(-1,2147483647,!1);b.MAX_VALUE=On;var Hn=T(-1,-1,!0);b.MAX_UNSIGNED_VALUE=Hn;var O1=T(0,-2147483648,!1);b.MIN_VALUE=O1;var h=b.prototype;h.toInt=function(){return this.unsigned?this.low>>>0:this.low};h.toNumber=function(){return this.unsigned?(this.high>>>0)*Ye+(this.low>>>0):this.high*Ye+(this.low>>>0)};h.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(O1)){var r=a0(t),i=this.div(r),a=i.mul(r).sub(this);return i.toString(t)+a.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var n=a0(J5(t,6),this.unsigned),o=this,s="";;){var l=o.div(n),c=o.sub(l.mul(n)).toInt()>>>0,d=c.toString(t);if(o=l,o.isZero())return d+s;for(;d.length<6;)d="0"+d;s=""+d+s}};h.getHighBits=function(){return this.high};h.getHighBitsUnsigned=function(){return this.high>>>0};h.getLowBits=function(){return this.low};h.getLowBitsUnsigned=function(){return this.low>>>0};h.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O1)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&(t&1<<r)==0;r--);return this.high!=0?r+33:r+1};h.isSafeInteger=function(){var t=this.high>>21;return t?this.unsigned?!1:t===-1&&!(this.low===0&&this.high===-2097152):!0};h.isZero=function(){return this.high===0&&this.low===0};h.eqz=h.isZero;h.isNegative=function(){return!this.unsigned&&this.high<0};h.isPositive=function(){return this.unsigned||this.high>=0};h.isOdd=function(){return(this.low&1)===1};h.isEven=function(){return(this.low&1)===0};h.equals=function(t){return g1(t)||(t=i0(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};h.eq=h.equals;h.notEquals=function(t){return!this.eq(t)};h.neq=h.notEquals;h.ne=h.notEquals;h.lessThan=function(t){return this.comp(t)<0};h.lt=h.lessThan;h.lessThanOrEqual=function(t){return this.comp(t)<=0};h.lte=h.lessThanOrEqual;h.le=h.lessThanOrEqual;h.greaterThan=function(t){return this.comp(t)>0};h.gt=h.greaterThan;h.greaterThanOrEqual=function(t){return this.comp(t)>=0};h.gte=h.greaterThanOrEqual;h.ge=h.greaterThanOrEqual;h.compare=function(t){if(g1(t)||(t=i0(t)),this.eq(t))return 0;var r=this.isNegative(),i=t.isNegative();return r&&!i?-1:!r&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};h.comp=h.compare;h.negate=function(){return!this.unsigned&&this.eq(O1)?O1:this.not().add(Qe)};h.neg=h.negate;h.add=function(t){g1(t)||(t=i0(t));var r=this.high>>>16,i=this.high&65535,a=this.low>>>16,n=this.low&65535,o=t.high>>>16,s=t.high&65535,l=t.low>>>16,c=t.low&65535,d=0,v=0,f=0,g=0;return g+=n+c,f+=g>>>16,g&=65535,f+=a+l,v+=f>>>16,f&=65535,v+=i+s,d+=v>>>16,v&=65535,d+=r+o,d&=65535,T(f<<16|g,d<<16|v,this.unsigned)};h.subtract=function(t){return g1(t)||(t=i0(t)),this.add(t.neg())};h.sub=h.subtract;h.multiply=function(t){if(this.isZero())return this;if(g1(t)||(t=i0(t)),n0){var r=n0.mul(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?U0:m0;if(this.eq(O1))return t.isOdd()?O1:m0;if(t.eq(O1))return this.isOdd()?O1:m0;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(In)&&t.lt(In))return a0(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,a=this.high&65535,n=this.low>>>16,o=this.low&65535,s=t.high>>>16,l=t.high&65535,c=t.low>>>16,d=t.low&65535,v=0,f=0,g=0,E=0;return E+=o*d,g+=E>>>16,E&=65535,g+=n*d,f+=g>>>16,g&=65535,g+=o*c,f+=g>>>16,g&=65535,f+=a*d,v+=f>>>16,f&=65535,f+=n*c,v+=f>>>16,f&=65535,f+=o*l,v+=f>>>16,f&=65535,v+=i*d+a*c+n*l+o*s,v&=65535,T(g<<16|E,v<<16|f,this.unsigned)};h.mul=h.multiply;h.divide=function(t){if(g1(t)||(t=i0(t)),t.isZero())throw Error("division by zero");if(n0){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?n0.div_u:n0.div_s)(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?U0:m0;var i,a,n;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return U0;if(t.gt(this.shru(1)))return Rn;n=U0}else{if(this.eq(O1)){if(t.eq(Qe)||t.eq(C6))return O1;if(t.eq(O1))return Qe;var o=this.shr(1);return i=o.div(t).shl(1),i.eq(m0)?t.isNegative()?Qe:C6:(a=this.sub(t.mul(i)),n=i.add(a.div(t)),n)}else if(t.eq(O1))return this.unsigned?U0:m0;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();n=m0}for(a=this;a.gte(t);){i=Math.max(1,Math.floor(a.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),l=s<=48?1:J5(2,s-48),c=a0(i),d=c.mul(t);d.isNegative()||d.gt(a);)i-=l,c=a0(i,this.unsigned),d=c.mul(t);c.isZero()&&(c=Qe),n=n.add(c),a=a.sub(d)}return n};h.div=h.divide;h.modulo=function(t){if(g1(t)||(t=i0(t)),n0){var r=(this.unsigned?n0.rem_u:n0.rem_s)(this.low,this.high,t.low,t.high);return T(r,n0.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};h.mod=h.modulo;h.rem=h.modulo;h.not=function(){return T(~this.low,~this.high,this.unsigned)};h.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};h.clz=h.countLeadingZeros;h.countTrailingZeros=function(){return this.low?Sn(this.low):Sn(this.high)+32};h.ctz=h.countTrailingZeros;h.and=function(t){return g1(t)||(t=i0(t)),T(this.low&t.low,this.high&t.high,this.unsigned)};h.or=function(t){return g1(t)||(t=i0(t)),T(this.low|t.low,this.high|t.high,this.unsigned)};h.xor=function(t){return g1(t)||(t=i0(t)),T(this.low^t.low,this.high^t.high,this.unsigned)};h.shiftLeft=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):T(0,this.low<<t-32,this.unsigned)};h.shl=h.shiftLeft;h.shiftRight=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):T(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};h.shr=h.shiftRight;h.shiftRightUnsigned=function(t){return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?T(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?T(this.high,0,this.unsigned):T(this.high>>>t-32,0,this.unsigned)};h.shru=h.shiftRightUnsigned;h.shr_u=h.shiftRightUnsigned;h.rotateLeft=function(t){var r;return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?T(this.high,this.low,this.unsigned):t<32?(r=32-t,T(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,T(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};h.rotl=h.rotateLeft;h.rotateRight=function(t){var r;return g1(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?T(this.high,this.low,this.unsigned):t<32?(r=32-t,T(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,T(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};h.rotr=h.rotateRight;h.toSigned=function(){return this.unsigned?T(this.low,this.high,!1):this};h.toUnsigned=function(){return this.unsigned?this:T(this.low,this.high,!0)};h.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};h.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};h.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};b.fromBytes=function(t,r,i){return i?b.fromBytesLE(t,r):b.fromBytesBE(t,r)};b.fromBytesLE=function(t,r){return new b(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};b.fromBytesBE=function(t,r){return new b(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};typeof BigInt=="function"&&(b.fromBigInt=function(t,r){var i=Number(BigInt.asIntN(32,t)),a=Number(BigInt.asIntN(32,t>>BigInt(32)));return T(i,a,r)},b.fromValue=function(t,r){return typeof t=="bigint"?b.fromBigInt(t,r):i0(t,r)},h.toBigInt=function(){var t=BigInt(this.low>>>0),r=BigInt(this.unsigned?this.high>>>0:this.high);return r<<BigInt(32)|t});var je=b;var Se=G(F(),1);function bn(){return{seconds:0,nanos:0}}var _1={$type:"google.protobuf.Timestamp",encode(e,t=Se.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 Se.default.Reader?e:Se.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=bn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.seconds=Ko(r.int64());continue;case 2:if(n!==16)break;a.nanos=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{seconds:Bn(e.seconds)?globalThis.Number(e.seconds):0,nanos:Bn(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 _1.fromPartial(e??{})},fromPartial(e){let t=bn();return t.seconds=e.seconds??0,t.nanos=e.nanos??0,t}};u.set(_1.$type,_1);function Ko(e){if(e.gt(globalThis.Number.MAX_SAFE_INTEGER))throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");return e.toNumber()}Se.default.util.Long!==je&&(Se.default.util.Long=je,Se.default.configure());function Bn(e){return e!=null}var y0;(function(e){e[e.CONSENT_STATUS_UNKNOWN=0]="CONSENT_STATUS_UNKNOWN",e[e.REVOKED=1]="REVOKED",e[e.GRANTED=2]="GRANTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(y0||(y0={}));function O3(e){switch(e){case 0:case"CONSENT_STATUS_UNKNOWN":return y0.CONSENT_STATUS_UNKNOWN;case 1:case"REVOKED":return y0.REVOKED;case 2:case"GRANTED":return y0.GRANTED;case-1:case"UNRECOGNIZED":default:return y0.UNRECOGNIZED}}function H3(e){switch(e){case y0.CONSENT_STATUS_UNKNOWN:return 0;case y0.REVOKED:return 1;case y0.GRANTED:return 2;case y0.UNRECOGNIZED:default:return-1}}var o0;(function(e){e[e.SCOPE_UNKNOWN=0]="SCOPE_UNKNOWN",e[e.SUBMIT_POST=1]="SUBMIT_POST",e[e.SUBMIT_COMMENT=2]="SUBMIT_COMMENT",e[e.SUBSCRIBE_TO_SUBREDDIT=3]="SUBSCRIBE_TO_SUBREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(o0||(o0={}));function ye(e){switch(e){case 0:case"SCOPE_UNKNOWN":return o0.SCOPE_UNKNOWN;case 1:case"SUBMIT_POST":return o0.SUBMIT_POST;case 2:case"SUBMIT_COMMENT":return o0.SUBMIT_COMMENT;case 3:case"SUBSCRIBE_TO_SUBREDDIT":return o0.SUBSCRIBE_TO_SUBREDDIT;case-1:case"UNRECOGNIZED":default:return o0.UNRECOGNIZED}}function Le(e){switch(e){case o0.SCOPE_UNKNOWN:return 0;case o0.SUBMIT_POST:return 1;case o0.SUBMIT_COMMENT:return 2;case o0.SUBSCRIBE_TO_SUBREDDIT:return 3;case o0.UNRECOGNIZED:default:return-1}}function kn(){return{appSlug:"",subredditId:"",scopes:[],consentStatus:0,updatedAt:void 0}}var c2={$type:"reddit.devvit.app_permission.v1.AppPermission",encode(e,t=k.default.Writer.create()){e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.subredditId!==""&&t.uint32(18).string(e.subredditId),t.uint32(26).fork();for(let r of e.scopes)t.int32(r);return t.ldelim(),e.consentStatus!==0&&t.uint32(32).int32(e.consentStatus),e.updatedAt!==void 0&&_1.encode(zo(e.updatedAt),t.uint32(42).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=kn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.subredditId=r.string();continue;case 3:if(n===24){a.scopes.push(r.int32());continue}if(n===26){let o=r.uint32()+r.pos;for(;r.pos<o;)a.scopes.push(r.int32());continue}break;case 4:if(n!==32)break;a.consentStatus=r.int32();continue;case 5:if(n!==42)break;a.updatedAt=qn(_1.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):"",scopes:globalThis.Array.isArray(e?.scopes)?e.scopes.map(t=>ye(t)):[],consentStatus:w1(e.consentStatus)?O3(e.consentStatus):0,updatedAt:w1(e.updatedAt)?Qo(e.updatedAt):void 0}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.subredditId!==""&&(t.subredditId=e.subredditId),e.scopes?.length&&(t.scopes=e.scopes.map(r=>Le(r))),e.consentStatus!==0&&(t.consentStatus=H3(e.consentStatus)),e.updatedAt!==void 0&&(t.updatedAt=e.updatedAt.toISOString()),t},create(e){return c2.fromPartial(e??{})},fromPartial(e){let t=kn();return t.appSlug=e.appSlug??"",t.subredditId=e.subredditId??"",t.scopes=e.scopes?.map(r=>r)||[],t.consentStatus=e.consentStatus??0,t.updatedAt=e.updatedAt??void 0,t}};u.set(c2.$type,c2);function Pn(){return{appSlug:"",appName:""}}var d2={$type:"reddit.devvit.app_permission.v1.DevvitApp",encode(e,t=k.default.Writer.create()){return e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.appName!==""&&t.uint32(18).string(e.appName),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Pn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.appName=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",appName:w1(e.appName)?globalThis.String(e.appName):""}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.appName!==""&&(t.appName=e.appName),t},create(e){return d2.fromPartial(e??{})},fromPartial(e){let t=Pn();return t.appSlug=e.appSlug??"",t.appName=e.appName??"",t}};u.set(d2.$type,d2);function $n(){return{userId:""}}var _6={$type:"reddit.devvit.app_permission.v1.GetAppPermissionsByUserIdRequest",encode(e,t=k.default.Writer.create()){return e.userId!==""&&t.uint32(10).string(e.userId),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=$n();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:w1(e.userId)?globalThis.String(e.userId):""}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),t},create(e){return _6.fromPartial(e??{})},fromPartial(e){let t=$n();return t.userId=e.userId??"",t}};u.set(_6.$type,_6);function Un(){return{appPermissions:[],devvitApps:[]}}var S6={$type:"reddit.devvit.app_permission.v1.GetAppPermissionsByUserIdResponse",encode(e,t=k.default.Writer.create()){for(let r of e.appPermissions)c2.encode(r,t.uint32(10).fork()).ldelim();for(let r of e.devvitApps)d2.encode(r,t.uint32(18).fork()).ldelim();return t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Un();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appPermissions.push(c2.decode(r,r.uint32()));continue;case 2:if(n!==18)break;a.devvitApps.push(d2.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appPermissions:globalThis.Array.isArray(e?.appPermissions)?e.appPermissions.map(t=>c2.fromJSON(t)):[],devvitApps:globalThis.Array.isArray(e?.devvitApps)?e.devvitApps.map(t=>d2.fromJSON(t)):[]}},toJSON(e){let t={};return e.appPermissions?.length&&(t.appPermissions=e.appPermissions.map(r=>c2.toJSON(r))),e.devvitApps?.length&&(t.devvitApps=e.devvitApps.map(r=>d2.toJSON(r))),t},create(e){return S6.fromPartial(e??{})},fromPartial(e){let t=Un();return t.appPermissions=e.appPermissions?.map(r=>c2.fromPartial(r))||[],t.devvitApps=e.devvitApps?.map(r=>d2.fromPartial(r))||[],t}};u.set(S6.$type,S6);function Dn(){return{userId:"",appSlug:"",subredditId:"",scopes:[]}}var y6={$type:"reddit.devvit.app_permission.v1.GrantAppPermissionRequest",encode(e,t=k.default.Writer.create()){e.userId!==""&&t.uint32(10).string(e.userId),e.appSlug!==""&&t.uint32(18).string(e.appSlug),e.subredditId!==""&&t.uint32(26).string(e.subredditId),t.uint32(34).fork();for(let r of e.scopes)t.int32(r);return t.ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Dn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue;case 2:if(n!==18)break;a.appSlug=r.string();continue;case 3:if(n!==26)break;a.subredditId=r.string();continue;case 4:if(n===32){a.scopes.push(r.int32());continue}if(n===34){let o=r.uint32()+r.pos;for(;r.pos<o;)a.scopes.push(r.int32());continue}break}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:w1(e.userId)?globalThis.String(e.userId):"",appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):"",scopes:globalThis.Array.isArray(e?.scopes)?e.scopes.map(t=>ye(t)):[]}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),e.appSlug!==""&&(t.appSlug=e.appSlug),e.subredditId!==""&&(t.subredditId=e.subredditId),e.scopes?.length&&(t.scopes=e.scopes.map(r=>Le(r))),t},create(e){return y6.fromPartial(e??{})},fromPartial(e){let t=Dn();return t.userId=e.userId??"",t.appSlug=e.appSlug??"",t.subredditId=e.subredditId??"",t.scopes=e.scopes?.map(r=>r)||[],t}};u.set(y6.$type,y6);function Gn(){return{error:void 0}}var L6={$type:"reddit.devvit.app_permission.v1.GrantAppPermissionResponse",encode(e,t=k.default.Writer.create()){return e.error!==void 0&&J1.encode(e.error,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Gn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.error=J1.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{error:w1(e.error)?J1.fromJSON(e.error):void 0}},toJSON(e){let t={};return e.error!==void 0&&(t.error=J1.toJSON(e.error)),t},create(e){return L6.fromPartial(e??{})},fromPartial(e){let t=Gn();return t.error=e.error!==void 0&&e.error!==null?J1.fromPartial(e.error):void 0,t}};u.set(L6.$type,L6);function Fn(){return{appSlug:"",userId:"",subredditId:""}}var N6={$type:"reddit.devvit.app_permission.v1.RevokeAppPermissionRequest",encode(e,t=k.default.Writer.create()){return e.appSlug!==""&&t.uint32(10).string(e.appSlug),e.userId!==""&&t.uint32(18).string(e.userId),e.subredditId!==""&&t.uint32(26).string(e.subredditId),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Fn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appSlug=r.string();continue;case 2:if(n!==18)break;a.userId=r.string();continue;case 3:if(n!==26)break;a.subredditId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appSlug:w1(e.appSlug)?globalThis.String(e.appSlug):"",userId:w1(e.userId)?globalThis.String(e.userId):"",subredditId:w1(e.subredditId)?globalThis.String(e.subredditId):""}},toJSON(e){let t={};return e.appSlug!==""&&(t.appSlug=e.appSlug),e.userId!==""&&(t.userId=e.userId),e.subredditId!==""&&(t.subredditId=e.subredditId),t},create(e){return N6.fromPartial(e??{})},fromPartial(e){let t=Fn();return t.appSlug=e.appSlug??"",t.userId=e.userId??"",t.subredditId=e.subredditId??"",t}};u.set(N6.$type,N6);function Jn(){return{error:void 0}}var V6={$type:"reddit.devvit.app_permission.v1.RevokeAppPermissionResponse",encode(e,t=k.default.Writer.create()){return e.error!==void 0&&J1.encode(e.error,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Jn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.error=J1.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{error:w1(e.error)?J1.fromJSON(e.error):void 0}},toJSON(e){let t={};return e.error!==void 0&&(t.error=J1.toJSON(e.error)),t},create(e){return V6.fromPartial(e??{})},fromPartial(e){let t=Jn();return t.error=e.error!==void 0&&e.error!==null?J1.fromPartial(e.error):void 0,t}};u.set(V6.$type,V6);function Wn(){return{message:""}}var J1={$type:"reddit.devvit.app_permission.v1.ErrorMessage",encode(e,t=k.default.Writer.create()){return e.message!==""&&t.uint32(10).string(e.message),t},decode(e,t){let r=e instanceof k.default.Reader?e:k.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Wn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.message=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{message:w1(e.message)?globalThis.String(e.message):""}},toJSON(e){let t={};return e.message!==""&&(t.message=e.message),t},create(e){return J1.fromPartial(e??{})},fromPartial(e){let t=Wn();return t.message=e.message??"",t}};u.set(J1.$type,J1);function zo(e){let t=Math.trunc(e.getTime()/1e3),r=e.getTime()%1e3*1e6;return{seconds:t,nanos:r}}function qn(e){let t=(e.seconds||0)*1e3;return t+=(e.nanos||0)/1e6,new globalThis.Date(t)}function Qo(e){return e instanceof globalThis.Date?e:typeof e=="string"?new globalThis.Date(e):qn(_1.fromJSON(e))}function w1(e){return e!=null}var W1=G(F(),1);var W5=G(F(),1);var u2;(function(e){e[e.APS_UNSPECIFIED=0]="APS_UNSPECIFIED",e[e.APS_REDDIT_PROMOTED=1]="APS_REDDIT_PROMOTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(u2||(u2={}));function Yo(e){switch(e){case 0:case"APS_UNSPECIFIED":return u2.APS_UNSPECIFIED;case 1:case"APS_REDDIT_PROMOTED":return u2.APS_REDDIT_PROMOTED;case-1:case"UNRECOGNIZED":default:return u2.UNRECOGNIZED}}function jo(e){switch(e){case u2.APS_UNSPECIFIED:return 0;case u2.APS_REDDIT_PROMOTED:return 1;case u2.UNRECOGNIZED:default:return-1}}function Xn(){return{promoStatus:0}}var D0={$type:"reddit.devvit.ads.v1.AdsConfig",encode(e,t=W5.default.Writer.create()){return e.promoStatus!==0&&t.uint32(8).int32(e.promoStatus),t},decode(e,t){let r=e instanceof W5.default.Reader?e:W5.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Xn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.promoStatus=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{promoStatus:el(e.promoStatus)?Yo(e.promoStatus):0}},toJSON(e){let t={};return e.promoStatus!==0&&(t.promoStatus=jo(e.promoStatus)),t},create(e){return D0.fromPartial(e??{})},fromPartial(e){let t=Xn();return t.promoStatus=e.promoStatus??0,t}};u.set(D0.$type,D0);function el(e){return e!=null}var L0;(function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE",e[e.UNLISTED=2]="UNLISTED",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(L0||(L0={}));function tl(e){switch(e){case 0:case"PUBLIC":return L0.PUBLIC;case 1:case"PRIVATE":return L0.PRIVATE;case 2:case"UNLISTED":return L0.UNLISTED;case-1:case"UNRECOGNIZED":default:return L0.UNRECOGNIZED}}function rl(e){switch(e){case L0.PUBLIC:return 0;case L0.PRIVATE:return 1;case L0.UNLISTED:return 2;case L0.UNRECOGNIZED:default:return-1}}var Kn;(function(e){e[e.RENDER_VERSION_UNSPECIFIED=0]="RENDER_VERSION_UNSPECIFIED",e[e.NO_DEVVIT_JSON=256]="NO_DEVVIT_JSON",e[e.WEBBIT_BLOCKS=512]="WEBBIT_BLOCKS",e[e.WEBBIT_PURE_NO_ENTRYPOINT=1024]="WEBBIT_PURE_NO_ENTRYPOINT",e[e.WEBBIT_PURE_NO_INLINE=1040]="WEBBIT_PURE_NO_INLINE",e[e.WEBBIT_PURE_INLINE=1056]="WEBBIT_PURE_INLINE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(Kn||(Kn={}));function zn(){return{id:"",slug:"",name:"",visibility:0,owner:void 0,version:"",adsConfig:void 0,termsAndConditions:"",privacyPolicy:"",requestedPermissionScopes:[],renderVersion:void 0}}var I6={$type:"reddit.devvit.common.v1.App",encode(e,t=W1.default.Writer.create()){e.id!==""&&t.uint32(10).string(e.id),e.slug!==""&&t.uint32(18).string(e.slug),e.name!==""&&t.uint32(26).string(e.name),e.visibility!==0&&t.uint32(32).int32(e.visibility),e.owner!==void 0&&v2.encode(e.owner,t.uint32(42).fork()).ldelim(),e.version!==""&&t.uint32(50).string(e.version),e.adsConfig!==void 0&&D0.encode(e.adsConfig,t.uint32(58).fork()).ldelim(),e.termsAndConditions!==""&&t.uint32(66).string(e.termsAndConditions),e.privacyPolicy!==""&&t.uint32(74).string(e.privacyPolicy),t.uint32(82).fork();for(let r of e.requestedPermissionScopes)t.int32(r);return t.ldelim(),e.renderVersion!==void 0&&t.uint32(88).int32(e.renderVersion),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=zn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.id=r.string();continue;case 2:if(n!==18)break;a.slug=r.string();continue;case 3:if(n!==26)break;a.name=r.string();continue;case 4:if(n!==32)break;a.visibility=r.int32();continue;case 5:if(n!==42)break;a.owner=v2.decode(r,r.uint32());continue;case 6:if(n!==50)break;a.version=r.string();continue;case 7:if(n!==58)break;a.adsConfig=D0.decode(r,r.uint32());continue;case 8:if(n!==66)break;a.termsAndConditions=r.string();continue;case 9:if(n!==74)break;a.privacyPolicy=r.string();continue;case 10:if(n===80){a.requestedPermissionScopes.push(r.int32());continue}if(n===82){let o=r.uint32()+r.pos;for(;r.pos<o;)a.requestedPermissionScopes.push(r.int32());continue}break;case 11:if(n!==88)break;a.renderVersion=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{id:H1(e.id)?globalThis.String(e.id):"",slug:H1(e.slug)?globalThis.String(e.slug):"",name:H1(e.name)?globalThis.String(e.name):"",visibility:H1(e.visibility)?tl(e.visibility):0,owner:H1(e.owner)?v2.fromJSON(e.owner):void 0,version:H1(e.version)?globalThis.String(e.version):"",adsConfig:H1(e.adsConfig)?D0.fromJSON(e.adsConfig):void 0,termsAndConditions:H1(e.termsAndConditions)?globalThis.String(e.termsAndConditions):"",privacyPolicy:H1(e.privacyPolicy)?globalThis.String(e.privacyPolicy):"",requestedPermissionScopes:globalThis.Array.isArray(e?.requestedPermissionScopes)?e.requestedPermissionScopes.map(t=>ye(t)):[],renderVersion:H1(e.renderVersion)?globalThis.Number(e.renderVersion):void 0}},toJSON(e){let t={};return e.id!==""&&(t.id=e.id),e.slug!==""&&(t.slug=e.slug),e.name!==""&&(t.name=e.name),e.visibility!==0&&(t.visibility=rl(e.visibility)),e.owner!==void 0&&(t.owner=v2.toJSON(e.owner)),e.version!==""&&(t.version=e.version),e.adsConfig!==void 0&&(t.adsConfig=D0.toJSON(e.adsConfig)),e.termsAndConditions!==""&&(t.termsAndConditions=e.termsAndConditions),e.privacyPolicy!==""&&(t.privacyPolicy=e.privacyPolicy),e.requestedPermissionScopes?.length&&(t.requestedPermissionScopes=e.requestedPermissionScopes.map(r=>Le(r))),e.renderVersion!==void 0&&(t.renderVersion=Math.round(e.renderVersion)),t},create(e){return I6.fromPartial(e??{})},fromPartial(e){let t=zn();return t.id=e.id??"",t.slug=e.slug??"",t.name=e.name??"",t.visibility=e.visibility??0,t.owner=e.owner!==void 0&&e.owner!==null?v2.fromPartial(e.owner):void 0,t.version=e.version??"",t.adsConfig=e.adsConfig!==void 0&&e.adsConfig!==null?D0.fromPartial(e.adsConfig):void 0,t.termsAndConditions=e.termsAndConditions??"",t.privacyPolicy=e.privacyPolicy??"",t.requestedPermissionScopes=e.requestedPermissionScopes?.map(r=>r)||[],t.renderVersion=e.renderVersion??void 0,t}};u.set(I6.$type,I6);function Qn(){return{userId:"",userName:""}}var v2={$type:"reddit.devvit.common.v1.AppOwner",encode(e,t=W1.default.Writer.create()){return e.userId!==""&&t.uint32(10).string(e.userId),e.userName!==""&&t.uint32(18).string(e.userName),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Qn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.userId=r.string();continue;case 2:if(n!==18)break;a.userName=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{userId:H1(e.userId)?globalThis.String(e.userId):"",userName:H1(e.userName)?globalThis.String(e.userName):""}},toJSON(e){let t={};return e.userId!==""&&(t.userId=e.userId),e.userName!==""&&(t.userName=e.userName),t},create(e){return v2.fromPartial(e??{})},fromPartial(e){let t=Qn();return t.userId=e.userId??"",t.userName=e.userName??"",t}};u.set(v2.$type,v2);function Yn(){return{entrypoints:{}}}var G0={$type:"reddit.devvit.common.v1.AppConfig",encode(e,t=W1.default.Writer.create()){return Object.entries(e.entrypoints).forEach(([r,i])=>{b3.encode({key:r,value:i},t.uint32(10).fork()).ldelim()}),t},decode(e,t){let r=e instanceof W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=Yn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;let o=b3.decode(r,r.uint32());o.value!==void 0&&(a.entrypoints[o.key]=o.value);continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{entrypoints:nl(e.entrypoints)?Object.entries(e.entrypoints).reduce((t,[r,i])=>(t[r]=String(i),t),{}):{}}},toJSON(e){let t={};if(e.entrypoints){let r=Object.entries(e.entrypoints);r.length>0&&(t.entrypoints={},r.forEach(([i,a])=>{t.entrypoints[i]=a}))}return t},create(e){return G0.fromPartial(e??{})},fromPartial(e){let t=Yn();return t.entrypoints=Object.entries(e.entrypoints??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=globalThis.String(a)),r),{}),t}};u.set(G0.$type,G0);function jn(){return{key:"",value:""}}var b3={$type:"reddit.devvit.common.v1.AppConfig.EntrypointsEntry",encode(e,t=W1.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 W1.default.Reader?e:W1.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=jn();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:H1(e.key)?globalThis.String(e.key):"",value:H1(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 b3.fromPartial(e??{})},fromPartial(e){let t=jn();return t.key=e.key??"",t.value=e.value??"",t}};u.set(b3.$type,b3);function nl(e){return typeof e=="object"&&e!==null}function H1(e){return e!=null}var q5=G(F(),1);var N0;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.INLINE_MODE=1]="INLINE_MODE",e[e.IMMERSIVE_MODE=2]="IMMERSIVE_MODE",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(N0||(N0={}));function B3(e){switch(e){case 0:case"UNSPECIFIED":return N0.UNSPECIFIED;case 1:case"INLINE_MODE":return N0.INLINE_MODE;case 2:case"IMMERSIVE_MODE":return N0.IMMERSIVE_MODE;case-1:case"UNRECOGNIZED":default:return N0.UNRECOGNIZED}}function k3(e){switch(e){case N0.UNSPECIFIED:return 0;case N0.INLINE_MODE:return 1;case N0.IMMERSIVE_MODE:return 2;case N0.UNRECOGNIZED:default:return-1}}function ea(){return{immersiveMode:0,entryUrl:void 0}}var T6={$type:"devvit.ui.effects.web_view.v1alpha.WebViewImmersiveModeEffect",encode(e,t=q5.default.Writer.create()){return e.immersiveMode!==0&&t.uint32(8).int32(e.immersiveMode),e.entryUrl!==void 0&&t.uint32(18).string(e.entryUrl),t},decode(e,t){let r=e instanceof q5.default.Reader?e:q5.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ea();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.immersiveMode=r.int32();continue;case 2:if(n!==18)break;a.entryUrl=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{immersiveMode:ta(e.immersiveMode)?B3(e.immersiveMode):0,entryUrl:ta(e.entryUrl)?globalThis.String(e.entryUrl):void 0}},toJSON(e){let t={};return e.immersiveMode!==0&&(t.immersiveMode=k3(e.immersiveMode)),e.entryUrl!==void 0&&(t.entryUrl=e.entryUrl),t},create(e){return T6.fromPartial(e??{})},fromPartial(e){let t=ea();return t.immersiveMode=e.immersiveMode??0,t.entryUrl=e.entryUrl??void 0,t}};u.set(T6.$type,T6);function ta(e){return e!=null}var l0;(function(e){e[e.CLIENT_UNSPECIFIED=0]="CLIENT_UNSPECIFIED",e[e.ANDROID=1]="ANDROID",e[e.IOS=2]="IOS",e[e.SHREDDIT=3]="SHREDDIT",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(l0||(l0={}));function al(e){switch(e){case 0:case"CLIENT_UNSPECIFIED":return l0.CLIENT_UNSPECIFIED;case 1:case"ANDROID":return l0.ANDROID;case 2:case"IOS":return l0.IOS;case 3:case"SHREDDIT":return l0.SHREDDIT;case-1:case"UNRECOGNIZED":default:return l0.UNRECOGNIZED}}function il(e){switch(e){case l0.CLIENT_UNSPECIFIED:return 0;case l0.ANDROID:return 1;case l0.IOS:return 2;case l0.SHREDDIT:return 3;case l0.UNRECOGNIZED:default:return-1}}var ra;(function(e){e[e.HEIGHT_UNSPECIFIED=0]="HEIGHT_UNSPECIFIED",e[e.REGULAR=1]="REGULAR",e[e.TALL=2]="TALL",e[e.UNRECOGNIZED=-1]="UNRECOGNIZED"})(ra||(ra={}));function na(){return{postData:void 0,shareParam:void 0,webViewContext:void 0,webbitToken:"",devvitDebug:"",client:0,nativeVersion:void 0,shredditVersion:void 0,appPermissionState:void 0,viewMode:void 0,signedRequestContext:void 0,webViewClientData:void 0,startTime:void 0}}var R6={$type:"devvit.ui.effects.web_view.v1alpha.BridgeContext",encode(e,t=R.default.Writer.create()){return e.postData!==void 0&&p2.encode(e.postData,t.uint32(10).fork()).ldelim(),e.shareParam!==void 0&&m2.encode(e.shareParam,t.uint32(18).fork()).ldelim(),e.webViewContext!==void 0&&V0.encode(e.webViewContext,t.uint32(26).fork()).ldelim(),e.webbitToken!==""&&t.uint32(34).string(e.webbitToken),e.devvitDebug!==""&&t.uint32(42).string(e.devvitDebug),e.client!==0&&t.uint32(48).int32(e.client),e.nativeVersion!==void 0&&h2.encode(e.nativeVersion,t.uint32(58).fork()).ldelim(),e.shredditVersion!==void 0&&f2.encode(e.shredditVersion,t.uint32(66).fork()).ldelim(),e.appPermissionState!==void 0&&w2.encode(e.appPermissionState,t.uint32(74).fork()).ldelim(),e.viewMode!==void 0&&t.uint32(80).int32(e.viewMode),e.signedRequestContext!==void 0&&t.uint32(98).string(e.signedRequestContext),e.webViewClientData!==void 0&&L.encode(L.wrap(e.webViewClientData),t.uint32(106).fork()).ldelim(),e.startTime!==void 0&&t.uint32(113).double(e.startTime),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=na();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.postData=p2.decode(r,r.uint32());continue;case 2:if(n!==18)break;a.shareParam=m2.decode(r,r.uint32());continue;case 3:if(n!==26)break;a.webViewContext=V0.decode(r,r.uint32());continue;case 4:if(n!==34)break;a.webbitToken=r.string();continue;case 5:if(n!==42)break;a.devvitDebug=r.string();continue;case 6:if(n!==48)break;a.client=r.int32();continue;case 7:if(n!==58)break;a.nativeVersion=h2.decode(r,r.uint32());continue;case 8:if(n!==66)break;a.shredditVersion=f2.decode(r,r.uint32());continue;case 9:if(n!==74)break;a.appPermissionState=w2.decode(r,r.uint32());continue;case 10:if(n!==80)break;a.viewMode=r.int32();continue;case 12:if(n!==98)break;a.signedRequestContext=r.string();continue;case 13:if(n!==106)break;a.webViewClientData=L.unwrap(L.decode(r,r.uint32()));continue;case 14:if(n!==113)break;a.startTime=r.double();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{postData:C(e.postData)?p2.fromJSON(e.postData):void 0,shareParam:C(e.shareParam)?m2.fromJSON(e.shareParam):void 0,webViewContext:C(e.webViewContext)?V0.fromJSON(e.webViewContext):void 0,webbitToken:C(e.webbitToken)?globalThis.String(e.webbitToken):"",devvitDebug:C(e.devvitDebug)?globalThis.String(e.devvitDebug):"",client:C(e.client)?al(e.client):0,nativeVersion:C(e.nativeVersion)?h2.fromJSON(e.nativeVersion):void 0,shredditVersion:C(e.shredditVersion)?f2.fromJSON(e.shredditVersion):void 0,appPermissionState:C(e.appPermissionState)?w2.fromJSON(e.appPermissionState):void 0,viewMode:C(e.viewMode)?B3(e.viewMode):void 0,signedRequestContext:C(e.signedRequestContext)?globalThis.String(e.signedRequestContext):void 0,webViewClientData:H6(e.webViewClientData)?e.webViewClientData:void 0,startTime:C(e.startTime)?globalThis.Number(e.startTime):void 0}},toJSON(e){let t={};return e.postData!==void 0&&(t.postData=p2.toJSON(e.postData)),e.shareParam!==void 0&&(t.shareParam=m2.toJSON(e.shareParam)),e.webViewContext!==void 0&&(t.webViewContext=V0.toJSON(e.webViewContext)),e.webbitToken!==""&&(t.webbitToken=e.webbitToken),e.devvitDebug!==""&&(t.devvitDebug=e.devvitDebug),e.client!==0&&(t.client=il(e.client)),e.nativeVersion!==void 0&&(t.nativeVersion=h2.toJSON(e.nativeVersion)),e.shredditVersion!==void 0&&(t.shredditVersion=f2.toJSON(e.shredditVersion)),e.appPermissionState!==void 0&&(t.appPermissionState=w2.toJSON(e.appPermissionState)),e.viewMode!==void 0&&(t.viewMode=k3(e.viewMode)),e.signedRequestContext!==void 0&&(t.signedRequestContext=e.signedRequestContext),e.webViewClientData!==void 0&&(t.webViewClientData=e.webViewClientData),e.startTime!==void 0&&(t.startTime=e.startTime),t},create(e){return R6.fromPartial(e??{})},fromPartial(e){let t=na();return t.postData=e.postData!==void 0&&e.postData!==null?p2.fromPartial(e.postData):void 0,t.shareParam=e.shareParam!==void 0&&e.shareParam!==null?m2.fromPartial(e.shareParam):void 0,t.webViewContext=e.webViewContext!==void 0&&e.webViewContext!==null?V0.fromPartial(e.webViewContext):void 0,t.webbitToken=e.webbitToken??"",t.devvitDebug=e.devvitDebug??"",t.client=e.client??0,t.nativeVersion=e.nativeVersion!==void 0&&e.nativeVersion!==null?h2.fromPartial(e.nativeVersion):void 0,t.shredditVersion=e.shredditVersion!==void 0&&e.shredditVersion!==null?f2.fromPartial(e.shredditVersion):void 0,t.appPermissionState=e.appPermissionState!==void 0&&e.appPermissionState!==null?w2.fromPartial(e.appPermissionState):void 0,t.viewMode=e.viewMode??void 0,t.signedRequestContext=e.signedRequestContext??void 0,t.webViewClientData=e.webViewClientData??void 0,t.startTime=e.startTime??void 0,t}};u.set(R6.$type,R6);function aa(){return{yyyy:0,release:0,attempt:0,number:0}}var h2={$type:"devvit.ui.effects.web_view.v1alpha.NativeClientVersion",encode(e,t=R.default.Writer.create()){return e.yyyy!==0&&t.uint32(8).int32(e.yyyy),e.release!==0&&t.uint32(16).int32(e.release),e.attempt!==0&&t.uint32(24).int32(e.attempt),e.number!==0&&t.uint32(32).int32(e.number),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=aa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.yyyy=r.int32();continue;case 2:if(n!==16)break;a.release=r.int32();continue;case 3:if(n!==24)break;a.attempt=r.int32();continue;case 4:if(n!==32)break;a.number=r.int32();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{yyyy:C(e.yyyy)?globalThis.Number(e.yyyy):0,release:C(e.release)?globalThis.Number(e.release):0,attempt:C(e.attempt)?globalThis.Number(e.attempt):0,number:C(e.number)?globalThis.Number(e.number):0}},toJSON(e){let t={};return e.yyyy!==0&&(t.yyyy=Math.round(e.yyyy)),e.release!==0&&(t.release=Math.round(e.release)),e.attempt!==0&&(t.attempt=Math.round(e.attempt)),e.number!==0&&(t.number=Math.round(e.number)),t},create(e){return h2.fromPartial(e??{})},fromPartial(e){let t=aa();return t.yyyy=e.yyyy??0,t.release=e.release??0,t.attempt=e.attempt??0,t.number=e.number??0,t}};u.set(h2.$type,h2);function ia(){return{major:0,minor:0,patch:0,version:""}}var f2={$type:"devvit.ui.effects.web_view.v1alpha.SemVer",encode(e,t=R.default.Writer.create()){return e.major!==0&&t.uint32(8).int32(e.major),e.minor!==0&&t.uint32(16).int32(e.minor),e.patch!==0&&t.uint32(24).int32(e.patch),e.version!==""&&t.uint32(34).string(e.version),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ia();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.major=r.int32();continue;case 2:if(n!==16)break;a.minor=r.int32();continue;case 3:if(n!==24)break;a.patch=r.int32();continue;case 4:if(n!==34)break;a.version=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{major:C(e.major)?globalThis.Number(e.major):0,minor:C(e.minor)?globalThis.Number(e.minor):0,patch:C(e.patch)?globalThis.Number(e.patch):0,version:C(e.version)?globalThis.String(e.version):""}},toJSON(e){let t={};return e.major!==0&&(t.major=Math.round(e.major)),e.minor!==0&&(t.minor=Math.round(e.minor)),e.patch!==0&&(t.patch=Math.round(e.patch)),e.version!==""&&(t.version=e.version),t},create(e){return f2.fromPartial(e??{})},fromPartial(e){let t=ia();return t.major=e.major??0,t.minor=e.minor??0,t.patch=e.patch??0,t.version=e.version??"",t}};u.set(f2.$type,f2);function oa(){return{appConfig:void 0}}var O6={$type:"devvit.ui.effects.web_view.v1alpha.WebViewClientData",encode(e,t=R.default.Writer.create()){return e.appConfig!==void 0&&G0.encode(e.appConfig,t.uint32(10).fork()).ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=oa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appConfig=G0.decode(r,r.uint32());continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appConfig:C(e.appConfig)?G0.fromJSON(e.appConfig):void 0}},toJSON(e){let t={};return e.appConfig!==void 0&&(t.appConfig=G0.toJSON(e.appConfig)),t},create(e){return O6.fromPartial(e??{})},fromPartial(e){let t=oa();return t.appConfig=e.appConfig!==void 0&&e.appConfig!==null?G0.fromPartial(e.appConfig):void 0,t}};u.set(O6.$type,O6);function la(){return{subredditId:"",subredditName:"",userId:"",appName:"",appVersion:"",postId:""}}var V0={$type:"devvit.ui.effects.web_view.v1alpha.WebViewContext",encode(e,t=R.default.Writer.create()){return e.subredditId!==""&&t.uint32(10).string(e.subredditId),e.subredditName!==""&&t.uint32(18).string(e.subredditName),e.userId!==""&&t.uint32(26).string(e.userId),e.appName!==""&&t.uint32(34).string(e.appName),e.appVersion!==""&&t.uint32(42).string(e.appVersion),e.postId!==""&&t.uint32(50).string(e.postId),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=la();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.subredditId=r.string();continue;case 2:if(n!==18)break;a.subredditName=r.string();continue;case 3:if(n!==26)break;a.userId=r.string();continue;case 4:if(n!==34)break;a.appName=r.string();continue;case 5:if(n!==42)break;a.appVersion=r.string();continue;case 6:if(n!==50)break;a.postId=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{subredditId:C(e.subredditId)?globalThis.String(e.subredditId):"",subredditName:C(e.subredditName)?globalThis.String(e.subredditName):"",userId:C(e.userId)?globalThis.String(e.userId):"",appName:C(e.appName)?globalThis.String(e.appName):"",appVersion:C(e.appVersion)?globalThis.String(e.appVersion):"",postId:C(e.postId)?globalThis.String(e.postId):""}},toJSON(e){let t={};return e.subredditId!==""&&(t.subredditId=e.subredditId),e.subredditName!==""&&(t.subredditName=e.subredditName),e.userId!==""&&(t.userId=e.userId),e.appName!==""&&(t.appName=e.appName),e.appVersion!==""&&(t.appVersion=e.appVersion),e.postId!==""&&(t.postId=e.postId),t},create(e){return V0.fromPartial(e??{})},fromPartial(e){let t=la();return t.subredditId=e.subredditId??"",t.subredditName=e.subredditName??"",t.userId=e.userId??"",t.appName=e.appName??"",t.appVersion=e.appVersion??"",t.postId=e.postId??"",t}};u.set(V0.$type,V0);function sa(){return{splash:void 0,developerData:void 0}}var p2={$type:"devvit.ui.effects.web_view.v1alpha.DevvitPostData",encode(e,t=R.default.Writer.create()){return e.splash!==void 0&&g2.encode(e.splash,t.uint32(26).fork()).ldelim(),e.developerData!==void 0&&L.encode(L.wrap(e.developerData),t.uint32(18).fork()).ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=sa();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 3:if(n!==26)break;a.splash=g2.decode(r,r.uint32());continue;case 2:if(n!==18)break;a.developerData=L.unwrap(L.decode(r,r.uint32()));continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{splash:C(e.splash)?g2.fromJSON(e.splash):void 0,developerData:H6(e.developerData)?e.developerData:void 0}},toJSON(e){let t={};return e.splash!==void 0&&(t.splash=g2.toJSON(e.splash)),e.developerData!==void 0&&(t.developerData=e.developerData),t},create(e){return p2.fromPartial(e??{})},fromPartial(e){let t=sa();return t.splash=e.splash!==void 0&&e.splash!==null?g2.fromPartial(e.splash):void 0,t.developerData=e.developerData??void 0,t}};u.set(p2.$type,p2);function ca(){return{path:"",params:{},hash:"",userData:void 0}}var m2={$type:"devvit.ui.effects.web_view.v1alpha.ShareParam",encode(e,t=R.default.Writer.create()){return e.path!==""&&t.uint32(10).string(e.path),Object.entries(e.params).forEach(([r,i])=>{P3.encode({key:r,value:i},t.uint32(18).fork()).ldelim()}),e.hash!==""&&t.uint32(26).string(e.hash),e.userData!==void 0&&t.uint32(34).string(e.userData),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ca();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.path=r.string();continue;case 2:if(n!==18)break;let o=P3.decode(r,r.uint32());o.value!==void 0&&(a.params[o.key]=o.value);continue;case 3:if(n!==26)break;a.hash=r.string();continue;case 4:if(n!==34)break;a.userData=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{path:C(e.path)?globalThis.String(e.path):"",params:H6(e.params)?Object.entries(e.params).reduce((t,[r,i])=>(t[r]=String(i),t),{}):{},hash:C(e.hash)?globalThis.String(e.hash):"",userData:C(e.userData)?globalThis.String(e.userData):void 0}},toJSON(e){let t={};if(e.path!==""&&(t.path=e.path),e.params){let r=Object.entries(e.params);r.length>0&&(t.params={},r.forEach(([i,a])=>{t.params[i]=a}))}return e.hash!==""&&(t.hash=e.hash),e.userData!==void 0&&(t.userData=e.userData),t},create(e){return m2.fromPartial(e??{})},fromPartial(e){let t=ca();return t.path=e.path??"",t.params=Object.entries(e.params??{}).reduce((r,[i,a])=>(a!==void 0&&(r[i]=globalThis.String(a)),r),{}),t.hash=e.hash??"",t.userData=e.userData??void 0,t}};u.set(m2.$type,m2);function da(){return{key:"",value:""}}var P3={$type:"devvit.ui.effects.web_view.v1alpha.ShareParam.ParamsEntry",encode(e,t=R.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 R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=da();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.key=r.string();continue;case 2:if(n!==18)break;a.value=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{key:C(e.key)?globalThis.String(e.key):"",value:C(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 P3.fromPartial(e??{})},fromPartial(e){let t=da();return t.key=e.key??"",t.value=e.value??"",t}};u.set(P3.$type,P3);function ua(){return{appDisplayName:void 0,appIconUri:void 0,backgroundUri:void 0,buttonLabel:void 0,description:void 0,entry:void 0,title:void 0}}var g2={$type:"devvit.ui.effects.web_view.v1alpha.SplashPostData",encode(e,t=R.default.Writer.create()){return e.appDisplayName!==void 0&&t.uint32(10).string(e.appDisplayName),e.appIconUri!==void 0&&t.uint32(18).string(e.appIconUri),e.backgroundUri!==void 0&&t.uint32(26).string(e.backgroundUri),e.buttonLabel!==void 0&&t.uint32(34).string(e.buttonLabel),e.description!==void 0&&t.uint32(42).string(e.description),e.entry!==void 0&&t.uint32(74).string(e.entry),e.title!==void 0&&t.uint32(58).string(e.title),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=ua();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==10)break;a.appDisplayName=r.string();continue;case 2:if(n!==18)break;a.appIconUri=r.string();continue;case 3:if(n!==26)break;a.backgroundUri=r.string();continue;case 4:if(n!==34)break;a.buttonLabel=r.string();continue;case 5:if(n!==42)break;a.description=r.string();continue;case 9:if(n!==74)break;a.entry=r.string();continue;case 7:if(n!==58)break;a.title=r.string();continue}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{appDisplayName:C(e.appDisplayName)?globalThis.String(e.appDisplayName):void 0,appIconUri:C(e.appIconUri)?globalThis.String(e.appIconUri):void 0,backgroundUri:C(e.backgroundUri)?globalThis.String(e.backgroundUri):void 0,buttonLabel:C(e.buttonLabel)?globalThis.String(e.buttonLabel):void 0,description:C(e.description)?globalThis.String(e.description):void 0,entry:C(e.entry)?globalThis.String(e.entry):void 0,title:C(e.title)?globalThis.String(e.title):void 0}},toJSON(e){let t={};return e.appDisplayName!==void 0&&(t.appDisplayName=e.appDisplayName),e.appIconUri!==void 0&&(t.appIconUri=e.appIconUri),e.backgroundUri!==void 0&&(t.backgroundUri=e.backgroundUri),e.buttonLabel!==void 0&&(t.buttonLabel=e.buttonLabel),e.description!==void 0&&(t.description=e.description),e.entry!==void 0&&(t.entry=e.entry),e.title!==void 0&&(t.title=e.title),t},create(e){return g2.fromPartial(e??{})},fromPartial(e){let t=ua();return t.appDisplayName=e.appDisplayName??void 0,t.appIconUri=e.appIconUri??void 0,t.backgroundUri=e.backgroundUri??void 0,t.buttonLabel=e.buttonLabel??void 0,t.description=e.description??void 0,t.entry=e.entry??void 0,t.title=e.title??void 0,t}};u.set(g2.$type,g2);function va(){return{consentStatus:0,grantedScopes:[],requestedScopes:[]}}var w2={$type:"devvit.ui.effects.web_view.v1alpha.AppPermissionState",encode(e,t=R.default.Writer.create()){e.consentStatus!==0&&t.uint32(8).int32(e.consentStatus),t.uint32(18).fork();for(let r of e.grantedScopes)t.int32(r);t.ldelim(),t.uint32(26).fork();for(let r of e.requestedScopes)t.int32(r);return t.ldelim(),t},decode(e,t){let r=e instanceof R.default.Reader?e:R.default.Reader.create(e),i=t===void 0?r.len:r.pos+t,a=va();for(;r.pos<i;){let n=r.uint32();switch(n>>>3){case 1:if(n!==8)break;a.consentStatus=r.int32();continue;case 2:if(n===16){a.grantedScopes.push(r.int32());continue}if(n===18){let o=r.uint32()+r.pos;for(;r.pos<o;)a.grantedScopes.push(r.int32());continue}break;case 3:if(n===24){a.requestedScopes.push(r.int32());continue}if(n===26){let o=r.uint32()+r.pos;for(;r.pos<o;)a.requestedScopes.push(r.int32());continue}break}if((n&7)===4||n===0)break;r.skipType(n&7)}return a},fromJSON(e){return{consentStatus:C(e.consentStatus)?O3(e.consentStatus):0,grantedScopes:globalThis.Array.isArray(e?.grantedScopes)?e.grantedScopes.map(t=>ye(t)):[],requestedScopes:globalThis.Array.isArray(e?.requestedScopes)?e.requestedScopes.map(t=>ye(t)):[]}},toJSON(e){let t={};return e.consentStatus!==0&&(t.consentStatus=H3(e.consentStatus)),e.grantedScopes?.length&&(t.grantedScopes=e.grantedScopes.map(r=>Le(r))),e.requestedScopes?.length&&(t.requestedScopes=e.requestedScopes.map(r=>Le(r))),t},create(e){return w2.fromPartial(e??{})},fromPartial(e){let t=va();return t.consentStatus=e.consentStatus??0,t.grantedScopes=e.grantedScopes?.map(r=>r)||[],t.requestedScopes=e.requestedScopes?.map(r=>r)||[],t}};u.set(w2.$type,w2);function H6(e){return typeof e=="object"&&e!==null}function C(e){return e!=null}function ha(e){if(e.appIconUri&&!new URL(e.appIconUri).host.endsWith("devvit.net")){console.warn(`invalid app icon "${e.appIconUri}"`);return}let t;if(e.userData){let r={hash:"",params:{},path:"",userData:e.userData};t=JSON.stringify(r)}return{appIconUri:e.appIconUri,devvitShare:t,text:e.text,title:e.title}}function Ne(e){return e?.toLowerCase()||""}function ol(e){return e=Ne(e),e.includes("chrome")||e.includes("crios")}function ll(e){return Ne(e).includes("edg")}function sl(e){return e=Ne(e),e.includes("firefox")||e.includes("fxios")}function cl(e,t){return/(iPad)/i.test(Ne(e))||/(Mac)/i.test(Ne(e))&&t&&t>1}function dl(e,t){return cl(e,t)||/(iPhone|iPod)/i.test(Ne(e))}function fa(e){return!ol(e)&&!ll(e)&&!sl(e)&&(Ne(e).includes("safari")||dl(e))}function b6(e,t){return new CustomEvent(e,{bubbles:!0,composed:!0,detail:t})}var pa=e=>e===null||typeof e!="object"?!1:"scope"in e&&e.scope===0&&"type"in e&&e.type==="devvit-internal";var ul="devvitdebug",vl="devvitshare";function B6(){return ga(ul)}function ma(){return ga(vl)}function X5(){var i,a;if(globalThis.devvit??(globalThis.devvit={}),globalThis.devvit.debug)return;(i=globalThis.devvit).debug??(i.debug={});let e={blocks:void 0,emitSnapshots:void 0,emitState:void 0,realtime:void 0,runtime:void 0,surface:void 0,useAsync:void 0,payments:void 0,bootstrap:void 0,webView:void 0},t={};for(let n in e)t[n.toLowerCase()]=n;let r=B6();if(r!=null){r==="all"&&(r=Object.keys(e).filter(n=>n!=="emitSnapshots"&&n!=="emitState").join());for(let n of r.split(",")??[]){let[o,s]=n.split("=");o&&(o.toLowerCase()in t?o=t[o.toLowerCase()]:console.warn(`[devvit] unknown devvitdebug parameter "${o}"`),(a=globalThis.devvit.debug)[o]??(a[o]=s||"true"),console.info(`[devvit] set devvitdebug ${o}=${globalThis.devvit.debug[o]}`))}}}function ga(e){return[...new URL(globalThis.location?location.href:"file://").searchParams].find(([r])=>r.toLowerCase()===e)?.[1]}X5();var Z2,E2,$3,U3,$,k6,D3,wa,P6,Aa,Ve,A2,S1=class extends j1{constructor(){super(...arguments);M(this,$);this.devMode=!1;this.autoFocus=!1;this.focusable=!1;this._originDiffers=!1;M(this,Z2,!1);M(this,E2,[]);M(this,$3);M(this,U3,()=>{});M(this,D3,r=>{if(r.source===this._iframe?.contentWindow){if(x(this,$,A2).call(this,"Got message from iframe:",r.data),pa(r.data)){x(this,$,wa).call(this,r.data);return}r.preventDefault(),r.stopImmediatePropagation(),this.onReceivedPostMessage?this.onReceivedPostMessage(r.data):this.dispatchEvent(P0("devvit-web-view-message",r.data))}})}static get styles(){return[p3`
601
601
  :host {
602
602
  display: flex;
603
603
  flex-direction: row;