Files
pezkuwi-apps/modu.dc85d2c93fa8a750.js
T
github-actions[bot] f3ee114735 Updates
2026-01-18 03:14:49 +00:00

1 line
143 KiB
JavaScript

"use strict";(("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps=("undefined"!=typeof self?self:this).webpackChunk_pezkuwi_apps||[]).push([[474],{3151(e,t,r){r.d(t,{b:()=>i});var s=r(98737),n=r(53403);function i(e,t){return(0,n.p)(e,()=>t.derive.chain.subscribeNewHeads().pipe((0,s.n)(e=>t.derive.chain.getBlock(e.createdAtHash||e.hash))))}},7971(e,t,r){r.d(t,{G:()=>p,i:()=>d});var s=r(59359),n=r(45118),i=r(18045),a=r(33307),o=r(98737),c=r(53403),u=r(66750);function d(e){return(t,r)=>(0,c.p)(t,()=>e(r).pipe((0,i.T)(u.a)))}function p(e,t,r){return e.queryAt(t.parentHash.isEmpty?r||t.hash:t.parentHash).pipe((0,o.n)(e=>function(e,t){const r=t.session?.validators?t.session.validators():(0,n.of)(null),{logs:[o]}=e.digest,c=o&&(o.isConsensus&&o.asConsensus[0].isNimbus&&o.asConsensus[1]||o.isPreRuntime&&o.asPreRuntime[0].isNimbus&&o.asPreRuntime[1]);if(c){if(t.authorMapping?.mappingWithDeposit)return(0,s.z)([(0,n.of)(e),r,t.authorMapping.mappingWithDeposit(c).pipe((0,i.T)(e=>e.unwrapOr({account:null}).account))]);if(t.teyrchainStaking?.selectedCandidates&&t.session?.nextKeys){const o=c.toHex();return(0,s.z)([(0,n.of)(e),r,t.teyrchainStaking.selectedCandidates().pipe((0,a.Z)(e=>(0,s.z)([(0,n.of)(e),t.session.nextKeys.multi(e).pipe((0,i.T)(e=>e.findIndex(e=>e.unwrapOrDefault().nimbus.toHex()===o)))])),(0,i.T)(([e,t])=>-1===t?null:e[t]))])}}return(0,s.z)([(0,n.of)(e),r,(0,n.of)(null)])}(t,e)))}},8196(e,t,r){r.d(t,{g:()=>d});var s=r(59359),n=r(98737),i=r(45118),a=r(18045),o=r(79832),c=r(53403),u=r(7971);function d(e,t){return(0,c.p)(e,e=>(0,s.z)([t.rpc.chain.getBlock(e),t.queryAt(e)]).pipe((0,n.n)(([r,n])=>(0,s.z)([(0,i.of)(r),n.system.events(),(0,u.G)(t,r.block.header,e)])),(0,a.T)(([e,t,[,r,s]])=>function(e,t,r,s,n){const i=e.createClass("SignedBlock");return new class extends i{#e;#t;#r;constructor(e,t,r,s,n){var i,a;super(e,t),this.#e=n||(0,o.D)(this.block.header.digest,s||[]),this.#t=r||[],this.#r=(i=this.block.extrinsics,a=this.#t,i.map((e,t)=>{let r,s;const n=a.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eq(t)).map(({event:e})=>("system"===e.section&&("ExtrinsicSuccess"===e.method?s=e.data[0]:"ExtrinsicFailed"===e.method&&(r=e.data[0],s=e.data[1])),e));return{dispatchError:r,dispatchInfo:s,events:n,extrinsic:e}})),this.createdAtHash=t?.createdAtHash}get author(){return this.#e}get events(){return this.#t}get extrinsics(){return this.#r}}(e,t,r,s,n)}(t.registry,e,t,r,s))))}},20659(e,t,r){r.d(t,{w:()=>o});const s=e=>e;function n(e,t,r,s){return e.filter(({event:e})=>t===e.section&&r.includes(e.method)).map(e=>s(e))}function i({event:{data:[e]}}){return e}function a({event:{data:e,method:t}}){return"ExtrinsicSuccess"===t?e[0]:e[1]}class o{dispatchError;dispatchInfo;internalError;events;status;txHash;txIndex;blockNumber;constructor({blockNumber:e,dispatchError:t,dispatchInfo:r,events:s,internalError:o,status:c,txHash:u,txIndex:d}){this.dispatchError=t||function(e=[]){return n(e,"system",["ExtrinsicFailed"],i)[0]}(s),this.dispatchInfo=r||function(e=[]){return n(e,"system",["ExtrinsicFailed","ExtrinsicSuccess"],a)[0]}(s),this.events=s||[],this.internalError=o,this.status=c,this.txHash=u,this.txIndex=d,this.blockNumber=e}get isCompleted(){return this.isError||this.status.isInBlock||this.status.isFinalized}get isError(){return this.status.isDropped||this.status.isFinalityTimeout||this.status.isInvalid||this.status.isUsurped}get isFinalized(){return this.status.isFinalized}get isInBlock(){return this.status.isInBlock}get isWarning(){return this.status.isRetracted}filterRecords(e,t){return n(this.events,e,Array.isArray(t)?t:[t],s)}findRecord(e,t){return this.filterRecords(e,t)[0]}toHuman(e){return{dispatchError:this.dispatchError?.toHuman(),dispatchInfo:this.dispatchInfo?.toHuman(),events:this.events.map(t=>t.toHuman(e)),internalError:this.internalError?.message.toString(),status:this.status.toHuman(e)}}}},22479(e,t,r){r.d(t,{l_:()=>c}),r(84792);var s=r(36730),n=r(76506),i=r(14034);const a={end:0,list:{},u8a:[]};async function o(e=!0){const t=Date.now();if(e&&t<a.end)return a;const r=await async function(e,t=2e3){const r=new AbortController;let s=!1;const n=setTimeout(()=>{console.log(`Timeout on ${e}`),s=!0,r.abort()},t);try{const t=await(0,i.h)(e,{signal:r.signal});return clearTimeout(n),t}catch(e){throw s||clearTimeout(n),e}}("https://phishing.pezkuwichain.io/address.json",void 0).then(e=>e.json());return a.end=t+27e5,a.list=r,a.u8a=Object.entries(r).map(([e,t])=>[e,t.map(e=>(0,n.F)(e))]),a}async function c(e,t=!0){try{const r=(0,n.F)(e),i=(await o(t)).u8a.find(([,e])=>e.some(e=>(0,s.f)(e,r)));return i?.[0]||null}catch{return null}}},25102(e,t,r){r.d(t,{X4:()=>u,tR:()=>d,Kx:()=>p});var s=r(65660),n=r(33687);const i={centrifuge:"polkadot",kusama:"polkadot",polkadot:"polkadot",sora:"polkadot",statemine:"polkadot",statemint:"polkadot",westmint:"polkadot"},a={"":!0,"cess-testnet":!0,"dock-testnet":!0,jupiter:!0,"mathchain-testnet":!0,p3dt:!0,subspace_testnet:!0,"zero-alphaville":!0},o=[0,2,42],c=["testnet"],u=[{decimals:[10],displayName:"Pezkuwi Relay Chain",network:"pezkuwi",prefix:0,standardAccount:"*25519",symbols:["PZW"],website:"https://pezkuwi.com"},{decimals:[12],displayName:"Zagros Relay Chain",network:"zagros",prefix:2,standardAccount:"*25519",symbols:["ZGS"],website:"https://zagros.pezkuwi.com"},{decimals:[12],displayName:"Bizinikiwi",network:"bizinikiwi",prefix:42,standardAccount:"*25519",symbols:["BZN"],website:"https://bizinikiwi.com"},{decimals:[18],displayName:"PezkuwiChain",network:"pezkuwichain",prefix:1453,standardAccount:"*25519",symbols:["PZC"],website:"https://chain.pezkuwi.com"}].map(function(e){const t=e.network||"",r=t.replace(/_/g,"-").split("-"),o=e;return o.slip44=s.V[t],o.hasLedgerSupport=!!o.slip44,o.genesisHash=n.A[t]||[],o.icon=i[t]||"substrate",o.isTestnet=!!a[t]||c.includes(r[r.length-1]),o.isIgnored=o.isTestnet||!(e.standardAccount&&e.decimals?.length&&e.symbols?.length)&&42!==e.prefix,o}),d=u.filter(function(e){return!e.isIgnored&&!!e.network}).sort(function(e,t){const r=o.includes(e.prefix);return r===o.includes(t.prefix)?r?0:e.displayName.localeCompare(t.displayName):r?-1:1}),p=d.filter(function({genesisHash:e,prefix:t}){return!!e.length||42===t})},30788(e,t,r){r.d(t,{B:()=>h});var s=r(39385),n=r(76838),i=r(34116),a=r(66615),o=r(96944),c=r(73274),u=r(1048).Buffer;async function d(e){let t;try{t=await e}catch(e){if(e.returnCode)throw new Error(`${e.returnCode}: ${e.errorMessage}`);throw new Error(e.message)}return t}function p(e,t,r,s=0,n=0){const o=`m/44'/${r}'/${s}'/0'/${n}'`;return async r=>{const{signature:s}=await d(r[e](o,(0,a.e)(t)));return{signature:(0,i.d)(s.toString("hex"))}}}function l(e,t,r,s=0,n=0){const o=`m/44'/${r}'/${s}'/0'/${n}'`;return async r=>{const{r:s,s:n,v:c}=await d(r[e](o,(0,a.e)(t))),p=u.concat([s,n,c]);return{signature:(0,i.d)(p.toString("hex"))}}}class h{#s;#n;#i;#a;#o=null;constructor(e,t,r,s,i){const a=c.M5[t],o=n.T.find(({type:t})=>t===e);if(!a)throw new Error(`Unsupported Ledger chain ${t}`);if(!o)throw new Error(`Unsupported Ledger transport ${e}`);this.#a=i,this.#i=s,this.#n=r,this.#s=o}async getAddress(e,t=!1,r=0,s=0){const n=`m/44'/${this.#n}'/${r}'/0'/${s}'`;return this.withApp(async r=>{const{address:s,pubKey:a}=await d(r.getAddressEd25519(n,e,t));return{address:s,publicKey:(0,i.d)(a)}})}async getAddressEcdsa(e=!1,t=0,r=0){const s=`m/44'/${this.#n}'/${t}'/0'/${r}'`;return this.withApp(async t=>{const{address:r,pubKey:n}=await d(t.getAddressEcdsa(s,e));return{address:r,publicKey:(0,i.d)(n)}})}async getVersion(){return this.withApp(async e=>{const{deviceLocked:t,major:r,minor:s,patch:n,testMode:i}=await d(e.getVersion());return{isLocked:!!t,isTestMode:!!i,version:[r||0,s||0,n||0]}})}async sign(e,t,r){return this.withApp(p("signEd25519",e,this.#n,t,r))}async signRaw(e,t,r){return this.withApp(p("signRawEd25519",(0,o.C1)(e),this.#n,t,r))}async signEcdsa(e,t,r){return this.withApp(l("signEcdsa",(0,o.C1)(e),this.#n,t,r))}async signRawEcdsa(e,t,r){return this.withApp(l("signRawEcdsa",(0,o.C1)(e),this.#n,t,r))}async signWithMetadata(e,t,r,s){return this.withApp(function(e,t,r=0,s=0,{metadata:n}={}){const a=`m/44'/${t}'/${r}'/0'/${s}'`;return async t=>{if(!n)throw new Error("The metadata option must be present when using signWithMetadata");const r=u.from(e),{signature:s}=await d(t.signWithMetadataEd25519(a,r,n));return{signature:(0,i.d)(s.toString("hex"))}}}(e,this.#n,t,r,s))}async signWithMetadataEcdsa(e,t,r,s){return this.withApp(function(e,t,r=0,s=0,{metadata:n}={}){const a=`m/44'/${t}'/${r}'/0'/${s}'`;return async t=>{if(!n)throw new Error("The metadata option must be present when using signWithMetadata");const r=u.from(e),{r:s,s:o,v:c}=await d(t.signWithMetadataEcdsa(a,r,n)),p=u.concat([s,o,c]);return{signature:(0,i.d)(p.toString("hex"))}}}(e,this.#n,t,r,s))}async withApp(e){try{if(!this.#o){const e=await this.#s.create();this.#o=new s.PolkadotGenericApp(e,this.#i,this.#a)}return await e(this.#o)}catch(e){throw this.#o=null,e}}}},33571(e,t,r){r.d(t,{AW:()=>M});var s=r(59540),n=r(89129),i=r(54143),a=r(79876),o=r(62518),c=r(35359),u=r(52959),d=r(76506),p=r(82228),l=r(56393),h=r(25455),f=r(70594),g=r(27774),m=r(35262),y=r(84645),b=r(92110),v=r(43778),w=r(33482),x=r(92100),k=r(6409);class _{#c={};add(e){return this.#c[(0,d.F)(e.address).toString()]=e,e}all(){return Object.values(this.#c)}get(e){const t=this.#c[(0,d.F)(e).toString()];if(!t)throw new Error(`Unable to retrieve keypair '${(0,w.b)(e)||(0,i.qv)(e)?(0,x.X)((0,k.e)(e)):e}'`);return t}remove(e){delete this.#c[(0,d.F)(e).toString()]}}const T={ecdsa:e=>(0,o.S)(e),ed25519:e=>(0,c.r)(e),ethereum:e=>(0,o.S)(e),sr25519:e=>(0,u.H)(e)};function S({publicKey:e}){return e}class q{#u;#d;#p;decodeAddress=d.F;constructor(e={}){if(e.type=e.type||"ed25519",!["ecdsa","ethereum","ed25519","sr25519"].includes(e.type||"undefined"))throw new Error(`Expected a keyring type of either 'ed25519', 'sr25519', 'ethereum' or 'ecdsa', found '${e.type||"unknown"}`);this.#u=new _,this.#p=e.ss58Format,this.#d=e.type}get pairs(){return this.getPairs()}get publicKeys(){return this.getPublicKeys()}get type(){return this.#d}addPair(e){return this.#u.add(e)}addFromAddress(e,t={},r=null,s=this.type,i,a){const o=this.decodeAddress(e,i);return this.addPair((0,n.x)({toSS58:this.encodeAddress,type:s},{publicKey:o,secretKey:new Uint8Array},t,r,a))}addFromJson(e,t){return this.addPair(this.createFromJson(e,t))}addFromMnemonic(e,t={},r=this.type,s){return this.addFromUri(e,t,r,s)}addFromPair(e,t={},r=this.type){return this.addPair(this.createFromPair(e,t,r))}addFromSeed(e,t={},r=this.type){return this.addPair((0,n.x)({toSS58:this.encodeAddress,type:r},T[r](e),t,null))}addFromUri(e,t={},r=this.type,s){return this.addPair(this.createFromUri(e,t,r,s))}createFromJson({address:e,encoded:t,encoding:{content:r,type:a,version:o},meta:c},u){if("3"===o&&"pkcs8"!==r[0])throw new Error(`Unable to decode non-pkcs8 type, [${r.join(",")}] found}`);const d="0"!==o&&Array.isArray(r)?r[1]:this.type,l=Array.isArray(a)?a:[a];if(!["ed25519","sr25519","ecdsa","ethereum"].includes(d))throw new Error(`Unknown crypto type ${d}`);const h=(0,i.qv)(e)?(0,s.V)(e):this.decodeAddress(e,u),f=(0,i.qv)(t)?(0,s.V)(t):(0,p.u)(t);return(0,n.x)({toSS58:this.encodeAddress,type:d},{publicKey:h,secretKey:new Uint8Array},c,f,l)}createFromPair(e,t={},r=this.type){return(0,n.x)({toSS58:this.encodeAddress,type:r},e,t,null)}createFromUri(e,t={},r=this.type,o){const c=e.startsWith("//")?`${v.G}${e}`:e,{derivePath:u,password:d,path:p,phrase:y}=(0,l.E)(c);let b;const w=(0,i.qv)(y,256);if(w)b=(0,s.V)(y);else{const e=y.split(" ");if([12,15,18,21,24].includes(e.length))b="ethereum"===r?(0,h.s)(y,"",!1,64):(0,f.F)(y,d,o);else{if(y.length>32)throw new Error("specified phrase is not a valid mnemonic and is invalid as a raw seed at > 32 bytes");b=(0,a.j)(y.padEnd(32))}}const x="ethereum"===r?w?T[r](b):(0,g.w)(b,u.substring(1)):(0,m.d)(T[r](b),p,r);return(0,n.x)({toSS58:this.encodeAddress,type:r},x,t,null)}encodeAddress=(e,t)=>"ethereum"===this.type?(0,y.w)(e):(0,b.j)(e,t??this.#p);getPair(e){return this.#u.get(e)}getPairs(){return this.#u.all()}getPublicKeys(){return this.#u.all().map(S)}removePair(e){this.#u.remove(e)}setSS58Format(e){this.#p=e}toJson(e,t){return this.#u.get(e).toJson(t)}}const E=[{p:"0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d",s:"0x98319d4ff8a9508c4bb0cf0b5a78d760a0b2082c02775e6e82370816fedfff48925a225d97aa00682d6a59b95b18780c10d7032336e88f3442b42361f4a66011",seed:"Alice",type:"sr25519"},{p:"0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f",s:"0xe8da6c9d810e020f5e3c7f5af2dea314cbeaa0d72bc6421e92c0808a0c584a6046ab28e97c3ffc77fe12b5a4d37e8cd4afbfebbf2391ffc7cb07c0f38c023efd",seed:"Alice//stash",type:"sr25519"},{p:"0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48",s:"0x081ff694633e255136bdb456c20a5fc8fed21f8b964c11bb17ff534ce80ebd5941ae88f85d0c1bfc37be41c904e1dfc01de8c8067b0d6d5df25dd1ac0894a325",seed:"Bob",type:"sr25519"},{p:"0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e",s:"0xc006507cdfc267a21532394c49ca9b754ca71de21e15a1cdf807c7ceab6d0b6c3ed408d9d35311540dcd54931933e67cf1ea10d46f75408f82b789d9bd212fde",seed:"Bob//stash",type:"sr25519"},{p:"0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22",s:"0xa8f2d83016052e5d6d77b2f6fd5d59418922a09024cda701b3c34369ec43a7668faf12ff39cd4e5d92bb773972f41a7a5279ebc2ed92264bed8f47d344f8f18c",seed:"Charlie",type:"sr25519"},{p:"0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20",s:"0x20e05482ca4677e0edbc58ae9a3a59f6ed3b1a9484ba17e64d6fe8688b2b7b5d108c4487b9323b98b11fe36cb301b084e920f7b7895536809a6d62a451b25568",seed:"Dave",type:"sr25519"},{p:"0xe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e",s:"0x683576abfd5dc35273e4264c23095a1bf21c14517bece57c7f0cc5c0ed4ce06a3dbf386b7828f348abe15d76973a72009e6ef86a5c91db2990cb36bb657c6587",seed:"Eve",type:"sr25519"},{p:"0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c",s:"0xb835c20f450079cf4f513900ae9faf8df06ad86c681884122c752a4b2bf74d4303e4f21bc6cc62bb4eeed5a9cce642c25e2d2ac1464093b50f6196d78e3a7426",seed:"Ferdie",type:"sr25519"}],C=[{name:"Alith",p:"0x02509540919faacf9ab52146c9aa40db68172d83777250b28e4679176e49ccdd9f",s:"0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133",type:"ethereum"},{name:"Baltathar",p:"0x033bc19e36ff1673910575b6727a974a9abd80c9a875d41ab3e2648dbfb9e4b518",s:"0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b",type:"ethereum"},{name:"Charleth",p:"0x0234637bdc0e89b5d46543bcbf8edff329d2702bc995e27e9af4b1ba009a3c2a5e",s:"0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b",type:"ethereum"},{name:"Dorothy",p:"0x02a00d60b2b408c2a14c5d70cdd2c205db8985ef737a7e55ad20ea32cc9e7c417c",s:"0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68",type:"ethereum"},{name:"Ethan",p:"0x025cdc005b752651cd3f728fb9192182acb3a9c89e19072cbd5b03f3ee1f1b3ffa",s:"0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4",type:"ethereum"},{name:"Faith",p:"0x037964b6c9d546da4646ada28a99e34acaa1d14e7aba861a9055f9bd200c8abf74",s:"0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df",type:"ethereum"}];function A(e,t){if(!e&&!t)throw new Error("Testing pair should have either a name or a seed");return{isTesting:!0,name:e||t?.replace("//","_").toLowerCase()}}function M(e={},t=!0){const r=new q(e),i="ethereum"===e.type?C:E;for(const{name:a,p:o,s:c,seed:u,type:d}of i){const i=A(a,u);(t||a||!u?r.addPair((0,n.x)({toSS58:r.encodeAddress,type:d},{publicKey:(0,s.V)(o),secretKey:(0,s.V)(c)},i)):r.addFromUri(u,i,e.type)).lock=()=>{}}return r}},33687(e,t,r){r.d(t,{A:()=>s});const s={acala:["0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c"],ajuna:["0xe358eb1d11b31255a286c12e44fe6780b7edb171d657905a97e39f71d9c6c3ee"],"aleph-node":["0x70255b4d28de0fc4e1a193d7e175ad1ccef431598211c55538f1018651a0344e"],astar:["0x9eb76c5184c4ab8679d2d5d819fdf90b9c001403e9e17da2e14b6d8aec4029c6"],basilisk:["0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755"],bifrost:["0x262e1b2ad728475fd6fe88e62d34c200abe6fd693931ddad144059b1eb884e5b"],"bifrost-kusama":["0x9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed"],bittensor:["0x2f0555cc76fc2840a25a6ea3b9637146806f1f44b090c175ffde2a7e5ab36c03"],centrifuge:["0xb3db41421702df9a7fcac62b53ffeac85f7853cc4e689e0b93aeb3db18c09d82","0x67dddf2673b69e5f875f6f25277495834398eafd67f492e09f3f3345e003d1b5"],cere:["0x81443836a9a24caaa23f1241897d1235717535711d1d3fe24eae4fdc942c092c"],composable:["0xdaab8df776eb52ec604a5df5d388bb62a050a0aaec4556a64265b9d42755552d"],creditcoin3:["0x4436a7d64e363df85e065a894721002a86643283f9707338bf195d360ba2ee71","0xfc4ec97a1c1f119c4353aecb4a17c7c0cf7b40d5d660143d8bad9117e9866572","0xfc9df99a665f964aed6649f275055e54df5e3420489538ed31d7788f53d11ef6"],darwinia:["0xe71578b37a7c799b0ab4ee87ffa6f059a6b98f71f06fb8c84a8d88013a548ad6"],dentnet:["0x0313f6a011d128d22f996703cbab05162e2fdc9e031493314fe6db79979c5ca7"],"dock-mainnet":["0x6bfe24dca2a3be10f22212678ac13a6446ec764103c0f3471c71609eac384aae","0xf73467c6544aa68df2ee546b135f955c46b90fa627e9b5d7935f41061bb8a5a9"],edgeware:["0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b"],encointer:["0x7dd99936c1e9e6d1ce7d90eb6f33bea8393b4bf87677d675aa63c9cb3e8c5b5b"],enjin:["0xd8761d3c88f26dc12875c00d3165f7d67243d56fc85b4cf19937601a7916e5a9"],equilibrium:["0x6f1a800de3daff7f5e037ddf66ab22ce03ab91874debeddb1086f5f7dbd48925"],frequency:["0x4a587bf17a404e3572747add7aab7bbe56e805a5479c6c436f07f36fcc8d3ae1"],genshiro:["0x9b8cefc0eb5c568b527998bdd76c184e2b76ae561be76e4667072230217ea243"],hydradx:["0xafdc188f45c71dacbaa0b62e16a91f726c7b8699a9748cdf715459de6b7f366d","0xd2a620c27ec5cbc5621ff9a522689895074f7cca0d08e7134a7804e1a3ba86fc","0x10af6e84234477d84dc572bac0789813b254aa490767ed06fb9591191d1073f9","0x3d75507dd46301767e601265791da1d9cb47b6ebc94e87347b635e5bf58bd047","0x0ed32bfcab4a83517fac88f2aa7cbc2f88d3ab93be9a12b6188a036bf8a943c2"],integritee:["0xcdedc8eadbfa209d3f207bba541e57c3c58a667b05a2e1d1e86353c9000758da","0xe13e7af377c64e83f95e0d70d5e5c3c01d697a84538776c5b9bbe0e7d7b6034c"],"interlay-parachain":["0xbf88efe70e9e0e916416e8bed61f2b45717f517d7f3523e33c7b001e5ffcbc72"],karura:["0xbaf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b"],khala:["0xd43540ba6d3eb4897c28a77d48cb5b729fea37603cbbfc7a86a73b72adb3be8d"],kulupu:["0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba"],kusama:["0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe","0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636","0x3fd7b9eb6a00376e5be61f01abb429ffb0b104be05eaff4d458da48fcd425baf"],dicle:["0xd9d3cd7c1e5d890d969b957f4c5b71a111bbeeabc968f1d0d4538c2663f080a7"],liberland:["0x6bd89e052d67a45bb60a9a23e8581053d5e0d619f15cb9865946937e690c42d6"],matrixchain:["0x3af4ff48ec76d2efc8476730f423ac07e25ad48f5f4c9dc39c778b164d808615"],mythos:["0xf6ee56e9c5277df5b4ce6ae9983ee88f3cbed27d31beeb98f9f84f997a1ab0b9"],nodle:["0x97da7ede98d7bad4e36b4d734b6055425a3be036da2a332ea5a7037656427a21"],origintrail:["0xe7e0962324a3b86c83404dbea483f25fb5dab4c224791c81b756cfc948006174"],p3d:["0x6c5894837ad89b6d92b114a2fb3eafa8fe3d26a54848e3447015442cd6ef4e66"],parallel:["0xe61a41c53f5dcd0beb09df93b34402aada44cb05117b71059cce40a2723a4e97"],peaq:["0xd2a5d385932d1f650dae03ef8e2748983779ee342c614f80854d32b8cd8fa48c"],pendulum:["0x5d3c298622d5634ed019bf61ea4b71655030015bde9beb0d6a24743714462c86"],phala:["0x1bb969d85965e4bb5a651abbedf21a54b6b31a21f66b5401cc3f1e286268d736"],picasso:["0x6811a339673c9daa897944dcdac99c6e2939cc88245ed21951a0a3c9a2be75bc","0xe8e7f0f4c4f5a00720b4821dbfddefea7490bcf0b19009961cc46957984e2c1c"],polimec:["0x7eb9354488318e7549c722669dcbdcdc526f1fef1420e7944667212f3601fdbd"],polkadex:["0x3920bcb4960a1eef5580cd5367ff3f430eef052774f78468852f7b9cb39f8a3c"],polkadot:["0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"],pezkuwi:["0x41693961995d879073269a008d0a52832caa3e0ae73869f02127f3d5daa4934c"],polymesh:["0x6fbd74e5e1d0a61d52ccfe9d4adaed16dd3a7caa37c6bc4d0c2fa12e8b2f4063"],quartz:["0xcd4d732201ebe5d6b014edda071c4203e16867305332301dc8d092044b28e554"],rococo:["0x6408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063e","0xaaf2cd1b74b5f726895921259421b534124726263982522174147046b8827897","0x037f5f3c8e67b314062025fc886fcd6238ea25a4a9b45dce8d246815c9ebe770","0xc196f81260cf1686172b47a79cf002120735d7cb0eb1474e8adce56618456fff","0xf6e9983c37baf68846fedafe21e56718790e39fb1c582abc408b81bc7b208f9a","0x5fce687da39305dfe682b117f0820b319348e8bb37eb16cf34acbf6a202de9d9","0xe7c3d5edde7db964317cd9b51a3a059d7cd99f81bdbce14990047354334c9779","0x1611e1dbf0405379b861e2e27daa90f480b2e6d3682414a80835a52e8cb8a215","0x343442f12fa715489a8714e79a7b264ea88c0d5b8c66b684a7788a516032f6b9","0x78bcd530c6b3a068bc17473cf5d2aff9c287102bed9af3ae3c41c33b9d6c6147","0x47381ee0697153d64404fc578392c8fd5cba9073391908f46c888498415647bd","0x19c0e4fa8ab75f5ac7865e0b8f74ff91eb9a100d336f423cd013a8befba40299"],pezkuwichain:["0x32154fd2c844f928c82964ff66168b41b15fc235f3a956d14393734c1ed4326b"],sora:["0x7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5"],stafi:["0x290a4149f09ea0e402c74c1c7e96ae4239588577fe78932f94f5404c68243d80"],statemine:["0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"],statemint:["0x68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f"],subsocial:["0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8"],ternoa:["0x6859c81ca95ef624c9dfe4dc6e3381c33e5d6509e35e147092bfbc780f777c4e"],unique:["0x84322d9cddbf35088f1e54e9a85c967a41a56a4f43445768125e61af166c7d31"],vara:["0xfe1b4c55fd4d668101126434206571a7838a8b6b93a6d1b95d607e78e6c53763"],vtb:["0x286bc8414c7000ce1d6ee6a834e29a54c1784814b76243eb77ed0b2c5573c60f","0x7483b89572fb2bd687c7b9a93b242d0b237f9aba463aba07ec24503931038aaa"],westend:["0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"],zagros:["0x297f5a4d105b4b28312586ff1915572ffe4ee015ff772b76399ecbff25a22026"],xxnetwork:["0x50dd5d206917bf10502c68fb4d18a59fc8aa31586f4e8856b493e43544aa82aa"],zeitgeist:["0x1bf2a2ecb4a868de66ea8610f2ce7c8c43706561b6476031315f6640fe38e060"]}},34060(e,t,r){r.d(t,{G:()=>i,Y:()=>n});var s=r(87194);let n;function i(e="",t){n=t?function(e,t){return{del:r=>t.del(`${e}${r}`),forEach:t.forEach,get:r=>{const s=`${e}${r}`,n=t.get(s);if(n)return n.x=Date.now(),t.set(s,n),n.v},set:(r,s)=>{t.set(`${e}${r}`,{v:s,x:Date.now()})}}}(`derive:${e}:`,t):s.U,t&&function(e){const t=Date.now(),r=[];e.forEach((e,{x:s})=>{t-s>6048e5&&r.push(e)}),r.forEach(t=>e.del(t))}(t)}i()},34985(e,t,r){r.d(t,{G:()=>Ui});var s={};r.r(s),r.d(s,{_flags:()=>ne,_identity:()=>fe,accountId:()=>re,flags:()=>ie,hasIdentity:()=>me,hasIdentityMulti:()=>ye,idAndIndex:()=>ae,idToIndex:()=>be,identity:()=>ge,indexToId:()=>ke,indexes:()=>xe,info:()=>Te});var n={};r.r(n),r.d(n,{hasProposals:()=>Oe,members:()=>Be,prime:()=>Fe,proposal:()=>Ve,proposalCount:()=>Ne,proposalHashes:()=>De,proposals:()=>$e});var i={};r.r(i),r.d(i,{_getIds:()=>Le,all:()=>Ke,expand:()=>Ye,get:()=>We,getExpanded:()=>Ze,listNodes:()=>Ge});var a={};r.r(a),r.d(a,{account:()=>lt,all:()=>it,votingBalance:()=>ft,votingBalances:()=>ht});var o={};r.r(o),r.d(o,{bounties:()=>yt});var c={};r.r(c),r.d(c,{_getHeaderRange:()=>Ct,bestNumber:()=>bt.s,bestNumberFinalized:()=>vt.k,bestNumberLag:()=>wt.G,getBlock:()=>xt.g,getBlockByNumber:()=>kt,getHeader:()=>qt,subscribeFinalizedBlocks:()=>Et,subscribeFinalizedHeads:()=>At,subscribeNewBlocks:()=>Mt.b,subscribeNewHeads:()=>It});var u={};r.r(u),r.d(u,{fees:()=>Pt});var d={};r.r(d),r.d(d,{hasProposals:()=>Nt,members:()=>Vt,prime:()=>jt,proposal:()=>Dt,proposalCount:()=>$t,proposalHashes:()=>Ft,proposals:()=>Ut,votes:()=>Bt,votesOf:()=>Ot});var p={};r.r(p),r.d(p,{childKey:()=>Kt,contributions:()=>Qt,ownContributions:()=>tr});var l={};r.r(l),r.d(l,{_referendumInfo:()=>_r,_referendumVotes:()=>xr,_referendumsVotes:()=>kr,dispatchQueue:()=>ar,locks:()=>cr,nextExternal:()=>ur,preimage:()=>lr,preimages:()=>pr,proposals:()=>fr,referendumIds:()=>gr,referendums:()=>mr,referendumsActive:()=>yr,referendumsFinished:()=>br,referendumsInfo:()=>Tr,sqrtElectorate:()=>qr});var h={};r.r(h),r.d(h,{info:()=>Mr});var f={};r.r(f),r.d(f,{receivedHeartbeats:()=>Pr});var g={};r.r(g),r.d(g,{hasProposals:()=>zr,members:()=>Hr,prime:()=>Nr,proposal:()=>Rr,proposalCount:()=>Br,proposalHashes:()=>Or,proposals:()=>Vr});var m={};r.r(m),r.d(m,{eraLength:()=>Lr,eraProgress:()=>Kr,indexes:()=>$r,info:()=>Fr,progress:()=>jr,sessionProgress:()=>Wr});var y={};r.r(y),r.d(y,{_members:()=>Gr,candidates:()=>Yr,info:()=>Zr,member:()=>Xr,members:()=>Qr});var b={};r.r(b),r.d(b,{_eraExposure:()=>vs,_eraPrefs:()=>Cs,_eraSlashes:()=>Rs,_erasExposure:()=>xs,_erasPoints:()=>qs,_erasPrefs:()=>Ms,_erasRewards:()=>Hs,_erasSlashes:()=>Os,_ownExposures:()=>Fs,_ownSlashes:()=>Ls,_stakerExposures:()=>Qs,_stakerPoints:()=>tn,_stakerPrefs:()=>sn,_stakerRewards:()=>cn,_stakerRewardsEras:()=>on,_stakerSlashes:()=>ln,account:()=>ss,accounts:()=>rs,currentPoints:()=>ns,electedInfo:()=>as,eraExposure:()=>ws,eraPrefs:()=>As,eraSlashes:()=>Bs,erasExposure:()=>ks,erasHistoric:()=>_s,erasPoints:()=>Es,erasPrefs:()=>Is,erasRewards:()=>zs,erasSlashes:()=>Vs,keys:()=>Ns,keysMulti:()=>Ds,nextElected:()=>mn,overview:()=>$s,ownExposure:()=>Us,ownExposures:()=>js,ownSlash:()=>Ks,ownSlashes:()=>Ws,query:()=>Xs,queryMulti:()=>Gs,stakerExposure:()=>en,stakerExposures:()=>Js,stakerPoints:()=>rn,stakerPrefs:()=>nn,stakerRewards:()=>un,stakerRewardsMulti:()=>pn,stakerRewardsMultiEras:()=>dn,stakerSlashes:()=>hn,stashes:()=>gn,validators:()=>yn,waitingInfo:()=>vn});var v={};r.r(v),r.d(v,{hasProposals:()=>xn,members:()=>wn,prime:()=>qn,proposal:()=>kn,proposalCount:()=>_n,proposalHashes:()=>Tn,proposals:()=>Sn});var w={};r.r(w),r.d(w,{info:()=>Mn,overview:()=>Pn});var x={};r.r(x),r.d(x,{proposals:()=>Hn});var k={};r.r(k),r.d(k,{accountExtrinsics:()=>Bn,events:()=>zn,extrinsicInfo:()=>Rn,signingInfo:()=>Kn});var _=r(56109),T=r(93302),S=r(76733),q=r(92100),E=r(6409);const C=(new URL("file:///home/runner/work/pezkuwi-apps/pezkuwi-apps/node_modules/@pezkuwi/api/packageInfo.js").pathname.substring(0,new URL("file:///home/runner/work/pezkuwi-apps/pezkuwi-apps/node_modules/@pezkuwi/api/packageInfo.js").pathname.lastIndexOf("/")+1),"16.5.9");function A(e,t){return e.findMetaCall((0,E.e)(t))}function M(e,t){return e.findMetaError((0,E.e)(t))}var I=r(16090),P=r(98737),H=r(45118),z=r(18045),R=r(95620),B=r(91829),O=r(23205),V=r(20091),N=r(8781),D=r(11243),$=r(60750),F=r(51524),U=r(36730),j=r(9799),L=r(89180),K=r(35775),W=r(25923),Y=r(59359),Z=r(58322),X=r(77473),G=r(4747);function Q(e,t,r,s){(0,G.s)(e,t,()=>(0,G.T)({},r(t),e=>s(t,e)))}var J=r(33482),ee=r(76506),te=r(53403);function re(e,t){return(0,te.p)(e,e=>{const r=(0,J.b)(e)?e:(0,ee.F)((e||"").toString());if(r.length>8)return(0,H.of)(t.registry.createType(20===r.length?"AccountId20":"AccountId",r));const s=t.registry.createType("AccountIndex",r);return t.derive.accounts.indexToId(s.toString()).pipe((0,z.T)(e=>(0,D.Z8)(e,"Unable to retrieve accountId")))})}var se=r(6404);function ne(e,t){return(0,te.p)(e,()=>{const e=[void 0,[],[],[],void 0],r=[(t.query.elections||t.query.phragmenElection||t.query.electionsPhragmen)?.members,t.query.council?.members,t.query.technicalCommittee?.members,t.query.society?.members,t.query.sudo?.key],s=r.filter(e=>e);return s.length?t.queryMulti(s).pipe((0,z.T)(t=>{let s=-1;for(let n=0,i=r.length;n<i;n++)(0,se.T)(r[n])&&(e[n]=t[++s]);return e})):(0,H.of)(e)})}function ie(e,t){return(0,te.p)(e,e=>t.derive.accounts._flags().pipe((0,z.T)(t=>function(e,[t,r,s,n,i]){const a=e?.toString(),o=e=>e.toString()===a;return{isCouncil:(t?.map(e=>Array.isArray(e)?e[0]:e.who)||r||[]).some(o),isSociety:(n||[]).some(o),isSudo:i?.toString()===a,isTechCommittee:(s||[]).some(o)}}(e,t))))}function ae(e,t){return(0,te.p)(e,e=>{try{const r=(0,J.b)(e)?e:(0,ee.F)((e||"").toString());if(r.length>8){const e=t.registry.createType(20===r.length?"AccountId20":"AccountId",r);return t.derive.accounts.idToIndex(e).pipe((0,z.T)(t=>[e,t]))}const s=t.registry.createType("AccountIndex",r);return t.derive.accounts.indexToId(s.toString()).pipe((0,z.T)(e=>[e,s]))}catch{return(0,H.of)([void 0,void 0])}})}var oe=r(73108),ce=r(54143);function ue(e){return e.pipe((0,z.T)(([e])=>e))}function de(e){return(t,r)=>(0,te.p)(t,(...t)=>ue(e(r,...t)))}const pe={toHex:()=>{}};function le(e){return e?e.isRaw?(0,oe.F)(e.asRaw.toU8a(!0)):e.isNone?void 0:e.toHex():e}function he(e){const t=e.unwrap();return Array.isArray(t)?t[0]:t}function fe(e,t){return(0,te.p)(e,e=>e&&t.query.identity?.identityOf?(0,Y.z)([t.query.identity.identityOf(e),t.query.identity.superOf(e)]):(0,H.of)([void 0,void 0]))}function ge(e,t){return(0,te.p)(e,e=>t.derive.accounts._identity(e).pipe((0,P.n)(([e,r])=>function(e,t,r){if(t?.isSome)return(0,H.of)([t,void 0]);if(r?.isSome){const t=r.unwrap();return(0,Y.z)([e.derive.accounts._identity(t[0]).pipe((0,z.T)(([e])=>e)),(0,H.of)(t)])}return(0,H.of)([void 0,void 0])}(t,e,r)),(0,z.T)(([e,t])=>function(e,t){if(!e?.isSome)return{judgements:[]};const{info:r,judgements:s}=he(e),n=le(r.display);return{discord:le(r.discord),display:t&&le(t[1])||n,displayParent:t&&n,email:le(r.email),github:le(r.github),image:le(r.image),judgements:s,legal:le(r.legal),matrix:le(r.matrix),other:r.additional?(i=r.additional,i.reduce((e,[t,r])=>{const s=le(t),n=le(r);return s&&n&&(e[s]=n),e},{})):{},parent:t?.[0],pgp:r.pgpFingerprint.unwrapOr(pe).toHex(),riot:le(r.riot),twitter:le(r.twitter),web:le(r.web)};var i}(e,t)),(0,P.n)(r=>function(e,t,r){const s=e.parent||r;return s&&t.query.identity?t.query.identity.subsOf(s).pipe((0,z.T)(t=>{const r=t[1];return{...e,subs:r}})):(0,H.of)(e)}(r,t,e))))}const me=de((e,t)=>e.derive.accounts.hasIdentityMulti([t]));function ye(e,t){return(0,te.p)(e,e=>t.query.identity?.identityOf?(0,Y.z)([t.query.identity.identityOf.multi(e),t.query.identity.superOf.multi(e)]).pipe((0,z.T)(([e,t])=>e.map((e,r)=>{const s=t[r],n=s&&s.isSome?s.unwrap()[0].toString():void 0;let i;if(e&&e.isSome){const t=le(he(e).info.display);t&&!(0,ce.qv)(t)&&(i=t)}return{display:i,hasIdentity:!(!i&&!n),parentId:n}}))):(0,H.of)(e.map(()=>({hasIdentity:!1}))))}function be(e,t){return(0,te.p)(e,e=>t.derive.accounts.indexes().pipe((0,z.T)(t=>t[e.toString()])))}var ve=r(58862);let we=null;function xe(e,t){return(0,te.p)(e,()=>we?(0,H.of)(we):(t.query.indices?function(e){return e.query.indices.accounts.entries().pipe((0,z.T)(t=>t.reduce((t,[r,s])=>(s.isSome&&(t[s.unwrap()[0].toString()]=e.registry.createType("AccountIndex",r.args[0])),t),{})))}(t).pipe((0,ve.Z)({})):(0,H.of)({})).pipe((0,z.T)(e=>(we=e,e))))}function ke(e,t){return(0,te.p)(e,e=>t.query.indices?t.query.indices.accounts(e).pipe((0,z.T)(e=>e.unwrapOr([])[0])):(0,H.of)(void 0))}function _e(e,t){return(t&&e.query.nicks?.nameOf?e.query.nicks.nameOf(t):(0,H.of)(void 0)).pipe((0,z.T)(t=>t?.isSome?(0,oe.F)(t.unwrap()[0]).substring(0,e.consts.nicks.maxLength.toNumber()):void 0))}function Te(e,t){return(0,te.p)(e,e=>t.derive.accounts.idAndIndex(e).pipe((0,P.n)(([e,r])=>(0,Y.z)([(0,H.of)({accountId:e,accountIndex:r}),t.derive.accounts.identity(e),_e(t,e)])),(0,z.T)(([{accountId:e,accountIndex:t},r,s])=>({accountId:e,accountIndex:t,identity:r,nickname:s}))))}function Se(e,t){return(r,s)=>(0,te.p)(r,t(function(e,t){const r=e.registry.getModuleInstances(e.runtimeVersion.specName,t),s=r?.length?r[0]:t;return e.query[s]}(s,e),s,r))}function qe(e,t){return r=>Se(r,r=>()=>(0,se.T)(r?.[e])?r[e]():(0,H.of)(t))}const Ee=qe("members",[]);var Ce=r(70672);function Ae(e,t,r){return((0,se.T)(t?.proposals)&&r.length?(0,Y.z)([(0,H.of)(r),t.proposalOf.multi(r).pipe((0,Ce.W)(()=>(0,H.of)(r.map(()=>null)))),t.voting.multi(r)]):(0,H.of)([[],[],[]])).pipe((0,z.T)(t=>function(e,[t,r,s]){return r.map((r,n)=>({hash:e.registry.createType("Hash",t[n]),proposal:r&&r.isSome?r.unwrap():null,votes:s[n].unwrapOr(null)}))}(e,t)))}function Me(e){return Se(e,e=>()=>(0,H.of)((0,se.T)(e?.proposals)))}function Ie(e){return Se(e,(t,r)=>()=>r.derive[e].proposalHashes().pipe((0,P.n)(e=>Ae(r,t,e))))}function Pe(e){return Se(e,(e,t)=>r=>(0,se.T)(e?.proposals)?ue(Ae(t,e,[r])):(0,H.of)(null))}const He=qe("proposalCount",null),ze=qe("proposals",[]);function Re(e){return Se(e,e=>()=>(0,se.T)(e?.prime)?e.prime().pipe((0,z.T)(e=>e.unwrapOr(null))):(0,H.of)(null))}const Be=Ee("allianceMotion"),Oe=Me("allianceMotion"),Ve=Pe("allianceMotion"),Ne=He("allianceMotion"),De=ze("allianceMotion"),$e=Ie("allianceMotion"),Fe=Re("allianceMotion");var Ue=r(665);function je(e){return e.query.voterList||e.query.voterBagsList||e.query.bagsList}function Le(e,t){const r=je(t);return(0,te.p)(e,e=>{const t=e.map(e=>(0,Ue.A)(e));return t.length?r.listBags.multi(t).pipe((0,z.T)(e=>function(e,t){const r=e.map((e,r)=>({bag:t[r].unwrapOr(null),id:e,key:e.toString()})).sort((e,t)=>t.id.cmp(e.id)),s=r.length-1;return r.map((e,t)=>(0,T.b)(e,{bagLower:t===s?F.Yz:r[t+1].id,bagUpper:e.id,index:t}))}(t,e))):(0,H.of)([])})}function Ke(e,t){const r=je(t);return(0,te.p)(e,()=>r.listBags.keys().pipe((0,P.n)(e=>t.derive.bagsList._getIds(e.map(({args:[e]})=>e))),(0,z.T)(e=>e.filter(({bag:e})=>e))))}function We(e,t){return(0,te.p)(e,e=>t.derive.bagsList._getIds([(0,Ue.A)(e)]).pipe((0,z.T)(e=>e[0])))}function Ye(e,t){return(0,te.p)(e,e=>t.derive.bagsList.listNodes(e.bag).pipe((0,z.T)(t=>(0,T.b)({nodes:t},e))))}function Ze(e,t){return(0,te.p)(e,e=>t.derive.bagsList.get(e).pipe((0,P.n)(e=>t.derive.bagsList.expand(e))))}var Xe=r(58797);function Ge(e,t){return(0,te.p)(e,e=>e&&e.head.isSome?function(e,t){const r=new W.t(t),s=je(e);return r.pipe((0,P.n)(e=>s.listNodes(e)),(0,Z.M)(e=>{(0,Xe.d)(()=>{e.isSome&&e.value.next.isSome?r.next(e.unwrap().next.unwrap()):r.complete()})}),(0,X.$)(),(0,z.T)(e=>e.map(e=>e.unwrap())))}(t,e.head.unwrap()):(0,H.of)([]))}var Qe=r(95927),Je=r(41206);function et(e,t,r,s){const{allLocked:n,lockedBalance:i,lockedBreakdown:a,vestingLocked:o}=function(e,t,r){let s=e.registry.createType("Balance"),n=[],i=e.registry.createType("Balance"),a=!1;if(Array.isArray(r)){n=r.filter(({until:e})=>!e||t&&e.gt(t)),a=n.some(({amount:e})=>e&&e.isMax()),i=e.registry.createType("Balance",n.filter(({id:e})=>e.eq("0x76657374696e6720")).reduce((e,{amount:t})=>e.iadd(t),new Qe(0)));const o=n.filter(({amount:e})=>e&&!e.isMax());o.length&&(s=e.registry.createType("Balance",(0,Je.N)(...o.map(({amount:e})=>e))))}return{allLocked:a,lockedBalance:s,lockedBreakdown:n,vestingLocked:i}}(e,t,s);let c=null;if(r?.frameSystemAccountInfo?.frozen){const{frameSystemAccountInfo:t,freeBalance:s,reservedBalance:i}=r,a=t.frozen.isZero()&&i.isZero(),o=e.consts.balances.existentialDeposit,u=a?new Qe(0):o,d=t.frozen.sub(i);c=e.registry.createType("Balance",n?0:(0,Je.N)(new Qe(0),s.sub((0,Je.N)(u,d))))}return(0,T.b)({},r,{availableBalance:e.registry.createType("Balance",n?0:(0,Je.N)(new Qe(0),r?.freeBalance?r.freeBalance.sub(i):new Qe(0))),lockedBalance:i,lockedBreakdown:a,transferable:c,vestingLocked:o})}function tt(e,t){return(0,Y.z)([e.query.balances.locks(t),e.query.balances.vesting(t)]).pipe((0,z.T)(([t,r])=>{let s=null;if(r.isSome){const{offset:t,perBlock:n,startingBlock:i}=r.unwrap();s=e.registry.createType("VestingInfo",{locked:t,perBlock:n,startingBlock:i})}return[s?[s]:null,[t],[]]}))}const rt=e=>!!e;function st(e){return[e.map(e=>!e),e.filter(rt)]}function nt(e,t,r=["balances"]){const[s,n]=st(r.map(t=>e.derive[t]?.customLocks||e.query[t]?.locks)),[i,a]=st(r.map(t=>e.query[t]?.reserves));return(0,Y.z)([e.query.vesting?.vesting?e.query.vesting.vesting(t):(0,H.of)(e.registry.createType("Option<VestingInfo>")),n.length?(0,Y.z)(n.map(e=>e(t))):(0,H.of)([]),a.length?(0,Y.z)(a.map(e=>e(t))):(0,H.of)([])]).pipe((0,z.T)(([t,r,n])=>{let a=-1,o=-1;const c=t.unwrapOr(null);return[c?Array.isArray(c)?c:[c]:null,s.map(t=>t?e.registry.createType("Vec<BalanceLock>"):r[++a]),i.map(t=>t?e.registry.createType("Vec<PezpalletBalancesReserveData>"):n[++o])]}))}function it(e,t){const r=t.registry.getModuleInstances(t.runtimeVersion.specName,"balances");return(0,te.p)(e,e=>(0,Y.z)([t.derive.balances.account(e),(0,se.T)(t.query.system?.account)||(0,se.T)(t.query.balances?.account)?nt(t,e,r):tt(t,e)]).pipe((0,P.n)(([e,r])=>(0,Y.z)([(0,H.of)(e),(0,H.of)(r),t.derive.chain.bestNumber()])),(0,z.T)(e=>function(e,t){const[r,[s,n,i],a]=t,o=et(e,a,r,n[0]);return(0,T.b)(o,function(e,t,r){const s=r||[],n=!t.vestingLocked.isZero(),i=s.map(({locked:t,perBlock:r,startingBlock:s})=>e.gt(s)?(0,Je.J)(t,r.mul(e.sub(s))):F.Yz),a=i.reduce((e,t)=>e.iadd(t),new Qe(0)),o=s.reduce((e,{locked:t})=>e.iadd(t),new Qe(0));return{isVesting:n,vestedBalance:a,vestedClaimable:n?t.vestingLocked.sub(o.sub(a)):F.Yz,vesting:s.map(({locked:e,perBlock:t,startingBlock:r},s)=>({endBlock:e.div(t).iadd(r),locked:e,perBlock:t,startingBlock:r,vested:i[s]})).filter(({locked:e})=>!e.isZero()),vestingTotal:o}}(a,o,s),{accountId:r.accountId,accountNonce:r.accountNonce,additional:n.slice(1).map((t,s)=>et(e,a,r.additional[s],t)),namedReserves:i})}(t,e))))}function at(e){return e.registry.createType("Balance")}function ot(e,[t,r,s,n],i){const a=e.registry.createType("Balance",t.toBn());return i.isFrameAccountData?{frameSystemAccountInfo:{flags:n,frozen:s},freeBalance:t,frozenFee:e.registry.createType("Balance",0),frozenMisc:e.registry.createType("Balance",0),reservedBalance:r,votingBalance:a}:{freeBalance:t,frozenFee:s,frozenMisc:n,reservedBalance:r,votingBalance:a}}function ct(e,t){return(0,Y.z)([e.query.balances.freeBalance(t),e.query.balances.reservedBalance(t),e.query.system.accountNonce(t)]).pipe((0,z.T)(([t,r,s])=>[s,[[t,r,at(e),at(e)]],{isFrameAccountData:!1}]))}function ut(e,t){const r=t=>[t,[[at(e),at(e),at(e),at(e)]],{isFrameAccountData:!1}];return(0,se.T)(e.query.system.account)?e.query.system.account(t).pipe((0,z.T)(({nonce:e})=>r(e))):(0,se.T)(e.query.system.accountNonce)?e.query.system.accountNonce(t).pipe((0,z.T)(e=>r(e))):(0,H.of)(r(e.registry.createType("Index")))}function dt(e,t,r=["balances"]){const s=r.map(t=>e.derive[t]?.customAccount||e.query[t]?.account).filter(e=>(0,se.T)(e)),n=(e,t)=>[e,t.map(({feeFrozen:e,free:t,miscFrozen:r,reserved:s})=>[t,s,e,r]),{isFrameAccountData:!1}];return s.length?(0,se.T)(e.query.system.account)?(0,Y.z)([e.query.system.account(t),...s.map(e=>e(t))]).pipe((0,z.T)(([{nonce:e},...t])=>n(e,t))):(0,Y.z)([e.query.system.accountNonce(t),...s.map(e=>e(t))]).pipe((0,z.T)(([e,...t])=>n(e,t))):ut(e,t)}function pt(e,t){return e.query.system.account(t).pipe((0,z.T)(t=>{const r=t.nonce?t.data:t[1],s=t.nonce||t[0];if(!r||r.isEmpty)return[s,[[at(e),at(e),at(e),at(e)]],{isFrameAccountData:!1}];if(t.data.frozen){const{flags:e,free:t,frozen:n,reserved:i}=r;return[s,[[t,i,n,e]],{isFrameAccountData:!0}]}{const{feeFrozen:e,free:t,miscFrozen:n,reserved:i}=r;return[s,[[t,i,e,n]],{isFrameAccountData:!1}]}}))}function lt(e,t){const r=t.registry.getModuleInstances(t.runtimeVersion.specName,"balances"),s=r&&"balances"!==r[0];return(0,te.p)(e,e=>t.derive.accounts.accountId(e).pipe((0,P.n)(e=>e?(0,Y.z)([(0,H.of)(e),s?dt(t,e,r):(0,se.T)(t.query.system?.account)?pt(t,e):(0,se.T)(t.query.balances?.account)?dt(t,e):(0,se.T)(t.query.balances?.freeBalance)?ct(t,e):ut(t,e)]):(0,H.of)([t.registry.createType("AccountId"),[t.registry.createType("Index"),[[at(t),at(t),at(t),at(t)]],{isFrameAccountData:!1}]])),(0,z.T)(e=>function(e,[t,[r,[s,...n],i]]){return(0,T.b)({accountId:t,accountNonce:r,additional:n.map(t=>ot(e,t,i))},ot(e,s,i))}(t,e))))}function ht(e,t){return(0,te.p)(e,e=>e?.length?(0,Y.z)(e.map(e=>t.derive.balances.account(e))):(0,H.of)([]))}const ft=it;function gt(e,t){const r=e.tx.bounties?e.tx.bounties:e.tx.treasury,s=[r.approveBounty,r.closeBounty,r.proposeCurator,r.unassignCurator];return t.filter(e=>s.find(t=>e.proposal&&t.is(e.proposal)))}function mt([e,t,r,s]){const n=[];return e.forEach((e,i)=>{e.isSome&&n.push({bounty:e.unwrap(),description:t[i].unwrapOrDefault().toUtf8(),index:r[i],proposals:s.filter(e=>e.proposal&&r[i].eq(e.proposal.args[0]))})}),n}function yt(e,t){const r=t.query.bounties||t.query.treasury;return(0,te.p)(e,()=>r.bounties?(0,Y.z)([r.bountyCount(),t.query.council?t.query.council.proposalCount():(0,H.of)(0)]).pipe((0,P.n)(()=>(0,Y.z)([r.bounties.keys(),t.derive.council?t.derive.council.proposals():(0,H.of)([])])),(0,P.n)(([e,s])=>{const n=e.map(({args:[e]})=>e);return(0,Y.z)([r.bounties.multi(n),r.bountyDescriptions.multi(n),(0,H.of)(n),(0,H.of)(gt(t,s))])}),(0,z.T)(mt)):(0,H.of)(mt([[],[],[],[]])))}var bt=r(49416),vt=r(67180),wt=r(74362),xt=r(8196);function kt(e,t){return(0,te.p)(e,e=>t.rpc.chain.getBlockHash(e).pipe((0,P.n)(e=>t.derive.chain.getBlock(e))))}var _t=r(79832);function Tt(e,t,r,s){const n=e.createClass("Header");return new class extends n{#e;constructor(e,t,r,s){super(e,t),this.#e=s||(0,_t.D)(this.digest,r||[]),this.createdAtHash=t?.createdAtHash}get author(){return this.#e}}(e,t,r,s)}var St=r(7971);function qt(e,t){return(0,te.p)(e,e=>t.rpc.chain.getHeader(e).pipe((0,P.n)(r=>(0,St.G)(t,r,e)),(0,z.T)(([e,t,r])=>Tt((t||e).registry,e,t,r))))}function Et(e,t){return(0,te.p)(e,()=>t.derive.chain.subscribeFinalizedHeads().pipe((0,P.n)(e=>t.derive.chain.getBlock(e.createdAtHash||e.hash))))}function Ct(e,t){return(0,te.p)(e,(e,r,s=[])=>t.rpc.chain.getHeader(e).pipe((0,P.n)(e=>e.parentHash.eq(r)?(0,H.of)([e,...s]):t.derive.chain._getHeaderRange(e.parentHash,r,[e,...s]))))}function At(e,t){return(0,te.p)(e,()=>{let e=null;return t.rpc.chain.subscribeFinalizedHeads().pipe((0,P.n)(r=>{const s=e,n=r.parentHash;return e=r.createdAtHash=r.hash,null===s||n.eq(s)?(0,H.of)(r):t.derive.chain._getHeaderRange(n,s,[r]).pipe((0,P.n)(e=>(0,K.H)(e)))}))})}var Mt=r(3151);function It(e,t){return(0,te.p)(e,()=>t.rpc.chain.subscribeNewHeads().pipe((0,P.n)(e=>(0,St.G)(t,e)),(0,z.T)(([e,t,r])=>(e.createdAtHash=e.hash,Tt(e.registry,e,t,r)))))}function Pt(e,t){return(0,te.p)(e,()=>function(e){return(0,H.of)([e.consts.contracts.callBaseFee||e.registry.createType("Balance"),e.consts.contracts.contractFee||e.registry.createType("Balance"),e.consts.contracts.creationFee||e.registry.createType("Balance"),e.consts.contracts.transactionBaseFee||e.registry.createType("Balance"),e.consts.contracts.transactionByteFee||e.registry.createType("Balance"),e.consts.contracts.transferFee||e.registry.createType("Balance"),e.consts.contracts.rentByteFee||e.registry.createType("Balance"),e.consts.contracts.rentDepositOffset||e.registry.createType("Balance"),e.consts.contracts.surchargeReward||e.registry.createType("Balance"),e.consts.contracts.tombstoneDeposit||e.registry.createType("Balance")])}(t).pipe((0,z.T)(([e,t,r,s,n,i,a,o,c,u])=>({callBaseFee:e,contractFee:t,creationFee:r,rentByteFee:a,rentDepositOffset:o,surchargeReward:c,tombstoneDeposit:u,transactionBaseFee:s,transactionByteFee:n,transferFee:i}))))}function Ht(e){return!Array.isArray(e)}function zt(e){return e.stakeOf.entries().pipe((0,z.T)(e=>e.map(([{args:[e]},t])=>[e,t])))}function Rt(e){return e.votesOf.entries().pipe((0,z.T)(e=>e.map(([{args:[e]},t])=>[e,t])))}function Bt(e,t){const r=t.query.elections||t.query.phragmenElection||t.query.electionsPhragmen;return(0,te.p)(e,()=>r?r.stakeOf?function(e,t){return(0,Y.z)([zt(t),Rt(t)]).pipe((0,z.T)(([t,r])=>{const s=[];return r.forEach(([t,r])=>{s.push([t,{stake:e.registry.createType("Balance"),votes:r}])}),t.forEach(([e,t])=>{const r=s.find(([t])=>t.eq(e));r?r[1].stake=t:s.push([e,{stake:t,votes:[]}])}),s}))}(t,r):function(e){return e.voting.entries().pipe((0,z.T)(e=>e.map(([{args:[e]},t])=>[e,Ht(t)?{stake:t.stake,votes:t.votes}:{stake:t[0],votes:t[1]}])))}(r):(0,H.of)([]))}function Ot(e,t){return(0,te.p)(e,e=>t.derive.council.votes().pipe((0,z.T)(r=>(r.find(([t])=>t.eq(e))||[null,{stake:t.registry.createType("Balance"),votes:[]}])[1])))}const Vt=Ee("council"),Nt=Me("council"),Dt=Pe("council"),$t=He("council"),Ft=ze("council"),Ut=Ie("council"),jt=Re("council");var Lt=r(83448);function Kt(e,t){return(0,te.p)(e,e=>t.query.crowdloan.funds(e).pipe((0,z.T)(e=>e.isSome?function(e){return(0,q.X)((0,Lt.z)(":child_storage:default:",(0,j.q)((0,Lt.z)("crowdloan",(e.fundIndex||e.trieIndex).toU8a()))))}(e.unwrap()):null)))}var Wt=r(21166),Yt=r(32633);function Zt(e,t){return t.filter(({event:{data:[,t],method:r,section:s}})=>"crowdloan"===s&&["Contributed","Withdrew"].includes(r)&&t.eq(e)).reduce((e,{event:{data:[t],method:r}})=>("Contributed"===r?e.added.push(t.toHex()):e.removed.push(t.toHex()),e),{added:[],blockHash:t.createdAtHash?.toHex()||"-",removed:[]})}function Xt(e,t){let r=[],s=[];return e.query.system.events().pipe((0,P.n)(e=>{const n=Zt(t,e);return n.added.length||n.removed.length?(r=r.concat(...n.added),s=s.concat(...n.removed),(0,H.of)({added:r,addedDelta:n.added,blockHash:e.createdAtHash?.toHex()||"-",removed:s,removedDelta:n.removed})):Wt.w}),(0,ve.Z)({added:r,addedDelta:[],blockHash:"-",removed:s,removedDelta:[]}))}function Gt(e,t,r){return function(e,t){return e.query.system.events().pipe((0,P.n)(e=>e.filter(({event:{data:[e],method:r,section:s}})=>"crowdloan"===s&&["AllRefunded","Dissolved","PartiallyRefunded"].includes(r)&&e.eq(t)).length?(0,H.of)(e.createdAtHash?.toHex()||"-"):Wt.w),(0,ve.Z)("-"))}(e,t).pipe((0,P.n)(()=>(0,se.T)(e.rpc.childstate.getKeysPaged)?function(e,t){const r=new W.t(void 0);return r.pipe((0,P.n)(r=>e.rpc.childstate.getKeysPaged(t,"0x",1e3,r)),(0,Z.M)(e=>{(0,Xe.d)(()=>{1e3===e.length?r.next(e[999].toHex()):r.complete()})}),(0,X.$)(),(0,z.T)(e=>(0,Yt.a)(e)))}(e,r):e.rpc.childstate.getKeys(r,"0x")),(0,z.T)(e=>e.map(e=>e.toHex())))}function Qt(e,t){return(0,te.p)(e,e=>t.derive.crowdloan.childKey(e).pipe((0,P.n)(r=>r?function(e,t,r){return(0,Y.z)([Gt(e,t,r),Xt(e,t)]).pipe((0,z.T)(([e,{added:t,blockHash:r,removed:s}])=>{const n={};return e.forEach(e=>{n[e]=!0}),t.forEach(e=>{n[e]=!0}),s.forEach(e=>{delete n[e]}),{blockHash:r,contributorsHex:Object.keys(n)}}))}(t,e,r):(0,H.of)({blockHash:"-",contributorsHex:[]}))))}function Jt(e,t,r){return(0,Y.z)(r.map(r=>e.rpc.childstate.getStorage(t,r))).pipe((0,z.T)(t=>t.map(t=>e.registry.createType("Option<StorageData>",t)).map(t=>t.isSome?e.registry.createType("Balance",t.unwrap()):e.registry.createType("Balance")).reduce((e,t,s)=>(0,T.b)(e,{[r[s]]:t}),{})))}function er(e,t,r,s){return e.query.system.events().pipe((0,P.n)(n=>{const i=Zt(t,n),a=s.filter(e=>i.added.includes(e)||i.removed.includes(e));return a.length?Jt(e,r,a):Wt.w}),(0,ve.Z)({}))}function tr(e,t){return(0,te.p)(e,(e,r)=>t.derive.crowdloan.childKey(e).pipe((0,P.n)(s=>s&&r.length?function(e,t,r,s){return(0,Y.z)([Jt(e,r,s),er(e,t,r,s)]).pipe((0,z.T)(([e,t])=>(0,T.b)({},e,t)))}(t,e,s,r):(0,H.of)({}))))}var rr=r(35198),sr=r(26865),nr=r(85159);const ir=(0,sr.i)("democrac");function ar(e,t){return(0,te.p)(e,()=>(0,se.T)(t.query.scheduler?.agenda)?function(e){return function(e){return e.derive.democracy.referendumsFinished().pipe((0,P.n)(()=>e.query.scheduler.agenda.keys()),(0,P.n)(t=>{const r=t.map(({args:[e]})=>e);return r.length?(0,Y.z)([(0,H.of)(r),e.query.scheduler.agenda.multi(r).pipe((0,Ce.W)(()=>(0,H.of)(r.map(()=>[]))))]):(0,H.of)([[],[]])}))}(e).pipe((0,P.n)(([t,r])=>{const s=[];return t.forEach((t,n)=>{(r[n]||[]).filter(e=>e.isSome).forEach(r=>{const n=r.unwrap();if(n.maybeId.isSome){const r=n.maybeId.unwrap().toHex();if(r.startsWith(ir)){const a=n.call instanceof rr.g?(i=n.call).isInline||i.isLegacy||i.isLookup?(0,nr.h)(n.call):n.call.isHash?n.call.asHash.toHex():n.call.asValue.args[0].toHex():n.call.args[0].toHex();s.push({at:t,imageHash:a,index:e.registry.createType("(u64, ReferendumIndex)",r)[1]})}}var i})}),(0,Y.z)([(0,H.of)(s),s.length?e.derive.democracy.preimages(s.map(({imageHash:e})=>e)):(0,H.of)([])])}),(0,z.T)(([e,t])=>e.map((e,r)=>(0,T.b)({image:t[r]},e))))}(t):t.query.democracy.dispatchQueue?function(e){return e.query.democracy.dispatchQueue().pipe((0,P.n)(t=>(0,Y.z)([(0,H.of)(t),e.derive.democracy.preimages(t.map(([,e])=>e))])),(0,z.T)(([e,t])=>e.map(([e,r,s],n)=>({at:e,image:t[n],imageHash:(0,nr.h)(r),index:s}))))}(t):(0,H.of)([]))}const or=[0,1,2,4,8,16,32];function cr(e,t){return(0,te.p)(e,e=>t.query.democracy.votingOf?t.query.democracy.votingOf(e).pipe((0,P.n)(e=>e.isDirect?function(e,{votes:t}){return t.length?e.query.democracy.referendumInfoOf.multi(t.map(([e])=>e)).pipe((0,z.T)(r=>t.map((e,t)=>[e,r[t].unwrapOr(null)]).filter(e=>!!e[1]&&(0,$.b)(e[1].end)&&e[0][1].isStandard).map(([t,r])=>function(e,[t,r],s){const{balance:n,vote:i}=r.asStandard,[a,o]=s.isFinished?function(e,t,{approved:r,end:s}){return[s,r.isTrue&&t.isAye||r.isFalse&&t.isNay?s.add((e.consts.democracy.voteLockingPeriod||e.consts.democracy.enactmentPeriod).muln(or[t.conviction.index])):F.Yz]}(e,i,s.asFinished):[F.Yz,F.Yz];return{balance:n,isDelegated:!1,isFinished:s.isFinished,referendumEnd:a,referendumId:t,unlockAt:o,vote:i}}(e,t,r)))):(0,H.of)([])}(t,e.asDirect):e.isDelegating?function(e,{balance:t,conviction:r,target:s}){return e.derive.democracy.locks(s).pipe((0,z.T)(s=>s.map(({isFinished:s,referendumEnd:n,referendumId:i,unlockAt:a,vote:o})=>({balance:t,isDelegated:!0,isFinished:s,referendumEnd:n,referendumId:i,unlockAt:a.isZero()?a:n.add((e.consts.democracy.voteLockingPeriod||e.consts.democracy.enactmentPeriod).muln(or[r.index])),vote:e.registry.createType("Vote",{aye:o.isAye,conviction:r})}))))}(t,e.asDelegating):(0,H.of)([]))):(0,H.of)([]))}function ur(e,t){return(0,te.p)(e,()=>t.query.democracy?.nextExternal?t.query.democracy.nextExternal().pipe((0,P.n)(e=>function(e,t){if(t.isNone)return(0,H.of)(null);const[r,s]=t.unwrap();return e.derive.democracy.preimage(r).pipe((0,z.T)(e=>({image:e,imageHash:(0,nr.h)(r),threshold:s})))}(t,e))):(0,H.of)(null))}function dr(e,[t,r,s,n]){let i;try{i=e.registry.createType("Call",t.toU8a(!0))}catch(e){console.error(e)}return{at:n,balance:s,proposal:i,proposer:r}}function pr(e,t){return(0,te.p)(e,e=>e.length?(0,se.T)(t.query.democracy.preimages)?function(e,t){const r=t.map(e=>(0,nr.h)(e));return e.query.democracy.preimages.multi(r).pipe((0,z.T)(t=>t.map(t=>function(e,t){if(!t.isNone){if(function(e,t){return!!t&&!e.query.democracy.dispatchQueue}(e,t)){const r=t.unwrap();if(r.isMissing)return;const{data:s,deposit:n,provider:i,since:a}=r.asAvailable;return dr(e,[s,i,n,a])}return dr(e,t.unwrap())}}(e,t))))}(t,e):(0,se.T)(t.query.preimage.preimageFor)?function(e,t){const r=t.map(e=>(0,nr.h)(e)),s=e.registry.lookup.getTypeDef(e.query.preimage.preimageFor.creator.meta.type.asMap.key).type;return e.query.preimage.statusFor.multi(r).pipe((0,P.n)(t=>{const n=t.map(e=>e.unwrapOr(null)),i=n.map((e,t)=>e?"H256"===s?r[t]:e.isRequested?[r[t],e.asRequested.len.unwrapOr(0)]:[r[t],e.asUnrequested.len]:null).filter(e=>!!e);return e.query.preimage.preimageFor.multi(i).pipe((0,z.T)(t=>{let s=-1;return n.map((e,n)=>e?[r[n],e,t[++s].unwrapOr(null)]:[r[n],null,null]).map(t=>function(e,[t,r,s]){if(!r)return;const[n,i]=r.isUnrequested?function(e){return e.ticket||e.deposit}(r.asUnrequested):function(e){return(e.maybeTicket||e.deposit).unwrapOrDefault()}(r.asRequested);let a;if(s)try{a=e.registry.createType("Call",s.toU8a(!0))}catch(e){console.error(e)}return{at:F.Yz,balance:i,proposal:a,proposalHash:t,proposer:n}}(e,t))}))}))}(t,e):(0,H.of)([]):(0,H.of)([]))}const lr=de((e,t)=>e.derive.democracy.preimages([t]));function hr([e,t,r]){return e.filter(([,,e],t)=>!!r[t]?.isSome&&!e.isEmpty).map(([e,s,n],i)=>{const a=r[i].unwrap();return(0,T.b)({image:t[i],imageHash:(0,nr.h)(s),index:e,proposer:n},function(e){return(0,se.T)(e[1].mul)}(a)?{balance:a[1],seconds:a[0]}:{balance:a[0],seconds:a[1]})})}function fr(e,t){return(0,te.p)(e,()=>(0,se.T)(t.query.democracy?.publicProps)?t.query.democracy.publicProps().pipe((0,P.n)(e=>e.length?(0,Y.z)([(0,H.of)(e),t.derive.democracy.preimages(e.map(([,e])=>e)),t.query.democracy.depositOf.multi(e.map(([e])=>e))]):(0,H.of)([[],[],[]])),(0,z.T)(hr)):(0,H.of)([]))}function gr(e,t){return(0,te.p)(e,()=>t.query.democracy?.lowestUnbaked?t.queryMulti([t.query.democracy.lowestUnbaked,t.query.democracy.referendumCount]).pipe((0,z.T)(([e,t])=>t.gt(e)?[...Array(t.sub(e).toNumber())].map((t,r)=>e.addn(r)):[])):(0,H.of)([]))}function mr(e,t){return(0,te.p)(e,()=>t.derive.democracy.referendumsActive().pipe((0,P.n)(e=>e.length?(0,Y.z)([(0,H.of)(e),t.derive.democracy._referendumsVotes(e)]):(0,H.of)([[],[]])),(0,z.T)(([e,t])=>e.map((e,r)=>(0,T.b)({},e,t[r])))))}function yr(e,t){return(0,te.p)(e,()=>t.derive.democracy.referendumIds().pipe((0,P.n)(e=>e.length?t.derive.democracy.referendumsInfo(e):(0,H.of)([]))))}function br(e,t){return(0,te.p)(e,()=>t.derive.democracy.referendumIds().pipe((0,P.n)(e=>t.query.democracy.referendumInfoOf.multi(e)),(0,z.T)(e=>e.map(e=>e.unwrapOr(null)).filter(e=>!!e&&e.isFinished).map(e=>e.asFinished))))}function vr(e,t){return e.query.democracy.votersFor(t).pipe((0,P.n)(r=>(0,Y.z)([(0,H.of)(r),r.length?e.query.democracy.voteOf.multi(r.map(e=>[t,e])):(0,H.of)([]),e.derive.balances.votingBalances(r)])),(0,z.T)(([t,r,s])=>t.map((t,n)=>({accountId:t,balance:s[n].votingBalance||e.registry.createType("Balance"),isDelegating:!1,vote:r[n]||e.registry.createType("Vote")}))))}function wr(e,t){return e.query.democracy.votingOf.entries().pipe((0,z.T)(r=>{const s=r.map(([{args:[e]},t])=>[e,t]),n=function(e,t){return e.filter(([,e])=>e.isDirect).map(([e,r])=>[e,r.asDirect.votes.filter(([e])=>e.eq(t))]).filter(([,e])=>!!e.length).reduce((e,[t,r])=>r.reduce((e,[,r])=>(r.isStandard&&e.push((0,T.b)({accountId:t,isDelegating:!1},r.asStandard)),e),e),[])}(s,t),i=s.filter(([,e])=>e.isDelegating).map(([e,t])=>[e,t.asDelegating]);return i.forEach(([t,{balance:r,conviction:s,target:a}])=>{const o=i.find(([e])=>e.eq(a)),c=n.find(({accountId:e})=>e.eq(o?o[0]:a));c&&n.push({accountId:t,balance:r,isDelegating:!0,vote:e.registry.createType("Vote",{aye:c.vote.isAye,conviction:s})})}),n}))}function xr(e,t){return(0,te.p)(e,e=>(0,Y.z)([t.derive.democracy.sqrtElectorate(),(0,se.T)(t.query.democracy.votingOf)?wr(t,e.index):vr(t,e.index)]).pipe((0,z.T)(([t,r])=>(0,nr.f1)(t,e,r))))}function kr(e,t){return(0,te.p)(e,e=>e.length?(0,Y.z)(e.map(e=>t.derive.democracy._referendumVotes(e))):(0,H.of)([]))}function _r(e,t){return(0,te.p)(e,(e,r)=>{const s=(0,nr.BS)(r);return s?t.derive.democracy.preimage(s.proposal||s.proposalHash).pipe((0,z.T)(r=>({image:r,imageHash:(0,nr.qg)(s),index:t.registry.createType("ReferendumIndex",e),status:s}))):(0,H.of)(null)})}function Tr(e,t){return(0,te.p)(e,e=>e.length?t.query.democracy.referendumInfoOf.multi(e).pipe((0,P.n)(r=>(0,Y.z)(e.map((e,s)=>t.derive.democracy._referendumInfo(e,r[s])))),(0,z.T)(e=>e.filter(e=>!!e))):(0,H.of)([]))}var Sr=r(99014);function qr(e,t){return(0,te.p)(e,()=>t.query.balances.totalIssuance().pipe((0,z.T)(Sr.t)))}function Er(e){return function(e){return!Array.isArray(e)}(e)?[e.who,e.stake]:e}function Cr(e){return function(e){return Array.isArray(e)}(e)?e[0]:e}function Ar([,e],[,t]){return t.cmp(e)}function Mr(e,t){return(0,te.p)(e,()=>{const[e,r]=function(e){const[t]=e.registry.getModuleInstances(e.runtimeVersion.specName,"council")||["council"],r=e.query.phragmenElection?"phragmenElection":e.query.electionsPhragmen?"electionsPhragmen":e.query.elections?"elections":null;return[e.query[t]?t:"council",r]}(t);return(r?function(e,t,r){return e.queryMulti([e.query[t].members,e.query[r].candidates,e.query[r].members,e.query[r].runnersUp])}(t,e,r):function(e,t){return(0,Y.z)([e.query[t].members(),(0,H.of)([]),(0,H.of)([]),(0,H.of)([])])}(t,e)).pipe((0,z.T)(([e,s,n,i])=>(0,T.b)({},function(e,t){return t?{candidacyBond:e.consts[t].candidacyBond,desiredRunnersUp:e.consts[t].desiredRunnersUp,desiredSeats:e.consts[t].desiredMembers,termDuration:e.consts[t].termDuration,votingBond:e.consts[t].votingBond,votingBondBase:e.consts[t].votingBondBase,votingBondFactor:e.consts[t].votingBondFactor}:{}}(t,r),{candidateCount:t.registry.createType("u32",s.length),candidates:s.map(Cr),members:n.length?n.map(Er).sort(Ar):e.map(e=>[e,t.registry.createType("Balance")]),runnersUp:i.map(Er).sort(Ar)})))})}function Ir([e,t,r,s]){return t.forEach((t,n)=>{const i=t.toString(),a=s[n],o=!r[n].isEmpty,c=e[i];c&&c.hasMessage===o&&c.blockCount.eq(a)||(e[i]={blockCount:a,hasMessage:o,isOnline:o||a.gt(F.Yz)})}),e}function Pr(e,t){return(0,te.p)(e,()=>t.query.imOnline?.receivedHeartbeats?t.derive.staking.overview().pipe((0,P.n)(({currentIndex:e,validators:r})=>(0,Y.z)([(0,H.of)({}),(0,H.of)(r),t.query.imOnline.receivedHeartbeats.multi(r.map((t,r)=>[e,r])),t.query.imOnline.authoredBlocks.multi(r.map(t=>[e,t]))])),(0,z.T)(Ir)):(0,H.of)({}))}const Hr=Ee("membership"),zr=Me("membership"),Rr=Pe("membership"),Br=He("membership"),Or=ze("membership"),Vr=Ie("membership"),Nr=Re("membership");function Dr([e,t,r,s,n]){return{activeEra:t,activeEraStart:r,currentEra:s,currentIndex:e,validatorCount:n}}function $r(e,t){return(0,te.p)(e,()=>t.query.session?t.query.staking?function(e){return e.queryMulti([e.query.session.currentIndex,e.query.staking.activeEra,e.query.staking.currentEra,e.query.staking.validatorCount]).pipe((0,z.T)(([e,t,r,s])=>{const{index:n,start:i}=t.unwrapOrDefault();return Dr([e,n,i,r.unwrapOrDefault(),s])}))}(t):function(e){return e.query.session.currentIndex().pipe((0,z.T)(t=>Dr([t,e.registry.createType("EraIndex"),e.registry.createType("Option<Moment>"),e.registry.createType("EraIndex"),e.registry.createType("u32")])))}(t):function(e){return(0,H.of)(Dr([e.registry.createType("SessionIndex",1),e.registry.createType("EraIndex"),e.registry.createType("Option<Moment>"),e.registry.createType("EraIndex"),e.registry.createType("u32")]))}(t))}function Fr(e,t){return(0,te.p)(e,()=>t.derive.session.indexes().pipe((0,z.T)(e=>{const r=t.consts?.babe?.epochDuration||t.registry.createType("u64",1),s=t.consts?.staking?.sessionsPerEra||t.registry.createType("SessionIndex",1);return(0,T.b)({eraLength:t.registry.createType("BlockNumber",s.mul(r)),isEpoch:!!t.query.babe,sessionLength:r,sessionsPerEra:s},e)})))}function Ur(e){return(t,r)=>(0,te.p)(t,()=>r.derive.session.progress().pipe((0,z.T)(t=>t[e])))}function jr(e,t){return(0,te.p)(e,()=>t.query.babe?function(e){return e.derive.session.info().pipe((0,P.n)(t=>(0,Y.z)([(0,H.of)(t),e.query.staking?.erasStartSessionIndex?e.queryMulti([e.query.babe.currentSlot,e.query.babe.epochIndex,e.query.babe.genesisSlot,[e.query.staking.erasStartSessionIndex,t.activeEra]]):e.queryMulti([e.query.babe.currentSlot,e.query.babe.epochIndex,e.query.babe.genesisSlot])])),(0,z.T)(([t,[r,s,n,i]])=>[t,[r,s,n,i&&i.isSome?i.unwrap():e.registry.createType("SessionIndex",1)]]))}(t).pipe((0,z.T)(([e,r])=>function(e,t,[r,s,n,i]){const a=s.mul(t.sessionLength).iadd(n),o=r.sub(a),c=t.currentIndex.sub(i).imul(t.sessionLength).iadd(o);return(0,T.b)({eraProgress:e.registry.createType("BlockNumber",c),sessionProgress:e.registry.createType("BlockNumber",o)},t)}(t,e,r))):function(e){return e.derive.session.info().pipe((0,z.T)(t=>(0,T.b)({eraProgress:e.registry.createType("BlockNumber"),sessionProgress:e.registry.createType("BlockNumber")},t)))}(t))}const Lr=Ur("eraLength"),Kr=Ur("eraProgress"),Wr=Ur("sessionProgress");function Yr(e,t){return(0,te.p)(e,()=>t.query.society.suspendedCandidates&&t.query.society.candidates.creator.meta.type.isPlain?function(e){return e.query.society.candidates().pipe((0,P.n)(t=>(0,Y.z)([(0,H.of)(t),e.query.society.suspendedCandidates.multi(t.map(({who:e})=>e))])),(0,z.T)(([e,t])=>e.map(({kind:e,value:r,who:s},n)=>({accountId:s,isSuspended:t[n].isSome,kind:e,value:r}))))}(t):function(e){return e.query.society.candidates.entries().pipe((0,z.T)(e=>e.filter(([,e])=>e.isSome).map(([{args:[e]},t])=>[e,t.unwrap()]).map(([e,{bid:t,kind:r}])=>({accountId:e,isSuspended:!1,kind:r,value:t}))))}(t))}function Zr(e,t){return(0,te.p)(e,()=>(0,Y.z)([t.query.society.bids(),t.query.society.defender?t.query.society.defender():(0,H.of)(void 0),t.query.society.founder(),t.query.society.head(),t.query.society.maxMembers?t.query.society.maxMembers():(0,H.of)(void 0),t.query.society.pot()]).pipe((0,z.T)(([e,t,r,s,n,i])=>({bids:e,defender:t?.unwrapOr(void 0),founder:r.unwrapOr(void 0),hasDefender:t?.isSome&&s.isSome&&!s.eq(t)||!1,head:s.unwrapOr(void 0),maxMembers:n,pot:i}))))}function Xr(e,t){return(0,te.p)(e,e=>t.derive.society._members([e]).pipe((0,z.T)(([e])=>e)))}function Gr(e,t){return(0,te.p)(e,e=>t.query.society.members.creator.meta.type.isMap?function(e,t){return(0,Y.z)([(0,H.of)(t),e.query.society.members.multi(t),e.query.society.payouts.multi(t),e.query.society.challengeRoundCount().pipe((0,P.n)(r=>e.query.society.defenderVotes.multi(t.map(e=>[r,e])))),e.query.society.suspendedMembers.multi(t)]).pipe((0,z.T)(([e,t,r,s,n])=>e.map((e,i)=>t[i].isSome?{accountId:e,isDefenderVoter:s[i].isSome,isSuspended:n[i].isSome,member:t[i].unwrap(),payouts:r[i].payouts}:null).filter(e=>!!e).map(({accountId:e,isDefenderVoter:t,isSuspended:r,member:s,payouts:n})=>({accountId:e,isDefenderVoter:t,isSuspended:r,payouts:n,strikes:s.strikes,vouching:s.vouching.unwrapOr(void 0)}))))}(t,e):function(e,t){return(0,Y.z)([(0,H.of)(t),e.query.society.payouts.multi(t),e.query.society.strikes.multi(t),e.query.society.defenderVotes.multi(t),e.query.society.suspendedMembers.multi(t),e.query.society.vouching.multi(t)]).pipe((0,z.T)(([e,t,r,s,n,i])=>e.map((e,a)=>({accountId:e,isDefenderVoter:s[a].isSome,isSuspended:n[a].isTrue,payouts:t[a],strikes:r[a],vote:s[a].unwrapOr(void 0),vouching:i[a].unwrapOr(void 0)}))))}(t,e))}function Qr(e,t){return(0,te.p)(e,()=>t.query.society.members.creator.meta.type.isMap?t.query.society.members.keys().pipe((0,P.n)(e=>t.derive.society._members(e.map(({args:[e]})=>e)))):t.query.society.members().pipe((0,P.n)(e=>t.derive.society._members(e))))}const Jr={withDestination:!0,withLedger:!0,withNominations:!0,withPrefs:!0};function es(e,t,r){const s=Object.entries((n=(t?.unlocking||[]).filter(({era:e})=>e.unwrap().gt(r.activeEra)),n.reduce((e,{era:t,value:r})=>{const s=t.toString();return e[s]=(e[s]||F.Yz).add(r.unwrap()),e},{}))).map(([t,s])=>({remainingEras:new Qe(t).isub(r.activeEra),value:e.registry.createType("Balance",s)}));var n;return s.length?s:void 0}function ts(e,t,r){return e.registry.createType("Balance",(t?.unlocking||[]).reduce((e,{era:t,value:s})=>t.unwrap().gt(r.currentEra)?e:e.iadd(s.unwrap()),new Qe(0)))}function rs(e,t){return(0,te.p)(e,(e,r=Jr)=>t.derive.session.info().pipe((0,P.n)(s=>(0,Y.z)([t.derive.staking.keysMulti(e),t.derive.staking.queryMulti(e,r)]).pipe((0,z.T)(([e,r])=>r.map((r,n)=>function(e,t,r,s){return(0,T.b)({},r,s,{redeemable:ts(e,s.stakingLedger,t),unlocking:es(e,s.stakingLedger,t)})}(t,s,e[n],r)))))))}const ss=de((e,t,r)=>e.derive.staking.accounts([t],r));function ns(e,t){return(0,te.p)(e,()=>t.derive.session.indexes().pipe((0,P.n)(({activeEra:e})=>t.query.staking.erasRewardPoints(e))))}const is={withController:!0,withExposure:!0,withPrefs:!0};function as(e,t){return(0,te.p)(e,(e=is,r=0)=>t.derive.staking.validators().pipe((0,P.n)(({nextElected:s,validators:n})=>t.derive.staking.queryMulti(function(e,t){return(0,Yt.a)([e,t.filter(t=>!e.find(e=>e.eq(t)))])}(s,n),e,r).pipe((0,z.T)(e=>({info:e,nextElected:s,validators:n}))))))}var os=r(34060);function cs(e,t,r){const s=`${e}-${t.toString()}`;return[s,r?void 0:os.Y.get(s)]}function us(e,t,r){return r?[]:t.map(t=>os.Y.get(`${e}-${t.toString()}`)).filter(e=>!!e)}function ds(e,t,r){return!t&&os.Y.set(e,r),r}function ps(e,t,r){return!t&&r.forEach(t=>os.Y.set(`${e}-${t.era.toString()}`,t)),r}function ls(e,t,r){return e.map(e=>t.find(({era:t})=>e.eq(t))||r.find(({era:t})=>e.eq(t))).filter(e=>!!e)}var hs=r(80438);function fs(e,t){return e.filter(e=>!t.some(({era:t})=>e.eq(t)))}function gs(e){return(t,r)=>(0,te.p)(t,(t=!1)=>r.derive.staking.erasHistoric(t).pipe((0,P.n)(s=>r.derive.staking[e](s,t))))}function ms(e){return(t,r)=>(0,te.p)(t,(t,s=!1,n)=>r.derive.staking.erasHistoric(s).pipe((0,P.n)(i=>r.derive.staking[e](t,i,s,n||0))))}function ys(e){return(t,r)=>(0,te.p)(t,t=>r.derive.staking[e](t,!0))}function bs(e){return(t,r)=>(0,te.p)(t,(t,s)=>t.length?function(e,t){const r=(0,hs.R)(e,14);let s=0;const n=new W.t(r[s]);return n.pipe((0,P.n)(t),(0,Z.M)(()=>{(0,Xe.d)(()=>{s++,s===r.length?n.complete():n.next(r[s])})}),(0,X.$)(),(0,z.T)(Yt.a))}(t,t=>(0,Y.z)(t.map(t=>r.derive.staking[e](t,s)))):(0,H.of)([]))}function vs(e,t){return(0,te.p)(e,(e,r=!1)=>{const[s,n]=cs("eraExposure",e,r);return n?(0,H.of)(n):t.query.staking.erasStakersPaged?t.query.staking.erasStakersPaged.entries(e).pipe((0,z.T)(t=>ds(s,r,function(e,t){const r={},s={};return t.forEach(([e,t])=>{if(t.isSome){const n=e.args[1].toString(),i=t.unwrap();s[n]=i,i.others.forEach(({who:e},t)=>{const s=e.toString();r[s]=r[s]||[],r[s].push({validatorId:n,validatorIndex:t})})}}),{era:e,nominators:r,validators:s}}(e,t)))):t.query.staking.erasStakersClipped.entries(e).pipe((0,z.T)(t=>ds(s,r,function(e,t){const r={},s={};return t.forEach(([e,t])=>{const n=e.args[1].toString();s[n]=t,t.others.forEach(({who:e},t)=>{const s=e.toString();r[s]=r[s]||[],r[s].push({validatorId:n,validatorIndex:t})})}),{era:e,nominators:r,validators:s}}(e,t))))})}const ws=ys("_eraExposure"),xs=bs("_eraExposure"),ks=gs("_erasExposure");function _s(e,t){return(0,te.p)(e,e=>(0,Y.z)([t.query.staking.activeEra(),t.consts.staking.historyDepth?(0,H.of)(t.consts.staking.historyDepth):t.query.staking.historyDepth()]).pipe((0,z.T)(([r,s])=>{const n=[],i=s.toNumber(),a=r.unwrapOrDefault().index;let o=a;for(;o.gte(F.Yz)&&n.length<i;)o===a&&!0!==e||n.push(t.registry.createType("EraIndex",o)),o=o.sub(F.Uu);return n.reverse()})))}const Ts="eraPoints";function Ss({individual:e}){return[...e.entries()].filter(([,e])=>e.gt(F.Yz)).reduce((e,[t,r])=>(e[t.toString()]=r,e),{})}function qs(e,t){return(0,te.p)(e,(e,r)=>{if(!e.length)return(0,H.of)([]);const s=us(Ts,e,r),n=fs(e,s);return n.length?t.query.staking.erasRewardPoints.multi(n).pipe((0,z.T)(t=>ls(e,s,ps(Ts,r,function(e,t){return e.map((e,r)=>({era:e,eraPoints:t[r].total,validators:Ss(t[r])}))}(n,t))))):(0,H.of)(s)})}const Es=gs("_erasPoints");function Cs(e,t){return(0,te.p)(e,(e,r)=>{const[s,n]=cs("eraPrefs",e,r);return n?(0,H.of)(n):t.query.staking.erasValidatorPrefs.entries(e).pipe((0,z.T)(t=>ds(s,r,function(e,t){const r={};return t.forEach(([e,t])=>{r[e.args[1].toString()]=t}),{era:e,validators:r}}(e,t))))})}const As=ys("_eraPrefs"),Ms=bs("_eraPrefs"),Is=gs("_erasPrefs"),Ps="eraRewards";function Hs(e,t){return(0,te.p)(e,(e,r)=>{if(!e.length)return(0,H.of)([]);const s=us(Ps,e,r),n=fs(e,s);return n.length?t.query.staking.erasValidatorReward.multi(n).pipe((0,z.T)(t=>ls(e,s,ps(Ps,r,function(e,t){return e.map((e,r)=>({era:e,eraReward:t[r].unwrapOrDefault()}))}(n,t))))):(0,H.of)(s)})}const zs=gs("_erasRewards");function Rs(e,t){return(0,te.p)(e,(e,r)=>{const[s,n]=cs("eraSlashes",e,r);return n?(0,H.of)(n):(0,Y.z)([t.query.staking.nominatorSlashInEra.entries(e),t.query.staking.validatorSlashInEra.entries(e)]).pipe((0,z.T)(([t,n])=>ds(s,r,function(e,t,r){const s={},n={};return t.forEach(([e,t])=>{s[e.args[1].toString()]=t.unwrap()}),r.forEach(([e,t])=>{n[e.args[1].toString()]=t.unwrapOrDefault()[1]}),{era:e,nominators:s,validators:n}}(e,t,n))))})}const Bs=ys("_eraSlashes"),Os=bs("_eraSlashes"),Vs=gs("_erasSlashes"),Ns=de((e,t)=>e.derive.staking.keysMulti([t]));function Ds(e,t){return(0,te.p)(e,e=>e.length?t.query.session.queuedKeys().pipe((0,P.n)(r=>(0,Y.z)([(0,H.of)(r),t.consts.session?.dedupKeyPrefix?t.query.session.nextKeys.multi(e.map(e=>[t.consts.session.dedupKeyPrefix,e])):(0,Y.z)(e.map(e=>t.query.session.nextKeys(e)))])),(0,z.T)(([t,r])=>e.map((e,s)=>function(e,t,r){const s=(t.find(([t])=>t.eq(e))||[void 0,[]])[1],n=r.unwrapOr([]);return{nextSessionIds:Array.isArray(n)?n:[...n.values()],sessionIds:Array.isArray(s)?s:[...s.values()]}}(e,t,r[s])))):(0,H.of)([]))}function $s(e,t){return(0,te.p)(e,()=>(0,Y.z)([t.derive.session.indexes(),t.derive.staking.validators()]).pipe((0,z.T)(([e,{nextElected:t,validators:r}])=>(0,T.b)({},e,{nextElected:t,validators:r}))))}function Fs(e,t){return(0,te.p)(e,(e,r,s,n)=>{const i=t.registry.createType("Exposure"),a=t.registry.createType("Option<Null>"),o=t.registry.createType("Option<Null>");return r.length?(0,Y.z)([t.query.staking.erasStakersClipped?(0,Y.z)(r.map(r=>t.query.staking.erasStakersClipped(r,e))):(0,H.of)(r.map(e=>i)),t.query.staking.erasStakers?(0,Y.z)(r.map(r=>t.query.staking.erasStakers(r,e))):(0,H.of)(r.map(e=>i)),t.query.staking.erasStakersPaged?(0,Y.z)(r.map(r=>t.query.staking.erasStakersPaged(r,e,n))):(0,H.of)(r.map(e=>a)),t.query.staking.erasStakersOverview?(0,Y.z)(r.map(r=>t.query.staking.erasStakersOverview(r,e))):(0,H.of)(r.map(e=>o))]).pipe((0,z.T)(([e,t,s,n])=>r.map((r,i)=>({clipped:e[i],era:r,exposure:t[i],exposureMeta:n[i],exposurePaged:s[i]})))):(0,H.of)([])})}const Us=de((e,t,r,s)=>e.derive.staking._ownExposures(t,[r],!0,s||0)),js=ms("_ownExposures");function Ls(e,t){return(0,te.p)(e,(e,r,s)=>r.length?(0,Y.z)([(0,Y.z)(r.map(r=>t.query.staking.validatorSlashInEra(r,e))),(0,Y.z)(r.map(r=>t.query.staking.nominatorSlashInEra(r,e)))]).pipe((0,z.T)(([e,t])=>r.map((r,s)=>({era:r,total:e[s].isSome?e[s].unwrap()[1]:t[s].unwrapOrDefault()})))):(0,H.of)([]))}const Ks=de((e,t,r)=>e.derive.staking._ownSlashes(t,[r],!0)),Ws=ms("_ownSlashes");function Ys(e,t){return e.registry.createType("Vec<u32>",t.filter(e=>-1!==e))}function Zs(e,t,r,s,n){return function(e,t,r,{withClaimedRewardsEras:s,withController:n,withDestination:i,withExposure:a,withExposureErasStakersLegacy:o,withExposureMeta:c,withLedger:u,withNominations:d,withPrefs:p},l){const h=e.registry.createType("Option<Nominations>"),f=e.registry.createType("RewardDestination"),g=e.registry.createType("Exposure"),m=e.registry.createType("ValidatorPrefs"),y=e.registry.createType("Option<Null>"),b=e.registry.createType("Option<Null>"),v=[-1],w=Number(e.consts.staking.historyDepth.toNumber()),x=new Array(w).fill(0).map((e,t)=>0===t?r.toNumber()-1:r.toNumber()-t-1);return(0,Y.z)([n||u?(0,Y.z)(t.map(t=>e.query.staking.bonded(t))):(0,H.of)(t.map(()=>null)),d?(0,Y.z)(t.map(t=>e.query.staking.nominators(t))):(0,H.of)(t.map(()=>h)),i?(0,Y.z)(t.map(t=>e.query.staking.payee(t))):(0,H.of)(t.map(()=>f)),p?(0,Y.z)(t.map(t=>e.query.staking.validators(t))):(0,H.of)(t.map(()=>m)),a&&e.query.staking.erasStakersPaged?(0,Y.z)(t.map(t=>e.query.staking.erasStakersPaged(r,t,l))):(0,H.of)(t.map(()=>y)),c&&e.query.staking.erasStakersOverview?(0,Y.z)(t.map(t=>e.query.staking.erasStakersOverview(r,t))):(0,H.of)(t.map(()=>b)),s&&e.query.staking.claimedRewards?(0,Y.z)([e.query.staking.claimedRewards.entries(),e.query.staking.erasStakersOverview.entries()]).pipe((0,z.T)(([e,r])=>function(e,t,r,s){const n={},i={},a=e.map(e=>e.toString());return r.forEach(([e,t])=>{const r=e.args[1].toString(),s=e.args[0].toNumber();a.includes(r)&&(n[r]||(n[r]=new Map),n[r].set(s,t.toArray()))}),s.forEach(([e,t])=>{const r=e.args[1].toString(),s=e.args[0].toNumber();a.includes(r)&&t.isSome&&(i[r]||(i[r]=new Map),i[r].set(s,t.unwrap().pageCount))}),e.map(e=>{const r=n[e.toString()],s=i[e.toString()];return t.map(e=>{if(r&&r.has(e)&&s&&s.has(e)){const t=r.get(e),n=s.get(e);return t.length===n.toNumber()?e:-1}return-1})})}(t,x,e,r))):(0,H.of)(t.map(()=>v)),o&&e.query.staking.erasStakers?(0,Y.z)(t.map(t=>e.query.staking.erasStakers(r,t))):(0,H.of)(t.map(()=>g))])}(e,r,t,s,n).pipe((0,P.n)(([t,n,i,a,o,c,u,d])=>function(e,t,{withLedger:r=!1}){const s=t.filter(e=>r&&!!e&&e.isSome).map(e=>e.unwrap()),n=e.registry.createType("Option<StakingLedger>");return(s.length?(0,Y.z)(s.map(t=>e.query.staking.ledger(t))):(0,H.of)([])).pipe((0,z.T)(e=>{let r=-1;return t.map(t=>t&&t.isSome&&e[++r]||n)}))}(e,t,s).pipe((0,z.T)(s=>r.map((r,p)=>function(e,t,r,s,n,i,a,o,c,u,d){return{accountId:t,claimedRewardsEras:Ys(e,u),controllerId:r?.unwrapOr(null)||null,exposureEraStakers:d,exposureMeta:c,exposurePaged:a,nominators:s.isSome?s.unwrap().targets:[],rewardDestination:(p=n,"boolean"==typeof p.isSome?p.unwrapOr(null):p),stakingLedger:o.unwrapOrDefault(),stashId:t,validatorPrefs:i};var p}(e,r,t[p],n[p],i[p],a[p],o[p],s[p],c[p],u[p],d[p]))))))}const Xs=de((e,t,r,s)=>e.derive.staking.queryMulti([t],r,s));function Gs(e,t){return(0,te.p)(e,(e,r,s)=>t.derive.session.indexes().pipe((0,P.n)(({activeEra:n})=>{const i=e.map(e=>t.registry.createType("AccountId",e)),a=s||0;return i.length?Zs(t,n,i,r,a):(0,H.of)([])})))}function Qs(e,t){return(0,te.p)(e,(e,r,s=!1)=>{const n=e.map(e=>t.registry.createType("AccountId",e).toString());return t.derive.staking._erasExposure(r,s).pipe((0,z.T)(e=>n.map(t=>e.map(({era:e,nominators:r,validators:s})=>{const n=!!s[t],i={},a=r[t]||[];return n?i[t]=s[t]:a&&a.forEach(({validatorId:e})=>{i[e]=s[e]}),{era:e,isEmpty:!Object.keys(i).length,isValidator:n,nominating:a,validators:i}}))))})}function Js(e,t){return(0,te.p)(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe((0,P.n)(s=>t.derive.staking._stakerExposures(e,s,r))))}const en=de((e,t,r)=>e.derive.staking.stakerExposures([t],r));function tn(e,t){return(0,te.p)(e,(e,r,s)=>{const n=t.registry.createType("AccountId",e).toString();return t.derive.staking._erasPoints(r,s).pipe((0,z.T)(e=>e.map(({era:e,eraPoints:r,validators:s})=>({era:e,eraPoints:r,points:s[n]||t.registry.createType("RewardPoint")}))))})}const rn=ms("_stakerPoints");function sn(e,t){return(0,te.p)(e,(e,r,s)=>t.query.staking.erasValidatorPrefs.multi(r.map(t=>[t,e])).pipe((0,z.T)(e=>e.map((e,t)=>({era:r[t],validatorPrefs:e})))))}const nn=ms("_stakerPrefs");function an(e,t){const r=t?(t.legacyClaimedRewards||t.claimedRewards)?.toArray():[];return(e.toArray()||[]).concat(r)}function on(e,t){return(0,te.p)(e,(e,r=!1)=>(0,Y.z)([t.derive.staking._erasPoints(e,r),t.derive.staking._erasPrefs(e,r),t.derive.staking._erasRewards(e,r)]))}function cn(e,t){return(0,te.p)(e,(e,r,s=!1)=>{const n=r.map(e=>"number"==typeof e||"string"==typeof e?t.registry.createType("u32",e):e);return(0,Y.z)([t.derive.staking.queryMulti(e,{withClaimedRewardsEras:!0,withLedger:!0}),t.derive.staking._stakerExposures(e,n,s),t.derive.staking._stakerRewardsEras(n,s)]).pipe((0,P.n)(([e,n,i])=>{const a=e.map(({claimedRewardsEras:e,stakingLedger:r,stashId:s},a)=>s&&(r||e)?function(e,t,[r,s,n],i,a){return i.map(({era:i,isEmpty:o,isValidator:c,nominating:u,validators:d})=>{const{eraPoints:p,validators:l}=r.find(e=>e.era.eq(i))||{eraPoints:F.Yz,validators:{}},{eraReward:h}=n.find(e=>e.era.eq(i))||{eraReward:e.registry.createType("Balance")},{validators:f}=s.find(e=>e.era.eq(i))||{validators:{}},g={},m=t.toString();return Object.entries(d).forEach(([t,r])=>{const s=l[t]||F.Yz,n=f[t]?.commission.unwrap()||F.Yz,i=r.total?r.total?.unwrap():r.pageTotal?r.pageTotal?.unwrap():F.Yz;let a,o=F.Yz;if(!(i.isZero()||s.isZero()||p.isZero())){o=h.mul(s).div(p);const e=n.mul(o).div(F.pr);let c;if(t===m)if(r.own)c=r.own.unwrap();else{const e=r.others.find(({who:e})=>e.eq(t));c=e?e.value.unwrap():F.Yz}else{const e=r.others.find(({who:e})=>e.eq(m));c=e?e.value.unwrap():F.Yz}a=o.sub(e).imul(c).div(i).iadd(t===m?e:F.Yz)}g[t]={total:e.registry.createType("Balance",o),value:e.registry.createType("Balance",a)}}),{era:i,eraReward:h,isClaimed:a.some(e=>e.eq(i)),isEmpty:o,isValidator:c,nominating:u,validators:g}})}(t,s,i,n[a],e):[]);if(s)return(0,H.of)(a);const[o,c]=a.reduce(([e,t],r)=>{const s=[];return t.push(s),r.forEach(({validators:t})=>Object.keys(t).forEach(t=>{s.includes(t)||(s.push(t),e.includes(t)||e.push(t))})),[e,t]},[[],[]]);return t.derive.staking.queryMulti(o,{withClaimedRewardsEras:!0,withLedger:!0}).pipe((0,z.T)(t=>e.map(({claimedRewardsEras:e,stakingLedger:s},n)=>function(e,t,{claimedRewardsEras:r,rewards:s,stakingLedger:n}){const i=e.filter(e=>!an(r,n).some(t=>t?.eq(e))),a=t.map(([e])=>e),o=t.map(([,e])=>e);return s.filter(({isEmpty:e})=>!e).filter(e=>!!i.some(t=>e.era.eq(t))&&(function(e,t,r,s){const n=[];Object.keys(r.validators).forEach(i=>{const a=e.indexOf(i);if(-1!==a){const e=t[a].stakingLedger;an(s,e).some(e=>r.era?.eq(e))&&n.push(i)}}),n.forEach(e=>{delete r.validators[e]})}(a,o,e,r),!0)).filter(({validators:e})=>0!==Object.keys(e).length).map(e=>{let t=e.isClaimed;const r=Object.keys(e.validators);if(!e.isClaimed&&r.length)for(const s of r){const r=o.find(e=>e.accountId.toString()===s);if(r){t=r.claimedRewardsEras?.toArray().some(t=>t.eq(e.era));break}}return(0,T.b)({},e,{isClaimed:t,nominators:e.nominating.filter(t=>e.validators[t.validatorId])})})}(r,c[n].map(e=>[e,t.find(t=>t.accountId.eq(e))]).filter(e=>!!e[1]),{claimedRewardsEras:e,rewards:a[n],stakingLedger:s}))))}))})}const un=de((e,t,r)=>e.derive.staking.erasHistoric(r).pipe((0,P.n)(s=>e.derive.staking._stakerRewards([t],s,r))));function dn(e,t){return(0,te.p)(e,(e,r)=>e.length&&r.length?t.derive.staking._stakerRewards(e,r,!1):(0,H.of)([]))}function pn(e,t){return(0,te.p)(e,(e,r=!1)=>t.derive.staking.erasHistoric(r).pipe((0,P.n)(r=>t.derive.staking.stakerRewardsMultiEras(e,r))))}function ln(e,t){return(0,te.p)(e,(e,r,s)=>{const n=t.registry.createType("AccountId",e).toString();return t.derive.staking._erasSlashes(r,s).pipe((0,z.T)(e=>e.map(({era:e,nominators:r,validators:s})=>({era:e,total:r[n]||s[n]||t.registry.createType("Balance")}))))})}const hn=ms("_stakerSlashes");var fn=r(11709);function gn(e,t){return(0,te.p)(e,()=>function(e){let t=Date.now();return e.query.system.events().pipe((0,z.T)(e=>(t=e.filter(({event:e,phase:t})=>{try{return t.isApplyExtrinsic&&"staking"===e.section&&"Bonded"===e.method}catch{return!1}})?Date.now():t,t)),(0,ve.Z)(t),(0,fn.V)({skipTimeout:!0}))}(t).pipe((0,P.n)(()=>t.query.staking.validators.keys()),(0,z.T)(e=>e.map(({args:[e]})=>e).filter(e=>e))))}function mn(e,t){return(0,te.p)(e,()=>t.query.staking.erasStakersOverview?t.derive.session.indexes().pipe((0,P.n)(({currentEra:e})=>t.query.staking.erasStakersOverview.keys(e)),(0,z.T)(e=>[...new Set(e.map(({args:[,e]})=>e.toString()))].map(e=>t.registry.createType("AccountId",e)))):t.query.staking.erasStakers?t.derive.session.indexes().pipe((0,P.n)(({currentEra:e})=>t.query.staking.erasStakers.keys(e)),(0,z.T)(e=>[...new Set(e.map(({args:[,e]})=>e.toString()))].map(e=>t.registry.createType("AccountId",e)))):t.query.staking.currentElected())}function yn(e,t){return(0,te.p)(e,()=>(0,Y.z)([t.query.session?t.query.session.validators():(0,H.of)([]),t.query.staking?t.derive.staking.nextElected():(0,H.of)([])]).pipe((0,z.T)(([e,t])=>({nextElected:t.length?t:e,validators:e}))))}const bn={withController:!0,withPrefs:!0};function vn(e,t){return(0,te.p)(e,(e=bn)=>(0,Y.z)([t.derive.staking.validators(),t.derive.staking.stashes()]).pipe((0,P.n)(([{nextElected:r},s])=>{const n=r.map(e=>e.toString()),i=s.filter(e=>!n.includes(e.toString()));return t.derive.staking.queryMulti(i,e).pipe((0,z.T)(e=>({info:e,waiting:i})))})))}const wn=Ee("technicalCommittee"),xn=Me("technicalCommittee"),kn=Pe("technicalCommittee"),_n=He("technicalCommittee"),Tn=ze("technicalCommittee"),Sn=Ie("technicalCommittee"),qn=Re("technicalCommittee");function En(e,t){return!!e.isSome&&e.unwrap().some(e=>e.eq(t))}function Cn(e,t){const r=t.find(([t])=>t===e);if(r&&r[1].isSome){const[e,t]=r[1].unwrap();return(0,T.b)({collatorId:e},t.isWithRetries?{isRetriable:!0,retries:t.asWithRetries.toNumber()}:{isRetriable:!1,retries:0})}return null}function An(e,t){return t.map(t=>{const r=t.find(([t])=>t===e);return r?r[1]:null})}function Mn(e,t){return(0,te.p)(e,e=>t.query.registrar&&t.query.teyrchains?t.queryMulti([t.query.registrar.active,t.query.registrar.retryQueue,t.query.registrar.selectedThreads,t.query.teyrchains.didUpdate,[t.query.registrar.paras,e],[t.query.registrar.pendingSwap,e],[t.query.teyrchains.heads,e],[t.query.teyrchains.relayDispatchQueue,e]]).pipe((0,z.T)(r=>function(e,[t,r,s,n,i,a,o,c]){return i.isNone?null:{active:Cn(e,t),didUpdate:En(n,e),heads:o,id:e,info:(0,T.b)({id:e},i.unwrap()),pendingSwapId:a.unwrapOr(null),relayDispatchQueue:c,retryCollators:An(e,r),selectedCollators:An(e,s)}}(t.registry.createType("ParaId",e),r))):(0,H.of)(null))}function In([e,t,r,s,n]){return e.map((e,i)=>({didUpdate:En(t,e),id:e,info:(0,T.b)({id:e},s[i].unwrapOr(null)),pendingSwapId:n[i].unwrapOr(null),relayDispatchQueueSize:r[i][0].toNumber()}))}function Pn(e,t){return(0,te.p)(e,()=>t.query.registrar?.teyrchains&&t.query.teyrchains?t.query.registrar.teyrchains().pipe((0,P.n)(e=>(0,Y.z)([(0,H.of)(e),t.query.teyrchains.didUpdate(),t.query.teyrchains.relayDispatchQueueSize.multi(e),t.query.registrar.paras.multi(e),t.query.registrar.pendingSwap.multi(e)])),(0,z.T)(In)):(0,H.of)([]))}function Hn(e,t){return(0,te.p)(e,()=>t.query.treasury?(0,Y.z)([t.query.treasury.proposalCount(),t.query.treasury.approvals()]).pipe((0,P.n)(([e,r])=>function(e,t,r){const s=[],n=t.toNumber();for(let t=0;t<n;t++)r.some(e=>e.eqn(t))||s.push(e.registry.createType("ProposalIndex",t));const i=[...s,...r];return(0,Y.z)([e.query.treasury.proposals.multi(i),e.derive.council?e.derive.council.proposals():(0,H.of)([])]).pipe((0,z.T)(([s,n])=>function(e,{allIds:t,allProposals:r,approvalIds:s,councilProposals:n,proposalCount:i}){const a=[],o=[],c=n.filter(({proposal:t})=>t&&(e.tx.treasury.approveProposal&&e.tx.treasury.approveProposal.is(t)||e.tx.treasury.rejectProposal&&e.tx.treasury.rejectProposal.is(t)));return t.forEach((e,t)=>{if(r[t].isSome){const n=c.filter(({proposal:t})=>t&&e.eq(t.args[0])).sort((e,t)=>e.proposal&&t.proposal?e.proposal.method.localeCompare(t.proposal.method):e.proposal?-1:1),i=s.some(t=>t.eq(e)),u={council:n,id:e,proposal:r[t].unwrap()};i?a.push(u):o.push(u)}}),{approvals:a,proposalCount:i,proposals:o}}(e,{allIds:i,allProposals:s,approvalIds:r,councilProposals:n,proposalCount:t})))}(t,e,r))):(0,H.of)({approvals:[],proposalCount:t.registry.createType("ProposalIndex"),proposals:[]}))}function zn(e,t){return(0,te.p)(e,e=>(0,Y.z)([t.rpc.chain.getBlock(e),t.queryAt(e).pipe((0,P.n)(e=>e.system.events()))]).pipe((0,z.T)(([e,t])=>({block:e,events:t}))))}function Rn(e,t){return(0,te.p)(e,(e,r)=>t.derive.tx.events(e).pipe((0,z.T)(({block:e,events:t})=>{const s=e.block.extrinsics.findIndex(e=>e.hash.toString()===r);if(-1===s)return null;const n=t.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eq(s));return{blockHash:e.hash.toHex(),blockNumber:e.block.header.number.toNumber(),events:n,extrinsic:e.block.extrinsics[s],success:-1!==n.findIndex(e=>"ExtrinsicSuccess"===e.event.method)}})))}function Bn(e,t){return(0,te.p)(e,(e,r)=>t.derive.tx.events(e).pipe((0,z.T)(({block:e,events:t})=>{const s=[];return{blockHash:e.hash.toHex(),blockNumber:e.block.header.number.toNumber(),extrinsics:e.block.extrinsics.filter((e,t)=>e.signer.toString()===r&&(s.push(t),!0)).map((e,r)=>{const n=t.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eq(s[r]));return{events:n,extrinsic:e,success:-1!==n.findIndex(e=>"ExtrinsicSuccess"===e.event.method)}})}})))}var On=r(44734),Vn=r(66750);const Nn=new Qe(6e3),Dn=new Qe(5),$n=new Qe(3e5);function Fn(e,t){return e.derive.balances.account(t).pipe((0,z.T)(({accountNonce:e})=>e))}function Un(e,t){return e.call.accountNonceApi?e.call.accountNonceApi.accountNonce(t):e.rpc.system?.accountNextIndex?e.rpc.system.accountNextIndex(t):Fn(e,t)}function jn(e){return(0,Y.z)([e.rpc.chain.getHeader().pipe((0,P.n)(t=>t.parentHash.isEmpty?(0,H.of)(t):e.rpc.chain.getHeader(t.parentHash).pipe((0,Ce.W)(()=>(0,H.of)(t))))),e.rpc.chain.getFinalizedHead().pipe((0,P.n)(t=>e.rpc.chain.getHeader(t).pipe((0,Ce.W)(()=>(0,H.of)(null)))))]).pipe((0,z.T)(([e,t])=>!t||(0,Vn.a)(e).sub((0,Vn.a)(t)).gt(Dn)?e:t))}function Ln(e){const t=e.consts.babe?.expectedBlockTime||e.consts.aura?.slotDuration||e.consts.timestamp?.minimumPeriod.muln(2);return t&&t.isZero&&!t.isZero()?t:void 0}function Kn(e,t){return(e,r,s)=>(0,Y.z)([(0,$.b)(r)?Fn(t,e):-1===r?Un(t,e):(0,H.of)(t.registry.createType("Index",r)),(0,$.b)(s)||(0,On.E)(s)&&s>0?jn(t):(0,H.of)(null)]).pipe((0,z.T)(([e,r])=>({header:r,mortalLength:Math.min(t.consts.system?.blockHashCount?.toNumber()||250,$n.div(Ln(t)||Nn).iadd(Dn).toNumber()),nonce:e})))}const Wn={accounts:s,alliance:n,bagsList:i,balances:a,bounties:o,chain:c,contracts:u,council:d,crowdloan:p,democracy:l,elections:h,imOnline:f,membership:g,teyrchains:w,session:m,society:y,staking:b,technicalCommittee:v,treasury:x,tx:k},Yn={allianceMotion:{instances:["allianceMotion"],methods:[]},bagsList:{instances:["voterBagsList","voterList","bagsList"],methods:[],withDetect:!0},contracts:{instances:["contracts"],methods:[]},council:{instances:["council"],methods:[],withDetect:!0},crowdloan:{instances:["crowdloan"],methods:[]},democracy:{instances:["democracy"],methods:[]},elections:{instances:["phragmenElection","electionsPhragmen","elections","council"],methods:[],withDetect:!0},imOnline:{instances:["imOnline"],methods:[]},membership:{instances:["membership"],methods:[]},teyrchains:{instances:["teyrchains","registrar"],methods:[]},session:{instances:["session"],methods:[]},society:{instances:["society"],methods:[]},staking:{instances:["staking"],methods:["erasRewardPoints"]},technicalCommittee:{instances:["technicalCommittee"],methods:[],withDetect:!0},treasury:{instances:["treasury"],methods:[]}};function Zn(e,t,r){const s={},n=Object.keys(r),i=Object.keys(t.query),a=t.runtimeVersion.specName,o=e=>i.includes(e),c=e=>function(e,t,r){return e.registry.getModuleInstances(t,r)||[]}(t,a,e).some(o),u=e=>Object.keys(r[e]),d=(s,n)=>r[s][n](e,t),p=e=>{return!Yn[e]||Yn[e].instances.some(o)&&(!Yn[e].methods.length||Yn[e].methods.every((r=Yn[e].instances,e=>r.some(r=>i.includes(r)&&t.query[r][e]))))||Yn[e].withDetect&&Yn[e].instances.some(c);var r};for(let e=0,t=n.length;e<t;e++){const t=n[e];p(t)&&Q(s,t,u,d)}return s}var Xn=r(74994),Gn=r(70248),Qn=r(47977),Jn=r(63632),ei=r(52512),ti=r(67954),ri=r(51661),si=r(64401),ni=r(5934),ii=r(33307),ai=r(16880);function oi(e){return(0,se.T)(e.sign)}var ci=r(71647);const ui=(0,N.v)("api/util");function di(e,{block:{extrinsics:t,header:r}},s,n){for(const[n,i]of t.entries())if(i.hash.eq(e))return{blockNumber:(0,ci.i)(r.number)?r.number.unwrap():r.number,events:s.filter(({phase:e})=>e.isApplyExtrinsic&&e.asApplyExtrinsic.eqn(n)),txIndex:n};if(n.isInBlock){const s=t.map(e=>e.hash.toHex());ui.warn(`block ${r.hash.toHex()}: Unable to find extrinsic ${e.toHex()} inside ${s.join(", ")}`)}return{}}var pi=r(20659);function li(e,t,r,{header:s,mortalLength:n,nonce:i}){if(!s){if(r.era&&!r.blockHash)throw new Error("Expected blockHash to be passed alongside non-immortal era options");return(0,On.E)(r.era)&&(delete r.era,delete r.blockHash),fi(e,r,{nonce:i})}return fi(e,r,{blockHash:s.hash,era:t.createTypeUnsafe("ExtrinsicEra",[{current:s.number,period:r.era||n}]),nonce:i})}function hi(e,t){let r={};return(0,se.T)(e)?t=e:r=(0,T.b)({},e),[r,t]}function fi(e,t,r){return(0,T.b)({blockHash:e.genesisHash,genesisHash:e.genesisHash},t,r,{runtimeVersion:e.runtimeVersion,signedExtensions:e.registry.signedExtensions,version:e.extrinsicType})}function gi(e,t,r,s,n){const i=function({api:e,apiType:t,blockHash:r,decorateMethod:s}){const n=e.registry.createClass("Extrinsic"),i=new WeakMap;class a extends n{#l;#h=_.D;constructor(r,s){super(r,s,{version:e.extrinsicType}),this.#l="rxjs"===t}get hasDryRun(){return(0,se.T)(e.rpc.system?.dryRun)}get hasPaymentInfo(){return(0,se.T)(e.call.transactionPaymentApi?.queryInfo)}dryRun(t,n){if(!this.hasDryRun)throw new Error("The system.dryRun RPC call is not available in your environment");return r||(0,S.K)(n)||(0,J.b)(n)?s(()=>e.rpc.system.dryRun(this.toHex(),r||n)):s(()=>this.#f(t,n).pipe((0,P.n)(()=>e.rpc.system.dryRun(this.toHex()))))()}paymentInfo(t,n){if(!this.hasPaymentInfo)throw new Error("The transactionPaymentApi.queryInfo runtime call is not available in your environment");if(r||(0,S.K)(n)||(0,J.b)(n))return s(()=>e.callAt(r||n).pipe((0,P.n)(e=>{const t=this.toU8a();return e.transactionPaymentApi.queryInfo(t,t.length)})));const[i]=hi(n),a=oi(t)?t.address:t.toString();return s(()=>e.derive.tx.signingInfo(a,i.nonce,i.era).pipe((0,ni.$)(),(0,P.n)(t=>{const r=li(e,this.registry,i,t),s=fi(e,r,{}),n=e.tx(this.toU8a()).signFake(a,s).toU8a();return e.call.transactionPaymentApi.queryInfo(n,n.length)})))()}send(t){const r=e.hasSubscriptions&&(this.#l||!!t),n=i.get(this);return i.delete(this),s(r?()=>this.#g(n):()=>this.#m(n))(t)}signAsync(t,r){return s(()=>this.#f(t,r).pipe((0,z.T)(t=>{if(t.signedTransaction){const r=new a(e.registry,t.signedTransaction);return i.set(this,t),r}return this})))()}signAndSend(t,r,n){const[i,a]=hi(r,n),o=e.hasSubscriptions&&(this.#l||!!a);return s(()=>this.#f(t,i).pipe((0,P.n)(e=>o?this.#g(e):this.#m(e))))(a)}withResultTransform(e){return this.#h=e,this}#f=(t,r)=>{const s=oi(t)?t.address:t.toString(),n=function(e={}){return(0,ai.f)(e)||(0,On.E)(e)?{nonce:e}:e}(r);return e.derive.tx.signingInfo(s,n.nonce,n.era).pipe((0,ni.$)(),(0,ii.Z)(async r=>{const i=li(e,this.registry,n,r);let a=-1,o=null;if(oi(t))this.sign(t,i);else{const e=await this.#y(s,i,r.header);a=e.id,e.signedTransaction&&(o=e.signedTransaction)}return{options:i,signedTransaction:o,updateId:a}}))};#b=(t,r)=>{if(!r.isFinalized&&!r.isInBlock)return(0,H.of)(this.#h(new pi.w({status:r,txHash:t})));const s=r.isInBlock?r.asInBlock:r.asFinalized;return e.derive.tx.events(s).pipe((0,z.T)(({block:e,events:s})=>this.#h(new pi.w({...di(t,e,s,r),status:r,txHash:t}))),(0,Ce.W)(e=>(0,H.of)(this.#h(new pi.w({internalError:e,status:r,txHash:t})))))};#m=t=>e.rpc.author.submitExtrinsic(t?.signedTransaction||this).pipe((0,Z.M)(e=>{this.#v(e,t)}));#g=t=>{const r=this.hash;return e.rpc.author.submitAndWatchExtrinsic(t?.signedTransaction||this).pipe((0,P.n)(e=>this.#b(r,e)),(0,Z.M)(e=>{this.#v(e,t)}))};#y=async(t,r,s)=>{const n=r.signer||e.signer,i=r.allowCallDataAlteration??!0;if(!n)throw new Error("No signer specified, either via api.setSigner or via sign options. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.");const a=this.registry.createTypeUnsafe("SignerPayload",[(0,T.b)({},r,{address:t,blockNumber:s?s.number:0,method:this.method})]);let o;if((0,se.T)(n.signPayload)){if(o=await n.signPayload(a.toPayload()),o.signedTransaction&&!r.withSignedTransaction)throw new Error("The `signedTransaction` field may not be submitted when `withSignedTransaction` is disabled");if(o.signedTransaction&&r.withSignedTransaction){const e=this.registry.createTypeUnsafe("Extrinsic",[o.signedTransaction]),r=this.registry.createTypeUnsafe("SignerPayload",[(0,T.b)({},{address:t,assetId:e.assetId&&e.assetId.isSome?e.assetId.toHex():null,blockHash:a.blockHash,blockNumber:s?s.number:0,era:e.era.toHex(),genesisHash:a.genesisHash,metadataHash:e.metadataHash?e.metadataHash.toHex():null,method:e.method.toHex(),mode:e.mode?e.mode.toHex():null,nonce:e.nonce.toHex(),runtimeVersion:a.runtimeVersion,signedExtensions:a.signedExtensions,tip:e.tip?e.tip.toHex():null,version:a.version})]);if(!e.isSigned)throw new Error(`When using the signedTransaction field, the transaction must be signed. Recieved isSigned: ${e.isSigned}`);return i||this.#w(a,e),super.addSignature(t,o.signature,r.toPayload()),{id:o.id,signedTransaction:o.signedTransaction}}}else{if(!(0,se.T)(n.signRaw))throw new Error("Invalid signer interface, it should implement either signPayload or signRaw (or both)");o=await n.signRaw(a.toRaw())}return super.addSignature(t,o.signature,a.toPayload()),{id:o.id}};#v=(t,r)=>{if(r&&-1!==r.updateId){const{options:s,updateId:n}=r,i=s.signer||e.signer;i&&(0,se.T)(i.update)&&i.update(n,t)}};#w=(e,t)=>{if(e.toPayload().method!==t.method.toHex())throw new Error("signAndSend: call data does not match the original payload")}}return a}({api:t,apiType:e,blockHash:n,decorateMethod:r});return e=>new i(s||t.registry,e)}var mi=r(36244);const yi=(0,N.v)("api/augment");function bi(e,t,r=[]){return t.length?` ${t.length} ${e}${r.length?" and":""}`:""}function vi(e,t){return t.length?`\n\t${e.padStart(7)}: ${t.sort().join(", ")}`:""}function wi(e,t,[r,s]){(r.length||s.length)&&yi.warn(`api.${e}: Found${bi("added",r,s)}${bi("removed",s)} ${t}:${vi("added",r)}${vi("removed",s)}`)}function xi(e,t){return e.filter(e=>!t.includes(e))}function ki(e,t){const r=Object.keys(e),s=(n=Object.keys(t),i=r,n.filter(e=>i.includes(e)));var n,i;const a=[];for(let r=0,n=s.length;r<n;r++){const n=s[r],i=Object.keys(e[n]),o=Object.keys(t[n]);for(let e=0,t=o.length;e<t;e++){const t=o[e];i.includes(t)||a.push(`${n}.${t}`)}}return a}function _i(e,t,r,s=!1){s&&(0,mi.H)(r),e&&Object.keys(r).length&&(wi(e,"modules",function(e,t){const r=Object.keys(e),s=Object.keys(t);return[xi(r,s),xi(s,r)]}(t,r)),wi(e,"calls",function(e,t){return[ki(t,e),ki(e,t)]}(t,r)));const n=Object.keys(t);for(let e=0,s=n.length;e<s;e++){const s=n[e],i=t[s];r[s]||(r[s]={}),(0,G.T)(r[s],Object.keys(i),e=>i[e])}return r}function Ti(e,t){const r=e=>Object.keys(t[e]),s=(r,s)=>e(t[r][s]),n={},i=Object.keys(t);for(let e=0,t=i.length;e<t;e++)Q(n,i[e],r,s);return n}function Si({lookup:e},{method:t,section:r},s){return`${r}.${t}(${s.map(t=>e.getTypeDef(t).type).join(", ")})`}function qi(e,t,r){const s=r.filter(e=>!(0,$.b)(e));if(t.meta.type.isPlain){if(0!==s.length)throw new Error(`${Si(e,t,[])} does not take any arguments, ${s.length} found`)}else{const{hashers:r,key:n}=t.meta.type.asMap,i=1===r.length?[n]:e.lookup.getSiType(n).def.asTuple.map(e=>e);if(s.length!==i.length)throw new Error(`${Si(e,t,i)} is a map, requiring ${i.length} arguments, ${s.length} found`)}return[t,s]}var Ei=r(27429);class Ci{#x=new Ei.b;emit(e,...t){return this.#x.emit(e,...t)}on(e,t){return this.#x.on(e,t),this}off(e,t){return this.#x.removeListener(e,t),this}once(e,t){return this.#x.once(e,t),this}}const Ai=1e3,Mi=(0,N.v)("api/init");let Ii=0;function Pi(e,{method:t,section:r}){return(0,D.Z8)(e.rx.query[r]&&e.rx.query[r][t],()=>`query.${r}.${t} is not available in this version of the metadata`)}class Hi extends Ci{#k;#_={};#T;#S=[];#q=[];__phantom=new Qe(0);_type;_call={};_consts={};_derive;_errors={};_events={};_extrinsics;_extrinsicType=Qn.b.LATEST_EXTRINSIC_VERSION;_genesisHash;_isConnected;_isReady=!1;_query={};_queryMulti;_rpc;_rpcCore;_runtimeMap={};_runtimeChain;_runtimeMetadata;_runtimeVersion;_rx={call:{},consts:{},query:{},tx:{}};_options;_decorateMethod;constructor(e,t,r){super(),this.#k=""+ ++Ii,this.#T=e.source?.registry||e.registry||new R.O,this._rx.callAt=(e,t)=>(0,K.H)(this.at(e,t)).pipe((0,z.T)(e=>e.rx.call)),this._rx.queryAt=(e,t)=>(0,K.H)(this.at(e,t)).pipe((0,z.T)(e=>e.rx.query)),this._rx.registry=this.#T,this._decorateMethod=r,this._options=e,this._type=t;const s=e.source?e.source._rpcCore.provider.isClonable?e.source._rpcCore.provider.clone():e.source._rpcCore.provider:e.provider||new Gn.E;this._rpcCore=new Xn.ph(this.#k,this.#T,{isPedantic:this._options.isPedantic,provider:s,rpcCacheCapacity:this._options.rpcCacheCapacity,ttl:this._options.provider?.ttl,userRpc:this._options.rpc}),this._isConnected=new W.t(this._rpcCore.provider.isConnected),this._rx.hasSubscriptions=this._rpcCore.provider.hasSubscriptions}get registry(){return this.#T}createType(e,...t){return this.#T.createType(e,...t)}registerTypes(e){e&&this.#T.register(e)}get hasSubscriptions(){return this._rpcCore.provider.hasSubscriptions}get supportMulti(){return this._rpcCore.provider.hasSubscriptions||!!this._rpcCore.state.queryStorageAt}_emptyDecorated(e,t){return{call:{},consts:{},errors:{},events:{},query:{},registry:e,rx:{call:{},query:{}},tx:gi(this._type,this._rx,this._decorateMethod,e,t)}}_createDecorated(e,t,r,s){r||(r=this._emptyDecorated(e.registry,s)),!t&&e.decoratedMeta||(e.decoratedMeta=(0,Jn.K8)(e.registry,e.metadata));const n=this._decorateCalls(e,this._decorateMethod,s),i=this._decorateCalls(e,this._rxDecorateMethod,s),a=this._decorateStorage(e.decoratedMeta,this._decorateMethod,s),o=this._decorateStorage(e.decoratedMeta,this._rxDecorateMethod,s);return _i("consts",e.decoratedMeta.consts,r.consts,t),_i("errors",e.decoratedMeta.errors,r.errors,t),_i("events",e.decoratedMeta.events,r.events,t),_i("query",a,r.query,t),_i("query",o,r.rx.query,t),_i("call",n,r.call,t),_i("call",i,r.rx.call,t),r.findCall=t=>A(e.registry,t),r.findError=t=>M(e.registry,t),r.queryMulti=s?this._decorateMultiAt(r,this._decorateMethod,s):this._decorateMulti(this._decorateMethod),r.runtimeVersion=e.runtimeVersion,{createdAt:s,decoratedApi:r,decoratedMeta:e.decoratedMeta}}_injectMetadata(e,t=!1){!t&&e.decoratedApi||(e.decoratedApi=this._emptyDecorated(e.registry));const{decoratedApi:r,decoratedMeta:s}=this._createDecorated(e,t,e.decoratedApi);this._call=r.call,this._consts=r.consts,this._errors=r.errors,this._events=r.events,this._query=r.query,this._rx.call=r.rx.call,this._rx.query=r.rx.query;const n=this._decorateExtrinsics(s,this._decorateMethod),i=this._decorateExtrinsics(s,this._rxDecorateMethod);t||!this._extrinsics?(this._extrinsics=n,this._rx.tx=i):(_i("tx",n,this._extrinsics,!1),_i(null,i,this._rx.tx,!1)),_i(null,s.consts,this._rx.consts,t),this.emit("decorated")}injectMetadata(e,t,r){this._injectMetadata({counter:0,metadata:e,registry:r||this.#T,runtimeVersion:this.#T.createType("RuntimeVersionPartial")},t)}_decorateFunctionMeta(e,t){return t.meta=e.meta,t.method=e.method,t.section=e.section,t.toJSON=e.toJSON,e.callIndex&&(t.callIndex=e.callIndex),t}_filterRpc(e,t){0!==Object.keys(t).length&&(this._rpcCore.addUserInterfaces(t),this._decorateRpc(this._rpcCore,this._decorateMethod,this._rpc),this._decorateRpc(this._rpcCore,this._rxDecorateMethod,this._rx.rpc));const r={};for(let t=0,s=e.length;t<s;t++){const[s]=e[t].split("_");r[s]=!0}const s=Object.keys(r);for(let e=0,t=s.length;e<t;e++){const t=(0,ti.g)(s[e]),r=`${t}Api`;this._runtimeMap[(0,j.X)(t,64)]=t,this._runtimeMap[(0,j.X)(r,64)]=r}this._filterRpcMethods(e)}_filterRpcMethods(e){const t=0!==e.length,r=[...this._rpcCore.mapping.entries()],s=[],n=r.length;for(let e=0;e<n;e++){const[,{alias:t,endpoint:n,method:i,pubsub:a,section:o}]=r[e];s.push(`${o}_${i}`),a&&(s.push(`${o}_${a[1]}`),s.push(`${o}_${a[2]}`)),t&&s.push(...t),n&&s.push(n)}const i=e.filter(e=>!s.includes(e)&&!e.includes("_unstable_"));i.length&&!this._options.noInitWarn&&Mi.warn(`RPC methods not decorated: ${i.join(", ")}`);for(let s=0;s<n;s++){const[n,{method:i,section:a}]=r[s];t&&!e.includes(n)&&"rpc_methods"!==n&&this._rpc[a]&&(delete this._rpc[a][i],delete this._rx.rpc[a][i])}}_rpcSubmitter(e){return e((e,...t)=>(0,K.H)(this._rpcCore.provider.send(e,t)))}_decorateRpc(e,t,r=this._rpcSubmitter(t)){const s=r,n=(r,s)=>{const n=e[r][s],i=t(n,{methodName:s});return i.meta=n.meta,i.raw=t(n.raw,{methodName:s}),i};for(let t=0,r=e.sections.length;t<r;t++){const r=e.sections[t];if(!Object.prototype.hasOwnProperty.call(s,r)){const t=Object.keys(e[r]),i=e=>n(r,e);for(let e=0,n=t.length;e<n;e++){const n=t[e];(this.hasSubscriptions||!n.startsWith("subscribe")&&!n.startsWith("unsubscribe"))&&(Object.prototype.hasOwnProperty.call(s,r)||(s[r]={}),(0,G.s)(s[r],n,i))}}}return s}_addRuntimeDef(e,t){if(!t)return;const r=Object.entries(t);for(let t=0,s=r.length;t<s;t++){const[s,n]=r[t];if(e[s])for(let t=0,r=n.length;t<r;t++){const r=n[t],i=e[s].find(({version:e})=>r.version===e);i?(0,T.b)(i.methods,r.methods):e[s].push(r)}else e[s]=n}}_getRuntimeDefs(e,t,r=""){const s={},n=Object.values(ei);for(let e=0,t=n.length;e<t;e++)this._addRuntimeDef(s,n[e].runtime);return this._addRuntimeDef(s,(0,V.sN)(e,r,t)),this._addRuntimeDef(s,this._options.runtime),Object.entries(s)}_getMethods(e,t){const r={};return t.forEach(t=>{const{docs:s,inputs:n,name:i,output:a}=t;r[i.toString()]={description:s.map(e=>e.toString()).join(),params:n.map(({name:t,type:r})=>({name:t.toString(),type:e.lookup.getName(r)||e.lookup.getTypeDef(r).type})),type:e.lookup.getName(a)||e.lookup.getTypeDef(a).type}}),r}_getRuntimeDefsViaMetadata(e){const t={},{apis:r}=e.metadata;for(let s=0,n=r.length;s<n;s++){const{methods:n,name:i}=r[s];t[i.toString()]=[{methods:this._getMethods(e,n),version:0}]}return Object.entries(t)}_decorateCalls({registry:e,runtimeVersion:{apis:t,specName:r,specVersion:s}},n,i){const a={},o={},c={},u=e.metadata.apis.length>0,d=u?this._getRuntimeDefsViaMetadata(e):this._getRuntimeDefs(e,r,this._runtimeChain),p=[],l=`${r.toString()}/${s.toString()}`,h=this.#_[l]||!1;if(this.#_[l]=!0,u)for(let e=0,t=d.length;e<t;e++){const[t,r]=d[e],s=r[0],n=(0,j.X)(t,64),i=(0,ri.WH)(t),a=Object.entries(s.methods);o[i]||(o[i]={});for(let e=0,r=a.length;e<r;e++){const[r,s]=a[e],c=(0,ri.WH)(r);o[i][c]=(0,T.b)({method:c,name:`${t}_${r}`,section:i,sectionHash:n},s)}}else{for(let e=0,r=d.length;e<r;e++){const[r,s]=d[e],n=(0,j.X)(r,64),i=t.find(([e])=>e.eq(n));if(c[n]=!0,i){const e=s.map(({version:e})=>e).sort(),t=s.find(({version:e})=>i[1].eq(e));if(t){const e=(0,ri.WH)(r),s=Object.entries(t.methods);if(s.length){o[e]||(o[e]={});for(let t=0,i=s.length;t<i;t++){const[i,a]=s[t],c=(0,ri.WH)(i);o[e][c]=(0,T.b)({method:c,name:`${r}_${i}`,section:e,sectionHash:n},a)}}}else p.push(`${r}/${i[1].toString()} (${e.join("/")} known)`)}}const e=t.map(([e,t])=>[e.toHex(),t.toString()]).filter(([e])=>!c[e]).map(([e,t])=>`${this._runtimeMap[e]||e}/${t}`);this._options.noInitWarn||h||(p.length&&Mi.warn(`${l}: Not decorating runtime apis without matching versions: ${p.join(", ")}`),e.length&&Mi.warn(`${l}: Not decorating unknown runtime apis: ${e.join(", ")}`))}const f=i?(e,t)=>this._rpcCore.state.call(e,t,i):(e,t)=>this._rpcCore.state.call(e,t),g=t=>(0,G.T)({},Object.keys(o[t]),r=>this._decorateCall(e,o[t][r],f,n)),m=Object.keys(o);for(let e=0,t=m.length;e<t;e++)(0,G.s)(a,m[e],g);return a}_decorateCall(e,t,r,s){const n=s((...s)=>{if(s.length!==t.params.length)throw new Error(`${t.name}:: Expected ${t.params.length} arguments, found ${s.length}`);const n=e.createType("Raw",(0,Lt.Q)(s.map((r,s)=>e.createTypeUnsafe(t.params[s].type,[r]).toU8a())));return r(t.name,n).pipe((0,z.T)(r=>e.createTypeUnsafe(t.type,[r])))});return n.meta=t,n}_decorateMulti(e){return e(e=>e.length?(this.hasSubscriptions?this._rpcCore.state.subscribeStorage:this._rpcCore.state.queryStorageAt)(e.map(e=>Array.isArray(e)?e[0].creator.meta.type.isPlain?[e[0].creator]:1===e[0].creator.meta.type.asMap.hashers.length?[e[0].creator,e.slice(1)]:[e[0].creator,...e.slice(1)]:[e.creator])):(0,H.of)([]))}_decorateMultiAt(e,t,r){return t(t=>t.length?this._rpcCore.state.queryStorageAt(t.map(t=>{if(Array.isArray(t)){const{creator:r}=Pi(e,t[0].creator);return r.meta.type.isPlain?[r]:1===r.meta.type.asMap.hashers.length?[r,t.slice(1)]:[r,...t.slice(1)]}return[Pi(e,t.creator).creator]}),r):(0,H.of)([]))}_decorateExtrinsics({tx:e},t){const r=gi(this._type,this._rx,t),s=t=>(0,G.T)({},Object.keys(e[t]),s=>s.startsWith("$")?e[t][s]:this._decorateExtrinsicEntry(e[t][s],r)),n=Object.keys(e);for(let e=0,t=n.length;e<t;e++)(0,G.s)(r,n[e],s);return r}_decorateExtrinsicEntry(e,t){const r=(...r)=>t(e(...r));return r.is=t=>e.is(t),this._decorateFunctionMeta(e,r)}_decorateStorage({query:e,registry:t},r,s){const n={},i=n=>(0,G.T)({},Object.keys(e[n]),i=>s?this._decorateStorageEntryAt(t,e[n][i],r,s):this._decorateStorageEntry(e[n][i],r)),a=Object.keys(e);for(let e=0,t=a.length;e<t;e++)(0,G.s)(n,a[e],i);return n}_decorateStorageEntry(e,t){const r=(t,r)=>qi(r||this.#T,e,t),s=t=>(0,K.H)(this.at(t)).pipe((0,z.T)(t=>Pi(t,e))),n=this._decorateStorageCall(e,t);return n.creator=e,n.at=t((e,...t)=>s(e).pipe((0,P.n)(e=>e(...t)))),n.hash=t((...e)=>this._rpcCore.state.getStorageHash(r(e))),n.is=t=>t.section===e.section&&t.method===e.method,n.key=(...t)=>(0,q.X)((0,si.a)(e(...t))[1]),n.keyPrefix=(...t)=>(0,q.X)(e.keyPrefix(...t)),n.size=t((...e)=>this._rpcCore.state.getStorageSize(r(e))),n.sizeAt=t((e,...t)=>s(e).pipe((0,P.n)(s=>this._rpcCore.state.getStorageSize(r(t,s.creator.meta.registry),e)))),e.iterKey&&e.meta.type.isMap&&(n.entries=t((0,te.p)(this.#k,(...t)=>this._retrieveMapEntries(e,null,t))),n.entriesAt=t((0,te.p)(this.#k,(e,...t)=>s(e).pipe((0,P.n)(r=>this._retrieveMapEntries(r.creator,e,t))))),n.entriesPaged=t((0,te.p)(this.#k,t=>this._retrieveMapEntriesPaged(e,void 0,t))),n.keys=t((0,te.p)(this.#k,(...t)=>this._retrieveMapKeys(e,null,t))),n.keysAt=t((0,te.p)(this.#k,(e,...t)=>s(e).pipe((0,P.n)(r=>this._retrieveMapKeys(r.creator,e,t))))),n.keysPaged=t((0,te.p)(this.#k,t=>this._retrieveMapKeysPaged(e,void 0,t)))),this.supportMulti&&e.meta.type.isMap&&(n.multi=t(t=>1===e.meta.type.asMap.hashers.length?this._retrieveMulti(t.map(t=>[e,[t]])):this._retrieveMulti(t.map(t=>[e,t])))),this._decorateFunctionMeta(e,n)}_decorateStorageEntryAt(e,t,r,s){const n=r=>qi(e,t,r),i=r((...e)=>this._rpcCore.state.getStorage(n(e),s));return i.creator=t,i.hash=r((...e)=>this._rpcCore.state.getStorageHash(n(e),s)),i.is=e=>e.section===t.section&&e.method===t.method,i.key=(...e)=>(0,q.X)((0,si.a)(t(...e))[1]),i.keyPrefix=(...e)=>(0,q.X)(t.keyPrefix(...e)),i.size=r((...e)=>this._rpcCore.state.getStorageSize(n(e),s)),t.iterKey&&t.meta.type.isMap&&(i.entries=r((0,te.p)(this.#k,(...e)=>this._retrieveMapEntries(t,s,e))),i.entriesPaged=r((0,te.p)(this.#k,e=>this._retrieveMapEntriesPaged(t,s,e))),i.keys=r((0,te.p)(this.#k,(...e)=>this._retrieveMapKeys(t,s,e))),i.keysPaged=r((0,te.p)(this.#k,e=>this._retrieveMapKeysPaged(t,s,e)))),this.supportMulti&&t.meta.type.isMap&&(i.multi=r(e=>1===t.meta.type.asMap.hashers.length?this._retrieveMulti(e.map(e=>[t,[e]]),s):this._retrieveMulti(e.map(e=>[t,e]),s))),this._decorateFunctionMeta(t,i)}_queueStorage(e,t){const r=t===this.#q?this._rpcCore.state.subscribeStorage:this._rpcCore.state.queryStorageAt;let s,n=t.length-1,i=0;return-1!==n&&t[n]&&50!==t[n][1].length?(s=t[n][0],i=t[n][1].length,t[n][1].push(e)):(n++,s=(0,K.H)(new Promise(e=>{(0,Xe.d)(()=>{const r=t[n][1];delete t[n],e(r)})})).pipe((0,P.n)(e=>r(e))),t.push([s,[e]])),s.pipe((0,z.T)(e=>e[i]))}_decorateStorageCall(e,t){return t((0,te.p)(this.#k,(...t)=>{const r=qi(this.#T,e,t);return this.hasSubscriptions?this._queueStorage(r,this.#q):this._rpcCore.state.getStorage(r)}),{methodName:e.method,overrideNoSub:(...t)=>this._queueStorage(qi(this.#T,e,t),this.#S)})}_retrieveMulti(e,t){if(!e.length)return(0,H.of)([]);const r=this.hasSubscriptions&&!t?this._rpcCore.state.subscribeStorage:this._rpcCore.state.queryStorageAt;return e.length<=250?t?r(e,t):r(e):(0,Y.z)((0,hs.R)(e,250).map(e=>t?r(e,t):r(e))).pipe((0,z.T)(Yt.a))}_retrieveMapKeys({iterKey:e,meta:t,method:r,section:s},n,i){if(!e||!t.type.isMap)throw new Error("keys can only be retrieved on maps");const a=e(...i).toHex(),o=new W.t(a),c=n?e=>this._rpcCore.state.getKeysPaged(a,Ai,e,n):e=>this._rpcCore.state.getKeysPaged(a,Ai,e),u=e=>e.setMeta(t,s,r);return o.pipe((0,P.n)(c),(0,z.T)(e=>e.map(u)),(0,Z.M)(e=>(0,Xe.d)(()=>{e.length===Ai?o.next(e[999].toHex()):o.complete()})),(0,X.$)(),(0,z.T)(Yt.a))}_retrieveMapKeysPaged({iterKey:e,meta:t,method:r,section:s},n,i){if(!e||!t.type.isMap)throw new Error("keys can only be retrieved on maps");const a=e=>e.setMeta(t,s,r);return(n?e=>this._rpcCore.state.getKeysPaged(e,i.pageSize,i.startKey||e,n):e=>this._rpcCore.state.getKeysPaged(e,i.pageSize,i.startKey||e))(e(...i.args).toHex()).pipe((0,z.T)(e=>e.map(a)))}_retrieveMapEntries(e,t,r){const s=t?e=>this._rpcCore.state.queryStorageAt(e,t):e=>this._rpcCore.state.queryStorageAt(e);return this._retrieveMapKeys(e,t,r).pipe((0,P.n)(e=>e.length?(0,Y.z)((0,hs.R)(e,250).map(s)).pipe((0,z.T)(t=>(0,Yt.a)(t).map((t,r)=>[e[r],t]))):(0,H.of)([])))}_retrieveMapEntriesPaged(e,t,r){const s=t?e=>this._rpcCore.state.queryStorageAt(e,t):e=>this._rpcCore.state.queryStorageAt(e);return this._retrieveMapKeysPaged(e,t,r).pipe((0,P.n)(e=>e.length?s(e).pipe((0,z.T)(t=>t.map((t,r)=>[e[r],t]))):(0,H.of)([])))}_decorateDeriveRx(e){const t=this._runtimeVersion?.specName.toString();return Ti(e,function(e,t,r={}){return{...Zn(e,t,Wn),...Zn(e,t,r)}}(this.#k,this._rx,(0,T.b)({},this._options.derives,this._options.typesBundle?.spec?.[t||""]?.derives)))}_decorateDerive(e){return Ti(e,this._rx.derive)}_rxDecorateMethod=e=>e}const zi=[16,15,14],Ri=(0,N.v)("api/init");function Bi(e){return e.toString()}class Oi extends Hi{#E=null;#C=null;#A=[];#M=null;#I={};constructor(e,t,r){super(e,t,r),this.registry.setKnownTypes(e),e.source?this.#A=e.source.#A:this.registerTypes(e.types),this._rpc=this._decorateRpc(this._rpcCore,this._decorateMethod),this._rx.rpc=this._decorateRpc(this._rpcCore,this._rxDecorateMethod),this.supportMulti&&(this._queryMulti=this._decorateMulti(this._decorateMethod),this._rx.queryMulti=this._decorateMulti(this._rxDecorateMethod)),this._rx.signer=e.signer,this._rpcCore.setRegistrySwap(e=>this.getBlockRegistry(e)),this._rpcCore.setResolveBlockHash(e=>(0,I._)(this._rpcCore.chain.getBlockHash(e))),this.hasSubscriptions?(this._rpcCore.provider.on("disconnected",()=>this.#P()),this._rpcCore.provider.on("error",e=>this.#H(e)),this._rpcCore.provider.on("connected",()=>this.#z())):this._options.noInitWarn||Ri.warn("Api will be available in a limited mode since the provider does not support subscriptions"),this._rpcCore.provider.isConnected&&this.#z().catch(_.l)}_initRegistry(e,t,r,s,n){e.clearCache(),e.setChainProperties(n||this.registry.getChainProperties()),e.setKnownTypes(this._options),e.register((0,V.hQ)(e,t,r.specName,r.specVersion)),e.setHasher((0,V.Pc)(e,t,r.specName)),e.knownTypes.typesBundle&&(e.knownTypes.typesAlias=(0,V.Os)(e,t,r.specName)),e.setMetadata(s,void 0,(0,T.b)({},(0,V.Kx)(e,t,r.specName),this._options.signedExtensions),this._options.noInitWarn)}_getDefaultRegistry(){return(0,D.Z8)(this.#A.find(({isDefault:e})=>e),"Initialization error, cannot find the default registry")}async at(e,t){const r=(0,E.e)(e),s=(0,q.X)(r),n=await this.getBlockRegistry(r,t);return this.#E&&this.#E[0]===s||(this.#E=[s,this._createDecorated(n,!0,null,r).decoratedApi]),this.#E[1]}async _createBlockRegistry(e,t,r){const s=new R.O(e),n=await this._retrieveMetadata(r.apis,t.parentHash,s),i=this._runtimeChain;if(!i)throw new Error("Invalid initializion order, runtimeChain is not available");this._initRegistry(s,i,r,n);const a={counter:0,lastBlockHash:e,metadata:n,registry:s,runtimeVersion:r};return this.#A.push(a),a}_cacheBlockRegistryProgress(e,t){let r=this.#I[e];return(0,$.b)(r)&&(r=this.#I[e]=new Promise((r,s)=>{t().then(t=>{delete this.#I[e],r(t)}).catch(t=>{delete this.#I[e],s(t)})})),r}_getBlockRegistryViaVersion(e,t){if(t){const r=this.#A.find(({runtimeVersion:{specName:e,specVersion:r}})=>e.eq(t.specName)&&r.eq(t.specVersion));if(r)return r.counter++,r.lastBlockHash=e,r}return null}async _getBlockRegistryViaHash(e){if(!this._genesisHash||!this._runtimeVersion)throw new Error("Cannot retrieve data on an uninitialized chain");const t=this.registry.createType("HeaderPartial",this._genesisHash.eq(e)?{number:F.Yz,parentHash:this._genesisHash}:await(0,I._)(this._rpcCore.chain.getHeader.raw(e)));if(t.parentHash.isEmpty)throw Ri.warn(`Unable to retrieve header ${e.toString()} and parent ${t.parentHash.toString()} from supplied hash`),new Error("Unable to retrieve header and parent from supplied hash");const[r,s]=(0,V.BN)(this._genesisHash,t.number),n=this.registry.createType("RuntimeVersionPartial",await(0,I._)(this._rpcCore.state.getRuntimeVersion.raw(t.parentHash)));return this._getBlockRegistryViaVersion(e,n)||await this._cacheBlockRegistryProgress(n.toHex(),()=>this._createBlockRegistry(e,t,n))}async getBlockRegistry(e,t){return this.#A.find(({lastBlockHash:t})=>t&&(0,U.f)(t,e))||this._getBlockRegistryViaVersion(e,t)||await this._cacheBlockRegistryProgress((0,q.X)(e),()=>this._getBlockRegistryViaHash(e))}async _loadMeta(){return this._isReady?(this._options.source||this._subscribeUpdates(),!0):(this._unsubscribeUpdates(),[this._genesisHash,this._runtimeMetadata]=this._options.source?._isReady?await this._metaFromSource(this._options.source):await this._metaFromChain(this._options.metadata),this._initFromMeta(this._runtimeMetadata))}async _metaFromSource(e){this._extrinsicType=e.extrinsicVersion,this._runtimeChain=e.runtimeChain,this._runtimeVersion=e.runtimeVersion;const t=Object.keys(e.rpc),r=[];for(let s=0,n=t.length;s<n;s++){const n=t[s],i=Object.keys(e.rpc[n]);for(let e=0,t=i.length;e<t;e++)r.push(`${n}_${i[e]}`)}return this._filterRpc(r,(0,V.V3)(this.registry,e.runtimeChain,e.runtimeVersion.specName)),[e.genesisHash,e.runtimeMetadata]}_subscribeUpdates(){!this.#M&&this.hasSubscriptions&&(this.#M=this._rpcCore.state.subscribeRuntimeVersion().pipe((0,P.n)(e=>this._runtimeVersion?.specVersion.eq(e.specVersion)?(0,H.of)(!1):this._rpcCore.state.getMetadata().pipe((0,z.T)(t=>{Ri.log(`Runtime version updated to spec=${e.specVersion.toString()}, tx=${e.transactionVersion.toString()}`),this._runtimeMetadata=t,this._runtimeVersion=e,this._rx.runtimeVersion=e;const r=this._getDefaultRegistry(),s=this._runtimeChain;if(!s)throw new Error("Invalid initializion order, runtimeChain is not available");return r.metadata=t,r.runtimeVersion=e,this._initRegistry(this.registry,s,e,t),this._injectMetadata(r,!0),!0})))).subscribe())}async _metaFromChain(e){const[t,r,s,n,i]=await Promise.all([(0,I._)(this._rpcCore.chain.getBlockHash(0)),(0,I._)(this._rpcCore.state.getRuntimeVersion()),(0,I._)(this._rpcCore.system.chain()),(0,I._)(this._rpcCore.system.properties()),(0,I._)(this._rpcCore.rpc.methods())]);this._runtimeChain=s,this._runtimeVersion=r,this._rx.runtimeVersion=r;const a=`${t.toHex()||"0x"}-${r.specVersion.toString()}`,o=e?.[a]?new B.O(this.registry,e[a]):await this._retrieveMetadata(r.apis);return this._initRegistry(this.registry,s,r,o,n),this._filterRpc(i.methods.map(Bi),(0,V.V3)(this.registry,s,r.specName)),this._subscribeUpdates(),this.#A.length||this.#A.push({counter:0,isDefault:!0,metadata:o,registry:this.registry,runtimeVersion:r}),o.getUniqTypes(this._options.throwOnUnknown||!1),[t,o]}_initFromMeta(e){const t=this._runtimeVersion;if(!t)throw new Error("Invalid initializion order, runtimeVersion is not available");return this._extrinsicType=e.asLatest.extrinsic.versions.at(0)||O.hL,this._rx.extrinsicType=this._extrinsicType,this._rx.genesisHash=this._genesisHash,this._rx.runtimeVersion=t,this._injectMetadata(this._getDefaultRegistry(),!0),this._rx.derive=this._decorateDeriveRx(this._rxDecorateMethod),this._derive=this._decorateDerive(this._decorateMethod),!0}async _retrieveMetadata(e,t,r){let s=null;const n=e.find(([e])=>e.eq((0,j.X)("Metadata",64))),i=r||this.registry;if(!n||n[1].toNumber()<2)return Ri.warn("MetadataApi not available, rpc::state::get_metadata will be used."),t?new B.O(i,await(0,I._)(this._rpcCore.state.getMetadata.raw(t))):await(0,I._)(this._rpcCore.state.getMetadata());try{const e=t?await(0,I._)(this._rpcCore.state.call.raw("Metadata_metadata_versions","0x",t)):await(0,I._)(this._rpcCore.state.call("Metadata_metadata_versions","0x"));s=i.createType("Vec<u32>",e).filter(e=>zi.includes(e.toNumber())).reduce((e,t)=>t.gt(e)?t:e)}catch(e){Ri.debug(e.message),Ri.warn("error with state_call::Metadata_metadata_versions, rpc::state::get_metadata will be used")}if(s&&!zi.includes(s.toNumber())&&(s=null),s)try{const e=t?await(0,I._)(this._rpcCore.state.call.raw("Metadata_metadata_at_version",(0,q.X)(s.toU8a()),t)):await(0,I._)(this._rpcCore.state.call("Metadata_metadata_at_version",(0,q.X)(s.toU8a()))),r=t?i.createType("Raw",e).toU8a():e,n=i.createType("Option<OpaqueMetadata>",r).unwrapOr(null);if(n)return new B.O(i,n.toHex())}catch(e){Ri.debug(e.message),Ri.warn("error with state_call::Metadata_metadata_at_version, rpc::state::get_metadata will be used")}return t?new B.O(i,await(0,I._)(this._rpcCore.state.getMetadata.raw(t))):await(0,I._)(this._rpcCore.state.getMetadata())}_subscribeHealth(){this._unsubscribeHealth(),this.#C=this.hasSubscriptions?setInterval(()=>{(0,I._)(this._rpcCore.system.health.raw()).catch(_.l)},1e4):null}_unsubscribeHealth(){this.#C&&(clearInterval(this.#C),this.#C=null)}_unsubscribeUpdates(){this.#M&&(this.#M.unsubscribe(),this.#M=null)}_unsubscribe(){this._unsubscribeHealth(),this._unsubscribeUpdates()}async#z(){this._isConnected.next(!0),this.emit("connected");try{const e=!1===this._options.initWasm||await(0,L.C)(),t=await this._loadMeta();this._subscribeHealth(),t&&!this._isReady&&e&&(this._isReady=!0,this.emit("ready",this))}catch(e){const t=new Error(`FATAL: Unable to initialize the API: ${e.message}`);Ri.error(t),this.emit("error",t)}}#P(){this._isConnected.next(!1),this._unsubscribe(),this.emit("disconnected")}#H(e){this.emit("error",e)}}function Vi(e){if(void 0===e)throw new Error("Api interfaces needs to be initialized before using, wait for 'isReady'");return e}class Ni extends Oi{get call(){return Vi(this._call)}get consts(){return Vi(this._consts)}get derive(){return Vi(this._derive)}get errors(){return Vi(this._errors)}get events(){return Vi(this._events)}get extrinsicVersion(){return this._extrinsicType}get genesisHash(){return Vi(this._genesisHash)}get isConnected(){return this._isConnected.getValue()}get libraryInfo(){return`@pezkuwi/api v${C}`}get query(){return Vi(this._query)}get queryMulti(){return Vi(this._queryMulti)}get rpc(){return Vi(this._rpc)}get runtimeChain(){return Vi(this._runtimeChain)}get runtimeMetadata(){return Vi(this._runtimeMetadata)}get runtimeVersion(){return Vi(this._runtimeVersion)}get rx(){return Vi(this._rx)}get stats(){return this._rpcCore.stats}get type(){return this._type}get tx(){return Vi(this._extrinsics)}findCall(e){return A(this.registry,e)}findError(e){return M(this.registry,e)}}class Di extends Ni{constructor(e={},t,r){super(e,t,r)}connect(){return this._rpcCore.connect()}disconnect(){return this._unsubscribe(),this._rpcCore.disconnect()}setSigner(e){this._rx.signer=e}async sign(e,t,{signer:r}={}){if((0,S.K)(e)){const s=r||this._rx.signer;if(!s?.signRaw)throw new Error("No signer exists with a signRaw interface. You possibly need to pass through an explicit keypair for the origin so it can be used for signing.");return(await s.signRaw((0,T.b)({type:"bytes"},t,{address:e}))).signature}return(0,q.X)(e.sign((0,E.e)(t.data)))}}class $i{#R=!1;#B;#O=[];#V=[];#N=!0;#D=[];#$=[];constructor(e,t){this.#B=t,this.#$=e.map(async(e,t)=>{const[r,...s]=Array.isArray(e)?e:[e];return this.#O.push(!1),this.#V.push(r),r(...s,this._createCallback(t))})}_allHasFired(){return this.#R||=0===this.#O.filter(e=>!e).length,this.#R}_createCallback(e){return t=>{this.#O[e]=!0,this.#D[e]=t,this._triggerUpdate()}}_triggerUpdate(){if(this.#N&&(0,se.T)(this.#B)&&this._allHasFired())try{Promise.resolve(this.#B(this.#D)).catch(_.l)}catch{}}unsubscribe(){this.#N&&(this.#N=!1,Promise.all(this.#$.map(async e=>{try{const t=await e;(0,se.T)(t)&&t()}catch{}})).catch(()=>{}))}}var Fi=r(90323);class Ui extends Di{#F;#U;constructor(e){super(e,"promise",Fi.p),this.#F=new Promise(e=>{super.once("ready",()=>e(this))}),this.#U=new Promise((e,t)=>{const r=(0,Fi.I)(e,t);super.once("ready",()=>r.resolve(this)),super.once("error",e=>r.reject(e))})}static create(e){const t=new Ui(e);return e&&e.throwOnConnect?t.isReadyOrError:(t.isReadyOrError.catch(_.l),t.isReady)}get isReady(){return this.#F}get isReadyOrError(){return this.#U}clone(){return new Ui((0,T.b)({},this._options,{source:this}))}async combineLatest(e,t){const r=new $i(e,t);return()=>{r.unsubscribe()}}}},41042(e,t,r){r.d(t,{el:()=>o,OZ:()=>l,jP:()=>p,tV:()=>h});var s=r(93302),n=r(92110),i=r(76506);const a=window;a.injectedWeb3=a.injectedWeb3||{};let o=u(),c=null;function u(){return 0!==Object.values(a.injectedWeb3).filter(({connect:e,enable:t})=>!(!e&&!t)).length}function d(e){throw new Error(`${e}: web3Enable(originName) needs to be called before ${e}`)}function p(e,t=[]){if(!e)throw new Error("You must pass a name for your app to the web3Enable function");const r=t.length?Promise.all(t.map(e=>e().catch(()=>!1))):Promise.resolve([!0]);var n;return n=()=>r.then(()=>function(e){return Promise.all(Object.entries(a.injectedWeb3).map(([t,{connect:r,enable:n,version:i}])=>Promise.resolve().then(()=>r?r(e):n?n(e).then(e=>(0,s.b)({name:t,version:i||"unknown"},e)):Promise.reject(new Error("No connect(..) or enable(...) hook found"))).catch(({message:e})=>{console.error(`Error initializing ${t}: ${e}`)}))).then(e=>e.filter(e=>!!e))}(e).then(e=>e.map(e=>(e.accounts.subscribe||(e.accounts.subscribe=t=>(e.accounts.get().then(t).catch(console.error),()=>{})),e))).catch(()=>[]).then(e=>{const t=e.map(({name:e,version:t})=>`${e}/${t}`);return o=u(),console.info(`web3Enable: Enabled ${e.length} extension${1!==e.length?"s":""}: ${t.join(", ")}`),e})),c=new Promise(e=>{"complete"===document.readyState?e(n()):window.addEventListener("load",()=>e(n()))}),c}async function l({accountType:e,extensions:t,genesisHash:r,ss58Format:s}={}){const a=[],o=await async function(e,t){return c?(await c).filter(({name:e})=>!t||t.includes(e)):d(e)}("web3Accounts",t),u=await Promise.all(o.map(async({accounts:t,name:a})=>{try{return function(e,t,r){return t.map(({address:t,genesisHash:s,name:a,type:o})=>({address:42===t.length?t:(0,n.j)((0,i.F)(t),r),meta:{genesisHash:s,name:a,source:e},type:o}))}(a,function(e,t,r){return e.filter(e=>(!e.type||!r||r.includes(e.type))&&(!e.genesisHash||!t||e.genesisHash===t))}(await t.get(),r,e),s)}catch{return[]}}));return u.forEach(e=>{a.push(...e)}),console.info(`web3Accounts: Found ${a.length} address${1!==a.length?"es":""}`),a}async function h(e){if(!c)return d("web3FromSource");const t=await c,r=e&&t.find(({name:t})=>t===e);if(!r)throw new Error(`web3FromSource: Unable to find an injected ${e}`);return r}},42815(e,t,r){r.d(t,{O:()=>p});var s=r(39385),n=r(76838),i=r(66615),a=r(34116),o=r(96944),c=r(73274);async function u(e){const t=await e;if(36864!==t.return_code)throw new Error(t.error_message);return t}function d(e,t,r=0,s=0,{account:n=2147483648,addressIndex:o=2147483648,change:c=2147483648}={}){return async d=>{const{signature:p}=await u(d[e](n+r,c,o+s,(0,i.e)(t)));return{signature:(0,a.d)(p.toString("hex"))}}}class p{#j;#s;#o=null;constructor(e,t){const r=c.M5[t],s=n.T.find(({type:t})=>t===e);if(!r)throw new Error(`Unsupported Ledger chain ${t}`);if(!s)throw new Error(`Unsupported Ledger transport ${e}`);this.#j=r,this.#s=s}async getAddress(e=!1,t=0,r=0,{account:s=2147483648,addressIndex:n=2147483648,change:i=2147483648}={}){return this.withApp(async o=>{const{address:c,pubKey:d}=await u(o.getAddress(s+t,i,n+r,e));return{address:c,publicKey:(0,a.d)(d)}})}async getVersion(){return this.withApp(async e=>{const{device_locked:t,major:r,minor:s,patch:n,test_mode:i}=await u(e.getVersion());return{isLocked:t,isTestMode:i,version:[r,s,n]}})}async sign(e,t,r,s){return this.withApp(d("sign",e,t,r,s))}async signRaw(e,t,r,s){return this.withApp(d("signRaw",(0,o.C1)(e),t,r,s))}async withApp(e){try{if(!this.#o){const e=await this.#s.create();this.#o=(0,s.newSubstrateApp)(e,this.#j)}return await e(this.#o)}catch(e){throw this.#o=null,e}}}},43778(e,t,r){r.d(t,{G:()=>s});const s="bottom drive obey lake curtain smoke basket hold race lonely fit walk"},49416(e,t,r){r.d(t,{s:()=>s});const s=(0,r(7971).i)(e=>e.rpc.chain.subscribeNewHeads())},51784(e,t,r){r.d(t,{l:()=>$});var s=r(95620),n=r(68050),i=r(54190),a=r(8781),o=r(44734),c=r(76733),u=r(51661),d=r(11243),p=r(29220),l=r(94547),h=r(60750),f=r(16880),g=r(64401),m=r(92100),y=r(23100),b=r(83448),v=r(52063),w=r(93302);function x(e){return e.map(e=>(0,w.b)({},e,{name:Array.isArray(e.name)?e.name:[e.name]}))}function k(e,t){if(!t.metadataVersion.length)throw new Error("Invalid format for V0 (detected) contract metadata");return e.createType("ContractMetadataV1",(0,w.b)({},t,{spec:(0,w.b)({},t.spec,{constructors:x(t.spec.constructors),messages:x(t.spec.messages)}),types:(0,v.F)(e,t.types)}))}const _={ContractConstructorSpec:"ContractMessageParamSpecV2",ContractEventSpec:"ContractEventParamSpecV2",ContractMessageSpec:"ContractMessageParamSpecV2"};function T(e){return(0,w.b)({},e,{label:Array.isArray(e.name)?e.name.join("::"):e.name})}function S(e,t,r){return r.map(r=>e.createType(`${t}V2`,(0,w.b)(T(r),{args:r.args.map(r=>e.createType(_[t],T(r)))})))}function q(e,t){return e.createType("ContractMetadataV2",(0,w.b)({},t,{spec:(0,w.b)({},t.spec,{constructors:S(e,"ContractConstructorSpec",t.spec.constructors),events:S(e,"ContractEventSpec",t.spec.events),messages:S(e,"ContractMessageSpec",t.spec.messages)})}))}function E(e,t){return e.createType("ContractMetadataV3",(0,w.b)({},t,{spec:(0,w.b)({},t.spec,{constructors:t.spec.constructors.map(t=>e.createType("ContractConstructorSpecV3",(0,w.b)({},t,{payable:!0})))})}))}function C(e,t){return e.createType("ContractMetadataV4",(0,w.b)({},t,{spec:(0,w.b)({},t.spec,{constructors:t.spec.constructors.map(t=>e.createType("ContractConstructorSpecV4",(0,w.b)({},t))),messages:t.spec.messages.map(t=>e.createType("ContractMessageSpecV3",(0,w.b)({},t)))}),version:e.createType("Text","4")}))}const A=["V6","V5","V4","V3","V2","V1"];function M(e,t){return(r,s)=>e(r,t(r,s))}function I(e,t){return t}const P=M(I,C),H=M(P,E),z=M(H,q),R=[["V6",function(e,t){return t}],["V5",function(e,t){return t}],["V4",I],["V3",P],["V2",H],["V1",z],["V0",M(z,k)]],B=(0,a.v)("Abi"),O=["AccountId","AccountId20","AccountIndex","Address","Balance"];function V(e,t){const r=(0,o.E)(t)?e[t]:(0,c.K)(t)?e.find(({identifier:e})=>[e,(0,u.WH)(e)].includes(t.toString())):t;return(0,d.Z8)(r,()=>`Attempted to call an invalid contract interface, ${(0,p.A)(t)}`)}function N(e){return!!e&&e instanceof Map&&!(0,h.b)(e.type)&&!(0,h.b)(e.displayName)}function D(e){return!!e&&e instanceof n.c}class ${events;constructors;info;json;messages;metadata;registry;environment=new Map;isRevive;constructor(e,t){[this.json,this.registry,this.metadata,this.info,this.isRevive]=function(e,t){const r=new s.O,n=function(e){const t=e.source,r=e.version;return"object"==typeof t&&null!==t&&"contract_binary"in t||"number"==typeof r&&r>=6}(e),i=n?"ContractReviveProjectInfo":"ContractProjectInfo",a=r.createType(i,e),o=function(e,t){const r=A.find(e=>(0,l.G)(t[e])),s=t.version;if(!r&&s&&!A.find(e=>e===`V${s}`))throw new Error(`Unable to handle version ${s}`);const n=e.createType("ContractMetadata",r?{[r]:t[r]}:s?{[`V${s}`]:t}:{V0:t}),i=R.find(([e])=>n[`is${e}`]);if(!i)throw new Error(`Unable to convert ABI with version ${n.type} to a supported version`);return i[1](e,n[`as${i[0]}`])}(r,e),c=r.createType("PortableRegistry",{types:o.types},!0);return r.setLookup(c),t&&r.setChainProperties(t),c.types.forEach(({id:e})=>c.getTypeDef(e)),[e,r,o,a,n]}((0,c.K)(e)?JSON.parse(e):e,t),this.constructors=this.metadata.spec.constructors.map((e,t)=>this.#L(e,t,{isConstructor:!0,isDefault:e.default.isTrue,isPayable:e.payable.isTrue,returnType:e.returnType.isSome?this.registry.lookup.getTypeDef(e.returnType.unwrap().type):null})),this.events=this.metadata.spec.events.map((e,t)=>this.#K(t)),this.messages=this.metadata.spec.messages.map((e,t)=>this.#L(e,t,{isDefault:e.default.isTrue,isMutating:e.mutates.isTrue,isPayable:e.payable.isTrue,returnType:e.returnType.isSome?this.registry.lookup.getTypeDef(e.returnType.unwrap().type):null}));for(const[e,t]of this.metadata.spec.environment.entries()){if(!D(t))throw new Error(`Expected Option<*> definition for ${e} in ContractEnvironment`);if(t.isSome){const r=t.unwrap();if((0,f.f)(r))this.environment.set(e,r);else{if(!N(r))throw new Error(`Invalid environment definition for ${e}:: Expected either Number or ContractTypeSpec`);this.environment.set(e,this.registry.lookup.getTypeDef(r.type))}}}}decodeEvent(e){switch(this.metadata.version.toString()){case"4":return this.#W(e);case"5":return this.#Y(e);default:return this.#Z(e)}}#Z=e=>{const t=e.event.data[2],r=t[0],s=e.event.data[1];if(r){const e=this.events.find(e=>void 0!==e.signatureTopic&&null!==e.signatureTopic&&e.signatureTopic===r.toHex());if(e)return e.fromU8a(s)}const n=t.length,i=this.events.filter(e=>(null===e.signatureTopic||void 0===e.signatureTopic)&&e.args.filter(e=>e.indexed).length===n);if(1===i.length)return i[0].fromU8a(s);throw new Error("Unable to determine event")};#Y=e=>{const t=e.topics[0],r=e.event.data[1];if(t){const e=this.events.find(e=>void 0!==e.signatureTopic&&null!==e.signatureTopic&&e.signatureTopic===t.toHex());if(e)return e.fromU8a(r)}const s=e.topics.length,n=this.events.filter(e=>(null===e.signatureTopic||void 0===e.signatureTopic)&&e.args.filter(e=>e.indexed).length===s);if(1===n.length)return n[0].fromU8a(r);throw new Error("Unable to determine event")};#W=e=>{const t=e.event.data[1],r=t[0],s=this.events[r];if(!s)throw new Error(`Unable to find event with index ${r}`);return s.fromU8a(t.subarray(1))};decodeConstructor(e){return this.#X("message",this.constructors,e)}decodeMessage(e){return this.#X("message",this.messages,e)}findConstructor(e){return V(this.constructors,e)}findMessage(e){return V(this.messages,e)}#G=(e,t)=>e.map(({label:e,type:r},s)=>{try{if(!(0,l.G)(r))throw new Error("Invalid type definition found");const t=r.displayName.length?r.displayName[r.displayName.length-1].toString():void 0,s=(0,u.WH)(e);if(t&&O.includes(t))return{name:s,type:{info:i.K.Plain,type:t}};const n=this.registry.lookup.getTypeDef(r.type);return{name:s,type:t&&!n.type.startsWith(t)?{displayName:t,...n}:n}}catch(e){throw B.error(`Error expanding argument ${s} in ${(0,p.A)(t)}`),e}});#Q=(e,t)=>this.#G(e,t);#J=(e,t)=>this.#G(e,t).map((t,r)=>({...t,indexed:e[r].indexed.toPrimitive()}));#K=e=>"4"===this.metadata.version.toString()?this.#ee(this.metadata.spec.events[e],e):this.#te(this.metadata.spec.events[e],e);#te=(e,t)=>{const r=this.#J(e.args,e),s={args:r,docs:e.docs.map(e=>e.toString()),fromU8a:e=>({args:this.#re(r,e),event:s}),identifier:[e.module_path,e.label].join("::"),index:t,signatureTopic:e.signature_topic.isSome?e.signature_topic.unwrap().toHex():null};return s};#ee=(e,t)=>{const r=this.#J(e.args,e),s={args:r,docs:e.docs.map(e=>e.toString()),fromU8a:e=>({args:this.#re(r,e),event:s}),identifier:e.label.toString(),index:t};return s};#L=(e,t,r={})=>{const s=this.#Q(e.args,e),n=e.label.toString(),i={...r,args:s,docs:e.docs.map(e=>e.toString()),fromU8a:e=>({args:this.#re(s,e),message:i}),identifier:n,index:t,isDefault:e.default.isTrue,method:(0,u.WH)(n),path:n.split("::").map(e=>(0,u.WH)(e)),selector:e.selector,toU8a:t=>this.#se(e,s,t)};return i};#re=(e,t)=>{let r=0;return e.map(({type:{lookupName:e,type:s}})=>{const n=this.registry.createType(e||s,t.subarray(r));return r+=n.encodedLength,n})};#X=(e,t,r)=>{const[,s]=(0,g.a)(r),n=s.subarray(0,4),i=t.find(e=>e.selector.eq(n));if(!i)throw new Error(`Unable to find ${e} with selector ${(0,m.X)(n)}`);return i.fromU8a(s.subarray(4))};#se=({label:e,selector:t},r,s)=>{if(s.length!==r.length)throw new Error(`Expected ${r.length} arguments to contract message '${e.toString()}', found ${s.length}`);return(0,y.h)((0,b.z)(this.registry.createType("ContractSelector",t).toU8a(),...r.map(({type:{lookupName:e,type:t}},r)=>this.registry.createType(e||t,s[r]).toU8a())))}}},65660(e,t,r){r.d(t,{V:()=>s});const s={acala:787,ajuna:354,"aleph-node":643,astar:810,bifrost:788,"bifrost-kusama":788,bittensor:354,centrifuge:747,composable:354,creditcoin3:354,darwinia:354,dentnet:734,"dock-mainnet":594,edgeware:523,encointer:434,enjin:1155,equilibrium:99999997,frequency:2091,genshiro:99999996,hydradx:354,integritee:2015,"interlay-parachain":354,karura:686,khala:434,kusama:434,liberland:767,matrixchain:1155,mythos:60,nodle:1003,origintrail:354,parallel:354,peaq:3338,pendulum:354,phala:354,picasso:434,polimec:3344,polkadex:799,polkadot:354,polymesh:595,quartz:631,sora:617,stafi:907,statemine:434,statemint:354,ternoa:995,unique:661,vara:4976,vtb:694,xxnetwork:1955,zeitgeist:354}},66750(e,t,r){r.d(t,{a:()=>n});var s=r(71647);function n(e){return(0,s.i)(e.number)?e.number.unwrap():e.number}},67180(e,t,r){r.d(t,{k:()=>s});const s=(0,r(7971).i)(e=>e.rpc.chain.subscribeFinalizedHeads())},72286(e,t,r){r.d(t,{ZC:()=>R,vZ:()=>B,AP:()=>O});var s=r(90323),n=r(20659),i=r(60750),a=r(51524);function o(e,t,r,s){if(e.isInBlock||e.isFinalized){const n=s?"revive":"contracts",i=e.filterRecords(n,t);if(i.length)return r(i)}}var c=r(6404),u=r(51784);class d{abi;api;_decorateMethod;_isWeightV1;_isRevive;constructor(e,t,r){if(!e||!e.isConnected||!e.tx)throw new Error("Your API has not been initialized correctly and is not connected to a chain");if(this.abi=t instanceof u.l?t:new u.l(t,e.registry.getChainProperties()),this.api=e,this._decorateMethod=r,this._isWeightV1=!e.registry.createType("Weight").proofSize,this._isRevive=this.abi.isRevive,this._isRevive){if(!e.tx.revive||!(0,c.T)(e.tx.revive.instantiateWithCode)||6!==e.tx.revive.instantiateWithCode.meta.args.length)throw new Error("The runtime does not expose api.tx.revive.instantiateWithCode with storageDepositLimit");if(!e.call.reviveApi||!(0,c.T)(e.call.reviveApi.call))throw new Error("Your runtime does not expose the api.call.reviveApi.call runtime interfaces")}else{if(!e.tx.contracts||!(0,c.T)(e.tx.contracts.instantiateWithCode)||6!==e.tx.contracts.instantiateWithCode.meta.args.length)throw new Error("The runtime does not expose api.tx.contracts.instantiateWithCode with storageDepositLimit");if(!e.call.contractsApi||!(0,c.T)(e.call.contractsApi.call))throw new Error("Your runtime does not expose the api.call.contractsApi.call runtime interfaces")}}get registry(){return this.api.registry}}var p=r(18045),l=r(95927),h=r(8781),f=r(55192),g=r(23100),m=r(6409),y=r(665),b=r(49141);const v=new Uint8Array;function w(e,t){return t.meta=e,t}function x(e,t){return w(e,(e,...r)=>t(e,r))}function k(e=(0,b.a)()){return e instanceof f.I?e:e?.length?(0,g.h)((0,m.e)(e)):v}function _(e){const[t,r]=function(e){return!!e.proofSize}(e)?[e.refTime.toBn(),e.proofSize.toBn()]:[(0,y.A)(e),void 0];return{v1Weight:t,v2Weight:{proofSize:r,refTime:t}}}const T=new l(5e12).isub(a.Uu),S=(0,h.v)("Contract");class q extends n.w{contractEvents;constructor(e,t){super(e),this.contractEvents=t}}class E extends d{address;#ne={};#ie={};constructor(e,t,r,s){super(e,t,s),this.address=this.registry.createType(this._isRevive?"AccountId20":"AccountId",r),this.abi.messages.forEach(e=>{var t;(0,i.b)(this.#ie[e.method])&&(this.#ie[e.method]=(t=(t,r)=>this.#ae(e,t,r),w(e,(e,...r)=>t(e,r)))),(0,i.b)(this.#ne[e.method])&&(this.#ne[e.method]=function(e,t){return w(e,(e,r,...s)=>t(e,r,s))}(e,(t,r,s)=>this.#oe(e,r,s).send(t)))})}get query(){return this.#ne}get tx(){return this.#ie}#ce=(e,t=!1)=>{const r=_(e);return r.v1Weight.gt(a.Yz)?r:_(t?T:_(this.api.consts.system.blockWeights?this.api.consts.system.blockWeights.maxBlock:this.api.consts.system.maximumBlockWeight).v1Weight.muln(64).div(a.cM))};#ae=(e,{gasLimit:t=a.Yz,storageDepositLimit:r=null,value:s=a.Yz},n)=>(this._isRevive?this.api.tx.revive:this.api.tx.contracts).call(this.address,s,this._isWeightV1?_(t).v1Weight:_(t).v2Weight,r,this.abi.findMessage(e).toU8a(n)).withResultTransform(e=>new q(e,o(e,["ContractEmitted","ContractExecution"],e=>e.filter(e=>{try{const t=e.event.data[0];return!!this.address.eq(t)||(S.debug(`Skipping event from different contract ${t.toString()} (this contract: ${this.address.toString()})`),!1)}catch(e){return S.warn(`Unable to extract contract address from event: ${e.message}`),!1}}).map(e=>{try{return this.abi.decodeEvent(e)}catch(e){return S.error(`Unable to decode contract event: ${e.message}`),null}}).filter(e=>!!e),this._isRevive)));#oe=(e,{gasLimit:t=a.Yz,storageDepositLimit:r=null,value:s=a.Yz},n)=>{const i=this.abi.findMessage(e);return{send:this._decorateMethod(e=>(this._isRevive?this.api.rx.call.reviveApi.call:this.api.rx.call.contractsApi.call)(e,this.address,s,this._isWeightV1?this.#ce(t,!0).v1Weight:this.#ce(t,!0).v2Weight,r,i.toU8a(n)).pipe((0,p.T)(({debugMessage:e,gasConsumed:t,gasRequired:r,result:s,storageDeposit:n})=>({debugMessage:e,gasConsumed:t,gasRequired:r&&!_(r).v1Weight.isZero()?r:t,output:s.isOk&&i.returnType?this.abi.registry.createTypeUnsafe(i.returnType.lookupName||i.returnType.type,[s.asOk.data.toU8a(!0)],{isPedantic:!0}):null,result:s,storageDeposit:n}))))}}}class C extends n.w{contract;constructor(e,t){super(e),this.contract=t}}class A extends d{codeHash;#ie={};constructor(e,t,r,s){super(e,t,s),this.codeHash=this.registry.createType("Hash",r),this.abi.constructors.forEach(e=>{(0,i.b)(this.#ie[e.method])&&(this.#ie[e.method]=x(e,(t,r)=>this.#ue(e,t,r)))})}get tx(){return this.#ie}#ue=(e,{gasLimit:t=a.Yz,salt:r,storageDepositLimit:s=null,value:n=a.Yz},i)=>(this._isRevive?this.api.tx.revive:this.api.tx.contracts).instantiate(n,this._isWeightV1?_(t).v1Weight:_(t).v2Weight,s,this.codeHash,this.abi.findConstructor(e).toU8a(i),k(r)).withResultTransform(e=>new C(e,o(e,["Instantiated"],([e])=>new E(this.api,this.abi,e.event.data[1],this._decorateMethod),this._isRevive)))}var M=r(3236),I=r(25557);class P extends n.w{blueprint;contract;constructor(e,t,r){super(e),this.blueprint=t,this.contract=r}}function H(e){return(0,M.H)(e)||(0,I.S)(e)}class z extends d{code;#ie={};constructor(e,t,r,s){if(super(e,t,s),this.code=H(this.abi.info.source.wasm)?this.abi.info.source.wasm:(0,m.e)(r),!H(this.code))throw new Error("Invalid code provided");this.abi.constructors.forEach(e=>{(0,i.b)(this.#ie[e.method])&&(this.#ie[e.method]=x(e,(t,r)=>this.#de(e,t,r)))})}get tx(){return this.#ie}#de=(e,{gasLimit:t=a.Yz,salt:r,storageDepositLimit:s=null,value:n=a.Yz},i)=>{const c=this._isRevive?this.api.tx.revive:this.api.tx.contracts;return this._isRevive?c.instantiateWithCode(n,this._isWeightV1?_(t).v1Weight:_(t).v2Weight,s,(0,g.h)(this.code),this.abi.findConstructor(e).toU8a(i),k(r)).withResultTransform(e=>new P(e,...o(e,["Instantiated"],e=>e.reduce(([e,t],{event:r})=>this.api.events.revive.Instantiated.is(r)?[e,new E(this.api,this.abi,r.data[1],this._decorateMethod)]:[e,t],[void 0,void 0]),this._isRevive)||[void 0,void 0])):c.instantiateWithCode(n,this._isWeightV1?_(t).v1Weight:_(t).v2Weight,s,(0,g.h)(this.code),this.abi.findConstructor(e).toU8a(i),k(r)).withResultTransform(e=>new P(e,...o(e,["CodeStored","Instantiated"],e=>e.reduce(([e,t],{event:r})=>this.api.events.contracts.Instantiated.is(r)?[e,new E(this.api,this.abi,r.data[1],this._decorateMethod)]:this.api.events.contracts.CodeStored.is(r)?[new A(this.api,this.abi,r.data[0],this._decorateMethod),t]:[e,t],[void 0,void 0]),this._isRevive)||[void 0,void 0]))}}class R extends A{constructor(e,t,r){super(e,t,r,s.p)}}class B extends z{constructor(e,t,r){super(e,t,r,s.p)}}class O extends E{constructor(e,t,r){super(e,t,r,s.p)}}},73274(e,t,r){r.d(t,{M5:()=>s});const s={acala:"Acala",ajuna:"Ajuna","aleph-node":"AlephZero",astar:"Astar",bifrost:"Bifrost","bifrost-kusama":"BifrostKusama",centrifuge:"Centrifuge",composable:"Composable",darwinia:"Darwinia","dock-mainnet":"Dock",edgeware:"Edgeware",enjin:"Enjin",equilibrium:"Equilibrium",genshiro:"Genshiro",hydradx:"HydraDX","interlay-parachain":"Interlay",karura:"Karura",khala:"Khala",kusama:"Kusama",matrixchain:"Matrixchain",nodle:"Nodle",origintrail:"OriginTrail",parallel:"Parallel",peaq:"Peaq",pendulum:"Pendulum",phala:"Phala",picasso:"Picasso",polkadex:"Polkadex",polkadot:"Polkadot",polymesh:"Polymesh",quartz:"Quartz",sora:"Sora",stafi:"Stafi",statemine:"Statemine",statemint:"Statemint",ternoa:"Ternoa",unique:"Unique",vtb:"VTB",xxnetwork:"XXNetwork",zeitgeist:"Zeitgeist",bittensor:"Bittensor",creditcoin3:"Creditcoin3",dentnet:"DENTNet",encointer:"Encointer",frequency:"Frequency",integritee:"Integritee",liberland:"Liberland",mythos:"Mythos",polimec:"Polimec",vara:"Vara"}},74362(e,t,r){r.d(t,{G:()=>a});var s=r(59359),n=r(18045),i=r(53403);function a(e,t){return(0,i.p)(e,()=>(0,s.z)([t.derive.chain.bestNumber(),t.derive.chain.bestNumberFinalized()]).pipe((0,n.T)(([e,r])=>t.registry.createType("BlockNumber",e.sub(r)))))}},76838(e,t,r){r.d(t,{T:()=>i});var s=r(7409);function n(...e){return e.map(([e,t])=>({create:()=>t.create(),type:e}))}const i=n(["webusb",r(25222).A],["hid",s.A])},79832(e,t,r){function s(e,t){const[r]=e.logs.filter(e=>e.isConsensus),s=e.logs.filter(e=>e.isPreRuntime),[n]=e.logs.filter(e=>e.isSeal);let i;try{for(const e of s){const[r,s]=e.asPreRuntime;if(i=r.extractAuthor(s,t),i)return i}if(!i&&r){const[e,s]=r.asConsensus;i=e.extractAuthor(s,t)}if(!i&&n){const[e,r]=n.asSeal;i=e.extractAuthor(r,t)}}catch{}return i}r.d(t,{D:()=>s})},85159(e,t,r){r.d(t,{BS:()=>f,X8:()=>l,f1:()=>h,h:()=>g,qg:()=>m});var s=r(95927),n=r(99014),i=r(26865),a=r(93302),o=r(92100),c=r(54143),u=r(76733),d=r(33482);function p(e,t,r,s){for(;;){const n=e.div(t),i=r.div(s);if(n.lt(i))return!0;if(i.lt(n))return!1;const a=e.mod(t),o=r.mod(s);if(o.isZero())return!1;if(a.isZero())return!0;e=s,r=t,t=o,s=a}}function l(e,t,r){return e.isSimpleMajority?r.votedAye.gt(r.votedNay):function(e,t,{votedAye:r,votedNay:s,votedTotal:i}){const a=(0,n.t)(i);return!a.isZero()&&(e.isSuperMajorityApprove?p(s,a,r,t):p(s,t,r,a))}(e,t,r)}function h(e,t,r){const n=t.status.tally?function(e,t){const r=[],s=[];return t.forEach(e=>{e.vote.isAye?r.push(e):s.push(e)}),{allAye:r,allNay:s,voteCount:r.length+s.length,voteCountAye:r.length,voteCountNay:s.length,votedAye:e.ayes,votedNay:e.nays,votedTotal:e.turnout}}(t.status.tally,r):r.reduce((e,t)=>{const{balance:r,vote:s}=t,n=0===s.conviction.index,i=r.muln(n?1:s.conviction.index).divn(n?10:1);return s.isAye?(e.allAye.push(t),e.voteCountAye++,e.votedAye.iadd(i)):(e.allNay.push(t),e.voteCountNay++,e.votedNay.iadd(i)),e.voteCount++,e.votedTotal.iadd(i),e},{allAye:[],allNay:[],voteCount:0,voteCountAye:0,voteCountNay:0,votedAye:new s(0),votedNay:new s(0),votedTotal:new s(0)});return(0,a.b)({},n,{isPassing:l(t.status.threshold,e,n),votes:r})}function f(e){if(e.isNone)return null;const t=e.unwrap();return function(e){return!!e.proposalHash}(t)?t:t.isOngoing?t.asOngoing:null}function g(e){return e.isLegacy?e.asLegacy.hash_.toHex():e.isLookup?e.asLookup.hash_.toHex():e.isInline?e.asInline.hash.toHex():(0,u.K)(e)?(0,c.qv)(e)?e:(0,i.i)(e):(0,d.b)(e)?(0,o.X)(e):e.toHex()}function m(e){return g(e.proposal||e.proposalHash)}},87106(e,t,r){r.d(t,{z:()=>s});const s={name:"@pezkuwi/networks",path:new URL("file:///home/runner/work/pezkuwi-apps/pezkuwi-apps/node_modules/@pezkuwi/networks/packageInfo.js").pathname.substring(0,new URL("file:///home/runner/work/pezkuwi-apps/pezkuwi-apps/node_modules/@pezkuwi/networks/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"14.0.10"}},87194(e,t,r){r.d(t,{S:()=>n,U:()=>i});const s=new Map,n={del:e=>{s.delete(e)},forEach:e=>{for(const[t,r]of s.entries())e(t,r)},get:e=>s.get(e),set:(e,t)=>{s.set(e,t)}},i={del:()=>{},forEach:()=>{},get:()=>{},set:(e,t)=>t}},89129(e,t,r){r.d(t,{x:()=>D});var s=r(86319),n=r(83448),i=r(93302),a=r(6409),o=r(92100),c=r(36730),u=r(62518),d=r(35359),p=r(52959),l=r(86221),h=r(12834),f=r(73314),g=r(9799),m=r(64792),y=r(71028),b=r(84645),v=r(88929),w=r(35262),x=r(13880),k=r(65587),_=r(73276),T=r(57432),S=r(23433);const q=new Uint8Array([161,35,3,33,0]),E=new Uint8Array([48,83,2,1,1,48,5,6,3,43,101,112,4,34,4,32]),C=E.length;var A=r(53335),M=r(22373),I=r(34658),P=r(20662);const H=new Uint8Array,z={ecdsa:u.S,ed25519:d.r,ethereum:u.S,sr25519:p.H},R={ecdsa:new Uint8Array([2]),ed25519:new Uint8Array([0]),ethereum:new Uint8Array([2]),sr25519:new Uint8Array([1])},B={ecdsa:(e,t)=>(0,l.c)(e,t,"blake2"),ed25519:h.t,ethereum:(e,t)=>(0,l.c)(e,t,"keccak"),sr25519:f.v},O={ecdsa:e=>e.length>32?(0,g.q)(e):e,ed25519:e=>e,ethereum:e=>20===e.length?e:(0,m.H1)((0,y.V)(e)),sr25519:e=>e};function V(e){return!e||(0,s.U)(e)}function N(e,t,r){return(0,g.q)((0,n.z)(t||"",r||"",e))}function D({toSS58:e,type:t},{publicKey:r,secretKey:s},u={},d=null,p){const l=(e,n)=>{const i=function(e,t,r){const s=Array.isArray(r)||void 0===r?r:[r],n=(0,S.y)(t,e,s),i=n.subarray(0,E.length);if(!(0,c.f)(i,E))throw new Error("Invalid encoding header found in body");let a=n.subarray(C,C+64),o=C+64,u=n.subarray(o,o+q.length);if(!(0,c.f)(u,q)&&(o=C+32,a=n.subarray(C,o),u=n.subarray(o,o+q.length),!(0,c.f)(u,q)))throw new Error("Invalid encoding divider found in body");const d=o+q.length;return{publicKey:n.subarray(d,d+32),secretKey:a}}(e,n||d,p);if(64===i.secretKey.length)r=i.publicKey,s=i.secretKey;else{const e=z[t](i.secretKey);r=e.publicKey,s=e.secretKey}},h=e=>(V(s)&&d&&l(e,d),d=function({publicKey:e,secretKey:t},r){if(!t)throw new Error("Expected a valid secretKey to be passed to encode");const s=(0,n.z)(E,t,q,e);if(!r)return s;const{params:i,password:a,salt:o}=(0,A.g)(r),{encrypted:c,nonce:u}=(0,M.K)(s,a.subarray(0,32));return(0,n.z)((0,I.z)(o,i),u,c)}({publicKey:r,secretKey:s},e),p=void 0,d),f=()=>{const s=O[t](r);return"ethereum"===t?(0,b.w)(s):e(s)};return{get address(){return f()},get addressRaw(){const e=O[t](r);return"ethereum"===t?e.slice(-20):e},get isLocked(){return V(s)},get meta(){return u},get publicKey(){return r},get type(){return t},decodePkcs8:l,derive:(n,i)=>{if("ethereum"===t)throw new Error("Unable to derive on this keypair");if(V(s))throw new Error("Cannot derive on a locked keypair");const{path:a}=(0,v._)(n),o=(0,w.d)({publicKey:r,secretKey:s},a,t);return D({toSS58:e,type:t},o,i,null)},encodePkcs8:e=>h(e),lock:()=>{s=new Uint8Array},setMeta:e=>{u=(0,i.b)({},u,e)},sign:(e,i={})=>{if(V(s))throw new Error("Cannot sign with a locked key pair");return(0,n.z)(i.withType?R[t]:H,B[t]((0,a.e)(e),{publicKey:r,secretKey:s}))},toJson:e=>{const s=["ecdsa","ethereum"].includes(t)?20===r.length?(0,o.X)(r):(0,o.X)((0,x.z)(r)):f();return function(e,{address:t,meta:r},s,n){return(0,i.b)((0,P.r)(s,["pkcs8",e],n),{address:t,meta:r})}(t,{address:s,meta:u},h(e),!!e)},unlock:e=>l(e),verify:(e,r,s)=>(0,k.K)(e,r,O[t]((0,a.e)(s))).isValid,vrfSign:(e,i,o)=>{if(V(s))throw new Error("Cannot sign with a locked key pair");if("sr25519"===t)return(0,_.x)(e,{secretKey:s},i,o);const c=B[t]((0,a.e)(e),{publicKey:r,secretKey:s});return(0,n.z)(N(c,i,o),c)},vrfVerify:(e,s,i,o,u)=>"sr25519"===t?(0,T.X)(e,s,r,o,u):(0,k.K)(e,(0,n.z)(R[t],s.subarray(32)),O[t]((0,a.e)(i))).isValid&&(0,c.f)(s.subarray(0,32),N(s.subarray(32),o,u))}}},90323(e,t,r){r.d(t,{I:()=>c,p:()=>u});var s=r(21166),n=r(70672),i=r(58322),a=r(6404),o=r(58797);function c(e,t){let r=!1;return{reject:e=>(r||(r=!0,t(e)),s.w),resolve:t=>{r||(r=!0,e(t))}}}function u(e,t){const r=!(!t?.methodName||!t.methodName.includes("subscribe"));return function(...s){const[u,d]=function(e,t){const r=e.slice(),s=e.length&&(0,a.T)(e[e.length-1])?r.pop():void 0;if(t&&!(0,a.T)(s))throw new Error("Expected a callback to be passed with subscriptions");return[r,s]}(s,r);return d?function(e,t,r){return new Promise((s,a)=>{const u=c(s,a),d=e(...t).pipe((0,n.W)(e=>u.reject(e)),(0,i.M)(()=>u.resolve(()=>d.unsubscribe()))).subscribe(e=>{(0,o.d)(()=>r(e))})})}(e,u,d):function(e,t){return new Promise((r,s)=>{const i=c(r,s),a=e(...t).pipe((0,n.W)(e=>i.reject(e))).subscribe(e=>{i.resolve(e),(0,o.d)(()=>a.unsubscribe())})})}(t?.overrideNoSub||e,u)}}}}]);