@canton-network/wallet-gateway-remote 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/auth/jwt-auth-service.d.ts.map +1 -1
- package/dist/auth/jwt-auth-service.js +16 -2
- package/dist/config/Config.d.ts +261 -2
- package/dist/config/Config.d.ts.map +1 -1
- package/dist/config/Config.js +26 -5
- package/dist/config/ConfigUtils.d.ts +16 -1
- package/dist/config/ConfigUtils.d.ts.map +1 -1
- package/dist/config/ConfigUtils.js +147 -59
- package/dist/dapp-api/controller.d.ts +13 -1
- package/dist/dapp-api/controller.d.ts.map +1 -1
- package/dist/dapp-api/controller.js +2 -1
- package/dist/dapp-api/rpc-gen/typings.d.ts +30 -0
- package/dist/dapp-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/dapp-api/server.d.ts +10 -5
- package/dist/dapp-api/server.d.ts.map +1 -1
- package/dist/dapp-api/server.js +10 -3
- package/dist/example-config.d.ts +58 -62
- package/dist/example-config.d.ts.map +1 -1
- package/dist/example-config.js +59 -61
- package/dist/index.js +7 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +64 -19
- package/dist/ledger/wallet-sync-service.d.ts +11 -1
- package/dist/ledger/wallet-sync-service.d.ts.map +1 -1
- package/dist/ledger/wallet-sync-service.js +101 -48
- package/dist/middleware/rateLimit.d.ts.map +1 -1
- package/dist/middleware/rateLimit.js +3 -9
- package/dist/notices/server-notices.d.ts +24 -0
- package/dist/notices/server-notices.d.ts.map +1 -0
- package/dist/notices/server-notices.js +40 -0
- package/dist/notices/server-status-service.d.ts +11 -0
- package/dist/notices/server-status-service.d.ts.map +1 -0
- package/dist/notices/server-status-service.js +17 -0
- package/dist/signing/service-account-session.d.ts +16 -2
- package/dist/signing/service-account-session.d.ts.map +1 -1
- package/dist/signing/service-account-session.js +31 -0
- package/dist/signing-providers-registration.d.ts +2 -1
- package/dist/signing-providers-registration.d.ts.map +1 -1
- package/dist/signing-providers-registration.js +76 -16
- package/dist/user-api/controller.d.ts +20 -2
- package/dist/user-api/controller.d.ts.map +1 -1
- package/dist/user-api/controller.js +161 -302
- package/dist/user-api/rpc-gen/index.d.ts +12 -3
- package/dist/user-api/rpc-gen/index.d.ts.map +1 -1
- package/dist/user-api/rpc-gen/index.js +4 -1
- package/dist/user-api/rpc-gen/schemas.d.ts.map +1 -1
- package/dist/user-api/rpc-gen/schemas.js +46 -3
- package/dist/user-api/rpc-gen/typings.d.ts +113 -35
- package/dist/user-api/rpc-gen/typings.d.ts.map +1 -1
- package/dist/user-api/server.d.ts +7 -5
- package/dist/user-api/server.d.ts.map +1 -1
- package/dist/user-api/server.js +7 -2
- package/dist/web/frontend/404/index.html +3 -2
- package/dist/web/frontend/activities/index.html +4 -3
- package/dist/web/frontend/admin/index.html +16 -0
- package/dist/web/frontend/api-keys/add/index.html +3 -2
- package/dist/web/frontend/api-keys/index.html +3 -2
- package/dist/web/frontend/approve/index.html +4 -4
- package/dist/web/frontend/assets/404-N2p-H94F.js +5 -0
- package/dist/web/frontend/assets/activities-CIyMcvMq.js +71 -0
- package/dist/web/frontend/assets/addApiKey-DD_HxolC.js +92 -0
- package/dist/web/frontend/assets/addIdentityProvider-DNaST3bz.js +28 -0
- package/dist/web/frontend/assets/addNetwork-BwV-qK9L.js +38 -0
- package/dist/web/frontend/assets/addParty-DtBW1rpV.js +14 -0
- package/dist/web/frontend/assets/admin-CKAkdJym.js +53 -0
- package/dist/web/frontend/assets/apiKeys-CcnbBkNH.js +68 -0
- package/dist/web/frontend/assets/approve-33mo5eC8.js +27 -0
- package/dist/web/frontend/assets/callback-lKGXXz-1.js +7 -0
- package/dist/web/frontend/assets/common-DaUa4tUM.js +15 -0
- package/dist/web/frontend/assets/dist-BW5ACUmw.js +2 -0
- package/dist/web/frontend/assets/dist-CVv1nHd6.js +1 -0
- package/dist/web/frontend/assets/editParty-ZifjLzYx.js +15 -0
- package/dist/web/frontend/assets/frontend-Bs6UVmG1.js +4968 -0
- package/dist/web/frontend/assets/identityProviders-D5s7N-Ec.js +76 -0
- package/dist/web/frontend/assets/login-BAJsIB9G.js +11 -0
- package/dist/web/frontend/assets/networks-Do-zoG5E.js +78 -0
- package/dist/web/frontend/assets/parties-DFcN190b.js +51 -0
- package/dist/web/frontend/assets/reviewIdentityProvider-C2tsrpKc.js +43 -0
- package/dist/web/frontend/assets/reviewNetwork-BEGzls61.js +43 -0
- package/dist/web/frontend/assets/rolldown-runtime-pP25SEvz.js +1 -0
- package/dist/web/frontend/assets/selfIssuedLogin-a2KenO2P.js +112 -0
- package/dist/web/frontend/assets/signMessage-CQF0sCMe.js +23 -0
- package/dist/web/frontend/callback/index.html +3 -3
- package/dist/web/frontend/identity-providers/add/index.html +3 -2
- package/dist/web/frontend/identity-providers/index.html +3 -2
- package/dist/web/frontend/identity-providers/review/index.html +3 -2
- package/dist/web/frontend/index.html +2 -1
- package/dist/web/frontend/login/index.html +4 -12
- package/dist/web/frontend/networks/add/index.html +3 -2
- package/dist/web/frontend/networks/index.html +3 -2
- package/dist/web/frontend/networks/review/index.html +3 -2
- package/dist/web/frontend/parties/add/index.html +5 -5
- package/dist/web/frontend/parties/edit/index.html +5 -5
- package/dist/web/frontend/parties/index.html +4 -3
- package/dist/web/frontend/self-issued-login/index.html +5 -13
- package/dist/web/frontend/sign-message/index.html +3 -2
- package/dist/web/route-inputs.d.ts.map +1 -1
- package/dist/web/route-inputs.js +1 -0
- package/package.json +34 -30
- package/dist/ledger/self-issued-auth-service.d.ts +0 -50
- package/dist/ledger/self-issued-auth-service.d.ts.map +0 -1
- package/dist/ledger/self-issued-auth-service.js +0 -264
- package/dist/signing/signing-worker.d.ts +0 -86
- package/dist/signing/signing-worker.d.ts.map +0 -1
- package/dist/signing/signing-worker.js +0 -213
- package/dist/web/frontend/assets/404-D6hNG1H8.js +0 -5
- package/dist/web/frontend/assets/activities-CSaNJ4Bw.js +0 -61
- package/dist/web/frontend/assets/addApiKey-IKOYP6lC.js +0 -92
- package/dist/web/frontend/assets/addIdentityProvider-CnRS1C3U.js +0 -28
- package/dist/web/frontend/assets/addNetwork-Wq0K3t5Z.js +0 -38
- package/dist/web/frontend/assets/addParty-B0GaqKvG.js +0 -14
- package/dist/web/frontend/assets/apiKeys-BgJyxg5r.js +0 -68
- package/dist/web/frontend/assets/approve-kKlT_54l.js +0 -27
- package/dist/web/frontend/assets/callback-83Lr1QFW.js +0 -7
- package/dist/web/frontend/assets/common-BkYw_tO_.js +0 -31
- package/dist/web/frontend/assets/editParty-DU9eMclk.js +0 -15
- package/dist/web/frontend/assets/identityProviders-sWmbKlSu.js +0 -71
- package/dist/web/frontend/assets/index-AvzB2hln.js +0 -93
- package/dist/web/frontend/assets/index-BF3EIXoM.js +0 -2
- package/dist/web/frontend/assets/index-CGK8ht7_.js +0 -1
- package/dist/web/frontend/assets/index-DRQ0oWml.js +0 -4814
- package/dist/web/frontend/assets/index-NgSpx7q_.js +0 -3
- package/dist/web/frontend/assets/login-BqK1nbQm.js +0 -11
- package/dist/web/frontend/assets/networks-C62lWsP4.js +0 -73
- package/dist/web/frontend/assets/reviewIdentityProvider-pILqo6EV.js +0 -43
- package/dist/web/frontend/assets/reviewNetwork-DZOWqkuG.js +0 -43
- package/dist/web/frontend/assets/selfIssuedLogin-DarXIpvS.js +0 -81
- package/dist/web/frontend/assets/signMessage-k9b_lLxh.js +0 -23
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function X(e){let t=typeof e;if(t=="object"){if(Array.isArray(e))return"array";if(e===null)return"null"}return t}function nt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}let W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),re=[];for(let e=0;e<W.length;e++)re[W[e].charCodeAt(0)]=e;re[45]=W.indexOf("+");re[95]=W.indexOf("/");function Lt(e){let t=e.length*3/4;e[e.length-2]=="="?t-=2:e[e.length-1]=="="&&(t-=1);let i=new Uint8Array(t),a=0,n=0,l,r=0;for(let s=0;s<e.length;s++){if(l=re[e.charCodeAt(s)],l===void 0)switch(e[s]){case"=":n=0;case`
|
|
2
|
-
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(n){case 0:r=l,n=1;break;case 1:i[a++]=r<<2|(l&48)>>4,r=l,n=2;break;case 2:i[a++]=(r&15)<<4|(l&60)>>2,r=l,n=3;break;case 3:i[a++]=(r&3)<<6|l,n=0;break}}if(n==1)throw Error("invalid base64 string.");return i.subarray(0,a)}function oe(e){let t="",i=0,a,n=0;for(let l=0;l<e.length;l++)switch(a=e[l],i){case 0:t+=W[a>>2],n=(a&3)<<4,i=1;break;case 1:t+=W[n|a>>4],n=(a&15)<<2,i=2;break;case 2:t+=W[n|a>>6],t+=W[a&63],i=0;break}return i&&(t+=W[n],t+="=",i==1&&(t+="=")),t}var f;(function(e){e.symbol=Symbol.for("protobuf-ts/unknown"),e.onRead=(i,a,n,l,r)=>{(t(a)?a[e.symbol]:a[e.symbol]=[]).push({no:n,wireType:l,data:r})},e.onWrite=(i,a,n)=>{for(let{no:l,wireType:r,data:s}of e.list(a))n.tag(l,r).raw(s)},e.list=(i,a)=>{if(t(i)){let n=i[e.symbol];return a?n.filter(l=>l.no==a):n}return[]},e.last=(i,a)=>e.list(i,a).slice(-1)[0];const t=i=>i&&Array.isArray(i[e.symbol])})(f||(f={}));var c;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(c||(c={}));function _t(){let e=0,t=0;for(let a=0;a<28;a+=7){let n=this.buf[this.pos++];if(e|=(n&127)<<a,(n&128)==0)return this.assertBounds(),[e,t]}let i=this.buf[this.pos++];if(e|=(i&15)<<28,t=(i&112)>>4,(i&128)==0)return this.assertBounds(),[e,t];for(let a=3;a<=31;a+=7){let n=this.buf[this.pos++];if(t|=(n&127)<<a,(n&128)==0)return this.assertBounds(),[e,t]}throw new Error("invalid varint")}function le(e,t,i){for(let l=0;l<28;l=l+7){const r=e>>>l,s=!(!(r>>>7)&&t==0),o=(s?r|128:r)&255;if(i.push(o),!s)return}const a=e>>>28&15|(t&7)<<4,n=t>>3!=0;if(i.push((n?a|128:a)&255),!!n){for(let l=3;l<31;l=l+7){const r=t>>>l,s=!!(r>>>7),o=(s?r|128:r)&255;if(i.push(o),!s)return}i.push(t>>>31&1)}}const ee=65536*65536;function yt(e){let t=e[0]=="-";t&&(e=e.slice(1));const i=1e6;let a=0,n=0;function l(r,s){const o=Number(e.slice(r,s));n*=i,a=a*i+o,a>=ee&&(n=n+(a/ee|0),a=a%ee)}return l(-24,-18),l(-18,-12),l(-12,-6),l(-6),[t,a,n]}function it(e,t){if(t>>>0<=2097151)return""+(ee*t+(e>>>0));let i=e&16777215,a=(e>>>24|t<<8)>>>0&16777215,n=t>>16&65535,l=i+a*6777216+n*6710656,r=a+n*8147497,s=n*2,o=1e7;l>=o&&(r+=Math.floor(l/o),l%=o),r>=o&&(s+=Math.floor(r/o),r%=o);function d(y,B){let T=y?String(y):"";return B?"0000000".slice(T.length)+T:T}return d(s,0)+d(r,s)+d(l,1)}function lt(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let i=0;i<9;i++)t.push(e&127|128),e=e>>7;t.push(1)}}function Ut(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let i=5;(e&128)!==0&&i<10;i++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}let N;function Ft(){const e=new DataView(new ArrayBuffer(8));N=globalThis.BigInt!==void 0&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:e}:void 0}Ft();function kt(e){if(!e)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const bt=/^-?[0-9]+$/,ne=4294967296,H=2147483648;class Tt{constructor(t,i){this.lo=t|0,this.hi=i|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let t=this.hi*ne+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class R extends Tt{static from(t){if(N)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=N.C(t);case"number":if(t===0)return this.ZERO;t=N.C(t);case"bigint":if(!t)return this.ZERO;if(t<N.UMIN)throw new Error("signed value for ulong");if(t>N.UMAX)throw new Error("ulong too large");return N.V.setBigUint64(0,t,!0),new R(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!bt.test(t))throw new Error("string is no integer");let[i,a,n]=yt(t);if(i)throw new Error("signed value for ulong");return new R(a,n);case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new R(t,t/ne)}throw new Error("unknown value "+typeof t)}toString(){return N?this.toBigInt().toString():it(this.lo,this.hi)}toBigInt(){return kt(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigUint64(0,!0)}}R.ZERO=new R(0,0);class w extends Tt{static from(t){if(N)switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=="")throw new Error("string is no integer");t=N.C(t);case"number":if(t===0)return this.ZERO;t=N.C(t);case"bigint":if(!t)return this.ZERO;if(t<N.MIN)throw new Error("signed long too small");if(t>N.MAX)throw new Error("signed long too large");return N.V.setBigInt64(0,t,!0),new w(N.V.getInt32(0,!0),N.V.getInt32(4,!0))}else switch(typeof t){case"string":if(t=="0")return this.ZERO;if(t=t.trim(),!bt.test(t))throw new Error("string is no integer");let[i,a,n]=yt(t);if(i){if(n>H||n==H&&a!=0)throw new Error("signed long too small")}else if(n>=H)throw new Error("signed long too large");let l=new w(a,n);return i?l.negate():l;case"number":if(t==0)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new w(t,t/ne):new w(-t,-t/ne).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return(this.hi&H)!==0}negate(){let t=~this.hi,i=this.lo;return i?i=~i+1:t+=1,new w(i,t)}toString(){if(N)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+it(t.lo,t.hi)}return it(this.lo,this.hi)}toBigInt(){return kt(N),N.V.setInt32(0,this.lo,!0),N.V.setInt32(4,this.hi,!0),N.V.getBigInt64(0,!0)}}w.ZERO=new w(0,0);const ct={readUnknownField:!0,readerFactory:e=>new ot(e)};function $t(e){return e?Object.assign(Object.assign({},ct),e):ct}class ot{constructor(t,i){this.varint64=_t,this.uint32=Ut,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.textDecoder=i??new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}tag(){let t=this.uint32(),i=t>>>3,a=t&7;if(i<=0||a<0||a>5)throw new Error("illegal tag: field no "+i+" wire type "+a);return[i,a]}skip(t){let i=this.pos;switch(t){case c.Varint:for(;this.buf[this.pos++]&128;);break;case c.Bit64:this.pos+=4;case c.Bit32:this.pos+=4;break;case c.LengthDelimited:let a=this.uint32();this.pos+=a;break;case c.StartGroup:let n;for(;(n=this.tag()[1])!==c.EndGroup;)this.skip(n);break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(i,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return new w(...this.varint64())}uint64(){return new R(...this.varint64())}sint64(){let[t,i]=this.varint64(),a=-(t&1);return t=(t>>>1|(i&1)<<31)^a,i=i>>>1^a,new w(t,i)}bool(){let[t,i]=this.varint64();return t!==0||i!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new R(this.sfixed32(),this.sfixed32())}sfixed64(){return new w(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),i=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(i,i+t)}string(){return this.textDecoder.decode(this.bytes())}}function b(e,t){if(!e)throw new Error(t)}const Wt=34028234663852886e22,xt=-34028234663852886e22,Pt=4294967295,Ot=2147483647,At=-2147483648;function q(e){if(typeof e!="number")throw new Error("invalid int 32: "+typeof e);if(!Number.isInteger(e)||e>Ot||e<At)throw new Error("invalid int 32: "+e)}function ie(e){if(typeof e!="number")throw new Error("invalid uint 32: "+typeof e);if(!Number.isInteger(e)||e>Pt||e<0)throw new Error("invalid uint 32: "+e)}function st(e){if(typeof e!="number")throw new Error("invalid float 32: "+typeof e);if(Number.isFinite(e)&&(e>Wt||e<xt))throw new Error("invalid float 32: "+e)}const dt={writeUnknownFields:!0,writerFactory:()=>new St};function Vt(e){return e?Object.assign(Object.assign({},dt),e):dt}class St{constructor(t){this.stack=[],this.textEncoder=t??new TextEncoder,this.chunks=[],this.buf=[]}finish(){this.chunks.push(new Uint8Array(this.buf));let t=0;for(let n=0;n<this.chunks.length;n++)t+=this.chunks[n].length;let i=new Uint8Array(t),a=0;for(let n=0;n<this.chunks.length;n++)i.set(this.chunks[n],a),a+=this.chunks[n].length;return this.chunks=[],i}fork(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}join(){let t=this.finish(),i=this.stack.pop();if(!i)throw new Error("invalid state, fork stack empty");return this.chunks=i.chunks,this.buf=i.buf,this.uint32(t.byteLength),this.raw(t)}tag(t,i){return this.uint32((t<<3|i)>>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(ie(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return q(t),lt(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let i=this.textEncoder.encode(t);return this.uint32(i.byteLength),this.raw(i)}float(t){st(t);let i=new Uint8Array(4);return new DataView(i.buffer).setFloat32(0,t,!0),this.raw(i)}double(t){let i=new Uint8Array(8);return new DataView(i.buffer).setFloat64(0,t,!0),this.raw(i)}fixed32(t){ie(t);let i=new Uint8Array(4);return new DataView(i.buffer).setUint32(0,t,!0),this.raw(i)}sfixed32(t){q(t);let i=new Uint8Array(4);return new DataView(i.buffer).setInt32(0,t,!0),this.raw(i)}sint32(t){return q(t),t=(t<<1^t>>31)>>>0,lt(t,this.buf),this}sfixed64(t){let i=new Uint8Array(8),a=new DataView(i.buffer),n=w.from(t);return a.setInt32(0,n.lo,!0),a.setInt32(4,n.hi,!0),this.raw(i)}fixed64(t){let i=new Uint8Array(8),a=new DataView(i.buffer),n=R.from(t);return a.setInt32(0,n.lo,!0),a.setInt32(4,n.hi,!0),this.raw(i)}int64(t){let i=w.from(t);return le(i.lo,i.hi,this.buf),this}sint64(t){let i=w.from(t),a=i.hi>>31,n=i.lo<<1^a,l=(i.hi<<1|i.lo>>>31)^a;return le(n,l,this.buf),this}uint64(t){let i=R.from(t);return le(i.lo,i.hi,this.buf),this}}const ft={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0},ut={ignoreUnknownFields:!1};function jt(e){return e?Object.assign(Object.assign({},ut),e):ut}function wt(e){return e?Object.assign(Object.assign({},ft),e):ft}const Nt=Symbol.for("protobuf-ts/message-type");function at(e){let t=!1;const i=[];for(let a=0;a<e.length;a++){let n=e.charAt(a);n=="_"?t=!0:/\d/.test(n)?(i.push(n),t=!0):t?(i.push(n.toUpperCase()),t=!1):a==0?i.push(n.toLowerCase()):i.push(n)}return i.join("")}var u;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(u||(u={}));var F;(function(e){e[e.BIGINT=0]="BIGINT",e[e.STRING=1]="STRING",e[e.NUMBER=2]="NUMBER"})(F||(F={}));var ae;(function(e){e[e.NO=0]="NO",e[e.PACKED=1]="PACKED",e[e.UNPACKED=2]="UNPACKED"})(ae||(ae={}));function Kt(e){var t,i,a,n;return e.localName=(t=e.localName)!==null&&t!==void 0?t:at(e.name),e.jsonName=(i=e.jsonName)!==null&&i!==void 0?i:at(e.name),e.repeat=(a=e.repeat)!==null&&a!==void 0?a:ae.NO,e.opt=(n=e.opt)!==null&&n!==void 0?n:e.repeat||e.oneof?!1:e.kind=="message",e}function Ct(e){if(typeof e!="object"||e===null||!e.hasOwnProperty("oneofKind"))return!1;switch(typeof e.oneofKind){case"string":return e[e.oneofKind]===void 0?!1:Object.keys(e).length==2;case"undefined":return Object.keys(e).length==1;default:return!1}}class Mt{constructor(t){var i;this.fields=(i=t.fields)!==null&&i!==void 0?i:[]}prepare(){if(this.data)return;const t=[],i=[],a=[];for(let n of this.fields)if(n.oneof)a.includes(n.oneof)||(a.push(n.oneof),t.push(n.oneof),i.push(n.oneof));else switch(i.push(n.localName),n.kind){case"scalar":case"enum":(!n.opt||n.repeat)&&t.push(n.localName);break;case"message":n.repeat&&t.push(n.localName);break;case"map":t.push(n.localName);break}this.data={req:t,known:i,oneofs:Object.values(a)}}is(t,i,a=!1){if(i<0)return!0;if(t==null||typeof t!="object")return!1;this.prepare();let n=Object.keys(t),l=this.data;if(n.length<l.req.length||l.req.some(r=>!n.includes(r))||!a&&n.some(r=>!l.known.includes(r)))return!1;if(i<1)return!0;for(const r of l.oneofs){const s=t[r];if(!Ct(s))return!1;if(s.oneofKind===void 0)continue;const o=this.fields.find(d=>d.localName===s.oneofKind);if(!o||!this.field(s[s.oneofKind],o,a,i))return!1}for(const r of this.fields)if(r.oneof===void 0&&!this.field(t[r.localName],r,a,i))return!1;return!0}field(t,i,a,n){let l=i.repeat;switch(i.kind){case"scalar":return t===void 0?i.opt:l?this.scalars(t,i.T,n,i.L):this.scalar(t,i.T,i.L);case"enum":return t===void 0?i.opt:l?this.scalars(t,u.INT32,n):this.scalar(t,u.INT32);case"message":return t===void 0?!0:l?this.messages(t,i.T(),a,n):this.message(t,i.T(),a,n);case"map":if(typeof t!="object"||t===null)return!1;if(n<2)return!0;if(!this.mapKeys(t,i.K,n))return!1;switch(i.V.kind){case"scalar":return this.scalars(Object.values(t),i.V.T,n,i.V.L);case"enum":return this.scalars(Object.values(t),u.INT32,n);case"message":return this.messages(Object.values(t),i.V.T(),a,n)}break}return!0}message(t,i,a,n){return a?i.isAssignable(t,n):i.is(t,n)}messages(t,i,a,n){if(!Array.isArray(t))return!1;if(n<2)return!0;if(a){for(let l=0;l<t.length&&l<n;l++)if(!i.isAssignable(t[l],n-1))return!1}else for(let l=0;l<t.length&&l<n;l++)if(!i.is(t[l],n-1))return!1;return!0}scalar(t,i,a){let n=typeof t;switch(i){case u.UINT64:case u.FIXED64:case u.INT64:case u.SFIXED64:case u.SINT64:switch(a){case F.BIGINT:return n=="bigint";case F.NUMBER:return n=="number"&&!isNaN(t);default:return n=="string"}case u.BOOL:return n=="boolean";case u.STRING:return n=="string";case u.BYTES:return t instanceof Uint8Array;case u.DOUBLE:case u.FLOAT:return n=="number"&&!isNaN(t);default:return n=="number"&&Number.isInteger(t)}}scalars(t,i,a,n){if(!Array.isArray(t))return!1;if(a<2)return!0;if(Array.isArray(t)){for(let l=0;l<t.length&&l<a;l++)if(!this.scalar(t[l],i,n))return!1}return!0}mapKeys(t,i,a){let n=Object.keys(t);switch(i){case u.INT32:case u.FIXED32:case u.SFIXED32:case u.SINT32:case u.UINT32:return this.scalars(n.slice(0,a).map(l=>parseInt(l)),i,a);case u.BOOL:return this.scalars(n.slice(0,a).map(l=>l=="true"?!0:l=="false"?!1:l),i,a);default:return this.scalars(n,i,a,F.STRING)}}}function U(e,t){switch(t){case F.BIGINT:return e.toBigInt();case F.NUMBER:return e.toNumber();default:return e.toString()}}class Gt{constructor(t){this.info=t}prepare(){var t;if(this.fMap===void 0){this.fMap={};const i=(t=this.info.fields)!==null&&t!==void 0?t:[];for(const a of i)this.fMap[a.name]=a,this.fMap[a.jsonName]=a,this.fMap[a.localName]=a}}assert(t,i,a){if(!t){let n=X(a);throw(n=="number"||n=="boolean")&&(n=a.toString()),new Error(`Cannot parse JSON ${n} for ${this.info.typeName}#${i}`)}}read(t,i,a){this.prepare();const n=[];for(const[l,r]of Object.entries(t)){const s=this.fMap[l];if(!s){if(!a.ignoreUnknownFields)throw new Error(`Found unknown field while reading ${this.info.typeName} from JSON format. JSON key: ${l}`);continue}const o=s.localName;let d;if(s.oneof){if(r===null&&(s.kind!=="enum"||s.T()[0]!=="google.protobuf.NullValue"))continue;if(n.includes(s.oneof))throw new Error(`Multiple members of the oneof group "${s.oneof}" of ${this.info.typeName} are present in JSON.`);n.push(s.oneof),d=i[s.oneof]={oneofKind:o}}else d=i;if(s.kind=="map"){if(r===null)continue;this.assert(nt(r),s.name,r);const y=d[o];for(const[B,T]of Object.entries(r)){this.assert(T!==null,s.name+" map value",null);let E;switch(s.V.kind){case"message":E=s.V.T().internalJsonRead(T,a);break;case"enum":if(E=this.enum(s.V.T(),T,s.name,a.ignoreUnknownFields),E===!1)continue;break;case"scalar":E=this.scalar(T,s.V.T,s.V.L,s.name);break}this.assert(E!==void 0,s.name+" map value",T);let $=B;s.K==u.BOOL&&($=$=="true"?!0:$=="false"?!1:$),$=this.scalar($,s.K,F.STRING,s.name).toString(),y[$]=E}}else if(s.repeat){if(r===null)continue;this.assert(Array.isArray(r),s.name,r);const y=d[o];for(const B of r){this.assert(B!==null,s.name,null);let T;switch(s.kind){case"message":T=s.T().internalJsonRead(B,a);break;case"enum":if(T=this.enum(s.T(),B,s.name,a.ignoreUnknownFields),T===!1)continue;break;case"scalar":T=this.scalar(B,s.T,s.L,s.name);break}this.assert(T!==void 0,s.name,r),y.push(T)}}else switch(s.kind){case"message":if(r===null&&s.T().typeName!="google.protobuf.Value"){this.assert(s.oneof===void 0,s.name+" (oneof member)",null);continue}d[o]=s.T().internalJsonRead(r,a,d[o]);break;case"enum":if(r===null)continue;let y=this.enum(s.T(),r,s.name,a.ignoreUnknownFields);if(y===!1)continue;d[o]=y;break;case"scalar":if(r===null)continue;d[o]=this.scalar(r,s.T,s.L,s.name);break}}}enum(t,i,a,n){if(t[0]=="google.protobuf.NullValue"&&b(i===null||i==="NULL_VALUE",`Unable to parse field ${this.info.typeName}#${a}, enum ${t[0]} only accepts null.`),i===null)return 0;switch(typeof i){case"number":return b(Number.isInteger(i),`Unable to parse field ${this.info.typeName}#${a}, enum can only be integral number, got ${i}.`),i;case"string":let l=i;t[2]&&i.substring(0,t[2].length)===t[2]&&(l=i.substring(t[2].length));let r=t[1][l];return typeof r>"u"&&n?!1:(b(typeof r=="number",`Unable to parse field ${this.info.typeName}#${a}, enum ${t[0]} has no value for "${i}".`),r)}b(!1,`Unable to parse field ${this.info.typeName}#${a}, cannot parse enum value from ${typeof i}".`)}scalar(t,i,a,n){let l;try{switch(i){case u.DOUBLE:case u.FLOAT:if(t===null)return 0;if(t==="NaN")return Number.NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(t===""){l="empty string";break}if(typeof t=="string"&&t.trim().length!==t.length){l="extra whitespace";break}if(typeof t!="string"&&typeof t!="number")break;let r=Number(t);if(Number.isNaN(r)){l="not a number";break}if(!Number.isFinite(r)){l="too large or small";break}return i==u.FLOAT&&st(r),r;case u.INT32:case u.FIXED32:case u.SFIXED32:case u.SINT32:case u.UINT32:if(t===null)return 0;let s;if(typeof t=="number"?s=t:t===""?l="empty string":typeof t=="string"&&(t.trim().length!==t.length?l="extra whitespace":s=Number(t)),s===void 0)break;return i==u.UINT32?ie(s):q(s),s;case u.INT64:case u.SFIXED64:case u.SINT64:if(t===null)return U(w.ZERO,a);if(typeof t!="number"&&typeof t!="string")break;return U(w.from(t),a);case u.FIXED64:case u.UINT64:if(t===null)return U(R.ZERO,a);if(typeof t!="number"&&typeof t!="string")break;return U(R.from(t),a);case u.BOOL:if(t===null)return!1;if(typeof t!="boolean")break;return t;case u.STRING:if(t===null)return"";if(typeof t!="string"){l="extra whitespace";break}try{encodeURIComponent(t)}catch(o){o="invalid UTF8";break}return t;case u.BYTES:if(t===null||t==="")return new Uint8Array(0);if(typeof t!="string")break;return Lt(t)}}catch(r){l=r.message}this.assert(!1,n+(l?" - "+l:""),t)}}class zt{constructor(t){var i;this.fields=(i=t.fields)!==null&&i!==void 0?i:[]}write(t,i){const a={},n=t;for(const l of this.fields){if(!l.oneof){let d=this.field(l,n[l.localName],i);d!==void 0&&(a[i.useProtoFieldName?l.name:l.jsonName]=d);continue}const r=n[l.oneof];if(r.oneofKind!==l.localName)continue;const s=l.kind=="scalar"||l.kind=="enum"?Object.assign(Object.assign({},i),{emitDefaultValues:!0}):i;let o=this.field(l,r[l.localName],s);b(o!==void 0),a[i.useProtoFieldName?l.name:l.jsonName]=o}return a}field(t,i,a){let n;if(t.kind=="map"){b(typeof i=="object"&&i!==null);const l={};switch(t.V.kind){case"scalar":for(const[o,d]of Object.entries(i)){const y=this.scalar(t.V.T,d,t.name,!1,!0);b(y!==void 0),l[o.toString()]=y}break;case"message":const r=t.V.T();for(const[o,d]of Object.entries(i)){const y=this.message(r,d,t.name,a);b(y!==void 0),l[o.toString()]=y}break;case"enum":const s=t.V.T();for(const[o,d]of Object.entries(i)){b(d===void 0||typeof d=="number");const y=this.enum(s,d,t.name,!1,!0,a.enumAsInteger);b(y!==void 0),l[o.toString()]=y}break}(a.emitDefaultValues||Object.keys(l).length>0)&&(n=l)}else if(t.repeat){b(Array.isArray(i));const l=[];switch(t.kind){case"scalar":for(let o=0;o<i.length;o++){const d=this.scalar(t.T,i[o],t.name,t.opt,!0);b(d!==void 0),l.push(d)}break;case"enum":const r=t.T();for(let o=0;o<i.length;o++){b(i[o]===void 0||typeof i[o]=="number");const d=this.enum(r,i[o],t.name,t.opt,!0,a.enumAsInteger);b(d!==void 0),l.push(d)}break;case"message":const s=t.T();for(let o=0;o<i.length;o++){const d=this.message(s,i[o],t.name,a);b(d!==void 0),l.push(d)}break}(a.emitDefaultValues||l.length>0||a.emitDefaultValues)&&(n=l)}else switch(t.kind){case"scalar":n=this.scalar(t.T,i,t.name,t.opt,a.emitDefaultValues);break;case"enum":n=this.enum(t.T(),i,t.name,t.opt,a.emitDefaultValues,a.enumAsInteger);break;case"message":n=this.message(t.T(),i,t.name,a);break}return n}enum(t,i,a,n,l,r){if(t[0]=="google.protobuf.NullValue")return!l&&!n?void 0:null;if(i===void 0){b(n);return}if(!(i===0&&!l&&!n))return b(typeof i=="number"),b(Number.isInteger(i)),r||!t[1].hasOwnProperty(i)?i:t[2]?t[2]+t[1][i]:t[1][i]}message(t,i,a,n){return i===void 0?n.emitDefaultValues?null:void 0:t.internalJsonWrite(i,n)}scalar(t,i,a,n,l){if(i===void 0){b(n);return}const r=l||n;switch(t){case u.INT32:case u.SFIXED32:case u.SINT32:return i===0?r?0:void 0:(q(i),i);case u.FIXED32:case u.UINT32:return i===0?r?0:void 0:(ie(i),i);case u.FLOAT:st(i);case u.DOUBLE:return i===0?r?0:void 0:(b(typeof i=="number"),Number.isNaN(i)?"NaN":i===Number.POSITIVE_INFINITY?"Infinity":i===Number.NEGATIVE_INFINITY?"-Infinity":i);case u.STRING:return i===""?r?"":void 0:(b(typeof i=="string"),i);case u.BOOL:return i===!1?r?!1:void 0:(b(typeof i=="boolean"),i);case u.UINT64:case u.FIXED64:b(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let s=R.from(i);return s.isZero()&&!r?void 0:s.toString();case u.INT64:case u.SFIXED64:case u.SINT64:b(typeof i=="number"||typeof i=="string"||typeof i=="bigint");let o=w.from(i);return o.isZero()&&!r?void 0:o.toString();case u.BYTES:return b(i instanceof Uint8Array),i.byteLength?oe(i):r?"":void 0}}}function rt(e,t=F.STRING){switch(e){case u.BOOL:return!1;case u.UINT64:case u.FIXED64:return U(R.ZERO,t);case u.INT64:case u.SFIXED64:case u.SINT64:return U(w.ZERO,t);case u.DOUBLE:case u.FLOAT:return 0;case u.BYTES:return new Uint8Array(0);case u.STRING:return"";default:return 0}}class Jt{constructor(t){this.info=t}prepare(){var t;if(!this.fieldNoToField){const i=(t=this.info.fields)!==null&&t!==void 0?t:[];this.fieldNoToField=new Map(i.map(a=>[a.no,a]))}}read(t,i,a,n){this.prepare();const l=n===void 0?t.len:t.pos+n;for(;t.pos<l;){const[r,s]=t.tag(),o=this.fieldNoToField.get(r);if(!o){let T=a.readUnknownField;if(T=="throw")throw new Error(`Unknown field ${r} (wire type ${s}) for ${this.info.typeName}`);let E=t.skip(s);T!==!1&&(T===!0?f.onRead:T)(this.info.typeName,i,r,s,E);continue}let d=i,y=o.repeat,B=o.localName;switch(o.oneof&&(d=d[o.oneof],d.oneofKind!==B&&(d=i[o.oneof]={oneofKind:B})),o.kind){case"scalar":case"enum":let T=o.kind=="enum"?u.INT32:o.T,E=o.kind=="scalar"?o.L:void 0;if(y){let Z=d[B];if(s==c.LengthDelimited&&T!=u.STRING&&T!=u.BYTES){let se=t.uint32()+t.pos;for(;t.pos<se;)Z.push(this.scalar(t,T,E))}else Z.push(this.scalar(t,T,E))}else d[B]=this.scalar(t,T,E);break;case"message":if(y){let Z=d[B],se=o.T().internalBinaryRead(t,t.uint32(),a);Z.push(se)}else d[B]=o.T().internalBinaryRead(t,t.uint32(),a,d[B]);break;case"map":let[$,Et]=this.mapEntry(o,t,a);d[B][$]=Et;break}}}mapEntry(t,i,a){let n=i.uint32(),l=i.pos+n,r,s;for(;i.pos<l;){let[o,d]=i.tag();switch(o){case 1:t.K==u.BOOL?r=i.bool().toString():r=this.scalar(i,t.K,F.STRING);break;case 2:switch(t.V.kind){case"scalar":s=this.scalar(i,t.V.T,t.V.L);break;case"enum":s=i.int32();break;case"message":s=t.V.T().internalBinaryRead(i,i.uint32(),a);break}break;default:throw new Error(`Unknown field ${o} (wire type ${d}) in map entry for ${this.info.typeName}#${t.name}`)}}if(r===void 0){let o=rt(t.K);r=t.K==u.BOOL?o.toString():o}if(s===void 0)switch(t.V.kind){case"scalar":s=rt(t.V.T,t.V.L);break;case"enum":s=0;break;case"message":s=t.V.T().create();break}return[r,s]}scalar(t,i,a){switch(i){case u.INT32:return t.int32();case u.STRING:return t.string();case u.BOOL:return t.bool();case u.DOUBLE:return t.double();case u.FLOAT:return t.float();case u.INT64:return U(t.int64(),a);case u.UINT64:return U(t.uint64(),a);case u.FIXED64:return U(t.fixed64(),a);case u.FIXED32:return t.fixed32();case u.BYTES:return t.bytes();case u.UINT32:return t.uint32();case u.SFIXED32:return t.sfixed32();case u.SFIXED64:return U(t.sfixed64(),a);case u.SINT32:return t.sint32();case u.SINT64:return U(t.sint64(),a)}}}class qt{constructor(t){this.info=t}prepare(){if(!this.fields){const t=this.info.fields?this.info.fields.concat():[];this.fields=t.sort((i,a)=>i.no-a.no)}}write(t,i,a){this.prepare();for(const l of this.fields){let r,s,o=l.repeat,d=l.localName;if(l.oneof){const y=t[l.oneof];if(y.oneofKind!==d)continue;r=y[d],s=!0}else r=t[d],s=!1;switch(l.kind){case"scalar":case"enum":let y=l.kind=="enum"?u.INT32:l.T;if(o)if(b(Array.isArray(r)),o==ae.PACKED)this.packed(i,y,l.no,r);else for(const B of r)this.scalar(i,y,l.no,B,!0);else r===void 0?b(l.opt):this.scalar(i,y,l.no,r,s||l.opt);break;case"message":if(o){b(Array.isArray(r));for(const B of r)this.message(i,a,l.T(),l.no,B)}else this.message(i,a,l.T(),l.no,r);break;case"map":b(typeof r=="object"&&r!==null);for(const[B,T]of Object.entries(r))this.mapEntry(i,a,l,B,T);break}}let n=a.writeUnknownFields;n!==!1&&(n===!0?f.onWrite:n)(this.info.typeName,t,i)}mapEntry(t,i,a,n,l){t.tag(a.no,c.LengthDelimited),t.fork();let r=n;switch(a.K){case u.INT32:case u.FIXED32:case u.UINT32:case u.SFIXED32:case u.SINT32:r=Number.parseInt(n);break;case u.BOOL:b(n=="true"||n=="false"),r=n=="true";break}switch(this.scalar(t,a.K,1,r,!0),a.V.kind){case"scalar":this.scalar(t,a.V.T,2,l,!0);break;case"enum":this.scalar(t,u.INT32,2,l,!0);break;case"message":this.message(t,i,a.V.T(),2,l);break}t.join()}message(t,i,a,n,l){l!==void 0&&(a.internalBinaryWrite(l,t.tag(n,c.LengthDelimited).fork(),i),t.join())}scalar(t,i,a,n,l){let[r,s,o]=this.scalarInfo(i,n);(!o||l)&&(t.tag(a,r),t[s](n))}packed(t,i,a,n){if(!n.length)return;b(i!==u.BYTES&&i!==u.STRING),t.tag(a,c.LengthDelimited),t.fork();let[,l]=this.scalarInfo(i);for(let r=0;r<n.length;r++)t[l](n[r]);t.join()}scalarInfo(t,i){let a=c.Varint,n,l=i===void 0,r=i===0;switch(t){case u.INT32:n="int32";break;case u.STRING:r=l||!i.length,a=c.LengthDelimited,n="string";break;case u.BOOL:r=i===!1,n="bool";break;case u.UINT32:n="uint32";break;case u.DOUBLE:a=c.Bit64,n="double";break;case u.FLOAT:a=c.Bit32,n="float";break;case u.INT64:r=l||w.from(i).isZero(),n="int64";break;case u.UINT64:r=l||R.from(i).isZero(),n="uint64";break;case u.FIXED64:r=l||R.from(i).isZero(),a=c.Bit64,n="fixed64";break;case u.BYTES:r=l||!i.byteLength,a=c.LengthDelimited,n="bytes";break;case u.FIXED32:a=c.Bit32,n="fixed32";break;case u.SFIXED32:a=c.Bit32,n="sfixed32";break;case u.SFIXED64:r=l||w.from(i).isZero(),a=c.Bit64,n="sfixed64";break;case u.SINT32:n="sint32";break;case u.SINT64:r=l||w.from(i).isZero(),n="sint64";break}return[a,n,l||r]}}function Xt(e){const t=e.messagePrototype?Object.create(e.messagePrototype):Object.defineProperty({},Nt,{value:e});for(let i of e.fields){let a=i.localName;if(!i.opt)if(i.oneof)t[i.oneof]={oneofKind:void 0};else if(i.repeat)t[a]=[];else switch(i.kind){case"scalar":t[a]=rt(i.T,i.L);break;case"enum":t[a]=0;break;case"map":t[a]={};break}}return t}function h(e,t,i){let a,n=i,l;for(let r of e.fields){let s=r.localName;if(r.oneof){const o=n[r.oneof];if(o?.oneofKind==null)continue;if(a=o[s],l=t[r.oneof],l.oneofKind=o.oneofKind,a==null){delete l[s];continue}}else if(a=n[s],l=t,a==null)continue;switch(r.repeat&&(l[s].length=a.length),r.kind){case"scalar":case"enum":if(r.repeat)for(let d=0;d<a.length;d++)l[s][d]=a[d];else l[s]=a;break;case"message":let o=r.T();if(r.repeat)for(let d=0;d<a.length;d++)l[s][d]=o.create(a[d]);else l[s]===void 0?l[s]=o.create(a):o.mergePartial(l[s],a);break;case"map":switch(r.V.kind){case"scalar":case"enum":Object.assign(l[s],a);break;case"message":let d=r.V.T();for(let y of Object.keys(a))l[s][y]=d.create(a[y]);break}break}}}function Zt(e,t,i){if(t===i)return!0;if(!t||!i)return!1;for(let a of e.fields){let n=a.localName,l=a.oneof?t[a.oneof][n]:t[n],r=a.oneof?i[a.oneof][n]:i[n];switch(a.kind){case"enum":case"scalar":let s=a.kind=="enum"?u.INT32:a.T;if(!(a.repeat?ht(s,l,r):Bt(s,l,r)))return!1;break;case"map":if(!(a.V.kind=="message"?mt(a.V.T(),Y(l),Y(r)):ht(a.V.kind=="enum"?u.INT32:a.V.T,Y(l),Y(r))))return!1;break;case"message":let o=a.T();if(!(a.repeat?mt(o,l,r):o.equals(l,r)))return!1;break}}return!0}const Y=Object.values;function Bt(e,t,i){if(t===i)return!0;if(e!==u.BYTES)return!1;let a=t,n=i;if(a.length!==n.length)return!1;for(let l=0;l<a.length;l++)if(a[l]!=n[l])return!1;return!0}function ht(e,t,i){if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++)if(!Bt(e,t[a],i[a]))return!1;return!0}function mt(e,t,i){if(t.length!==i.length)return!1;for(let a=0;a<t.length;a++)if(!e.equals(t[a],i[a]))return!1;return!0}const It=Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})),Ht=It[Nt]={};class m{constructor(t,i,a){this.defaultCheckDepth=16,this.typeName=t,this.fields=i.map(Kt),this.options=a??{},Ht.value=this,this.messagePrototype=Object.create(null,It),this.refTypeCheck=new Mt(this),this.refJsonReader=new Gt(this),this.refJsonWriter=new zt(this),this.refBinReader=new Jt(this),this.refBinWriter=new qt(this)}create(t){let i=Xt(this);return t!==void 0&&h(this,i,t),i}clone(t){let i=this.create();return h(this,i,t),i}equals(t,i){return Zt(this,t,i)}is(t,i=this.defaultCheckDepth){return this.refTypeCheck.is(t,i,!1)}isAssignable(t,i=this.defaultCheckDepth){return this.refTypeCheck.is(t,i,!0)}mergePartial(t,i){h(this,t,i)}fromBinary(t,i){let a=$t(i);return this.internalBinaryRead(a.readerFactory(t),t.byteLength,a)}fromJson(t,i){return this.internalJsonRead(t,jt(i))}fromJsonString(t,i){let a=JSON.parse(t);return this.fromJson(a,i)}toJson(t,i){return this.internalJsonWrite(t,wt(i))}toJsonString(t,i){var a;let n=this.toJson(t,i);return JSON.stringify(n,null,(a=i?.prettySpaces)!==null&&a!==void 0?a:0)}toBinary(t,i){let a=Vt(i);return this.internalBinaryWrite(t,a.writerFactory(),a).finish()}internalJsonRead(t,i,a){if(t!==null&&typeof t=="object"&&!Array.isArray(t)){let n=a??this.create();return this.refJsonReader.read(t,n,i),n}throw new Error(`Unable to parse message ${this.typeName} from JSON ${X(t)}.`)}internalJsonWrite(t,i){return this.refJsonWriter.write(t,i)}internalBinaryWrite(t,i,a){return this.refBinWriter.write(t,i,a),i}internalBinaryRead(t,i,a,n){let l=n??this.create();return this.refBinReader.read(t,l,a,i),l}}var Yt=class extends m{constructor(){super("google.protobuf.Duration",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}internalJsonWrite(e,t){let i=w.from(e.seconds).toNumber();if(i>315576e6||i<-315576e6)throw new Error("Duration value out of range.");let a=e.seconds.toString();if(i===0&&e.nanos<0&&(a="-"+a),e.nanos!==0){let n=Math.abs(e.nanos).toString();n="0".repeat(9-n.length)+n,n.substring(3)==="000000"?n=n.substring(0,3):n.substring(6)==="000"&&(n=n.substring(0,6)),a+="."+n}return a+"s"}internalJsonRead(e,t,i){if(typeof e!="string")throw new Error("Unable to parse Duration from JSON "+X(e)+". Expected string.");let a=e.match(/^(-?)([0-9]+)(?:\.([0-9]+))?s/);if(a===null)throw new Error("Unable to parse Duration from JSON string. Invalid format.");i||(i=this.create());let[,n,l,r]=a,s=w.from(n+l);if(s.toNumber()>315576e6||s.toNumber()<-315576e6)throw new Error("Unable to parse Duration from JSON string. Value out of range.");if(i.seconds=s.toBigInt(),typeof r=="string"){let o=n+r+"0".repeat(9-r.length);i.nanos=parseInt(o)}return i}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.seconds=e.int64().toBigInt();break;case 2:n.nanos=e.int32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.seconds!==0n&&t.tag(1,c.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,c.Varint).int32(e.nanos);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const I=new Yt;var Qt=class extends m{constructor(){super("google.protobuf.Timestamp",[{no:1,name:"seconds",kind:"scalar",T:3,L:0},{no:2,name:"nanos",kind:"scalar",T:5}])}now(){const e=this.create(),t=Date.now();return e.seconds=w.from(Math.floor(t/1e3)).toBigInt(),e.nanos=t%1e3*1e6,e}toDate(e){return new Date(w.from(e.seconds).toNumber()*1e3+Math.ceil(e.nanos/1e6))}fromDate(e){const t=this.create(),i=e.getTime();return t.seconds=w.from(Math.floor(i/1e3)).toBigInt(),t.nanos=(i%1e3+(i<0&&i%1e3!==0?1e3:0))*1e6,t}internalJsonWrite(e,t){let i=w.from(e.seconds).toNumber()*1e3;if(i<Date.parse("0001-01-01T00:00:00Z")||i>Date.parse("9999-12-31T23:59:59Z"))throw new Error("Unable to encode Timestamp to JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");if(e.nanos<0)throw new Error("Unable to encode invalid Timestamp to JSON. Nanos must not be negative.");let a="Z";if(e.nanos>0){let n=(e.nanos+1e9).toString().substring(1);n.substring(3)==="000000"?a="."+n.substring(0,3)+"Z":n.substring(6)==="000"?a="."+n.substring(0,6)+"Z":a="."+n+"Z"}return new Date(i).toISOString().replace(".000Z",a)}internalJsonRead(e,t,i){if(typeof e!="string")throw new Error("Unable to parse Timestamp from JSON "+X(e)+".");let a=e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!a)throw new Error("Unable to parse Timestamp from JSON. Invalid format.");let n=Date.parse(a[1]+"-"+a[2]+"-"+a[3]+"T"+a[4]+":"+a[5]+":"+a[6]+(a[8]?a[8]:"Z"));if(Number.isNaN(n))throw new Error("Unable to parse Timestamp from JSON. Invalid value.");if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new globalThis.Error("Unable to parse Timestamp from JSON. Must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive.");return i||(i=this.create()),i.seconds=w.from(n/1e3).toBigInt(),i.nanos=0,a[7]&&(i.nanos=parseInt("1"+a[7]+"0".repeat(9-a[7].length))-1e9),i}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.seconds=0n,t.nanos=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.seconds=e.int64().toBigInt();break;case 2:n.nanos=e.int32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.seconds!==0n&&t.tag(1,c.Varint).int64(e.seconds),e.nanos!==0&&t.tag(2,c.Varint).int32(e.nanos);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const k=new Qt;function en(e,t){var i,a,n;let l=e;return l.service=t,l.localName=(i=l.localName)!==null&&i!==void 0?i:at(l.name),l.serverStreaming=!!l.serverStreaming,l.clientStreaming=!!l.clientStreaming,l.options=(a=l.options)!==null&&a!==void 0?a:{},l.idempotency=(n=l.idempotency)!==null&&n!==void 0?n:void 0,l}class tn{constructor(t,i,a){this.typeName=t,this.methods=i.map(n=>en(n,this)),this.options=a??{}}}var nn=class extends m{constructor(){super("google.protobuf.Empty",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const A=new nn;var an=class extends m{constructor(){super("com.daml.ledger.api.v2.Value",[{no:1,name:"unit",kind:"message",oneof:"sum",T:()=>A},{no:2,name:"bool",kind:"scalar",oneof:"sum",T:8},{no:3,name:"int64",kind:"scalar",oneof:"sum",T:18},{no:4,name:"date",kind:"scalar",oneof:"sum",T:5},{no:5,name:"timestamp",kind:"scalar",oneof:"sum",T:16},{no:6,name:"numeric",kind:"scalar",oneof:"sum",T:9},{no:7,name:"party",kind:"scalar",oneof:"sum",T:9},{no:8,name:"text",kind:"scalar",oneof:"sum",T:9},{no:9,name:"contract_id",kind:"scalar",oneof:"sum",T:9},{no:10,name:"optional",kind:"message",oneof:"sum",T:()=>he},{no:11,name:"list",kind:"message",oneof:"sum",T:()=>ue},{no:12,name:"text_map",kind:"message",oneof:"sum",T:()=>me},{no:13,name:"gen_map",kind:"message",oneof:"sum",T:()=>ge},{no:14,name:"record",kind:"message",oneof:"sum",T:()=>v},{no:15,name:"variant",kind:"message",oneof:"sum",T:()=>de},{no:16,name:"enum",kind:"message",oneof:"sum",T:()=>fe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.sum={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.sum={oneofKind:"unit",unit:A.internalBinaryRead(e,e.uint32(),i,n.sum.unit)};break;case 2:n.sum={oneofKind:"bool",bool:e.bool()};break;case 3:n.sum={oneofKind:"int64",int64:e.sint64().toString()};break;case 4:n.sum={oneofKind:"date",date:e.int32()};break;case 5:n.sum={oneofKind:"timestamp",timestamp:e.sfixed64().toString()};break;case 6:n.sum={oneofKind:"numeric",numeric:e.string()};break;case 7:n.sum={oneofKind:"party",party:e.string()};break;case 8:n.sum={oneofKind:"text",text:e.string()};break;case 9:n.sum={oneofKind:"contractId",contractId:e.string()};break;case 10:n.sum={oneofKind:"optional",optional:he.internalBinaryRead(e,e.uint32(),i,n.sum.optional)};break;case 11:n.sum={oneofKind:"list",list:ue.internalBinaryRead(e,e.uint32(),i,n.sum.list)};break;case 12:n.sum={oneofKind:"textMap",textMap:me.internalBinaryRead(e,e.uint32(),i,n.sum.textMap)};break;case 13:n.sum={oneofKind:"genMap",genMap:ge.internalBinaryRead(e,e.uint32(),i,n.sum.genMap)};break;case 14:n.sum={oneofKind:"record",record:v.internalBinaryRead(e,e.uint32(),i,n.sum.record)};break;case 15:n.sum={oneofKind:"variant",variant:de.internalBinaryRead(e,e.uint32(),i,n.sum.variant)};break;case 16:n.sum={oneofKind:"enum",enum:fe.internalBinaryRead(e,e.uint32(),i,n.sum.enum)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.sum.oneofKind==="unit"&&A.internalBinaryWrite(e.sum.unit,t.tag(1,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="bool"&&t.tag(2,c.Varint).bool(e.sum.bool),e.sum.oneofKind==="int64"&&t.tag(3,c.Varint).sint64(e.sum.int64),e.sum.oneofKind==="date"&&t.tag(4,c.Varint).int32(e.sum.date),e.sum.oneofKind==="timestamp"&&t.tag(5,c.Bit64).sfixed64(e.sum.timestamp),e.sum.oneofKind==="numeric"&&t.tag(6,c.LengthDelimited).string(e.sum.numeric),e.sum.oneofKind==="party"&&t.tag(7,c.LengthDelimited).string(e.sum.party),e.sum.oneofKind==="text"&&t.tag(8,c.LengthDelimited).string(e.sum.text),e.sum.oneofKind==="contractId"&&t.tag(9,c.LengthDelimited).string(e.sum.contractId),e.sum.oneofKind==="optional"&&he.internalBinaryWrite(e.sum.optional,t.tag(10,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="list"&&ue.internalBinaryWrite(e.sum.list,t.tag(11,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="textMap"&&me.internalBinaryWrite(e.sum.textMap,t.tag(12,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="genMap"&&ge.internalBinaryWrite(e.sum.genMap,t.tag(13,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="record"&&v.internalBinaryWrite(e.sum.record,t.tag(14,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="variant"&&de.internalBinaryWrite(e.sum.variant,t.tag(15,c.LengthDelimited).fork(),i).join(),e.sum.oneofKind==="enum"&&fe.internalBinaryWrite(e.sum.enum,t.tag(16,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const g=new an;var rn=class extends m{constructor(){super("com.daml.ledger.api.v2.Record",[{no:1,name:"record_id",kind:"message",T:()=>p},{no:2,name:"fields",kind:"message",repeat:2,T:()=>ce}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.fields=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.recordId=p.internalBinaryRead(e,e.uint32(),i,n.recordId);break;case 2:n.fields.push(ce.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.recordId&&p.internalBinaryWrite(e.recordId,t.tag(1,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.fields.length;n++)ce.internalBinaryWrite(e.fields[n],t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const v=new rn;var on=class extends m{constructor(){super("com.daml.ledger.api.v2.RecordField",[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.label="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.label=e.string();break;case 2:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.label!==""&&t.tag(1,c.LengthDelimited).string(e.label),e.value&&g.internalBinaryWrite(e.value,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ce=new on;var sn=class extends m{constructor(){super("com.daml.ledger.api.v2.Identifier",[{no:1,name:"package_id",kind:"scalar",T:9},{no:2,name:"module_name",kind:"scalar",T:9},{no:3,name:"entity_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageId="",t.moduleName="",t.entityName="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageId=e.string();break;case 2:n.moduleName=e.string();break;case 3:n.entityName=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.packageId!==""&&t.tag(1,c.LengthDelimited).string(e.packageId),e.moduleName!==""&&t.tag(2,c.LengthDelimited).string(e.moduleName),e.entityName!==""&&t.tag(3,c.LengthDelimited).string(e.entityName);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const p=new sn;var ln=class extends m{constructor(){super("com.daml.ledger.api.v2.Variant",[{no:1,name:"variant_id",kind:"message",T:()=>p},{no:2,name:"constructor",kind:"scalar",T:9},{no:3,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.constructor="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.variantId=p.internalBinaryRead(e,e.uint32(),i,n.variantId);break;case 2:n.constructor=e.string();break;case 3:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.variantId&&p.internalBinaryWrite(e.variantId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.constructor!==""&&t.tag(2,c.LengthDelimited).string(e.constructor),e.value&&g.internalBinaryWrite(e.value,t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const de=new ln;var cn=class extends m{constructor(){super("com.daml.ledger.api.v2.Enum",[{no:1,name:"enum_id",kind:"message",T:()=>p},{no:2,name:"constructor",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.constructor="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.enumId=p.internalBinaryRead(e,e.uint32(),i,n.enumId);break;case 2:n.constructor=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.enumId&&p.internalBinaryWrite(e.enumId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.constructor!==""&&t.tag(2,c.LengthDelimited).string(e.constructor);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const fe=new cn;var dn=class extends m{constructor(){super("com.daml.ledger.api.v2.List",[{no:1,name:"elements",kind:"message",repeat:2,T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.elements=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.elements.push(g.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.elements.length;n++)g.internalBinaryWrite(e.elements[n],t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ue=new dn;var fn=class extends m{constructor(){super("com.daml.ledger.api.v2.Optional",[{no:1,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.value&&g.internalBinaryWrite(e.value,t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const he=new fn;var un=class extends m{constructor(){super("com.daml.ledger.api.v2.TextMap",[{no:1,name:"entries",kind:"message",repeat:2,T:()=>pe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.entries=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.entries.push(pe.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.entries.length;n++)pe.internalBinaryWrite(e.entries[n],t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const me=new un;var hn=class extends m{constructor(){super("com.daml.ledger.api.v2.TextMap.Entry",[{no:1,name:"key",kind:"scalar",T:9},{no:2,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.key="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.key=e.string();break;case 2:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.key!==""&&t.tag(1,c.LengthDelimited).string(e.key),e.value&&g.internalBinaryWrite(e.value,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const pe=new hn;var mn=class extends m{constructor(){super("com.daml.ledger.api.v2.GenMap",[{no:1,name:"entries",kind:"message",repeat:2,T:()=>ye}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.entries=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.entries.push(ye.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.entries.length;n++)ye.internalBinaryWrite(e.entries[n],t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ge=new mn;var pn=class extends m{constructor(){super("com.daml.ledger.api.v2.GenMap.Entry",[{no:1,name:"key",kind:"message",T:()=>g},{no:2,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.key=g.internalBinaryRead(e,e.uint32(),i,n.key);break;case 2:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.key&&g.internalBinaryWrite(e.key,t.tag(1,c.LengthDelimited).fork(),i).join(),e.value&&g.internalBinaryWrite(e.value,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ye=new pn;var gn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GlobalKey",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"package_name",kind:"scalar",T:9},{no:3,name:"key",kind:"message",T:()=>g},{no:4,name:"hash",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageName="",t.hash=new Uint8Array(0),e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.packageName=e.string();break;case 3:n.key=g.internalBinaryRead(e,e.uint32(),i,n.key);break;case 4:n.hash=e.bytes();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.packageName!==""&&t.tag(2,c.LengthDelimited).string(e.packageName),e.key&&g.internalBinaryWrite(e.key,t.tag(3,c.LengthDelimited).fork(),i).join(),e.hash.length&&t.tag(4,c.LengthDelimited).bytes(e.hash);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const V=new gn;var yn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GlobalKeyWithMaintainers",[{no:1,name:"key",kind:"message",T:()=>V},{no:2,name:"maintainers",kind:"scalar",repeat:2,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.maintainers=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.key=V.internalBinaryRead(e,e.uint32(),i,n.key);break;case 2:n.maintainers.push(e.string());break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.key&&V.internalBinaryWrite(e.key,t.tag(1,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.maintainers.length;n++)t.tag(2,c.LengthDelimited).string(e.maintainers[n]);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const L=new yn;var kn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.Fetch",[{no:1,name:"lf_version",kind:"scalar",T:9},{no:2,name:"contract_id",kind:"scalar",T:9},{no:3,name:"package_name",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"signatories",kind:"scalar",repeat:2,T:9},{no:6,name:"stakeholders",kind:"scalar",repeat:2,T:9},{no:7,name:"acting_parties",kind:"scalar",repeat:2,T:9},{no:8,name:"interface_id",kind:"message",T:()=>p},{no:9,name:"key",kind:"message",T:()=>L},{no:10,name:"by_key",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lfVersion="",t.contractId="",t.packageName="",t.signatories=[],t.stakeholders=[],t.actingParties=[],t.byKey=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.lfVersion=e.string();break;case 2:n.contractId=e.string();break;case 3:n.packageName=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.signatories.push(e.string());break;case 6:n.stakeholders.push(e.string());break;case 7:n.actingParties.push(e.string());break;case 8:n.interfaceId=p.internalBinaryRead(e,e.uint32(),i,n.interfaceId);break;case 9:n.key=L.internalBinaryRead(e,e.uint32(),i,n.key);break;case 10:n.byKey=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.lfVersion!==""&&t.tag(1,c.LengthDelimited).string(e.lfVersion),e.contractId!==""&&t.tag(2,c.LengthDelimited).string(e.contractId),e.packageName!==""&&t.tag(3,c.LengthDelimited).string(e.packageName),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.signatories.length;n++)t.tag(5,c.LengthDelimited).string(e.signatories[n]);for(let n=0;n<e.stakeholders.length;n++)t.tag(6,c.LengthDelimited).string(e.stakeholders[n]);for(let n=0;n<e.actingParties.length;n++)t.tag(7,c.LengthDelimited).string(e.actingParties[n]);e.interfaceId&&p.internalBinaryWrite(e.interfaceId,t.tag(8,c.LengthDelimited).fork(),i).join(),e.key&&L.internalBinaryWrite(e.key,t.tag(9,c.LengthDelimited).fork(),i).join(),e.byKey!==!1&&t.tag(10,c.Varint).bool(e.byKey);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ke=new kn;var bn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.Exercise",[{no:1,name:"lf_version",kind:"scalar",T:9},{no:2,name:"contract_id",kind:"scalar",T:9},{no:3,name:"package_name",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"signatories",kind:"scalar",repeat:2,T:9},{no:6,name:"stakeholders",kind:"scalar",repeat:2,T:9},{no:7,name:"acting_parties",kind:"scalar",repeat:2,T:9},{no:8,name:"interface_id",kind:"message",T:()=>p},{no:9,name:"choice_id",kind:"scalar",T:9},{no:10,name:"chosen_value",kind:"message",T:()=>g},{no:11,name:"consuming",kind:"scalar",T:8},{no:12,name:"children",kind:"scalar",repeat:2,T:9},{no:13,name:"exercise_result",kind:"message",T:()=>g},{no:14,name:"choice_observers",kind:"scalar",repeat:2,T:9},{no:15,name:"key",kind:"message",T:()=>L},{no:16,name:"by_key",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lfVersion="",t.contractId="",t.packageName="",t.signatories=[],t.stakeholders=[],t.actingParties=[],t.choiceId="",t.consuming=!1,t.children=[],t.choiceObservers=[],t.byKey=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.lfVersion=e.string();break;case 2:n.contractId=e.string();break;case 3:n.packageName=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.signatories.push(e.string());break;case 6:n.stakeholders.push(e.string());break;case 7:n.actingParties.push(e.string());break;case 8:n.interfaceId=p.internalBinaryRead(e,e.uint32(),i,n.interfaceId);break;case 9:n.choiceId=e.string();break;case 10:n.chosenValue=g.internalBinaryRead(e,e.uint32(),i,n.chosenValue);break;case 11:n.consuming=e.bool();break;case 12:n.children.push(e.string());break;case 13:n.exerciseResult=g.internalBinaryRead(e,e.uint32(),i,n.exerciseResult);break;case 14:n.choiceObservers.push(e.string());break;case 15:n.key=L.internalBinaryRead(e,e.uint32(),i,n.key);break;case 16:n.byKey=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.lfVersion!==""&&t.tag(1,c.LengthDelimited).string(e.lfVersion),e.contractId!==""&&t.tag(2,c.LengthDelimited).string(e.contractId),e.packageName!==""&&t.tag(3,c.LengthDelimited).string(e.packageName),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.signatories.length;n++)t.tag(5,c.LengthDelimited).string(e.signatories[n]);for(let n=0;n<e.stakeholders.length;n++)t.tag(6,c.LengthDelimited).string(e.stakeholders[n]);for(let n=0;n<e.actingParties.length;n++)t.tag(7,c.LengthDelimited).string(e.actingParties[n]);e.interfaceId&&p.internalBinaryWrite(e.interfaceId,t.tag(8,c.LengthDelimited).fork(),i).join(),e.choiceId!==""&&t.tag(9,c.LengthDelimited).string(e.choiceId),e.chosenValue&&g.internalBinaryWrite(e.chosenValue,t.tag(10,c.LengthDelimited).fork(),i).join(),e.consuming!==!1&&t.tag(11,c.Varint).bool(e.consuming);for(let n=0;n<e.children.length;n++)t.tag(12,c.LengthDelimited).string(e.children[n]);e.exerciseResult&&g.internalBinaryWrite(e.exerciseResult,t.tag(13,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.choiceObservers.length;n++)t.tag(14,c.LengthDelimited).string(e.choiceObservers[n]);e.key&&L.internalBinaryWrite(e.key,t.tag(15,c.LengthDelimited).fork(),i).join(),e.byKey!==!1&&t.tag(16,c.Varint).bool(e.byKey);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const be=new bn;var Tn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.Create",[{no:1,name:"lf_version",kind:"scalar",T:9},{no:2,name:"contract_id",kind:"scalar",T:9},{no:3,name:"package_name",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"argument",kind:"message",T:()=>g},{no:6,name:"signatories",kind:"scalar",repeat:2,T:9},{no:7,name:"stakeholders",kind:"scalar",repeat:2,T:9},{no:8,name:"key",kind:"message",T:()=>L}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lfVersion="",t.contractId="",t.packageName="",t.signatories=[],t.stakeholders=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.lfVersion=e.string();break;case 2:n.contractId=e.string();break;case 3:n.packageName=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.argument=g.internalBinaryRead(e,e.uint32(),i,n.argument);break;case 6:n.signatories.push(e.string());break;case 7:n.stakeholders.push(e.string());break;case 8:n.key=L.internalBinaryRead(e,e.uint32(),i,n.key);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.lfVersion!==""&&t.tag(1,c.LengthDelimited).string(e.lfVersion),e.contractId!==""&&t.tag(2,c.LengthDelimited).string(e.contractId),e.packageName!==""&&t.tag(3,c.LengthDelimited).string(e.packageName),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join(),e.argument&&g.internalBinaryWrite(e.argument,t.tag(5,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.signatories.length;n++)t.tag(6,c.LengthDelimited).string(e.signatories[n]);for(let n=0;n<e.stakeholders.length;n++)t.tag(7,c.LengthDelimited).string(e.stakeholders[n]);e.key&&L.internalBinaryWrite(e.key,t.tag(8,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const S=new Tn;var wn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.Rollback",[{no:1,name:"children",kind:"scalar",repeat:2,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.children=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.children.push(e.string());break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.children.length;n++)t.tag(1,c.LengthDelimited).string(e.children[n]);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Te=new wn;var Nn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.QueryByKey",[{no:1,name:"lf_version",kind:"scalar",T:9},{no:2,name:"package_name",kind:"scalar",T:9},{no:3,name:"template_id",kind:"message",T:()=>p},{no:4,name:"exhaustive",kind:"scalar",T:8},{no:5,name:"key",kind:"message",T:()=>L},{no:6,name:"result",kind:"scalar",repeat:2,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.lfVersion="",t.packageName="",t.exhaustive=!1,t.result=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.lfVersion=e.string();break;case 2:n.packageName=e.string();break;case 3:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 4:n.exhaustive=e.bool();break;case 5:n.key=L.internalBinaryRead(e,e.uint32(),i,n.key);break;case 6:n.result.push(e.string());break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.lfVersion!==""&&t.tag(1,c.LengthDelimited).string(e.lfVersion),e.packageName!==""&&t.tag(2,c.LengthDelimited).string(e.packageName),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(3,c.LengthDelimited).fork(),i).join(),e.exhaustive!==!1&&t.tag(4,c.Varint).bool(e.exhaustive),e.key&&L.internalBinaryWrite(e.key,t.tag(5,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.result.length;n++)t.tag(6,c.LengthDelimited).string(e.result[n]);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const we=new Nn;var Bn=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.transaction.v1.Node",[{no:1,name:"create",kind:"message",oneof:"nodeType",T:()=>S},{no:2,name:"fetch",kind:"message",oneof:"nodeType",T:()=>ke},{no:3,name:"exercise",kind:"message",oneof:"nodeType",T:()=>be},{no:4,name:"rollback",kind:"message",oneof:"nodeType",T:()=>Te},{no:5,name:"query_by_key",kind:"message",oneof:"nodeType",T:()=>we}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.nodeType={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.nodeType={oneofKind:"create",create:S.internalBinaryRead(e,e.uint32(),i,n.nodeType.create)};break;case 2:n.nodeType={oneofKind:"fetch",fetch:ke.internalBinaryRead(e,e.uint32(),i,n.nodeType.fetch)};break;case 3:n.nodeType={oneofKind:"exercise",exercise:be.internalBinaryRead(e,e.uint32(),i,n.nodeType.exercise)};break;case 4:n.nodeType={oneofKind:"rollback",rollback:Te.internalBinaryRead(e,e.uint32(),i,n.nodeType.rollback)};break;case 5:n.nodeType={oneofKind:"queryByKey",queryByKey:we.internalBinaryRead(e,e.uint32(),i,n.nodeType.queryByKey)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.nodeType.oneofKind==="create"&&S.internalBinaryWrite(e.nodeType.create,t.tag(1,c.LengthDelimited).fork(),i).join(),e.nodeType.oneofKind==="fetch"&&ke.internalBinaryWrite(e.nodeType.fetch,t.tag(2,c.LengthDelimited).fork(),i).join(),e.nodeType.oneofKind==="exercise"&&be.internalBinaryWrite(e.nodeType.exercise,t.tag(3,c.LengthDelimited).fork(),i).join(),e.nodeType.oneofKind==="rollback"&&Te.internalBinaryWrite(e.nodeType.rollback,t.tag(4,c.LengthDelimited).fork(),i).join(),e.nodeType.oneofKind==="queryByKey"&&we.internalBinaryWrite(e.nodeType.queryByKey,t.tag(5,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ne=new Bn;var In=class extends m{constructor(){super("com.daml.ledger.api.v2.PackageReference",[{no:1,name:"package_id",kind:"scalar",T:9},{no:2,name:"package_name",kind:"scalar",T:9},{no:3,name:"package_version",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageId="",t.packageName="",t.packageVersion="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageId=e.string();break;case 2:n.packageName=e.string();break;case 3:n.packageVersion=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.packageId!==""&&t.tag(1,c.LengthDelimited).string(e.packageId),e.packageName!==""&&t.tag(2,c.LengthDelimited).string(e.packageName),e.packageVersion!==""&&t.tag(3,c.LengthDelimited).string(e.packageVersion);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const j=new In;var Rn=class extends m{constructor(){super("com.daml.ledger.api.v2.VettedPackage",[{no:1,name:"package_id",kind:"scalar",T:9},{no:2,name:"valid_from_inclusive",kind:"message",T:()=>k},{no:3,name:"valid_until_exclusive",kind:"message",T:()=>k},{no:4,name:"package_name",kind:"scalar",T:9},{no:5,name:"package_version",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageId="",t.packageName="",t.packageVersion="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageId=e.string();break;case 2:n.validFromInclusive=k.internalBinaryRead(e,e.uint32(),i,n.validFromInclusive);break;case 3:n.validUntilExclusive=k.internalBinaryRead(e,e.uint32(),i,n.validUntilExclusive);break;case 4:n.packageName=e.string();break;case 5:n.packageVersion=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.packageId!==""&&t.tag(1,c.LengthDelimited).string(e.packageId),e.validFromInclusive&&k.internalBinaryWrite(e.validFromInclusive,t.tag(2,c.LengthDelimited).fork(),i).join(),e.validUntilExclusive&&k.internalBinaryWrite(e.validUntilExclusive,t.tag(3,c.LengthDelimited).fork(),i).join(),e.packageName!==""&&t.tag(4,c.LengthDelimited).string(e.packageName),e.packageVersion!==""&&t.tag(5,c.LengthDelimited).string(e.packageVersion);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Be=new Rn;var vn=class extends m{constructor(){super("com.daml.ledger.api.v2.VettedPackages",[{no:1,name:"packages",kind:"message",repeat:2,T:()=>Be},{no:2,name:"participant_id",kind:"scalar",T:9},{no:3,name:"synchronizer_id",kind:"scalar",T:9},{no:4,name:"topology_serial",kind:"scalar",T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packages=[],t.participantId="",t.synchronizerId="",t.topologySerial=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packages.push(Be.internalBinaryRead(e,e.uint32(),i));break;case 2:n.participantId=e.string();break;case 3:n.synchronizerId=e.string();break;case 4:n.topologySerial=e.uint32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.packages.length;n++)Be.internalBinaryWrite(e.packages[n],t.tag(1,c.LengthDelimited).fork(),i).join();e.participantId!==""&&t.tag(2,c.LengthDelimited).string(e.participantId),e.synchronizerId!==""&&t.tag(3,c.LengthDelimited).string(e.synchronizerId),e.topologySerial!==0&&t.tag(4,c.Varint).uint32(e.topologySerial);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};new vn;var Dn=class extends m{constructor(){super("com.daml.ledger.api.v2.PriorTopologySerial",[{no:1,name:"prior",kind:"scalar",oneof:"serial",T:13},{no:2,name:"no_prior",kind:"message",oneof:"serial",T:()=>A}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.serial={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.serial={oneofKind:"prior",prior:e.uint32()};break;case 2:n.serial={oneofKind:"noPrior",noPrior:A.internalBinaryRead(e,e.uint32(),i,n.serial.noPrior)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.serial.oneofKind==="prior"&&t.tag(1,c.Varint).uint32(e.serial.prior),e.serial.oneofKind==="noPrior"&&A.internalBinaryWrite(e.serial.noPrior,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};new Dn;var En=class extends m{constructor(){super("com.daml.ledger.api.v2.TraceContext",[{no:1,name:"traceparent",kind:"scalar",opt:!0,T:9},{no:2,name:"tracestate",kind:"scalar",opt:!0,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.traceparent=e.string();break;case 2:n.tracestate=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.traceparent!==void 0&&t.tag(1,c.LengthDelimited).string(e.traceparent),e.tracestate!==void 0&&t.tag(2,c.LengthDelimited).string(e.tracestate);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ie=new En;var Ln=class extends m{constructor(){super("google.protobuf.Any",[{no:1,name:"type_url",kind:"scalar",T:9},{no:2,name:"value",kind:"scalar",T:12}])}pack(e,t){return{typeUrl:this.typeNameToUrl(t.typeName),value:t.toBinary(e)}}unpack(e,t,i){if(!this.contains(e,t))throw new Error("Cannot unpack google.protobuf.Any with typeUrl '"+e.typeUrl+"' as "+t.typeName+".");return t.fromBinary(e.value,i)}contains(e,t){return e.typeUrl.length?(typeof t=="string"?t:t.typeName)===this.typeUrlToName(e.typeUrl):!1}internalJsonWrite(e,t){if(e.typeUrl==="")return{};let i=this.typeUrlToName(e.typeUrl),a=wt(t),n=a.typeRegistry?.find(s=>s.typeName===i);if(!n)throw new globalThis.Error("Unable to convert google.protobuf.Any with typeUrl '"+e.typeUrl+"' to JSON. The specified type "+i+" is not available in the type registry.");let l=n.fromBinary(e.value,{readUnknownField:!1}),r=n.internalJsonWrite(l,a);return(i.startsWith("google.protobuf.")||!nt(r))&&(r={value:r}),r["@type"]=e.typeUrl,r}internalJsonRead(e,t,i){if(!nt(e))throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON "+X(e)+".");if(typeof e["@type"]!="string"||e["@type"]=="")return this.create();let a=this.typeUrlToName(e["@type"]),n=t?.typeRegistry?.find(r=>r.typeName==a);if(!n)throw new globalThis.Error("Unable to parse google.protobuf.Any from JSON. The specified type "+a+" is not available in the type registry.");let l;if(a.startsWith("google.protobuf.")&&e.hasOwnProperty("value"))l=n.fromJson(e.value,t);else{let r=Object.assign({},e);delete r["@type"],l=n.fromJson(r,t)}return i===void 0&&(i=this.create()),i.typeUrl=e["@type"],i.value=n.toBinary(l),i}typeNameToUrl(e){if(!e.length)throw new Error("invalid type name: "+e);return"type.googleapis.com/"+e}typeUrlToName(e){if(!e.length)throw new Error("invalid type url: "+e);let t=e.lastIndexOf("/"),i=t>0?e.substring(t+1):e;if(!i.length)throw new Error("invalid type url: "+e);return i}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.typeUrl="",t.value=new Uint8Array(0),e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.typeUrl=e.string();break;case 2:n.value=e.bytes();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.typeUrl!==""&&t.tag(1,c.LengthDelimited).string(e.typeUrl),e.value.length&&t.tag(2,c.LengthDelimited).bytes(e.value);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Re=new Ln;var _n=class extends m{constructor(){super("google.rpc.Status",[{no:1,name:"code",kind:"scalar",T:5},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"details",kind:"message",repeat:2,T:()=>Re}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.code=0,t.message="",t.details=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.code=e.int32();break;case 2:n.message=e.string();break;case 3:n.details.push(Re.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.code!==0&&t.tag(1,c.Varint).int32(e.code),e.message!==""&&t.tag(2,c.LengthDelimited).string(e.message);for(let n=0;n<e.details.length;n++)Re.internalBinaryWrite(e.details[n],t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ve=new _n;var Un=class extends m{constructor(){super("com.daml.ledger.api.v2.Event",[{no:1,name:"created",kind:"message",oneof:"event",T:()=>Ee},{no:2,name:"archived",kind:"message",oneof:"event",T:()=>_e},{no:3,name:"exercised",kind:"message",oneof:"event",T:()=>Ue}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.event={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.event={oneofKind:"created",created:Ee.internalBinaryRead(e,e.uint32(),i,n.event.created)};break;case 2:n.event={oneofKind:"archived",archived:_e.internalBinaryRead(e,e.uint32(),i,n.event.archived)};break;case 3:n.event={oneofKind:"exercised",exercised:Ue.internalBinaryRead(e,e.uint32(),i,n.event.exercised)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.event.oneofKind==="created"&&Ee.internalBinaryWrite(e.event.created,t.tag(1,c.LengthDelimited).fork(),i).join(),e.event.oneofKind==="archived"&&_e.internalBinaryWrite(e.event.archived,t.tag(2,c.LengthDelimited).fork(),i).join(),e.event.oneofKind==="exercised"&&Ue.internalBinaryWrite(e.event.exercised,t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const De=new Un;var Fn=class extends m{constructor(){super("com.daml.ledger.api.v2.CreatedEvent",[{no:1,name:"offset",kind:"scalar",T:3,L:0},{no:2,name:"node_id",kind:"scalar",T:5},{no:3,name:"contract_id",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"contract_key",kind:"message",T:()=>g},{no:16,name:"contract_key_hash",kind:"scalar",T:12},{no:6,name:"create_arguments",kind:"message",T:()=>v},{no:7,name:"created_event_blob",kind:"scalar",T:12},{no:8,name:"interface_views",kind:"message",repeat:2,T:()=>Le},{no:9,name:"witness_parties",kind:"scalar",repeat:2,T:9},{no:10,name:"signatories",kind:"scalar",repeat:2,T:9},{no:11,name:"observers",kind:"scalar",repeat:2,T:9},{no:12,name:"created_at",kind:"message",T:()=>k},{no:13,name:"package_name",kind:"scalar",T:9},{no:14,name:"acs_delta",kind:"scalar",T:8},{no:15,name:"representative_package_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.offset=0n,t.nodeId=0,t.contractId="",t.contractKeyHash=new Uint8Array(0),t.createdEventBlob=new Uint8Array(0),t.interfaceViews=[],t.witnessParties=[],t.signatories=[],t.observers=[],t.packageName="",t.acsDelta=!1,t.representativePackageId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.offset=e.int64().toBigInt();break;case 2:n.nodeId=e.int32();break;case 3:n.contractId=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.contractKey=g.internalBinaryRead(e,e.uint32(),i,n.contractKey);break;case 16:n.contractKeyHash=e.bytes();break;case 6:n.createArguments=v.internalBinaryRead(e,e.uint32(),i,n.createArguments);break;case 7:n.createdEventBlob=e.bytes();break;case 8:n.interfaceViews.push(Le.internalBinaryRead(e,e.uint32(),i));break;case 9:n.witnessParties.push(e.string());break;case 10:n.signatories.push(e.string());break;case 11:n.observers.push(e.string());break;case 12:n.createdAt=k.internalBinaryRead(e,e.uint32(),i,n.createdAt);break;case 13:n.packageName=e.string();break;case 14:n.acsDelta=e.bool();break;case 15:n.representativePackageId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.offset!==0n&&t.tag(1,c.Varint).int64(e.offset),e.nodeId!==0&&t.tag(2,c.Varint).int32(e.nodeId),e.contractId!==""&&t.tag(3,c.LengthDelimited).string(e.contractId),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join(),e.contractKey&&g.internalBinaryWrite(e.contractKey,t.tag(5,c.LengthDelimited).fork(),i).join(),e.createArguments&&v.internalBinaryWrite(e.createArguments,t.tag(6,c.LengthDelimited).fork(),i).join(),e.createdEventBlob.length&&t.tag(7,c.LengthDelimited).bytes(e.createdEventBlob);for(let n=0;n<e.interfaceViews.length;n++)Le.internalBinaryWrite(e.interfaceViews[n],t.tag(8,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.witnessParties.length;n++)t.tag(9,c.LengthDelimited).string(e.witnessParties[n]);for(let n=0;n<e.signatories.length;n++)t.tag(10,c.LengthDelimited).string(e.signatories[n]);for(let n=0;n<e.observers.length;n++)t.tag(11,c.LengthDelimited).string(e.observers[n]);e.createdAt&&k.internalBinaryWrite(e.createdAt,t.tag(12,c.LengthDelimited).fork(),i).join(),e.packageName!==""&&t.tag(13,c.LengthDelimited).string(e.packageName),e.acsDelta!==!1&&t.tag(14,c.Varint).bool(e.acsDelta),e.representativePackageId!==""&&t.tag(15,c.LengthDelimited).string(e.representativePackageId),e.contractKeyHash.length&&t.tag(16,c.LengthDelimited).bytes(e.contractKeyHash);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ee=new Fn;var $n=class extends m{constructor(){super("com.daml.ledger.api.v2.InterfaceView",[{no:1,name:"interface_id",kind:"message",T:()=>p},{no:2,name:"view_status",kind:"message",T:()=>ve},{no:3,name:"view_value",kind:"message",T:()=>v},{no:4,name:"implementation_package_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.implementationPackageId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.interfaceId=p.internalBinaryRead(e,e.uint32(),i,n.interfaceId);break;case 2:n.viewStatus=ve.internalBinaryRead(e,e.uint32(),i,n.viewStatus);break;case 3:n.viewValue=v.internalBinaryRead(e,e.uint32(),i,n.viewValue);break;case 4:n.implementationPackageId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.interfaceId&&p.internalBinaryWrite(e.interfaceId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.viewStatus&&ve.internalBinaryWrite(e.viewStatus,t.tag(2,c.LengthDelimited).fork(),i).join(),e.viewValue&&v.internalBinaryWrite(e.viewValue,t.tag(3,c.LengthDelimited).fork(),i).join(),e.implementationPackageId!==""&&t.tag(4,c.LengthDelimited).string(e.implementationPackageId);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Le=new $n;var Wn=class extends m{constructor(){super("com.daml.ledger.api.v2.ArchivedEvent",[{no:1,name:"offset",kind:"scalar",T:3,L:0},{no:2,name:"node_id",kind:"scalar",T:5},{no:3,name:"contract_id",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"witness_parties",kind:"scalar",repeat:2,T:9},{no:6,name:"package_name",kind:"scalar",T:9},{no:7,name:"implemented_interfaces",kind:"message",repeat:2,T:()=>p}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.offset=0n,t.nodeId=0,t.contractId="",t.witnessParties=[],t.packageName="",t.implementedInterfaces=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.offset=e.int64().toBigInt();break;case 2:n.nodeId=e.int32();break;case 3:n.contractId=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.witnessParties.push(e.string());break;case 6:n.packageName=e.string();break;case 7:n.implementedInterfaces.push(p.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.offset!==0n&&t.tag(1,c.Varint).int64(e.offset),e.nodeId!==0&&t.tag(2,c.Varint).int32(e.nodeId),e.contractId!==""&&t.tag(3,c.LengthDelimited).string(e.contractId),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.witnessParties.length;n++)t.tag(5,c.LengthDelimited).string(e.witnessParties[n]);e.packageName!==""&&t.tag(6,c.LengthDelimited).string(e.packageName);for(let n=0;n<e.implementedInterfaces.length;n++)p.internalBinaryWrite(e.implementedInterfaces[n],t.tag(7,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const _e=new Wn;var xn=class extends m{constructor(){super("com.daml.ledger.api.v2.ExercisedEvent",[{no:1,name:"offset",kind:"scalar",T:3,L:0},{no:2,name:"node_id",kind:"scalar",T:5},{no:3,name:"contract_id",kind:"scalar",T:9},{no:4,name:"template_id",kind:"message",T:()=>p},{no:5,name:"interface_id",kind:"message",T:()=>p},{no:6,name:"choice",kind:"scalar",T:9},{no:7,name:"choice_argument",kind:"message",T:()=>g},{no:8,name:"acting_parties",kind:"scalar",repeat:2,T:9},{no:9,name:"consuming",kind:"scalar",T:8},{no:10,name:"witness_parties",kind:"scalar",repeat:2,T:9},{no:11,name:"last_descendant_node_id",kind:"scalar",T:5},{no:12,name:"exercise_result",kind:"message",T:()=>g},{no:13,name:"package_name",kind:"scalar",T:9},{no:14,name:"implemented_interfaces",kind:"message",repeat:2,T:()=>p},{no:15,name:"acs_delta",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.offset=0n,t.nodeId=0,t.contractId="",t.choice="",t.actingParties=[],t.consuming=!1,t.witnessParties=[],t.lastDescendantNodeId=0,t.packageName="",t.implementedInterfaces=[],t.acsDelta=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.offset=e.int64().toBigInt();break;case 2:n.nodeId=e.int32();break;case 3:n.contractId=e.string();break;case 4:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 5:n.interfaceId=p.internalBinaryRead(e,e.uint32(),i,n.interfaceId);break;case 6:n.choice=e.string();break;case 7:n.choiceArgument=g.internalBinaryRead(e,e.uint32(),i,n.choiceArgument);break;case 8:n.actingParties.push(e.string());break;case 9:n.consuming=e.bool();break;case 10:n.witnessParties.push(e.string());break;case 11:n.lastDescendantNodeId=e.int32();break;case 12:n.exerciseResult=g.internalBinaryRead(e,e.uint32(),i,n.exerciseResult);break;case 13:n.packageName=e.string();break;case 14:n.implementedInterfaces.push(p.internalBinaryRead(e,e.uint32(),i));break;case 15:n.acsDelta=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.offset!==0n&&t.tag(1,c.Varint).int64(e.offset),e.nodeId!==0&&t.tag(2,c.Varint).int32(e.nodeId),e.contractId!==""&&t.tag(3,c.LengthDelimited).string(e.contractId),e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(4,c.LengthDelimited).fork(),i).join(),e.interfaceId&&p.internalBinaryWrite(e.interfaceId,t.tag(5,c.LengthDelimited).fork(),i).join(),e.choice!==""&&t.tag(6,c.LengthDelimited).string(e.choice),e.choiceArgument&&g.internalBinaryWrite(e.choiceArgument,t.tag(7,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.actingParties.length;n++)t.tag(8,c.LengthDelimited).string(e.actingParties[n]);e.consuming!==!1&&t.tag(9,c.Varint).bool(e.consuming);for(let n=0;n<e.witnessParties.length;n++)t.tag(10,c.LengthDelimited).string(e.witnessParties[n]);e.lastDescendantNodeId!==0&&t.tag(11,c.Varint).int32(e.lastDescendantNodeId),e.exerciseResult&&g.internalBinaryWrite(e.exerciseResult,t.tag(12,c.LengthDelimited).fork(),i).join(),e.packageName!==""&&t.tag(13,c.LengthDelimited).string(e.packageName);for(let n=0;n<e.implementedInterfaces.length;n++)p.internalBinaryWrite(e.implementedInterfaces[n],t.tag(14,c.LengthDelimited).fork(),i).join();e.acsDelta!==!1&&t.tag(15,c.Varint).bool(e.acsDelta);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ue=new xn;var Pn=class extends m{constructor(){super("com.daml.ledger.api.v2.Transaction",[{no:1,name:"update_id",kind:"scalar",T:9},{no:2,name:"command_id",kind:"scalar",T:9},{no:3,name:"workflow_id",kind:"scalar",T:9},{no:4,name:"effective_at",kind:"message",T:()=>k},{no:5,name:"events",kind:"message",repeat:2,T:()=>De},{no:6,name:"offset",kind:"scalar",T:3,L:0},{no:7,name:"synchronizer_id",kind:"scalar",T:9},{no:8,name:"trace_context",kind:"message",T:()=>Ie},{no:9,name:"record_time",kind:"message",T:()=>k},{no:10,name:"external_transaction_hash",kind:"scalar",opt:!0,T:12},{no:11,name:"paid_traffic_cost",kind:"scalar",opt:!0,T:3,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.updateId="",t.commandId="",t.workflowId="",t.events=[],t.offset=0n,t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.updateId=e.string();break;case 2:n.commandId=e.string();break;case 3:n.workflowId=e.string();break;case 4:n.effectiveAt=k.internalBinaryRead(e,e.uint32(),i,n.effectiveAt);break;case 5:n.events.push(De.internalBinaryRead(e,e.uint32(),i));break;case 6:n.offset=e.int64().toBigInt();break;case 7:n.synchronizerId=e.string();break;case 8:n.traceContext=Ie.internalBinaryRead(e,e.uint32(),i,n.traceContext);break;case 9:n.recordTime=k.internalBinaryRead(e,e.uint32(),i,n.recordTime);break;case 10:n.externalTransactionHash=e.bytes();break;case 11:n.paidTrafficCost=e.int64().toBigInt();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.updateId!==""&&t.tag(1,c.LengthDelimited).string(e.updateId),e.commandId!==""&&t.tag(2,c.LengthDelimited).string(e.commandId),e.workflowId!==""&&t.tag(3,c.LengthDelimited).string(e.workflowId),e.effectiveAt&&k.internalBinaryWrite(e.effectiveAt,t.tag(4,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.events.length;n++)De.internalBinaryWrite(e.events[n],t.tag(5,c.LengthDelimited).fork(),i).join();e.offset!==0n&&t.tag(6,c.Varint).int64(e.offset),e.synchronizerId!==""&&t.tag(7,c.LengthDelimited).string(e.synchronizerId),e.traceContext&&Ie.internalBinaryWrite(e.traceContext,t.tag(8,c.LengthDelimited).fork(),i).join(),e.recordTime&&k.internalBinaryWrite(e.recordTime,t.tag(9,c.LengthDelimited).fork(),i).join(),e.externalTransactionHash!==void 0&&t.tag(10,c.LengthDelimited).bytes(e.externalTransactionHash),e.paidTrafficCost!==void 0&&t.tag(11,c.Varint).int64(e.paidTrafficCost);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Fe=new Pn;let On=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ACS_DELTA=1]="ACS_DELTA",e[e.LEDGER_EFFECTS=2]="LEDGER_EFFECTS",e})({});var An=class extends m{constructor(){super("com.daml.ledger.api.v2.Filters",[{no:1,name:"cumulative",kind:"message",repeat:2,T:()=>$e}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.cumulative=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.cumulative.push($e.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.cumulative.length;n++)$e.internalBinaryWrite(e.cumulative[n],t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const P=new An;var Vn=class extends m{constructor(){super("com.daml.ledger.api.v2.CumulativeFilter",[{no:1,name:"wildcard_filter",kind:"message",oneof:"identifierFilter",T:()=>We},{no:2,name:"interface_filter",kind:"message",oneof:"identifierFilter",T:()=>xe},{no:3,name:"template_filter",kind:"message",oneof:"identifierFilter",T:()=>Pe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.identifierFilter={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.identifierFilter={oneofKind:"wildcardFilter",wildcardFilter:We.internalBinaryRead(e,e.uint32(),i,n.identifierFilter.wildcardFilter)};break;case 2:n.identifierFilter={oneofKind:"interfaceFilter",interfaceFilter:xe.internalBinaryRead(e,e.uint32(),i,n.identifierFilter.interfaceFilter)};break;case 3:n.identifierFilter={oneofKind:"templateFilter",templateFilter:Pe.internalBinaryRead(e,e.uint32(),i,n.identifierFilter.templateFilter)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.identifierFilter.oneofKind==="wildcardFilter"&&We.internalBinaryWrite(e.identifierFilter.wildcardFilter,t.tag(1,c.LengthDelimited).fork(),i).join(),e.identifierFilter.oneofKind==="interfaceFilter"&&xe.internalBinaryWrite(e.identifierFilter.interfaceFilter,t.tag(2,c.LengthDelimited).fork(),i).join(),e.identifierFilter.oneofKind==="templateFilter"&&Pe.internalBinaryWrite(e.identifierFilter.templateFilter,t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const $e=new Vn;var Sn=class extends m{constructor(){super("com.daml.ledger.api.v2.WildcardFilter",[{no:1,name:"include_created_event_blob",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.includeCreatedEventBlob=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.includeCreatedEventBlob=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.includeCreatedEventBlob!==!1&&t.tag(1,c.Varint).bool(e.includeCreatedEventBlob);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const We=new Sn;var jn=class extends m{constructor(){super("com.daml.ledger.api.v2.InterfaceFilter",[{no:1,name:"interface_id",kind:"message",T:()=>p},{no:2,name:"include_interface_view",kind:"scalar",T:8},{no:3,name:"include_created_event_blob",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.includeInterfaceView=!1,t.includeCreatedEventBlob=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.interfaceId=p.internalBinaryRead(e,e.uint32(),i,n.interfaceId);break;case 2:n.includeInterfaceView=e.bool();break;case 3:n.includeCreatedEventBlob=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.interfaceId&&p.internalBinaryWrite(e.interfaceId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.includeInterfaceView!==!1&&t.tag(2,c.Varint).bool(e.includeInterfaceView),e.includeCreatedEventBlob!==!1&&t.tag(3,c.Varint).bool(e.includeCreatedEventBlob);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const xe=new jn;var Kn=class extends m{constructor(){super("com.daml.ledger.api.v2.TemplateFilter",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"include_created_event_blob",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.includeCreatedEventBlob=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.includeCreatedEventBlob=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.includeCreatedEventBlob!==!1&&t.tag(2,c.Varint).bool(e.includeCreatedEventBlob);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Pe=new Kn;var Cn=class extends m{constructor(){super("com.daml.ledger.api.v2.EventFormat",[{no:1,name:"filters_by_party",kind:"map",K:9,V:{kind:"message",T:()=>P}},{no:2,name:"filters_for_any_party",kind:"message",T:()=>P},{no:3,name:"verbose",kind:"scalar",T:8}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.filtersByParty={},t.verbose=!1,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:this.binaryReadMap1(n.filtersByParty,e,i);break;case 2:n.filtersForAnyParty=P.internalBinaryRead(e,e.uint32(),i,n.filtersForAnyParty);break;case 3:n.verbose=e.bool();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}binaryReadMap1(e,t,i){let a=t.uint32(),n=t.pos+a,l,r;for(;t.pos<n;){let[s,o]=t.tag();switch(s){case 1:l=t.string();break;case 2:r=P.internalBinaryRead(t,t.uint32(),i);break;default:throw new globalThis.Error("unknown map entry field for com.daml.ledger.api.v2.EventFormat.filters_by_party")}}e[l??""]=r??P.create()}internalBinaryWrite(e,t,i){for(let n of globalThis.Object.keys(e.filtersByParty))t.tag(1,c.LengthDelimited).fork().tag(1,c.LengthDelimited).string(n),t.tag(2,c.LengthDelimited).fork(),P.internalBinaryWrite(e.filtersByParty[n],t,i),t.join().join();e.filtersForAnyParty&&P.internalBinaryWrite(e.filtersForAnyParty,t.tag(2,c.LengthDelimited).fork(),i).join(),e.verbose!==!1&&t.tag(3,c.Varint).bool(e.verbose);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const K=new Cn;var Mn=class extends m{constructor(){super("com.daml.ledger.api.v2.TransactionFormat",[{no:1,name:"event_format",kind:"message",T:()=>K},{no:2,name:"transaction_shape",kind:"enum",T:()=>["com.daml.ledger.api.v2.TransactionShape",On,"TRANSACTION_SHAPE_"]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.transactionShape=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.eventFormat=K.internalBinaryRead(e,e.uint32(),i,n.eventFormat);break;case 2:n.transactionShape=e.int32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.eventFormat&&K.internalBinaryWrite(e.eventFormat,t.tag(1,c.LengthDelimited).fork(),i).join(),e.transactionShape!==0&&t.tag(2,c.Varint).int32(e.transactionShape);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const C=new Mn;var Gn=class extends m{constructor(){super("com.daml.ledger.api.v2.TopologyFormat",[{no:1,name:"include_participant_authorization_events",kind:"message",T:()=>Ae}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.includeParticipantAuthorizationEvents=Ae.internalBinaryRead(e,e.uint32(),i,n.includeParticipantAuthorizationEvents);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.includeParticipantAuthorizationEvents&&Ae.internalBinaryWrite(e.includeParticipantAuthorizationEvents,t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Oe=new Gn;var zn=class extends m{constructor(){super("com.daml.ledger.api.v2.ParticipantAuthorizationTopologyFormat",[{no:1,name:"parties",kind:"scalar",repeat:2,T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.parties=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.parties.push(e.string());break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.parties.length;n++)t.tag(1,c.LengthDelimited).string(e.parties[n]);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ae=new zn;var Jn=class extends m{constructor(){super("com.daml.ledger.api.v2.UpdateFormat",[{no:1,name:"include_transactions",kind:"message",T:()=>C},{no:2,name:"include_reassignments",kind:"message",T:()=>K},{no:3,name:"include_topology_events",kind:"message",T:()=>Oe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.includeTransactions=C.internalBinaryRead(e,e.uint32(),i,n.includeTransactions);break;case 2:n.includeReassignments=K.internalBinaryRead(e,e.uint32(),i,n.includeReassignments);break;case 3:n.includeTopologyEvents=Oe.internalBinaryRead(e,e.uint32(),i,n.includeTopologyEvents);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.includeTransactions&&C.internalBinaryWrite(e.includeTransactions,t.tag(1,c.LengthDelimited).fork(),i).join(),e.includeReassignments&&K.internalBinaryWrite(e.includeReassignments,t.tag(2,c.LengthDelimited).fork(),i).join(),e.includeTopologyEvents&&Oe.internalBinaryWrite(e.includeTopologyEvents,t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};new Jn;let qn=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.EC_CURVE25519=1]="EC_CURVE25519",e[e.EC_P256=2]="EC_P256",e[e.EC_P384=3]="EC_P384",e[e.EC_SECP256K1=4]="EC_SECP256K1",e})({}),Xn=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.DER=1]="DER",e[e.RAW=2]="RAW",e[e.DER_X509_SUBJECT_PUBLIC_KEY_INFO=3]="DER_X509_SUBJECT_PUBLIC_KEY_INFO",e})({}),Rt=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ED25519=1]="ED25519",e[e.EC_DSA_SHA_256=2]="EC_DSA_SHA_256",e[e.EC_DSA_SHA_384=3]="EC_DSA_SHA_384",e})({}),Zn=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.RAW=1]="RAW",e[e.DER=2]="DER",e[e.CONCAT=3]="CONCAT",e[e.SYMBOLIC=1e4]="SYMBOLIC",e})({});var Hn=class extends m{constructor(){super("com.daml.ledger.api.v2.SigningPublicKey",[{no:1,name:"format",kind:"enum",T:()=>["com.daml.ledger.api.v2.CryptoKeyFormat",Xn,"CRYPTO_KEY_FORMAT_"]},{no:2,name:"key_data",kind:"scalar",T:12},{no:3,name:"key_spec",kind:"enum",T:()=>["com.daml.ledger.api.v2.SigningKeySpec",qn,"SIGNING_KEY_SPEC_"]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.format=0,t.keyData=new Uint8Array(0),t.keySpec=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.format=e.int32();break;case 2:n.keyData=e.bytes();break;case 3:n.keySpec=e.int32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.format!==0&&t.tag(1,c.Varint).int32(e.format),e.keyData.length&&t.tag(2,c.LengthDelimited).bytes(e.keyData),e.keySpec!==0&&t.tag(3,c.Varint).int32(e.keySpec);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};new Hn;var Yn=class extends m{constructor(){super("com.daml.ledger.api.v2.Signature",[{no:1,name:"format",kind:"enum",T:()=>["com.daml.ledger.api.v2.SignatureFormat",Zn,"SIGNATURE_FORMAT_"]},{no:2,name:"signature",kind:"scalar",T:12},{no:3,name:"signed_by",kind:"scalar",T:9},{no:4,name:"signing_algorithm_spec",kind:"enum",T:()=>["com.daml.ledger.api.v2.SigningAlgorithmSpec",Rt,"SIGNING_ALGORITHM_SPEC_"]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.format=0,t.signature=new Uint8Array(0),t.signedBy="",t.signingAlgorithmSpec=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.format=e.int32();break;case 2:n.signature=e.bytes();break;case 3:n.signedBy=e.string();break;case 4:n.signingAlgorithmSpec=e.int32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.format!==0&&t.tag(1,c.Varint).int32(e.format),e.signature.length&&t.tag(2,c.LengthDelimited).bytes(e.signature),e.signedBy!==""&&t.tag(3,c.LengthDelimited).string(e.signedBy),e.signingAlgorithmSpec!==0&&t.tag(4,c.Varint).int32(e.signingAlgorithmSpec);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ve=new Yn;var Qn=class extends m{constructor(){super("com.daml.ledger.api.v2.Command",[{no:1,name:"create",kind:"message",oneof:"command",T:()=>Se},{no:2,name:"exercise",kind:"message",oneof:"command",T:()=>je},{no:4,name:"exercise_by_key",kind:"message",oneof:"command",T:()=>Ke},{no:3,name:"create_and_exercise",kind:"message",oneof:"command",T:()=>Ce}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.command={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.command={oneofKind:"create",create:Se.internalBinaryRead(e,e.uint32(),i,n.command.create)};break;case 2:n.command={oneofKind:"exercise",exercise:je.internalBinaryRead(e,e.uint32(),i,n.command.exercise)};break;case 4:n.command={oneofKind:"exerciseByKey",exerciseByKey:Ke.internalBinaryRead(e,e.uint32(),i,n.command.exerciseByKey)};break;case 3:n.command={oneofKind:"createAndExercise",createAndExercise:Ce.internalBinaryRead(e,e.uint32(),i,n.command.createAndExercise)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.command.oneofKind==="create"&&Se.internalBinaryWrite(e.command.create,t.tag(1,c.LengthDelimited).fork(),i).join(),e.command.oneofKind==="exercise"&&je.internalBinaryWrite(e.command.exercise,t.tag(2,c.LengthDelimited).fork(),i).join(),e.command.oneofKind==="createAndExercise"&&Ce.internalBinaryWrite(e.command.createAndExercise,t.tag(3,c.LengthDelimited).fork(),i).join(),e.command.oneofKind==="exerciseByKey"&&Ke.internalBinaryWrite(e.command.exerciseByKey,t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const M=new Qn;var ei=class extends m{constructor(){super("com.daml.ledger.api.v2.CreateCommand",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"create_arguments",kind:"message",T:()=>v}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.createArguments=v.internalBinaryRead(e,e.uint32(),i,n.createArguments);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.createArguments&&v.internalBinaryWrite(e.createArguments,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Se=new ei;var ti=class extends m{constructor(){super("com.daml.ledger.api.v2.ExerciseCommand",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"contract_id",kind:"scalar",T:9},{no:3,name:"choice",kind:"scalar",T:9},{no:4,name:"choice_argument",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.contractId="",t.choice="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.contractId=e.string();break;case 3:n.choice=e.string();break;case 4:n.choiceArgument=g.internalBinaryRead(e,e.uint32(),i,n.choiceArgument);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.contractId!==""&&t.tag(2,c.LengthDelimited).string(e.contractId),e.choice!==""&&t.tag(3,c.LengthDelimited).string(e.choice),e.choiceArgument&&g.internalBinaryWrite(e.choiceArgument,t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const je=new ti;var ni=class extends m{constructor(){super("com.daml.ledger.api.v2.ExerciseByKeyCommand",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"contract_key",kind:"message",T:()=>g},{no:3,name:"choice",kind:"scalar",T:9},{no:4,name:"choice_argument",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.choice="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.contractKey=g.internalBinaryRead(e,e.uint32(),i,n.contractKey);break;case 3:n.choice=e.string();break;case 4:n.choiceArgument=g.internalBinaryRead(e,e.uint32(),i,n.choiceArgument);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.contractKey&&g.internalBinaryWrite(e.contractKey,t.tag(2,c.LengthDelimited).fork(),i).join(),e.choice!==""&&t.tag(3,c.LengthDelimited).string(e.choice),e.choiceArgument&&g.internalBinaryWrite(e.choiceArgument,t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ke=new ni;var ii=class extends m{constructor(){super("com.daml.ledger.api.v2.CreateAndExerciseCommand",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"create_arguments",kind:"message",T:()=>v},{no:3,name:"choice",kind:"scalar",T:9},{no:4,name:"choice_argument",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.choice="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.createArguments=v.internalBinaryRead(e,e.uint32(),i,n.createArguments);break;case 3:n.choice=e.string();break;case 4:n.choiceArgument=g.internalBinaryRead(e,e.uint32(),i,n.choiceArgument);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.createArguments&&v.internalBinaryWrite(e.createArguments,t.tag(2,c.LengthDelimited).fork(),i).join(),e.choice!==""&&t.tag(3,c.LengthDelimited).string(e.choice),e.choiceArgument&&g.internalBinaryWrite(e.choiceArgument,t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ce=new ii;var ai=class extends m{constructor(){super("com.daml.ledger.api.v2.DisclosedContract",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"contract_id",kind:"scalar",T:9},{no:3,name:"created_event_blob",kind:"scalar",T:12},{no:4,name:"synchronizer_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.contractId="",t.createdEventBlob=new Uint8Array(0),t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.contractId=e.string();break;case 3:n.createdEventBlob=e.bytes();break;case 4:n.synchronizerId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.contractId!==""&&t.tag(2,c.LengthDelimited).string(e.contractId),e.createdEventBlob.length&&t.tag(3,c.LengthDelimited).bytes(e.createdEventBlob),e.synchronizerId!==""&&t.tag(4,c.LengthDelimited).string(e.synchronizerId);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const G=new ai;var ri=class extends m{constructor(){super("com.daml.ledger.api.v2.Commands",[{no:1,name:"workflow_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"command_id",kind:"scalar",T:9},{no:4,name:"commands",kind:"message",repeat:2,T:()=>M},{no:5,name:"deduplication_duration",kind:"message",oneof:"deduplicationPeriod",T:()=>I},{no:6,name:"deduplication_offset",kind:"scalar",oneof:"deduplicationPeriod",T:3,L:0},{no:7,name:"min_ledger_time_abs",kind:"message",T:()=>k},{no:8,name:"min_ledger_time_rel",kind:"message",T:()=>I},{no:9,name:"act_as",kind:"scalar",repeat:2,T:9},{no:10,name:"read_as",kind:"scalar",repeat:2,T:9},{no:11,name:"submission_id",kind:"scalar",T:9},{no:12,name:"disclosed_contracts",kind:"message",repeat:2,T:()=>G},{no:13,name:"synchronizer_id",kind:"scalar",T:9},{no:14,name:"package_id_selection_preference",kind:"scalar",repeat:2,T:9},{no:15,name:"prefetch_contract_keys",kind:"message",repeat:2,T:()=>z},{no:16,name:"taps_max_passes",kind:"scalar",opt:!0,T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.workflowId="",t.userId="",t.commandId="",t.commands=[],t.deduplicationPeriod={oneofKind:void 0},t.actAs=[],t.readAs=[],t.submissionId="",t.disclosedContracts=[],t.synchronizerId="",t.packageIdSelectionPreference=[],t.prefetchContractKeys=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.workflowId=e.string();break;case 2:n.userId=e.string();break;case 3:n.commandId=e.string();break;case 4:n.commands.push(M.internalBinaryRead(e,e.uint32(),i));break;case 5:n.deduplicationPeriod={oneofKind:"deduplicationDuration",deduplicationDuration:I.internalBinaryRead(e,e.uint32(),i,n.deduplicationPeriod.deduplicationDuration)};break;case 6:n.deduplicationPeriod={oneofKind:"deduplicationOffset",deduplicationOffset:e.int64().toBigInt()};break;case 7:n.minLedgerTimeAbs=k.internalBinaryRead(e,e.uint32(),i,n.minLedgerTimeAbs);break;case 8:n.minLedgerTimeRel=I.internalBinaryRead(e,e.uint32(),i,n.minLedgerTimeRel);break;case 9:n.actAs.push(e.string());break;case 10:n.readAs.push(e.string());break;case 11:n.submissionId=e.string();break;case 12:n.disclosedContracts.push(G.internalBinaryRead(e,e.uint32(),i));break;case 13:n.synchronizerId=e.string();break;case 14:n.packageIdSelectionPreference.push(e.string());break;case 15:n.prefetchContractKeys.push(z.internalBinaryRead(e,e.uint32(),i));break;case 16:n.tapsMaxPasses=e.uint32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.workflowId!==""&&t.tag(1,c.LengthDelimited).string(e.workflowId),e.userId!==""&&t.tag(2,c.LengthDelimited).string(e.userId),e.commandId!==""&&t.tag(3,c.LengthDelimited).string(e.commandId);for(let n=0;n<e.commands.length;n++)M.internalBinaryWrite(e.commands[n],t.tag(4,c.LengthDelimited).fork(),i).join();e.deduplicationPeriod.oneofKind==="deduplicationDuration"&&I.internalBinaryWrite(e.deduplicationPeriod.deduplicationDuration,t.tag(5,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationOffset"&&t.tag(6,c.Varint).int64(e.deduplicationPeriod.deduplicationOffset),e.minLedgerTimeAbs&&k.internalBinaryWrite(e.minLedgerTimeAbs,t.tag(7,c.LengthDelimited).fork(),i).join(),e.minLedgerTimeRel&&I.internalBinaryWrite(e.minLedgerTimeRel,t.tag(8,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.actAs.length;n++)t.tag(9,c.LengthDelimited).string(e.actAs[n]);for(let n=0;n<e.readAs.length;n++)t.tag(10,c.LengthDelimited).string(e.readAs[n]);e.submissionId!==""&&t.tag(11,c.LengthDelimited).string(e.submissionId);for(let n=0;n<e.disclosedContracts.length;n++)G.internalBinaryWrite(e.disclosedContracts[n],t.tag(12,c.LengthDelimited).fork(),i).join();e.synchronizerId!==""&&t.tag(13,c.LengthDelimited).string(e.synchronizerId);for(let n=0;n<e.packageIdSelectionPreference.length;n++)t.tag(14,c.LengthDelimited).string(e.packageIdSelectionPreference[n]);for(let n=0;n<e.prefetchContractKeys.length;n++)z.internalBinaryWrite(e.prefetchContractKeys[n],t.tag(15,c.LengthDelimited).fork(),i).join();e.tapsMaxPasses!==void 0&&t.tag(16,c.Varint).uint32(e.tapsMaxPasses);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};new ri;var oi=class extends m{constructor(){super("com.daml.ledger.api.v2.PrefetchContractKey",[{no:1,name:"template_id",kind:"message",T:()=>p},{no:2,name:"contract_key",kind:"message",T:()=>g},{no:3,name:"limit",kind:"scalar",opt:!0,T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.templateId=p.internalBinaryRead(e,e.uint32(),i,n.templateId);break;case 2:n.contractKey=g.internalBinaryRead(e,e.uint32(),i,n.contractKey);break;case 3:n.limit=e.uint32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.templateId&&p.internalBinaryWrite(e.templateId,t.tag(1,c.LengthDelimited).fork(),i).join(),e.contractKey&&g.internalBinaryWrite(e.contractKey,t.tag(2,c.LengthDelimited).fork(),i).join(),e.limit!==void 0&&t.tag(3,c.Varint).uint32(e.limit);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const z=new oi;let J=(function(e){return e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.V2=2]="V2",e[e.V3=3]="V3",e})({});var si=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.CostEstimationHints",[{no:1,name:"disabled",kind:"scalar",T:8},{no:2,name:"expected_signatures",kind:"enum",repeat:1,T:()=>["com.daml.ledger.api.v2.SigningAlgorithmSpec",Rt,"SIGNING_ALGORITHM_SPEC_"]}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.disabled=!1,t.expectedSignatures=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.disabled=e.bool();break;case 2:if(s===c.LengthDelimited)for(let y=e.int32()+e.pos;e.pos<y;)n.expectedSignatures.push(e.int32());else n.expectedSignatures.push(e.int32());break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){if(e.disabled!==!1&&t.tag(1,c.Varint).bool(e.disabled),e.expectedSignatures.length){t.tag(2,c.LengthDelimited).fork();for(let n=0;n<e.expectedSignatures.length;n++)t.int32(e.expectedSignatures[n]);t.join()}let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Me=new si;var li=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.CostEstimation",[{no:1,name:"estimation_timestamp",kind:"message",T:()=>k},{no:2,name:"confirmation_request_traffic_cost_estimation",kind:"scalar",T:4,L:0},{no:3,name:"confirmation_response_traffic_cost_estimation",kind:"scalar",T:4,L:0},{no:4,name:"total_traffic_cost_estimation",kind:"scalar",T:4,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.confirmationRequestTrafficCostEstimation=0n,t.confirmationResponseTrafficCostEstimation=0n,t.totalTrafficCostEstimation=0n,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.estimationTimestamp=k.internalBinaryRead(e,e.uint32(),i,n.estimationTimestamp);break;case 2:n.confirmationRequestTrafficCostEstimation=e.uint64().toBigInt();break;case 3:n.confirmationResponseTrafficCostEstimation=e.uint64().toBigInt();break;case 4:n.totalTrafficCostEstimation=e.uint64().toBigInt();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.estimationTimestamp&&k.internalBinaryWrite(e.estimationTimestamp,t.tag(1,c.LengthDelimited).fork(),i).join(),e.confirmationRequestTrafficCostEstimation!==0n&&t.tag(2,c.Varint).uint64(e.confirmationRequestTrafficCostEstimation),e.confirmationResponseTrafficCostEstimation!==0n&&t.tag(3,c.Varint).uint64(e.confirmationResponseTrafficCostEstimation),e.totalTrafficCostEstimation!==0n&&t.tag(4,c.Varint).uint64(e.totalTrafficCostEstimation);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ge=new li;var ci=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PrepareSubmissionRequest",[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"command_id",kind:"scalar",T:9},{no:3,name:"commands",kind:"message",repeat:2,T:()=>M},{no:4,name:"min_ledger_time",kind:"message",T:()=>_},{no:11,name:"max_record_time",kind:"message",T:()=>k},{no:5,name:"act_as",kind:"scalar",repeat:2,T:9},{no:6,name:"read_as",kind:"scalar",repeat:2,T:9},{no:7,name:"disclosed_contracts",kind:"message",repeat:2,T:()=>G},{no:8,name:"synchronizer_id",kind:"scalar",T:9},{no:9,name:"package_id_selection_preference",kind:"scalar",repeat:2,T:9},{no:10,name:"verbose_hashing",kind:"scalar",T:8},{no:15,name:"prefetch_contract_keys",kind:"message",repeat:2,T:()=>z},{no:16,name:"estimate_traffic_cost",kind:"message",T:()=>Me},{no:17,name:"hashing_scheme_version",kind:"enum",opt:!0,T:()=>["com.daml.ledger.api.v2.interactive.HashingSchemeVersion",J,"HASHING_SCHEME_VERSION_"]},{no:18,name:"taps_max_passes",kind:"scalar",opt:!0,T:13}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.userId="",t.commandId="",t.commands=[],t.actAs=[],t.readAs=[],t.disclosedContracts=[],t.synchronizerId="",t.packageIdSelectionPreference=[],t.verboseHashing=!1,t.prefetchContractKeys=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.userId=e.string();break;case 2:n.commandId=e.string();break;case 3:n.commands.push(M.internalBinaryRead(e,e.uint32(),i));break;case 4:n.minLedgerTime=_.internalBinaryRead(e,e.uint32(),i,n.minLedgerTime);break;case 11:n.maxRecordTime=k.internalBinaryRead(e,e.uint32(),i,n.maxRecordTime);break;case 5:n.actAs.push(e.string());break;case 6:n.readAs.push(e.string());break;case 7:n.disclosedContracts.push(G.internalBinaryRead(e,e.uint32(),i));break;case 8:n.synchronizerId=e.string();break;case 9:n.packageIdSelectionPreference.push(e.string());break;case 10:n.verboseHashing=e.bool();break;case 15:n.prefetchContractKeys.push(z.internalBinaryRead(e,e.uint32(),i));break;case 16:n.estimateTrafficCost=Me.internalBinaryRead(e,e.uint32(),i,n.estimateTrafficCost);break;case 17:n.hashingSchemeVersion=e.int32();break;case 18:n.tapsMaxPasses=e.uint32();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.userId!==""&&t.tag(1,c.LengthDelimited).string(e.userId),e.commandId!==""&&t.tag(2,c.LengthDelimited).string(e.commandId);for(let n=0;n<e.commands.length;n++)M.internalBinaryWrite(e.commands[n],t.tag(3,c.LengthDelimited).fork(),i).join();e.minLedgerTime&&_.internalBinaryWrite(e.minLedgerTime,t.tag(4,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.actAs.length;n++)t.tag(5,c.LengthDelimited).string(e.actAs[n]);for(let n=0;n<e.readAs.length;n++)t.tag(6,c.LengthDelimited).string(e.readAs[n]);for(let n=0;n<e.disclosedContracts.length;n++)G.internalBinaryWrite(e.disclosedContracts[n],t.tag(7,c.LengthDelimited).fork(),i).join();e.synchronizerId!==""&&t.tag(8,c.LengthDelimited).string(e.synchronizerId);for(let n=0;n<e.packageIdSelectionPreference.length;n++)t.tag(9,c.LengthDelimited).string(e.packageIdSelectionPreference[n]);e.verboseHashing!==!1&&t.tag(10,c.Varint).bool(e.verboseHashing),e.maxRecordTime&&k.internalBinaryWrite(e.maxRecordTime,t.tag(11,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.prefetchContractKeys.length;n++)z.internalBinaryWrite(e.prefetchContractKeys[n],t.tag(15,c.LengthDelimited).fork(),i).join();e.estimateTrafficCost&&Me.internalBinaryWrite(e.estimateTrafficCost,t.tag(16,c.LengthDelimited).fork(),i).join(),e.hashingSchemeVersion!==void 0&&t.tag(17,c.Varint).int32(e.hashingSchemeVersion),e.tapsMaxPasses!==void 0&&t.tag(18,c.Varint).uint32(e.tapsMaxPasses);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const di=new ci;var fi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PrepareSubmissionResponse",[{no:1,name:"prepared_transaction",kind:"message",T:()=>D},{no:2,name:"prepared_transaction_hash",kind:"scalar",T:12},{no:3,name:"hashing_scheme_version",kind:"enum",T:()=>["com.daml.ledger.api.v2.interactive.HashingSchemeVersion",J,"HASHING_SCHEME_VERSION_"]},{no:4,name:"hashing_details",kind:"scalar",opt:!0,T:9},{no:5,name:"cost_estimation",kind:"message",T:()=>Ge}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.preparedTransactionHash=new Uint8Array(0),t.hashingSchemeVersion=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.preparedTransaction=D.internalBinaryRead(e,e.uint32(),i,n.preparedTransaction);break;case 2:n.preparedTransactionHash=e.bytes();break;case 3:n.hashingSchemeVersion=e.int32();break;case 4:n.hashingDetails=e.string();break;case 5:n.costEstimation=Ge.internalBinaryRead(e,e.uint32(),i,n.costEstimation);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.preparedTransaction&&D.internalBinaryWrite(e.preparedTransaction,t.tag(1,c.LengthDelimited).fork(),i).join(),e.preparedTransactionHash.length&&t.tag(2,c.LengthDelimited).bytes(e.preparedTransactionHash),e.hashingSchemeVersion!==0&&t.tag(3,c.Varint).int32(e.hashingSchemeVersion),e.hashingDetails!==void 0&&t.tag(4,c.LengthDelimited).string(e.hashingDetails),e.costEstimation&&Ge.internalBinaryWrite(e.costEstimation,t.tag(5,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ui=new fi;var hi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.SinglePartySignatures",[{no:1,name:"party",kind:"scalar",T:9},{no:2,name:"signatures",kind:"message",repeat:2,T:()=>Ve}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.party="",t.signatures=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.party=e.string();break;case 2:n.signatures.push(Ve.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.party!==""&&t.tag(1,c.LengthDelimited).string(e.party);for(let n=0;n<e.signatures.length;n++)Ve.internalBinaryWrite(e.signatures[n],t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ze=new hi;var mi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PartySignatures",[{no:1,name:"signatures",kind:"message",repeat:2,T:()=>ze}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.signatures=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.signatures.push(ze.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.signatures.length;n++)ze.internalBinaryWrite(e.signatures[n],t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const x=new mi;var pi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionRequest",[{no:1,name:"prepared_transaction",kind:"message",T:()=>D},{no:2,name:"party_signatures",kind:"message",T:()=>x},{no:3,name:"deduplication_duration",kind:"message",oneof:"deduplicationPeriod",T:()=>I},{no:4,name:"deduplication_offset",kind:"scalar",oneof:"deduplicationPeriod",T:3,L:0},{no:5,name:"submission_id",kind:"scalar",T:9},{no:6,name:"user_id",kind:"scalar",T:9},{no:7,name:"hashing_scheme_version",kind:"enum",T:()=>["com.daml.ledger.api.v2.interactive.HashingSchemeVersion",J,"HASHING_SCHEME_VERSION_"]},{no:8,name:"min_ledger_time",kind:"message",T:()=>_}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.deduplicationPeriod={oneofKind:void 0},t.submissionId="",t.userId="",t.hashingSchemeVersion=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.preparedTransaction=D.internalBinaryRead(e,e.uint32(),i,n.preparedTransaction);break;case 2:n.partySignatures=x.internalBinaryRead(e,e.uint32(),i,n.partySignatures);break;case 3:n.deduplicationPeriod={oneofKind:"deduplicationDuration",deduplicationDuration:I.internalBinaryRead(e,e.uint32(),i,n.deduplicationPeriod.deduplicationDuration)};break;case 4:n.deduplicationPeriod={oneofKind:"deduplicationOffset",deduplicationOffset:e.int64().toBigInt()};break;case 5:n.submissionId=e.string();break;case 6:n.userId=e.string();break;case 7:n.hashingSchemeVersion=e.int32();break;case 8:n.minLedgerTime=_.internalBinaryRead(e,e.uint32(),i,n.minLedgerTime);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.preparedTransaction&&D.internalBinaryWrite(e.preparedTransaction,t.tag(1,c.LengthDelimited).fork(),i).join(),e.partySignatures&&x.internalBinaryWrite(e.partySignatures,t.tag(2,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationDuration"&&I.internalBinaryWrite(e.deduplicationPeriod.deduplicationDuration,t.tag(3,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationOffset"&&t.tag(4,c.Varint).int64(e.deduplicationPeriod.deduplicationOffset),e.submissionId!==""&&t.tag(5,c.LengthDelimited).string(e.submissionId),e.userId!==""&&t.tag(6,c.LengthDelimited).string(e.userId),e.hashingSchemeVersion!==0&&t.tag(7,c.Varint).int32(e.hashingSchemeVersion),e.minLedgerTime&&_.internalBinaryWrite(e.minLedgerTime,t.tag(8,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const gi=new pi;var yi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionResponse",[])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const ki=new yi;var bi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionAndWaitRequest",[{no:1,name:"prepared_transaction",kind:"message",T:()=>D},{no:2,name:"party_signatures",kind:"message",T:()=>x},{no:3,name:"deduplication_duration",kind:"message",oneof:"deduplicationPeriod",T:()=>I},{no:4,name:"deduplication_offset",kind:"scalar",oneof:"deduplicationPeriod",T:3,L:0},{no:5,name:"submission_id",kind:"scalar",T:9},{no:6,name:"user_id",kind:"scalar",T:9},{no:7,name:"hashing_scheme_version",kind:"enum",T:()=>["com.daml.ledger.api.v2.interactive.HashingSchemeVersion",J,"HASHING_SCHEME_VERSION_"]},{no:8,name:"min_ledger_time",kind:"message",T:()=>_}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.deduplicationPeriod={oneofKind:void 0},t.submissionId="",t.userId="",t.hashingSchemeVersion=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.preparedTransaction=D.internalBinaryRead(e,e.uint32(),i,n.preparedTransaction);break;case 2:n.partySignatures=x.internalBinaryRead(e,e.uint32(),i,n.partySignatures);break;case 3:n.deduplicationPeriod={oneofKind:"deduplicationDuration",deduplicationDuration:I.internalBinaryRead(e,e.uint32(),i,n.deduplicationPeriod.deduplicationDuration)};break;case 4:n.deduplicationPeriod={oneofKind:"deduplicationOffset",deduplicationOffset:e.int64().toBigInt()};break;case 5:n.submissionId=e.string();break;case 6:n.userId=e.string();break;case 7:n.hashingSchemeVersion=e.int32();break;case 8:n.minLedgerTime=_.internalBinaryRead(e,e.uint32(),i,n.minLedgerTime);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.preparedTransaction&&D.internalBinaryWrite(e.preparedTransaction,t.tag(1,c.LengthDelimited).fork(),i).join(),e.partySignatures&&x.internalBinaryWrite(e.partySignatures,t.tag(2,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationDuration"&&I.internalBinaryWrite(e.deduplicationPeriod.deduplicationDuration,t.tag(3,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationOffset"&&t.tag(4,c.Varint).int64(e.deduplicationPeriod.deduplicationOffset),e.submissionId!==""&&t.tag(5,c.LengthDelimited).string(e.submissionId),e.userId!==""&&t.tag(6,c.LengthDelimited).string(e.userId),e.hashingSchemeVersion!==0&&t.tag(7,c.Varint).int32(e.hashingSchemeVersion),e.minLedgerTime&&_.internalBinaryWrite(e.minLedgerTime,t.tag(8,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ti=new bi;var wi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionAndWaitResponse",[{no:1,name:"update_id",kind:"scalar",T:9},{no:2,name:"completion_offset",kind:"scalar",T:3,L:0}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.updateId="",t.completionOffset=0n,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.updateId=e.string();break;case 2:n.completionOffset=e.int64().toBigInt();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.updateId!==""&&t.tag(1,c.LengthDelimited).string(e.updateId),e.completionOffset!==0n&&t.tag(2,c.Varint).int64(e.completionOffset);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ni=new wi;var Bi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionAndWaitForTransactionRequest",[{no:1,name:"prepared_transaction",kind:"message",T:()=>D},{no:2,name:"party_signatures",kind:"message",T:()=>x},{no:3,name:"deduplication_duration",kind:"message",oneof:"deduplicationPeriod",T:()=>I},{no:4,name:"deduplication_offset",kind:"scalar",oneof:"deduplicationPeriod",T:3,L:0},{no:5,name:"submission_id",kind:"scalar",T:9},{no:6,name:"user_id",kind:"scalar",T:9},{no:7,name:"hashing_scheme_version",kind:"enum",T:()=>["com.daml.ledger.api.v2.interactive.HashingSchemeVersion",J,"HASHING_SCHEME_VERSION_"]},{no:8,name:"min_ledger_time",kind:"message",T:()=>_},{no:9,name:"transaction_format",kind:"message",T:()=>C}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.deduplicationPeriod={oneofKind:void 0},t.submissionId="",t.userId="",t.hashingSchemeVersion=0,e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.preparedTransaction=D.internalBinaryRead(e,e.uint32(),i,n.preparedTransaction);break;case 2:n.partySignatures=x.internalBinaryRead(e,e.uint32(),i,n.partySignatures);break;case 3:n.deduplicationPeriod={oneofKind:"deduplicationDuration",deduplicationDuration:I.internalBinaryRead(e,e.uint32(),i,n.deduplicationPeriod.deduplicationDuration)};break;case 4:n.deduplicationPeriod={oneofKind:"deduplicationOffset",deduplicationOffset:e.int64().toBigInt()};break;case 5:n.submissionId=e.string();break;case 6:n.userId=e.string();break;case 7:n.hashingSchemeVersion=e.int32();break;case 8:n.minLedgerTime=_.internalBinaryRead(e,e.uint32(),i,n.minLedgerTime);break;case 9:n.transactionFormat=C.internalBinaryRead(e,e.uint32(),i,n.transactionFormat);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.preparedTransaction&&D.internalBinaryWrite(e.preparedTransaction,t.tag(1,c.LengthDelimited).fork(),i).join(),e.partySignatures&&x.internalBinaryWrite(e.partySignatures,t.tag(2,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationDuration"&&I.internalBinaryWrite(e.deduplicationPeriod.deduplicationDuration,t.tag(3,c.LengthDelimited).fork(),i).join(),e.deduplicationPeriod.oneofKind==="deduplicationOffset"&&t.tag(4,c.Varint).int64(e.deduplicationPeriod.deduplicationOffset),e.submissionId!==""&&t.tag(5,c.LengthDelimited).string(e.submissionId),e.userId!==""&&t.tag(6,c.LengthDelimited).string(e.userId),e.hashingSchemeVersion!==0&&t.tag(7,c.Varint).int32(e.hashingSchemeVersion),e.minLedgerTime&&_.internalBinaryWrite(e.minLedgerTime,t.tag(8,c.LengthDelimited).fork(),i).join(),e.transactionFormat&&C.internalBinaryWrite(e.transactionFormat,t.tag(9,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ii=new Bi;var Ri=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.ExecuteSubmissionAndWaitForTransactionResponse",[{no:1,name:"transaction",kind:"message",T:()=>Fe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.transaction=Fe.internalBinaryRead(e,e.uint32(),i,n.transaction);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.transaction&&Fe.internalBinaryWrite(e.transaction,t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const vi=new Ri;var Di=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.MinLedgerTime",[{no:1,name:"min_ledger_time_abs",kind:"message",oneof:"time",T:()=>k},{no:2,name:"min_ledger_time_rel",kind:"message",oneof:"time",T:()=>I}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.time={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.time={oneofKind:"minLedgerTimeAbs",minLedgerTimeAbs:k.internalBinaryRead(e,e.uint32(),i,n.time.minLedgerTimeAbs)};break;case 2:n.time={oneofKind:"minLedgerTimeRel",minLedgerTimeRel:I.internalBinaryRead(e,e.uint32(),i,n.time.minLedgerTimeRel)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.time.oneofKind==="minLedgerTimeAbs"&&k.internalBinaryWrite(e.time.minLedgerTimeAbs,t.tag(1,c.LengthDelimited).fork(),i).join(),e.time.oneofKind==="minLedgerTimeRel"&&I.internalBinaryWrite(e.time.minLedgerTimeRel,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const _=new Di;var Ei=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PreparedTransaction",[{no:1,name:"transaction",kind:"message",T:()=>He},{no:2,name:"metadata",kind:"message",T:()=>Je}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.transaction=He.internalBinaryRead(e,e.uint32(),i,n.transaction);break;case 2:n.metadata=Je.internalBinaryRead(e,e.uint32(),i,n.metadata);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.transaction&&He.internalBinaryWrite(e.transaction,t.tag(1,c.LengthDelimited).fork(),i).join(),e.metadata&&Je.internalBinaryWrite(e.metadata,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const D=new Ei;var Li=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.Metadata",[{no:2,name:"submitter_info",kind:"message",T:()=>qe},{no:3,name:"synchronizer_id",kind:"scalar",T:9},{no:4,name:"mediator_group",kind:"scalar",T:13},{no:5,name:"transaction_uuid",kind:"scalar",T:9},{no:6,name:"preparation_time",kind:"scalar",T:4,L:0},{no:7,name:"input_contracts",kind:"message",repeat:2,T:()=>Ze},{no:9,name:"min_ledger_effective_time",kind:"scalar",opt:!0,T:4,L:0},{no:10,name:"max_ledger_effective_time",kind:"scalar",opt:!0,T:4,L:0},{no:11,name:"max_record_time",kind:"scalar",opt:!0,T:4,L:0},{no:8,name:"global_key_mapping",kind:"message",repeat:2,T:()=>Xe}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.synchronizerId="",t.mediatorGroup=0,t.transactionUuid="",t.preparationTime=0n,t.inputContracts=[],t.globalKeyMapping=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 2:n.submitterInfo=qe.internalBinaryRead(e,e.uint32(),i,n.submitterInfo);break;case 3:n.synchronizerId=e.string();break;case 4:n.mediatorGroup=e.uint32();break;case 5:n.transactionUuid=e.string();break;case 6:n.preparationTime=e.uint64().toBigInt();break;case 7:n.inputContracts.push(Ze.internalBinaryRead(e,e.uint32(),i));break;case 9:n.minLedgerEffectiveTime=e.uint64().toBigInt();break;case 10:n.maxLedgerEffectiveTime=e.uint64().toBigInt();break;case 11:n.maxRecordTime=e.uint64().toBigInt();break;case 8:n.globalKeyMapping.push(Xe.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.submitterInfo&&qe.internalBinaryWrite(e.submitterInfo,t.tag(2,c.LengthDelimited).fork(),i).join(),e.synchronizerId!==""&&t.tag(3,c.LengthDelimited).string(e.synchronizerId),e.mediatorGroup!==0&&t.tag(4,c.Varint).uint32(e.mediatorGroup),e.transactionUuid!==""&&t.tag(5,c.LengthDelimited).string(e.transactionUuid),e.preparationTime!==0n&&t.tag(6,c.Varint).uint64(e.preparationTime);for(let n=0;n<e.inputContracts.length;n++)Ze.internalBinaryWrite(e.inputContracts[n],t.tag(7,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.globalKeyMapping.length;n++)Xe.internalBinaryWrite(e.globalKeyMapping[n],t.tag(8,c.LengthDelimited).fork(),i).join();e.minLedgerEffectiveTime!==void 0&&t.tag(9,c.Varint).uint64(e.minLedgerEffectiveTime),e.maxLedgerEffectiveTime!==void 0&&t.tag(10,c.Varint).uint64(e.maxLedgerEffectiveTime),e.maxRecordTime!==void 0&&t.tag(11,c.Varint).uint64(e.maxRecordTime);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Je=new Li;var _i=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.Metadata.SubmitterInfo",[{no:1,name:"act_as",kind:"scalar",repeat:2,T:9},{no:2,name:"command_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.actAs=[],t.commandId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.actAs.push(e.string());break;case 2:n.commandId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.actAs.length;n++)t.tag(1,c.LengthDelimited).string(e.actAs[n]);e.commandId!==""&&t.tag(2,c.LengthDelimited).string(e.commandId);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const qe=new _i;var Ui=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.Metadata.GlobalKeyMappingEntry",[{no:1,name:"key",kind:"message",T:()=>V},{no:2,name:"value",kind:"message",T:()=>g}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.key=V.internalBinaryRead(e,e.uint32(),i,n.key);break;case 2:n.value=g.internalBinaryRead(e,e.uint32(),i,n.value);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.key&&V.internalBinaryWrite(e.key,t.tag(1,c.LengthDelimited).fork(),i).join(),e.value&&g.internalBinaryWrite(e.value,t.tag(2,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Xe=new Ui;var Fi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.Metadata.InputContract",[{no:1,name:"v1",kind:"message",oneof:"contract",T:()=>S},{no:1e3,name:"created_at",kind:"scalar",T:4,L:0},{no:1002,name:"event_blob",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.contract={oneofKind:void 0},t.createdAt=0n,t.eventBlob=new Uint8Array(0),e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.contract={oneofKind:"v1",v1:S.internalBinaryRead(e,e.uint32(),i,n.contract.v1)};break;case 1e3:n.createdAt=e.uint64().toBigInt();break;case 1002:n.eventBlob=e.bytes();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.contract.oneofKind==="v1"&&S.internalBinaryWrite(e.contract.v1,t.tag(1,c.LengthDelimited).fork(),i).join(),e.createdAt!==0n&&t.tag(1e3,c.Varint).uint64(e.createdAt),e.eventBlob.length&&t.tag(1002,c.LengthDelimited).bytes(e.eventBlob);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ze=new Fi;var $i=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.DamlTransaction",[{no:1,name:"version",kind:"scalar",T:9},{no:2,name:"roots",kind:"scalar",repeat:2,T:9},{no:3,name:"nodes",kind:"message",repeat:2,T:()=>Qe},{no:4,name:"node_seeds",kind:"message",repeat:2,T:()=>Ye}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.version="",t.roots=[],t.nodes=[],t.nodeSeeds=[],e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.version=e.string();break;case 2:n.roots.push(e.string());break;case 3:n.nodes.push(Qe.internalBinaryRead(e,e.uint32(),i));break;case 4:n.nodeSeeds.push(Ye.internalBinaryRead(e,e.uint32(),i));break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.version!==""&&t.tag(1,c.LengthDelimited).string(e.version);for(let n=0;n<e.roots.length;n++)t.tag(2,c.LengthDelimited).string(e.roots[n]);for(let n=0;n<e.nodes.length;n++)Qe.internalBinaryWrite(e.nodes[n],t.tag(3,c.LengthDelimited).fork(),i).join();for(let n=0;n<e.nodeSeeds.length;n++)Ye.internalBinaryWrite(e.nodeSeeds[n],t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const He=new $i;var Wi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.DamlTransaction.NodeSeed",[{no:1,name:"node_id",kind:"scalar",T:5},{no:2,name:"seed",kind:"scalar",T:12}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.nodeId=0,t.seed=new Uint8Array(0),e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.nodeId=e.int32();break;case 2:n.seed=e.bytes();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.nodeId!==0&&t.tag(1,c.Varint).int32(e.nodeId),e.seed.length&&t.tag(2,c.LengthDelimited).bytes(e.seed);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ye=new Wi;var xi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.DamlTransaction.Node",[{no:1,name:"node_id",kind:"scalar",T:9},{no:1e3,name:"v1",kind:"message",oneof:"versionedNode",T:()=>Ne}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.nodeId="",t.versionedNode={oneofKind:void 0},e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.nodeId=e.string();break;case 1e3:n.versionedNode={oneofKind:"v1",v1:Ne.internalBinaryRead(e,e.uint32(),i,n.versionedNode.v1)};break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.nodeId!==""&&t.tag(1,c.LengthDelimited).string(e.nodeId),e.versionedNode.oneofKind==="v1"&&Ne.internalBinaryWrite(e.versionedNode.v1,t.tag(1e3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Qe=new xi;var Pi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GetPreferredPackageVersionRequest",[{no:1,name:"parties",kind:"scalar",repeat:2,T:9},{no:2,name:"package_name",kind:"scalar",T:9},{no:3,name:"synchronizer_id",kind:"scalar",T:9},{no:4,name:"vetting_valid_at",kind:"message",T:()=>k}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.parties=[],t.packageName="",t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.parties.push(e.string());break;case 2:n.packageName=e.string();break;case 3:n.synchronizerId=e.string();break;case 4:n.vettingValidAt=k.internalBinaryRead(e,e.uint32(),i,n.vettingValidAt);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.parties.length;n++)t.tag(1,c.LengthDelimited).string(e.parties[n]);e.packageName!==""&&t.tag(2,c.LengthDelimited).string(e.packageName),e.synchronizerId!==""&&t.tag(3,c.LengthDelimited).string(e.synchronizerId),e.vettingValidAt&&k.internalBinaryWrite(e.vettingValidAt,t.tag(4,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Oi=new Pi;var Ai=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GetPreferredPackageVersionResponse",[{no:1,name:"package_preference",kind:"message",T:()=>et}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packagePreference=et.internalBinaryRead(e,e.uint32(),i,n.packagePreference);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.packagePreference&&et.internalBinaryWrite(e.packagePreference,t.tag(1,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Vi=new Ai;var Si=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PackagePreference",[{no:1,name:"package_reference",kind:"message",T:()=>j},{no:2,name:"synchronizer_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageReference=j.internalBinaryRead(e,e.uint32(),i,n.packageReference);break;case 2:n.synchronizerId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){e.packageReference&&j.internalBinaryWrite(e.packageReference,t.tag(1,c.LengthDelimited).fork(),i).join(),e.synchronizerId!==""&&t.tag(2,c.LengthDelimited).string(e.synchronizerId);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const et=new Si;var ji=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.PackageVettingRequirement",[{no:1,name:"parties",kind:"scalar",repeat:2,T:9},{no:2,name:"package_name",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.parties=[],t.packageName="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.parties.push(e.string());break;case 2:n.packageName=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.parties.length;n++)t.tag(1,c.LengthDelimited).string(e.parties[n]);e.packageName!==""&&t.tag(2,c.LengthDelimited).string(e.packageName);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const tt=new ji;var Ki=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GetPreferredPackagesRequest",[{no:1,name:"package_vetting_requirements",kind:"message",repeat:2,T:()=>tt},{no:2,name:"synchronizer_id",kind:"scalar",T:9},{no:3,name:"vetting_valid_at",kind:"message",T:()=>k}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageVettingRequirements=[],t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageVettingRequirements.push(tt.internalBinaryRead(e,e.uint32(),i));break;case 2:n.synchronizerId=e.string();break;case 3:n.vettingValidAt=k.internalBinaryRead(e,e.uint32(),i,n.vettingValidAt);break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.packageVettingRequirements.length;n++)tt.internalBinaryWrite(e.packageVettingRequirements[n],t.tag(1,c.LengthDelimited).fork(),i).join();e.synchronizerId!==""&&t.tag(2,c.LengthDelimited).string(e.synchronizerId),e.vettingValidAt&&k.internalBinaryWrite(e.vettingValidAt,t.tag(3,c.LengthDelimited).fork(),i).join();let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Ci=new Ki;var Mi=class extends m{constructor(){super("com.daml.ledger.api.v2.interactive.GetPreferredPackagesResponse",[{no:1,name:"package_references",kind:"message",repeat:2,T:()=>j},{no:2,name:"synchronizer_id",kind:"scalar",T:9}])}create(e){const t=globalThis.Object.create(this.messagePrototype);return t.packageReferences=[],t.synchronizerId="",e!==void 0&&h(this,t,e),t}internalBinaryRead(e,t,i,a){let n=a??this.create(),l=e.pos+t;for(;e.pos<l;){let[r,s]=e.tag();switch(r){case 1:n.packageReferences.push(j.internalBinaryRead(e,e.uint32(),i));break;case 2:n.synchronizerId=e.string();break;default:let o=i.readUnknownField;if(o==="throw")throw new globalThis.Error(`Unknown field ${r} (wire type ${s}) for ${this.typeName}`);let d=e.skip(s);o!==!1&&(o===!0?f.onRead:o)(this.typeName,n,r,s,d)}}return n}internalBinaryWrite(e,t,i){for(let n=0;n<e.packageReferences.length;n++)j.internalBinaryWrite(e.packageReferences[n],t.tag(1,c.LengthDelimited).fork(),i).join();e.synchronizerId!==""&&t.tag(2,c.LengthDelimited).string(e.synchronizerId);let a=i.writeUnknownFields;return a!==!1&&(a==!0?f.onWrite:a)(this.typeName,e,t),t}};const Gi=new Mi;new tn("com.daml.ledger.api.v2.interactive.InteractiveSubmissionService",[{name:"PrepareSubmission",options:{},I:di,O:ui},{name:"ExecuteSubmission",options:{},I:gi,O:ki},{name:"ExecuteSubmissionAndWait",options:{},I:Ti,O:Ni},{name:"ExecuteSubmissionAndWaitForTransaction",options:{},I:Ii,O:vi},{name:"GetPreferredPackageVersion",options:{},I:Oi,O:Vi},{name:"GetPreferredPackages",options:{},I:Ci,O:Gi}]);const zi=32,Ji=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}),qi=/[\t\n\r]/g,Xi=new RegExp("\\p{Cc}","u");function Zi(e){const t=f.list(e);if(t.length!==0)return Dt(t.map(({no:i,wireType:a,data:n})=>{try{return[i,vt(new ot(n),a,0)]}catch{return[i,oe(n)]}}))}function vt(e,t,i){switch(t){case c.Varint:return pt(e.uint64().toString());case c.Bit64:return pt(e.fixed64().toString());case c.Bit32:return e.fixed32();case c.LengthDelimited:return Hi(e.bytes(),i);default:return oe(e.skip(t))}}function Hi(e,t){const i=Yi(e);if(i!==void 0)return i;if(t<zi){const a=ea(e,t+1);if(a!==void 0)return a}return oe(e)}function Yi(e){let t;try{t=Ji.decode(e)}catch{return}return Qi(t)?t:void 0}function Qi(e){return!Xi.test(e.replace(qi,""))}function ea(e,t){try{const i=new ot(e),a=[];for(;i.pos<i.len;){const[n,l]=i.tag();a.push([n,vt(i,l,t)])}return Dt(a)}catch{return}}function Dt(e){const t={};for(const[i,a]of e){const n=t[i];n===void 0?t[i]=a:Array.isArray(n)?n.push(a):t[i]=[n,a]}return t}function pt(e){const t=Number(e);return Number.isSafeInteger(t)?t:e}function ta(e){const t=atob(e),i=t.length,a=new Uint8Array(i);for(let n=0;n<i;n++)a[n]=t.charCodeAt(n);return a}Uint8Array.from([0,0,0,48]);Uint8Array.from([1]);Uint8Array.from([J.V2]);const na=e=>e?.readUnknownField===void 0?void 0:{readUnknownField:e.readUnknownField},ia=(e,t)=>{const i=ta(e);return D.fromBinary(i,na(t))};function aa(e,t){if(typeof t=="bigint")return t.toString();if(t!==null&&typeof t=="object"){const i=Zi(t);if(i)return{...t,unknownFields:i}}return t}function ra(e,t){const i=ia(e,t);return JSON.stringify(i,aa,2)}function te(e){return e?.versionedNode?.oneofKind!=="v1"?null:e.versionedNode.v1?.nodeType??null}function oa(e,t){return t?e.find(i=>i?.nodeId===t)??null:null}function sa(e,t){const i=e?.transaction?.roots?.[0];return oa(t,i)}function gt(e,t){return e.find(i=>te(i)?.oneofKind===t)??null}function la(e){return e?.sum?.oneofKind!=="record"?[]:e.sum.record?.fields??[]}function O(e,t){return la(e).find(i=>i?.label===t)?.value}function Q(e){if(e?.sum?.oneofKind==="numeric"&&e.sum.numeric)return e.sum.numeric}function ca(e){const t=e?.transaction?.nodes??[];if(!Array.isArray(t)||t.length===0)return{};const i=sa(e,t),a=(te(i)?.oneofKind==="exercise"?i:null)||gt(t,"exercise"),n=gt(t,"create"),l=te(a)?.exercise,r=te(n)?.create,s=l?.choiceId,o=Q(O(l?.chosenValue,"amount"))??Q(O(O(O(l?.chosenValue,"allocation"),"transferLeg"),"amount")),d=Q(O(r?.argument,"amount"))??Q(O(O(r?.argument,"amount"),"initialAmount")),y=l?o:d;return{...s?{choiceId:s}:{},...y?{amount:y}:{}}}function da(e,t){const i=ra(e,t),a=JSON.parse(i),n={jsonString:i,isCreate:!1,isExercise:!1};function l(r){if(!(r===null||typeof r!="object")){typeof r.packageName=="string"&&(n.packageName=r.packageName),Array.isArray(r.signatories)&&(n.signatories=r.signatories),Array.isArray(r.stakeholders)&&(n.stakeholders=r.stakeholders),r.templateId?.moduleName&&(n.moduleName=r.templateId.moduleName),r.templateId?.entityName&&(n.entityName=r.templateId.entityName),r.nodeType?.create&&(n.isCreate=!0),r.nodeType?.exercise&&(n.isExercise=!0);for(const s of Object.keys(r))l(r[s])}}return l(a),n.templateId=`${n.packageName||"N/A"}:${n.moduleName||"N/A"}:${n.entityName||"N/A"}`,Object.assign(n,ca(a)),n}export{da as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{B as K0,o as S0,C as Z0,E as P0,f as D0,F as q0,m as G0}from"./index-DRQ0oWml.js";function X0(ff){throw new Error('Could not dynamically require "'+ff+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var r0={exports:{}};const $0={},V0=Object.freeze(Object.defineProperty({__proto__:null,default:$0},Symbol.toStringTag,{value:"Module"})),W0=K0(V0);var U0;function H0(){return U0||(U0=1,(function(ff){(function(A){var p=function(r){var x,t=new Float64Array(16);if(r)for(x=0;x<r.length;x++)t[x]=r[x];return t},V=function(){throw new Error("no PRNG")},W=new Uint8Array(16),rf=new Uint8Array(32);rf[0]=9;var of=p(),Uf=p([1]),T0=p([56129,1]),t0=p([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),Y0=p([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),x0=p([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),e0=p([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),M0=p([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function n0(r,x,t,f){r[x]=t>>24&255,r[x+1]=t>>16&255,r[x+2]=t>>8&255,r[x+3]=t&255,r[x+4]=f>>24&255,r[x+5]=f>>16&255,r[x+6]=f>>8&255,r[x+7]=f&255}function Ff(r,x,t,f,e){var a,i=0;for(a=0;a<e;a++)i|=r[x+a]^t[f+a];return(1&i-1>>>8)-1}function a0(r,x,t,f){return Ff(r,x,t,f,16)}function If(r,x,t,f){return Ff(r,x,t,f,32)}function j0(r,x,t,f){for(var e=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,a=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,i=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,s=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,l=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,B=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,v=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,q=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,w=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Y=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,M=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,C=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,j=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,R=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,E=e,S=a,_=i,g=s,U=l,y=B,o=v,h=q,b=w,c=Y,u=M,d=O,T=C,z=j,F=R,N=L,n,K=0;K<20;K+=2)n=E+T|0,U^=n<<7|n>>>25,n=U+E|0,b^=n<<9|n>>>23,n=b+U|0,T^=n<<13|n>>>19,n=T+b|0,E^=n<<18|n>>>14,n=y+S|0,c^=n<<7|n>>>25,n=c+y|0,z^=n<<9|n>>>23,n=z+c|0,S^=n<<13|n>>>19,n=S+z|0,y^=n<<18|n>>>14,n=u+o|0,F^=n<<7|n>>>25,n=F+u|0,_^=n<<9|n>>>23,n=_+F|0,o^=n<<13|n>>>19,n=o+_|0,u^=n<<18|n>>>14,n=N+d|0,g^=n<<7|n>>>25,n=g+N|0,h^=n<<9|n>>>23,n=h+g|0,d^=n<<13|n>>>19,n=d+h|0,N^=n<<18|n>>>14,n=E+g|0,S^=n<<7|n>>>25,n=S+E|0,_^=n<<9|n>>>23,n=_+S|0,g^=n<<13|n>>>19,n=g+_|0,E^=n<<18|n>>>14,n=y+U|0,o^=n<<7|n>>>25,n=o+y|0,h^=n<<9|n>>>23,n=h+o|0,U^=n<<13|n>>>19,n=U+h|0,y^=n<<18|n>>>14,n=u+c|0,d^=n<<7|n>>>25,n=d+u|0,b^=n<<9|n>>>23,n=b+d|0,c^=n<<13|n>>>19,n=c+b|0,u^=n<<18|n>>>14,n=N+F|0,T^=n<<7|n>>>25,n=T+N|0,z^=n<<9|n>>>23,n=z+T|0,F^=n<<13|n>>>19,n=F+z|0,N^=n<<18|n>>>14;E=E+e|0,S=S+a|0,_=_+i|0,g=g+s|0,U=U+l|0,y=y+B|0,o=o+v|0,h=h+q|0,b=b+w|0,c=c+Y|0,u=u+M|0,d=d+O|0,T=T+C|0,z=z+j|0,F=F+R|0,N=N+L|0,r[0]=E>>>0&255,r[1]=E>>>8&255,r[2]=E>>>16&255,r[3]=E>>>24&255,r[4]=S>>>0&255,r[5]=S>>>8&255,r[6]=S>>>16&255,r[7]=S>>>24&255,r[8]=_>>>0&255,r[9]=_>>>8&255,r[10]=_>>>16&255,r[11]=_>>>24&255,r[12]=g>>>0&255,r[13]=g>>>8&255,r[14]=g>>>16&255,r[15]=g>>>24&255,r[16]=U>>>0&255,r[17]=U>>>8&255,r[18]=U>>>16&255,r[19]=U>>>24&255,r[20]=y>>>0&255,r[21]=y>>>8&255,r[22]=y>>>16&255,r[23]=y>>>24&255,r[24]=o>>>0&255,r[25]=o>>>8&255,r[26]=o>>>16&255,r[27]=o>>>24&255,r[28]=h>>>0&255,r[29]=h>>>8&255,r[30]=h>>>16&255,r[31]=h>>>24&255,r[32]=b>>>0&255,r[33]=b>>>8&255,r[34]=b>>>16&255,r[35]=b>>>24&255,r[36]=c>>>0&255,r[37]=c>>>8&255,r[38]=c>>>16&255,r[39]=c>>>24&255,r[40]=u>>>0&255,r[41]=u>>>8&255,r[42]=u>>>16&255,r[43]=u>>>24&255,r[44]=d>>>0&255,r[45]=d>>>8&255,r[46]=d>>>16&255,r[47]=d>>>24&255,r[48]=T>>>0&255,r[49]=T>>>8&255,r[50]=T>>>16&255,r[51]=T>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=F>>>0&255,r[57]=F>>>8&255,r[58]=F>>>16&255,r[59]=F>>>24&255,r[60]=N>>>0&255,r[61]=N>>>8&255,r[62]=N>>>16&255,r[63]=N>>>24&255}function L0(r,x,t,f){for(var e=f[0]&255|(f[1]&255)<<8|(f[2]&255)<<16|(f[3]&255)<<24,a=t[0]&255|(t[1]&255)<<8|(t[2]&255)<<16|(t[3]&255)<<24,i=t[4]&255|(t[5]&255)<<8|(t[6]&255)<<16|(t[7]&255)<<24,s=t[8]&255|(t[9]&255)<<8|(t[10]&255)<<16|(t[11]&255)<<24,l=t[12]&255|(t[13]&255)<<8|(t[14]&255)<<16|(t[15]&255)<<24,B=f[4]&255|(f[5]&255)<<8|(f[6]&255)<<16|(f[7]&255)<<24,v=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,q=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,w=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,Y=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,M=f[8]&255|(f[9]&255)<<8|(f[10]&255)<<16|(f[11]&255)<<24,O=t[16]&255|(t[17]&255)<<8|(t[18]&255)<<16|(t[19]&255)<<24,C=t[20]&255|(t[21]&255)<<8|(t[22]&255)<<16|(t[23]&255)<<24,j=t[24]&255|(t[25]&255)<<8|(t[26]&255)<<16|(t[27]&255)<<24,R=t[28]&255|(t[29]&255)<<8|(t[30]&255)<<16|(t[31]&255)<<24,L=f[12]&255|(f[13]&255)<<8|(f[14]&255)<<16|(f[15]&255)<<24,E=e,S=a,_=i,g=s,U=l,y=B,o=v,h=q,b=w,c=Y,u=M,d=O,T=C,z=j,F=R,N=L,n,K=0;K<20;K+=2)n=E+T|0,U^=n<<7|n>>>25,n=U+E|0,b^=n<<9|n>>>23,n=b+U|0,T^=n<<13|n>>>19,n=T+b|0,E^=n<<18|n>>>14,n=y+S|0,c^=n<<7|n>>>25,n=c+y|0,z^=n<<9|n>>>23,n=z+c|0,S^=n<<13|n>>>19,n=S+z|0,y^=n<<18|n>>>14,n=u+o|0,F^=n<<7|n>>>25,n=F+u|0,_^=n<<9|n>>>23,n=_+F|0,o^=n<<13|n>>>19,n=o+_|0,u^=n<<18|n>>>14,n=N+d|0,g^=n<<7|n>>>25,n=g+N|0,h^=n<<9|n>>>23,n=h+g|0,d^=n<<13|n>>>19,n=d+h|0,N^=n<<18|n>>>14,n=E+g|0,S^=n<<7|n>>>25,n=S+E|0,_^=n<<9|n>>>23,n=_+S|0,g^=n<<13|n>>>19,n=g+_|0,E^=n<<18|n>>>14,n=y+U|0,o^=n<<7|n>>>25,n=o+y|0,h^=n<<9|n>>>23,n=h+o|0,U^=n<<13|n>>>19,n=U+h|0,y^=n<<18|n>>>14,n=u+c|0,d^=n<<7|n>>>25,n=d+u|0,b^=n<<9|n>>>23,n=b+d|0,c^=n<<13|n>>>19,n=c+b|0,u^=n<<18|n>>>14,n=N+F|0,T^=n<<7|n>>>25,n=T+N|0,z^=n<<9|n>>>23,n=z+T|0,F^=n<<13|n>>>19,n=F+z|0,N^=n<<18|n>>>14;r[0]=E>>>0&255,r[1]=E>>>8&255,r[2]=E>>>16&255,r[3]=E>>>24&255,r[4]=y>>>0&255,r[5]=y>>>8&255,r[6]=y>>>16&255,r[7]=y>>>24&255,r[8]=u>>>0&255,r[9]=u>>>8&255,r[10]=u>>>16&255,r[11]=u>>>24&255,r[12]=N>>>0&255,r[13]=N>>>8&255,r[14]=N>>>16&255,r[15]=N>>>24&255,r[16]=o>>>0&255,r[17]=o>>>8&255,r[18]=o>>>16&255,r[19]=o>>>24&255,r[20]=h>>>0&255,r[21]=h>>>8&255,r[22]=h>>>16&255,r[23]=h>>>24&255,r[24]=b>>>0&255,r[25]=b>>>8&255,r[26]=b>>>16&255,r[27]=b>>>24&255,r[28]=c>>>0&255,r[29]=c>>>8&255,r[30]=c>>>16&255,r[31]=c>>>24&255}function Bf(r,x,t,f){j0(r,x,t,f)}function Sf(r,x,t,f){L0(r,x,t,f)}var bf=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function i0(r,x,t,f,e,a,i){var s=new Uint8Array(16),l=new Uint8Array(64),B,v;for(v=0;v<16;v++)s[v]=0;for(v=0;v<8;v++)s[v]=a[v];for(;e>=64;){for(Bf(l,s,i,bf),v=0;v<64;v++)r[x+v]=t[f+v]^l[v];for(B=1,v=8;v<16;v++)B=B+(s[v]&255)|0,s[v]=B&255,B>>>=8;e-=64,x+=64,f+=64}if(e>0)for(Bf(l,s,i,bf),v=0;v<e;v++)r[x+v]=t[f+v]^l[v];return 0}function o0(r,x,t,f,e){var a=new Uint8Array(16),i=new Uint8Array(64),s,l;for(l=0;l<16;l++)a[l]=0;for(l=0;l<8;l++)a[l]=f[l];for(;t>=64;){for(Bf(i,a,e,bf),l=0;l<64;l++)r[x+l]=i[l];for(s=1,l=8;l<16;l++)s=s+(a[l]&255)|0,a[l]=s&255,s>>>=8;t-=64,x+=64}if(t>0)for(Bf(i,a,e,bf),l=0;l<t;l++)r[x+l]=i[l];return 0}function h0(r,x,t,f,e){var a=new Uint8Array(32);Sf(a,f,e,bf);for(var i=new Uint8Array(8),s=0;s<8;s++)i[s]=f[s+16];return o0(r,x,t,i,a)}function Kf(r,x,t,f,e,a,i){var s=new Uint8Array(32);Sf(s,a,i,bf);for(var l=new Uint8Array(8),B=0;B<8;B++)l[B]=a[B+16];return i0(r,x,t,f,e,l,s)}var Tf=function(r){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var x,t,f,e,a,i,s,l;x=r[0]&255|(r[1]&255)<<8,this.r[0]=x&8191,t=r[2]&255|(r[3]&255)<<8,this.r[1]=(x>>>13|t<<3)&8191,f=r[4]&255|(r[5]&255)<<8,this.r[2]=(t>>>10|f<<6)&7939,e=r[6]&255|(r[7]&255)<<8,this.r[3]=(f>>>7|e<<9)&8191,a=r[8]&255|(r[9]&255)<<8,this.r[4]=(e>>>4|a<<12)&255,this.r[5]=a>>>1&8190,i=r[10]&255|(r[11]&255)<<8,this.r[6]=(a>>>14|i<<2)&8191,s=r[12]&255|(r[13]&255)<<8,this.r[7]=(i>>>11|s<<5)&8065,l=r[14]&255|(r[15]&255)<<8,this.r[8]=(s>>>8|l<<8)&8191,this.r[9]=l>>>5&127,this.pad[0]=r[16]&255|(r[17]&255)<<8,this.pad[1]=r[18]&255|(r[19]&255)<<8,this.pad[2]=r[20]&255|(r[21]&255)<<8,this.pad[3]=r[22]&255|(r[23]&255)<<8,this.pad[4]=r[24]&255|(r[25]&255)<<8,this.pad[5]=r[26]&255|(r[27]&255)<<8,this.pad[6]=r[28]&255|(r[29]&255)<<8,this.pad[7]=r[30]&255|(r[31]&255)<<8};Tf.prototype.blocks=function(r,x,t){for(var f=this.fin?0:2048,e,a,i,s,l,B,v,q,w,Y,M,O,C,j,R,L,E,S,_,g=this.h[0],U=this.h[1],y=this.h[2],o=this.h[3],h=this.h[4],b=this.h[5],c=this.h[6],u=this.h[7],d=this.h[8],T=this.h[9],z=this.r[0],F=this.r[1],N=this.r[2],n=this.r[3],K=this.r[4],G=this.r[5],X=this.r[6],I=this.r[7],P=this.r[8],D=this.r[9];t>=16;)e=r[x+0]&255|(r[x+1]&255)<<8,g+=e&8191,a=r[x+2]&255|(r[x+3]&255)<<8,U+=(e>>>13|a<<3)&8191,i=r[x+4]&255|(r[x+5]&255)<<8,y+=(a>>>10|i<<6)&8191,s=r[x+6]&255|(r[x+7]&255)<<8,o+=(i>>>7|s<<9)&8191,l=r[x+8]&255|(r[x+9]&255)<<8,h+=(s>>>4|l<<12)&8191,b+=l>>>1&8191,B=r[x+10]&255|(r[x+11]&255)<<8,c+=(l>>>14|B<<2)&8191,v=r[x+12]&255|(r[x+13]&255)<<8,u+=(B>>>11|v<<5)&8191,q=r[x+14]&255|(r[x+15]&255)<<8,d+=(v>>>8|q<<8)&8191,T+=q>>>5|f,w=0,Y=w,Y+=g*z,Y+=U*(5*D),Y+=y*(5*P),Y+=o*(5*I),Y+=h*(5*X),w=Y>>>13,Y&=8191,Y+=b*(5*G),Y+=c*(5*K),Y+=u*(5*n),Y+=d*(5*N),Y+=T*(5*F),w+=Y>>>13,Y&=8191,M=w,M+=g*F,M+=U*z,M+=y*(5*D),M+=o*(5*P),M+=h*(5*I),w=M>>>13,M&=8191,M+=b*(5*X),M+=c*(5*G),M+=u*(5*K),M+=d*(5*n),M+=T*(5*N),w+=M>>>13,M&=8191,O=w,O+=g*N,O+=U*F,O+=y*z,O+=o*(5*D),O+=h*(5*P),w=O>>>13,O&=8191,O+=b*(5*I),O+=c*(5*X),O+=u*(5*G),O+=d*(5*K),O+=T*(5*n),w+=O>>>13,O&=8191,C=w,C+=g*n,C+=U*N,C+=y*F,C+=o*z,C+=h*(5*D),w=C>>>13,C&=8191,C+=b*(5*P),C+=c*(5*I),C+=u*(5*X),C+=d*(5*G),C+=T*(5*K),w+=C>>>13,C&=8191,j=w,j+=g*K,j+=U*n,j+=y*N,j+=o*F,j+=h*z,w=j>>>13,j&=8191,j+=b*(5*D),j+=c*(5*P),j+=u*(5*I),j+=d*(5*X),j+=T*(5*G),w+=j>>>13,j&=8191,R=w,R+=g*G,R+=U*K,R+=y*n,R+=o*N,R+=h*F,w=R>>>13,R&=8191,R+=b*z,R+=c*(5*D),R+=u*(5*P),R+=d*(5*I),R+=T*(5*X),w+=R>>>13,R&=8191,L=w,L+=g*X,L+=U*G,L+=y*K,L+=o*n,L+=h*N,w=L>>>13,L&=8191,L+=b*F,L+=c*z,L+=u*(5*D),L+=d*(5*P),L+=T*(5*I),w+=L>>>13,L&=8191,E=w,E+=g*I,E+=U*X,E+=y*G,E+=o*K,E+=h*n,w=E>>>13,E&=8191,E+=b*N,E+=c*F,E+=u*z,E+=d*(5*D),E+=T*(5*P),w+=E>>>13,E&=8191,S=w,S+=g*P,S+=U*I,S+=y*X,S+=o*G,S+=h*K,w=S>>>13,S&=8191,S+=b*n,S+=c*N,S+=u*F,S+=d*z,S+=T*(5*D),w+=S>>>13,S&=8191,_=w,_+=g*D,_+=U*P,_+=y*I,_+=o*X,_+=h*G,w=_>>>13,_&=8191,_+=b*K,_+=c*n,_+=u*N,_+=d*F,_+=T*z,w+=_>>>13,_&=8191,w=(w<<2)+w|0,w=w+Y|0,Y=w&8191,w=w>>>13,M+=w,g=Y,U=M,y=O,o=C,h=j,b=R,c=L,u=E,d=S,T=_,x+=16,t-=16;this.h[0]=g,this.h[1]=U,this.h[2]=y,this.h[3]=o,this.h[4]=h,this.h[5]=b,this.h[6]=c,this.h[7]=u,this.h[8]=d,this.h[9]=T},Tf.prototype.finish=function(r,x){var t=new Uint16Array(10),f,e,a,i;if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(f=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=f,f=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=f*5,f=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=f,f=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=f,t[0]=this.h[0]+5,f=t[0]>>>13,t[0]&=8191,i=1;i<10;i++)t[i]=this.h[i]+f,f=t[i]>>>13,t[i]&=8191;for(t[9]-=8192,e=(f^1)-1,i=0;i<10;i++)t[i]&=e;for(e=~e,i=0;i<10;i++)this.h[i]=this.h[i]&e|t[i];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,a=this.h[0]+this.pad[0],this.h[0]=a&65535,i=1;i<8;i++)a=(this.h[i]+this.pad[i]|0)+(a>>>16)|0,this.h[i]=a&65535;r[x+0]=this.h[0]>>>0&255,r[x+1]=this.h[0]>>>8&255,r[x+2]=this.h[1]>>>0&255,r[x+3]=this.h[1]>>>8&255,r[x+4]=this.h[2]>>>0&255,r[x+5]=this.h[2]>>>8&255,r[x+6]=this.h[3]>>>0&255,r[x+7]=this.h[3]>>>8&255,r[x+8]=this.h[4]>>>0&255,r[x+9]=this.h[4]>>>8&255,r[x+10]=this.h[5]>>>0&255,r[x+11]=this.h[5]>>>8&255,r[x+12]=this.h[6]>>>0&255,r[x+13]=this.h[6]>>>8&255,r[x+14]=this.h[7]>>>0&255,r[x+15]=this.h[7]>>>8&255},Tf.prototype.update=function(r,x,t){var f,e;if(this.leftover){for(e=16-this.leftover,e>t&&(e=t),f=0;f<e;f++)this.buffer[this.leftover+f]=r[x+f];if(t-=e,x+=e,this.leftover+=e,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(t>=16&&(e=t-t%16,this.blocks(r,x,e),x+=e,t-=e),t){for(f=0;f<t;f++)this.buffer[this.leftover+f]=r[x+f];this.leftover+=t}};function Zf(r,x,t,f,e,a){var i=new Tf(a);return i.update(t,f,e),i.finish(r,x),0}function c0(r,x,t,f,e,a){var i=new Uint8Array(16);return Zf(i,0,t,f,e,a),a0(r,x,i,0)}function Pf(r,x,t,f,e){var a;if(t<32)return-1;for(Kf(r,0,x,0,t,f,e),Zf(r,16,r,32,t-32,r),a=0;a<16;a++)r[a]=0;return 0}function Df(r,x,t,f,e){var a,i=new Uint8Array(32);if(t<32||(h0(i,0,32,f,e),c0(x,16,x,32,t-32,i)!==0))return-1;for(Kf(r,0,x,0,t,f,e),a=0;a<32;a++)r[a]=0;return 0}function sf(r,x){var t;for(t=0;t<16;t++)r[t]=x[t]|0}function qf(r){var x,t,f=1;for(x=0;x<16;x++)t=r[x]+f+65535,f=Math.floor(t/65536),r[x]=t-f*65536;r[0]+=f-1+37*(f-1)}function yf(r,x,t){for(var f,e=~(t-1),a=0;a<16;a++)f=e&(r[a]^x[a]),r[a]^=f,x[a]^=f}function vf(r,x){var t,f,e,a=p(),i=p();for(t=0;t<16;t++)i[t]=x[t];for(qf(i),qf(i),qf(i),f=0;f<2;f++){for(a[0]=i[0]-65517,t=1;t<15;t++)a[t]=i[t]-65535-(a[t-1]>>16&1),a[t-1]&=65535;a[15]=i[15]-32767-(a[14]>>16&1),e=a[15]>>16&1,a[14]&=65535,yf(i,a,1-e)}for(t=0;t<16;t++)r[2*t]=i[t]&255,r[2*t+1]=i[t]>>8}function s0(r,x){var t=new Uint8Array(32),f=new Uint8Array(32);return vf(t,r),vf(f,x),If(t,0,f,0)}function u0(r){var x=new Uint8Array(32);return vf(x,r),x[0]&1}function Gf(r,x){var t;for(t=0;t<16;t++)r[t]=x[2*t]+(x[2*t+1]<<8);r[15]&=32767}function hf(r,x,t){for(var f=0;f<16;f++)r[f]=x[f]+t[f]}function cf(r,x,t){for(var f=0;f<16;f++)r[f]=x[f]-t[f]}function Z(r,x,t){var f,e,a=0,i=0,s=0,l=0,B=0,v=0,q=0,w=0,Y=0,M=0,O=0,C=0,j=0,R=0,L=0,E=0,S=0,_=0,g=0,U=0,y=0,o=0,h=0,b=0,c=0,u=0,d=0,T=0,z=0,F=0,N=0,n=t[0],K=t[1],G=t[2],X=t[3],I=t[4],P=t[5],D=t[6],m=t[7],$=t[8],H=t[9],J=t[10],Q=t[11],k=t[12],tf=t[13],xf=t[14],ef=t[15];f=x[0],a+=f*n,i+=f*K,s+=f*G,l+=f*X,B+=f*I,v+=f*P,q+=f*D,w+=f*m,Y+=f*$,M+=f*H,O+=f*J,C+=f*Q,j+=f*k,R+=f*tf,L+=f*xf,E+=f*ef,f=x[1],i+=f*n,s+=f*K,l+=f*G,B+=f*X,v+=f*I,q+=f*P,w+=f*D,Y+=f*m,M+=f*$,O+=f*H,C+=f*J,j+=f*Q,R+=f*k,L+=f*tf,E+=f*xf,S+=f*ef,f=x[2],s+=f*n,l+=f*K,B+=f*G,v+=f*X,q+=f*I,w+=f*P,Y+=f*D,M+=f*m,O+=f*$,C+=f*H,j+=f*J,R+=f*Q,L+=f*k,E+=f*tf,S+=f*xf,_+=f*ef,f=x[3],l+=f*n,B+=f*K,v+=f*G,q+=f*X,w+=f*I,Y+=f*P,M+=f*D,O+=f*m,C+=f*$,j+=f*H,R+=f*J,L+=f*Q,E+=f*k,S+=f*tf,_+=f*xf,g+=f*ef,f=x[4],B+=f*n,v+=f*K,q+=f*G,w+=f*X,Y+=f*I,M+=f*P,O+=f*D,C+=f*m,j+=f*$,R+=f*H,L+=f*J,E+=f*Q,S+=f*k,_+=f*tf,g+=f*xf,U+=f*ef,f=x[5],v+=f*n,q+=f*K,w+=f*G,Y+=f*X,M+=f*I,O+=f*P,C+=f*D,j+=f*m,R+=f*$,L+=f*H,E+=f*J,S+=f*Q,_+=f*k,g+=f*tf,U+=f*xf,y+=f*ef,f=x[6],q+=f*n,w+=f*K,Y+=f*G,M+=f*X,O+=f*I,C+=f*P,j+=f*D,R+=f*m,L+=f*$,E+=f*H,S+=f*J,_+=f*Q,g+=f*k,U+=f*tf,y+=f*xf,o+=f*ef,f=x[7],w+=f*n,Y+=f*K,M+=f*G,O+=f*X,C+=f*I,j+=f*P,R+=f*D,L+=f*m,E+=f*$,S+=f*H,_+=f*J,g+=f*Q,U+=f*k,y+=f*tf,o+=f*xf,h+=f*ef,f=x[8],Y+=f*n,M+=f*K,O+=f*G,C+=f*X,j+=f*I,R+=f*P,L+=f*D,E+=f*m,S+=f*$,_+=f*H,g+=f*J,U+=f*Q,y+=f*k,o+=f*tf,h+=f*xf,b+=f*ef,f=x[9],M+=f*n,O+=f*K,C+=f*G,j+=f*X,R+=f*I,L+=f*P,E+=f*D,S+=f*m,_+=f*$,g+=f*H,U+=f*J,y+=f*Q,o+=f*k,h+=f*tf,b+=f*xf,c+=f*ef,f=x[10],O+=f*n,C+=f*K,j+=f*G,R+=f*X,L+=f*I,E+=f*P,S+=f*D,_+=f*m,g+=f*$,U+=f*H,y+=f*J,o+=f*Q,h+=f*k,b+=f*tf,c+=f*xf,u+=f*ef,f=x[11],C+=f*n,j+=f*K,R+=f*G,L+=f*X,E+=f*I,S+=f*P,_+=f*D,g+=f*m,U+=f*$,y+=f*H,o+=f*J,h+=f*Q,b+=f*k,c+=f*tf,u+=f*xf,d+=f*ef,f=x[12],j+=f*n,R+=f*K,L+=f*G,E+=f*X,S+=f*I,_+=f*P,g+=f*D,U+=f*m,y+=f*$,o+=f*H,h+=f*J,b+=f*Q,c+=f*k,u+=f*tf,d+=f*xf,T+=f*ef,f=x[13],R+=f*n,L+=f*K,E+=f*G,S+=f*X,_+=f*I,g+=f*P,U+=f*D,y+=f*m,o+=f*$,h+=f*H,b+=f*J,c+=f*Q,u+=f*k,d+=f*tf,T+=f*xf,z+=f*ef,f=x[14],L+=f*n,E+=f*K,S+=f*G,_+=f*X,g+=f*I,U+=f*P,y+=f*D,o+=f*m,h+=f*$,b+=f*H,c+=f*J,u+=f*Q,d+=f*k,T+=f*tf,z+=f*xf,F+=f*ef,f=x[15],E+=f*n,S+=f*K,_+=f*G,g+=f*X,U+=f*I,y+=f*P,o+=f*D,h+=f*m,b+=f*$,c+=f*H,u+=f*J,d+=f*Q,T+=f*k,z+=f*tf,F+=f*xf,N+=f*ef,a+=38*S,i+=38*_,s+=38*g,l+=38*U,B+=38*y,v+=38*o,q+=38*h,w+=38*b,Y+=38*c,M+=38*u,O+=38*d,C+=38*T,j+=38*z,R+=38*F,L+=38*N,e=1,f=a+e+65535,e=Math.floor(f/65536),a=f-e*65536,f=i+e+65535,e=Math.floor(f/65536),i=f-e*65536,f=s+e+65535,e=Math.floor(f/65536),s=f-e*65536,f=l+e+65535,e=Math.floor(f/65536),l=f-e*65536,f=B+e+65535,e=Math.floor(f/65536),B=f-e*65536,f=v+e+65535,e=Math.floor(f/65536),v=f-e*65536,f=q+e+65535,e=Math.floor(f/65536),q=f-e*65536,f=w+e+65535,e=Math.floor(f/65536),w=f-e*65536,f=Y+e+65535,e=Math.floor(f/65536),Y=f-e*65536,f=M+e+65535,e=Math.floor(f/65536),M=f-e*65536,f=O+e+65535,e=Math.floor(f/65536),O=f-e*65536,f=C+e+65535,e=Math.floor(f/65536),C=f-e*65536,f=j+e+65535,e=Math.floor(f/65536),j=f-e*65536,f=R+e+65535,e=Math.floor(f/65536),R=f-e*65536,f=L+e+65535,e=Math.floor(f/65536),L=f-e*65536,f=E+e+65535,e=Math.floor(f/65536),E=f-e*65536,a+=e-1+37*(e-1),e=1,f=a+e+65535,e=Math.floor(f/65536),a=f-e*65536,f=i+e+65535,e=Math.floor(f/65536),i=f-e*65536,f=s+e+65535,e=Math.floor(f/65536),s=f-e*65536,f=l+e+65535,e=Math.floor(f/65536),l=f-e*65536,f=B+e+65535,e=Math.floor(f/65536),B=f-e*65536,f=v+e+65535,e=Math.floor(f/65536),v=f-e*65536,f=q+e+65535,e=Math.floor(f/65536),q=f-e*65536,f=w+e+65535,e=Math.floor(f/65536),w=f-e*65536,f=Y+e+65535,e=Math.floor(f/65536),Y=f-e*65536,f=M+e+65535,e=Math.floor(f/65536),M=f-e*65536,f=O+e+65535,e=Math.floor(f/65536),O=f-e*65536,f=C+e+65535,e=Math.floor(f/65536),C=f-e*65536,f=j+e+65535,e=Math.floor(f/65536),j=f-e*65536,f=R+e+65535,e=Math.floor(f/65536),R=f-e*65536,f=L+e+65535,e=Math.floor(f/65536),L=f-e*65536,f=E+e+65535,e=Math.floor(f/65536),E=f-e*65536,a+=e-1+37*(e-1),r[0]=a,r[1]=i,r[2]=s,r[3]=l,r[4]=B,r[5]=v,r[6]=q,r[7]=w,r[8]=Y,r[9]=M,r[10]=O,r[11]=C,r[12]=j,r[13]=R,r[14]=L,r[15]=E}function af(r,x){Z(r,x,x)}function b0(r,x){var t=p(),f;for(f=0;f<16;f++)t[f]=x[f];for(f=253;f>=0;f--)af(t,t),f!==2&&f!==4&&Z(t,t,x);for(f=0;f<16;f++)r[f]=t[f]}function d0(r,x){var t=p(),f;for(f=0;f<16;f++)t[f]=x[f];for(f=250;f>=0;f--)af(t,t),f!==1&&Z(t,t,x);for(f=0;f<16;f++)r[f]=t[f]}function Yf(r,x,t){var f=new Uint8Array(32),e=new Float64Array(80),a,i,s=p(),l=p(),B=p(),v=p(),q=p(),w=p();for(i=0;i<31;i++)f[i]=x[i];for(f[31]=x[31]&127|64,f[0]&=248,Gf(e,t),i=0;i<16;i++)l[i]=e[i],v[i]=s[i]=B[i]=0;for(s[0]=v[0]=1,i=254;i>=0;--i)a=f[i>>>3]>>>(i&7)&1,yf(s,l,a),yf(B,v,a),hf(q,s,B),cf(s,s,B),hf(B,l,v),cf(l,l,v),af(v,q),af(w,s),Z(s,B,s),Z(B,l,q),hf(q,s,B),cf(s,s,B),af(l,s),cf(B,v,w),Z(s,B,T0),hf(s,s,v),Z(B,B,s),Z(s,v,w),Z(v,l,e),af(l,q),yf(s,l,a),yf(B,v,a);for(i=0;i<16;i++)e[i+16]=s[i],e[i+32]=B[i],e[i+48]=l[i],e[i+64]=v[i];var Y=e.subarray(32),M=e.subarray(16);return b0(Y,Y),Z(M,M,Y),vf(r,M),0}function Mf(r,x){return Yf(r,x,rf)}function l0(r,x){return V(x,32),Mf(r,x)}function jf(r,x,t){var f=new Uint8Array(32);return Yf(f,t,x),Sf(r,W,f,bf)}var y0=Pf,R0=Df;function C0(r,x,t,f,e,a){var i=new Uint8Array(32);return jf(i,e,a),y0(r,x,t,f,i)}function O0(r,x,t,f,e,a){var i=new Uint8Array(32);return jf(i,e,a),R0(r,x,t,f,i)}var v0=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _0(r,x,t,f){for(var e=new Int32Array(16),a=new Int32Array(16),i,s,l,B,v,q,w,Y,M,O,C,j,R,L,E,S,_,g,U,y,o,h,b,c,u,d,T=r[0],z=r[1],F=r[2],N=r[3],n=r[4],K=r[5],G=r[6],X=r[7],I=x[0],P=x[1],D=x[2],m=x[3],$=x[4],H=x[5],J=x[6],Q=x[7],k=0;f>=128;){for(U=0;U<16;U++)y=8*U+k,e[U]=t[y+0]<<24|t[y+1]<<16|t[y+2]<<8|t[y+3],a[U]=t[y+4]<<24|t[y+5]<<16|t[y+6]<<8|t[y+7];for(U=0;U<80;U++)if(i=T,s=z,l=F,B=N,v=n,q=K,w=G,Y=X,M=I,O=P,C=D,j=m,R=$,L=H,E=J,S=Q,o=X,h=Q,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=(n>>>14|$<<18)^(n>>>18|$<<14)^($>>>9|n<<23),h=($>>>14|n<<18)^($>>>18|n<<14)^(n>>>9|$<<23),b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,o=n&K^~n&G,h=$&H^~$&J,b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,o=v0[U*2],h=v0[U*2+1],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,o=e[U%16],h=a[U%16],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,_=u&65535|d<<16,g=b&65535|c<<16,o=_,h=g,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=(T>>>28|I<<4)^(I>>>2|T<<30)^(I>>>7|T<<25),h=(I>>>28|T<<4)^(T>>>2|I<<30)^(T>>>7|I<<25),b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,o=T&z^T&F^z&F,h=I&P^I&D^P&D,b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,Y=u&65535|d<<16,S=b&65535|c<<16,o=B,h=j,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=_,h=g,b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,B=u&65535|d<<16,j=b&65535|c<<16,z=i,F=s,N=l,n=B,K=v,G=q,X=w,T=Y,P=M,D=O,m=C,$=j,H=R,J=L,Q=E,I=S,U%16===15)for(y=0;y<16;y++)o=e[y],h=a[y],b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=e[(y+9)%16],h=a[(y+9)%16],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,_=e[(y+1)%16],g=a[(y+1)%16],o=(_>>>1|g<<31)^(_>>>8|g<<24)^_>>>7,h=(g>>>1|_<<31)^(g>>>8|_<<24)^(g>>>7|_<<25),b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,_=e[(y+14)%16],g=a[(y+14)%16],o=(_>>>19|g<<13)^(g>>>29|_<<3)^_>>>6,h=(g>>>19|_<<13)^(_>>>29|g<<3)^(g>>>6|_<<26),b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,e[y]=u&65535|d<<16,a[y]=b&65535|c<<16;o=T,h=I,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[0],h=x[0],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[0]=T=u&65535|d<<16,x[0]=I=b&65535|c<<16,o=z,h=P,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[1],h=x[1],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[1]=z=u&65535|d<<16,x[1]=P=b&65535|c<<16,o=F,h=D,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[2],h=x[2],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[2]=F=u&65535|d<<16,x[2]=D=b&65535|c<<16,o=N,h=m,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[3],h=x[3],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[3]=N=u&65535|d<<16,x[3]=m=b&65535|c<<16,o=n,h=$,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[4],h=x[4],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[4]=n=u&65535|d<<16,x[4]=$=b&65535|c<<16,o=K,h=H,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[5],h=x[5],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[5]=K=u&65535|d<<16,x[5]=H=b&65535|c<<16,o=G,h=J,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[6],h=x[6],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[6]=G=u&65535|d<<16,x[6]=J=b&65535|c<<16,o=X,h=Q,b=h&65535,c=h>>>16,u=o&65535,d=o>>>16,o=r[7],h=x[7],b+=h&65535,c+=h>>>16,u+=o&65535,d+=o>>>16,c+=b>>>16,u+=c>>>16,d+=u>>>16,r[7]=X=u&65535|d<<16,x[7]=Q=b&65535|c<<16,k+=128,f-=128}return f}function df(r,x,t){var f=new Int32Array(8),e=new Int32Array(8),a=new Uint8Array(256),i,s=t;for(f[0]=1779033703,f[1]=3144134277,f[2]=1013904242,f[3]=2773480762,f[4]=1359893119,f[5]=2600822924,f[6]=528734635,f[7]=1541459225,e[0]=4089235720,e[1]=2227873595,e[2]=4271175723,e[3]=1595750129,e[4]=2917565137,e[5]=725511199,e[6]=4215389547,e[7]=327033209,_0(f,e,x,t),t%=128,i=0;i<t;i++)a[i]=x[s-t+i];for(a[t]=128,t=256-128*(t<112?1:0),a[t-9]=0,n0(a,t-8,s/536870912|0,s<<3),_0(f,e,a,t),i=0;i<8;i++)n0(r,8*i,f[i],e[i]);return 0}function Lf(r,x){var t=p(),f=p(),e=p(),a=p(),i=p(),s=p(),l=p(),B=p(),v=p();cf(t,r[1],r[0]),cf(v,x[1],x[0]),Z(t,t,v),hf(f,r[0],r[1]),hf(v,x[0],x[1]),Z(f,f,v),Z(e,r[3],x[3]),Z(e,e,Y0),Z(a,r[2],x[2]),hf(a,a,a),cf(i,f,t),cf(s,a,e),hf(l,a,e),hf(B,f,t),Z(r[0],i,s),Z(r[1],B,l),Z(r[2],l,s),Z(r[3],i,B)}function w0(r,x,t){var f;for(f=0;f<4;f++)yf(r[f],x[f],t)}function Xf(r,x){var t=p(),f=p(),e=p();b0(e,x[2]),Z(t,x[0],e),Z(f,x[1],e),vf(r,f),r[31]^=u0(t)<<7}function $f(r,x,t){var f,e;for(sf(r[0],of),sf(r[1],Uf),sf(r[2],Uf),sf(r[3],of),e=255;e>=0;--e)f=t[e/8|0]>>(e&7)&1,w0(r,x,f),Lf(x,r),Lf(r,r),w0(r,x,f)}function Rf(r,x){var t=[p(),p(),p(),p()];sf(t[0],x0),sf(t[1],e0),sf(t[2],Uf),Z(t[3],x0,e0),$f(r,t,x)}function Vf(r,x,t){var f=new Uint8Array(64),e=[p(),p(),p(),p()],a;for(t||V(x,32),df(f,x,32),f[0]&=248,f[31]&=127,f[31]|=64,Rf(e,f),Xf(r,e),a=0;a<32;a++)x[a+32]=r[a];return 0}var Cf=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function Wf(r,x){var t,f,e,a;for(f=63;f>=32;--f){for(t=0,e=f-32,a=f-12;e<a;++e)x[e]+=t-16*x[f]*Cf[e-(f-32)],t=Math.floor((x[e]+128)/256),x[e]-=t*256;x[e]+=t,x[f]=0}for(t=0,e=0;e<32;e++)x[e]+=t-(x[31]>>4)*Cf[e],t=x[e]>>8,x[e]&=255;for(e=0;e<32;e++)x[e]-=t*Cf[e];for(f=0;f<32;f++)x[f+1]+=x[f]>>8,r[f]=x[f]&255}function Hf(r){var x=new Float64Array(64),t;for(t=0;t<64;t++)x[t]=r[t];for(t=0;t<64;t++)r[t]=0;Wf(r,x)}function p0(r,x,t,f){var e=new Uint8Array(64),a=new Uint8Array(64),i=new Uint8Array(64),s,l,B=new Float64Array(64),v=[p(),p(),p(),p()];df(e,f,32),e[0]&=248,e[31]&=127,e[31]|=64;var q=t+64;for(s=0;s<t;s++)r[64+s]=x[s];for(s=0;s<32;s++)r[32+s]=e[32+s];for(df(i,r.subarray(32),t+32),Hf(i),Rf(v,i),Xf(r,v),s=32;s<64;s++)r[s]=f[s];for(df(a,r,t+64),Hf(a),s=0;s<64;s++)B[s]=0;for(s=0;s<32;s++)B[s]=i[s];for(s=0;s<32;s++)for(l=0;l<32;l++)B[s+l]+=a[s]*e[l];return Wf(r.subarray(32),B),q}function z0(r,x){var t=p(),f=p(),e=p(),a=p(),i=p(),s=p(),l=p();return sf(r[2],Uf),Gf(r[1],x),af(e,r[1]),Z(a,e,t0),cf(e,e,r[2]),hf(a,r[2],a),af(i,a),af(s,i),Z(l,s,i),Z(t,l,e),Z(t,t,a),d0(t,t),Z(t,t,e),Z(t,t,a),Z(t,t,a),Z(r[0],t,a),af(f,r[0]),Z(f,f,a),s0(f,e)&&Z(r[0],r[0],M0),af(f,r[0]),Z(f,f,a),s0(f,e)?-1:(u0(r[0])===x[31]>>7&&cf(r[0],of,r[0]),Z(r[3],r[0],r[1]),0)}function Jf(r,x,t,f){var e,a=new Uint8Array(32),i=new Uint8Array(64),s=[p(),p(),p(),p()],l=[p(),p(),p(),p()];if(t<64||z0(l,f))return-1;for(e=0;e<t;e++)r[e]=x[e];for(e=0;e<32;e++)r[e+32]=f[e];if(df(i,r,t),Hf(i),$f(s,l,i),Rf(l,x.subarray(32)),Lf(s,l),Xf(a,s),t-=64,If(x,0,a,0)){for(e=0;e<t;e++)r[e]=0;return-1}for(e=0;e<t;e++)r[e]=x[e+64];return t}var Qf=32,Of=24,pf=32,_f=16,Ef=32,zf=32,gf=32,Af=32,mf=32,E0=Of,N0=pf,F0=_f,uf=64,lf=32,wf=64,kf=32,f0=64;A.lowlevel={crypto_core_hsalsa20:Sf,crypto_stream_xor:Kf,crypto_stream:h0,crypto_stream_salsa20_xor:i0,crypto_stream_salsa20:o0,crypto_onetimeauth:Zf,crypto_onetimeauth_verify:c0,crypto_verify_16:a0,crypto_verify_32:If,crypto_secretbox:Pf,crypto_secretbox_open:Df,crypto_scalarmult:Yf,crypto_scalarmult_base:Mf,crypto_box_beforenm:jf,crypto_box_afternm:y0,crypto_box:C0,crypto_box_open:O0,crypto_box_keypair:l0,crypto_hash:df,crypto_sign:p0,crypto_sign_keypair:Vf,crypto_sign_open:Jf,crypto_secretbox_KEYBYTES:Qf,crypto_secretbox_NONCEBYTES:Of,crypto_secretbox_ZEROBYTES:pf,crypto_secretbox_BOXZEROBYTES:_f,crypto_scalarmult_BYTES:Ef,crypto_scalarmult_SCALARBYTES:zf,crypto_box_PUBLICKEYBYTES:gf,crypto_box_SECRETKEYBYTES:Af,crypto_box_BEFORENMBYTES:mf,crypto_box_NONCEBYTES:E0,crypto_box_ZEROBYTES:N0,crypto_box_BOXZEROBYTES:F0,crypto_sign_BYTES:uf,crypto_sign_PUBLICKEYBYTES:lf,crypto_sign_SECRETKEYBYTES:wf,crypto_sign_SEEDBYTES:kf,crypto_hash_BYTES:f0,gf:p,D:t0,L:Cf,pack25519:vf,unpack25519:Gf,M:Z,A:hf,S:af,Z:cf,pow2523:d0,add:Lf,set25519:sf,modL:Wf,scalarmult:$f,scalarbase:Rf};function g0(r,x){if(r.length!==Qf)throw new Error("bad key size");if(x.length!==Of)throw new Error("bad nonce size")}function I0(r,x){if(r.length!==gf)throw new Error("bad public key size");if(x.length!==Af)throw new Error("bad secret key size")}function nf(){for(var r=0;r<arguments.length;r++)if(!(arguments[r]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function A0(r){for(var x=0;x<r.length;x++)r[x]=0}A.randomBytes=function(r){var x=new Uint8Array(r);return V(x,r),x},A.secretbox=function(r,x,t){nf(r,x,t),g0(t,x);for(var f=new Uint8Array(pf+r.length),e=new Uint8Array(f.length),a=0;a<r.length;a++)f[a+pf]=r[a];return Pf(e,f,f.length,x,t),e.subarray(_f)},A.secretbox.open=function(r,x,t){nf(r,x,t),g0(t,x);for(var f=new Uint8Array(_f+r.length),e=new Uint8Array(f.length),a=0;a<r.length;a++)f[a+_f]=r[a];return f.length<32||Df(e,f,f.length,x,t)!==0?null:e.subarray(pf)},A.secretbox.keyLength=Qf,A.secretbox.nonceLength=Of,A.secretbox.overheadLength=_f,A.scalarMult=function(r,x){if(nf(r,x),r.length!==zf)throw new Error("bad n size");if(x.length!==Ef)throw new Error("bad p size");var t=new Uint8Array(Ef);return Yf(t,r,x),t},A.scalarMult.base=function(r){if(nf(r),r.length!==zf)throw new Error("bad n size");var x=new Uint8Array(Ef);return Mf(x,r),x},A.scalarMult.scalarLength=zf,A.scalarMult.groupElementLength=Ef,A.box=function(r,x,t,f){var e=A.box.before(t,f);return A.secretbox(r,x,e)},A.box.before=function(r,x){nf(r,x),I0(r,x);var t=new Uint8Array(mf);return jf(t,r,x),t},A.box.after=A.secretbox,A.box.open=function(r,x,t,f){var e=A.box.before(t,f);return A.secretbox.open(r,x,e)},A.box.open.after=A.secretbox.open,A.box.keyPair=function(){var r=new Uint8Array(gf),x=new Uint8Array(Af);return l0(r,x),{publicKey:r,secretKey:x}},A.box.keyPair.fromSecretKey=function(r){if(nf(r),r.length!==Af)throw new Error("bad secret key size");var x=new Uint8Array(gf);return Mf(x,r),{publicKey:x,secretKey:new Uint8Array(r)}},A.box.publicKeyLength=gf,A.box.secretKeyLength=Af,A.box.sharedKeyLength=mf,A.box.nonceLength=E0,A.box.overheadLength=A.secretbox.overheadLength,A.sign=function(r,x){if(nf(r,x),x.length!==wf)throw new Error("bad secret key size");var t=new Uint8Array(uf+r.length);return p0(t,r,r.length,x),t},A.sign.open=function(r,x){if(nf(r,x),x.length!==lf)throw new Error("bad public key size");var t=new Uint8Array(r.length),f=Jf(t,r,r.length,x);if(f<0)return null;for(var e=new Uint8Array(f),a=0;a<e.length;a++)e[a]=t[a];return e},A.sign.detached=function(r,x){for(var t=A.sign(r,x),f=new Uint8Array(uf),e=0;e<f.length;e++)f[e]=t[e];return f},A.sign.detached.verify=function(r,x,t){if(nf(r,x,t),x.length!==uf)throw new Error("bad signature size");if(t.length!==lf)throw new Error("bad public key size");var f=new Uint8Array(uf+r.length),e=new Uint8Array(uf+r.length),a;for(a=0;a<uf;a++)f[a]=x[a];for(a=0;a<r.length;a++)f[a+uf]=r[a];return Jf(e,f,f.length,t)>=0},A.sign.keyPair=function(){var r=new Uint8Array(lf),x=new Uint8Array(wf);return Vf(r,x),{publicKey:r,secretKey:x}},A.sign.keyPair.fromSecretKey=function(r){if(nf(r),r.length!==wf)throw new Error("bad secret key size");for(var x=new Uint8Array(lf),t=0;t<x.length;t++)x[t]=r[32+t];return{publicKey:x,secretKey:new Uint8Array(r)}},A.sign.keyPair.fromSeed=function(r){if(nf(r),r.length!==kf)throw new Error("bad seed size");for(var x=new Uint8Array(lf),t=new Uint8Array(wf),f=0;f<32;f++)t[f]=r[f];return Vf(x,t,!0),{publicKey:x,secretKey:t}},A.sign.publicKeyLength=lf,A.sign.secretKeyLength=wf,A.sign.seedLength=kf,A.sign.signatureLength=uf,A.hash=function(r){nf(r);var x=new Uint8Array(f0);return df(x,r,r.length),x},A.hash.hashLength=f0,A.verify=function(r,x){return nf(r,x),r.length===0||x.length===0||r.length!==x.length?!1:Ff(r,0,x,0,r.length)===0},A.setPRNG=function(r){V=r},(function(){var r=typeof self<"u"?self.crypto||self.msCrypto:null;if(r&&r.getRandomValues){var x=65536;A.setPRNG(function(t,f){var e,a=new Uint8Array(f);for(e=0;e<f;e+=x)r.getRandomValues(a.subarray(e,e+Math.min(f-e,x)));for(e=0;e<f;e++)t[e]=a[e];A0(a)})}else typeof X0<"u"&&(r=W0,r&&r.randomBytes&&A.setPRNG(function(t,f){var e,a=r.randomBytes(f);for(e=0;e<f;e++)t[e]=a[e];A0(a)}))})()})(ff.exports?ff.exports:self.nacl=self.nacl||{})})(r0)),r0.exports}H0();var Nf={exports:{}},J0=Nf.exports,B0;function Q0(){return B0||(B0=1,(function(ff){(function(A,p){ff.exports?ff.exports=p():(A.nacl||(A.nacl={}),A.nacl.util=p())})(J0,function(){var A={};function p(V){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(V))throw new TypeError("invalid encoding")}return A.decodeUTF8=function(V){if(typeof V!="string")throw new TypeError("expected string");var W,rf=unescape(encodeURIComponent(V)),of=new Uint8Array(rf.length);for(W=0;W<rf.length;W++)of[W]=rf.charCodeAt(W);return of},A.encodeUTF8=function(V){var W,rf=[];for(W=0;W<V.length;W++)rf.push(String.fromCharCode(V[W]));return decodeURIComponent(escape(rf.join("")))},typeof atob>"u"?typeof Buffer.from<"u"?(A.encodeBase64=function(V){return Buffer.from(V).toString("base64")},A.decodeBase64=function(V){return p(V),new Uint8Array(Array.prototype.slice.call(Buffer.from(V,"base64"),0))}):(A.encodeBase64=function(V){return new Buffer(V).toString("base64")},A.decodeBase64=function(V){return p(V),new Uint8Array(Array.prototype.slice.call(new Buffer(V,"base64"),0))}):(A.encodeBase64=function(V){var W,rf=[],of=V.length;for(W=0;W<of;W++)rf.push(String.fromCharCode(V[W]));return btoa(rf.join(""))},A.decodeBase64=function(V){p(V);var W,rf=atob(V),of=new Uint8Array(rf.length);for(W=0;W<rf.length;W++)of[W]=rf.charCodeAt(W);return of}),A})})(Nf)),Nf.exports}Q0();let m0=(function(ff){return ff.WALLET_KERNEL="wallet-kernel",ff.PARTICIPANT="participant",ff.FIREBLOCKS="fireblocks",ff.BLOCKDAEMON="blockdaemon",ff.DFNS="dfns",ff.SECUROSYS="securosys",ff.BITGO="bitgo",ff})({});const k0=S0({provider:q0(m0),properties:Z0(D0(),P0()).optional()});S0({drivers:G0(k0).optional()});export{m0 as S};
|