@smartledger/bsv 6.1.2 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +38 -38
  3. package/SECURITY.md +39 -12
  4. package/bsv-anchor.min.js +18 -11
  5. package/bsv-covenant.min.js +2 -48
  6. package/bsv-didweb.min.js +18 -11
  7. package/bsv-ecies.min.js +2 -20
  8. package/bsv-gdaf.min.js +103 -45
  9. package/bsv-ltp.min.js +103 -45
  10. package/bsv-message.min.js +3 -10
  11. package/bsv-mnemonic.min.js +20 -11
  12. package/bsv-script-helper.min.js +2 -10
  13. package/bsv-security.min.js +2 -10
  14. package/bsv-shamir.min.js +20 -11
  15. package/bsv-smartcontract.min.js +26 -48
  16. package/bsv-statuslist.min.js +74 -17
  17. package/bsv-vcjwt.min.js +18 -11
  18. package/bsv.bundle.js +103 -45
  19. package/bsv.min.js +103 -45
  20. package/build/esbuild/empty.js +2 -0
  21. package/build/esbuild/globals.js +6 -0
  22. package/build/esbuild.js +129 -0
  23. package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
  24. package/docs/THREAT_MODEL.md +127 -0
  25. package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
  26. package/docs/getting-started/INSTALLATION.md +23 -23
  27. package/docs/getting-started/QUICK_START.md +7 -7
  28. package/docs/migration/FROM_BSV_1_5_6.md +5 -5
  29. package/index.js +3 -2
  30. package/lib/smart_contract/index.js +1 -1
  31. package/package.json +5 -23
  32. package/test/build/bundle_smoke.js +55 -0
  33. package/test/build/esbuild_main.js +65 -0
  34. package/test/build/version_sync.js +14 -0
  35. package/test/security/threat_model_coverage.js +31 -0
  36. package/version.js +3 -0
  37. package/build/webpack.anchor.config.js +0 -15
  38. package/build/webpack.base.js +0 -125
  39. package/build/webpack.bundle.config.js +0 -15
  40. package/build/webpack.config.js +0 -17
  41. package/build/webpack.covenant.config.js +0 -17
  42. package/build/webpack.didweb.config.js +0 -15
  43. package/build/webpack.ecies.config.js +0 -15
  44. package/build/webpack.gdaf.config.js +0 -15
  45. package/build/webpack.ltp.config.js +0 -15
  46. package/build/webpack.message.config.js +0 -15
  47. package/build/webpack.mnemonic.config.js +0 -15
  48. package/build/webpack.script-helper.config.js +0 -17
  49. package/build/webpack.security.config.js +0 -15
  50. package/build/webpack.shamir.config.js +0 -15
  51. package/build/webpack.smartcontract.config.js +0 -18
  52. package/build/webpack.statuslist.config.js +0 -15
  53. package/build/webpack.vcjwt.config.js +0 -15
@@ -1,48 +1,2 @@
1
- var bsvCovenant;(()=>{var e={5424(e,t,r){e.exports=r(8924)},5237(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5606),o=e.exports;if(o.deps=o.deps||{},o.deps._=r(4799),o.deps.Buffer=void 0!==i?i:null,"undefined"==typeof window)o.deps.bnjs=r(9404),o.deps.bs58=r(6763);else{try{o.deps.bnjs=r(9404)}catch(e){}try{o.deps.bs58=r(6763)}catch(e){}}o.version="v"+r(8330).rE,o.versionGuard=function(e){if(void 0!==e){console.warn("\n More than one instance of bsv found.\n Please make sure to require bsv and check that submodules do\n not also include their own bsv dependency.")}},o.versionGuard(r.g._bsv),r.g._bsv=o.version,o.isHardened=!0,o.hardenedBy="SmartLedger",o.baseVersion="v1.5.6",o.securityFeatures=["canonical-signatures","malleability-protection","enhanced-validation","elliptic-patches"],o.crypto={},o.crypto.BN=r(9043),o.crypto.ECDSA=r(1955),o.crypto.Hash=r(5067),o.crypto.Random=r(9968),o.crypto.Point=r(4125),o.crypto.Signature=r(7881),o.crypto.Shamir=r(261),o.crypto.SmartVerify=r(2959),o.crypto.EllipticFixed=r(7230),o.encoding={},o.encoding.Base58=r(9375),o.encoding.Base58Check=r(9047),o.encoding.BufferReader=r(7798),o.encoding.BufferWriter=r(5750),o.encoding.Varint=r(3173),o.util={},o.util.js=r(3035),o.util.preconditions=r(6365),o.errors=r(3649),o.Address=r(617),o.Block=r(1127),o.MerkleBlock=r(4416),o.BlockHeader=r(3423),o.SPV=r(2985),o.HDPrivateKey=r(983),o.HDPublicKey=r(4997),o.Networks=r(1262),o.Opcode=r(7239),o.PrivateKey=r(4339),o.PublicKey=r(6161),o.Script=r(5133),o.Transaction=r(6558),o.Input=r(6558).Input,o.Output=r(6558).Output,o.UnspentOutput=r(6558).UnspentOutput,o.Message=r(2157),o.Mnemonic=r(6162),o.ECIES=r(2729),o.Signature=r(7881),o.Shamir=r(261),o.SmartLedger={version:o.version,hardenedBy:o.hardenedBy,baseVersion:o.baseVersion,securityFeatures:o.securityFeatures,SmartVerify:r(2959),EllipticFixed:r(7230)},o.SmartVerify=r(2959),o.EllipticFixed=r(7230);try{o.SmartContract=r(6306)}catch(e){"undefined"==typeof window&&console.warn("SmartContract module not available:",e.message)}try{o.BrowserUTXOManager=r(646)}catch(e){"undefined"==typeof window&&console.warn("[bsv] BrowserUTXOManager failed to load:",e.message)}if("undefined"==typeof window)try{var a,s=!1;Object.defineProperty(o,"SmartUTXO",{configurable:!0,enumerable:!0,get:function(){return s||n.env&&n.env.BSV_HIDE_DEPRECATIONS||(s=!0,console.warn("[bsv] bsv.SmartUTXO is a development-only simulator and is deprecated; it will be removed in v6.0.0. Import directly: require('@smartledger/bsv/lib/smartutxo'). Set BSV_HIDE_DEPRECATIONS=1 to silence this warning.")),a||(a=r(2408)),a}}),o.SmartMiner=r(3737),o.CustomScriptHelper=r(1113)}catch(e){}o.Ordinals=r(9648),o.GDAF=r(8922);try{o.DIDWeb=r(3967)}catch(e){"undefined"==typeof window&&console.warn("[bsv] DIDWeb module failed to load:",e.message)}try{o.VcJwt=r(6470)}catch(e){"undefined"==typeof window&&console.warn("[bsv] VcJwt module failed to load:",e.message)}try{o.StatusList=r(4096)}catch(e){"undefined"==typeof window&&console.warn("[bsv] StatusList module failed to load:",e.message)}try{o.Anchor=r(5323)}catch(e){"undefined"==typeof window&&console.warn("[bsv] Anchor module failed to load:",e.message)}o.createDID=function(e){return(new o.GDAF).createDID(e)},o.resolveDID=function(e){return(new o.GDAF).resolveDID(e)},o.createEmailCredential=function(e,t,r,i){return(new o.GDAF).createEmailCredential(e,t,r,i)},o.createAgeCredential=function(e,t,r,i,n){return(new o.GDAF).createAgeCredential(e,t,r,i,n)},o.createKYCCredential=function(e,t,r,i,n){return(new o.GDAF).createKYCCredential(e,t,r,i,n)},o.verifyCredential=function(e,t){return(new o.GDAF).verifyCredential(e,t)},o.validateCredential=function(e,t){return(new o.GDAF).validateCredential(e,t)},o.generateSelectiveProof=function(e,t,r){return(new o.GDAF).generateSelectiveProof(e,t,r)},o.generateAgeProof=function(e,t,r){return(new o.GDAF).generateAgeProof(e,t,r)},o.verifyAgeProof=function(e,t,r){return(new o.GDAF).verifyAgeProof(e,t,r)},o.createPresentation=function(e,t,r,i){return(new o.GDAF).createPresentation(e,t,r,i)},o.getCredentialSchemas=function(){return(new o.GDAF).getAllSchemas()},o.createCredentialTemplate=function(e){return(new o.GDAF).createTemplate(e)},o.LTP=r(542),o.prepareRightToken=function(e,t,r,i,n,a){return o.LTP.Right.prepareRightToken(e,t,r,i,n,a)},o.prepareRightTokenVerification=function(e,t){return o.LTP.Right.prepareRightTokenVerification(e,t)},o.prepareRightTokenTransfer=function(e,t,r,i){return o.LTP.Right.prepareRightTokenTransfer(e,t,r,i)},o.prepareRightTypeValidation=function(e){return o.LTP.Right.prepareRightTypeValidation(e)},o.prepareObligationToken=function(e,t,r,i,n,a){return o.LTP.Obligation.prepareObligationToken(e,t,r,i,n,a)},o.prepareObligationVerification=function(e,t){return o.LTP.Obligation.prepareObligationVerification(e,t)},o.prepareObligationFulfillment=function(e,t,r,i){return o.LTP.Obligation.prepareObligationFulfillment(e,t,r,i)},o.prepareObligationBreachAssessment=function(e,t,r){return o.LTP.Obligation.prepareObligationBreachAssessment(e,t,r)},o.prepareObligationMonitoringReport=function(e,t){return o.LTP.Obligation.prepareObligationMonitoringReport(e,t)},o.prepareClaimValidation=function(e,t){return o.LTP.Claim.prepareClaimValidation(e,t)},o.prepareClaimAttestation=function(e,t,r){return o.LTP.Claim.prepareClaimAttestation(e,t,r)},o.prepareClaimDispute=function(e,t,r){return o.LTP.Claim.prepareClaimDispute(e,t,r)},o.prepareBulkClaimValidation=function(e,t){return o.LTP.Claim.prepareBulkClaimValidation(e,t)},o.prepareClaimTemplate=function(e,t){return o.LTP.Claim.prepareClaimTemplate(e,t)},o.prepareSignatureProof=function(e,t,r){return o.LTP.Proof.prepareSignatureProof(e,t,r)},o.prepareSignatureVerification=function(e,t){return o.LTP.Proof.prepareSignatureVerification(e,t)},o.prepareSelectiveDisclosure=function(e,t,r){return o.LTP.Proof.prepareSelectiveDisclosure(e,t,r)},o.prepareSelectiveDisclosureVerification=function(e,t){return o.LTP.Proof.prepareSelectiveDisclosureVerification(e,t)},o.prepareLegalValidityProof=function(e,t,r){return o.LTP.Proof.prepareLegalValidityProof(e,t,r)},o.prepareZeroKnowledgeProof=function(e,t,r){return o.LTP.Proof.prepareZeroKnowledgeProof(e,t,r)},o.prepareRegistry=function(e){return o.LTP.Registry.prepareRegistry(e)},o.prepareTokenRegistration=function(e,t,r){return o.LTP.Registry.prepareTokenRegistration(e,t,r)},o.prepareTokenApproval=function(e,t,r){return o.LTP.Registry.prepareTokenApproval(e,t,r)},o.prepareTokenRevocation=function(e,t,r){return o.LTP.Registry.prepareTokenRevocation(e,t,r)},o.prepareTokenStatusQuery=function(e,t){return o.LTP.Registry.prepareTokenStatusQuery(e,t)},o.prepareTokenSearch=function(e,t){return o.LTP.Registry.prepareTokenSearch(e,t)},o.prepareStatisticsQuery=function(e){return o.LTP.Registry.prepareStatisticsQuery(e)},o.prepareAuditLogQuery=function(e,t){return o.LTP.Registry.prepareAuditLogQuery(e,t)},o.prepareTokenCommitment=function(e,t){return o.LTP.Anchor.prepareTokenCommitment(e,t)},o.prepareBatchCommitment=function(e,t){return o.LTP.Anchor.prepareBatchCommitment(e,t)},o.verifyTokenAnchor=function(e,t,r){return o.LTP.Anchor.verifyTokenAnchor(e,t,r)},o.formatRevocation=function(e,t){return o.LTP.Anchor.formatRevocation(e,t)},o.createRightToken=function(e,t,r){return(new o.LTP).createRightToken(e,t,r)},o.verifyLegalToken=function(e,t){return(new o.LTP).verifyToken(e,t)},o.validateLegalClaim=function(e,t){return(new o.LTP).validateClaim(e,t)},o.createSelectiveDisclosure=function(e,t,r){return(new o.LTP).createSelectiveDisclosure(e,t,r)},o.createLegalRegistry=function(e){return o.LTP.Registry.prepareRegistry(e)},o.createLegalValidityProof=function(e,t,r){return(new o.LTP).createLegalValidityProof(e,t,r)},o.getRightTypes=function(){return o.LTP.Right.getRightTypes()},o.getObligationTypes=function(){return o.LTP.Obligation.getObligationTypes()},o.getObligationPriority=function(){return o.LTP.Obligation.getObligationPriority()},o.getObligationStatus=function(){return o.LTP.Obligation.getObligationStatus()},o.getClaimSchemas=function(){return o.LTP.Claim.getSchemas()},o.getClaimSchemaNames=function(){return o.LTP.Claim.getSchemaNames()},o.getClaimSchema=function(e){return o.LTP.Claim.getSchema(e)},o.createClaimTemplate=function(e){return o.LTP.Claim.createTemplate(e)},o.canonicalizeClaim=function(e){return o.LTP.Claim.canonicalize(e)},o.hashClaim=function(e){return o.LTP.Claim.hash(e)},o.addCustomClaimSchema=function(e,t){return o.LTP.Claim.addSchema(e,t)},o.Transaction.sighash=r(999)},617(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(3649),s=r(9047),u=r(1262),c=r(5067),l=r(3035),h=r(6161);function f(e,t,r){if(!(this instanceof f))return new f(e,t,r);if(n.isArray(e)&&n.isNumber(t))return f.createMultisig(e,t,r);if(e instanceof f)return e;if(o.checkArgument(e,"First argument is required, please include address data.","guide/address.html"),t&&!u.get(t))throw new TypeError('Second argument must be "livenet", "testnet", or "regtest".');if(r&&r!==f.PayToPublicKeyHash&&r!==f.PayToScriptHash)throw new TypeError('Third argument must be "pubkeyhash" or "scripthash".');var i=this._classifyArguments(e,t,r);return i.network=i.network||u.get(t)||u.defaultNetwork,i.type=i.type||r||f.PayToPublicKeyHash,l.defineImmutable(this,{hashBuffer:i.hashBuffer,network:i.network,type:i.type}),this}f.prototype._classifyArguments=function(e,t,r){if((e instanceof i||e instanceof Uint8Array)&&20===e.length)return f._transformHash(e);if((e instanceof i||e instanceof Uint8Array)&&21===e.length)return f._transformBuffer(e,t,r);if(e instanceof h)return f._transformPublicKey(e);if(e instanceof p)return f._transformScript(e,t);if("string"==typeof e)return f._transformString(e,t,r);if(n.isObject(e))return f._transformObject(e);throw new TypeError("First argument is an unrecognized data format.")},f.PayToPublicKeyHash="pubkeyhash",f.PayToScriptHash="scripthash",f._transformHash=function(e){var t={};if(!(e instanceof i||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(20!==e.length)throw new TypeError("Address hashbuffers must be exactly 20 bytes.");return t.hashBuffer=e,t},f._transformObject=function(e){return o.checkArgument(e.hash||e.hashBuffer,"Must provide a `hash` or `hashBuffer` property"),o.checkArgument(e.type,"Must provide a `type` property"),{hashBuffer:e.hash?i.from(e.hash,"hex"):e.hashBuffer,network:u.get(e.network)||u.defaultNetwork,type:e.type}},f._classifyFromVersion=function(e){var t={},r=u.get(e[0],"pubkeyhash"),i=u.get(e[0],"scripthash");return r?(t.network=r,t.type=f.PayToPublicKeyHash):i&&(t.network=i,t.type=f.PayToScriptHash),t},f._transformBuffer=function(e,t,r){var n={};if(!(e instanceof i||e instanceof Uint8Array))throw new TypeError("Address supplied is not a buffer.");if(21!==e.length)throw new TypeError("Address buffers must be exactly 21 bytes.");var o=u.get(t),a=f._classifyFromVersion(e);if(t&&!o)throw new TypeError("Unknown network");if(!a.network||o&&o!==a.network)throw new TypeError("Address has mismatched network type.");if(!a.type||r&&r!==a.type)throw new TypeError("Address has mismatched type.");return n.hashBuffer=e.slice(1),n.network=a.network,n.type=a.type,n},f._transformPublicKey=function(e){var t={};if(!(e instanceof h))throw new TypeError("Address must be an instance of PublicKey.");return t.hashBuffer=c.sha256ripemd160(e.toBuffer()),t.type=f.PayToPublicKeyHash,t},f._transformScript=function(e,t){o.checkArgument(e instanceof p,"script must be a Script instance");var r=e.getAddressInfo(t);if(!r)throw new a.Script.CantDeriveAddress(e);return r},f.createMultisig=function(e,t,r){return r=r||e[0].network||u.defaultNetwork,f.payingTo(p.buildMultisigOut(e,t),r)},f._transformString=function(e,t,r){if("string"!=typeof e)throw new TypeError("data parameter supplied is not a string.");if(e.length<27)throw new Error("Invalid Address string provided");e=e.trim();var i=u.get(t);if(t&&!i)throw new TypeError("Unknown network");var n=s.decode(e);return f._transformBuffer(n,t,r)},f.fromPublicKey=function(e,t){var r=f._transformPublicKey(e);return t=t||u.defaultNetwork,new f(r.hashBuffer,t,r.type)},f.fromPrivateKey=function(e,t){let r=h.fromPrivateKey(e);return t=t||e.network||u.defaultNetwork,f.fromPublicKey(r,t)},f.fromPublicKeyHash=function(e,t){var r=f._transformHash(e);return new f(r.hashBuffer,t,f.PayToPublicKeyHash)},f.fromScriptHash=function(e,t){o.checkArgument(e,"hash parameter is required");var r=f._transformHash(e);return new f(r.hashBuffer,t,f.PayToScriptHash)},f.payingTo=function(e,t){return o.checkArgument(e,"script is required"),o.checkArgument(e instanceof p,"script must be instance of Script"),f.fromScriptHash(c.sha256ripemd160(e.toBuffer()),t)},f.fromScript=function(e,t){o.checkArgument(e instanceof p,"script must be a Script instance");var r=f._transformScript(e,t);return new f(r.hashBuffer,t,r.type)},f.fromBuffer=function(e,t,r){var i=f._transformBuffer(e,t,r);return new f(i.hashBuffer,i.network,i.type)},f.fromHex=function(e,t,r){return f.fromBuffer(i.from(e,"hex"),t,r)},f.fromString=function(e,t,r){var i=f._transformString(e,t,r);return new f(i.hashBuffer,i.network,i.type)},f.fromObject=function(e){return o.checkState(l.isHexa(e.hash),'Unexpected hash property, "'+e.hash+'", expected to be hex.'),new f(i.from(e.hash,"hex"),e.network,e.type)},f.getValidationError=function(e,t,r){var i;try{new f(e,t,r)}catch(e){i=e}return i},f.isValid=function(e,t,r){return!f.getValidationError(e,t,r)},f.prototype.isPayToPublicKeyHash=function(){return this.type===f.PayToPublicKeyHash},f.prototype.isPayToScriptHash=function(){return this.type===f.PayToScriptHash},f.prototype.toBuffer=function(){var e=i.from([this.network[this.type]]);return i.concat([e,this.hashBuffer])},f.prototype.toHex=function(){return this.toBuffer().toString("hex")},f.prototype.toObject=f.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},f.prototype.inspect=function(){return"<Address: "+this.toString()+", type: "+this.type+", network: "+this.network+">"},f.prototype.toString=function(){return s.encode(this.toBuffer())},e.exports=f;var p=r(5133)},5323(e,t,r){"use strict";var i=r(8287).Buffer,n=r(2338);function o(e){var t;if("string"==typeof e)t=i.from(e,"utf8");else if(i.isBuffer(e))t=e;else{if(!(e instanceof Uint8Array))throw new Error("Data must be string, Buffer, or Uint8Array");t=i.from(e)}return n.createHash("sha256").update(t).digest("hex")}e.exports={sha256Hex:o,buildAnchorPayload:function(e){if(!e.kind||!e.hash||!e.issuerDid)throw new Error("kind, hash, and issuerDid are required");var t=["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"];if(-1===t.indexOf(e.kind))throw new Error("Invalid kind. Must be one of: "+t.join(", "));if(!/^[a-fA-F0-9]{64}$/.test(e.hash))throw new Error("Invalid hash format. Must be 64 hex characters");var r={protocol:"SmartLedger",version:"1.0",type:e.kind,hash:e.hash,issuer:e.issuerDid,timestamp:e.issuedAt||(new Date).toISOString()};return{json:JSON.stringify(r)}},verifyAnchorHash:function(e,t){return o(e)===t},parseAnchorPayload:function(e){try{var t=JSON.parse(e);if("SmartLedger"!==t.protocol)return{valid:!1,error:"Invalid protocol"};return-1===["VC_ANCHOR_SHA256","STATUSLIST_SHA256","PRESENTATION_SHA256"].indexOf(t.type)?{valid:!1,error:"Invalid anchor type"}:/^[a-fA-F0-9]{64}$/.test(t.hash)?{valid:!0,protocol:t.protocol,version:t.version,type:t.type,hash:t.hash,issuer:t.issuer,timestamp:t.timestamp}:{valid:!1,error:"Invalid hash format"}}catch(e){return{valid:!1,error:"Failed to parse anchor payload: "+e.message}}}}},5006(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(3423),a=r(9043),s=r(7798),u=r(5750),c=r(5067),l=r(6558),h=r(6365);function f(e){return this instanceof f?(n.extend(this,f._from(e)),this):new f(e)}f.MAX_BLOCK_SIZE=128e6,f._from=function(e){var t={};if(i.isBuffer(e))t=f._fromBufferReader(s(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for Block");t=f._fromObject(e)}return t},f._fromObject=function(e){var t=[];return e.transactions.forEach(function(e){e instanceof l?t.push(e):t.push(l().fromObject(e))}),{header:o.fromObject(e.header),transactions:t}},f.fromObject=function(e){var t=f._fromObject(e);return new f(t)},f._fromBufferReader=function(e){var t={};h.checkState(!e.finished(),"No block data received"),t.header=o.fromBufferReader(e);var r=e.readVarintNum();t.transactions=[];for(var i=0;i<r;i++)t.transactions.push(l().fromBufferReader(e));return t},f.fromBufferReader=function(e){h.checkArgument(e,"br is required");var t=f._fromBufferReader(e);return new f(t)},f.fromBuffer=function(e){return f.fromBufferReader(new s(e))},f.fromString=function(e){var t=i.from(e,"hex");return f.fromBuffer(t)},f.fromRawBlock=function(e){i.isBuffer(e)||(e=i.from(e,"binary"));var t=s(e);t.pos=f.Values.START_OF_BLOCK;var r=f._fromBufferReader(t);return new f(r)},f.prototype.toObject=f.prototype.toJSON=function(){var e=[];return this.transactions.forEach(function(t){e.push(t.toObject())}),{header:this.header.toObject(),transactions:e}},f.prototype.toBuffer=function(){return this.toBufferWriter().concat()},f.prototype.toString=function(){return this.toBuffer().toString("hex")},f.prototype.toBufferWriter=function(e){e||(e=new u),e.write(this.header.toBuffer()),e.writeVarintNum(this.transactions.length);for(var t=0;t<this.transactions.length;t++)this.transactions[t].toBufferWriter(e);return e},f.prototype.getTransactionHashes=function(){var e=[];if(0===this.transactions.length)return[f.Values.NULL_HASH];for(var t=0;t<this.transactions.length;t++)e.push(this.transactions[t]._getHash());return e},f.prototype.getMerkleTree=function(){for(var e=this.getTransactionHashes(),t=0,r=this.transactions.length;r>1;r=Math.floor((r+1)/2)){for(var n=0;n<r;n+=2){var o=Math.min(n+1,r-1),a=i.concat([e[t+n],e[t+o]]);e.push(c.sha256sha256(a))}t+=r}return e},f.prototype.getMerkleRoot=function(){var e=this.getMerkleTree();return e[e.length-1]},f.prototype.validMerkleRoot=function(){var e=new a(this.header.merkleRoot.toString("hex"),"hex"),t=new a(this.getMerkleRoot().toString("hex"),"hex");return 0===e.cmp(t)},f.prototype._getHash=function(){return this.header._getHash()};var p={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=this.header.id),this._id},set:n.noop};Object.defineProperty(f.prototype,"id",p),Object.defineProperty(f.prototype,"hash",p),f.prototype.inspect=function(){return"<Block "+this.id+">"},f.Values={START_OF_BLOCK:8,NULL_HASH:i.from("0000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=f},3423(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(9043),a=r(7798),s=r(5750),u=r(5067),c=r(6365),l=function e(t){if(!(this instanceof e))return new e(t);var r=e._from(t);return this.version=r.version,this.prevHash=r.prevHash,this.merkleRoot=r.merkleRoot,this.time=r.time,this.timestamp=r.time,this.bits=r.bits,this.nonce=r.nonce,r.hash&&c.checkState(this.hash===r.hash,"Argument object hash property does not match block hash."),this};l._from=function(e){var t={};if(i.isBuffer(e))t=l._fromBufferReader(a(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for BlockHeader");t=l._fromObject(e)}return t},l._fromObject=function(e){c.checkArgument(e,"data is required");var t=e.prevHash,r=e.merkleRoot;return n.isString(e.prevHash)&&(t=i.from(e.prevHash,"hex").reverse()),n.isString(e.merkleRoot)&&(r=i.from(e.merkleRoot,"hex").reverse()),{hash:e.hash,version:e.version,prevHash:t,merkleRoot:r,time:e.time,timestamp:e.time,bits:e.bits,nonce:e.nonce}},l.fromObject=function(e){var t=l._fromObject(e);return new l(t)},l.fromRawBlock=function(e){i.isBuffer(e)||(e=i.from(e,"binary"));var t=a(e);t.pos=l.Constants.START_OF_HEADER;var r=l._fromBufferReader(t);return new l(r)},l.fromBuffer=function(e){var t=l._fromBufferReader(a(e));return new l(t)},l.fromString=function(e){var t=i.from(e,"hex");return l.fromBuffer(t)},l._fromBufferReader=function(e){var t={};return t.version=e.readInt32LE(),t.prevHash=e.read(32),t.merkleRoot=e.read(32),t.time=e.readUInt32LE(),t.bits=e.readUInt32LE(),t.nonce=e.readUInt32LE(),t},l.fromBufferReader=function(e){var t=l._fromBufferReader(e);return new l(t)},l.prototype.toObject=l.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:i.from(this.prevHash).reverse().toString("hex"),merkleRoot:i.from(this.merkleRoot).reverse().toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},l.prototype.toBuffer=function(){return this.toBufferWriter().concat()},l.prototype.toString=function(){return this.toBuffer().toString("hex")},l.prototype.toBufferWriter=function(e){return e||(e=new s),e.writeInt32LE(this.version),e.write(this.prevHash),e.write(this.merkleRoot),e.writeUInt32LE(this.time),e.writeUInt32LE(this.bits),e.writeUInt32LE(this.nonce),e},l.prototype.getTargetDifficulty=function(e){e=e||this.bits;for(var t=new o(16777215&e),r=8*((e>>>24)-3);r-- >0;)t=t.mul(new o(2));return t},l.prototype.getDifficulty=function(){var e=this.getTargetDifficulty(486604799).mul(new o(Math.pow(10,8))),t=this.getTargetDifficulty(),r=e.div(t).toString(10),i=r.length-8;return r=r.slice(0,i)+"."+r.slice(i),parseFloat(r)},l.prototype._getHash=function(){var e=this.toBuffer();return u.sha256sha256(e)};var h={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=a(this._getHash()).readReverse().toString("hex")),this._id},set:n.noop};Object.defineProperty(l.prototype,"id",h),Object.defineProperty(l.prototype,"hash",h),l.prototype.validTimestamp=function(){var e=Math.round((new Date).getTime()/1e3);return!(this.time>e+l.Constants.MAX_TIME_OFFSET)},l.prototype.validProofOfWork=function(){var e=new o(this.id,"hex"),t=this.getTargetDifficulty();return!(e.cmp(t)>0)},l.prototype.inspect=function(){return"<BlockHeader "+this.id+">"},l.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new o("10000000000000000000000000000000000000000000000000000000000000000","hex")},e.exports=l},1127(e,t,r){e.exports=r(5006),e.exports.BlockHeader=r(3423),e.exports.MerkleBlock=r(4416)},4416(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(3423),a=r(7798),s=r(5750),u=r(5067),c=r(6558),l=r(3649),h=r(6365);function f(e){if(!(this instanceof f))return new f(e);var t={};if(i.isBuffer(e))t=f._fromBufferReader(a(e));else{if(!n.isObject(e))throw new TypeError("Unrecognized argument for MerkleBlock");t={header:e.header instanceof o?e.header:o.fromObject(e.header),numTransactions:e.numTransactions,hashes:e.hashes,flags:e.flags}}return n.extend(this,t),this._flagBitsUsed=0,this._hashesUsed=0,this}f.fromBuffer=function(e){return f.fromBufferReader(a(e))},f.fromBufferReader=function(e){return new f(f._fromBufferReader(e))},f.prototype.toBuffer=function(){return this.toBufferWriter().concat()},f.prototype.toBufferWriter=function(e){e||(e=new s),e.write(this.header.toBuffer()),e.writeUInt32LE(this.numTransactions),e.writeVarintNum(this.hashes.length);for(var t=0;t<this.hashes.length;t++)e.write(i.from(this.hashes[t],"hex"));for(e.writeVarintNum(this.flags.length),t=0;t<this.flags.length;t++)e.writeUInt8(this.flags[t]);return e},f.prototype.toObject=f.prototype.toJSON=function(){return{header:this.header.toObject(),numTransactions:this.numTransactions,hashes:this.hashes,flags:this.flags}},f.prototype.validMerkleTree=function(){if(h.checkState(n.isArray(this.flags),"MerkleBlock flags is not an array"),h.checkState(n.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)return!1;if(8*this.flags.length<this.hashes.length)return!1;var e=this._calcTreeHeight(),t={hashesUsed:0,flagBitsUsed:0},r=this._traverseMerkleTree(e,0,t);return t.hashesUsed===this.hashes.length&&r.equals(this.header.merkleRoot)},f.prototype.filterdTxsHash=function(){throw new Error("filterdTxsHash has been deprecated. use filteredTxsHash.")},f.prototype.filteredTxsHash=function(){if(h.checkState(n.isArray(this.flags),"MerkleBlock flags is not an array"),h.checkState(n.isArray(this.hashes),"MerkleBlock hashes is not an array"),this.hashes.length>this.numTransactions)throw new l.MerkleBlock.InvalidMerkleTree;if(8*this.flags.length<this.hashes.length)throw new l.MerkleBlock.InvalidMerkleTree;if(1===this.hashes.length)return[];var e=this._calcTreeHeight(),t={hashesUsed:0,flagBitsUsed:0},r=this._traverseMerkleTree(e,0,t,!0);if(t.hashesUsed!==this.hashes.length)throw new l.MerkleBlock.InvalidMerkleTree;return r},f.prototype._traverseMerkleTree=function(e,t,r,n){if((r=r||{}).txs=r.txs||[],r.flagBitsUsed=r.flagBitsUsed||0,r.hashesUsed=r.hashesUsed||0,n=n||!1,r.flagBitsUsed>8*this.flags.length)return null;var o=this.flags[r.flagBitsUsed>>3]>>>(7&r.flagBitsUsed++)&1;if(0!==e&&o){var a=this._traverseMerkleTree(e-1,2*t,r),s=a;return 2*t+1<this._calcTreeWidth(e-1)&&(s=this._traverseMerkleTree(e-1,2*t+1,r)),n?r.txs:u.sha256sha256(i.concat([a,s]))}if(r.hashesUsed>=this.hashes.length)return null;var c=this.hashes[r.hashesUsed++];return 0===e&&o&&r.txs.push(c),i.from(c,"hex")},f.prototype._calcTreeWidth=function(e){return this.numTransactions+(1<<e)-1>>e},f.prototype._calcTreeHeight=function(){for(var e=0;this._calcTreeWidth(e)>1;)e++;return e},f.prototype.hasTransaction=function(e){h.checkArgument(!n.isUndefined(e),"tx cannot be undefined"),h.checkArgument(e instanceof c||"string"==typeof e,'Invalid tx given, tx must be a "string" or "Transaction"');var t=e;e instanceof c&&(t=i.from(e.id,"hex").reverse().toString("hex"));var r=[],o=this._calcTreeHeight();return this._traverseMerkleTree(o,0,{txs:r}),-1!==r.indexOf(t)},f._fromBufferReader=function(e){h.checkState(!e.finished(),"No merkleblock data received");var t={};t.header=o.fromBufferReader(e),t.numTransactions=e.readUInt32LE();var r=e.readVarintNum();t.hashes=[];for(var i=0;i<r;i++)t.hashes.push(e.read(32).toString("hex"));var n=e.readVarintNum();for(t.flags=[],i=0;i<n;i++)t.flags.push(e.readUInt8());return t},f.fromObject=function(e){return new f(e)},e.exports=f},646(e,t,r){"use strict";var i=r(5606),n=function(){(void 0!==i&&i.env&&i.env.BSV_DEBUG||"undefined"!=typeof window&&window.BSV_DEBUG)&&console.log.apply(console,arguments)},o={MEMORY:"memory",SESSION:"session",LOCAL:"local"};function a(e){if(e=e||{},this.options={storage:e.storage||o.MEMORY,storageKey:e.storageKey||"smartledger-utxos",autoSave:!1!==e.autoSave,maxUTXOs:e.maxUTXOs||1e3},-1===[o.MEMORY,o.SESSION,o.LOCAL].indexOf(this.options.storage))throw new Error("Invalid storage type: "+this.options.storage);this.utxos=new Map,this.addressIndex=new Map,this.spentUTXOs=new Map,this.metadata={totalUTXOs:0,totalValue:0,createdAt:(new Date).toISOString(),lastModified:(new Date).toISOString()},this.loadFromStorage()}a.prototype.getStorage=function(){return this.options.storage===o.SESSION?"undefined"!=typeof sessionStorage?sessionStorage:null:this.options.storage===o.LOCAL&&"undefined"!=typeof localStorage?localStorage:null},a.prototype.loadFromStorage=function(){var e=this.getStorage();if(e)try{var t=e.getItem(this.options.storageKey);if(!t)return;var r=JSON.parse(t);if(!r.utxos)return;var i=this;r.utxos.forEach(function(e){var t=e.txid+":"+e.vout;i.utxos.set(t,e),i.addressIndex.has(e.address)||i.addressIndex.set(e.address,new Set),i.addressIndex.get(e.address).add(t)}),r.metadata&&(this.metadata=r.metadata),n("✅ BrowserUTXOManager: Loaded "+this.utxos.size+" UTXOs from "+this.options.storage+" storage")}catch(e){console.error("Failed to load UTXOs from storage:",e)}},a.prototype.saveToStorage=function(){if(this.options.storage!==o.MEMORY){var e=this.getStorage();if(e)try{var t={utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",timestamp:(new Date).toISOString()};e.setItem(this.options.storageKey,JSON.stringify(t)),n("💾 BrowserUTXOManager: Saved "+this.utxos.size+" UTXOs to "+this.options.storage+" storage")}catch(e){console.error("Failed to save UTXOs to storage:",e)}}},a.prototype.addUTXO=function(e){if(!e||!e.txid||"number"!=typeof e.vout)throw new Error("Invalid UTXO: missing txid or vout");var t=e.txid+":"+e.vout;if(this.utxos.has(t))return n("⚠️ UTXO already exists: "+t),!1;var r={txid:e.txid,vout:e.vout,address:e.address||"",satoshis:e.satoshis||0,script:e.script||"",status:"available",addedAt:(new Date).toISOString()};return this.utxos.set(t,r),r.address&&(this.addressIndex.has(r.address)||this.addressIndex.set(r.address,new Set),this.addressIndex.get(r.address).add(t)),this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),!0},a.prototype.getUTXOsForAddress=function(e){var t=this.addressIndex.get(e);if(!t)return[];var r=[],i=this;return t.forEach(function(e){var t=i.utxos.get(e);t&&"available"===t.status&&r.push(t)}),r},a.prototype.getBalance=function(e){return this.getUTXOsForAddress(e).reduce(function(e,t){return e+(t.satoshis||0)},0)},a.prototype.spendUTXOs=function(e,t){t=t||"browser-spend";for(var r=[],i=0;i<e.length;i++){var n=e[i],o=n.txid+":"+n.vout,a=this.utxos.get(o);a&&"available"===a.status&&(a.status="spent",a.spentAt=(new Date).toISOString(),a.spentInTx=t,this.spentUTXOs.set(o,{txid:a.txid,vout:a.vout,spentInTx:t,spentAt:a.spentAt}),r.push(a))}return this.updateMetadata(),this.options.autoSave&&this.saveToStorage(),r},a.prototype.getUTXO=function(e,t){var r=e+":"+t,i=this.utxos.get(r);return{exists:!!i,utxo:i,status:i?i.status:"not-found"}},a.prototype.createMockUTXOs=function(e,t,r){t=t||5,r=r||1e5;for(var i=[],n=0;n<t;n++){for(var o="",a=0;a<64;a++)o+=Math.floor(16*Math.random()).toString(16);var s={txid:o,vout:n,address:e,satoshis:r+Math.floor(1e4*Math.random()),script:"",status:"available"};this.addUTXO(s),i.push(s)}return i},a.prototype.getStats=function(){var e=0,t=0,r=0;return this.utxos.forEach(function(i){e+=i.satoshis||0,"available"===i.status?t++:"spent"===i.status&&r++}),{totalUTXOs:this.utxos.size,totalAvailable:t,totalSpent:r,totalValue:e,totalAddresses:this.addressIndex.size,storageType:this.options.storage,metadata:this.metadata}},a.prototype.updateMetadata=function(){var e=this.getStats();this.metadata.totalUTXOs=e.totalUTXOs,this.metadata.totalValue=e.totalValue,this.metadata.lastModified=(new Date).toISOString()},a.prototype.exportData=function(){return JSON.stringify({utxos:Array.from(this.utxos.values()),metadata:this.metadata,version:"1.0.0",exportedAt:(new Date).toISOString()})},a.prototype.importData=function(e,t){t=t||!1;try{var r=JSON.parse(e);if(t||(this.utxos.clear(),this.addressIndex.clear(),this.spentUTXOs.clear()),r.utxos&&Array.isArray(r.utxos)){var i=this;r.utxos.forEach(function(e){i.addUTXO(e)})}return n("✅ BrowserUTXOManager: Imported "+(r.utxos&&r.utxos.length||0)+" UTXOs"),!0}catch(e){return console.error("Failed to import UTXO data:",e),!1}},e.exports?(e.exports=a,e.exports.STORAGE_TYPES=o):"undefined"!=typeof window&&(window.BrowserUTXOManager=a,window.BrowserUTXOManager.STORAGE_TYPES=o)},9043(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9404),o=r(6365),a=r(4799),s=function(e){for(var t=i.alloc(e.length),r=0;r<e.length;r++)t[r]=e[e.length-1-r];return t};n.Zero=new n(0),n.One=new n(1),n.Minus1=new n(-1),n.fromNumber=function(e){return o.checkArgument(a.isNumber(e)),new n(e)},n.fromString=function(e,t){return o.checkArgument(a.isString(e)),new n(e,t)},n.fromBuffer=function(e,t){void 0!==t&&"little"===t.endian&&(e=s(e));var r=e.toString("hex");return new n(r,16)},n.fromSM=function(e,t){var r;if(0===e.length)return n.fromBuffer(i.from([0]));var o="big";return t&&(o=t.endian),"little"===o&&(e=s(e)),128&e[0]?(e[0]=127&e[0],(r=n.fromBuffer(e)).neg().copy(r)):r=n.fromBuffer(e),r},n.prototype.toNumber=function(){return parseInt(this.toString(10),10)},n.prototype.toBuffer=function(e){var t,r;if(e&&e.size){var o=(r=this.toString(16,2)).length/2;t=i.from(r,"hex"),o===e.size||(o>e.size?t=n.trim(t,o):o<e.size&&(t=n.pad(t,o,e.size)))}else r=this.toString(16,2),t=i.from(r,"hex");return void 0!==e&&"little"===e.endian&&(t=s(t)),t},n.prototype.toSMBigEndian=function(){var e;return-1===this.cmp(n.Zero)?128&(e=this.neg().toBuffer())[0]?e=i.concat([i.from([128]),e]):e[0]=128|e[0]:128&(e=this.toBuffer())[0]&&(e=i.concat([i.from([0]),e])),1===e.length&0===e[0]&&(e=i.from([])),e},n.prototype.toSM=function(e){var t=e?e.endian:"big",r=this.toSMBigEndian();return"little"===t&&(r=s(r)),r},n.fromScriptNumBuffer=function(e,t,r){var i=r||4;if(o.checkArgument(e.length<=i,new Error("script number overflow")),t&&e.length>0&&!(127&e[e.length-1]||!(e.length<=1)&&128&e[e.length-2]))throw new Error("non-minimally encoded script number");return n.fromSM(e,{endian:"little"})},n.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},n.trim=function(e,t){return e.slice(t-e.length,e.length)},n.pad=function(e,t,r){for(var n=i.alloc(r),o=0;o<e.length;o++)n[n.length-1-o]=e[e.length-1-o];for(o=0;o<r-t;o++)n[o]=0;return n},n.prototype.toHex=function(...e){return this.toBuffer(...e).toString("hex")},n.fromHex=function(e,...t){return n.fromBuffer(i.from(e,"hex"),...t)},e.exports=n},1955(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),o=r(4125),a=r(7881),s=r(6161),u=r(9968),c=r(5067),l=r(4799),h=r(6365),f=function e(t){if(!(this instanceof e))return new e(t);t&&this.set(t)};f.prototype.set=function(e){if(this.hashbuf=e.hashbuf||this.hashbuf,this.endian=e.endian||this.endian,this.privkey=e.privkey||this.privkey,this.pubkey=e.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),e.sig)if(i.isBuffer(e.sig)){var t=r(7881);this.sig=t.fromDER(e.sig)}else this.sig=e.sig;else this.sig=this.sig;return this.k=e.k||this.k,this.verified=e.verified||this.verified,this},f.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},f.prototype.calci=function(){for(var e=0;e<4;e++){var t;this.sig.i=e;try{t=this.toPublicKey()}catch(e){console.error(e);continue}if(t.point.eq(this.pubkey.point))return this.sig.compressed=this.pubkey.compressed,this}throw this.sig.i=void 0,new Error("Unable to find valid recovery factor")},f.fromString=function(e){var t=JSON.parse(e);return new f(t)},f.prototype.randomK=function(){var e,t=o.getN();do{e=n.fromBuffer(u.getRandomBuffer(32))}while(!e.lt(t)||!e.gt(n.Zero));return this.k=e,this},f.prototype.deterministicK=function(e){l.isUndefined(e)&&(e=0);var t=i.alloc(32);t.fill(1);var r=i.alloc(32);r.fill(0);var a=this.privkey.bn.toBuffer({size:32}),s="little"===this.endian?i.from(this.hashbuf).reverse():this.hashbuf;r=c.sha256hmac(i.concat([t,i.from([0]),a,s]),r),t=c.sha256hmac(t,r),r=c.sha256hmac(i.concat([t,i.from([1]),a,s]),r),t=c.sha256hmac(t,r),t=c.sha256hmac(t,r);for(var u=n.fromBuffer(t),h=o.getN(),f=0;f<e||!u.lt(h)||!u.gt(n.Zero);f++)r=c.sha256hmac(i.concat([t,i.from([0])]),r),t=c.sha256hmac(t,r),t=c.sha256hmac(t,r),u=n.fromBuffer(t);return this.k=u,this},f.prototype.toPublicKey=function(){var e=this.sig.i;h.checkArgument(0===e||1===e||2===e||3===e,new Error("i must be equal to 0, 1, 2, or 3"));var t=n.fromBuffer(this.hashbuf),r=this.sig.r,i=this.sig.s,a=1&e,u=e>>1,c=o.getN(),l=o.getG(),f=u?r.add(c):r,p=o.fromX(a,f);if(!p.mul(c).isInfinity())throw new Error("nR is not a valid curve point");var d=t.neg().umod(c),g=r.invm(c),m=p.mul(i).add(l.mul(d)).mul(g);return s.fromPoint(m,this.sig.compressed)},f.prototype.sigError=function(){if(!i.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var e=this.sig.r,t=this.sig.s,r=o.getN();try{if(e.lte(n.Zero)||t.lte(n.Zero)||e.gte(r)||t.gte(r))return"r and s not in range";var a=n.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),s=t.invm(r),u=s.mul(a).umod(r),c=s.mul(e).umod(r),l=o.getG().mulAdd(u,this.pubkey.point,c);return l.isInfinity()?"p is infinity":0!==l.getX().umod(r).cmp(e)&&"Invalid signature"}catch(e){return"Signature security validation failed: "+e.message}},f.toLowS=function(e){return e.gt(n.fromBuffer(i.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(e=o.getN().sub(e)),e},f.prototype._findSignature=function(e,t){var r,i,a,s=o.getN(),u=o.getG(),c=0;do{(!this.k||c>0)&&this.deterministicK(c),c++,r=this.k,i=u.mul(r).x.umod(s),a=r.invm(s).mul(t.add(e.mul(i))).umod(s)}while(i.cmp(n.Zero)<=0||a.cmp(n.Zero)<=0);return{s:a=f.toLowS(a),r:i}},f.prototype.sign=function(){var e=this.hashbuf,t=this.privkey,r=t.bn;h.checkState(e&&t&&r,new Error("invalid parameters")),h.checkState(i.isBuffer(e)&&32===e.length,new Error("hashbuf must be a 32 byte buffer"));var o=n.fromBuffer(e,this.endian?{endian:this.endian}:void 0),s=this._findSignature(r,o);return s.compressed=this.pubkey.compressed,this.sig=new a(s),this},f.prototype.signRandomK=function(){return this.randomK(),this.sign()},f.prototype.toString=function(){var e={};return this.hashbuf&&(e.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(e.privkey=this.privkey.toString()),this.pubkey&&(e.pubkey=this.pubkey.toString()),this.sig&&(e.sig=this.sig.toString()),this.k&&(e.k=this.k.toString()),JSON.stringify(e)},f.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},f.prototype.verifyBool=function(){return!0===this.verify().verified},f.sign=function(e,t,r){return f().set({hashbuf:e,endian:r,privkey:t}).sign().sig},f.signWithCalcI=function(e,t,r){return f().set({hashbuf:e,endian:r,privkey:t}).sign().calci().sig},f.signRandomK=function(e,t,r){return f().set({hashbuf:e,endian:r,privkey:t}).signRandomK().sig},f.verify=function(e,t,r,i){return f().set({hashbuf:e,endian:i,sig:t,pubkey:r}).verify().verified},e.exports=f},7230(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),{secp256k1:o}=r(4554),a=o.Point,s=a.Fn.ORDER;function u(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new n(t,16)}function c(e){return i.isBuffer(e)?Uint8Array.from(e):e instanceof Uint8Array?e:Uint8Array.from(i.from(e,"hex"))}function l(e){this._p=e}l.prototype.eq=function(e){var t=e&&e._p?e._p:e;return this._p.equals(t)};var h={curve:{n:u(s)},keyFromPrivate:function(e,t){var r;r=i.isBuffer(e)?e:e instanceof Uint8Array?i.from(e):i.from(e,t||"hex");var n=Uint8Array.from(r);return{_priv:n,getPublic:function(){return new l(a.fromBytes(o.getPublicKey(n,!0)))}}},sign:function(e,t){var r=o.sign(c(e),t._priv,{lowS:!0,prehash:!1,format:"recovered"}),n=r[0];return{r:u(BigInt("0x"+i.from(r.subarray(1,33)).toString("hex"))),s:u(BigInt("0x"+i.from(r.subarray(33,65)).toString("hex"))),recoveryParam:n}},verify:function(e,t,r){try{if(!t||"object"!=typeof t)return!1;var n=t.r,a=t.s;if(!n||!a||"function"!=typeof n.cmp||"function"!=typeof a.cmp)return!1;if(n.isZero()||a.isZero())return!1;var s=h.curve.n;if(n.cmp(s)>=0||a.cmp(s)>=0)return!1;var u=i.concat([n.toBuffer({size:32}),a.toBuffer({size:32})]),l=r._priv?o.getPublicKey(r._priv,!0):r._p?r._p.toBytes(!0):r;return o.verify(Uint8Array.from(u),c(e),Uint8Array.from(l),{lowS:!1,prehash:!1})}catch(e){return!1}},recoverPubKey:function(e,t,r){var n=i.concat([t.r.toBuffer({size:32}),t.s.toBuffer({size:32})]);return new l(o.Signature.fromBytes(Uint8Array.from(n),"compact").addRecoveryBit(r).recoverPublicKey(c(e)))}};e.exports=h},6773(e,t,r){"use strict";var i=r(8287).Buffer,n=r(7952),o=r(6365),a=e.exports;a.sha1=function(e){return o.checkArgument(i.isBuffer(e)),i.from(n.sha1().update(e).digest("hex"),"hex")},a.sha1.blocksize=512,a.sha256=function(e){return o.checkArgument(i.isBuffer(e)),i.from(n.sha256().update(e).digest("hex"),"hex")},a.sha256.blocksize=512,a.sha256sha256=function(e){return o.checkArgument(i.isBuffer(e)),a.sha256(a.sha256(e))},a.ripemd160=function(e){return o.checkArgument(i.isBuffer(e)),i.from(n.ripemd160().update(e).digest("hex"),"hex")},a.sha256ripemd160=function(e){return o.checkArgument(i.isBuffer(e)),a.ripemd160(a.sha256(e))},a.sha512=function(e){return o.checkArgument(i.isBuffer(e)),i.from(n.sha512().update(e).digest("hex"),"hex")},a.sha512.blocksize=1024,a.hmac=function(e,t,r){o.checkArgument(i.isBuffer(t)),o.checkArgument(i.isBuffer(r)),o.checkArgument(e.blocksize);var n=e.blocksize/8;if(r.length>n)r=e(r);else if(r<n){var a=i.alloc(n);a.fill(0),r.copy(a),r=a}var s=i.alloc(n);s.fill(92);var u=i.alloc(n);u.fill(54);for(var c=i.alloc(n),l=i.alloc(n),h=0;h<n;h++)c[h]=s[h]^r[h],l[h]=u[h]^r[h];return e(i.concat([c,e(i.concat([l,t]))]))},a.sha256hmac=function(e,t){return a.hmac(a.sha256,e,t)},a.sha512hmac=function(e,t){return a.hmac(a.sha512,e,t)}},5067(e,t,r){r(5606).browser?e.exports=r(6773):e.exports=r(7581)},7581(e,t,r){"use strict";var i=r(8287).Buffer,n=r(8738),o=r(6365),a=e.exports;a.sha1=function(e){return o.checkArgument(i.isBuffer(e)),n.createHash("sha1").update(e).digest()},a.sha1.blocksize=512,a.sha256=function(e){return o.checkArgument(i.isBuffer(e)),n.createHash("sha256").update(e).digest()},a.sha256.blocksize=512,a.sha256sha256=function(e){return o.checkArgument(i.isBuffer(e)),a.sha256(a.sha256(e))},a.ripemd160=function(e){return o.checkArgument(i.isBuffer(e)),n.createHash("ripemd160").update(e).digest()},a.sha256ripemd160=function(e){return o.checkArgument(i.isBuffer(e)),a.ripemd160(a.sha256(e))},a.sha512=function(e){return o.checkArgument(i.isBuffer(e)),n.createHash("sha512").update(e).digest()},a.sha512.blocksize=1024,a.hmac=function(e,t,r){o.checkArgument(i.isBuffer(t)),o.checkArgument(i.isBuffer(r)),o.checkArgument(e.blocksize);var n=e.blocksize/8;if(r.length>n)r=e(r);else if(r<n){var a=i.alloc(n);a.fill(0),r.copy(a),r=a}var s=i.alloc(n);s.fill(92);var u=i.alloc(n);u.fill(54);for(var c=i.alloc(n),l=i.alloc(n),h=0;h<n;h++)c[h]=s[h]^r[h],l[h]=u[h]^r[h];return e(i.concat([c,e(i.concat([l,t]))]))},a.sha256hmac=function(e,t){return a.hmac(a.sha256,e,t)},a.sha512hmac=function(e,t){return a.hmac(a.sha512,e,t)}},4125(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),{secp256k1:o}=r(4554),a=o.Point,s=a.Fn.ORDER;function u(e){var t=e.toString(16);return t.length%2&&(t="0"+t),new n(t,16)}function c(e){if(null==e)throw new Error("Invalid Point");if("bigint"==typeof e)return e;if("number"==typeof e)return BigInt(e);if("string"==typeof e)return BigInt(0===e.indexOf("0x")?e:"0x"+e);if("function"==typeof e.toString)return BigInt("0x"+(e.toString(16)||"0"));throw new Error("Invalid Point")}function l(e){var t=Object.create(p.prototype);return t._p=e,t}function h(e,t){var r=c(t).toString(16).padStart(64,"0");return a.fromHex((e?"03":"02")+r)}function f(e,t){var r;try{r=h(1n==(1n&t),e)}catch(e){throw new Error("Point does not lie on the curve")}if(r.toAffine().y!==t)throw new Error("Invalid y value for curve.")}function p(e,t,r){if(!(this instanceof p))return new p(e,t,r);var i,n;try{i=c(e),n=c(t)}catch(e){throw new Error("Invalid Point")}f(i,n);try{this._p=a.fromAffine({x:i,y:n})}catch(e){throw new Error("Invalid Point")}return this}p.fromX=function(e,t){try{var r=l(h(e,t))}catch(e){throw new Error("Invalid X")}return r.validate(),r},p.getG=function(){return l(a.BASE)},p.getN=function(){return u(s)},p.prototype.getX=function(){return u(this._p.toAffine().x)},p.prototype.getY=function(){return u(this._p.toAffine().y)},Object.defineProperty(p.prototype,"x",{configurable:!0,enumerable:!0,get:function(){return this.getX()}}),Object.defineProperty(p.prototype,"y",{configurable:!0,enumerable:!0,get:function(){return this.getY()}}),p.prototype.mul=function(e){var t=(c(e)%s+s)%s;return 0n===t||this._p.is0()?l(a.ZERO):l(this._p.multiply(t))},p.prototype.add=function(e){return l(this._p.add(e._p))},p.prototype.mulAdd=function(e,t,r){return this.mul(e).add(t.mul(r))},p.prototype.eq=function(e){return this._p.equals(e._p)},p.prototype.isInfinity=function(){return this._p.is0()},p.prototype.validate=function(){if(this.isInfinity())throw new Error("Point cannot be equal to Infinity");var e=this._p.toAffine();return f(e.x,e.y),this},p.pointToCompressed=function(e){var t,r=e.getX().toBuffer({size:32}),n=e.getY().toBuffer({size:32});return t=n[n.length-1]%2?i.from([3]):i.from([2]),i.concat([t,r])},p.pointFromCompressed=function(e){if(33!==e.length)throw new Error("invalid buffer length");var t,r=e[0];if(3===r)t=!0;else{if(2!==r)throw new Error("invalid value of compressed prefix");t=!1}var i=n.fromBuffer(e.slice(1,33));return p.fromX(t,i)},p.prototype.toBuffer=function(){return p.pointToCompressed(this)},p.prototype.toHex=function(){return this.toBuffer().toString("hex")},p.fromBuffer=function(e){return p.pointFromCompressed(e)},p.fromHex=function(e){return p.fromBuffer(i.from(e,"hex"))},e.exports=p},9968(e,t,r){"use strict";var i=r(5606),n=r(8287).Buffer;function o(){}o.getRandomBuffer=function(e){return i.browser?o.getRandomBufferBrowser(e):o.getRandomBufferNode(e)},o.getRandomBufferNode=function(e){return r(8738).randomBytes(e)},o.getRandomBufferBrowser=function(e){if(!window.crypto&&!window.msCrypto)throw new Error("window.crypto not available");var t;if(window.crypto&&window.crypto.getRandomValues)t=window.crypto;else{if(!window.msCrypto||!window.msCrypto.getRandomValues)throw new Error("window.crypto.getRandomValues not available");t=window.msCrypto}var r=new Uint8Array(e);return t.getRandomValues(r),n.from(r)},e.exports=o},261(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),o=r(9968),a=r(5067),s=null;function u(){if(s)return s;var e=r(8015);return e.setRNG(function(e){for(var t=0;t<64;t++){for(var r=o.getRandomBuffer(Math.ceil(e/8)),i="",n=0;n<r.length;n++)i+=("00000000"+r[n].toString(2)).slice(-8);if(i=i.slice(0,e),/1/.test(i))return i}throw new Error("shamir: CSPRNG returned all-zero draws 64 times in a row — refusing to hang on a degenerate/stubbed random source")}),s=e}var c="ff";function l(e){return this instanceof l?(this.options=e||{},this):new l(e)}l.split=function(e,t,r,n){if(n=n||{},null==e)throw new Error("Secret is required");if(t<2)throw new Error("Threshold must be at least 2");if(r<t)throw new Error("Number of shares must be at least threshold");if(t>255||r>255)throw new Error("Threshold and shares must be <= 255");for(var s=i.isBuffer(e)?e:i.from(e,"utf8"),l=c+s.toString("hex"),h=u().share(l,r,t),f=o.getRandomBuffer(8).toString("hex"),p=!0===n.checksum?a.sha256(s).slice(0,4).toString("hex"):null,d=[],g=0;g<h.length;g++)d.push({v:2,id:g+1,threshold:t,shares:r,length:s.length,splitId:f,share:h[g],checksum:p});return d},l.combine=function(e){if(!e||0===e.length)throw new Error("Shares array is required");if(e[0]&&Array.isArray(e[0].bytes)&&void 0===e[0].share)return l._combineLegacy(e);var t=e[0].threshold,r=e[0].splitId;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var n=[],o=0;o<e.length;o++){var s=e[o];if(!s||"string"!=typeof s.share)throw new Error("Invalid share at index "+o);if(void 0!==r&&s.splitId!==r)throw new Error("Shares are from different splits (splitId mismatch)");if(s.threshold!==t)throw new Error("Shares have inconsistent threshold");n.push(s.share)}var h=u().combine(n);if(h.slice(0,2)!==c)throw new Error("Reconstruction failed: invalid or insufficient shares");var f=i.from(h.slice(2),"hex"),p=e[0].checksum;if(p&&a.sha256(f).slice(0,4).toString("hex")!==p)throw new Error("Integrity check failed: shares are inconsistent or tampered");return f},l.verifyShare=function(e){try{return!(!e||"object"!=typeof e)&&(Array.isArray(e.bytes)&&void 0===e.share?l._verifyLegacyShare(e):2===e.v&&(!("string"!=typeof e.share||!/^[0-9a-fA-F]+$/.test(e.share))&&("number"==typeof e.threshold&&"number"==typeof e.shares&&(!(e.threshold<2||e.shares<e.threshold||e.shares>255)&&(!(e.id<1||e.id>e.shares)&&(!(null!==e.checksum&&void 0!==e.checksum&&!/^[0-9a-fA-F]{8}$/.test(e.checksum))&&(u().extractShareComponents(e.share),!0)))))))}catch(e){return!1}},l.generateTestVectors=function(){var e="Hello, Bitcoin SV!",t=l.split(e,3,5),r=l.combine(t.slice(0,3));return{secret:e,threshold:3,totalShares:5,shares:t,reconstructed:r.toString("utf8"),valid:r.toString("utf8")===e}};var h=new n(2147483647);l._combineLegacy=function(e){var t=e[0].threshold,r=e[0].shares,n=e[0].length;if(e.length<t)throw new Error("Insufficient shares: need "+t+", got "+e.length);for(var o=0;o<e.length;o++){if(e[o].threshold!==t||e[o].shares!==r)throw new Error("Shares have inconsistent parameters");if(e[o].length!==n)throw new Error("Shares have different secret lengths")}for(var a=[],s=0;s<n;s++){for(var u=[],c=0;c<Math.min(e.length,t);c++)u.push(e[c].bytes[s]);a.push(l._combineByteLegacy(u))}return i.from(a)},l._combineByteLegacy=function(e){for(var t=new n(0),r=0;r<e.length;r++){for(var i=new n(e[r].x),o=new n(e[r].y,16),a=new n(1),s=new n(1),u=0;u<e.length;u++)if(r!==u){var c=new n(e[u].x),f=new n(0).sub(c);f.lt(new n(0))&&(f=f.add(h)),a=a.mul(f).mod(h);var p=i.sub(c);p.lt(new n(0))&&(p=p.add(h)),s=s.mul(p).mod(h)}var d=l._modInverseLegacy(s,h),g=a.mul(d).mod(h);t=t.add(o.mul(g)).mod(h)}return t.mod(h).mod(new n(256)).toNumber()},l._modInverseLegacy=function(e,t){e.lt(new n(0))&&(e=e.mod(t).add(t));var r=l._extendedGCDLegacy(e,t);if(!r.gcd.eq(new n(1)))throw new Error("Modular inverse does not exist");return r.x.mod(t).add(t).mod(t)},l._extendedGCDLegacy=function(e,t){if(e.eq(new n(0)))return{gcd:t,x:new n(0),y:new n(1)};var r=l._extendedGCDLegacy(t.mod(e),e);return{gcd:r.gcd,x:r.y.sub(t.div(e).mul(r.x)),y:r.x}},l._verifyLegacyShare=function(e){if(!(e.id&&e.threshold&&e.shares&&e.bytes&&"number"==typeof e.length))return!1;if(e.threshold<2||e.shares<e.threshold)return!1;if(!Array.isArray(e.bytes)||e.bytes.length!==e.length)return!1;for(var t=0;t<e.bytes.length;t++){var r=e.bytes[t];if(!r||!r.x||!r.y)return!1;if(r.x<1||r.x>e.shares)return!1;if(!/^[0-9a-fA-F]+$/.test(r.y))return!1}return!0},e.exports=l},7881(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),o=r(4799),a=r(6365),s=r(3035),u=function e(t,r){if(!(this instanceof e))return new e(t,r);if(t instanceof n)this.set({r:t,s:r});else if(t){var i=t;this.set(i)}};u.prototype.set=function(e){return this.r=e.r||this.r||void 0,this.s=e.s||this.s||void 0,this.i=void 0!==e.i?e.i:this.i,this.compressed=void 0!==e.compressed?e.compressed:this.compressed,this.nhashtype=e.nhashtype||this.nhashtype||void 0,this},u.fromCompact=function(e){a.checkArgument(i.isBuffer(e),"Argument is expected to be a Buffer");var t=new u,r=!0,o=e.slice(0,1)[0]-27-4;o<0&&(r=!1,o+=4);var s=e.slice(1,33),c=e.slice(33,65);return a.checkArgument(0===o||1===o||2===o||3===o,new Error("i must be 0, 1, 2, or 3")),a.checkArgument(32===s.length,new Error("r must be 32 bytes")),a.checkArgument(32===c.length,new Error("s must be 32 bytes")),t.compressed=r,t.i=o,t.r=n.fromBuffer(s),t.s=n.fromBuffer(c),t},u.fromDER=u.fromBuffer=function(e,t){var r=u.parseDER(e,t),i=new u;return i.r=r.r,i.s=r.s,i},u.fromTxFormat=function(e){var t=e.readUInt8(e.length-1),r=e.slice(0,e.length-1),i=u.fromDER(r,!1);return i.nhashtype=t,i},u.fromString=function(e){var t=i.from(e,"hex");return u.fromDER(t)},u.parseDER=function(e,t){a.checkArgument(i.isBuffer(e),new Error("DER formatted signature should be a buffer")),o.isUndefined(t)&&(t=!0);var r=e[0];a.checkArgument(48===r,new Error("Header byte should be 0x30"));var s=e[1],u=e.slice(2).length;a.checkArgument(!t||s===u,new Error("Length byte should length of what follows")),s=s<u?s:u;var c=e[2];a.checkArgument(2===c,new Error("Integer byte for r should be 0x02"));var l=e[3],h=e.slice(4,4+l),f=n.fromBuffer(h),p=0===e[4];a.checkArgument(l===h.length,new Error("Length of r incorrect"));var d=e[4+l+0];a.checkArgument(2===d,new Error("Integer byte for s should be 0x02"));var g=e[4+l+1],m=e.slice(4+l+2,4+l+2+g),y=n.fromBuffer(m),v=0===e[4+l+2+2];a.checkArgument(g===m.length,new Error("Length of s incorrect"));var b=4+l+2+g;return a.checkArgument(s===b-2,new Error("Length of signature incorrect")),{header:r,length:s,rheader:c,rlength:l,rneg:p,rbuf:h,r:f,sheader:d,slength:g,sneg:v,sbuf:m,s:y}},u.prototype.toCompact=function(e,t){if(e="number"==typeof e?e:this.i,t="boolean"==typeof t?t:this.compressed,0!==e&&1!==e&&2!==e&&3!==e)throw new Error("i must be equal to 0, 1, 2, or 3");var r=e+27+4;!1===t&&(r-=4);var n=i.from([r]),o=this.r.toBuffer({size:32}),a=this.s.toBuffer({size:32});return i.concat([n,o,a])},u.prototype.toBuffer=u.prototype.toDER=function(){var e=this.r.toBuffer(),t=this.s.toBuffer(),r=!!(128&e[0]),n=!!(128&t[0]),o=r?i.concat([i.from([0]),e]):e,a=n?i.concat([i.from([0]),t]):t,s=o.length,u=a.length,c=2+s+2+u;return i.concat([i.from([48,c,2,s]),o,i.from([2,u]),a])},u.prototype.toString=function(){return this.toDER().toString("hex")},u.isTxDER=function(e){if(e.length<9)return!1;if(e.length>73)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-3)return!1;var t=e[3];if(5+t>=e.length)return!1;var r=e[5+t];if(t+r+7!==e.length)return!1;var i=e.slice(4);if(2!==e[2])return!1;if(0===t)return!1;if(128&i[0])return!1;if(t>1&&0===i[0]&&!(128&i[1]))return!1;var n=e.slice(6+t);return 2===e[6+t-2]&&(0!==r&&(!(128&n[0])&&!(r>1&&0===n[0]&&!(128&n[1]))))},u.prototype.hasLowS=function(){return!this.s.lt(new n(1))&&!this.s.gt(new n("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))},u.prototype.hasDefinedHashtype=function(){if(!s.isNaturalNumber(this.nhashtype))return!1;var e=31&this.nhashtype;return!(e<u.SIGHASH_ALL||e>u.SIGHASH_SINGLE)},u.prototype.toTxFormat=function(){var e=this.toDER(),t=i.alloc(1);return t.writeUInt8(this.nhashtype,0),i.concat([e,t])},u.SIGHASH_ALL=1,u.SIGHASH_NONE=2,u.SIGHASH_SINGLE=3,u.SIGHASH_FORKID=64,u.SIGHASH_ANYONECANPAY=128,u.prototype.isCanonical=function(){var e=r(4125).getN().shrn(1);return this.s.lte(e)},u.prototype.toCanonical=function(){if(this.isCanonical())return new u({r:this.r,s:this.s,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype});var e=r(4125).getN().sub(this.s);return new u({r:this.r,s:e,i:this.i,compressed:this.compressed,nhashtype:this.nhashtype})},u.prototype.validate=function(){if(!this.r||!this.s)throw new Error("Signature missing r or s component");if(this.r.isZero())throw new Error("Signature r component is zero");if(this.s.isZero())throw new Error("Signature s component is zero");var e=r(4125).getN();if(this.r.gte(e))throw new Error("Signature r component >= curve order");if(this.s.gte(e))throw new Error("Signature s component >= curve order");if(this.r.isNeg())throw new Error("Signature r component is negative");if(this.s.isNeg())throw new Error("Signature s component is negative");return!0},u.prototype.isValid=function(){try{return this.validate(),!0}catch(e){return!1}},u.prototype.applySecurityPatches=function(){var e=r(4125).getN(),t=e.shrn(1);if(this.r.isZero()||this.s.isZero())throw new Error("Invalid signature: zero r or s");if(this.r.gte(e)||this.s.gte(e))throw new Error("Invalid signature: out of range");return this.s.gt(t)&&(this.s=e.sub(this.s)),this},e.exports=u},2959(e,t,r){"use strict";var i=r(8287).Buffer;const n=r(9043),o=r(4125),a=r(1955),s=o.getN(),u=s.shrn(1);e.exports={smartVerify:function(e,t,o){if(!i.isBuffer(e)||32!==e.length)throw new Error("Invalid message hash: must be 32-byte buffer");if(!t)return!1;let c=t;if(i.isBuffer(t))try{c=r(7881).fromDER(t)}catch(e){return!1}if(!c||!c.r||!c.s)return!1;const l=n.isBN(c.r)?c.r:new n(c.r),h=n.isBN(c.s)?c.s:new n(c.s);if(l.isZero()||h.isZero())return!1;if(l.gte(s)||h.gte(s))return!1;let f=h;h.gt(u)&&(f=s.sub(h));const p=new(r(7881))({r:l,s:f});return a.verify(e,p,o)},isCanonical:function(e){if(!e)return!1;let t=e;if(i.isBuffer(e))try{t=r(7881).fromDER(e)}catch(e){return!1}return!(!t||!t.s)&&(n.isBN(t.s)?t.s:new n(t.s)).lte(u)},canonicalize:function(e){if(!e||!e.r||!e.s)throw new Error("Invalid signature object");const t=n.isBN(e.r)?e.r:new n(e.r),r=n.isBN(e.s)?e.s:new n(e.s);let i=r;return r.gt(u)&&(i=s.sub(r)),{r:t,s:i}},constants:{n:s,nh:u}}},1113(e,t,r){var i=r(8287).Buffer;const n=r(8722);class o{static createSignature(e,t,r,o,a,s=null){s=s||n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_FORKID;const u=n.Transaction.sighash.sign(e,t,s,r,o,new n.crypto.BN(a));return i.concat([u.toDER(),i.from([s])])}static createMultisigScript(e,t){let r=(new n.Script).add(n.Opcode[`OP_${e}`]);for(const e of t)r=r.add(e.toBuffer());return r.add(n.Opcode[`OP_${t.length}`]).add(n.Opcode.OP_CHECKMULTISIG)}static createMultisigUnlocking(e){let t=(new n.Script).add(n.Opcode.OP_0);for(const r of e)t=t.add(r);return t}static createTimelockScript(e,t){const r=i.from(e.toString(16).padStart(8,"0"),"hex").reverse();return(new n.Script).add(r).add(n.Opcode.OP_CHECKLOCKTIMEVERIFY).add(n.Opcode.OP_DROP).add(t.toBuffer())}static createConditionalScript(e,t=null){let r=(new n.Script).add(n.Opcode.OP_IF).add(e.toBuffer());return t&&(r=r.add(n.Opcode.OP_ELSE).add(t.toBuffer())),r.add(n.Opcode.OP_ENDIF)}static createP2PKHScript(e){return(new n.Script).add(n.Opcode.OP_DUP).add(n.Opcode.OP_HASH160).add(e.toAddress().hashBuffer).add(n.Opcode.OP_EQUALVERIFY).add(n.Opcode.OP_CHECKSIG)}static createP2PKHUnlocking(e,t){return(new n.Script).add(e).add(t.toBuffer())}static getPreimage(e,t,r,i,o=null){return o=o||n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_FORKID,n.Transaction.sighash.sighash(e,o,t,r,new n.crypto.BN(i))}static createDataScript(e){return"string"==typeof e&&(e=i.from(e,"utf8")),(new n.Script).add(e)}static createOpReturnScript(e){return"string"==typeof e&&(e=i.from(e,"utf8")),(new n.Script).add(n.Opcode.OP_FALSE).add(n.Opcode.OP_RETURN).add(e)}static validateTransaction(e){try{return e.verify()}catch(e){return console.error("Transaction validation error:",e.message),!1}}static validateScript(e,t,r,i){try{return(new n.Script.Interpreter).verify(e,t,r,i,n.Script.Interpreter.SCRIPT_VERIFY_P2SH|n.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|n.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID|n.Script.Interpreter.SCRIPT_ENABLE_MAGNETIC_OPCODES|n.Script.Interpreter.SCRIPT_ENABLE_MONOLITH_OPCODES)}catch(e){return console.error("Script validation error:",e.message),!1}}static createLowFeeTransaction(e,t,r=10){let i=(new n.Transaction).feePerKb(r);for(const t of e)i=i.from(t);for(const e of t)i=i.to(e.address,e.satoshis);return i}}o.SIGHASH_ALL=n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_FORKID,o.SIGHASH_NONE=n.crypto.Signature.SIGHASH_NONE|n.crypto.Signature.SIGHASH_FORKID,o.SIGHASH_SINGLE=n.crypto.Signature.SIGHASH_SINGLE|n.crypto.Signature.SIGHASH_FORKID,e.exports=o},3967(e,t,r){"use strict";var i=r(9550);e.exports={generateIssuerKeys:async function(e){var t,r=(e=e||{}).alg||"ES256",n=e.kid||"key-"+Date.now();if("ES256"!==r&&"ES256K"!==r)throw new Error("Invalid algorithm. Must be ES256 or ES256K");t="ES256"===r?i.generateKeyPairSync("ec",{namedCurve:"P-256",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}}):i.generateKeyPairSync("ec",{namedCurve:"secp256k1",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});var o=i.createPublicKey(t.publicKey).export({format:"jwk"}),a=i.createPrivateKey(t.privateKey).export({format:"jwk"});return o.kid=n,o.alg=r,o.use="sig",o.kty="EC",a.kid=n,a.alg=r,a.use="sig",a.kty="EC",{privateJwk:a,publicJwk:o,kid:n,alg:r}},buildDidWebDocuments:function(e){if(!e.domain)throw new Error("domain is required");var t="did:web:"+e.domain.replace(/:/g,"%3A"),r=[],i=[];if(e.p256){var n={id:t+"#"+e.p256.kid,type:"JsonWebKey2020",controller:t,publicKeyJwk:e.p256.jwk};r.push(n),i.push(e.p256.jwk)}if(e.k1){var o={id:t+"#"+e.k1.kid,type:"JsonWebKey2020",controller:t,publicKeyJwk:e.k1.jwk};r.push(o),i.push(e.k1.jwk)}if(0===r.length)throw new Error("At least one key (p256 or k1) must be provided");var a={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:t,verificationMethod:r,authentication:r.map(function(e){return e.id}),assertionMethod:r.map(function(e){return e.id})};return e.controllerName&&(a.controller=e.controllerName),{did:t,didDocument:a,jwks:{keys:i}}},rotateIssuerKey:function(e){if(!e.domain||!e.newKey)throw new Error("domain and newKey are required");var t="did:web:"+e.domain.replace(/:/g,"%3A"),r=e.keepOldForDays||30,i={id:t+"#"+e.newKey.kid,type:"JsonWebKey2020",controller:t,publicKeyJwk:e.newKey.jwk};return{didDocument:{"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/jws-2020/v1"],id:t,verificationMethod:[i],authentication:[i.id],assertionMethod:[i.id],rotationInfo:{rotatedAt:(new Date).toISOString(),gracePeriodDays:r}},jwks:{keys:[e.newKey.jwk]}}}}},9719(e,t,r){"use strict";var i=r(8287).Buffer,{secp256k1:n}=r(4554),{sha512:o,sha256:a}=r(8087),{hmac:s}=r(7474),{cbc:u}=r(2405),c=r(5237),l=c.PublicKey,h=c.util.preconditions,f=c.crypto.Random;function p(e){return i.from(e.buffer,e.byteOffset,e.byteLength)}function d(e,t){return p(s(a,e,t))}var g=function(){};g.encrypt=function(e,t,r){h.checkArgument(e),h.checkArgument(t),h.checkArgument(r),r=r||f.getRandomBuffer(16);var n=u(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e));return i.concat([i.from(r),p(n)])},g.decrypt=function(e,t){h.checkArgument(e),h.checkArgument(t);var r=e.slice(0,16),i=e.slice(16);return p(u(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(i)))};var m=function e(t){if(!(this instanceof e))return new e;this.opts=t||{}};m.prototype.privateKey=function(e){return h.checkArgument(e,"no private key provided"),this._privateKey=e||null,this},m.prototype.publicKey=function(e){return h.checkArgument(e,"no public key provided"),this._publicKey=e||null,this};var y=function(e,t){var r="_"+e;Object.defineProperty(m.prototype,e,{configurable:!1,enumerable:!0,get:function(){var e=this[r];return e||(e=this[r]=t.apply(this)),e}})};y("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return p(n.getPublicKey(Uint8Array.from(e),!0))}),y("kEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=n.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0).slice(1);return p(o(r))}),y("kE",function(){return this.kEkM.slice(0,32)}),y("kM",function(){return this.kEkM.slice(32,64)}),m.prototype.encrypt=function(e,t){i.isBuffer(e)||(e=i.from(e)),void 0===t&&(t=d(this._privateKey.toBuffer(),e).slice(0,16));var r=g.encrypt(e,this.kE,t),n=d(this.kM,r);return this.opts.shortTag&&(n=n.slice(0,4)),this.opts.noKey?i.concat([r,n]):i.concat([this.Rbuf,r,n])},m.prototype.decrypt=function(e){h.checkArgument(e);var t=0,r=this.opts.shortTag?4:32;if(!this.opts.noKey){var i;switch(e[0]){case 4:i=e.slice(0,65);break;case 3:case 2:i=e.slice(0,33);break;default:throw new Error("Invalid type: "+e[0])}this._publicKey=l.fromDER(i),t+=i.length}var n=e.slice(t,e.length-r),o=e.slice(e.length-r,e.length),a=d(this.kM,n);if(this.opts.shortTag&&(a=a.slice(0,4)),!function(e,t){if(e.length!==t.length)return!1;for(var r=0,i=0;i<e.length;i++)r|=e[i]^t[i];return 0===r}(o,a))throw new Error("Invalid checksum");return g.decrypt(n,this.kE)},e.exports=m},4354(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.PublicKey,a=n.PrivateKey,s=n.util.preconditions,u=r(9719),c=r(8318),{secp256k1:l}=r(4554),{sha512:h,sha256:f}=r(8087),{hmac:p}=r(7474),{cbc:d}=r(2405);function g(e){return i.from(e.buffer,e.byteOffset,e.byteLength)}function m(e,t){return g(p(f,t,e))}var y=function(){};y.encrypt=function(e,t,r){return s.checkArgument(e),s.checkArgument(t),s.checkArgument(r),s.checkArgument(16===t.length,"keybuf length must be 16"),s.checkArgument(16===r.length,"ivbuf length must be 16"),g(d(Uint8Array.from(t),Uint8Array.from(r)).encrypt(Uint8Array.from(e)))},y.decrypt=function(e,t,r){return s.checkArgument(e),s.checkArgument(t),s.checkArgument(r),s.checkArgument(16===t.length,"keybuf length must be 16"),s.checkArgument(16===r.length,"ivbuf length must be 16"),g(d(Uint8Array.from(t),Uint8Array.from(r)).decrypt(Uint8Array.from(e)))};var v=function e(t,r="BIE1"){if("BIE1"!==r)throw new c.UnsupportAlgorithm(r);if(!(this instanceof e))return new e(t,r);this._privateKey=new n.PrivateKey,this.opts=t||{},this.opts.ephemeralKey=!0};v.prototype.privateKey=function(e){return s.checkArgument(a.isValid(e),"no private key provided"),this._privateKey=a(e.toHex())||null,this.opts.ephemeralKey=!1,this},v.prototype.publicKey=function(e){return s.checkArgument(o.isValid(e),"no public key provided"),this._publicKey=o(e.toString())||null,null!=this._publicKey&&(this.opts.fixedPublicKey=!0),this};var b=function(e,t){var r="_"+e;Object.defineProperty(v.prototype,e,{configurable:!1,enumerable:!0,get:function(){this[r];return this[r]=t.apply(this)}})};b("Rbuf",function(){var e=this._privateKey.bn.toBuffer({size:32});return g(l.getPublicKey(Uint8Array.from(e),!0))}),b("ivkEkM",function(){var e=this._privateKey.bn.toBuffer({size:32}),t=this._publicKey.toDER(),r=l.getSharedSecret(Uint8Array.from(e),Uint8Array.from(t),!0);return g(h(r))}),b("iv",function(){return this.ivkEkM.slice(0,16)}),b("kE",function(){return this.ivkEkM.slice(16,32)}),b("kM",function(){return this.ivkEkM.slice(32,64)}),v.prototype.encrypt=function(e){i.isBuffer(e)||(e=i.from(e));var t,r=y.encrypt(e,this.kE,this.iv),n=i.from("BIE1"),o=m(t=this.opts.noKey&&!this.opts.ephemeralKey?i.concat([n,r]):i.concat([n,this.Rbuf,r]),this.kM);return this.opts.shortTag&&(o=o.slice(0,4)),i.concat([t,o])},v.prototype.decrypt=function(e){s.checkArgument(i.isBuffer(e),"ciphetext must be a buffer");var t=this.opts.shortTag?4:32,r=4;if(!e.slice(0,4).equals(i.from("BIE1")))throw new c.DecryptionError("Invalid Magic");if(!this.opts.noKey){var n=e.slice(4,37);this.opts.fixedPublicKey?console.log('Notice: Overriding PublicKey in message. Consider use "noKey" option if you are not sending message to electrum and do not want to use ephemeral key'):this._publicKey=o.fromDER(n),r=37}var a=e.slice(r,e.length-t),u=e.slice(e.length-t,e.length),l=m(e.slice(0,e.length-t),this.kM);if(this.opts.shortTag&&(l=l.slice(0,4)),u.length!==l.length)throw new c.DecryptionError("Invalid checksum");for(var h=0,f=0;f<l.length;f++)h|=u[f]^l[f];if(0!==h)throw new c.DecryptionError("Invalid checksum");return y.decrypt(a,this.kE,this.iv)},v.bitcoreECIES=u,e.exports=v},8318(e,t,r){"use strict";e.exports=r(5237).errors.extend({name:"ECIES",message:"Internal Error on bsv-ecies Module {0}",errors:[{name:"DecryptionError",message:"Invalid Message: {0}"},{name:"UnsupportAlgorithm",message:"Unsupport Algorithm: {0}"}]})},2729(e,t,r){e.exports=r(4354)},9375(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6763),a=r(8287),s="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),u=function e(t){if(!(this instanceof e))return new e(t);if(i.isBuffer(t)){var r=t;this.fromBuffer(r)}else if("string"==typeof t){var n=t;this.fromString(n)}};u.validCharacters=function(e){return a.Buffer.isBuffer(e)&&(e=e.toString()),n.every(n.map(e,function(e){return n.includes(s,e)}))},u.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this},u.encode=function(e){if(!a.Buffer.isBuffer(e))throw new Error("Input should be a buffer");return o.encode(e)},u.decode=function(e){if("string"!=typeof e)throw new Error("Input should be a string");return i.from(o.decode(e))},u.prototype.fromBuffer=function(e){return this.buf=e,this},u.fromBuffer=function(e){return(new u).fromBuffer(e)},u.fromHex=function(e){return u.fromBuffer(i.from(e,"hex"))},u.prototype.fromString=function(e){var t=u.decode(e);return this.buf=t,this},u.fromString=function(e){return(new u).fromString(e)},u.prototype.toBuffer=function(){return this.buf},u.prototype.toHex=function(){return this.toBuffer().toString("hex")},u.prototype.toString=function(){return u.encode(this.buf)},e.exports=u},9047(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(9375),a=r(8287),s=r(5067).sha256sha256,u=function e(t){if(!(this instanceof e))return new e(t);if(i.isBuffer(t)){var r=t;this.fromBuffer(r)}else if("string"==typeof t){var n=t;this.fromString(n)}};u.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this},u.validChecksum=function(e,t){return n.isString(e)&&(e=a.Buffer.from(o.decode(e))),n.isString(t)&&(t=a.Buffer.from(o.decode(t))),t||(t=e.slice(-4),e=e.slice(0,-4)),u.checksum(e).toString("hex")===t.toString("hex")},u.decode=function(e){if("string"!=typeof e)throw new Error("Input must be a string");var t=i.from(o.decode(e));if(t.length<4)throw new Error("Input string too short");var r=t.slice(0,-4),n=t.slice(-4),a=s(r).slice(0,4);if(n.toString("hex")!==a.toString("hex"))throw new Error("Checksum mismatch");return r},u.checksum=function(e){return s(e).slice(0,4)},u.encode=function(e){if(!i.isBuffer(e))throw new Error("Input must be a buffer");var t=i.alloc(e.length+4),r=u.checksum(e);return e.copy(t),r.copy(t,e.length),o.encode(t)},u.prototype.fromBuffer=function(e){return this.buf=e,this},u.fromBuffer=function(e){return(new u).fromBuffer(e)},u.fromHex=function(e){return u.fromBuffer(i.from(e,"hex"))},u.prototype.fromString=function(e){var t=u.decode(e);return this.buf=t,this},u.fromString=function(e){var t=u.decode(e);return new o(t)},u.prototype.toBuffer=function(){return this.buf},u.prototype.toHex=function(){return this.toBuffer().toString("hex")},u.prototype.toString=function(){return u.encode(this.buf)},e.exports=u},7798(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(9043),s=function e(t){if(!(this instanceof e))return new e(t);if(!n.isUndefined(t))if(i.isBuffer(t))this.set({buf:t});else if(n.isString(t)){var r=i.from(t,"hex");if(2*r.length!==t.length)throw new TypeError("Invalid hex string");this.set({buf:r})}else{if(!n.isObject(t))throw new TypeError("Unrecognized argument for BufferReader");var o=t;this.set(o)}};s.prototype.set=function(e){return this.buf=e.buf||this.buf||void 0,this.pos=e.pos||this.pos||0,this},s.prototype.eof=function(){return this.pos>=this.buf.length},s.prototype.finished=s.prototype.eof,s.prototype.read=function(e){o.checkArgument(!n.isUndefined(e),"Must specify a length");var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,t},s.prototype.readAll=function(){var e=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,e},s.prototype.readUInt8=function(){var e=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,e},s.prototype.readUInt16BE=function(){var e=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,e},s.prototype.readUInt16LE=function(){var e=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,e},s.prototype.readUInt32BE=function(){var e=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,e},s.prototype.readUInt32LE=function(){var e=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,e},s.prototype.readInt32LE=function(){var e=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,e},s.prototype.readUInt64BEBN=function(){var e=this.buf.slice(this.pos,this.pos+8),t=a.fromBuffer(e);return this.pos=this.pos+8,t},s.prototype.readUInt64LEBN=function(){var e,t=this.buf.readUInt32LE(this.pos),r=4294967296*this.buf.readUInt32LE(this.pos+4)+t;if(r<=9007199254740991)e=new a(r);else{var i=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);e=new a(i,10,"le")}return this.pos=this.pos+8,e},s.prototype.readVarintNum=function(){var e=this.readUInt8();switch(e){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var t=this.readUInt64LEBN().toNumber();if(t<=Math.pow(2,53))return t;throw new Error("number too large to retain precision - use readVarintBN");default:return e}},s.prototype.readVarLengthBuffer=function(){var e=this.readVarintNum(),t=this.read(e);return o.checkState(t.length===e,"Invalid length while reading varlength buffer. Expected to read: "+e+" and read "+t.length),t},s.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},s.prototype.readVarintBN=function(){var e=this.readUInt8();switch(e){case 253:return new a(this.readUInt16LE());case 254:return new a(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new a(e)}},s.prototype.reverse=function(){for(var e=i.alloc(this.buf.length),t=0;t<e.length;t++)e[t]=this.buf[this.buf.length-1-t];return this.buf=e,this},s.prototype.readReverse=function(e){n.isUndefined(e)&&(e=this.buf.length);var t=this.buf.slice(this.pos,this.pos+e);return this.pos=this.pos+e,i.from(t).reverse()},e.exports=s},5750(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4148),o=function e(t){if(!(this instanceof e))return new e(t);this.bufLen=0,t?this.set(t):this.bufs=[]};o.prototype.set=function(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(function(e,t){return e+t.length},0),this},o.prototype.toBuffer=function(){return this.concat()},o.prototype.concat=function(){return i.concat(this.bufs,this.bufLen)},o.prototype.write=function(e){return n(i.isBuffer(e)),this.bufs.push(e),this.bufLen+=e.length,this},o.prototype.writeReverse=function(e){return n(i.isBuffer(e)),this.bufs.push(i.from(e).reverse()),this.bufLen+=e.length,this},o.prototype.writeUInt8=function(e){var t=i.alloc(1);return t.writeUInt8(e,0),this.write(t),this},o.prototype.writeUInt16BE=function(e){var t=i.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this},o.prototype.writeUInt16LE=function(e){var t=i.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this},o.prototype.writeUInt32BE=function(e){var t=i.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this},o.prototype.writeInt32LE=function(e){var t=i.alloc(4);return t.writeInt32LE(e,0),this.write(t),this},o.prototype.writeUInt32LE=function(e){var t=i.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this},o.prototype.writeUInt64BEBN=function(e){var t=e.toBuffer({size:8});return this.write(t),this},o.prototype.writeUInt64LEBN=function(e){var t=e.toBuffer({size:8});return this.writeReverse(t),this},o.prototype.writeVarintNum=function(e){var t=o.varintBufNum(e);return this.write(t),this},o.prototype.writeVarintBN=function(e){var t=o.varintBufBN(e);return this.write(t),this},o.varintBufNum=function(e){var t;return e<253?(t=i.alloc(1)).writeUInt8(e,0):e<65536?((t=i.alloc(3)).writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?((t=i.alloc(5)).writeUInt8(254,0),t.writeUInt32LE(e,1)):((t=i.alloc(9)).writeUInt8(255,0),t.writeInt32LE(-1&e,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t},o.varintBufBN=function(e){var t,r=e.toNumber();if(r<253)(t=i.alloc(1)).writeUInt8(r,0);else if(r<65536)(t=i.alloc(3)).writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)(t=i.alloc(5)).writeUInt8(254,0),t.writeUInt32LE(r,1);else{var n=new o;n.writeUInt8(255),n.writeUInt64LEBN(e),t=n.concat()}return t},e.exports=o},3173(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5750),o=r(7798),a=r(9043),s=function e(t){if(!(this instanceof e))return new e(t);if(i.isBuffer(t))this.buf=t;else if("number"==typeof t){var r=t;this.fromNumber(r)}else if(t instanceof a){var n=t;this.fromBN(n)}else if(t){var o=t;this.set(o)}};s.prototype.set=function(e){return this.buf=e.buf||this.buf,this},s.prototype.fromString=function(e){return this.set({buf:i.from(e,"hex")}),this},s.prototype.toString=function(){return this.buf.toString("hex")},s.prototype.fromBuffer=function(e){return this.buf=e,this},s.prototype.fromBufferReader=function(e){return this.buf=e.readVarintBuf(),this},s.prototype.fromBN=function(e){return this.buf=n().writeVarintBN(e).concat(),this},s.prototype.fromNumber=function(e){return this.buf=n().writeVarintNum(e).concat(),this},s.prototype.toBuffer=function(){return this.buf},s.prototype.toBN=function(){return o(this.buf).readVarintBN()},s.prototype.toNumber=function(){return o(this.buf).readVarintNum()},e.exports=s},3649(e,t,r){"use strict";var i=r(4799);var n=function(e,t){var r=function(){if(i.isString(t.message))this.message=(e=t.message,r=arguments,e.replace("{0}",r[0]).replace("{1}",r[1]).replace("{2}",r[2]));else{if(!i.isFunction(t.message))throw new Error("Invalid error definition for "+t.name);this.message=t.message.apply(null,arguments)}var e,r;this.stack=this.message+"\n"+(new Error).stack};return(r.prototype=Object.create(e.prototype)).name=e.prototype.name+t.name,e[t.name]=r,t.errors&&o(r,t.errors),r},o=function(e,t){i.each(t,function(t){n(e,t)})},a={Error:function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack}};a.Error.prototype=Object.create(Error.prototype),a.Error.prototype.name="bsv.Error";var s,u=r(5486);s=a.Error,o(s,u),e.exports=a.Error,e.exports.extend=function(e){return n(a.Error,e)}},5486(e){"use strict";e.exports=[{name:"InvalidB58Char",message:"Invalid Base58 character: {0} in {1}"},{name:"InvalidB58Checksum",message:"Invalid Base58 checksum for {0}"},{name:"InvalidNetwork",message:"Invalid version for network: got {0}"},{name:"InvalidState",message:"Invalid state: {0}"},{name:"NotImplemented",message:"Function {0} was not implemented yet"},{name:"InvalidNetworkArgument",message:'Invalid network: must be "livenet" or "testnet", got {0}'},{name:"InvalidArgument",message:function(){return"Invalid Argument"+(arguments[0]?": "+arguments[0]:"")+(arguments[1]?" Documentation: https://docs.moneybutton.com/"+arguments[1]:"")}},{name:"AbstractMethodInvoked",message:"Abstract Method Invocation: {0}"},{name:"InvalidArgumentType",message:function(){return"Invalid Argument for "+arguments[2]+", expected "+arguments[1]+" but got "+typeof arguments[0]}},{name:"Unit",message:"Internal Error on Unit {0}",errors:[{name:"UnknownCode",message:"Unrecognized unit code: {0}"},{name:"InvalidRate",message:"Invalid exchange rate: {0}"}]},{name:"MerkleBlock",message:"Internal Error on MerkleBlock {0}",errors:[{name:"InvalidMerkleTree",message:"This MerkleBlock contain an invalid Merkle Tree"}]},{name:"Transaction",message:"Internal Error on Transaction {0}",errors:[{name:"Input",message:"Internal Error on Input {0}",errors:[{name:"MissingScript",message:"Need a script to create an input"},{name:"UnsupportedScript",message:"Unsupported input script type: {0}"},{name:"MissingPreviousOutput",message:"No previous output information."}]},{name:"NeedMoreInfo",message:"{0}"},{name:"InvalidSorting",message:"The sorting function provided did not return the change output as one of the array elements"},{name:"InvalidOutputAmountSum",message:"{0}"},{name:"MissingSignatures",message:"Some inputs have not been fully signed"},{name:"InvalidIndex",message:"Invalid index: {0} is not between 0, {1}"},{name:"UnableToVerifySignature",message:"Unable to verify signature: {0}"},{name:"DustOutputs",message:"Dust amount detected in one output"},{name:"InvalidSatoshis",message:"Output satoshis are invalid"},{name:"FeeError",message:"Internal Error on Fee {0}",errors:[{name:"TooSmall",message:"Fee is too small: {0}"},{name:"TooLarge",message:"Fee is too large: {0}"},{name:"Different",message:"Unspent value is different from specified fee: {0}"}]},{name:"ChangeAddressMissing",message:"Change address is missing"},{name:"BlockHeightTooHigh",message:"Block Height can be at most 2^32 -1"},{name:"NLockTimeOutOfRange",message:"Block Height can only be between 0 and 499 999 999"},{name:"LockTimeTooEarly",message:"Lock Time can't be earlier than UNIX date 500 000 000"}]},{name:"Script",message:"Internal Error on Script {0}",errors:[{name:"UnrecognizedAddress",message:"Expected argument {0} to be an address"},{name:"CantDeriveAddress",message:"Can't derive address associated with script {0}, needs to be p2pkh in, p2pkh out, p2sh in, or p2sh out."},{name:"InvalidBuffer",message:"Invalid script buffer: can't parse valid script from given buffer {0}"}]},{name:"HDPrivateKey",message:"Internal Error on HDPrivateKey {0}",errors:[{name:"InvalidDerivationArgument",message:"Invalid derivation argument {0}, expected string, or number and boolean"},{name:"InvalidEntropyArgument",message:"Invalid entropy: must be an hexa string or binary buffer, got {0}",errors:[{name:"TooMuchEntropy",message:'Invalid entropy: more than 512 bits is non standard, got "{0}"'},{name:"NotEnoughEntropy",message:'Invalid entropy: at least 128 bits needed, got "{0}"'}]},{name:"InvalidLength",message:"Invalid length for xprivkey string in {0}"},{name:"InvalidPath",message:"Invalid derivation path: {0}"},{name:"UnrecognizedArgument",message:'Invalid argument: creating a HDPrivateKey requires a string, buffer, json or object, got "{0}"'}]},{name:"HDPublicKey",message:"Internal Error on HDPublicKey {0}",errors:[{name:"ArgumentIsPrivateExtended",message:"Argument is an extended private key: {0}"},{name:"InvalidDerivationArgument",message:"Invalid derivation argument: got {0}"},{name:"InvalidLength",message:'Invalid length for xpubkey: got "{0}"'},{name:"InvalidPath",message:'Invalid derivation path, it should look like: "m/1/100", got "{0}"'},{name:"InvalidIndexCantDeriveHardened",message:"Invalid argument: creating a hardened path requires an HDPrivateKey"},{name:"MustSupplyArgument",message:"Must supply an argument to create a HDPublicKey"},{name:"UnrecognizedArgument",message:"Invalid argument for creation, must be string, json, buffer, or object"}]}]},9439(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(7082),a=n.PrivateKey,s=n.crypto.Hash,u=n.crypto.ECDSA,c=(n.crypto.Signature,n.util.preconditions);r(4799);function l(e,t){return this instanceof l?("string"==typeof e&&(e=a.fromWIF(e)),c.checkArgument(e instanceof a,"Invalid private key"),this.privateKey=e,this.publicKey=e.toPublicKey(),this.options=t||{},this.did=o.fromPrivateKey(e,this.options),this):new l(e,t)}l._sortValue=function(e){return Array.isArray(e)?e.map(function(e){return l._sortValue(e)}):null!==e&&"object"==typeof e?Object.keys(e).sort().reduce(function(t,r){return t[r]=l._sortValue(e[r]),t},{}):e},l._canonicalizeJSON=function(e){return JSON.stringify(l._sortValue(e))},l._hashCredential=function(e){var t=l._canonicalizeJSON(e);return s.sha256(i.from(t,"utf8"))},l.prototype.createCredential=function(e,t){t=t||{},c.checkArgument(e&&"object"==typeof e,"Invalid credential subject");var r=(new Date).toISOString(),i={"@context":["https://www.w3.org/2018/credentials/v1"],id:t.id||"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential"],issuer:this.did,issuanceDate:r,credentialSubject:e};return t.type&&(Array.isArray(t.type)?i.type=i.type.concat(t.type):i.type.push(t.type)),t.context&&(Array.isArray(t.context)?i["@context"]=i["@context"].concat(t.context):i["@context"].push(t.context)),t.expirationDate&&(i.expirationDate=t.expirationDate),t.termsOfUse&&(i.termsOfUse=t.termsOfUse),t.evidence&&(i.evidence=t.evidence),t.refreshService&&(i.refreshService=t.refreshService),i},l.prototype.signCredential=function(e,t){t=t||{},c.checkArgument(e&&"object"==typeof e,"Invalid credential");var r=JSON.parse(JSON.stringify(e));delete r.proof;var i=l._hashCredential(r),n=new u;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:(new Date).toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:t.proofPurpose||"assertionMethod",jws:a};t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain);var h=JSON.parse(JSON.stringify(r));return h.proof=s,h.rootHash=i.toString("hex"),h},l.prototype._createJWSSignature=function(e,t){var r=i.from(JSON.stringify({alg:"ES256K",typ:"JWT"})).toString("base64url");e.toString("base64url");return r+".."+t.toDER().toString("base64url")},l.prototype.createEmailCredential=function(e,t){t=t||{},c.checkArgument("string"==typeof e&&e.includes("@"),"Invalid email address");var r={id:t.subjectId||"did:smartledger:"+s.sha256(i.from(e)).toString("hex"),email:e,verified:!0,verificationMethod:"email_verification",verificationTimestamp:(new Date).toISOString()},n={type:"EmailVerifiedCredential",context:"https://smartledger.technology/contexts/email/v1",...t},o=this.createCredential(r,n);return this.signCredential(o,t)},l.prototype.createAgeCredential=function(e,t,r){r=r||{},c.checkArgument("number"==typeof e&&e>0,"Invalid age");var n={id:r.subjectId||"urn:uuid:"+this._generateUUID(),ageOver:e,verified:!0,verificationMethod:"age_verification"};t&&(n.birthDateHash=s.sha256(i.from(t.toISOString())).toString("hex"));var o={type:"AgeVerifiedCredential",context:"https://smartledger.technology/contexts/age/v1",...r},a=this.createCredential(n,o);return this.signCredential(a,r)},l.prototype.createKYCCredential=function(e,t){t=t||{},c.checkArgument(e&&"object"==typeof e,"Invalid KYC data");var r={id:t.subjectId||"urn:uuid:"+this._generateUUID(),kycLevel:e.level||"basic",verified:!0,verificationMethod:"kyc_verification",verificationTimestamp:(new Date).toISOString(),verifyingAuthority:e.authority||this.did};e.firstName&&(r.firstNameHash=s.sha256(i.from(e.firstName)).toString("hex")),e.lastName&&(r.lastNameHash=s.sha256(i.from(e.lastName)).toString("hex")),e.ssn&&(r.ssnHash=s.sha256(i.from(e.ssn)).toString("hex"));var n={type:"KYCVerifiedCredential",context:"https://smartledger.technology/contexts/kyc/v1",...t},o=this.createCredential(r,n);return this.signCredential(o,t)},l.prototype.createOrganizationCredential=function(e,t){t=t||{},c.checkArgument(e&&"object"==typeof e,"Invalid organization data");var r={id:t.subjectId||"did:smartledger:org:"+s.sha256(i.from(e.name||"")).toString("hex"),name:e.name,type:e.type||"Organization",verified:!0,verificationMethod:"organization_verification",verificationTimestamp:(new Date).toISOString()};e.taxId&&(r.taxIdHash=s.sha256(i.from(e.taxId)).toString("hex")),e.incorporationState&&(r.incorporationState=e.incorporationState),e.industry&&(r.industry=e.industry);var n={type:"OrganizationCredential",context:"https://smartledger.technology/contexts/organization/v1",...t},o=this.createCredential(r,n);return this.signCredential(o,t)},l.prototype._generateUUID=function(){var e=n.crypto.Random.getRandomBuffer(16);e[6]=15&e[6]|64,e[8]=63&e[8]|128;var t=e.toString("hex");return[t.substring(0,8),t.substring(8,12),t.substring(12,16),t.substring(16,20),t.substring(20,32)].join("-")},l.prototype.createPresentation=function(e,t){t=t||{},c.checkArgument(Array.isArray(e),"Credentials must be an array");var r={"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],id:t.id||"urn:uuid:"+this._generateUUID(),holder:this.did,verifiableCredential:e};t.context&&(Array.isArray(t.context)?r["@context"]=r["@context"].concat(t.context):r["@context"].push(t.context));var i=l._hashCredential(r),n=new u;n.hashbuf=i,n.privkey=this.privateKey,n.pubkey=this.publicKey,n.sign();var o=n.sig,a=this._createJWSSignature(i,o),s={type:"EcdsaSecp256k1Signature2019",created:(new Date).toISOString(),verificationMethod:this.did+"#keys-1",proofPurpose:"authentication",jws:a};return t.challenge&&(s.challenge=t.challenge),t.domain&&(s.domain=t.domain),r.proof=s,r},l.prototype.getIssuerInfo=function(){return{did:this.did,publicKey:this.publicKey.toString("hex"),verificationMethod:this.did+"#keys-1"}},e.exports=l},7275(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(7082),a=r(9439),s=(n.PublicKey,n.crypto.Hash,n.crypto.ECDSA),u=n.crypto.Signature,c=n.util.preconditions;function l(e){return this instanceof l?(this.options=e||{},this.trustedIssuers=this.options.trustedIssuers||[],this):new l(e)}l.verifyCredential=async function(e,t){t=t||{};try{c.checkArgument(e&&"object"==typeof e,"Invalid credential");var r={valid:!1,errors:[],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}},i=l._validateStructure(e);r.checks.structure=i.valid,i.valid||(r.errors=r.errors.concat(i.errors));var n=await l._verifySignature(e);r.checks.signature=n.valid,n.valid?(r.issuerDID=n.issuerDID,r.verificationMethod=n.verificationMethod):r.errors=r.errors.concat(n.errors);var o=await l._validateIssuer(e,t);r.checks.issuer=o.valid,o.valid||(r.errors=r.errors.concat(o.errors)),o.warnings&&(r.warnings=r.warnings.concat(o.warnings));var a=l._validateTemporal(e);if(r.checks.temporal=a.valid,a.valid||(r.errors=r.errors.concat(a.errors)),a.warnings&&(r.warnings=r.warnings.concat(a.warnings)),t.schema){var s=l._validateSchema(e,t.schema);r.checks.schema=s.valid,s.valid||(r.errors=r.errors.concat(s.errors))}else r.checks.schema=!0;return r.valid=Object.values(r.checks).every(e=>!0===e),r}catch(e){return{valid:!1,errors:["Verification failed: "+e.message],warnings:[],checks:{structure:!1,signature:!1,issuer:!1,temporal:!1,schema:!1}}}},l.verifyPresentation=async function(e,t){t=t||{};try{c.checkArgument(e&&"object"==typeof e,"Invalid presentation");var r={valid:!1,errors:[],warnings:[],credentialResults:[],presentationValid:!1};if(!e.type||!e.type.includes("VerifiablePresentation"))return r.errors.push("Invalid presentation type"),r;if(!e.holder)return r.errors.push("Missing presentation holder"),r;var i=await l._verifyPresentationSignature(e);if(r.presentationValid=i.valid,i.valid||(r.errors=r.errors.concat(i.errors)),e.verifiableCredential&&Array.isArray(e.verifiableCredential))for(var n=0;n<e.verifiableCredential.length;n++){var o=e.verifiableCredential[n],a=await l.verifyCredential(o,t);r.credentialResults.push({index:n,result:a}),a.valid||r.errors.push("Credential "+n+" is invalid")}var s=r.credentialResults.every(e=>e.result.valid);return r.valid=r.presentationValid&&s,r}catch(e){return{valid:!1,errors:["Presentation verification failed: "+e.message],warnings:[],credentialResults:[],presentationValid:!1}}},l._validateStructure=function(e){var t=[];return e["@context"]?Array.isArray(e["@context"])?e["@context"].includes("https://www.w3.org/2018/credentials/v1")||t.push("Missing required W3C credentials context"):t.push("@context must be an array"):t.push("Missing @context"),e.type?Array.isArray(e.type)?e.type.includes("VerifiableCredential")||t.push("Must include VerifiableCredential type"):t.push("type must be an array"):t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof"),{valid:0===t.length,errors:t}},l._normalizeDID=function(e){var t=e&&"object"==typeof e?e.id:e;return"string"!=typeof t||0===t.length?null:t.split("#")[0]},l._verifySignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing proof"]};if("EcdsaSecp256k1Signature2019"!==t.type)return{valid:!1,errors:["Unsupported proof type: "+t.type]};if(!t.verificationMethod)return{valid:!1,errors:["Missing verification method"]};if(!t.jws)return{valid:!1,errors:["Missing JWS signature"]};var r=t.verificationMethod,i=r.split("#")[0],n=l._normalizeDID(e.issuer);if(!n)return{valid:!1,errors:["Missing or invalid credential issuer"]};if(n!==i)return{valid:!1,errors:["Verification method DID ("+i+") does not match credential issuer ("+n+")"]};var u=o.getPublicKey(i),c=JSON.parse(JSON.stringify(e));delete c.proof,delete c.rootHash;var h=a._hashCredential(c),f=l._parseJWSSignature(t.jws),p=new s;return p.hashbuf=h,p.pubkey=u,p.sig=f,p.verify().verified?{valid:!0,issuerDID:i,verificationMethod:r}:{valid:!1,errors:["Signature verification failed"]}}catch(e){return{valid:!1,errors:["Signature verification error: "+e.message]}}},l._parseJWSSignature=function(e){var t=e.split(".");if(3!==t.length)throw new Error("Invalid JWS format");var r=t[2],n=i.from(r,"base64url");return u.fromDER(n)},l._verifyPresentationSignature=async function(e){try{var t=e.proof;if(!t)return{valid:!1,errors:["Missing presentation proof"]};var r=e.holder,i=o.getPublicKey(r),n=JSON.parse(JSON.stringify(e));delete n.proof;var u=a._hashCredential(n),c=l._parseJWSSignature(t.jws),h=new s;h.hashbuf=u,h.pubkey=i,h.sig=c;var f=h.verify().verified;return{valid:f,errors:f?[]:["Presentation signature verification failed"]}}catch(e){return{valid:!1,errors:["Presentation signature error: "+e.message]}}},l._validateIssuer=async function(e,t){var r=[],i=[];try{var n=e.issuer;if(!o.isValidDID(n))return r.push("Invalid issuer DID format"),{valid:!1,errors:r};if(!(await o.resolve(n)).didDocument)return r.push("Unable to resolve issuer DID"),{valid:!1,errors:r};if(t.trustedIssuers&&Array.isArray(t.trustedIssuers)){var a=l._normalizeDID(n),s=t.trustedIssuers.map(function(e){return l._normalizeDID(e)}).filter(Boolean);if(!a||-1===s.indexOf(a))return r.push("Issuer not in trusted list"),{valid:!1,errors:r,warnings:i}}return{valid:0===r.length,errors:r,warnings:i}}catch(e){return{valid:!1,errors:["Issuer validation error: "+e.message],warnings:i}}},l._validateTemporal=function(e){var t=[],r=[],i=new Date;if(e.issuanceDate){var n=new Date(e.issuanceDate);isNaN(n.getTime())?t.push("Invalid issuanceDate format"):n>i&&t.push("Credential issued in the future")}if(e.expirationDate){var o=new Date(e.expirationDate);isNaN(o.getTime())?t.push("Invalid expirationDate format"):o<=i?t.push("Credential has expired"):o<=new Date(i.getTime()+864e5)&&r.push("Credential expires within 24 hours")}return{valid:0===t.length,errors:t,warnings:r}},l._validateSchema=function(e,t){var r=[];(t.requiredFields&&t.requiredFields.forEach(function(t){l._getNestedProperty(e,t)||r.push("Missing required field: "+t)}),t.requiredTypes)&&(t.requiredTypes.some(function(t){return e.type&&e.type.includes(t)})||r.push("Missing required credential type"));return{valid:0===r.length,errors:r}},l._getNestedProperty=function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},l.verifyCredentialHash=function(e){try{if(!e.rootHash)return!1;var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.rootHash;var r=a._hashCredential(t),n=i.from(e.rootHash,"hex");return 0===i.compare(r,n)}catch(e){return!1}},l.extractClaims=function(e){try{var t={issuer:e.issuer,subject:e.credentialSubject.id||"unknown",types:e.type||[],issuanceDate:e.issuanceDate,expirationDate:e.expirationDate,claims:{}};return Object.keys(e.credentialSubject).forEach(function(r){"id"!==r&&(t.claims[r]=e.credentialSubject[r])}),t}catch(e){return null}},l.createReport=function(e){var t=[];return t.push("=== Credential Verification Report ==="),t.push("Overall Status: "+(e.valid?"VALID":"INVALID")),t.push(""),t.push("Verification Checks:"),Object.keys(e.checks).forEach(function(r){var i=e.checks[r]?"✓":"✗";t.push(" "+i+" "+r.charAt(0).toUpperCase()+r.slice(1))}),t.push(""),e.errors.length>0&&(t.push("Errors:"),e.errors.forEach(function(e){t.push(" • "+e)}),t.push("")),e.warnings.length>0&&(t.push("Warnings:"),e.warnings.forEach(function(e){t.push(" • "+e)}),t.push("")),e.issuerDID&&t.push("Issuer: "+e.issuerDID),e.verificationMethod&&t.push("Verification Method: "+e.verificationMethod),t.join("\n")},e.exports=l},7082(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.PublicKey,a=n.PrivateKey,s=n.crypto.Hash,u=n.util.preconditions;n.errors;function c(e){return this instanceof c?(this.options=e||{},this.network=this.options.network||"mainnet",this.registry=this.options.registry||null,this):new c(e)}c.fromPublicKey=function(e,t){t=t||{},"string"==typeof e&&(e=o.fromString(e)),u.checkArgument(e instanceof o,"Invalid public key");var r=e.toString("hex"),i=t.network||"mainnet",n=t.path||"",a="did:smartledger:"+r;return"mainnet"!==i&&(a+=":"+i),n&&(a+=":"+n),a},c.fromPrivateKey=function(e,t){return"string"==typeof e&&(e=a.fromWIF(e)),u.checkArgument(e instanceof a,"Invalid private key"),c.fromPublicKey(e.toPublicKey(),t)},c.parseDID=function(e){if(u.checkArgument("string"==typeof e,"DID must be a string"),!e.startsWith("did:smartledger:"))throw new Error("Invalid SmartLedger DID format");var t=e.split(":");if(t.length<3)throw new Error("Invalid DID format");var r={method:"smartledger",identifier:t[2],network:"mainnet",path:""};return t.length>3&&""!==t[3]&&(r.network=t[3]),t.length>4&&(r.path=t.slice(4).join(":")),r},c.isValidDID=function(e){try{var t=c.parseDID(e);return!(!/^[0-9a-fA-F]{66}$/.test(t.identifier)&&!/^[0-9a-fA-F]{130}$/.test(t.identifier))&&!!["mainnet","testnet","regtest"].includes(t.network)}catch(e){return!1}},c.getPublicKey=function(e){var t=c.parseDID(e);return o.fromString(t.identifier)},c.createDocument=function(e,t){t=t||{},u.checkArgument(c.isValidDID(e),"Invalid DID");var r=e+"#keys-1",i={"@context":["https://www.w3.org/ns/did/v1","https://w3id.org/security/suites/secp256k1-2019/v1"],id:e,verificationMethod:[{id:r,type:"EcdsaSecp256k1VerificationKey2019",controller:e,publicKeyHex:c.getPublicKey(e).toString("hex")}],authentication:[r],assertionMethod:[r],keyAgreement:[r],capabilityInvocation:[r],capabilityDelegation:[r]};return t.services&&Array.isArray(t.services)&&(i.service=t.services),t.verificationMethods&&(i.verificationMethod=i.verificationMethod.concat(t.verificationMethods)),t.created&&(i.created=t.created),t.updated&&(i.updated=t.updated),i},c.resolve=async function(e,t){t=t||{};try{return u.checkArgument(c.isValidDID(e),"Invalid DID"),{"@context":"https://w3id.org/did-resolution/v1",didDocument:c.createDocument(e,t),didResolutionMetadata:{contentType:"application/did+ld+json",retrieved:(new Date).toISOString()},didDocumentMetadata:{method:{published:!0,recoveryCommitment:null,updateCommitment:null}}}}catch(e){return{"@context":"https://w3id.org/did-resolution/v1",didDocument:null,didResolutionMetadata:{error:"notFound",errorMessage:e.message},didDocumentMetadata:{}}}},c.verifyOwnership=function(e,t,r){try{var o=c.getPublicKey(e),a=s.sha256(i.isBuffer(r)?r:i.from(r,"utf8")),u=n.crypto.Signature.fromString(t),l=new n.crypto.ECDSA;return l.hashbuf=a,l.pubkey=o,l.sig=u,!0===l.verify().verified}catch(e){return!1}},c.signMessage=function(e,t){u.checkArgument(t instanceof a,"Invalid private key");var r=s.sha256(i.isBuffer(e)?e:i.from(e,"utf8")),o=new n.crypto.ECDSA;return o.hashbuf=r,o.privkey=t,o.pubkey=t.toPublicKey(),o.sign().toString()},c.createProofOfOwnership=function(e,t){u.checkArgument(e instanceof a,"Invalid private key"),u.checkArgument("string"==typeof t,"Challenge must be a string");var r=c.fromPrivateKey(e),i=(new Date).toISOString(),n=t+":"+i+":"+r;return{type:"EcdsaSecp256k1Signature2019",created:i,verificationMethod:r+"#keys-1",proofPurpose:"authentication",challenge:t,jws:c.signMessage(n,e)}},c.verifyProofOfOwnership=function(e,t){try{u.checkArgument(e&&"object"==typeof e,"Invalid proof object"),u.checkArgument("string"==typeof t,"DID must be a string");var r=e.challenge+":"+e.created+":"+t;return c.verifyOwnership(t,e.jws,r)}catch(e){return!1}},c.createDIDURL=function(e,t){return u.checkArgument("string"==typeof e,"DID must be a string"),u.checkArgument("string"==typeof t,"Fragment must be a string"),e+"#"+t},c.generateTestDID=function(e){e=e||{};var t=new a,r=c.fromPrivateKey(t,e),i=c.createDocument(r,e);return{did:r,privateKey:t.toWIF(),publicKey:t.toPublicKey().toString("hex"),document:i}},e.exports=c},8922(e,t,r){"use strict";var i=r(7082),n=r(9439),o=r(7275),a=r(7532),s=r(9306),u=r(4116);function c(e){if(!(this instanceof c))return new c(e);e=e||{},this.didResolver=i,this.attestationVerifier=o,this.zkProver=a,this.schemaValidator=u,this._attestationSignerOptions=e.attestationSigner||{},this._anchorOptions=e.anchor||{}}c.prototype.createDID=function(e){return this.didResolver.fromPublicKey(e)},c.prototype.resolveDID=function(e){return this.didResolver.resolve(e)},c.prototype.verifyDIDOwnership=function(e,t){return this.didResolver.verifyOwnership(e,t)},c.prototype.createEmailCredential=function(e,t,r,i){return new n(i,this._attestationSignerOptions).createEmailCredential(r,{issuerDID:e,subjectId:t})},c.prototype.createAgeCredential=function(e,t,r,i,o){return new n(o,this._attestationSignerOptions).createAgeCredential(r,i,{issuerDID:e,subjectId:t})},c.prototype.createKYCCredential=function(e,t,r,i,o){var a=new n(o,this._attestationSignerOptions),s=Object.assign({level:r},i);return a.createKYCCredential(s,{issuerDID:e,subjectId:t})},c.prototype.createOrganizationCredential=function(e,t,r,i){return new n(i,this._attestationSignerOptions).createOrganizationCredential(r,{issuerDID:e,subjectId:t})},c.prototype.createPresentation=function(e,t,r,i){return new n(r,this._attestationSignerOptions).createPresentation(e,t,r,i)},c.prototype.signCredential=function(e,t){return new n(t,this._attestationSignerOptions).signCredential(e,t)},c.prototype.verifyCredential=function(e,t){return this.attestationVerifier.verifyCredential(e,t)},c.prototype.verifyPresentation=function(e,t){return this.attestationVerifier.verifyPresentation(e,t)},c.prototype.extractClaims=function(e){return this.attestationVerifier.extractClaims(e)},c.prototype.generateSelectiveProof=function(e,t,r){return this.zkProver.generateSelectiveProof(e,t,r)},c.prototype.verifySelectiveProof=function(e,t){return this.zkProver.verifySelectiveProof(e,t)},c.prototype.generateAgeProof=function(e,t,r){var i=new Date("1995-06-15");return this.zkProver.generateAgeProof(i,t,r)},c.prototype.verifyAgeProof=function(e,t,r){return this.zkProver.verifyAgeProof(e,t,r)},c.prototype.generateRangeProof=function(e,t,r,i){return this.zkProver.generateRangeProof(e,t,r,i)},c.prototype.verifyRangeProof=function(e,t,r){return this.zkProver.verifyRangeProof(e,t,r)},c.prototype.generateMembershipProof=function(e,t,r){return this.zkProver.generateMembershipProof(e,t,r)},c.prototype.verifyMembershipProof=function(e,t){return this.zkProver.verifyMembershipProof(e,t)},c.prototype.anchorCredential=function(e,t,r){return new s(t,this._anchorOptions).anchorCredential(e,t,r)},c.prototype.anchorBatch=function(e,t,r){return new s(t,this._anchorOptions).anchorBatch(e,t,r)},c.prototype.registerDID=function(e,t,r,i){return new s(r,this._anchorOptions).registerDID(e,t,r,i)},c.prototype.revokeCredential=function(e,t,r,i){return new s(r,this._anchorOptions).revokeCredential(e,t,r,i)},c.prototype.queryAnchoredData=function(e){return new s(null,this._anchorOptions).queryAnchoredData(e)},c.prototype.validateCredential=function(e,t){return this.schemaValidator.validate(e,t)},c.prototype.getSchema=function(e){return this.schemaValidator.getSchema(e)},c.prototype.getAllSchemas=function(){return this.schemaValidator.getAllSchemas()},c.prototype.addSchema=function(e,t){return this.schemaValidator.addSchema(e,t)},c.prototype.createTemplate=function(e){return this.schemaValidator.createTemplate(e)},c.prototype.generateNonce=function(e){return e=e||32,r(9775).randomBytes(e).toString("hex")},c.prototype.hashData=function(e,t){var i=r(9775).createHash("sha256");return i.update(e),t&&i.update(t),i.digest("hex")},c.prototype.getVersion=function(){return"1.0.0"},c.prototype.getInfo=function(){return{name:"SmartLedger BSV Global Digital Attestation Framework",version:this.getVersion(),description:"W3C-compliant verifiable credentials with DID resolution, zero-knowledge proofs, and blockchain anchoring",components:{didResolver:"DID Resolution and Management",attestationSigner:"Verifiable Credential Creation",attestationVerifier:"Credential and Presentation Verification",zkProver:"Zero-Knowledge Proof Generation and Verification",anchor:"Blockchain Anchoring and Timestamping",schemaValidator:"W3C VC Schema Validation"},standards:["W3C Verifiable Credentials Data Model v1.1","W3C Decentralized Identifiers (DIDs) v1.0","RFC 7515 JSON Web Signature (JWS)","BSV Blockchain Protocol"]}},e.exports=c},4116(e,t,r){"use strict";var i=r(6365),n={EmailVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/email/v1"],type:["VerifiableCredential","EmailVerifiedCredential"],requiredFields:["credentialSubject.email","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["email","verified"],properties:{email:{type:"string",format:"email"},verified:{type:"boolean"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},AgeVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/age/v1"],type:["VerifiableCredential","AgeVerifiedCredential"],requiredFields:["credentialSubject.ageOver","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["ageOver","verified"],properties:{ageOver:{type:"number",minimum:0,maximum:150},verified:{type:"boolean"},birthDateHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verificationMethod:{type:"string"}}}}},KYCVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/kyc/v1"],type:["VerifiableCredential","KYCVerifiedCredential"],requiredFields:["credentialSubject.kycLevel","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["kycLevel","verified","verifyingAuthority"],properties:{kycLevel:{type:"string",enum:["basic","enhanced","premium","institutional"]},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},firstNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},lastNameHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"}}}}},OrganizationCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/organization/v1"],type:["VerifiableCredential","OrganizationCredential"],requiredFields:["credentialSubject.name","credentialSubject.type","credentialSubject.verified"],properties:{credentialSubject:{type:"object",required:["name","type","verified"],properties:{name:{type:"string"},type:{type:"string",enum:["Corporation","LLC","Partnership","NGO","Government","Other"]},verified:{type:"boolean"},taxIdHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},incorporationState:{type:"string"},industry:{type:"string"},verificationMethod:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"}}}}},SSNVerifiedCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ssn/v1"],type:["VerifiableCredential","SSNVerifiedCredential"],requiredFields:["credentialSubject.ssnHash","credentialSubject.verified","credentialSubject.verifyingAuthority"],properties:{credentialSubject:{type:"object",required:["ssnHash","verified","verifyingAuthority"],properties:{ssnHash:{type:"string",pattern:"^[a-fA-F0-9]{64}$"},verified:{type:"boolean"},verifyingAuthority:{type:"string"},verificationTimestamp:{type:"string",format:"date-time"},issuingState:{type:"string"}}}}},EducationalCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/education/v1"],type:["VerifiableCredential","EducationalCredential"],requiredFields:["credentialSubject.degree","credentialSubject.institution","credentialSubject.graduationDate"],properties:{credentialSubject:{type:"object",required:["degree","institution","graduationDate"],properties:{degree:{type:"string"},institution:{type:"string"},graduationDate:{type:"string",format:"date"},gpa:{type:"number",minimum:0,maximum:4},major:{type:"string"},honors:{type:"array",items:{type:"string"}}}}}},ProfessionalLicenseCredential:{"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/license/v1"],type:["VerifiableCredential","ProfessionalLicenseCredential"],requiredFields:["credentialSubject.licenseType","credentialSubject.licenseNumber","credentialSubject.issuingAuthority","credentialSubject.isValid"],properties:{credentialSubject:{type:"object",required:["licenseType","licenseNumber","issuingAuthority","isValid"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},issuingState:{type:"string"},isValid:{type:"boolean"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"}}}}}},o={getSchema:function(e){return n[e]||null},getAllSchemas:function(){return n},validate:function(e,t){try{var r;if(i.checkArgument(e&&"object"==typeof e,"Invalid credential"),"string"==typeof t){if(!(r=n[t]))return{valid:!1,errors:["Unknown schema type: "+t]}}else{if("object"!=typeof t)return{valid:!1,errors:["Invalid schema parameter"]};r=t}var o=[],a=[];return this._validateCredentialStructure(e,o),this._validateCredentialTypes(e,r,o),this._validateRequiredFields(e,r,o),this._validateFieldProperties(e,r,o,a),{valid:0===o.length,errors:o,warnings:a}}catch(e){return{valid:!1,errors:["Schema validation error: "+e.message]}}},_validateCredentialStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.type||t.push("Missing type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject")},_validateCredentialTypes:function(e,t,r){if(Array.isArray(e.type)){if(t.type&&Array.isArray(t.type))for(var i=0;i<t.type.length;i++)e.type.includes(t.type[i])||r.push("Missing required type: "+t.type[i])}else r.push("Credential type must be array")},_validateRequiredFields:function(e,t,r){if(t.requiredFields&&Array.isArray(t.requiredFields))for(var i=0;i<t.requiredFields.length;i++){var n=t.requiredFields[i],o=this._getNestedProperty(e,n);null==o&&r.push("Missing required field: "+n)}},_validateFieldProperties:function(e,t,r,i){t.properties&&t.properties.credentialSubject&&this._validateObjectProperties(e.credentialSubject,t.properties.credentialSubject,"credentialSubject",r,i)},_validateObjectProperties:function(e,t,r,i,n){e&&"object"==typeof e&&t.properties&&Object.keys(t.properties).forEach(function(o){var a=e[o],s=t.properties[o],u=r+"."+o;null!=a&&this._validateProperty(a,s,u,i,n)}.bind(this))},_validateProperty:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type)return void i.push("Invalid type for "+r+": expected "+t.type+", got "+o)}if("string"===t.type&&("email"!==t.format||this._isValidEmail(e)||i.push("Invalid email format for "+r),"date"!==t.format||this._isValidDate(e)||i.push("Invalid date format for "+r),"date-time"!==t.format||this._isValidDateTime(e)||i.push("Invalid date-time format for "+r),t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e)),"number"===t.type&&(void 0!==t.minimum&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),void 0!==t.maximum&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum)),"array"===t.type&&t.items)for(var a=0;a<e.length;a++)this._validateProperty(e[a],t.items,r+"["+a+"]",i,n)},_getNestedProperty:function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},_isValidEmail:function(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())},addSchema:function(e,t){i.checkArgument("string"==typeof e,"Schema name must be string"),i.checkArgument(t&&"object"==typeof t,"Invalid schema definition"),n[e]=t},createTemplate:function(e){var t=n[e];if(!t)throw new Error("Unknown credential type: "+e);return{"@context":t["@context"]||["https://www.w3.org/2018/credentials/v1"],type:t.type||["VerifiableCredential"],issuer:"did:smartledger:ISSUER_DID_HERE",issuanceDate:(new Date).toISOString(),credentialSubject:this._createSubjectTemplate(t.properties?t.properties.credentialSubject:{})}},_createSubjectTemplate:function(e){var t={id:"SUBJECT_ID_HERE"};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t},_getDefaultValue:function(e){switch(e.type){case"string":return e.enum?e.enum[0]:"email"===e.format?"example@example.com":"date"===e.format?"2023-01-01":"date-time"===e.format?(new Date).toISOString():"PLACEHOLDER_STRING";case"number":return e.minimum||0;case"boolean":return!0;case"array":return[];case"object":return{};default:return null}}};e.exports=o},9306(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.Transaction,a=n.Script,s=n.PrivateKey,u=(n.Address,n.crypto.Hash),c=n.SPV,l=n.util.preconditions;function h(e,t){return this instanceof h?("string"==typeof e&&(e=s.fromWIF(e)),null!==e?(l.checkArgument(e instanceof s,"Invalid private key"),this.privateKey=e,this.address=e.toAddress()):(this.privateKey=null,this.address=null),this.options=t||{},this.network=this.options.network||"mainnet",this.PROTOCOL_ID="SMARTLEDGER.ATTEST",this.VERSION=1,this):new h(e,t)}h.prototype.anchorCredential=async function(e,t,r){t=t||{},"string"==typeof e&&(e=i.from(e,"hex")),l.checkArgument(i.isBuffer(e),"Invalid credential hash"),l.checkArgument(32===e.length,"Hash must be 32 bytes");var n=this._createAnchorPayload("CREDENTIAL",e,t),o=await this._createAnchorTransaction(n,r);return{txid:o.hash,transaction:o,anchorHash:e.toString("hex"),metadata:t,timestamp:(new Date).toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"CREDENTIAL"}}},h.prototype.anchorBatch=async function(e,t,r){t=t||{},l.checkArgument(Array.isArray(e),"Credential hashes must be array"),l.checkArgument(e.length>0,"Must provide at least one hash");var n=this._createMerkleRoot(e),o=this._createAnchorPayload("BATCH",n,{...t,batchSize:e.length,merkleRoot:n.toString("hex")}),a=await this._createAnchorTransaction(o,r);return{txid:a.hash,transaction:a,merkleRoot:n.toString("hex"),batchSize:e.length,credentialHashes:e.map(e=>i.isBuffer(e)?e.toString("hex"):e),metadata:t,timestamp:(new Date).toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"BATCH"}}},h.prototype.registerDID=async function(e,t,r){l.checkArgument("string"==typeof e,"DID must be string"),l.checkArgument(t&&"object"==typeof t,"Invalid DID document");var n=u.sha256(i.from(JSON.stringify(t),"utf8")),o=this._createAnchorPayload("DID_REG",n,{did:e,operation:"create",documentHash:n.toString("hex")}),a=await this._createAnchorTransaction(o,r);return{txid:a.hash,transaction:a,did:e,documentHash:n.toString("hex"),timestamp:(new Date).toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"DID_REG"}}},h.prototype.revokeCredential=async function(e,t,r){l.checkArgument("string"==typeof e,"Credential ID must be string");var n={credentialId:e,reason:t=t||"unspecified",timestamp:(new Date).toISOString(),issuer:this.address.toString()},o=u.sha256(i.from(JSON.stringify(n),"utf8")),a=this._createAnchorPayload("REVOKE",o,{credentialId:e,reason:t}),s=await this._createAnchorTransaction(a,r);return{txid:s.hash,transaction:s,credentialId:e,reason:t,revocationHash:o.toString("hex"),timestamp:(new Date).toISOString(),blockchainProof:{protocol:this.PROTOCOL_ID,version:this.VERSION,type:"REVOKE"}}},h.prototype._createAnchorPayload=function(e,t,r){var n=Math.floor(Date.now()/1e3);return i.concat([i.from(this.PROTOCOL_ID,"utf8"),i.from([this.VERSION]),i.from(e.padEnd(10,"\0"),"utf8"),i.from([n>>24,n>>16,n>>8,n]),t,i.from(JSON.stringify(r),"utf8")])},h.prototype._createAnchorTransaction=async function(e,t){if(!t||0===t.length)throw new Error("UTXOs required for anchor transaction");var r=(200+e.length)*(this.options.feeRate||1),i=t.reduce((e,t)=>e+t.satoshis,0);if(i<r)throw new Error("Insufficient funds for anchor transaction");var n=new o;t.forEach(e=>{n.from(e)});var s=a.buildDataOut(e);n.addOutput(new o.Output({script:s,satoshis:0}));var u=i-r;return u>546&&n.to(this.address,u),n.sign(this.privateKey),n},h.prototype._createMerkleRoot=function(e){if(0===e.length)throw new Error("Cannot create Merkle root from empty array");for(var t=e.map(e=>i.isBuffer(e)?e:i.from(e,"hex"));t.length>1;){for(var r=[],n=0;n<t.length;n+=2){var o=t[n],a=n+1<t.length?t[n+1]:o,s=i.concat([o,a]),c=u.sha256(s);r.push(c)}t=r}return t[0]},h.parseAnchorData=function(e){if(!i.isBuffer(e))throw new Error("Data must be Buffer");if(e.length<50)throw new Error("Data too short for SmartLedger anchor");var t=0,r=e.slice(t,t+18).toString("utf8");if(t+=18,"SMARTLEDGER.ATTEST"!==r)throw new Error("Invalid protocol identifier");var n=e[t];t+=1;var o=e.slice(t,t+10).toString("utf8").replace(/\0/g,""),a=e[t+=10]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];t+=4;var s=e.slice(t,t+32);t+=32;var u=e.slice(t),c={};try{c=JSON.parse(u.toString("utf8"))}catch(e){}return{protocol:r,version:n,type:o,timestamp:new Date(1e3*a),hash:s.toString("hex"),metadata:c}},h.verifyAnchor=async function(e,t,r){if(r=r||{},!e||!t)throw new Error("verifyAnchor requires both txid and expectedHash");if(r.spvProof&&(r.header||r.headerChain)&&r.rawTx)return h._verifyAnchorSPV(e,t,r);if("function"!=typeof r.chainProvider)throw new Error("verifyAnchor needs either a trustless SPV proof — { spvProof: { index, nodes }, header, rawTx } — or a trusted options.chainProvider(txid) returning { confirmations, blockHeight, opReturns }. Refusing to fabricate a result.");var i=null!=r.minConfirmations?r.minConfirmations:1,n=await r.chainProvider(e),o=n&&n.confirmations||0,a=n&&n.opReturns||[],s=String(t).toLowerCase(),u=a.some(function(e){return-1!==String(e).toLowerCase().indexOf(s)});return{verified:o>=i&&u,txid:e,hash:t,committed:u,confirmations:o,blockHeight:n&&n.blockHeight||null,timestamp:(new Date).toISOString(),proof:{type:"blockchain_anchor",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}},h._verifyAnchorSPV=function(e,t,r){var n=r.spvProof||{},o=null,a=r.header;r.headerChain&&(o=c.verifyHeaderChain(r.headerChain,{requirePow:!1!==r.requirePow,trustedHash:r.trustedHash}),a=r.headerChain[0]);var s=c.verifyTxInclusion({txid:e,index:n.index,nodes:n.nodes,header:a,requirePow:!1!==r.requirePow}),l=i.isBuffer(r.rawTx)?r.rawTx:i.from(r.rawTx,"hex"),f=i.from(u.sha256sha256(l)).reverse().toString("hex").toLowerCase()===String(e).toLowerCase(),p=f&&h._rawTxCommitsTo(l,t),d=o?o.count:r.header?1:0,g=null!=r.minConfirmations?r.minConfirmations:1,m=!o||o.valid,y=d>=g;return{verified:s.valid&&f&&p&&m&&y,chainVerified:s.valid,committed:p,txidBound:f,powValid:s.powValid,confirmations:d,headerChainValid:o?o.valid:null,headerChainReason:o&&o.reason||null,tipHash:o?o.tipHash:null,txid:e,hash:t,blockHash:s.blockHash,merkleRoot:s.merkleRoot,timestamp:(new Date).toISOString(),proof:{type:o?"spv_merkle_inclusion_with_confirmations":"spv_merkle_inclusion",protocol:"SMARTLEDGER.ATTEST",network:r.network||"mainnet"}}},h._rawTxCommitsTo=function(e,t){var r,i=String(t).toLowerCase();try{r=new o(e)}catch(e){return!1}return r.outputs.some(function(e){var t=e.script;return!!(t&&t.chunks&&t.chunks.length)&&(!!(106===t.chunks[0].opcodenum||0===t.chunks[0].opcodenum&&t.chunks[1]&&106===t.chunks[1].opcodenum)&&t.chunks.some(function(e){return e.buf&&-1!==e.buf.toString("hex").toLowerCase().indexOf(i)}))})},h.getCostEstimate=function(e,t){var r=(t=t||{}).feeRate||1,i=232*e*r,n=(200+32*e)*r;return{individual:{totalCost:i,costPerHash:200*r,transactions:e},batch:{totalCost:n,costPerHash:Math.ceil(n/e),transactions:1},savings:{absolute:i-n,percentage:Math.round((i-n)/i*100)}}},h.createUTXO=function(e,t,r,i){return{txid:e,outputIndex:t,satoshis:r,script:i}},h.generateTestData=function(){var e=new s,t=new h(e),r=u.sha256(i.from("test credential data"));return{privateKey:e.toWIF(),address:e.toAddress().toString(),credentialHash:r.toString("hex"),metadata:{issuer:"did:smartledger:test",type:"EmailVerifiedCredential",environment:"test"},anchor:t}},e.exports=h},7532(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(9439),a=n.crypto.Hash,s=(n.crypto.BN,n.util.preconditions);function u(e){return this instanceof u?(this.options=e||{},this):new u(e)}u.createMerkleTree=function(e,t){t=t||n.crypto.Random.getRandomBuffer(32).toString("hex"),s.checkArgument(e&&"object"==typeof e,"Invalid credential");var r=u._extractFields(e).map(function(e){var r=e.path+":"+JSON.stringify(e.value)+":"+t;return{path:e.path,value:e.value,hash:a.sha256(i.from(r,"utf8")).toString("hex"),salt:t}}),o=u._buildMerkleTree(r.map(e=>e.hash));return{salt:t,leaves:r,tree:o,root:o[o.length-1][0]}},u.generateSelectiveProof=function(e,t,r){s.checkArgument(e&&"object"==typeof e,"Invalid credential"),"string"==typeof t&&(t=[t]),s.checkArgument(Array.isArray(t),"Disclose paths must be array");var i=u.createMerkleTree(e,r),n=[],a=[];return t.forEach(function(e){var t=i.leaves.find(t=>t.path===e);if(t){n.push(t);var r=i.leaves.findIndex(t=>t.path===e),o=u._generateMerkleProof(i.tree,r);a.push({path:e,leafIndex:r,proof:o})}}),{type:"SelectiveDisclosureProof",created:(new Date).toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,credentialRoot:i.root,credentialHash:e.rootHash||o._hashCredential(e).toString("hex"),disclosedFields:n.map(function(e){return{path:e.path,value:e.value,hash:e.hash}}),merkleProofs:a,salt:r}},u.verifySelectiveProof=function(e,t){try{s.checkArgument(e&&"object"==typeof e,"Invalid proof"),s.checkArgument("string"==typeof t,"Expected root must be string");for(var r={valid:!1,errors:[],verifiedFields:[]},n=0;n<e.disclosedFields.length;n++){var o=e.disclosedFields[n],c=e.merkleProofs.find(e=>e.path===o.path);if(c){var l=o.path+":"+JSON.stringify(o.value)+":"+e.salt;if(a.sha256(i.from(l,"utf8")).toString("hex")===o.hash)u._verifyMerkleProof(o.hash,c.proof,t)?r.verifiedFields.push({path:o.path,value:o.value,verified:!0}):r.errors.push("Invalid Merkle proof for: "+o.path);else r.errors.push("Field hash mismatch for: "+o.path)}else r.errors.push("Missing Merkle proof for field: "+o.path)}return r.valid=0===r.errors.length&&r.verifiedFields.length>0,r}catch(e){return{valid:!1,errors:["Proof verification failed: "+e.message],verifiedFields:[]}}},u.generateAgeProof=function(e,t,r){s.checkArgument(e instanceof Date,"Birth date must be Date object"),s.checkArgument("number"==typeof t,"Minimum age must be number"),r=r||n.crypto.Random.getRandomBuffer(32).toString("hex");var o=new Date,c=Math.floor((o-e)/315576e5);if(c<t)throw new Error("Age requirement not met");var l=e.toISOString().split("T")[0],h=a.sha256(i.from(l+":"+r,"utf8")).toString("hex"),f={minimumAge:t,ageAttestation:c>=t,timestamp:o.toISOString(),salt:r},p=a.sha256(i.from(JSON.stringify(f),"utf8")).toString("hex");return{type:"AgeProof",created:(new Date).toISOString(),proofPurpose:"ageVerification",minimumAge:t,meetsRequirement:!0,birthDateCommitment:h,ageProofHash:p,challengeResponse:u._generateAgeChallenge(e,t,r)}},u.verifyAgeProof=function(e,t){try{return s.checkArgument(e&&"object"==typeof e,"Invalid proof"),s.checkArgument("number"==typeof t,"Required age must be number"),"AgeProof"===e.type&&(e.minimumAge===t&&(!!e.meetsRequirement&&(e.challengeResponse&&e.challengeResponse.length>0)))}catch(e){return!1}},u.generateRangeProof=function(e,t,r,o){s.checkArgument("number"==typeof e,"Value must be number"),s.checkArgument("number"==typeof t,"Min must be number"),s.checkArgument("number"==typeof r,"Max must be number"),s.checkArgument(e>=t&&e<=r,"Value not in range"),o=o||n.crypto.Random.getRandomBuffer(32).toString("hex");var u=a.sha256(i.from(e.toString()+":"+o,"utf8")).toString("hex"),c={min:t,max:r,inRange:!0,timestamp:(new Date).toISOString(),salt:o},l=a.sha256(i.from(JSON.stringify(c),"utf8")).toString("hex");return{type:"RangeProof",created:(new Date).toISOString(),proofPurpose:"rangeVerification",range:{min:t,max:r},valueCommitment:u,proofHash:l,inRange:!0}},u.verifyRangeProof=function(e,t,r){try{return s.checkArgument(e&&"object"==typeof e,"Invalid proof"),"RangeProof"===e.type&&(e.range.min===t&&e.range.max===r&&!0===e.inRange)}catch(e){return!1}},u._extractFields=function(e,t){t=t||"";var r=[];return Object.keys(e).forEach(function(i){var n=t?t+"."+i:i,o=e[i];!o||"object"!=typeof o||Array.isArray(o)||o instanceof Date?r.push({path:n,value:o}):r=r.concat(u._extractFields(o,n))}),r},u._buildMerkleTree=function(e){if(0===e.length)throw new Error("Cannot build tree from empty leaves");for(var t=[e];t[t.length-1].length>1;){for(var r=t[t.length-1],n=[],o=0;o<r.length;o+=2){var s=r[o],u=s+(o+1<r.length?r[o+1]:s),c=a.sha256(i.from(u,"hex")).toString("hex");n.push(c)}t.push(n)}return t},u._generateMerkleProof=function(e,t){for(var r=[],i=t,n=0;n<e.length-1;n++){var o=e[n],a=i%2==0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r},u._verifyMerkleProof=function(e,t,r){for(var n=e,o=0;o<t.length;o++){var s=t[o],u=s.isLeft?s.hash+n:n+s.hash;n=a.sha256(i.from(u,"hex")).toString("hex")}return n===r},u._generateAgeChallenge=function(e,t,r){return a.sha256(i.from(e.toISOString()+t+r,"utf8")).toString("hex")},u.generateMembershipProof=function(e,t,r){s.checkArgument(Array.isArray(e),"Set must be array"),s.checkArgument(e.includes(t),"Value not in set"),r=r||n.crypto.Random.getRandomBuffer(32).toString("hex");var o=e.map(function(e){return a.sha256(i.from(JSON.stringify(e)+":"+r,"utf8")).toString("hex")}),u=a.sha256(i.from(JSON.stringify(t)+":"+r,"utf8")).toString("hex");return{type:"MembershipProof",created:(new Date).toISOString(),proofPurpose:"membershipVerification",setCommitments:o,valueCommitment:u,isMember:!0}},u.verifyMembershipProof=function(e){try{return s.checkArgument(e&&"object"==typeof e,"Invalid proof"),"MembershipProof"===e.type&&(!!Array.isArray(e.setCommitments)&&(e.setCommitments.includes(e.valueCommitment)&&e.isMember))}catch(e){return!1}},e.exports=u},983(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4148),o=r(8287),a=r(4799),s=r(6365),u=r(9043),c=r(9375),l=r(9047),h=r(5067),f=r(1262),p=r(4125),d=r(4339),g=r(9968),m=r(3649),y=m.HDPrivateKey,v=r(3035);function b(e){if(e instanceof b)return e;if(!(this instanceof b))return new b(e);if(!e)return this._generateRandomly();if(f.get(e))return this._generateRandomly(e);if(a.isString(e)||i.isBuffer(e))if(b.isValidSerialized(e))this._buildFromSerialized(e);else if(v.isValidJSON(e))this._buildFromJSON(e);else{if(!i.isBuffer(e)||!b.isValidSerialized(e.toString()))throw b.getSerializedError(e);this._buildFromSerialized(e.toString())}else{if(!a.isObject(e))throw new y.UnrecognizedArgument(e);this._buildFromObject(e)}}b.fromRandom=function(){return new b},b.isValidPath=function(e,t){if(a.isString(e)){var r=b._getDerivationIndexes(e);return null!==r&&a.every(r,b.isValidPath)}return!!a.isNumber(e)&&(e<b.Hardened&&!0===t&&(e+=b.Hardened),e>=0&&e<b.MaxIndex)},b._getDerivationIndexes=function(e){var t=e.split("/");if(a.includes(b.RootElementAlias,e))return[];if(!a.includes(b.RootElementAlias,t[0]))return null;var r=t.slice(1).map(function(e){var t="'"===e.slice(-1);if(t&&(e=e.slice(0,-1)),!e||"-"===e[0])return NaN;var r=+e;return t&&(r+=b.Hardened),r});return a.some(r,isNaN)?null:r},b.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")},b.prototype.deriveChild=function(e,t){if(a.isNumber(e))return this._deriveWithNumber(e,t);if(a.isString(e))return this._deriveFromString(e);throw new y.InvalidDerivationArgument(e)},b.prototype.deriveNonCompliantChild=function(e,t){if(a.isNumber(e))return this._deriveWithNumber(e,t,!0);if(a.isString(e))return this._deriveFromString(e,!0);throw new y.InvalidDerivationArgument(e)},b.prototype._deriveWithNumber=function(e,t,r){if(!b.isValidPath(e,t))throw new y.InvalidPath(e);t=e>=b.Hardened||t,e<b.Hardened&&!0===t&&(e+=b.Hardened);var a,s=v.integerAsBuffer(e);if(t&&r){var c=this.privateKey.bn.toBuffer();a=i.concat([o.Buffer.from([0]),c,s])}else if(t){var l=this.privateKey.bn.toBuffer({size:32});n(32===l.length,"length of private key buffer is expected to be 32 bytes"),a=i.concat([o.Buffer.from([0]),l,s])}else a=i.concat([this.publicKey.toBuffer(),s]);var f=h.sha512hmac(a,this._buffers.chainCode),g=u.fromBuffer(f.slice(0,32),{size:32}),m=f.slice(32,64),S=g.add(this.privateKey.toBigNumber()).umod(p.getN()).toBuffer({size:32});return d.isValid(S)?new b({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:m,privateKey:S}):this._deriveWithNumber(e+1,null,r)},b.prototype._deriveFromString=function(e,t){if(!b.isValidPath(e))throw new y.InvalidPath(e);return b._getDerivationIndexes(e).reduce(function(e,r){return e._deriveWithNumber(r,null,t)},this)},b.isValidSerialized=function(e,t){return!b.getSerializedError(e,t)},b.getSerializedError=function(e,t){if(!a.isString(e)&&!i.isBuffer(e))return new y.UnrecognizedArgument("Expected string or buffer");if(!c.validCharacters(e))return new m.InvalidB58Char("(unknown)",e);try{e=l.decode(e)}catch(t){return new m.InvalidB58Checksum(e)}if(e.length!==b.DataLength)return new y.InvalidLength(e);if(!a.isUndefined(t)){var r=b._validateNetwork(e,t);if(r)return r}return null},b._validateNetwork=function(e,t){var r=f.get(t);if(!r)return new m.InvalidNetworkArgument(t);var i=e.slice(0,4);return i.readUInt32BE(0)!==r.xprivkey?new m.InvalidNetwork(i):null},b.fromString=function(e){return s.checkArgument(a.isString(e),"No valid string was provided"),new b(e)},b.fromObject=function(e){return s.checkArgument(a.isObject(e),"No valid argument was provided"),new b(e)},b.prototype._buildFromJSON=function(e){return this._buildFromObject(JSON.parse(e))},b.prototype._buildFromObject=function(e){var t={version:e.network?v.integerAsBuffer(f.get(e.network).xprivkey):e.version,depth:a.isNumber(e.depth)?i.from([255&e.depth]):e.depth,parentFingerPrint:a.isNumber(e.parentFingerPrint)?v.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:a.isNumber(e.childIndex)?v.integerAsBuffer(e.childIndex):e.childIndex,chainCode:a.isString(e.chainCode)?i.from(e.chainCode,"hex"):e.chainCode,privateKey:a.isString(e.privateKey)&&v.isHexa(e.privateKey)?i.from(e.privateKey,"hex"):e.privateKey,checksum:e.checksum?e.checksum.length?e.checksum:v.integerAsBuffer(e.checksum):void 0};return this._buildFromBuffers(t)},b.prototype._buildFromSerialized=function(e){var t=l.decode(e),r={version:t.slice(b.VersionStart,b.VersionEnd),depth:t.slice(b.DepthStart,b.DepthEnd),parentFingerPrint:t.slice(b.ParentFingerPrintStart,b.ParentFingerPrintEnd),childIndex:t.slice(b.ChildIndexStart,b.ChildIndexEnd),chainCode:t.slice(b.ChainCodeStart,b.ChainCodeEnd),privateKey:t.slice(b.PrivateKeyStart,b.PrivateKeyEnd),checksum:t.slice(b.ChecksumStart,b.ChecksumEnd),xprivkey:e};return this._buildFromBuffers(r)},b.prototype._generateRandomly=function(e){return b.fromSeed(g.getRandomBuffer(64),e)},b.fromSeed=function(e,t){if(v.isHexaString(e)&&(e=i.from(e,"hex")),!i.isBuffer(e))throw new y.InvalidEntropyArgument(e);if(e.length<16)throw new y.InvalidEntropyArgument.NotEnoughEntropy(e);if(e.length>64)throw new y.InvalidEntropyArgument.TooMuchEntropy(e);var r=h.sha512hmac(e,o.Buffer.from("Bitcoin seed"));return new b({network:f.get(t)||f.defaultNetwork,depth:0,parentFingerPrint:0,childIndex:0,privateKey:r.slice(0,32),chainCode:r.slice(32,64)})},b.prototype._calcHDPublicKey=function(){if(!this._hdPublicKey){var e=r(4997);this._hdPublicKey=new e(this)}},b.prototype._buildFromBuffers=function(e){b._validateBufferArguments(e),v.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,i.alloc(1),e.privateKey],r=o.Buffer.concat(t);if(e.checksum&&e.checksum.length){if(e.checksum.toString()!==l.checksum(r).toString())throw new m.InvalidB58Checksum(r)}else e.checksum=l.checksum(r);var n,a=f.get(e.version.readUInt32BE(0));n=l.encode(o.Buffer.concat(t)),e.xprivkey=i.from(n);var s=new d(u.fromBuffer(e.privateKey),a),c=s.toPublicKey(),p=b.ParentFingerPrintSize,g=h.sha256ripemd160(c.toBuffer()).slice(0,p);return v.defineImmutable(this,{xprivkey:n,network:a,depth:e.depth[0],privateKey:s,publicKey:c,fingerPrint:g}),this._hdPublicKey=null,Object.defineProperty(this,"hdPublicKey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey}}),Object.defineProperty(this,"xpubkey",{configurable:!1,enumerable:!0,get:function(){return this._calcHDPublicKey(),this._hdPublicKey.xpubkey}}),this},b._validateBufferArguments=function(e){var t=function(t,r){var o=e[t];n(i.isBuffer(o),t+" argument is not a buffer"),n(o.length===r,t+" has not the expected size: found "+o.length+", expected "+r)};t("version",b.VersionSize),t("depth",b.DepthSize),t("parentFingerPrint",b.ParentFingerPrintSize),t("childIndex",b.ChildIndexSize),t("chainCode",b.ChainCodeSize),t("privateKey",b.PrivateKeySize),e.checksum&&e.checksum.length&&t("checksum",b.CheckSumSize)},b.prototype.toString=function(){return this.xprivkey},b.prototype.inspect=function(){return"<HDPrivateKey: "+this.xprivkey+">"},b.prototype.toObject=b.prototype.toJSON=function(){return{network:f.get(this._buffers.version.readUInt32BE(0),"xprivkey").name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),privateKey:this.privateKey.toBuffer().toString("hex"),checksum:this._buffers.checksum.readUInt32BE(0),xprivkey:this.xprivkey}},b.fromBuffer=function(e){return new b(e.toString())},b.fromHex=function(e){return b.fromBuffer(i.from(e,"hex"))},b.prototype.toBuffer=function(){return i.from(this.toString())},b.prototype.toHex=function(){return this.toBuffer().toString("hex")},b.DefaultDepth=0,b.DefaultFingerprint=0,b.DefaultChildIndex=0,b.Hardened=2147483648,b.MaxIndex=2*b.Hardened,b.RootElementAlias=["m","M","m'","M'"],b.VersionSize=4,b.DepthSize=1,b.ParentFingerPrintSize=4,b.ChildIndexSize=4,b.ChainCodeSize=32,b.PrivateKeySize=32,b.CheckSumSize=4,b.DataLength=78,b.SerializedByteSize=82,b.VersionStart=0,b.VersionEnd=b.VersionStart+b.VersionSize,b.DepthStart=b.VersionEnd,b.DepthEnd=b.DepthStart+b.DepthSize,b.ParentFingerPrintStart=b.DepthEnd,b.ParentFingerPrintEnd=b.ParentFingerPrintStart+b.ParentFingerPrintSize,b.ChildIndexStart=b.ParentFingerPrintEnd,b.ChildIndexEnd=b.ChildIndexStart+b.ChildIndexSize,b.ChainCodeStart=b.ChildIndexEnd,b.ChainCodeEnd=b.ChainCodeStart+b.ChainCodeSize,b.PrivateKeyStart=b.ChainCodeEnd+1,b.PrivateKeyEnd=b.PrivateKeyStart+b.PrivateKeySize,b.ChecksumStart=b.PrivateKeyEnd,b.ChecksumEnd=b.ChecksumStart+b.CheckSumSize,n(b.ChecksumEnd===b.SerializedByteSize),e.exports=b},4997(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(9043),s=r(9375),u=r(9047),c=r(5067),l=r(983),h=r(1262),f=r(4125),p=r(6161),d=r(3649),g=d,m=d.HDPublicKey,y=r(4148),v=r(3035);function b(e){if(e instanceof b)return e;if(!(this instanceof b))return new b(e);if(e){if(n.isString(e)||i.isBuffer(e)){var t=b.getSerializedError(e);if(t){if(i.isBuffer(e)&&!b.getSerializedError(e.toString()))return this._buildFromSerialized(e.toString());if(t instanceof m.ArgumentIsPrivateExtended)return new l(e).hdPublicKey;throw t}return this._buildFromSerialized(e)}if(n.isObject(e))return e instanceof l?this._buildFromPrivate(e):this._buildFromObject(e);throw new m.UnrecognizedArgument(e)}throw new m.MustSupplyArgument}b.fromHDPrivateKey=function(e){return new b(e)},b.isValidPath=function(e){if(n.isString(e)){var t=l._getDerivationIndexes(e);return null!==t&&n.every(t,b.isValidPath)}return!!n.isNumber(e)&&(e>=0&&e<b.Hardened)},b.prototype.derive=function(){throw new Error("derive has been deprecated. use deriveChild or, for the old way, deriveNonCompliantChild.")},b.prototype.deriveChild=function(e,t){if(n.isNumber(e))return this._deriveWithNumber(e,t);if(n.isString(e))return this._deriveFromString(e);throw new m.InvalidDerivationArgument(e)},b.prototype._deriveWithNumber=function(e,t){if(e>=b.Hardened||t)throw new m.InvalidIndexCantDeriveHardened;if(e<0)throw new m.InvalidPath(e);var r,n=v.integerAsBuffer(e),o=i.concat([this.publicKey.toBuffer(),n]),s=c.sha512hmac(o,this._buffers.chainCode),u=a.fromBuffer(s.slice(0,32),{size:32}),l=s.slice(32,64);try{r=p.fromPoint(f.getG().mul(u).add(this.publicKey.point))}catch(t){return this._deriveWithNumber(e+1)}return new b({network:this.network,depth:this.depth+1,parentFingerPrint:this.fingerPrint,childIndex:e,chainCode:l,publicKey:r})},b.prototype._deriveFromString=function(e){if(n.includes(e,"'"))throw new m.InvalidIndexCantDeriveHardened;if(!b.isValidPath(e))throw new m.InvalidPath(e);return l._getDerivationIndexes(e).reduce(function(e,t){return e._deriveWithNumber(t)},this)},b.isValidSerialized=function(e,t){return n.isNull(b.getSerializedError(e,t))},b.getSerializedError=function(e,t){if(!n.isString(e)&&!i.isBuffer(e))return new m.UnrecognizedArgument("expected buffer or string");if(!s.validCharacters(e))return new g.InvalidB58Char("(unknown)",e);try{e=u.decode(e)}catch(t){return new g.InvalidB58Checksum(e)}if(e.length!==b.DataSize)return new m.InvalidLength(e);if(!n.isUndefined(t)){var r=b._validateNetwork(e,t);if(r)return r}var o=e.readUInt32BE(0);return o===h.livenet.xprivkey||o===h.testnet.xprivkey?new m.ArgumentIsPrivateExtended:null},b._validateNetwork=function(e,t){var r=h.get(t);if(!r)return new g.InvalidNetworkArgument(t);var i=e.slice(b.VersionStart,b.VersionEnd);return i.readUInt32BE(0)!==r.xpubkey?new g.InvalidNetwork(i):null},b.prototype._buildFromPrivate=function(e){var t=n.clone(e._buffers),r=f.getG().mul(a.fromBuffer(t.privateKey));return t.publicKey=f.pointToCompressed(r),t.version=v.integerAsBuffer(h.get(t.version.readUInt32BE(0)).xpubkey),t.privateKey=void 0,t.checksum=void 0,t.xprivkey=void 0,this._buildFromBuffers(t)},b.prototype._buildFromObject=function(e){var t={version:e.network?v.integerAsBuffer(h.get(e.network).xpubkey):e.version,depth:n.isNumber(e.depth)?i.from([255&e.depth]):e.depth,parentFingerPrint:n.isNumber(e.parentFingerPrint)?v.integerAsBuffer(e.parentFingerPrint):e.parentFingerPrint,childIndex:n.isNumber(e.childIndex)?v.integerAsBuffer(e.childIndex):e.childIndex,chainCode:n.isString(e.chainCode)?i.from(e.chainCode,"hex"):e.chainCode,publicKey:n.isString(e.publicKey)?i.from(e.publicKey,"hex"):i.isBuffer(e.publicKey)?e.publicKey:e.publicKey.toBuffer(),checksum:n.isNumber(e.checksum)?v.integerAsBuffer(e.checksum):e.checksum};return this._buildFromBuffers(t)},b.prototype._buildFromSerialized=function(e){var t=u.decode(e),r={version:t.slice(b.VersionStart,b.VersionEnd),depth:t.slice(b.DepthStart,b.DepthEnd),parentFingerPrint:t.slice(b.ParentFingerPrintStart,b.ParentFingerPrintEnd),childIndex:t.slice(b.ChildIndexStart,b.ChildIndexEnd),chainCode:t.slice(b.ChainCodeStart,b.ChainCodeEnd),publicKey:t.slice(b.PublicKeyStart,b.PublicKeyEnd),checksum:t.slice(b.ChecksumStart,b.ChecksumEnd),xpubkey:e};return this._buildFromBuffers(r)},b.prototype._buildFromBuffers=function(e){b._validateBufferArguments(e),v.defineImmutable(this,{_buffers:e});var t=[e.version,e.depth,e.parentFingerPrint,e.childIndex,e.chainCode,e.publicKey],r=i.concat(t),n=u.checksum(r);if(e.checksum&&e.checksum.length){if(e.checksum.toString("hex")!==n.toString("hex"))throw new g.InvalidB58Checksum(r,n)}else e.checksum=n;var o,a=h.get(e.version.readUInt32BE(0));o=u.encode(i.concat(t)),e.xpubkey=i.from(o);var s=new p(e.publicKey,{network:a}),l=b.ParentFingerPrintSize,f=c.sha256ripemd160(s.toBuffer()).slice(0,l);return v.defineImmutable(this,{xpubkey:o,network:a,depth:e.depth[0],publicKey:s,fingerPrint:f}),this},b._validateBufferArguments=function(e){var t=function(t,r){var n=e[t];y(i.isBuffer(n),t+" argument is not a buffer, it's "+typeof n),y(n.length===r,t+" has not the expected size: found "+n.length+", expected "+r)};t("version",b.VersionSize),t("depth",b.DepthSize),t("parentFingerPrint",b.ParentFingerPrintSize),t("childIndex",b.ChildIndexSize),t("chainCode",b.ChainCodeSize),t("publicKey",b.PublicKeySize),e.checksum&&e.checksum.length&&t("checksum",b.CheckSumSize)},b.fromString=function(e){return o.checkArgument(n.isString(e),"No valid string was provided"),new b(e)},b.fromObject=function(e){return o.checkArgument(n.isObject(e),"No valid argument was provided"),new b(e)},b.prototype.toString=function(){return this.xpubkey},b.prototype.inspect=function(){return"<HDPublicKey: "+this.xpubkey+">"},b.prototype.toObject=b.prototype.toJSON=function(){return{network:h.get(this._buffers.version.readUInt32BE(0)).name,depth:this._buffers.depth[0],fingerPrint:this.fingerPrint.readUInt32BE(0),parentFingerPrint:this._buffers.parentFingerPrint.readUInt32BE(0),childIndex:this._buffers.childIndex.readUInt32BE(0),chainCode:this._buffers.chainCode.toString("hex"),publicKey:this.publicKey.toString(),checksum:this._buffers.checksum.readUInt32BE(0),xpubkey:this.xpubkey}},b.fromBuffer=function(e){return new b(e)},b.fromHex=function(e){return b.fromBuffer(i.from(e,"hex"))},b.prototype.toBuffer=function(){return i.from(this._buffers.xpubkey)},b.prototype.toHex=function(){return this.toBuffer().toString("hex")},b.Hardened=2147483648,b.RootElementAlias=["m","M"],b.VersionSize=4,b.DepthSize=1,b.ParentFingerPrintSize=4,b.ChildIndexSize=4,b.ChainCodeSize=32,b.PublicKeySize=33,b.CheckSumSize=4,b.DataSize=78,b.SerializedByteSize=82,b.VersionStart=0,b.VersionEnd=b.VersionStart+b.VersionSize,b.DepthStart=b.VersionEnd,b.DepthEnd=b.DepthStart+b.DepthSize,b.ParentFingerPrintStart=b.DepthEnd,b.ParentFingerPrintEnd=b.ParentFingerPrintStart+b.ParentFingerPrintSize,b.ChildIndexStart=b.ParentFingerPrintEnd,b.ChildIndexEnd=b.ChildIndexStart+b.ChildIndexSize,b.ChainCodeStart=b.ChildIndexEnd,b.ChainCodeEnd=b.ChainCodeStart+b.ChainCodeSize,b.PublicKeyStart=b.ChainCodeEnd,b.PublicKeyEnd=b.PublicKeyStart+b.PublicKeySize,b.ChecksumStart=b.PublicKeyEnd,b.ChecksumEnd=b.ChecksumStart+b.CheckSumSize,y(b.PublicKeyEnd===b.DataSize),y(b.ChecksumEnd===b.SerializedByteSize),e.exports=b},9033(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=n.util.preconditions,s={prepareTokenCommitment:function(e,t){t=t||{},a.checkArgument(e&&"object"==typeof e,"Invalid token");try{var r=this._createCommitment(e,t),i=this._formatOpReturn(r,t);return{success:!0,commitment:r,opReturnData:i,txTemplate:this._createTxTemplate(i,t),preparedAt:(new Date).toISOString(),metadata:{tokenId:e.id,purpose:t.purpose||"legal_token_anchor",version:"LTP.v1"}}}catch(e){return{success:!1,error:e.message}}},prepareBatchCommitment:function(e,t){t=t||{},a.checkArgument(Array.isArray(e),"Tokens must be array");try{var r=this._createBatchCommitment(e,t),i=this._formatOpReturn(r,t);return{success:!0,batchCommitment:r,opReturnData:i,txTemplate:this._createTxTemplate(i,t),tokenCount:e.length,preparedAt:(new Date).toISOString(),metadata:{purpose:t.purpose||"legal_token_batch_anchor",version:"LTP.v1"}}}catch(e){return{success:!1,error:e.message}}},verifyTokenAnchor:function(e,t,r){a.checkArgument(e&&"object"==typeof e,"Invalid token"),a.checkArgument("string"==typeof t,"Transaction ID must be string");try{var i=this._createCommitment(e,{}),n=this._extractOpReturn(r);return n?{valid:this._verifyCommitment(i,n),chainVerified:!1,txid:t,commitment:i,anchorData:n,verifiedAt:(new Date).toISOString()}:{valid:!1,error:"No OP_RETURN data found in transaction"}}catch(e){return{valid:!1,error:e.message}}},formatRevocation:function(e,t){a.checkArgument("string"==typeof e,"Token ID must be string"),a.checkArgument(t&&"object"==typeof t,"Invalid revocation data");try{var r={type:"LTP_REVOCATION",tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:(new Date).toISOString(),effectiveDate:t.effectiveDate||(new Date).toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null},n=o.sha256(i.from(JSON.stringify(r))).toString("hex");return{success:!0,revocation:r,revocationHash:n,opReturnData:this._formatOpReturn({hash:n,type:"REVOCATION"},{})}}catch(e){return{success:!1,error:e.message}}},_createCommitment:function(e,t){var r=this._canonicalizeToken(e),n={type:"LTP_TOKEN",tokenHash:o.sha256(i.from(r)).toString("hex"),tokenId:e.id,timestamp:(new Date).toISOString(),purpose:t.purpose||"legal_token"};return{hash:o.sha256(i.from(JSON.stringify(n))).toString("hex"),data:n,canonical:r}},_createBatchCommitment:function(e,t){var r=[],n=[];e.forEach(function(e){var i=this._createCommitment(e,t);r.push(i.hash),n.push(e.id)}.bind(this));var a=this._createMerkleRoot(r),s={type:"LTP_BATCH",merkleRoot:a,tokenCount:e.length,tokenIds:n,timestamp:(new Date).toISOString(),purpose:t.purpose||"batch_anchor"};return{hash:o.sha256(i.from(JSON.stringify(s))).toString("hex"),data:s,merkleRoot:a,tokenHashes:r}},_formatOpReturn:function(e,t){var r=t.prefix||"LTP.v1",n=e.hash;return{prefix:r,data:n,full:r+"."+n,bytes:i.from(r+"."+n,"utf8"),size:i.from(r+"."+n,"utf8").length}},_createTxTemplate:function(e,t){try{var r={version:1,inputs:[],outputs:[{satoshis:0,script:"OP_RETURN "+e.data}],locktime:0};return t.feeOutput&&r.outputs.push(t.feeOutput),{template:r,opReturn:e,estimatedSize:this._estimateSize(r),instructions:{step1:"Add input UTXOs to cover fees",step2:"Add change output if needed",step3:"Sign transaction with appropriate keys",step4:"Broadcast to BSV network"}}}catch(e){throw new Error("Failed to create transaction template: "+e.message)}},_extractOpReturn:function(e){try{if(!e||!e.outputs)return null;for(var t=0;t<e.outputs.length;t++){var r=e.outputs[t];if(r.script&&r.script.startsWith("OP_RETURN")){var n=r.script.replace("OP_RETURN ","");return{raw:n,decoded:i.from(n,"hex").toString("utf8")}}}return null}catch(e){return null}},_verifyCommitment:function(e,t){try{return!(!t||!t.decoded)&&t.decoded.includes(e.hash)}catch(e){return!1}},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,delete t.anchorTx,delete t.anchorBlock,JSON.stringify(this._sortObjectKeys(t))},_createMerkleRoot:function(e){if(0===e.length)return null;if(1===e.length)return e[0];for(var t=e.slice();t.length>1;){for(var r=[],n=0;n<t.length;n+=2){var a=t[n],s=t[n+1]||a,u=i.concat([i.from(a,"hex"),i.from(s,"hex")]),c=o.sha256(u).toString("hex");r.push(c)}t=r}return t[0]},_estimateSize:function(e){var t=34*e.outputs.length;return{base:10+t,withOneInput:10+t+148,bytesPerInput:148}},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(null!==e&&"object"==typeof e){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};e.exports=s},8938(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=n.util.preconditions,s={PropertyTitle:{title:"Property Title",description:"Real estate property ownership title",type:"object",required:["propertyId","address","ownershipType"],properties:{propertyId:{type:"string",description:"Unique property identifier"},address:{type:"object",required:["street","city","state","country"],properties:{street:{type:"string"},city:{type:"string"},state:{type:"string"},country:{type:"string"},postalCode:{type:"string"}}},ownershipType:{type:"string",enum:["fee_simple","leasehold","joint_tenancy","tenancy_in_common"]},titleNumber:{type:"string"},registeredDate:{type:"string",format:"date-time"},legalDescription:{type:"string"},encumbrances:{type:"array",items:{type:"object",properties:{type:{type:"string"},amount:{type:"number"},description:{type:"string"}}}}}},VehicleTitle:{title:"Vehicle Title",description:"Motor vehicle ownership title",type:"object",required:["vin","make","model","year"],properties:{vin:{type:"string",pattern:"^[A-HJ-NPR-Z0-9]{17}$",description:"Vehicle Identification Number"},make:{type:"string"},model:{type:"string"},year:{type:"integer",minimum:1900,maximum:2030},titleNumber:{type:"string"},registeredState:{type:"string"},mileage:{type:"integer",minimum:0},color:{type:"string"},fuelType:{type:"string",enum:["gasoline","diesel","electric","hybrid","other"]},liens:{type:"array",items:{type:"object",properties:{lienholderName:{type:"string"},lienAmount:{type:"number"},lienDate:{type:"string",format:"date"}}}}}},PromissoryNote:{title:"Promissory Note",description:"Legal promise to pay a specified amount",type:"object",required:["principal","interestRate","maturityDate","borrower","lender"],properties:{principalAmount:{type:"number",minimum:0,description:"Principal amount in base currency units"},currency:{type:"string",default:"USD"},interestRate:{type:"number",minimum:0,maximum:100,description:"Annual interest rate percentage"},maturityDate:{type:"string",format:"date",description:"Date when principal and interest are due"},payee:{type:"string",description:"DID of the payee (creditor)"},payor:{type:"string",description:"DID of the payor (debtor)"},paymentSchedule:{type:"string",enum:["lump_sum","monthly","quarterly","annually"]},collateral:{type:"array",items:{type:"object",properties:{description:{type:"string"},value:{type:"number"},type:{type:"string"}}}},defaultProvisions:{type:"string"},governingLaw:{type:"string"}}},IntellectualProperty:{title:"Intellectual Property",description:"Intellectual property rights and licensing",type:"object",required:["ipType","title","registrationNumber"],properties:{ipType:{type:"string",enum:["patent","trademark","copyright","trade_secret"]},title:{type:"string"},creator:{type:"string",description:"Creator DID"},registrationNumber:{type:"string"},registrationDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},jurisdiction:{type:"string"},description:{type:"string"},claims:{type:"array",items:{type:"string"}},priorArt:{type:"array",items:{type:"object",properties:{reference:{type:"string"},date:{type:"string",format:"date"},relevance:{type:"string"}}}}}},ProfessionalLicense:{title:"Professional License",description:"Professional practice license or certification",type:"object",required:["licenseType","licenseNumber","issuingAuthority","expirationDate"],properties:{licenseType:{type:"string"},licenseNumber:{type:"string"},issuingAuthority:{type:"string"},licensee:{type:"string",description:"Licensee DID"},issueDate:{type:"string",format:"date"},expirationDate:{type:"string",format:"date"},renewalDate:{type:"string",format:"date"},jurisdiction:{type:"string"},scope:{type:"string"},restrictions:{type:"array",items:{type:"string"}},continuing_education:{type:"object",properties:{hours_required:{type:"integer"},deadline:{type:"string",format:"date"},completed_hours:{type:"integer"}}}}},MusicLicense:{title:"Music License",description:"Music performance and usage licensing",type:"object",required:["songTitle","artist","licenseType","royaltyRate"],properties:{workTitle:{type:"string"},composer:{type:"string",description:"Composer DID"},performer:{type:"string",description:"Performer DID"},licenseType:{type:"string",enum:["mechanical","performance","synchronization","master_use"]},territory:{type:"string"},duration:{type:"string"},royaltyRate:{type:"number",minimum:0,maximum:100},advancePayment:{type:"number",minimum:0},exclusivity:{type:"boolean"},mediaTypes:{type:"array",items:{type:"string",enum:["cd","vinyl","digital","streaming","broadcast","film","tv"]}},usage_restrictions:{type:"string"},copyrightNotice:{type:"string"}}}},u={prepareClaimValidation:function(e,t){try{a.checkArgument(e&&"object"==typeof e,"Invalid claim"),a.checkArgument("string"==typeof t,"Schema name must be string");var r=s[t];if(!r)return{success:!1,error:"Unknown schema: "+t};var i=[],n=[];this._validateObject(e,r,"",i,n);var o={valid:0===i.length,errors:i,warnings:n,schema:t,claimHash:this.hash(e),canonical:this.canonicalize(e)};return{success:!0,validation:o,claim:e,schema:r,externalOperations:{store:{endpoint:"POST /claims/validate",data:{claim:e,validation:o,schema:t}},index:{endpoint:"POST /claims/index",data:{claimHash:o.claimHash,schemaName:t,valid:o.valid}}}}}catch(e){return{success:!1,error:"Validation preparation failed: "+e.message}}},prepareClaimAttestation:function(e,t,r){try{a.checkArgument(e&&"object"==typeof e,"Invalid claim"),a.checkArgument("string"==typeof t,"Schema name must be string"),a.checkArgument(r&&"object"==typeof r,"Invalid attestor");var n=this.prepareClaimValidation(e,t);if(!n.success||!n.validation.valid)return{success:!1,error:"Cannot attest invalid claim",validation:n};var s={type:"LTP_CLAIM_ATTESTATION",claimHash:n.validation.claimHash,schemaName:t,attestor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},attestedAt:(new Date).toISOString(),confidence:r.confidence||100,evidence:r.evidence||null,notes:r.notes||null},u=o.sha256(i.from(this.canonicalize(s))).toString("hex");return s.attestationHash=u,{success:!0,attestation:s,claim:e,validation:n.validation,externalOperations:{storeAttestation:{endpoint:"POST /claims/"+n.validation.claimHash+"/attestations",data:s},notifyStakeholders:{endpoint:"POST /notifications/claim-attested",data:{claimHash:n.validation.claimHash,attestorDid:s.attestor.did,attestationHash:u}}}}}catch(e){return{success:!1,error:"Attestation preparation failed: "+e.message}}},prepareClaimDispute:function(e,t,r){try{a.checkArgument("string"==typeof e,"Claim hash must be string"),a.checkArgument(t&&"object"==typeof t,"Invalid disputant"),a.checkArgument(r&&"object"==typeof r,"Invalid dispute");var n={type:"LTP_CLAIM_DISPUTE",claimHash:e,disputant:{did:t.did||t.id,name:t.name||"Unknown",jurisdiction:t.jurisdiction||null},dispute:{reason:r.reason||"UNSPECIFIED",category:r.category||"ACCURACY",description:r.description||"",evidence:r.evidence||null,requestedAction:r.requestedAction||"REVIEW"},disputedAt:(new Date).toISOString(),status:"FILED",priority:r.priority||"NORMAL"},s=o.sha256(i.from(this.canonicalize(n))).toString("hex");return n.disputeHash=s,{success:!0,dispute:n,disputeId:this._generateDisputeId(e),externalOperations:{fileDispute:{endpoint:"POST /claims/"+e+"/disputes",data:n},notifyStakeholders:{endpoint:"POST /notifications/claim-disputed",data:{claimHash:e,disputantDid:n.disputant.did,disputeHash:s}},escalate:{endpoint:"POST /disputes/escalate",data:{disputeHash:s,priority:n.priority}}}}}catch(e){return{success:!1,error:"Dispute preparation failed: "+e.message}}},prepareBulkClaimValidation:function(e,t){try{a.checkArgument(Array.isArray(e),"Claims must be array"),a.checkArgument("string"==typeof t,"Schema name must be string");var r=[],n=[],s=0;e.forEach(function(e,i){try{var o=this.prepareClaimValidation(e,t);o.success&&o.validation.valid&&s++,r.push({index:i,result:o})}catch(e){n.push({index:i,error:e.message})}}.bind(this));var u=this._generateBatchId(),c=o.sha256(i.from(JSON.stringify(r.map(e=>e.result.validation.claimHash)))).toString("hex");return{success:!0,batchId:u,batchHash:c,totalClaims:e.length,validClaims:s,invalidClaims:e.length-s,validations:r,errors:n,externalOperations:{storeBatch:{endpoint:"POST /claims/batch-validate",data:{batchId:u,batchHash:c,schemaName:t,validations:r}},generateReport:{endpoint:"POST /reports/bulk-validation",data:{batchId:u,summary:{total:e.length,valid:s,invalid:e.length-s}}}}}}catch(e){return{success:!1,error:"Bulk validation preparation failed: "+e.message}}},canonicalize:function(e){a.checkArgument(e&&"object"==typeof e,"Invalid claim");var t=this._sortObjectKeys(e);return JSON.stringify(t)},hash:function(e){var t=this.canonicalize(e);return o.sha256(i.from(t)).toString("hex")},prepareClaimTemplate:function(e,t){t=t||{};try{var r=s[e];if(!r)return{success:!1,error:"Unknown schema: "+e};var i=this._createTemplateFromSchema(r),n=this._generateFormStructure(r);return{success:!0,schemaName:e,template:i,schema:r,formStructure:n,validation:{required:r.required||[],patterns:this._extractPatterns(r),enums:this._extractEnums(r)},externalOperations:{generateForm:{endpoint:"POST /forms/generate",data:{schemaName:e,formStructure:n,template:i}},saveTemplate:{endpoint:"POST /templates/claim",data:{schemaName:e,template:i,customizations:t.customizations||{}}}}}}catch(e){return{success:!1,error:"Template preparation failed: "+e.message}}},getSchemas:function(){return s},getSchemaNames:function(){return Object.keys(s)},getSchema:function(e){return s[e]||null},addSchema:function(e,t){a.checkArgument("string"==typeof e,"Schema name must be string"),a.checkArgument(t&&"object"==typeof t,"Invalid schema"),s[e]=t},createTemplate:function(e){var t=s[e];if(!t)throw new Error("Unknown schema: "+e);return this._createTemplateFromSchema(t)},_generateDisputeId:function(e){var t="dispute_"+e+"_"+Date.now();return o.sha256(i.from(t)).toString("hex").substring(0,16)},_generateBatchId:function(){var e="batch_"+Date.now()+"_"+Math.random();return o.sha256(i.from(e)).toString("hex").substring(0,16)},_generateFormStructure:function(e){var t={type:"form",title:e.title||"Legal Claim Form",description:e.description||"",fields:[]};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r],n={name:r,label:this._humanizeFieldName(r),type:this._mapSchemaTypeToFormType(i),required:e.required&&e.required.includes(r),validation:this._extractFieldValidation(i)};i.enum&&(n.options=i.enum.map(function(e){return{value:e,label:this._humanizeValue(e)}}.bind(this))),t.fields.push(n)}.bind(this)),t},_extractPatterns:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.pattern&&(t[r]=i.pattern)}),t},_extractEnums:function(e){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];i.enum&&(t[r]=i.enum)}),t},_mapSchemaTypeToFormType:function(e){switch(e.type){case"string":return e.enum?"select":"date"===e.format?"date":"date-time"===e.format?"datetime":"text";case"number":case"integer":return"number";case"boolean":return"checkbox";case"array":return"list";case"object":return"fieldset";default:return"text"}},_extractFieldValidation:function(e){var t={};return e.pattern&&(t.pattern=e.pattern),void 0!==e.minimum&&(t.min=e.minimum),void 0!==e.maximum&&(t.max=e.maximum),e.format&&(t.format=e.format),t},_humanizeFieldName:function(e){return e.replace(/([A-Z])/g," $1").replace(/^./,function(e){return e.toUpperCase()}).replace(/_/g," ")},_humanizeValue:function(e){return e.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()})},_validateObject:function(e,t,r,i,n){"object"===t.type?(t.required&&Array.isArray(t.required)&&t.required.forEach(function(t){e.hasOwnProperty(t)||i.push("Missing required field: "+this._getFieldPath(r,t))}.bind(this)),t.properties&&Object.keys(e).forEach(function(o){var a=this._getFieldPath(r,o),s=t.properties[o];s?this._validateValue(e[o],s,a,i,n):n.push("Unknown field: "+a)}.bind(this))):this._validateValue(e,t,r,i,n)},_validateValue:function(e,t,r,i,n){if(t.type){var o=Array.isArray(e)?"array":typeof e;if(o!==t.type)return void i.push("Invalid type for "+r+": expected "+t.type+", got "+o)}if("string"===t.type&&(t.pattern&&!new RegExp(t.pattern).test(e)&&i.push("Value does not match pattern for "+r),t.enum&&!t.enum.includes(e)&&i.push("Invalid enum value for "+r+": "+e),"date"!==t.format||this._isValidDate(e)||i.push("Invalid date format for "+r),"date-time"!==t.format||this._isValidDateTime(e)||i.push("Invalid date-time format for "+r)),"number"!==t.type&&"integer"!==t.type||(void 0!==t.minimum&&e<t.minimum&&i.push("Value below minimum for "+r+": "+e+" < "+t.minimum),void 0!==t.maximum&&e>t.maximum&&i.push("Value above maximum for "+r+": "+e+" > "+t.maximum),"integer"!==t.type||Number.isInteger(e)||i.push("Value must be integer for "+r)),"array"===t.type&&t.items)for(var a=0;a<e.length;a++)this._validateValue(e[a],t.items,r+"["+a+"]",i,n);"object"===t.type&&this._validateObject(e,t,r,i,n)},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(null!==e&&"object"==typeof e){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_createTemplateFromSchema:function(e){if("object"===e.type){var t={};return e.properties&&Object.keys(e.properties).forEach(function(r){var i=e.properties[r];t[r]=this._getDefaultValue(i)}.bind(this)),t}return this._getDefaultValue(e)},_getDefaultValue:function(e){if(void 0!==e.default)return e.default;switch(e.type){case"string":return e.enum?e.enum[0]:"date"===e.format?"2023-01-01":"date-time"===e.format?(new Date).toISOString():"PLACEHOLDER_STRING";case"number":case"integer":return e.minimum||0;case"boolean":return!1;case"array":return[];case"object":return this._createTemplateFromSchema(e);default:return null}},_getFieldPath:function(e,t){return e?e+"."+t:t},_isValidDate:function(e){var t=new Date(e);return!isNaN(t.getTime())&&e.match(/^\d{4}-\d{2}-\d{2}$/)},_isValidDateTime:function(e){var t=new Date(e);return!isNaN(t.getTime())}};e.exports=u},542(e,t,r){"use strict";var i=r(1232),n=r(8938),o=r(9033),a=r(5020),s=r(5479),u=r(348),c=r(5237),l=c.PrivateKey,h=c.util.preconditions,f=function(e){return this instanceof f?(this.config=e||{},this.registry=null,this.config.registry&&(this.registry=s.createRegistry(this.config.registry)),this):new f(e)};f.prototype.createRightToken=function(e,t,r){h.checkArgument(e&&"object"==typeof e,"Invalid right data"),h.checkArgument(t instanceof l,"Invalid private key"),r=r||{};try{var n=i.create(e.type,e.owner,e.owner,e,t,r);if(!n)return{success:!1,error:"Failed to create token"};if(!1!==r.addProof&&(n=i._signToken(n,t)),r.anchor){var a=o.anchorToken(n,r.anchor);a.success&&(n.anchorTx=a.txid,n.anchorBlock=a.blockHeight)}if(this.registry&&!1!==r.register){var u=s.registerToken(this.registry,n,{registeredBy:r.registeredBy||"SYSTEM"});u.success&&(n.registrationId=u.registrationId,n.registrationStatus=u.status)}return{success:!0,token:n,type:"LegalRightToken"}}catch(e){return{success:!1,error:e.message}}},f.prototype.validateClaim=function(e,t){return n.validate(e,t)},f.prototype.createSelectiveDisclosure=function(e,t,r){return a.prepareSelectiveDisclosure(e,t,r)},f.prototype.verifyToken=function(e,t){return e&&e.proof?i.verifyToken(e,t):{valid:!1,error:"No proof found in token"}},f.prototype.transferRight=function(e,t,r,n){h.checkArgument(e&&"object"==typeof e,"Invalid token"),h.checkArgument("string"==typeof t,"New owner must be string"),h.checkArgument(r instanceof l,"Invalid owner key"),n=n||{};try{if(!this.verifyToken(e,r.toPublicKey().toString()).valid)return{success:!1,error:"Invalid token or ownership proof"};var a=i.prepareRightTokenTransfer(e,t,r,n);if(!a.success)return{success:!1,error:a.error};var u=a.newToken,c=a.transferProof;if(n.anchor){var f=o.anchorToken(u,n.anchor);f.success&&(u.transferAnchorTx=f.txid)}if(this.registry){var p=s.registerToken(this.registry,u,{registeredBy:n.registeredBy||t,metadata:{transferFrom:e.owner,transferTo:t,originalTokenId:e.id}});p.success&&(u.registrationId=p.registrationId)}return{success:!0,token:u,transferId:c.id,transferredAt:c.issuanceDate,transferProof:c}}catch(e){return{success:!1,error:e.message}}},f.prototype.createObligation=function(e,t,r){h.checkArgument(e&&"object"==typeof e,"Invalid right token"),h.checkArgument(t&&"object"==typeof t,"Invalid obligation data"),h.checkArgument(r instanceof l,"Invalid private key");try{var n=i.prepareObligationToken(e,t.obligor,t,r);return n.success?{success:!0,obligation:n.obligationToken,rightTokenId:e.id}:{success:!1,error:n.error}}catch(e){return{success:!1,error:e.message}}},f.prototype.revokeToken=function(e,t,r){return h.checkArgument("string"==typeof e,"Token ID must be string"),h.checkArgument(t&&"object"==typeof t,"Invalid revocation data"),h.checkArgument("string"==typeof r,"Authority must be string"),this.registry?s.revokeToken(this.registry,e,{reason:t.reason,revokedBy:r,legalBasis:t.legalBasis,evidence:t.evidence}):{success:!1,error:"No registry available for revocation"}},f.prototype.checkTokenStatus=function(e){return h.checkArgument("string"==typeof e,"Token ID must be string"),this.registry?s.checkTokenStatus(this.registry,e):{found:!1,error:"No registry available"}},f.prototype.searchTokens=function(e){return this.registry?s.searchTokens(this.registry,e):{success:!1,error:"No registry available"}},f.prototype.getRegistryStats=function(){return this.registry?s.getStatistics(this.registry):{error:"No registry available"}},f.prototype.createLegalValidityProof=function(e,t,r){return a.prepareLegalValidityProof(e,t,r)},f.prototype.anchorTokenBatch=function(e,t){return o.anchorBatch(e,t)},f.prototype.verifyAnchor=function(e,t){return o.verifyAnchor(e,t)},f.prototype.getRightTypes=function(){return i.getRightTypes()},f.prototype.getClaimSchemas=function(){return n.getSchemas()},f.prototype.createRegistry=function(e){return this.registry=s.createRegistry(e),this.registry},f.prototype.setRegistry=function(e){h.checkArgument(e&&"object"==typeof e,"Invalid registry"),this.registry=e},f.create=function(e){return new f(e)},f.createRightToken=function(e,t,r){return(new f).createRightToken(e,t,r)},f.validateClaim=function(e,t){return n.validate(e,t)},f.verifyToken=function(e,t){return(new f).verifyToken(e,t)},f.createRegistry=function(e){return s.createRegistry(e)},f.Right=i,f.Claim=n,f.Anchor=o,f.Proof=a,f.Registry=s,f.Obligation=u,e.exports=f},348(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=n.crypto.ECDSA,s=n.crypto.Signature,u=n.PrivateKey,c=n.util.preconditions;var l={CORRELATIVE_OBLIGATION:"CorrelativeObligation",CONTRACTUAL_OBLIGATION:"ContractualObligation",PAYMENT_OBLIGATION:"PaymentObligation",DELIVERY_OBLIGATION:"DeliveryObligation",PERFORMANCE_OBLIGATION:"PerformanceObligation",MAINTENANCE_OBLIGATION:"MaintenanceObligation",COMPLIANCE_OBLIGATION:"ComplianceObligation",REPORTING_OBLIGATION:"ReportingObligation",CONFIDENTIALITY_OBLIGATION:"ConfidentialityObligation",NON_COMPETE_OBLIGATION:"NonCompeteObligation",INDEMNIFICATION_OBLIGATION:"IndemnificationObligation",WARRANTY_OBLIGATION:"WarrantyObligation",SUPPORT_OBLIGATION:"SupportObligation",REGULATORY_OBLIGATION:"RegulatoryObligation",FIDUCIARY_OBLIGATION:"FiduciaryObligation"},h={CRITICAL:"CRITICAL",HIGH:"HIGH",MEDIUM:"MEDIUM",LOW:"LOW",DEFERRED:"DEFERRED"},f={PENDING:"PENDING",ACTIVE:"ACTIVE",IN_PROGRESS:"IN_PROGRESS",COMPLETED:"COMPLETED",OVERDUE:"OVERDUE",BREACHED:"BREACHED",WAIVED:"WAIVED",TERMINATED:"TERMINATED"},p={prepareObligationToken:function(e,t,r,i,n,o){o=o||{},c.checkArgument("string"==typeof e,"Obligation type must be string"),c.checkArgument("string"==typeof t,"Issuer DID must be string"),c.checkArgument("string"==typeof r,"Obligor DID must be string"),c.checkArgument(i&&"object"==typeof i,"Obligation must be object"),c.checkArgument(n instanceof u,"Invalid issuer private key");var a=Object.values(l);c.checkArgument(a.includes(e),"Invalid obligation type: "+e);try{var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken",e],issuer:t,issuanceDate:(new Date).toISOString(),credentialSubject:{id:r,obligationType:e,obligation:i,jurisdiction:o.jurisdiction||"US",priority:o.priority||h.MEDIUM,status:f.PENDING,dueDate:o.dueDate||null,effectiveDate:o.effectiveDate||(new Date).toISOString(),expirationDate:o.expirationDate||null,correlativeRight:o.correlativeRight||null,rightHolder:o.rightHolder||null,enforceable:!1!==o.enforceable,penalties:o.penalties||null,remedies:o.remedies||null}};o.metadata&&(s.credentialSubject.metadata=o.metadata);var p=this._signToken(s,n);return{success:!0,obligationToken:p,tokenHash:p.tokenHash,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight},externalOperations:{storeToken:{endpoint:"POST /obligations/tokens",data:{token:p,metadata:{type:e,issuer:t,obligor:r,priority:s.credentialSubject.priority,status:s.credentialSubject.status,jurisdiction:s.credentialSubject.jurisdiction,dueDate:s.credentialSubject.dueDate,correlativeRight:s.credentialSubject.correlativeRight}}},indexToken:{endpoint:"POST /obligations/index",data:{tokenId:p.id,tokenHash:p.tokenHash,type:e,issuer:t,obligor:r,issuedAt:p.issuanceDate,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},notifyObligor:{endpoint:"POST /notifications/obligation-issued",data:{tokenId:p.id,issuer:t,obligor:r,obligationType:e,dueDate:s.credentialSubject.dueDate,priority:s.credentialSubject.priority}},scheduleReminders:s.credentialSubject.dueDate?{endpoint:"POST /obligations/schedule-reminders",data:{tokenId:p.id,obligor:r,dueDate:s.credentialSubject.dueDate,reminderSchedule:o.reminderSchedule||["7d","3d","1d"]}}:null}}}catch(e){return{success:!1,error:e.message}}},prepareObligationVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateObligationType(e,r),this._validateObligationStatus(e,r,i),this._validateObligationPriority(e,i);var n={valid:0===r.length,errors:r,warnings:i,issuerDID:e.issuer,obligorDID:e.credentialSubject?e.credentialSubject.id:null,obligationType:e.credentialSubject?e.credentialSubject.obligationType:null,status:e.credentialSubject?e.credentialSubject.status:null,priority:e.credentialSubject?e.credentialSubject.priority:null,isOverdue:this._checkIfOverdue(e),verifiedAt:(new Date).toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /obligations/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt,isOverdue:n.isOverdue}},auditVerification:{endpoint:"POST /audit/obligation-verification",data:{tokenId:e.id,obligationType:n.obligationType,issuer:n.issuerDID,obligor:n.obligorDID,result:n.valid,verifiedAt:n.verifiedAt}},updateStatus:n.isOverdue&&e.credentialSubject.status===f.ACTIVE?{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:f.OVERDUE,updatedAt:n.verifiedAt,reason:"Due date passed"}}:null}}}catch(e){return{success:!1,error:"Verification preparation failed: "+e.message}}},prepareObligationFulfillment:function(e,t,r,i){i=i||{},c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(t&&"object"==typeof t,"Invalid fulfillment"),c.checkArgument(r instanceof u,"Invalid obligor key");try{var n=this.prepareObligationVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot fulfill invalid obligation: "+n.verification.errors.join(", ")};if(e.credentialSubject.status===f.COMPLETED)return{success:!1,error:"Obligation already fulfilled"};if(e.credentialSubject.status===f.TERMINATED)return{success:!1,error:"Obligation has been terminated"};var o={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationFulfillment"],issuer:e.credentialSubject.id,issuanceDate:(new Date).toISOString(),credentialSubject:{id:e.id,fulfillmentType:t.type||"FULL_FULFILLMENT",fulfillmentDate:(new Date).toISOString(),evidence:t.evidence||null,description:t.description||"",completionPercentage:t.completionPercentage||100,attestations:t.attestations||[],notes:t.notes||null}},a=this._signToken(o,r),s=o.credentialSubject.completionPercentage>=100?f.COMPLETED:f.IN_PROGRESS;return{success:!0,fulfillmentRecord:a,newStatus:s,fulfillmentId:a.id,externalOperations:{recordFulfillment:{endpoint:"POST /obligations/fulfillments",data:{obligationId:e.id,fulfillmentRecord:a,obligor:e.credentialSubject.id,fulfillmentDate:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:s,fulfillmentId:a.id,updatedAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}},notifyRightHolder:e.credentialSubject.rightHolder?{endpoint:"POST /notifications/obligation-fulfilled",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,completionPercentage:o.credentialSubject.completionPercentage,newStatus:s}}:null,auditFulfillment:{endpoint:"POST /audit/obligation-fulfillment",data:{obligationId:e.id,fulfillmentId:a.id,obligor:e.credentialSubject.id,fulfilledAt:o.credentialSubject.fulfillmentDate,completionPercentage:o.credentialSubject.completionPercentage}}}}}catch(e){return{success:!1,error:e.message}}},prepareObligationBreachAssessment:function(e,t,r){c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(t&&"object"==typeof t,"Invalid breach details"),c.checkArgument(r&&"object"==typeof r,"Invalid assessor");try{var n={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","ObligationBreachAssessment"],issuer:r.did||r.id,issuanceDate:(new Date).toISOString(),credentialSubject:{id:e.id,breachType:t.type||"MATERIAL_BREACH",breachDate:t.date||(new Date).toISOString(),description:t.description||"",severity:t.severity||"MODERATE",evidence:t.evidence||[],assessor:{did:r.did||r.id,name:r.name||"Unknown",authority:r.authority||null,jurisdiction:r.jurisdiction||null},damages:t.damages||null,recommendedRemedies:t.recommendedRemedies||[],assessmentDate:(new Date).toISOString()}},a=o.sha256(i.from(JSON.stringify(n))).toString("hex");return n.credentialSubject.assessmentHash=a,{success:!0,breachAssessment:n,breachId:n.id,severity:t.severity||"MODERATE",externalOperations:{recordBreach:{endpoint:"POST /obligations/breaches",data:{obligationId:e.id,breachAssessment:n,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachDate:t.date||(new Date).toISOString(),severity:t.severity||"MODERATE"}},updateStatus:{endpoint:"PUT /obligations/tokens/"+e.id+"/status",data:{status:f.BREACHED,breachId:n.id,breachDate:t.date||(new Date).toISOString(),updatedAt:(new Date).toISOString()}},notifyParties:{endpoint:"POST /notifications/obligation-breached",data:{obligationId:e.id,breachId:n.id,obligor:e.credentialSubject.id,rightHolder:e.credentialSubject.rightHolder,breachType:t.type||"MATERIAL_BREACH",severity:t.severity||"MODERATE"}},escalateBreach:"CRITICAL"===t.severity?{endpoint:"POST /legal/escalate-breach",data:{obligationId:e.id,breachId:n.id,severity:t.severity,jurisdiction:e.credentialSubject.jurisdiction}}:null,auditBreach:{endpoint:"POST /audit/obligation-breach",data:{obligationId:e.id,breachId:n.id,obligor:e.credentialSubject.id,assessedAt:n.credentialSubject.assessmentDate,severity:t.severity||"MODERATE"}}}}}catch(e){return{success:!1,error:e.message}}},prepareObligationMonitoringReport:function(e,t){t=t||{},c.checkArgument(Array.isArray(e),"Obligations must be array");try{var r={reportId:"rpt_"+this._generateUUID(),generatedAt:(new Date).toISOString(),criteria:t,summary:{totalObligations:e.length,byStatus:{},byPriority:{},byType:{},overdue:0,dueSoon:0,completed:0},obligations:[],alerts:[],recommendations:[]},i=new Date,n=new Date(i.getTime()+6048e5);return e.forEach(function(e){var t={id:e.id,type:e.credentialSubject.obligationType,status:e.credentialSubject.status,priority:e.credentialSubject.priority,obligor:e.credentialSubject.id,dueDate:e.credentialSubject.dueDate,isOverdue:this._checkIfOverdue(e),isDueSoon:!1};if(e.credentialSubject.dueDate){var o=new Date(e.credentialSubject.dueDate);t.isDueSoon=o<=n&&o>i}r.summary.byStatus[t.status]=(r.summary.byStatus[t.status]||0)+1,r.summary.byPriority[t.priority]=(r.summary.byPriority[t.priority]||0)+1,r.summary.byType[t.type]=(r.summary.byType[t.type]||0)+1,t.isOverdue&&r.summary.overdue++,t.isDueSoon&&r.summary.dueSoon++,t.status===f.COMPLETED&&r.summary.completed++,t.isOverdue&&t.priority===h.CRITICAL&&r.alerts.push({type:"CRITICAL_OVERDUE",obligationId:e.id,message:"Critical obligation is overdue",priority:"HIGH"}),t.isDueSoon&&t.priority===h.HIGH&&r.alerts.push({type:"HIGH_PRIORITY_DUE_SOON",obligationId:e.id,message:"High priority obligation due soon",priority:"MEDIUM"}),r.obligations.push(t)}.bind(this)),r.summary.overdue>0&&r.recommendations.push({type:"OVERDUE_MANAGEMENT",message:"Consider prioritizing overdue obligations",count:r.summary.overdue}),r.summary.dueSoon>5&&r.recommendations.push({type:"WORKLOAD_MANAGEMENT",message:"High number of obligations due soon - consider workload distribution",count:r.summary.dueSoon}),{success:!0,report:r,externalOperations:{storeReport:{endpoint:"POST /obligations/monitoring-reports",data:{report:r,generatedAt:r.generatedAt}},sendAlerts:r.alerts.length>0?{endpoint:"POST /notifications/obligation-alerts",data:{reportId:r.reportId,alerts:r.alerts,summary:r.summary}}:null,updateDashboard:{endpoint:"PUT /dashboard/obligation-metrics",data:{summary:r.summary,lastUpdated:r.generatedAt}}}}}catch(e){return{success:!1,error:e.message}}},getObligationTypes:function(){return l},getObligationPriority:function(){return h},getObligationStatus:function(){return f},_signToken:function(e,t){var r=this._canonicalizeToken(e),n=o.sha256(i.from(r)),s=new a;s.hashbuf=n,s.privkey=t,s.pubkey=t.toPublicKey(),s.sign();var u=s.sig,c={type:"EcdsaSecp256k1Signature2019",created:(new Date).toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(n,u)},l=JSON.parse(JSON.stringify(e));return l.proof=c,l.tokenHash=n.toString("hex"),l},_createJWS:function(e,t){var r=i.from(JSON.stringify({alg:"ES256K",typ:"JWT"})).toString("base64url");e.toString("base64url");return r+".."+t.toDER().toString("base64url")},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(null!==e&&"object"==typeof e){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),e.type&&Array.isArray(e.type)||t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws)return void t.push("Missing signature proof");var u=this._canonicalizeToken(e),c=o.sha256(i.from(u));if(e.tokenHash&&e.tokenHash!==c.toString("hex"))return void t.push("Token hash mismatch");var l=function(e,t){if((t=t||{}).issuerPublicKey)return t.issuerPublicKey instanceof n.PublicKey?t.issuerPublicKey:n.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if("string"!=typeof r)return null;try{var i=r.split("#")[0].split(":")[2];return i?n.PublicKey.fromString(i):null}catch(e){return null}}(e,r);if(!l)return void t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");var h=e.proof.jws.split(".");if(3!==h.length||!h[2])return void t.push("Malformed JWS");var f=s.fromDER(i.from(h[2],"base64url")),p=new a;p.hashbuf=c,p.sig=f,p.pubkey=l,!0!==p.verify().verified&&t.push("Signature verification failed")}catch(e){t.push("Signature verification failed: "+e.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date;(new Date(e.issuanceDate)>i&&t.push("Token issued in the future"),e.credentialSubject.effectiveDate)&&(i<new Date(e.credentialSubject.effectiveDate)&&r.push("Obligation not yet effective"));e.credentialSubject.expirationDate&&(i>new Date(e.credentialSubject.expirationDate)&&t.push("Obligation expired"))},_validateObligationType:function(e,t){e.credentialSubject.obligationType?Object.values(l).includes(e.credentialSubject.obligationType)||t.push("Invalid obligation type: "+e.credentialSubject.obligationType):t.push("Missing obligationType")},_validateObligationStatus:function(e,t,r){e.credentialSubject.status?(Object.values(f).includes(e.credentialSubject.status)||t.push("Invalid obligation status: "+e.credentialSubject.status),this._checkIfOverdue(e)&&e.credentialSubject.status===f.ACTIVE&&r.push("Obligation is overdue but status is still ACTIVE")):t.push("Missing status")},_validateObligationPriority:function(e,t){e.credentialSubject.priority&&(Object.values(h).includes(e.credentialSubject.priority)||t.push("Invalid obligation priority: "+e.credentialSubject.priority))},_checkIfOverdue:function(e){return!!e.credentialSubject.dueDate&&(new Date>new Date(e.credentialSubject.dueDate)&&e.credentialSubject.status!==f.COMPLETED)},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}};p.ObligationTypes=l,p.ObligationPriority=h,p.ObligationStatus=f,e.exports=p},5020(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=n.crypto.ECDSA,s=n.crypto.Signature,u=n.PrivateKey,c=n.util.preconditions,l={prepareSignatureProof:function(e,t,r){r=r||{},c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(t instanceof u,"Invalid private key");try{var n=this._canonicalizeForSigning(e),s=o.sha256(i.from(n)),l=new a;l.hashbuf=s,l.privkey=t,l.pubkey=t.toPublicKey(),l.sign();var h=l.sig,f={type:"EcdsaSecp256k1Signature2019",created:(new Date).toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:r.purpose||"assertionMethod",jws:this._createJWS(s,h),proofValue:h.toDER().toString("hex")};return{success:!0,proof:f,tokenHash:s.toString("hex"),canonical:n,signingKey:{publicKey:t.toPublicKey().toString(),keyId:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1"},externalOperations:{storeProof:{endpoint:"POST /proofs/signature",data:{tokenHash:s.toString("hex"),proof:f,signingKey:t.toPublicKey().toString()}},verifyProof:{endpoint:"POST /proofs/verify-signature",data:{tokenHash:s.toString("hex"),signature:h.toDER().toString("hex"),publicKey:t.toPublicKey().toString()}}}}}catch(e){return{success:!1,error:e.message}}},prepareSignatureVerification:function(e,t){try{if(c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument("string"==typeof t,"Public key must be string"),!e.proof)return{success:!1,error:"No proof found in token"};var r=this._canonicalizeForSigning(e),u=o.sha256(i.from(r)),l=s.fromDER(i.from(e.proof.proofValue,"hex")),h={tokenHash:u.toString("hex"),signature:l.toDER().toString("hex"),publicKey:t,proof:e.proof,canonical:r},f=new a;f.hashbuf=u,f.sig=l,f.pubkey=n.PublicKey.fromString(t);var p=!0===f.verify().verified;return{success:!0,verification:{valid:p,tokenHash:u.toString("hex"),signatureValid:p,publicKey:t,verifiedAt:(new Date).toISOString()},verificationData:h,externalOperations:{recordVerification:{endpoint:"POST /proofs/verification-record",data:{tokenHash:u.toString("hex"),result:p,publicKey:t,verifiedAt:(new Date).toISOString()}},auditVerification:{endpoint:"POST /audit/proof-verification",data:{tokenId:e.id,proofType:e.proof.type,result:p,verifier:t}}}}}catch(e){return{success:!1,error:e.message}}},prepareSelectiveDisclosure:function(e,t,r){c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(Array.isArray(t),"Revealed fields must be array"),c.checkArgument("string"==typeof r,"Nonce must be string");try{var i=this._createFieldCommitments(e,r),n=this._createMerkleTree(i),o=[],a=[];t.forEach(function(t){var r=this._getNestedValue(e,t),s=this._findFieldCommitment(i,t);if(s){o.push({path:t,value:r,commitment:s.hash,salt:s.salt});var u=this._generateMerkleProof(n,s.index);a.push({path:t,leafIndex:s.index,proof:u})}}.bind(this));var s={type:"LegalTokenSelectiveDisclosure",created:(new Date).toISOString(),proofPurpose:"selectiveDisclosure",verificationMethod:e.proof?e.proof.verificationMethod:null,nonce:r,merkleRoot:n.root,disclosures:o,merkleProofs:a,totalFields:i.length};return{success:!0,proof:s,hiddenFieldCount:i.length-o.length,revealedFieldCount:o.length,externalOperations:{storeDisclosure:{endpoint:"POST /proofs/selective-disclosure",data:{tokenId:e.id,proof:s,merkleRoot:n.root}},verifyDisclosure:{endpoint:"POST /proofs/verify-disclosure",data:{proof:s,expectedNonce:r}},auditDisclosure:{endpoint:"POST /audit/selective-disclosure",data:{tokenId:e.id,revealedFields:t,totalFields:i.length,disclosedAt:(new Date).toISOString()}}}}}catch(e){return{success:!1,error:e.message}}},prepareSelectiveDisclosureVerification:function(e,t){try{if(c.checkArgument(e&&"object"==typeof e,"Invalid proof"),c.checkArgument("string"==typeof t,"Expected nonce must be string"),e.nonce!==t)return{success:!1,error:"Nonce mismatch"};var r=[],i=[];e.disclosures.forEach(function(t,n){var o=e.merkleProofs[n];this._hashField(t.path,t.value,t.salt)===t.commitment?this._verifyMerkleProof(t.commitment,o.leafIndex,o.proof,e.merkleRoot)?r.push({path:t.path,value:t.value,verified:!0}):i.push("Invalid Merkle proof for field: "+t.path):i.push("Invalid commitment for field: "+t.path)}.bind(this));var n={valid:0===i.length,errors:i,disclosures:r,merkleRoot:e.merkleRoot,totalFields:e.totalFields,verifiedAt:(new Date).toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /proofs/disclosure-verification",data:{proofId:e.id||"unknown",result:n.valid,verifiedFields:r.length,totalFields:e.totalFields,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/disclosure-verification",data:{merkleRoot:e.merkleRoot,disclosuresVerified:r.length,errors:i.length,result:n.valid}}}}}catch(e){return{success:!1,error:e.message}}},prepareLegalValidityProof:function(e,t,r){c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(t&&"object"==typeof t,"Invalid jurisdiction"),c.checkArgument("string"==typeof r,"Nonce must be string");try{var i=t.requirements||[],n=[],o=!0;i.forEach(function(t){var r=this._checkLegalRequirement(e,t);n.push(r),r.satisfied||(o=!1)}.bind(this));var a={type:"LegalValidityProof",created:(new Date).toISOString(),proofPurpose:"legalValidity",jurisdiction:t.code,nonce:r,valid:o,checks:n,complianceHash:this._hashCompliance(e,t,r)};return{success:!0,proof:a,valid:o,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(e=>e.satisfied).length,failedRequirements:n.filter(e=>!e.satisfied).length,overallCompliance:o},externalOperations:{submitCompliance:{endpoint:"POST /compliance/legal-validity",data:{tokenId:e.id,jurisdiction:t.code,proof:a,complianceReport:{jurisdiction:t.code,totalRequirements:i.length,satisfiedRequirements:n.filter(e=>e.satisfied).length,failedRequirements:n.filter(e=>!e.satisfied).length,overallCompliance:o}}},auditCompliance:{endpoint:"POST /audit/compliance-check",data:{tokenId:e.id,jurisdiction:t.code,result:o,checkedAt:(new Date).toISOString(),requirements:n}},notifyRegulator:o?null:{endpoint:"POST /notifications/compliance-failure",data:{tokenId:e.id,jurisdiction:t.code,failedRequirements:n.filter(e=>!e.satisfied)}}}}}catch(e){return{success:!1,error:e.message}}},prepareZeroKnowledgeProof:function(e,t,r){c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument(t&&"object"==typeof t,"Invalid statement"),c.checkArgument("string"==typeof r,"Nonce must be string");try{var n=o.sha256(i.from(this._canonicalizeForSigning(e)+r)).toString("hex"),a={type:"LegalTokenZKProof",created:(new Date).toISOString(),proofPurpose:"zeroKnowledge",statement:{claim:t.claim||"UNSPECIFIED",predicate:t.predicate||"SATISFIES",threshold:t.threshold||null},commitment:n,nonce:r,proofData:this._generateZKProofData(e,t,r)};return{success:!0,proof:a,commitment:n,externalOperations:{storeZKProof:{endpoint:"POST /proofs/zero-knowledge",data:{tokenId:e.id,proof:a,statement:t}},verifyZKProof:{endpoint:"POST /proofs/verify-zk",data:{proof:a,expectedNonce:r}},auditZKProof:{endpoint:"POST /audit/zk-proof",data:{tokenId:e.id,statement:t.claim,proofGenerated:(new Date).toISOString()}}}}}catch(e){return{success:!1,error:e.message}}},_generateZKProofData:function(e,t,r){return{challenge:o.sha256(i.from(t.claim+r)).toString("hex"),response:o.sha256(i.from(this._canonicalizeForSigning(e)+t.claim)).toString("hex"),witness:o.sha256(i.from(r+e.id+t.predicate)).toString("hex")}},_createJWS:function(e,t){var r=i.from(JSON.stringify({alg:"ES256K",typ:"JWT"})).toString("base64url");e.toString("base64url");return r+".."+t.toDER().toString("base64url")},_canonicalizeForSigning:function(e){var t=JSON.parse(JSON.stringify(e));delete t.proof,delete t.tokenHash;var r=this._sortObjectKeys(t);return JSON.stringify(r)},_createFieldCommitments:function(e,t){var r=[],n=0;return this._traverseObject(e,"",function(e,a){if("proof"!==e&&"tokenHash"!==e){var s=o.sha256(i.from(t+e+n)).toString("hex"),u=this._hashField(e,a,s);r.push({path:e,value:a,salt:s,hash:u,index:n}),n++}}.bind(this)),r},_hashField:function(e,t,r){var n=e+":"+JSON.stringify(t)+":"+r;return o.sha256(i.from(n)).toString("hex")},_createMerkleTree:function(e){var t=e.map(function(e){return e.hash});if(0===t.length)return{root:null,levels:[]};for(var r=[t],n=t;n.length>1;){for(var a=[],s=0;s<n.length;s+=2){var u=n[s],c=n[s+1]||u,l=i.concat([i.from(u,"hex"),i.from(c,"hex")]),h=o.sha256(l).toString("hex");a.push(h)}r.push(a),n=a}return{root:n[0],levels:r}},_generateMerkleProof:function(e,t){for(var r=[],i=t,n=0;n<e.levels.length-1;n++){var o=e.levels[n],a=i%2==0,s=a?i+1:i-1;s<o.length&&r.push({hash:o[s],isLeft:!a}),i=Math.floor(i/2)}return r},_verifyMerkleProof:function(e,t,r,n){for(var a=e,s=t,u=0;u<r.length;u++){var c,l=r[u];c=l.isLeft?i.concat([i.from(l.hash,"hex"),i.from(a,"hex")]):i.concat([i.from(a,"hex"),i.from(l.hash,"hex")]),a=o.sha256(c).toString("hex"),s=Math.floor(s/2)}return a===n},_traverseObject:function(e,t,r){Array.isArray(e)?e.forEach(function(e,i){var n=t+"["+i+"]";this._traverseObject(e,n,r)}.bind(this)):null!==e&&"object"==typeof e?Object.keys(e).forEach(function(i){var n=t?t+"."+i:i;this._traverseObject(e[i],n,r)}.bind(this)):r(t,e)},_getNestedValue:function(e,t){return t.split(".").reduce(function(e,t){return e&&e[t]},e)},_findFieldCommitment:function(e,t){return e.find(function(e){return e.path===t})},_checkLegalRequirement:function(e,t){switch(t.type){case"field_present":var r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:null!=r};case"field_value":r=this._getNestedValue(e,t.field);return{requirement:t.type,field:t.field,satisfied:r===t.expectedValue};case"temporal_validity":var i=new Date,n=new Date(e.issuanceDate);return{requirement:t.type,satisfied:n<=i};default:return{requirement:t.type,satisfied:!1,error:"Unknown requirement type"}}},_hashCompliance:function(e,t,r){var n={tokenId:e.id,jurisdiction:t.code,nonce:r,timestamp:(new Date).toISOString()};return o.sha256(i.from(JSON.stringify(n))).toString("hex")},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(null!==e&&"object"==typeof e){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e}};e.exports=l},5479(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=(n.Address,n.Transaction,n.util.preconditions),s={prepareRegistry:function(e){e=e||{},a.checkArgument("object"==typeof e,"Config must be object");var t={id:e.id||this._generateRegistryId(),name:e.name||"Legal Token Registry",jurisdiction:e.jurisdiction||"GLOBAL",authority:e.authority||null,created:(new Date).toISOString(),version:"1.0.0",config:{allowPublicRegistration:e.allowPublicRegistration||!1,requireApproval:e.requireApproval||!0,enableRevocation:!1!==e.enableRevocation,enableAuditTrail:!1!==e.enableAuditTrail,retentionPeriod:e.retentionPeriod||"7Y",complianceLevel:e.complianceLevel||"STANDARD"},dataStructure:{tokens:"Map<tokenId, registrationRecord>",revocations:"Map<tokenId, revocationRecord>",auditLog:"Array<auditEntry>",statistics:{totalTokens:0,activeTokens:0,revokedTokens:0,registrations:0}},externalStorage:{required:!0,type:"database_or_blockchain",endpoints:{store:"POST /registry/{id}/tokens",retrieve:"GET /registry/{id}/tokens/{tokenId}",search:"GET /registry/{id}/search",revoke:"POST /registry/{id}/revocations"}}};return{success:!0,registry:t,initialAudit:this._prepareAuditEntry({action:"REGISTRY_CREATED",actor:e.authority,timestamp:t.created,metadata:{jurisdiction:t.jurisdiction,config:t.config}}),instructions:{step1:"Store registry configuration in external system",step2:"Initialize token storage with provided data structure",step3:"Set up audit logging with provided templates",step4:"Configure external endpoints for registry operations"}}},prepareTokenRegistration:function(e,t,r){r=r||{},a.checkArgument(e&&"object"==typeof e,"Invalid token"),a.checkArgument(t&&"object"==typeof t,"Invalid registry config");try{var i=this._validateTokenForRegistration(e,t);if(!i.valid)return{success:!1,error:"Token validation failed: "+i.error};var n={tokenId:e.id,tokenHash:this._hashToken(e),token:e,status:t.requireApproval?"PENDING":"ACTIVE",registeredBy:r.registeredBy||"UNKNOWN",registeredAt:(new Date).toISOString(),approvedBy:null,approvedAt:null,metadata:r.metadata||{},compliance:{jurisdiction:e.jurisdiction||t.jurisdiction,level:this._calculateComplianceLevel(e),checks:i.checks||[]}},o=this._prepareAuditEntry({action:"TOKEN_REGISTERED",actor:r.registeredBy,tokenId:e.id,timestamp:n.registeredAt,metadata:{status:n.status,tokenType:e.type,compliance:n.compliance}});return{success:!0,registrationRecord:n,auditEntry:o,registrationId:this._generateRegistrationId(e.id),validation:i,externalOperations:{store:{endpoint:"POST /registry/"+t.id+"/tokens",data:n},audit:{endpoint:"POST /registry/"+t.id+"/audit",data:o}}}}catch(e){return{success:!1,error:e.message}}},prepareTokenApproval:function(e,t,r){try{a.checkArgument("string"==typeof e,"Token ID must be string"),a.checkArgument("string"==typeof t,"Approver must be string"),a.checkArgument(r&&"object"==typeof r,"Invalid registry config");var i={tokenId:e,status:"ACTIVE",approvedBy:t,approvedAt:(new Date).toISOString()},n=this._prepareAuditEntry({action:"TOKEN_APPROVED",actor:t,tokenId:e,timestamp:i.approvedAt});return{success:!0,approvalData:i,auditEntry:n,externalOperations:{update:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:i},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:n}}}}catch(e){return{success:!1,error:e.message}}},prepareTokenRevocation:function(e,t,r){try{if(a.checkArgument("string"==typeof e,"Token ID must be string"),a.checkArgument(t&&"object"==typeof t,"Invalid revocation"),a.checkArgument(r&&"object"==typeof r,"Invalid registry config"),!r.enableRevocation)return{success:!1,error:"Revocation is disabled for this registry"};var i={tokenId:e,reason:t.reason||"UNSPECIFIED",revokedBy:t.revokedBy||"UNKNOWN",revokedAt:(new Date).toISOString(),effectiveDate:t.effectiveDate||(new Date).toISOString(),legalBasis:t.legalBasis||null,evidence:t.evidence||null,revocationHash:this._generateRevocationHash(e,t)},n={tokenId:e,status:"REVOKED",revokedAt:i.revokedAt,revocationReason:i.reason},o=this._prepareAuditEntry({action:"TOKEN_REVOKED",actor:t.revokedBy,tokenId:e,timestamp:i.revokedAt,metadata:{reason:i.reason,legalBasis:i.legalBasis}});return{success:!0,revocationRecord:i,statusUpdate:n,auditEntry:o,revocationId:this._generateRevocationId(e),externalOperations:{storeRevocation:{endpoint:"POST /registry/"+r.id+"/revocations",data:i},updateStatus:{endpoint:"PUT /registry/"+r.id+"/tokens/"+e+"/status",data:n},audit:{endpoint:"POST /registry/"+r.id+"/audit",data:o}}}}catch(e){return{success:!1,error:e.message}}},prepareTokenStatusQuery:function(e,t){try{return a.checkArgument("string"==typeof e,"Token ID must be string"),a.checkArgument(t&&"object"==typeof t,"Invalid registry config"),{success:!0,query:{tokenId:e,registryId:t.id},externalOperations:{retrieve:{endpoint:"GET /registry/"+t.id+"/tokens/"+e,method:"GET"},checkRevocation:{endpoint:"GET /registry/"+t.id+"/revocations/"+e,method:"GET"}},expectedResponse:{found:"boolean",status:"string (PENDING|ACTIVE|REVOKED)",registeredAt:"ISO datetime",registeredBy:"string",approvedAt:"ISO datetime or null",approvedBy:"string or null",revokedAt:"ISO datetime or null",revocationReason:"string or null",compliance:"object",revocation:"object or null"}}}catch(e){return{success:!1,error:e.message}}},prepareTokenSearch:function(e,t){e=e||{};try{a.checkArgument(t&&"object"==typeof t,"Invalid registry config");var r=[];e.status&&r.push("status="+encodeURIComponent(e.status)),e.type&&r.push("type="+encodeURIComponent(e.type)),e.registeredBy&&r.push("registeredBy="+encodeURIComponent(e.registeredBy)),e.jurisdiction&&r.push("jurisdiction="+encodeURIComponent(e.jurisdiction)),e.dateFrom&&r.push("dateFrom="+encodeURIComponent(e.dateFrom)),e.dateTo&&r.push("dateTo="+encodeURIComponent(e.dateTo)),e.includeTokens&&r.push("includeTokens=true"),e.sortBy&&r.push("sortBy="+encodeURIComponent(e.sortBy)),e.sortOrder&&r.push("sortOrder="+encodeURIComponent(e.sortOrder));var i=e.offset||0,n=e.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,searchCriteria:e,externalOperations:{search:{endpoint:"GET /registry/"+t.id+"/search"+o,method:"GET"}},expectedResponse:{success:"boolean",results:"Array<tokenRecord>",totalCount:"number",totalRegistrations:"number",offset:"number",limit:"number",hasMore:"boolean"}}}catch(e){return{success:!1,error:e.message}}},prepareStatisticsQuery:function(e){return a.checkArgument(e&&"object"==typeof e,"Invalid registry config"),{success:!0,query:{registryId:e.id},externalOperations:{getStatistics:{endpoint:"GET /registry/"+e.id+"/statistics",method:"GET"}},expectedResponse:{id:"string",name:"string",jurisdiction:"string",created:"ISO datetime",statistics:{totalTokens:"number",activeTokens:"number",revokedTokens:"number",registrations:"number"},auditEntries:"number",lastActivity:"ISO datetime"}}},prepareAuditLogQuery:function(e,t){if(t=t||{},a.checkArgument(e&&"object"==typeof e,"Invalid registry config"),!e.enableAuditTrail)return{success:!1,error:"Audit trail is disabled"};var r=[];t.action&&r.push("action="+encodeURIComponent(t.action)),t.actor&&r.push("actor="+encodeURIComponent(t.actor)),t.tokenId&&r.push("tokenId="+encodeURIComponent(t.tokenId)),t.dateFrom&&r.push("dateFrom="+encodeURIComponent(t.dateFrom)),t.dateTo&&r.push("dateTo="+encodeURIComponent(t.dateTo));var i=t.offset||0,n=t.limit||100;r.push("offset="+i),r.push("limit="+n);var o=r.length>0?"?"+r.join("&"):"";return{success:!0,auditOptions:t,externalOperations:{getAuditLog:{endpoint:"GET /registry/"+e.id+"/audit"+o,method:"GET"}},expectedResponse:{success:"boolean",entries:"Array<auditEntry>",totalEntries:"number",offset:"number",limit:"number",hasMore:"boolean"}}},_generateRegistryId:function(){var e="reg_"+Date.now()+"_"+Math.random();return"reg_"+o.sha256(i.from(e)).toString("hex").substring(0,16)},_generateRegistrationId:function(e){var t="reg_"+e+"_"+Date.now();return o.sha256(i.from(t)).toString("hex").substring(0,16)},_generateRevocationId:function(e){var t="rev_"+e+"_"+Date.now();return o.sha256(i.from(t)).toString("hex").substring(0,16)},_hashToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,o.sha256(i.from(JSON.stringify(t))).toString("hex")},_generateRevocationHash:function(e,t){var r=e+(t.reason||"")+(t.revokedBy||"")+Date.now();return o.sha256(i.from(r)).toString("hex")},_validateTokenForRegistration:function(e,t){var r=[],i=!0;return e.id?r.push({field:"id",valid:!0}):(r.push({field:"id",valid:!1,error:"Missing token ID"}),i=!1),e.type?r.push({field:"type",valid:!0}):(r.push({field:"type",valid:!1,error:"Missing token type"}),i=!1),e.issuanceDate?r.push({field:"issuanceDate",valid:!0}):(r.push({field:"issuanceDate",valid:!1,error:"Missing issuance date"}),i=!1),e.proof?r.push({field:"proof",valid:!0}):(r.push({field:"proof",valid:!1,error:"Missing cryptographic proof"}),i=!1),{valid:i,checks:r}},_calculateComplianceLevel:function(e){var t="BASIC";return e.proof&&e.proof.type&&(t="STANDARD"),e.jurisdiction&&e.legalBasis&&(t="ENHANCED"),e.attestations&&e.attestations.length>0&&(t="PREMIUM"),t},_prepareAuditEntry:function(e){return{id:this._generateAuditId(),action:e.action,actor:e.actor||"SYSTEM",tokenId:e.tokenId||null,timestamp:e.timestamp||(new Date).toISOString(),metadata:e.metadata||{},hash:this._generateAuditHash(e)}},_generateAuditId:function(){var e="audit_"+Date.now()+"_"+Math.random();return"audit_"+o.sha256(i.from(e)).toString("hex").substring(0,12)},_generateAuditHash:function(e){var t=(e.action||"")+(e.actor||"")+(e.tokenId||"")+(e.timestamp||"");return o.sha256(i.from(t)).toString("hex").substring(0,16)}};e.exports=s},1232(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=n.crypto.ECDSA,s=n.crypto.Signature,u=n.PrivateKey,c=n.util.preconditions;r(4799);function l(e,t){if((t=t||{}).issuerPublicKey)return t.issuerPublicKey instanceof n.PublicKey?t.issuerPublicKey:n.PublicKey.fromString(t.issuerPublicKey);var r=e&&e.issuer;if("string"!=typeof r)return null;try{var i=r.split("#")[0].split(":")[2];return i?n.PublicKey.fromString(i):null}catch(e){return null}}var h={PROPERTY_TITLE:"PropertyTitle",VEHICLE_TITLE:"VehicleTitle",INTELLECTUAL_PROPERTY:"IntellectualProperty",MUSIC_LICENSE:"MusicLicense",SOFTWARE_LICENSE:"SoftwareLicense",FINANCIAL_INSTRUMENT:"FinancialInstrument",PROMISSORY_NOTE:"PromissoryNote",BOND:"Bond",EQUITY_SHARE:"EquityShare",PROFESSIONAL_LICENSE:"ProfessionalLicense",REGULATORY_PERMIT:"RegulatoryPermit",ACCESS_RIGHT:"AccessRight",VOTING_RIGHT:"VotingRight",ROYALTY_RIGHT:"RoyaltyRight",USAGE_RIGHT:"UsageRight"},f={create:function(e,t,r,i,n,o){o=o||{},c.checkArgument("string"==typeof e,"Right type must be string"),c.checkArgument("string"==typeof t,"Issuer DID must be string"),c.checkArgument("string"==typeof r,"Subject DID must be string"),c.checkArgument(i&&"object"==typeof i,"Claim must be object");var a=Object.values(h);c.checkArgument(a.includes(e),"Invalid right type: "+e);var s={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightToken",e],issuer:t,issuanceDate:(new Date).toISOString(),credentialSubject:{id:r,rightType:e,claim:i,jurisdiction:o.jurisdiction||"US",purpose:o.purpose||"legal_right",validFrom:o.validFrom||(new Date).toISOString(),validUntil:o.validUntil||null,transferable:!1!==o.transferable,revocable:!1!==o.revocable}};return o.metadata&&(s.credentialSubject.metadata=o.metadata),s},prepareRightToken:function(e,t,r,i,n,o){o=o||{},c.checkArgument("string"==typeof e,"Right type must be string"),c.checkArgument("string"==typeof t,"Issuer DID must be string"),c.checkArgument("string"==typeof r,"Subject DID must be string"),c.checkArgument(i&&"object"==typeof i,"Claim must be object"),c.checkArgument(n instanceof u,"Invalid issuer private key");var a=Object.values(h);c.checkArgument(a.includes(e),"Invalid right type: "+e);try{var s=this.create(e,t,r,i,n,o),l=this._signToken(s,n);return{success:!0,rightToken:l,tokenHash:l.tokenHash,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction},externalOperations:{storeToken:{endpoint:"POST /rights/tokens",data:{token:l,metadata:{type:e,issuer:t,subject:r,transferable:s.credentialSubject.transferable,revocable:s.credentialSubject.revocable,jurisdiction:s.credentialSubject.jurisdiction}}},indexToken:{endpoint:"POST /rights/index",data:{tokenId:l.id,tokenHash:l.tokenHash,type:e,issuer:t,subject:r,issuedAt:l.issuanceDate}},notifyParties:{endpoint:"POST /notifications/right-issued",data:{tokenId:l.id,issuer:t,subject:r,rightType:e}}}}}catch(e){return{success:!1,error:e.message}}},prepareRightTokenVerification:function(e,t){t=t||{};try{var r=[],i=[];this._validateTokenStructure(e,r),this._verifyTokenSignature(e,r,t),this._validateTokenTemporal(e,r,i),this._validateRightType(e,r),t.requireJurisdiction&&this._validateJurisdiction(e,t.allowedJurisdictions,r);var n={valid:0===r.length,errors:r,warnings:i,issuerDID:e.issuer,subjectDID:e.credentialSubject?e.credentialSubject.id:null,rightType:e.credentialSubject?e.credentialSubject.rightType:null,transferable:e.credentialSubject?e.credentialSubject.transferable:null,revocable:e.credentialSubject?e.credentialSubject.revocable:null,verifiedAt:(new Date).toISOString()};return{success:!0,verification:n,externalOperations:{recordVerification:{endpoint:"POST /rights/verification-record",data:{tokenId:e.id,result:n.valid,errors:r,warnings:i,verifiedAt:n.verifiedAt}},auditVerification:{endpoint:"POST /audit/right-verification",data:{tokenId:e.id,rightType:n.rightType,issuer:n.issuerDID,subject:n.subjectDID,result:n.valid,verifiedAt:n.verifiedAt}},updateTokenStatus:n.valid?{endpoint:"PUT /rights/tokens/"+e.id+"/status",data:{status:"VERIFIED",verifiedAt:n.verifiedAt}}:null}}}catch(e){return{success:!1,error:"Verification preparation failed: "+e.message}}},prepareRightTokenTransfer:function(e,t,r,i){i=i||{},c.checkArgument(e&&"object"==typeof e,"Invalid token"),c.checkArgument("string"==typeof t,"New owner DID must be string"),c.checkArgument(r instanceof u,"Invalid current owner key");try{var n=this.prepareRightTokenVerification(e,{});if(!n.success||!n.verification.valid)return{success:!1,error:"Cannot transfer invalid token: "+n.verification.errors.join(", ")};if(!e.credentialSubject.transferable)return{success:!1,error:"Token is not transferable"};var o=l({issuer:e.credentialSubject&&e.credentialSubject.id},{issuerPublicKey:i.currentOwnerPublicKey});if(!o)return{success:!1,error:"Cannot resolve current owner public key from token.credentialSubject.id; pass options.currentOwnerPublicKey"};if(r.toPublicKey().toString()!==o.toString())return{success:!1,error:"Unauthorized transfer: signing key does not match the current owner"};var a={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalRightTransfer"],issuer:e.credentialSubject.id,issuanceDate:(new Date).toISOString(),credentialSubject:{id:t,originalToken:e.id,transferFrom:e.credentialSubject.id,transferTo:t,transferDate:(new Date).toISOString(),transferReason:i.reason||"ownership_transfer",consideration:i.consideration||null}},s=this._signToken(a,r),h=JSON.parse(JSON.stringify(e));h.id="urn:uuid:"+this._generateUUID(),h.issuanceDate=(new Date).toISOString(),h.credentialSubject.id=t,h.credentialSubject.transferHistory=h.credentialSubject.transferHistory||[],h.credentialSubject.transferHistory.push({transferId:s.id,transferDate:s.issuanceDate,from:e.credentialSubject.id,to:t}),delete h.proof;var f=this._signToken(h,r);return{success:!0,newToken:f,transferProof:s,transferId:s.id,externalOperations:{recordTransfer:{endpoint:"POST /rights/transfers",data:{originalTokenId:e.id,newTokenId:f.id,transferProof:s,fromOwner:e.credentialSubject.id,toOwner:t,transferDate:s.issuanceDate}},updateOwnership:{endpoint:"PUT /rights/tokens/"+e.id+"/ownership",data:{newOwner:t,transferId:s.id,transferDate:s.issuanceDate,previousOwner:e.credentialSubject.id}},notifyParties:{endpoint:"POST /notifications/right-transferred",data:{originalTokenId:e.id,newTokenId:f.id,fromOwner:e.credentialSubject.id,toOwner:t,rightType:e.credentialSubject.rightType}},auditTransfer:{endpoint:"POST /audit/right-transfer",data:{originalTokenId:e.id,newTokenId:f.id,transferId:s.id,fromOwner:e.credentialSubject.id,toOwner:t,transferredAt:s.issuanceDate}}}}}catch(e){return{success:!1,error:e.message}}},prepareObligationToken:function(e,t,r,i){c.checkArgument(e&&"object"==typeof e,"Invalid right token"),c.checkArgument("string"==typeof t,"Obligor DID must be string"),c.checkArgument(r&&"object"==typeof r,"Obligation must be object"),c.checkArgument(i instanceof u,"Invalid issuer key");try{var n={"@context":["https://www.w3.org/2018/credentials/v1","https://smartledger.technology/contexts/ltp/v1"],id:"urn:uuid:"+this._generateUUID(),type:["VerifiableCredential","LegalObligationToken"],issuer:e.issuer,issuanceDate:(new Date).toISOString(),credentialSubject:{id:t,obligationType:"correlative_obligation",correlativeRight:e.id,rightHolder:e.credentialSubject.id,obligation:r,jurisdiction:e.credentialSubject.jurisdiction,purpose:e.credentialSubject.purpose}},o=this._signToken(n,i);return{success:!0,obligationToken:o,correlativeRight:e.id,externalOperations:{storeObligation:{endpoint:"POST /obligations/tokens",data:{obligationToken:o,correlativeRightId:e.id,obligor:t,rightHolder:e.credentialSubject.id}},linkToRight:{endpoint:"POST /rights/tokens/"+e.id+"/obligations",data:{obligationId:o.id,obligor:t,obligationType:"correlative_obligation"}},notifyObligor:{endpoint:"POST /notifications/obligation-created",data:{obligationId:o.id,obligor:t,rightHolder:e.credentialSubject.id,correlativeRight:e.id}}}}}catch(e){return{success:!1,error:e.message}}},prepareRightTypeValidation:function(e){c.checkArgument("string"==typeof e,"Right type must be string");var t=Object.values(h),r=t.includes(e);return{success:!0,validation:{type:e,valid:r,availableTypes:t,category:this._categorizeRightType(e),description:this._getRightTypeDescription(e)},externalOperations:{validateType:{endpoint:"POST /rights/validate-type",data:{type:e,valid:r}}}}},_categorizeRightType:function(e){return{PropertyTitle:"PROPERTY_RIGHT",VehicleTitle:"PROPERTY_RIGHT",IntellectualProperty:"IP_RIGHT",MusicLicense:"IP_RIGHT",SoftwareLicense:"IP_RIGHT",FinancialInstrument:"FINANCIAL_RIGHT",PromissoryNote:"FINANCIAL_RIGHT",Bond:"FINANCIAL_RIGHT",EquityShare:"FINANCIAL_RIGHT",ProfessionalLicense:"LICENSE_RIGHT",RegulatoryPermit:"LICENSE_RIGHT",AccessRight:"ACCESS_RIGHT",VotingRight:"GOVERNANCE_RIGHT",RoyaltyRight:"IP_RIGHT",UsageRight:"ACCESS_RIGHT"}[e]||"UNKNOWN"},_getRightTypeDescription:function(e){return{PropertyTitle:"Legal ownership of real estate property",VehicleTitle:"Legal ownership of motor vehicle",IntellectualProperty:"Rights to intellectual property assets",MusicLicense:"License for music performance and usage",SoftwareLicense:"License for software usage and distribution",FinancialInstrument:"Rights related to financial instruments",PromissoryNote:"Promise to pay a specified amount",Bond:"Debt security representing loan",EquityShare:"Ownership stake in company",ProfessionalLicense:"License for professional practice",RegulatoryPermit:"Permit for regulated activities",AccessRight:"Right to access resources or locations",VotingRight:"Right to participate in governance",RoyaltyRight:"Right to receive royalty payments",UsageRight:"Right to use specific assets or services"}[e]||"Unknown right type"},getRightTypes:function(){return h},verifyToken:function(e,t){var r=[];try{if(c.checkArgument(e&&"object"==typeof e,"Invalid token"),!e.proof||!e.proof.jws)return r.push("Missing signature proof"),{valid:!1,errors:r};var u=t instanceof n.PublicKey?t:n.PublicKey.fromString(t),l=this._canonicalizeToken(e),h=o.sha256(i.from(l));if(e.tokenHash&&e.tokenHash!==h.toString("hex"))return r.push("Token hash mismatch"),{valid:!1,errors:r};var f=e.proof.jws.split(".");if(3!==f.length||!f[2])return r.push("Malformed JWS"),{valid:!1,errors:r};var p=s.fromDER(i.from(f[2],"base64url")),d=new a;return d.hashbuf=h,d.sig=p,d.pubkey=u,d.verify().verified||r.push("Signature verification failed"),{valid:0===r.length,errors:r,tokenHash:h.toString("hex"),verifiedAt:(new Date).toISOString()}}catch(e){return r.push(e.message),{valid:!1,errors:r}}},_signToken:function(e,t){var r=this._canonicalizeToken(e),n=o.sha256(i.from(r)),s=new a;s.hashbuf=n,s.privkey=t,s.pubkey=t.toPublicKey(),s.sign();var u=s.sig,c={type:"EcdsaSecp256k1Signature2019",created:(new Date).toISOString(),verificationMethod:"did:smartledger:"+t.toPublicKey().toString()+"#keys-1",proofPurpose:"assertionMethod",jws:this._createJWS(n,u)},l=JSON.parse(JSON.stringify(e));return l.proof=c,l.tokenHash=n.toString("hex"),l},_createJWS:function(e,t){return i.from(JSON.stringify({alg:"ES256K",typ:"JWT"})).toString("base64url")+".."+t.toDER().toString("base64url")},_canonicalizeToken:function(e){var t=JSON.parse(JSON.stringify(e));return delete t.proof,delete t.tokenHash,JSON.stringify(this._sortObjectKeys(t))},_sortObjectKeys:function(e){if(Array.isArray(e))return e.map(this._sortObjectKeys.bind(this));if(null!==e&&"object"==typeof e){var t={};return Object.keys(e).sort().forEach(function(r){t[r]=this._sortObjectKeys(e[r])}.bind(this)),t}return e},_validateTokenStructure:function(e,t){e["@context"]||t.push("Missing @context"),e.id||t.push("Missing id"),e.type&&Array.isArray(e.type)||t.push("Missing or invalid type"),e.issuer||t.push("Missing issuer"),e.issuanceDate||t.push("Missing issuanceDate"),e.credentialSubject||t.push("Missing credentialSubject"),e.proof||t.push("Missing proof")},_verifyTokenSignature:function(e,t,r){try{if(!e.proof||!e.proof.jws)return void t.push("Missing signature proof");var n=this._canonicalizeToken(e),u=o.sha256(i.from(n));if(e.tokenHash&&e.tokenHash!==u.toString("hex"))return void t.push("Token hash mismatch");var c=l(e,r);if(!c)return void t.push("Signature not verified: issuer public key could not be resolved from token.issuer; pass options.issuerPublicKey");var h=e.proof.jws.split(".");if(3!==h.length||!h[2])return void t.push("Malformed JWS");var f=s.fromDER(i.from(h[2],"base64url")),p=new a;p.hashbuf=u,p.sig=f,p.pubkey=c,!0!==p.verify().verified&&t.push("Signature verification failed")}catch(e){t.push("Signature verification failed: "+e.message)}},_validateTokenTemporal:function(e,t,r){var i=new Date;(new Date(e.issuanceDate)>i&&t.push("Token issued in the future"),e.credentialSubject.validFrom)&&(i<new Date(e.credentialSubject.validFrom)&&r.push("Token not yet valid"));e.credentialSubject.validUntil&&(i>new Date(e.credentialSubject.validUntil)&&t.push("Token expired"))},_validateRightType:function(e,t){e.credentialSubject.rightType?Object.values(h).includes(e.credentialSubject.rightType)||t.push("Invalid right type: "+e.credentialSubject.rightType):t.push("Missing rightType")},_validateJurisdiction:function(e,t,r){e.credentialSubject.jurisdiction?t&&Array.isArray(t)&&(t.includes(e.credentialSubject.jurisdiction)||r.push("Jurisdiction not allowed: "+e.credentialSubject.jurisdiction)):r.push("Missing jurisdiction")},_generateUUID:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}};f.RightTypes=h,e.exports=f},2157(e,t,r){var i=r(5237);i.Message=r(4177),e.exports=i.Message},4177(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.deps._,a=n.PrivateKey,s=n.PublicKey,u=n.Address,c=n.encoding.BufferWriter,l=n.crypto.ECDSA,h=n.crypto.Signature,f=n.crypto.Hash.sha256sha256,p=n.util.js,d=n.util.preconditions,g=function e(t){return this instanceof e?(d.checkArgument(o.isString(t)||i.isBuffer(t),"First argument should be a string or Buffer"),o.isString(t)&&(this.messageBuffer=i.from(t)),i.isBuffer(t)&&(this.messageBuffer=t),this):new e(t)};g.sign=function(e,t){return new g(e).sign(t)},g.verify=function(e,t,r){return new g(e).verify(t,r)},g.MAGIC_BYTES=i.from("Bitcoin Signed Message:\n"),g.prototype.magicHash=function(){var e=c.varintBufNum(g.MAGIC_BYTES.length),t=c.varintBufNum(this.messageBuffer.length),r=i.concat([e,g.MAGIC_BYTES,t,this.messageBuffer]);return f(r)},g.prototype._sign=function(e){d.checkArgument(e instanceof a,"First argument should be an instance of PrivateKey");var t=this.magicHash();return l.signWithCalcI(t,e)},g.prototype.sign=function(e){return this._sign(e).toCompact().toString("base64")},g.prototype._verify=function(e,t){d.checkArgument(e instanceof s,"First argument should be an instance of PublicKey"),d.checkArgument(t instanceof h,"Second argument should be an instance of Signature");var r=this.magicHash(),i=l.verify(r,t,e);return i||(this.error="The signature was invalid"),i},g.prototype.verify=function(e,t){d.checkArgument(e),d.checkArgument(t&&o.isString(t)),o.isString(e)&&(e=u.fromString(e));var r=h.fromCompact(i.from(t,"base64")),n=new l;n.hashbuf=this.magicHash(),n.sig=r;var a=n.toPublicKey(),s=u.fromPublicKey(a,e.network);return e.toString()!==s.toString()?(this.error="The signature did not match the message digest",!1):this._verify(a,r)},g.fromString=function(e){return new g(e)},g.fromJSON=function(e){return p.isValidJSON(e)&&(e=JSON.parse(e)),g.fromObject(e)},g.prototype.toObject=function(){return{messageHex:this.messageBuffer.toString("hex")}},g.fromObject=function(e){let t=i.from(e.messageHex,"hex");return new g(t)},g.prototype.toJSON=function(){return JSON.stringify(this.toObject())},g.prototype.toString=function(){return this.messageBuffer.toString()},g.prototype.inspect=function(){return"<Message: "+this.toString()+">"},e.exports=g},9143(e,t,r){"use strict";e.exports=r(5237).errors.extend({name:"Mnemonic",message:"Internal Error on bsv-mnemonic module {0}",errors:[{name:"InvalidEntropy",message:"Entropy length must be an even multiple of 11 bits: {0}"},{name:"UnknownWordlist",message:"Could not detect the used word list: {0}"},{name:"InvalidMnemonic",message:"Mnemonic string is invalid: {0}"}]})},6162(e,t,r){var i=r(5237);i.Mnemonic=r(1324),e.exports=i.Mnemonic},1324(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.BN,a=r(7063),s=n.deps._,u=r(2185),c=r(9143),l=n.crypto.Hash,h=n.crypto.Random,f=n.util.preconditions,p=function(e,t){if(!(this instanceof p))return new p(e,t);var r,o,u;if(s.isArray(e)&&(t=e,e=null),i.isBuffer(e))u=e;else if(s.isString(e))o=a.nfkd(e);else if(s.isNumber(e))r=e;else if(e)throw new n.errors.InvalidArgument("data","Must be a Buffer, a string or an integer");if(r=r||128,t=t||p._getDictionary(o),o&&!t)throw new c.UnknownWordlist(o);if(t=t||p.Words.ENGLISH,u&&(o=p._entropy2mnemonic(u,t)),o&&!p.isValid(o,t))throw new c.InvalidMnemonic(o);if(r%32!=0||r<128)throw new n.errors.InvalidArgument("ENT","Values must be ENT > 128 and ENT % 32 == 0");o=o||p._mnemonic(r,t),Object.defineProperty(this,"wordlist",{configurable:!1,value:t}),Object.defineProperty(this,"phrase",{configurable:!1,value:o})};p.fromRandom=function(e=p.Words.ENGLISH){return new p(e)},p.fromString=function(e,t=p.Words.ENGLISH){return new p(e,t)},p.Words=r(4484),p.isValid=function(e,t){if(e=a.nfkd(e),!(t=t||p._getDictionary(e)))return!1;for(var r=e.split(" "),n="",o=0;o<r.length;o++){var s=t.indexOf(r[o]);if(s<0)return!1;n+=("00000000000"+s.toString(2)).slice(-11)}var u=n.length/33,c=n.slice(-u),l=n.slice(0,n.length-u),h=i.alloc(l.length/8);for(o=0;o<l.length/8;o++)h.writeUInt8(parseInt(n.slice(8*o,8*(o+1)),2),o);return p._entropyChecksum(h)===c},p._belongsToWordlist=function(e,t){for(var r=a.nfkd(e).split(" "),i=0;i<r.length;i++){if(t.indexOf(r[i])<0)return!1}return!0},p._getDictionary=function(e){if(!e)return null;for(var t=Object.keys(p.Words),r=0;r<t.length;r++){var i=t[r];if(p._belongsToWordlist(e,p.Words[i]))return p.Words[i]}return null},p.prototype.toSeed=function(e){return e=e||"",u(a.nfkd(this.phrase),a.nfkd("mnemonic"+e),2048,64)},p.fromSeed=function(e,t){return f.checkArgument(i.isBuffer(e),"seed must be a Buffer."),f.checkArgument(s.isArray(t)||s.isString(t),"wordlist must be a string or an array."),new p(e,t)},p.prototype.toHDPrivateKey=function(e,t){var r=this.toSeed(e);return n.HDPrivateKey.fromSeed(r,t)},p.prototype.toString=function(){return this.phrase},p.prototype.inspect=function(){return"<Mnemonic: "+this.toString()+" >"},p._mnemonic=function(e,t){var r=h.getRandomBuffer(e/8);return p._entropy2mnemonic(r,t)},p._entropy2mnemonic=function(e,t){for(var r="",i=0;i<e.length;i++)r+=("00000000"+e[i].toString(2)).slice(-8);if((r+=p._entropyChecksum(e)).length%11!=0)throw new c.InvalidEntropy(r);var n=[];for(i=0;i<r.length/11;i++){var o=parseInt(r.slice(11*i,11*(i+1)),2);n.push(t[o])}return t===p.Words.JAPANESE?n.join(" "):n.join(" ")},p._entropyChecksum=function(e){for(var t=l.sha256(e),r=8*e.length/32,i=new o(t.toString("hex"),16).toString(2);i.length%256!=0;)i="0"+i;return i.slice(0,r)},p.bsv=n,e.exports=p},6071(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5067);e.exports=function(e,t,r,o){var a=64;if(o>(Math.pow(2,32)-1)*a)throw Error("Requested key length too long");if("string"!=typeof e&&!i.isBuffer(e))throw new TypeError("key must a string or Buffer");if("string"!=typeof t&&!i.isBuffer(t))throw new TypeError("salt must a string or Buffer");"string"==typeof e&&(e=i.from(e)),"string"==typeof t&&(t=i.from(t));var s=i.alloc(o),u=i.alloc(a),c=i.alloc(a),l=i.alloc(t.length+4),h=Math.ceil(o/a),f=o-(h-1)*a;t.copy(l,0,0,t.length);for(var p=1;p<=h;p++){l[t.length+0]=p>>24&255,l[t.length+1]=p>>16&255,l[t.length+2]=p>>8&255,l[t.length+3]=255&p,(u=n.sha512hmac(l,e)).copy(c,0,0,a);for(var d=1;d<r;d++){u=n.sha512hmac(u,e);for(var g=0;g<a;g++)c[g]^=u[g]}var m=(p-1)*a,y=p===h?f:a;c.copy(s,m,0,y)}return s}},2185(e,t,r){r(5606).browser?e.exports=r(6071):e.exports=r(1459)},1459(e,t,r){"use strict";var i=r(8287).Buffer,n=r(6039);e.exports=function(e,t,r,o){var a=64;if(o>(Math.pow(2,32)-1)*a)throw Error("Requested key length too long");if("string"!=typeof e&&!i.isBuffer(e))throw new TypeError("key must a string or Buffer");if("string"!=typeof t&&!i.isBuffer(t))throw new TypeError("salt must a string or Buffer");"string"==typeof e&&(e=i.from(e)),"string"==typeof t&&(t=i.from(t));var s=i.alloc(o),u=i.alloc(a),c=i.alloc(a),l=i.alloc(t.length+4),h=Math.ceil(o/a),f=o-(h-1)*a;t.copy(l,0,0,t.length);for(var p=1;p<=h;p++){l[t.length+0]=p>>24&255,l[t.length+1]=p>>16&255,l[t.length+2]=p>>8&255,l[t.length+3]=255&p,(u=n.createHmac("sha512",e).update(l).digest()).copy(c,0,0,a);for(var d=1;d<r;d++){u=n.createHmac("sha512",e).update(u).digest();for(var g=0;g<a;g++)c[g]^=u[g]}var m=(p-1)*a,y=p===h?f:a;c.copy(s,m,0,y)}return s}},2379(e){"use strict";e.exports=["的","一","是","在","不","了","有","和","人","这","中","大","为","上","个","国","我","以","要","他","时","来","用","们","生","到","作","地","于","出","就","分","对","成","会","可","主","发","年","动","同","工","也","能","下","过","子","说","产","种","面","而","方","后","多","定","行","学","法","所","民","得","经","十","三","之","进","着","等","部","度","家","电","力","里","如","水","化","高","自","二","理","起","小","物","现","实","加","量","都","两","体","制","机","当","使","点","从","业","本","去","把","性","好","应","开","它","合","还","因","由","其","些","然","前","外","天","政","四","日","那","社","义","事","平","形","相","全","表","间","样","与","关","各","重","新","线","内","数","正","心","反","你","明","看","原","又","么","利","比","或","但","质","气","第","向","道","命","此","变","条","只","没","结","解","问","意","建","月","公","无","系","军","很","情","者","最","立","代","想","已","通","并","提","直","题","党","程","展","五","果","料","象","员","革","位","入","常","文","总","次","品","式","活","设","及","管","特","件","长","求","老","头","基","资","边","流","路","级","少","图","山","统","接","知","较","将","组","见","计","别","她","手","角","期","根","论","运","农","指","几","九","区","强","放","决","西","被","干","做","必","战","先","回","则","任","取","据","处","队","南","给","色","光","门","即","保","治","北","造","百","规","热","领","七","海","口","东","导","器","压","志","世","金","增","争","济","阶","油","思","术","极","交","受","联","什","认","六","共","权","收","证","改","清","美","再","采","转","更","单","风","切","打","白","教","速","花","带","安","场","身","车","例","真","务","具","万","每","目","至","达","走","积","示","议","声","报","斗","完","类","八","离","华","名","确","才","科","张","信","马","节","话","米","整","空","元","况","今","集","温","传","土","许","步","群","广","石","记","需","段","研","界","拉","林","律","叫","且","究","观","越","织","装","影","算","低","持","音","众","书","布","复","容","儿","须","际","商","非","验","连","断","深","难","近","矿","千","周","委","素","技","备","半","办","青","省","列","习","响","约","支","般","史","感","劳","便","团","往","酸","历","市","克","何","除","消","构","府","称","太","准","精","值","号","率","族","维","划","选","标","写","存","候","毛","亲","快","效","斯","院","查","江","型","眼","王","按","格","养","易","置","派","层","片","始","却","专","状","育","厂","京","识","适","属","圆","包","火","住","调","满","县","局","照","参","红","细","引","听","该","铁","价","严","首","底","液","官","德","随","病","苏","失","尔","死","讲","配","女","黄","推","显","谈","罪","神","艺","呢","席","含","企","望","密","批","营","项","防","举","球","英","氧","势","告","李","台","落","木","帮","轮","破","亚","师","围","注","远","字","材","排","供","河","态","封","另","施","减","树","溶","怎","止","案","言","士","均","武","固","叶","鱼","波","视","仅","费","紧","爱","左","章","早","朝","害","续","轻","服","试","食","充","兵","源","判","护","司","足","某","练","差","致","板","田","降","黑","犯","负","击","范","继","兴","似","余","坚","曲","输","修","故","城","夫","够","送","笔","船","占","右","财","吃","富","春","职","觉","汉","画","功","巴","跟","虽","杂","飞","检","吸","助","升","阳","互","初","创","抗","考","投","坏","策","古","径","换","未","跑","留","钢","曾","端","责","站","简","述","钱","副","尽","帝","射","草","冲","承","独","令","限","阿","宣","环","双","请","超","微","让","控","州","良","轴","找","否","纪","益","依","优","顶","础","载","倒","房","突","坐","粉","敌","略","客","袁","冷","胜","绝","析","块","剂","测","丝","协","诉","念","陈","仍","罗","盐","友","洋","错","苦","夜","刑","移","频","逐","靠","混","母","短","皮","终","聚","汽","村","云","哪","既","距","卫","停","烈","央","察","烧","迅","境","若","印","洲","刻","括","激","孔","搞","甚","室","待","核","校","散","侵","吧","甲","游","久","菜","味","旧","模","湖","货","损","预","阻","毫","普","稳","乙","妈","植","息","扩","银","语","挥","酒","守","拿","序","纸","医","缺","雨","吗","针","刘","啊","急","唱","误","训","愿","审","附","获","茶","鲜","粮","斤","孩","脱","硫","肥","善","龙","演","父","渐","血","欢","械","掌","歌","沙","刚","攻","谓","盾","讨","晚","粒","乱","燃","矛","乎","杀","药","宁","鲁","贵","钟","煤","读","班","伯","香","介","迫","句","丰","培","握","兰","担","弦","蛋","沉","假","穿","执","答","乐","谁","顺","烟","缩","征","脸","喜","松","脚","困","异","免","背","星","福","买","染","井","概","慢","怕","磁","倍","祖","皇","促","静","补","评","翻","肉","践","尼","衣","宽","扬","棉","希","伤","操","垂","秋","宜","氢","套","督","振","架","亮","末","宪","庆","编","牛","触","映","雷","销","诗","座","居","抓","裂","胞","呼","娘","景","威","绿","晶","厚","盟","衡","鸡","孙","延","危","胶","屋","乡","临","陆","顾","掉","呀","灯","岁","措","束","耐","剧","玉","赵","跳","哥","季","课","凯","胡","额","款","绍","卷","齐","伟","蒸","殖","永","宗","苗","川","炉","岩","弱","零","杨","奏","沿","露","杆","探","滑","镇","饭","浓","航","怀","赶","库","夺","伊","灵","税","途","灭","赛","归","召","鼓","播","盘","裁","险","康","唯","录","菌","纯","借","糖","盖","横","符","私","努","堂","域","枪","润","幅","哈","竟","熟","虫","泽","脑","壤","碳","欧","遍","侧","寨","敢","彻","虑","斜","薄","庭","纳","弹","饲","伸","折","麦","湿","暗","荷","瓦","塞","床","筑","恶","户","访","塔","奇","透","梁","刀","旋","迹","卡","氯","遇","份","毒","泥","退","洗","摆","灰","彩","卖","耗","夏","择","忙","铜","献","硬","予","繁","圈","雪","函","亦","抽","篇","阵","阴","丁","尺","追","堆","雄","迎","泛","爸","楼","避","谋","吨","野","猪","旗","累","偏","典","馆","索","秦","脂","潮","爷","豆","忽","托","惊","塑","遗","愈","朱","替","纤","粗","倾","尚","痛","楚","谢","奋","购","磨","君","池","旁","碎","骨","监","捕","弟","暴","割","贯","殊","释","词","亡","壁","顿","宝","午","尘","闻","揭","炮","残","冬","桥","妇","警","综","招","吴","付","浮","遭","徐","您","摇","谷","赞","箱","隔","订","男","吹","园","纷","唐","败","宋","玻","巨","耕","坦","荣","闭","湾","键","凡","驻","锅","救","恩","剥","凝","碱","齿","截","炼","麻","纺","禁","废","盛","版","缓","净","睛","昌","婚","涉","筒","嘴","插","岸","朗","庄","街","藏","姑","贸","腐","奴","啦","惯","乘","伙","恢","匀","纱","扎","辩","耳","彪","臣","亿","璃","抵","脉","秀","萨","俄","网","舞","店","喷","纵","寸","汗","挂","洪","贺","闪","柬","爆","烯","津","稻","墙","软","勇","像","滚","厘","蒙","芳","肯","坡","柱","荡","腿","仪","旅","尾","轧","冰","贡","登","黎","削","钻","勒","逃","障","氨","郭","峰","币","港","伏","轨","亩","毕","擦","莫","刺","浪","秘","援","株","健","售","股","岛","甘","泡","睡","童","铸","汤","阀","休","汇","舍","牧","绕","炸","哲","磷","绩","朋","淡","尖","启","陷","柴","呈","徒","颜","泪","稍","忘","泵","蓝","拖","洞","授","镜","辛","壮","锋","贫","虚","弯","摩","泰","幼","廷","尊","窗","纲","弄","隶","疑","氏","宫","姐","震","瑞","怪","尤","琴","循","描","膜","违","夹","腰","缘","珠","穷","森","枝","竹","沟","催","绳","忆","邦","剩","幸","浆","栏","拥","牙","贮","礼","滤","钠","纹","罢","拍","咱","喊","袖","埃","勤","罚","焦","潜","伍","墨","欲","缝","姓","刊","饱","仿","奖","铝","鬼","丽","跨","默","挖","链","扫","喝","袋","炭","污","幕","诸","弧","励","梅","奶","洁","灾","舟","鉴","苯","讼","抱","毁","懂","寒","智","埔","寄","届","跃","渡","挑","丹","艰","贝","碰","拔","爹","戴","码","梦","芽","熔","赤","渔","哭","敬","颗","奔","铅","仲","虎","稀","妹","乏","珍","申","桌","遵","允","隆","螺","仓","魏","锐","晓","氮","兼","隐","碍","赫","拨","忠","肃","缸","牵","抢","博","巧","壳","兄","杜","讯","诚","碧","祥","柯","页","巡","矩","悲","灌","龄","伦","票","寻","桂","铺","圣","恐","恰","郑","趣","抬","荒","腾","贴","柔","滴","猛","阔","辆","妻","填","撤","储","签","闹","扰","紫","砂","递","戏","吊","陶","伐","喂","疗","瓶","婆","抚","臂","摸","忍","虾","蜡","邻","胸","巩","挤","偶","弃","槽","劲","乳","邓","吉","仁","烂","砖","租","乌","舰","伴","瓜","浅","丙","暂","燥","橡","柳","迷","暖","牌","秧","胆","详","簧","踏","瓷","谱","呆","宾","糊","洛","辉","愤","竞","隙","怒","粘","乃","绪","肩","籍","敏","涂","熙","皆","侦","悬","掘","享","纠","醒","狂","锁","淀","恨","牲","霸","爬","赏","逆","玩","陵","祝","秒","浙","貌","役","彼","悉","鸭","趋","凤","晨","畜","辈","秩","卵","署","梯","炎","滩","棋","驱","筛","峡","冒","啥","寿","译","浸","泉","帽","迟","硅","疆","贷","漏","稿","冠","嫩","胁","芯","牢","叛","蚀","奥","鸣","岭","羊","凭","串","塘","绘","酵","融","盆","锡","庙","筹","冻","辅","摄","袭","筋","拒","僚","旱","钾","鸟","漆","沈","眉","疏","添","棒","穗","硝","韩","逼","扭","侨","凉","挺","碗","栽","炒","杯","患","馏","劝","豪","辽","勃","鸿","旦","吏","拜","狗","埋","辊","掩","饮","搬","骂","辞","勾","扣","估","蒋","绒","雾","丈","朵","姆","拟","宇","辑","陕","雕","偿","蓄","崇","剪","倡","厅","咬","驶","薯","刷","斥","番","赋","奉","佛","浇","漫","曼","扇","钙","桃","扶","仔","返","俗","亏","腔","鞋","棱","覆","框","悄","叔","撞","骗","勘","旺","沸","孤","吐","孟","渠","屈","疾","妙","惜","仰","狠","胀","谐","抛","霉","桑","岗","嘛","衰","盗","渗","脏","赖","涌","甜","曹","阅","肌","哩","厉","烃","纬","毅","昨","伪","症","煮","叹","钉","搭","茎","笼","酷","偷","弓","锥","恒","杰","坑","鼻","翼","纶","叙","狱","逮","罐","络","棚","抑","膨","蔬","寺","骤","穆","冶","枯","册","尸","凸","绅","坯","牺","焰","轰","欣","晋","瘦","御","锭","锦","丧","旬","锻","垄","搜","扑","邀","亭","酯","迈","舒","脆","酶","闲","忧","酚","顽","羽","涨","卸","仗","陪","辟","惩","杭","姚","肚","捉","飘","漂","昆","欺","吾","郎","烷","汁","呵","饰","萧","雅","邮","迁","燕","撒","姻","赴","宴","烦","债","帐","斑","铃","旨","醇","董","饼","雏","姿","拌","傅","腹","妥","揉","贤","拆","歪","葡","胺","丢","浩","徽","昂","垫","挡","览","贪","慰","缴","汪","慌","冯","诺","姜","谊","凶","劣","诬","耀","昏","躺","盈","骑","乔","溪","丛","卢","抹","闷","咨","刮","驾","缆","悟","摘","铒","掷","颇","幻","柄","惠","惨","佳","仇","腊","窝","涤","剑","瞧","堡","泼","葱","罩","霍","捞","胎","苍","滨","俩","捅","湘","砍","霞","邵","萄","疯","淮","遂","熊","粪","烘","宿","档","戈","驳","嫂","裕","徙","箭","捐","肠","撑","晒","辨","殿","莲","摊","搅","酱","屏","疫","哀","蔡","堵","沫","皱","畅","叠","阁","莱","敲","辖","钩","痕","坝","巷","饿","祸","丘","玄","溜","曰","逻","彭","尝","卿","妨","艇","吞","韦","怨","矮","歇"]},932(e){"use strict";e.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},6714(e){e.exports=["abaisser","abandon","abdiquer","abeille","abolir","aborder","aboutir","aboyer","abrasif","abreuver","abriter","abroger","abrupt","absence","absolu","absurde","abusif","abyssal","académie","acajou","acarien","accabler","accepter","acclamer","accolade","accroche","accuser","acerbe","achat","acheter","aciduler","acier","acompte","acquérir","acronyme","acteur","actif","actuel","adepte","adéquat","adhésif","adjectif","adjuger","admettre","admirer","adopter","adorer","adoucir","adresse","adroit","adulte","adverbe","aérer","aéronef","affaire","affecter","affiche","affreux","affubler","agacer","agencer","agile","agiter","agrafer","agréable","agrume","aider","aiguille","ailier","aimable","aisance","ajouter","ajuster","alarmer","alchimie","alerte","algèbre","algue","aliéner","aliment","alléger","alliage","allouer","allumer","alourdir","alpaga","altesse","alvéole","amateur","ambigu","ambre","aménager","amertume","amidon","amiral","amorcer","amour","amovible","amphibie","ampleur","amusant","analyse","anaphore","anarchie","anatomie","ancien","anéantir","angle","angoisse","anguleux","animal","annexer","annonce","annuel","anodin","anomalie","anonyme","anormal","antenne","antidote","anxieux","apaiser","apéritif","aplanir","apologie","appareil","appeler","apporter","appuyer","aquarium","aqueduc","arbitre","arbuste","ardeur","ardoise","argent","arlequin","armature","armement","armoire","armure","arpenter","arracher","arriver","arroser","arsenic","artériel","article","aspect","asphalte","aspirer","assaut","asservir","assiette","associer","assurer","asticot","astre","astuce","atelier","atome","atrium","atroce","attaque","attentif","attirer","attraper","aubaine","auberge","audace","audible","augurer","aurore","automne","autruche","avaler","avancer","avarice","avenir","averse","aveugle","aviateur","avide","avion","aviser","avoine","avouer","avril","axial","axiome","badge","bafouer","bagage","baguette","baignade","balancer","balcon","baleine","balisage","bambin","bancaire","bandage","banlieue","bannière","banquier","barbier","baril","baron","barque","barrage","bassin","bastion","bataille","bateau","batterie","baudrier","bavarder","belette","bélier","belote","bénéfice","berceau","berger","berline","bermuda","besace","besogne","bétail","beurre","biberon","bicycle","bidule","bijou","bilan","bilingue","billard","binaire","biologie","biopsie","biotype","biscuit","bison","bistouri","bitume","bizarre","blafard","blague","blanchir","blessant","blinder","blond","bloquer","blouson","bobard","bobine","boire","boiser","bolide","bonbon","bondir","bonheur","bonifier","bonus","bordure","borne","botte","boucle","boueux","bougie","boulon","bouquin","bourse","boussole","boutique","boxeur","branche","brasier","brave","brebis","brèche","breuvage","bricoler","brigade","brillant","brioche","brique","brochure","broder","bronzer","brousse","broyeur","brume","brusque","brutal","bruyant","buffle","buisson","bulletin","bureau","burin","bustier","butiner","butoir","buvable","buvette","cabanon","cabine","cachette","cadeau","cadre","caféine","caillou","caisson","calculer","calepin","calibre","calmer","calomnie","calvaire","camarade","caméra","camion","campagne","canal","caneton","canon","cantine","canular","capable","caporal","caprice","capsule","capter","capuche","carabine","carbone","caresser","caribou","carnage","carotte","carreau","carton","cascade","casier","casque","cassure","causer","caution","cavalier","caverne","caviar","cédille","ceinture","céleste","cellule","cendrier","censurer","central","cercle","cérébral","cerise","cerner","cerveau","cesser","chagrin","chaise","chaleur","chambre","chance","chapitre","charbon","chasseur","chaton","chausson","chavirer","chemise","chenille","chéquier","chercher","cheval","chien","chiffre","chignon","chimère","chiot","chlorure","chocolat","choisir","chose","chouette","chrome","chute","cigare","cigogne","cimenter","cinéma","cintrer","circuler","cirer","cirque","citerne","citoyen","citron","civil","clairon","clameur","claquer","classe","clavier","client","cligner","climat","clivage","cloche","clonage","cloporte","cobalt","cobra","cocasse","cocotier","coder","codifier","coffre","cogner","cohésion","coiffer","coincer","colère","colibri","colline","colmater","colonel","combat","comédie","commande","compact","concert","conduire","confier","congeler","connoter","consonne","contact","convexe","copain","copie","corail","corbeau","cordage","corniche","corpus","correct","cortège","cosmique","costume","coton","coude","coupure","courage","couteau","couvrir","coyote","crabe","crainte","cravate","crayon","créature","créditer","crémeux","creuser","crevette","cribler","crier","cristal","critère","croire","croquer","crotale","crucial","cruel","crypter","cubique","cueillir","cuillère","cuisine","cuivre","culminer","cultiver","cumuler","cupide","curatif","curseur","cyanure","cycle","cylindre","cynique","daigner","damier","danger","danseur","dauphin","débattre","débiter","déborder","débrider","débutant","décaler","décembre","déchirer","décider","déclarer","décorer","décrire","décupler","dédale","déductif","déesse","défensif","défiler","défrayer","dégager","dégivrer","déglutir","dégrafer","déjeuner","délice","déloger","demander","demeurer","démolir","dénicher","dénouer","dentelle","dénuder","départ","dépenser","déphaser","déplacer","déposer","déranger","dérober","désastre","descente","désert","désigner","désobéir","dessiner","destrier","détacher","détester","détourer","détresse","devancer","devenir","deviner","devoir","diable","dialogue","diamant","dicter","différer","digérer","digital","digne","diluer","dimanche","diminuer","dioxyde","directif","diriger","discuter","disposer","dissiper","distance","divertir","diviser","docile","docteur","dogme","doigt","domaine","domicile","dompter","donateur","donjon","donner","dopamine","dortoir","dorure","dosage","doseur","dossier","dotation","douanier","double","douceur","douter","doyen","dragon","draper","dresser","dribbler","droiture","duperie","duplexe","durable","durcir","dynastie","éblouir","écarter","écharpe","échelle","éclairer","éclipse","éclore","écluse","école","économie","écorce","écouter","écraser","écrémer","écrivain","écrou","écume","écureuil","édifier","éduquer","effacer","effectif","effigie","effort","effrayer","effusion","égaliser","égarer","éjecter","élaborer","élargir","électron","élégant","éléphant","élève","éligible","élitisme","éloge","élucider","éluder","emballer","embellir","embryon","émeraude","émission","emmener","émotion","émouvoir","empereur","employer","emporter","emprise","émulsion","encadrer","enchère","enclave","encoche","endiguer","endosser","endroit","enduire","énergie","enfance","enfermer","enfouir","engager","engin","englober","énigme","enjamber","enjeu","enlever","ennemi","ennuyeux","enrichir","enrobage","enseigne","entasser","entendre","entier","entourer","entraver","énumérer","envahir","enviable","envoyer","enzyme","éolien","épaissir","épargne","épatant","épaule","épicerie","épidémie","épier","épilogue","épine","épisode","épitaphe","époque","épreuve","éprouver","épuisant","équerre","équipe","ériger","érosion","erreur","éruption","escalier","espadon","espèce","espiègle","espoir","esprit","esquiver","essayer","essence","essieu","essorer","estime","estomac","estrade","étagère","étaler","étanche","étatique","éteindre","étendoir","éternel","éthanol","éthique","ethnie","étirer","étoffer","étoile","étonnant","étourdir","étrange","étroit","étude","euphorie","évaluer","évasion","éventail","évidence","éviter","évolutif","évoquer","exact","exagérer","exaucer","exceller","excitant","exclusif","excuse","exécuter","exemple","exercer","exhaler","exhorter","exigence","exiler","exister","exotique","expédier","explorer","exposer","exprimer","exquis","extensif","extraire","exulter","fable","fabuleux","facette","facile","facture","faiblir","falaise","fameux","famille","farceur","farfelu","farine","farouche","fasciner","fatal","fatigue","faucon","fautif","faveur","favori","fébrile","féconder","fédérer","félin","femme","fémur","fendoir","féodal","fermer","féroce","ferveur","festival","feuille","feutre","février","fiasco","ficeler","fictif","fidèle","figure","filature","filetage","filière","filleul","filmer","filou","filtrer","financer","finir","fiole","firme","fissure","fixer","flairer","flamme","flasque","flatteur","fléau","flèche","fleur","flexion","flocon","flore","fluctuer","fluide","fluvial","folie","fonderie","fongible","fontaine","forcer","forgeron","formuler","fortune","fossile","foudre","fougère","fouiller","foulure","fourmi","fragile","fraise","franchir","frapper","frayeur","frégate","freiner","frelon","frémir","frénésie","frère","friable","friction","frisson","frivole","froid","fromage","frontal","frotter","fruit","fugitif","fuite","fureur","furieux","furtif","fusion","futur","gagner","galaxie","galerie","gambader","garantir","gardien","garnir","garrigue","gazelle","gazon","géant","gélatine","gélule","gendarme","général","génie","genou","gentil","géologie","géomètre","géranium","germe","gestuel","geyser","gibier","gicler","girafe","givre","glace","glaive","glisser","globe","gloire","glorieux","golfeur","gomme","gonfler","gorge","gorille","goudron","gouffre","goulot","goupille","gourmand","goutte","graduel","graffiti","graine","grand","grappin","gratuit","gravir","grenat","griffure","griller","grimper","grogner","gronder","grotte","groupe","gruger","grutier","gruyère","guépard","guerrier","guide","guimauve","guitare","gustatif","gymnaste","gyrostat","habitude","hachoir","halte","hameau","hangar","hanneton","haricot","harmonie","harpon","hasard","hélium","hématome","herbe","hérisson","hermine","héron","hésiter","heureux","hiberner","hibou","hilarant","histoire","hiver","homard","hommage","homogène","honneur","honorer","honteux","horde","horizon","horloge","hormone","horrible","houleux","housse","hublot","huileux","humain","humble","humide","humour","hurler","hydromel","hygiène","hymne","hypnose","idylle","ignorer","iguane","illicite","illusion","image","imbiber","imiter","immense","immobile","immuable","impact","impérial","implorer","imposer","imprimer","imputer","incarner","incendie","incident","incliner","incolore","indexer","indice","inductif","inédit","ineptie","inexact","infini","infliger","informer","infusion","ingérer","inhaler","inhiber","injecter","injure","innocent","inoculer","inonder","inscrire","insecte","insigne","insolite","inspirer","instinct","insulter","intact","intense","intime","intrigue","intuitif","inutile","invasion","inventer","inviter","invoquer","ironique","irradier","irréel","irriter","isoler","ivoire","ivresse","jaguar","jaillir","jambe","janvier","jardin","jauger","jaune","javelot","jetable","jeton","jeudi","jeunesse","joindre","joncher","jongler","joueur","jouissif","journal","jovial","joyau","joyeux","jubiler","jugement","junior","jupon","juriste","justice","juteux","juvénile","kayak","kimono","kiosque","label","labial","labourer","lacérer","lactose","lagune","laine","laisser","laitier","lambeau","lamelle","lampe","lanceur","langage","lanterne","lapin","largeur","larme","laurier","lavabo","lavoir","lecture","légal","léger","légume","lessive","lettre","levier","lexique","lézard","liasse","libérer","libre","licence","licorne","liège","lièvre","ligature","ligoter","ligue","limer","limite","limonade","limpide","linéaire","lingot","lionceau","liquide","lisière","lister","lithium","litige","littoral","livreur","logique","lointain","loisir","lombric","loterie","louer","lourd","loutre","louve","loyal","lubie","lucide","lucratif","lueur","lugubre","luisant","lumière","lunaire","lundi","luron","lutter","luxueux","machine","magasin","magenta","magique","maigre","maillon","maintien","mairie","maison","majorer","malaxer","maléfice","malheur","malice","mallette","mammouth","mandater","maniable","manquant","manteau","manuel","marathon","marbre","marchand","mardi","maritime","marqueur","marron","marteler","mascotte","massif","matériel","matière","matraque","maudire","maussade","mauve","maximal","méchant","méconnu","médaille","médecin","méditer","méduse","meilleur","mélange","mélodie","membre","mémoire","menacer","mener","menhir","mensonge","mentor","mercredi","mérite","merle","messager","mesure","métal","météore","méthode","métier","meuble","miauler","microbe","miette","mignon","migrer","milieu","million","mimique","mince","minéral","minimal","minorer","minute","miracle","miroiter","missile","mixte","mobile","moderne","moelleux","mondial","moniteur","monnaie","monotone","monstre","montagne","monument","moqueur","morceau","morsure","mortier","moteur","motif","mouche","moufle","moulin","mousson","mouton","mouvant","multiple","munition","muraille","murène","murmure","muscle","muséum","musicien","mutation","muter","mutuel","myriade","myrtille","mystère","mythique","nageur","nappe","narquois","narrer","natation","nation","nature","naufrage","nautique","navire","nébuleux","nectar","néfaste","négation","négliger","négocier","neige","nerveux","nettoyer","neurone","neutron","neveu","niche","nickel","nitrate","niveau","noble","nocif","nocturne","noirceur","noisette","nomade","nombreux","nommer","normatif","notable","notifier","notoire","nourrir","nouveau","novateur","novembre","novice","nuage","nuancer","nuire","nuisible","numéro","nuptial","nuque","nutritif","obéir","objectif","obliger","obscur","observer","obstacle","obtenir","obturer","occasion","occuper","océan","octobre","octroyer","octupler","oculaire","odeur","odorant","offenser","officier","offrir","ogive","oiseau","oisillon","olfactif","olivier","ombrage","omettre","onctueux","onduler","onéreux","onirique","opale","opaque","opérer","opinion","opportun","opprimer","opter","optique","orageux","orange","orbite","ordonner","oreille","organe","orgueil","orifice","ornement","orque","ortie","osciller","osmose","ossature","otarie","ouragan","ourson","outil","outrager","ouvrage","ovation","oxyde","oxygène","ozone","paisible","palace","palmarès","palourde","palper","panache","panda","pangolin","paniquer","panneau","panorama","pantalon","papaye","papier","papoter","papyrus","paradoxe","parcelle","paresse","parfumer","parler","parole","parrain","parsemer","partager","parure","parvenir","passion","pastèque","paternel","patience","patron","pavillon","pavoiser","payer","paysage","peigne","peintre","pelage","pélican","pelle","pelouse","peluche","pendule","pénétrer","pénible","pensif","pénurie","pépite","péplum","perdrix","perforer","période","permuter","perplexe","persil","perte","peser","pétale","petit","pétrir","peuple","pharaon","phobie","phoque","photon","phrase","physique","piano","pictural","pièce","pierre","pieuvre","pilote","pinceau","pipette","piquer","pirogue","piscine","piston","pivoter","pixel","pizza","placard","plafond","plaisir","planer","plaque","plastron","plateau","pleurer","plexus","pliage","plomb","plonger","pluie","plumage","pochette","poésie","poète","pointe","poirier","poisson","poivre","polaire","policier","pollen","polygone","pommade","pompier","ponctuel","pondérer","poney","portique","position","posséder","posture","potager","poteau","potion","pouce","poulain","poumon","pourpre","poussin","pouvoir","prairie","pratique","précieux","prédire","préfixe","prélude","prénom","présence","prétexte","prévoir","primitif","prince","prison","priver","problème","procéder","prodige","profond","progrès","proie","projeter","prologue","promener","propre","prospère","protéger","prouesse","proverbe","prudence","pruneau","psychose","public","puceron","puiser","pulpe","pulsar","punaise","punitif","pupitre","purifier","puzzle","pyramide","quasar","querelle","question","quiétude","quitter","quotient","racine","raconter","radieux","ragondin","raideur","raisin","ralentir","rallonge","ramasser","rapide","rasage","ratisser","ravager","ravin","rayonner","réactif","réagir","réaliser","réanimer","recevoir","réciter","réclamer","récolter","recruter","reculer","recycler","rédiger","redouter","refaire","réflexe","réformer","refrain","refuge","régalien","région","réglage","régulier","réitérer","rejeter","rejouer","relatif","relever","relief","remarque","remède","remise","remonter","remplir","remuer","renard","renfort","renifler","renoncer","rentrer","renvoi","replier","reporter","reprise","reptile","requin","réserve","résineux","résoudre","respect","rester","résultat","rétablir","retenir","réticule","retomber","retracer","réunion","réussir","revanche","revivre","révolte","révulsif","richesse","rideau","rieur","rigide","rigoler","rincer","riposter","risible","risque","rituel","rival","rivière","rocheux","romance","rompre","ronce","rondin","roseau","rosier","rotatif","rotor","rotule","rouge","rouille","rouleau","routine","royaume","ruban","rubis","ruche","ruelle","rugueux","ruiner","ruisseau","ruser","rustique","rythme","sabler","saboter","sabre","sacoche","safari","sagesse","saisir","salade","salive","salon","saluer","samedi","sanction","sanglier","sarcasme","sardine","saturer","saugrenu","saumon","sauter","sauvage","savant","savonner","scalpel","scandale","scélérat","scénario","sceptre","schéma","science","scinder","score","scrutin","sculpter","séance","sécable","sécher","secouer","sécréter","sédatif","séduire","seigneur","séjour","sélectif","semaine","sembler","semence","séminal","sénateur","sensible","sentence","séparer","séquence","serein","sergent","sérieux","serrure","sérum","service","sésame","sévir","sevrage","sextuple","sidéral","siècle","siéger","siffler","sigle","signal","silence","silicium","simple","sincère","sinistre","siphon","sirop","sismique","situer","skier","social","socle","sodium","soigneux","soldat","soleil","solitude","soluble","sombre","sommeil","somnoler","sonde","songeur","sonnette","sonore","sorcier","sortir","sosie","sottise","soucieux","soudure","souffle","soulever","soupape","source","soutirer","souvenir","spacieux","spatial","spécial","sphère","spiral","stable","station","sternum","stimulus","stipuler","strict","studieux","stupeur","styliste","sublime","substrat","subtil","subvenir","succès","sucre","suffixe","suggérer","suiveur","sulfate","superbe","supplier","surface","suricate","surmener","surprise","sursaut","survie","suspect","syllabe","symbole","symétrie","synapse","syntaxe","système","tabac","tablier","tactile","tailler","talent","talisman","talonner","tambour","tamiser","tangible","tapis","taquiner","tarder","tarif","tartine","tasse","tatami","tatouage","taupe","taureau","taxer","témoin","temporel","tenaille","tendre","teneur","tenir","tension","terminer","terne","terrible","tétine","texte","thème","théorie","thérapie","thorax","tibia","tiède","timide","tirelire","tiroir","tissu","titane","titre","tituber","toboggan","tolérant","tomate","tonique","tonneau","toponyme","torche","tordre","tornade","torpille","torrent","torse","tortue","totem","toucher","tournage","tousser","toxine","traction","trafic","tragique","trahir","train","trancher","travail","trèfle","tremper","trésor","treuil","triage","tribunal","tricoter","trilogie","triomphe","tripler","triturer","trivial","trombone","tronc","tropical","troupeau","tuile","tulipe","tumulte","tunnel","turbine","tuteur","tutoyer","tuyau","tympan","typhon","typique","tyran","ubuesque","ultime","ultrason","unanime","unifier","union","unique","unitaire","univers","uranium","urbain","urticant","usage","usine","usuel","usure","utile","utopie","vacarme","vaccin","vagabond","vague","vaillant","vaincre","vaisseau","valable","valise","vallon","valve","vampire","vanille","vapeur","varier","vaseux","vassal","vaste","vecteur","vedette","végétal","véhicule","veinard","véloce","vendredi","vénérer","venger","venimeux","ventouse","verdure","vérin","vernir","verrou","verser","vertu","veston","vétéran","vétuste","vexant","vexer","viaduc","viande","victoire","vidange","vidéo","vignette","vigueur","vilain","village","vinaigre","violon","vipère","virement","virtuose","virus","visage","viseur","vision","visqueux","visuel","vital","vitesse","viticole","vitrine","vivace","vivipare","vocation","voguer","voile","voisin","voiture","volaille","volcan","voltiger","volume","vorace","vortex","voter","vouloir","voyage","voyelle","wagon","xénon","yacht","zèbre","zénith","zeste","zoologie"]},4484(e,t,r){e.exports={CHINESE:r(2379),ENGLISH:r(932),FRENCH:r(6714),ITALIAN:r(6052),JAPANESE:r(4321),SPANISH:r(8676)}},6052(e){"use strict";e.exports=["abaco","abbaglio","abbinato","abete","abisso","abolire","abrasivo","abrogato","accadere","accenno","accusato","acetone","achille","acido","acqua","acre","acrilico","acrobata","acuto","adagio","addebito","addome","adeguato","aderire","adipe","adottare","adulare","affabile","affetto","affisso","affranto","aforisma","afoso","africano","agave","agente","agevole","aggancio","agire","agitare","agonismo","agricolo","agrumeto","aguzzo","alabarda","alato","albatro","alberato","albo","albume","alce","alcolico","alettone","alfa","algebra","aliante","alibi","alimento","allagato","allegro","allievo","allodola","allusivo","almeno","alogeno","alpaca","alpestre","altalena","alterno","alticcio","altrove","alunno","alveolo","alzare","amalgama","amanita","amarena","ambito","ambrato","ameba","america","ametista","amico","ammasso","ammenda","ammirare","ammonito","amore","ampio","ampliare","amuleto","anacardo","anagrafe","analista","anarchia","anatra","anca","ancella","ancora","andare","andrea","anello","angelo","angolare","angusto","anima","annegare","annidato","anno","annuncio","anonimo","anticipo","anzi","apatico","apertura","apode","apparire","appetito","appoggio","approdo","appunto","aprile","arabica","arachide","aragosta","araldica","arancio","aratura","arazzo","arbitro","archivio","ardito","arenile","argento","argine","arguto","aria","armonia","arnese","arredato","arringa","arrosto","arsenico","arso","artefice","arzillo","asciutto","ascolto","asepsi","asettico","asfalto","asino","asola","aspirato","aspro","assaggio","asse","assoluto","assurdo","asta","astenuto","astice","astratto","atavico","ateismo","atomico","atono","attesa","attivare","attorno","attrito","attuale","ausilio","austria","autista","autonomo","autunno","avanzato","avere","avvenire","avviso","avvolgere","azione","azoto","azzimo","azzurro","babele","baccano","bacino","baco","badessa","badilata","bagnato","baita","balcone","baldo","balena","ballata","balzano","bambino","bandire","baraonda","barbaro","barca","baritono","barlume","barocco","basilico","basso","batosta","battuto","baule","bava","bavosa","becco","beffa","belgio","belva","benda","benevole","benigno","benzina","bere","berlina","beta","bibita","bici","bidone","bifido","biga","bilancia","bimbo","binocolo","biologo","bipede","bipolare","birbante","birra","biscotto","bisesto","bisnonno","bisonte","bisturi","bizzarro","blando","blatta","bollito","bonifico","bordo","bosco","botanico","bottino","bozzolo","braccio","bradipo","brama","branca","bravura","bretella","brevetto","brezza","briglia","brillante","brindare","broccolo","brodo","bronzina","brullo","bruno","bubbone","buca","budino","buffone","buio","bulbo","buono","burlone","burrasca","bussola","busta","cadetto","caduco","calamaro","calcolo","calesse","calibro","calmo","caloria","cambusa","camerata","camicia","cammino","camola","campale","canapa","candela","cane","canino","canotto","cantina","capace","capello","capitolo","capogiro","cappero","capra","capsula","carapace","carcassa","cardo","carisma","carovana","carretto","cartolina","casaccio","cascata","caserma","caso","cassone","castello","casuale","catasta","catena","catrame","cauto","cavillo","cedibile","cedrata","cefalo","celebre","cellulare","cena","cenone","centesimo","ceramica","cercare","certo","cerume","cervello","cesoia","cespo","ceto","chela","chiaro","chicca","chiedere","chimera","china","chirurgo","chitarra","ciao","ciclismo","cifrare","cigno","cilindro","ciottolo","circa","cirrosi","citrico","cittadino","ciuffo","civetta","civile","classico","clinica","cloro","cocco","codardo","codice","coerente","cognome","collare","colmato","colore","colposo","coltivato","colza","coma","cometa","commando","comodo","computer","comune","conciso","condurre","conferma","congelare","coniuge","connesso","conoscere","consumo","continuo","convegno","coperto","copione","coppia","copricapo","corazza","cordata","coricato","cornice","corolla","corpo","corredo","corsia","cortese","cosmico","costante","cottura","covato","cratere","cravatta","creato","credere","cremoso","crescita","creta","criceto","crinale","crisi","critico","croce","cronaca","crostata","cruciale","crusca","cucire","cuculo","cugino","cullato","cupola","curatore","cursore","curvo","cuscino","custode","dado","daino","dalmata","damerino","daniela","dannoso","danzare","datato","davanti","davvero","debutto","decennio","deciso","declino","decollo","decreto","dedicato","definito","deforme","degno","delegare","delfino","delirio","delta","demenza","denotato","dentro","deposito","derapata","derivare","deroga","descritto","deserto","desiderio","desumere","detersivo","devoto","diametro","dicembre","diedro","difeso","diffuso","digerire","digitale","diluvio","dinamico","dinnanzi","dipinto","diploma","dipolo","diradare","dire","dirotto","dirupo","disagio","discreto","disfare","disgelo","disposto","distanza","disumano","dito","divano","divelto","dividere","divorato","doblone","docente","doganale","dogma","dolce","domato","domenica","dominare","dondolo","dono","dormire","dote","dottore","dovuto","dozzina","drago","druido","dubbio","dubitare","ducale","duna","duomo","duplice","duraturo","ebano","eccesso","ecco","eclissi","economia","edera","edicola","edile","editoria","educare","egemonia","egli","egoismo","egregio","elaborato","elargire","elegante","elencato","eletto","elevare","elfico","elica","elmo","elsa","eluso","emanato","emblema","emesso","emiro","emotivo","emozione","empirico","emulo","endemico","enduro","energia","enfasi","enoteca","entrare","enzima","epatite","epilogo","episodio","epocale","eppure","equatore","erario","erba","erboso","erede","eremita","erigere","ermetico","eroe","erosivo","errante","esagono","esame","esanime","esaudire","esca","esempio","esercito","esibito","esigente","esistere","esito","esofago","esortato","esoso","espanso","espresso","essenza","esso","esteso","estimare","estonia","estroso","esultare","etilico","etnico","etrusco","etto","euclideo","europa","evaso","evidenza","evitato","evoluto","evviva","fabbrica","faccenda","fachiro","falco","famiglia","fanale","fanfara","fango","fantasma","fare","farfalla","farinoso","farmaco","fascia","fastoso","fasullo","faticare","fato","favoloso","febbre","fecola","fede","fegato","felpa","feltro","femmina","fendere","fenomeno","fermento","ferro","fertile","fessura","festivo","fetta","feudo","fiaba","fiducia","fifa","figurato","filo","finanza","finestra","finire","fiore","fiscale","fisico","fiume","flacone","flamenco","flebo","flemma","florido","fluente","fluoro","fobico","focaccia","focoso","foderato","foglio","folata","folclore","folgore","fondente","fonetico","fonia","fontana","forbito","forchetta","foresta","formica","fornaio","foro","fortezza","forzare","fosfato","fosso","fracasso","frana","frassino","fratello","freccetta","frenata","fresco","frigo","frollino","fronde","frugale","frutta","fucilata","fucsia","fuggente","fulmine","fulvo","fumante","fumetto","fumoso","fune","funzione","fuoco","furbo","furgone","furore","fuso","futile","gabbiano","gaffe","galateo","gallina","galoppo","gambero","gamma","garanzia","garbo","garofano","garzone","gasdotto","gasolio","gastrico","gatto","gaudio","gazebo","gazzella","geco","gelatina","gelso","gemello","gemmato","gene","genitore","gennaio","genotipo","gergo","ghepardo","ghiaccio","ghisa","giallo","gilda","ginepro","giocare","gioiello","giorno","giove","girato","girone","gittata","giudizio","giurato","giusto","globulo","glutine","gnomo","gobba","golf","gomito","gommone","gonfio","gonna","governo","gracile","grado","grafico","grammo","grande","grattare","gravoso","grazia","greca","gregge","grifone","grigio","grinza","grotta","gruppo","guadagno","guaio","guanto","guardare","gufo","guidare","ibernato","icona","identico","idillio","idolo","idra","idrico","idrogeno","igiene","ignaro","ignorato","ilare","illeso","illogico","illudere","imballo","imbevuto","imbocco","imbuto","immane","immerso","immolato","impacco","impeto","impiego","importo","impronta","inalare","inarcare","inattivo","incanto","incendio","inchino","incisivo","incluso","incontro","incrocio","incubo","indagine","india","indole","inedito","infatti","infilare","inflitto","ingaggio","ingegno","inglese","ingordo","ingrosso","innesco","inodore","inoltrare","inondato","insano","insetto","insieme","insonnia","insulina","intasato","intero","intonaco","intuito","inumidire","invalido","invece","invito","iperbole","ipnotico","ipotesi","ippica","iride","irlanda","ironico","irrigato","irrorare","isolato","isotopo","isterico","istituto","istrice","italia","iterare","labbro","labirinto","lacca","lacerato","lacrima","lacuna","laddove","lago","lampo","lancetta","lanterna","lardoso","larga","laringe","lastra","latenza","latino","lattuga","lavagna","lavoro","legale","leggero","lembo","lentezza","lenza","leone","lepre","lesivo","lessato","lesto","letterale","leva","levigato","libero","lido","lievito","lilla","limatura","limitare","limpido","lineare","lingua","liquido","lira","lirica","lisca","lite","litigio","livrea","locanda","lode","logica","lombare","londra","longevo","loquace","lorenzo","loto","lotteria","luce","lucidato","lumaca","luminoso","lungo","lupo","luppolo","lusinga","lusso","lutto","macabro","macchina","macero","macinato","madama","magico","maglia","magnete","magro","maiolica","malafede","malgrado","malinteso","malsano","malto","malumore","mana","mancia","mandorla","mangiare","manifesto","mannaro","manovra","mansarda","mantide","manubrio","mappa","maratona","marcire","maretta","marmo","marsupio","maschera","massaia","mastino","materasso","matricola","mattone","maturo","mazurca","meandro","meccanico","mecenate","medesimo","meditare","mega","melassa","melis","melodia","meninge","meno","mensola","mercurio","merenda","merlo","meschino","mese","messere","mestolo","metallo","metodo","mettere","miagolare","mica","micelio","michele","microbo","midollo","miele","migliore","milano","milite","mimosa","minerale","mini","minore","mirino","mirtillo","miscela","missiva","misto","misurare","mitezza","mitigare","mitra","mittente","mnemonico","modello","modifica","modulo","mogano","mogio","mole","molosso","monastero","monco","mondina","monetario","monile","monotono","monsone","montato","monviso","mora","mordere","morsicato","mostro","motivato","motosega","motto","movenza","movimento","mozzo","mucca","mucosa","muffa","mughetto","mugnaio","mulatto","mulinello","multiplo","mummia","munto","muovere","murale","musa","muscolo","musica","mutevole","muto","nababbo","nafta","nanometro","narciso","narice","narrato","nascere","nastrare","naturale","nautica","naviglio","nebulosa","necrosi","negativo","negozio","nemmeno","neofita","neretto","nervo","nessuno","nettuno","neutrale","neve","nevrotico","nicchia","ninfa","nitido","nobile","nocivo","nodo","nome","nomina","nordico","normale","norvegese","nostrano","notare","notizia","notturno","novella","nucleo","nulla","numero","nuovo","nutrire","nuvola","nuziale","oasi","obbedire","obbligo","obelisco","oblio","obolo","obsoleto","occasione","occhio","occidente","occorrere","occultare","ocra","oculato","odierno","odorare","offerta","offrire","offuscato","oggetto","oggi","ognuno","olandese","olfatto","oliato","oliva","ologramma","oltre","omaggio","ombelico","ombra","omega","omissione","ondoso","onere","onice","onnivoro","onorevole","onta","operato","opinione","opposto","oracolo","orafo","ordine","orecchino","orefice","orfano","organico","origine","orizzonte","orma","ormeggio","ornativo","orologio","orrendo","orribile","ortensia","ortica","orzata","orzo","osare","oscurare","osmosi","ospedale","ospite","ossa","ossidare","ostacolo","oste","otite","otre","ottagono","ottimo","ottobre","ovale","ovest","ovino","oviparo","ovocito","ovunque","ovviare","ozio","pacchetto","pace","pacifico","padella","padrone","paese","paga","pagina","palazzina","palesare","pallido","palo","palude","pandoro","pannello","paolo","paonazzo","paprica","parabola","parcella","parere","pargolo","pari","parlato","parola","partire","parvenza","parziale","passivo","pasticca","patacca","patologia","pattume","pavone","peccato","pedalare","pedonale","peggio","peloso","penare","pendice","penisola","pennuto","penombra","pensare","pentola","pepe","pepita","perbene","percorso","perdonato","perforare","pergamena","periodo","permesso","perno","perplesso","persuaso","pertugio","pervaso","pesatore","pesista","peso","pestifero","petalo","pettine","petulante","pezzo","piacere","pianta","piattino","piccino","picozza","piega","pietra","piffero","pigiama","pigolio","pigro","pila","pilifero","pillola","pilota","pimpante","pineta","pinna","pinolo","pioggia","piombo","piramide","piretico","pirite","pirolisi","pitone","pizzico","placebo","planare","plasma","platano","plenario","pochezza","poderoso","podismo","poesia","poggiare","polenta","poligono","pollice","polmonite","polpetta","polso","poltrona","polvere","pomice","pomodoro","ponte","popoloso","porfido","poroso","porpora","porre","portata","posa","positivo","possesso","postulato","potassio","potere","pranzo","prassi","pratica","precluso","predica","prefisso","pregiato","prelievo","premere","prenotare","preparato","presenza","pretesto","prevalso","prima","principe","privato","problema","procura","produrre","profumo","progetto","prolunga","promessa","pronome","proposta","proroga","proteso","prova","prudente","prugna","prurito","psiche","pubblico","pudica","pugilato","pugno","pulce","pulito","pulsante","puntare","pupazzo","pupilla","puro","quadro","qualcosa","quasi","querela","quota","raccolto","raddoppio","radicale","radunato","raffica","ragazzo","ragione","ragno","ramarro","ramingo","ramo","randagio","rantolare","rapato","rapina","rappreso","rasatura","raschiato","rasente","rassegna","rastrello","rata","ravveduto","reale","recepire","recinto","recluta","recondito","recupero","reddito","redimere","regalato","registro","regola","regresso","relazione","remare","remoto","renna","replica","reprimere","reputare","resa","residente","responso","restauro","rete","retina","retorica","rettifica","revocato","riassunto","ribadire","ribelle","ribrezzo","ricarica","ricco","ricevere","riciclato","ricordo","ricreduto","ridicolo","ridurre","rifasare","riflesso","riforma","rifugio","rigare","rigettato","righello","rilassato","rilevato","rimanere","rimbalzo","rimedio","rimorchio","rinascita","rincaro","rinforzo","rinnovo","rinomato","rinsavito","rintocco","rinuncia","rinvenire","riparato","ripetuto","ripieno","riportare","ripresa","ripulire","risata","rischio","riserva","risibile","riso","rispetto","ristoro","risultato","risvolto","ritardo","ritegno","ritmico","ritrovo","riunione","riva","riverso","rivincita","rivolto","rizoma","roba","robotico","robusto","roccia","roco","rodaggio","rodere","roditore","rogito","rollio","romantico","rompere","ronzio","rosolare","rospo","rotante","rotondo","rotula","rovescio","rubizzo","rubrica","ruga","rullino","rumine","rumoroso","ruolo","rupe","russare","rustico","sabato","sabbiare","sabotato","sagoma","salasso","saldatura","salgemma","salivare","salmone","salone","saltare","saluto","salvo","sapere","sapido","saporito","saraceno","sarcasmo","sarto","sassoso","satellite","satira","satollo","saturno","savana","savio","saziato","sbadiglio","sbalzo","sbancato","sbarra","sbattere","sbavare","sbendare","sbirciare","sbloccato","sbocciato","sbrinare","sbruffone","sbuffare","scabroso","scadenza","scala","scambiare","scandalo","scapola","scarso","scatenare","scavato","scelto","scenico","scettro","scheda","schiena","sciarpa","scienza","scindere","scippo","sciroppo","scivolo","sclerare","scodella","scolpito","scomparto","sconforto","scoprire","scorta","scossone","scozzese","scriba","scrollare","scrutinio","scuderia","scultore","scuola","scuro","scusare","sdebitare","sdoganare","seccatura","secondo","sedano","seggiola","segnalato","segregato","seguito","selciato","selettivo","sella","selvaggio","semaforo","sembrare","seme","seminato","sempre","senso","sentire","sepolto","sequenza","serata","serbato","sereno","serio","serpente","serraglio","servire","sestina","setola","settimana","sfacelo","sfaldare","sfamato","sfarzoso","sfaticato","sfera","sfida","sfilato","sfinge","sfocato","sfoderare","sfogo","sfoltire","sforzato","sfratto","sfruttato","sfuggito","sfumare","sfuso","sgabello","sgarbato","sgonfiare","sgorbio","sgrassato","sguardo","sibilo","siccome","sierra","sigla","signore","silenzio","sillaba","simbolo","simpatico","simulato","sinfonia","singolo","sinistro","sino","sintesi","sinusoide","sipario","sisma","sistole","situato","slitta","slogatura","sloveno","smarrito","smemorato","smentito","smeraldo","smilzo","smontare","smottato","smussato","snellire","snervato","snodo","sobbalzo","sobrio","soccorso","sociale","sodale","soffitto","sogno","soldato","solenne","solido","sollazzo","solo","solubile","solvente","somatico","somma","sonda","sonetto","sonnifero","sopire","soppeso","sopra","sorgere","sorpasso","sorriso","sorso","sorteggio","sorvolato","sospiro","sosta","sottile","spada","spalla","spargere","spatola","spavento","spazzola","specie","spedire","spegnere","spelatura","speranza","spessore","spettrale","spezzato","spia","spigoloso","spillato","spinoso","spirale","splendido","sportivo","sposo","spranga","sprecare","spronato","spruzzo","spuntino","squillo","sradicare","srotolato","stabile","stacco","staffa","stagnare","stampato","stantio","starnuto","stasera","statuto","stelo","steppa","sterzo","stiletto","stima","stirpe","stivale","stizzoso","stonato","storico","strappo","stregato","stridulo","strozzare","strutto","stuccare","stufo","stupendo","subentro","succoso","sudore","suggerito","sugo","sultano","suonare","superbo","supporto","surgelato","surrogato","sussurro","sutura","svagare","svedese","sveglio","svelare","svenuto","svezia","sviluppo","svista","svizzera","svolta","svuotare","tabacco","tabulato","tacciare","taciturno","tale","talismano","tampone","tannino","tara","tardivo","targato","tariffa","tarpare","tartaruga","tasto","tattico","taverna","tavolata","tazza","teca","tecnico","telefono","temerario","tempo","temuto","tendone","tenero","tensione","tentacolo","teorema","terme","terrazzo","terzetto","tesi","tesserato","testato","tetro","tettoia","tifare","tigella","timbro","tinto","tipico","tipografo","tiraggio","tiro","titanio","titolo","titubante","tizio","tizzone","toccare","tollerare","tolto","tombola","tomo","tonfo","tonsilla","topazio","topologia","toppa","torba","tornare","torrone","tortora","toscano","tossire","tostatura","totano","trabocco","trachea","trafila","tragedia","tralcio","tramonto","transito","trapano","trarre","trasloco","trattato","trave","treccia","tremolio","trespolo","tributo","tricheco","trifoglio","trillo","trincea","trio","tristezza","triturato","trivella","tromba","trono","troppo","trottola","trovare","truccato","tubatura","tuffato","tulipano","tumulto","tunisia","turbare","turchino","tuta","tutela","ubicato","uccello","uccisore","udire","uditivo","uffa","ufficio","uguale","ulisse","ultimato","umano","umile","umorismo","uncinetto","ungere","ungherese","unicorno","unificato","unisono","unitario","unte","uovo","upupa","uragano","urgenza","urlo","usanza","usato","uscito","usignolo","usuraio","utensile","utilizzo","utopia","vacante","vaccinato","vagabondo","vagliato","valanga","valgo","valico","valletta","valoroso","valutare","valvola","vampata","vangare","vanitoso","vano","vantaggio","vanvera","vapore","varano","varcato","variante","vasca","vedetta","vedova","veduto","vegetale","veicolo","velcro","velina","velluto","veloce","venato","vendemmia","vento","verace","verbale","vergogna","verifica","vero","verruca","verticale","vescica","vessillo","vestale","veterano","vetrina","vetusto","viandante","vibrante","vicenda","vichingo","vicinanza","vidimare","vigilia","vigneto","vigore","vile","villano","vimini","vincitore","viola","vipera","virgola","virologo","virulento","viscoso","visione","vispo","vissuto","visura","vita","vitello","vittima","vivanda","vivido","viziare","voce","voga","volatile","volere","volpe","voragine","vulcano","zampogna","zanna","zappato","zattera","zavorra","zefiro","zelante","zelo","zenzero","zerbino","zibetto","zinco","zircone","zitto","zolla","zotico","zucchero","zufolo","zulu","zuppa"]},4321(e){"use strict";e.exports=["あいこくしん","あいさつ","あいだ","あおぞら","あかちゃん","あきる","あけがた","あける","あこがれる","あさい","あさひ","あしあと","あじわう","あずかる","あずき","あそぶ","あたえる","あたためる","あたりまえ","あたる","あつい","あつかう","あっしゅく","あつまり","あつめる","あてな","あてはまる","あひる","あぶら","あぶる","あふれる","あまい","あまど","あまやかす","あまり","あみもの","あめりか","あやまる","あゆむ","あらいぐま","あらし","あらすじ","あらためる","あらゆる","あらわす","ありがとう","あわせる","あわてる","あんい","あんがい","あんこ","あんぜん","あんてい","あんない","あんまり","いいだす","いおん","いがい","いがく","いきおい","いきなり","いきもの","いきる","いくじ","いくぶん","いけばな","いけん","いこう","いこく","いこつ","いさましい","いさん","いしき","いじゅう","いじょう","いじわる","いずみ","いずれ","いせい","いせえび","いせかい","いせき","いぜん","いそうろう","いそがしい","いだい","いだく","いたずら","いたみ","いたりあ","いちおう","いちじ","いちど","いちば","いちぶ","いちりゅう","いつか","いっしゅん","いっせい","いっそう","いったん","いっち","いってい","いっぽう","いてざ","いてん","いどう","いとこ","いない","いなか","いねむり","いのち","いのる","いはつ","いばる","いはん","いびき","いひん","いふく","いへん","いほう","いみん","いもうと","いもたれ","いもり","いやがる","いやす","いよかん","いよく","いらい","いらすと","いりぐち","いりょう","いれい","いれもの","いれる","いろえんぴつ","いわい","いわう","いわかん","いわば","いわゆる","いんげんまめ","いんさつ","いんしょう","いんよう","うえき","うえる","うおざ","うがい","うかぶ","うかべる","うきわ","うくらいな","うくれれ","うけたまわる","うけつけ","うけとる","うけもつ","うける","うごかす","うごく","うこん","うさぎ","うしなう","うしろがみ","うすい","うすぎ","うすぐらい","うすめる","うせつ","うちあわせ","うちがわ","うちき","うちゅう","うっかり","うつくしい","うったえる","うつる","うどん","うなぎ","うなじ","うなずく","うなる","うねる","うのう","うぶげ","うぶごえ","うまれる","うめる","うもう","うやまう","うよく","うらがえす","うらぐち","うらない","うりあげ","うりきれ","うるさい","うれしい","うれゆき","うれる","うろこ","うわき","うわさ","うんこう","うんちん","うんてん","うんどう","えいえん","えいが","えいきょう","えいご","えいせい","えいぶん","えいよう","えいわ","えおり","えがお","えがく","えきたい","えくせる","えしゃく","えすて","えつらん","えのぐ","えほうまき","えほん","えまき","えもじ","えもの","えらい","えらぶ","えりあ","えんえん","えんかい","えんぎ","えんげき","えんしゅう","えんぜつ","えんそく","えんちょう","えんとつ","おいかける","おいこす","おいしい","おいつく","おうえん","おうさま","おうじ","おうせつ","おうたい","おうふく","おうべい","おうよう","おえる","おおい","おおう","おおどおり","おおや","おおよそ","おかえり","おかず","おがむ","おかわり","おぎなう","おきる","おくさま","おくじょう","おくりがな","おくる","おくれる","おこす","おこなう","おこる","おさえる","おさない","おさめる","おしいれ","おしえる","おじぎ","おじさん","おしゃれ","おそらく","おそわる","おたがい","おたく","おだやか","おちつく","おっと","おつり","おでかけ","おとしもの","おとなしい","おどり","おどろかす","おばさん","おまいり","おめでとう","おもいで","おもう","おもたい","おもちゃ","おやつ","おやゆび","およぼす","おらんだ","おろす","おんがく","おんけい","おんしゃ","おんせん","おんだん","おんちゅう","おんどけい","かあつ","かいが","がいき","がいけん","がいこう","かいさつ","かいしゃ","かいすいよく","かいぜん","かいぞうど","かいつう","かいてん","かいとう","かいふく","がいへき","かいほう","かいよう","がいらい","かいわ","かえる","かおり","かかえる","かがく","かがし","かがみ","かくご","かくとく","かざる","がぞう","かたい","かたち","がちょう","がっきゅう","がっこう","がっさん","がっしょう","かなざわし","かのう","がはく","かぶか","かほう","かほご","かまう","かまぼこ","かめれおん","かゆい","かようび","からい","かるい","かろう","かわく","かわら","がんか","かんけい","かんこう","かんしゃ","かんそう","かんたん","かんち","がんばる","きあい","きあつ","きいろ","ぎいん","きうい","きうん","きえる","きおう","きおく","きおち","きおん","きかい","きかく","きかんしゃ","ききて","きくばり","きくらげ","きけんせい","きこう","きこえる","きこく","きさい","きさく","きさま","きさらぎ","ぎじかがく","ぎしき","ぎじたいけん","ぎじにってい","ぎじゅつしゃ","きすう","きせい","きせき","きせつ","きそう","きぞく","きぞん","きたえる","きちょう","きつえん","ぎっちり","きつつき","きつね","きてい","きどう","きどく","きない","きなが","きなこ","きぬごし","きねん","きのう","きのした","きはく","きびしい","きひん","きふく","きぶん","きぼう","きほん","きまる","きみつ","きむずかしい","きめる","きもだめし","きもち","きもの","きゃく","きやく","ぎゅうにく","きよう","きょうりゅう","きらい","きらく","きりん","きれい","きれつ","きろく","ぎろん","きわめる","ぎんいろ","きんかくじ","きんじょ","きんようび","ぐあい","くいず","くうかん","くうき","くうぐん","くうこう","ぐうせい","くうそう","ぐうたら","くうふく","くうぼ","くかん","くきょう","くげん","ぐこう","くさい","くさき","くさばな","くさる","くしゃみ","くしょう","くすのき","くすりゆび","くせげ","くせん","ぐたいてき","くださる","くたびれる","くちこみ","くちさき","くつした","ぐっすり","くつろぐ","くとうてん","くどく","くなん","くねくね","くのう","くふう","くみあわせ","くみたてる","くめる","くやくしょ","くらす","くらべる","くるま","くれる","くろう","くわしい","ぐんかん","ぐんしょく","ぐんたい","ぐんて","けあな","けいかく","けいけん","けいこ","けいさつ","げいじゅつ","けいたい","げいのうじん","けいれき","けいろ","けおとす","けおりもの","げきか","げきげん","げきだん","げきちん","げきとつ","げきは","げきやく","げこう","げこくじょう","げざい","けさき","げざん","けしき","けしごむ","けしょう","げすと","けたば","けちゃっぷ","けちらす","けつあつ","けつい","けつえき","けっこん","けつじょ","けっせき","けってい","けつまつ","げつようび","げつれい","けつろん","げどく","けとばす","けとる","けなげ","けなす","けなみ","けぬき","げねつ","けねん","けはい","げひん","けぶかい","げぼく","けまり","けみかる","けむし","けむり","けもの","けらい","けろけろ","けわしい","けんい","けんえつ","けんお","けんか","げんき","けんげん","けんこう","けんさく","けんしゅう","けんすう","げんそう","けんちく","けんてい","けんとう","けんない","けんにん","げんぶつ","けんま","けんみん","けんめい","けんらん","けんり","こあくま","こいぬ","こいびと","ごうい","こうえん","こうおん","こうかん","ごうきゅう","ごうけい","こうこう","こうさい","こうじ","こうすい","ごうせい","こうそく","こうたい","こうちゃ","こうつう","こうてい","こうどう","こうない","こうはい","ごうほう","ごうまん","こうもく","こうりつ","こえる","こおり","ごかい","ごがつ","ごかん","こくご","こくさい","こくとう","こくない","こくはく","こぐま","こけい","こける","ここのか","こころ","こさめ","こしつ","こすう","こせい","こせき","こぜん","こそだて","こたい","こたえる","こたつ","こちょう","こっか","こつこつ","こつばん","こつぶ","こてい","こてん","ことがら","ことし","ことば","ことり","こなごな","こねこね","このまま","このみ","このよ","ごはん","こひつじ","こふう","こふん","こぼれる","ごまあぶら","こまかい","ごますり","こまつな","こまる","こむぎこ","こもじ","こもち","こもの","こもん","こやく","こやま","こゆう","こゆび","こよい","こよう","こりる","これくしょん","ころっけ","こわもて","こわれる","こんいん","こんかい","こんき","こんしゅう","こんすい","こんだて","こんとん","こんなん","こんびに","こんぽん","こんまけ","こんや","こんれい","こんわく","ざいえき","さいかい","さいきん","ざいげん","ざいこ","さいしょ","さいせい","ざいたく","ざいちゅう","さいてき","ざいりょう","さうな","さかいし","さがす","さかな","さかみち","さがる","さぎょう","さくし","さくひん","さくら","さこく","さこつ","さずかる","ざせき","さたん","さつえい","ざつおん","ざっか","ざつがく","さっきょく","ざっし","さつじん","ざっそう","さつたば","さつまいも","さてい","さといも","さとう","さとおや","さとし","さとる","さのう","さばく","さびしい","さべつ","さほう","さほど","さます","さみしい","さみだれ","さむけ","さめる","さやえんどう","さゆう","さよう","さよく","さらだ","ざるそば","さわやか","さわる","さんいん","さんか","さんきゃく","さんこう","さんさい","ざんしょ","さんすう","さんせい","さんそ","さんち","さんま","さんみ","さんらん","しあい","しあげ","しあさって","しあわせ","しいく","しいん","しうち","しえい","しおけ","しかい","しかく","じかん","しごと","しすう","じだい","したうけ","したぎ","したて","したみ","しちょう","しちりん","しっかり","しつじ","しつもん","してい","してき","してつ","じてん","じどう","しなぎれ","しなもの","しなん","しねま","しねん","しのぐ","しのぶ","しはい","しばかり","しはつ","しはらい","しはん","しひょう","しふく","じぶん","しへい","しほう","しほん","しまう","しまる","しみん","しむける","じむしょ","しめい","しめる","しもん","しゃいん","しゃうん","しゃおん","じゃがいも","しやくしょ","しゃくほう","しゃけん","しゃこ","しゃざい","しゃしん","しゃせん","しゃそう","しゃたい","しゃちょう","しゃっきん","じゃま","しゃりん","しゃれい","じゆう","じゅうしょ","しゅくはく","じゅしん","しゅっせき","しゅみ","しゅらば","じゅんばん","しょうかい","しょくたく","しょっけん","しょどう","しょもつ","しらせる","しらべる","しんか","しんこう","じんじゃ","しんせいじ","しんちく","しんりん","すあげ","すあし","すあな","ずあん","すいえい","すいか","すいとう","ずいぶん","すいようび","すうがく","すうじつ","すうせん","すおどり","すきま","すくう","すくない","すける","すごい","すこし","ずさん","すずしい","すすむ","すすめる","すっかり","ずっしり","ずっと","すてき","すてる","すねる","すのこ","すはだ","すばらしい","ずひょう","ずぶぬれ","すぶり","すふれ","すべて","すべる","ずほう","すぼん","すまい","すめし","すもう","すやき","すらすら","するめ","すれちがう","すろっと","すわる","すんぜん","すんぽう","せあぶら","せいかつ","せいげん","せいじ","せいよう","せおう","せかいかん","せきにん","せきむ","せきゆ","せきらんうん","せけん","せこう","せすじ","せたい","せたけ","せっかく","せっきゃく","ぜっく","せっけん","せっこつ","せっさたくま","せつぞく","せつだん","せつでん","せっぱん","せつび","せつぶん","せつめい","せつりつ","せなか","せのび","せはば","せびろ","せぼね","せまい","せまる","せめる","せもたれ","せりふ","ぜんあく","せんい","せんえい","せんか","せんきょ","せんく","せんげん","ぜんご","せんさい","せんしゅ","せんすい","せんせい","せんぞ","せんたく","せんちょう","せんてい","せんとう","せんぬき","せんねん","せんぱい","ぜんぶ","ぜんぽう","せんむ","せんめんじょ","せんもん","せんやく","せんゆう","せんよう","ぜんら","ぜんりゃく","せんれい","せんろ","そあく","そいとげる","そいね","そうがんきょう","そうき","そうご","そうしん","そうだん","そうなん","そうび","そうめん","そうり","そえもの","そえん","そがい","そげき","そこう","そこそこ","そざい","そしな","そせい","そせん","そそぐ","そだてる","そつう","そつえん","そっかん","そつぎょう","そっけつ","そっこう","そっせん","そっと","そとがわ","そとづら","そなえる","そなた","そふぼ","そぼく","そぼろ","そまつ","そまる","そむく","そむりえ","そめる","そもそも","そよかぜ","そらまめ","そろう","そんかい","そんけい","そんざい","そんしつ","そんぞく","そんちょう","ぞんび","ぞんぶん","そんみん","たあい","たいいん","たいうん","たいえき","たいおう","だいがく","たいき","たいぐう","たいけん","たいこ","たいざい","だいじょうぶ","だいすき","たいせつ","たいそう","だいたい","たいちょう","たいてい","だいどころ","たいない","たいねつ","たいのう","たいはん","だいひょう","たいふう","たいへん","たいほ","たいまつばな","たいみんぐ","たいむ","たいめん","たいやき","たいよう","たいら","たいりょく","たいる","たいわん","たうえ","たえる","たおす","たおる","たおれる","たかい","たかね","たきび","たくさん","たこく","たこやき","たさい","たしざん","だじゃれ","たすける","たずさわる","たそがれ","たたかう","たたく","ただしい","たたみ","たちばな","だっかい","だっきゃく","だっこ","だっしゅつ","だったい","たてる","たとえる","たなばた","たにん","たぬき","たのしみ","たはつ","たぶん","たべる","たぼう","たまご","たまる","だむる","ためいき","ためす","ためる","たもつ","たやすい","たよる","たらす","たりきほんがん","たりょう","たりる","たると","たれる","たれんと","たろっと","たわむれる","だんあつ","たんい","たんおん","たんか","たんき","たんけん","たんご","たんさん","たんじょうび","だんせい","たんそく","たんたい","だんち","たんてい","たんとう","だんな","たんにん","だんねつ","たんのう","たんぴん","だんぼう","たんまつ","たんめい","だんれつ","だんろ","だんわ","ちあい","ちあん","ちいき","ちいさい","ちえん","ちかい","ちから","ちきゅう","ちきん","ちけいず","ちけん","ちこく","ちさい","ちしき","ちしりょう","ちせい","ちそう","ちたい","ちたん","ちちおや","ちつじょ","ちてき","ちてん","ちぬき","ちぬり","ちのう","ちひょう","ちへいせん","ちほう","ちまた","ちみつ","ちみどろ","ちめいど","ちゃんこなべ","ちゅうい","ちゆりょく","ちょうし","ちょさくけん","ちらし","ちらみ","ちりがみ","ちりょう","ちるど","ちわわ","ちんたい","ちんもく","ついか","ついたち","つうか","つうじょう","つうはん","つうわ","つかう","つかれる","つくね","つくる","つけね","つける","つごう","つたえる","つづく","つつじ","つつむ","つとめる","つながる","つなみ","つねづね","つのる","つぶす","つまらない","つまる","つみき","つめたい","つもり","つもる","つよい","つるぼ","つるみく","つわもの","つわり","てあし","てあて","てあみ","ていおん","ていか","ていき","ていけい","ていこく","ていさつ","ていし","ていせい","ていたい","ていど","ていねい","ていひょう","ていへん","ていぼう","てうち","ておくれ","てきとう","てくび","でこぼこ","てさぎょう","てさげ","てすり","てそう","てちがい","てちょう","てつがく","てつづき","でっぱ","てつぼう","てつや","でぬかえ","てぬき","てぬぐい","てのひら","てはい","てぶくろ","てふだ","てほどき","てほん","てまえ","てまきずし","てみじか","てみやげ","てらす","てれび","てわけ","てわたし","でんあつ","てんいん","てんかい","てんき","てんぐ","てんけん","てんごく","てんさい","てんし","てんすう","でんち","てんてき","てんとう","てんない","てんぷら","てんぼうだい","てんめつ","てんらんかい","でんりょく","でんわ","どあい","といれ","どうかん","とうきゅう","どうぐ","とうし","とうむぎ","とおい","とおか","とおく","とおす","とおる","とかい","とかす","ときおり","ときどき","とくい","とくしゅう","とくてん","とくに","とくべつ","とけい","とける","とこや","とさか","としょかん","とそう","とたん","とちゅう","とっきゅう","とっくん","とつぜん","とつにゅう","とどける","ととのえる","とない","となえる","となり","とのさま","とばす","どぶがわ","とほう","とまる","とめる","ともだち","ともる","どようび","とらえる","とんかつ","どんぶり","ないかく","ないこう","ないしょ","ないす","ないせん","ないそう","なおす","ながい","なくす","なげる","なこうど","なさけ","なたでここ","なっとう","なつやすみ","ななおし","なにごと","なにもの","なにわ","なのか","なふだ","なまいき","なまえ","なまみ","なみだ","なめらか","なめる","なやむ","ならう","ならび","ならぶ","なれる","なわとび","なわばり","にあう","にいがた","にうけ","におい","にかい","にがて","にきび","にくしみ","にくまん","にげる","にさんかたんそ","にしき","にせもの","にちじょう","にちようび","にっか","にっき","にっけい","にっこう","にっさん","にっしょく","にっすう","にっせき","にってい","になう","にほん","にまめ","にもつ","にやり","にゅういん","にりんしゃ","にわとり","にんい","にんか","にんき","にんげん","にんしき","にんずう","にんそう","にんたい","にんち","にんてい","にんにく","にんぷ","にんまり","にんむ","にんめい","にんよう","ぬいくぎ","ぬかす","ぬぐいとる","ぬぐう","ぬくもり","ぬすむ","ぬまえび","ぬめり","ぬらす","ぬんちゃく","ねあげ","ねいき","ねいる","ねいろ","ねぐせ","ねくたい","ねくら","ねこぜ","ねこむ","ねさげ","ねすごす","ねそべる","ねだん","ねつい","ねっしん","ねつぞう","ねったいぎょ","ねぶそく","ねふだ","ねぼう","ねほりはほり","ねまき","ねまわし","ねみみ","ねむい","ねむたい","ねもと","ねらう","ねわざ","ねんいり","ねんおし","ねんかん","ねんきん","ねんぐ","ねんざ","ねんし","ねんちゃく","ねんど","ねんぴ","ねんぶつ","ねんまつ","ねんりょう","ねんれい","のいず","のおづま","のがす","のきなみ","のこぎり","のこす","のこる","のせる","のぞく","のぞむ","のたまう","のちほど","のっく","のばす","のはら","のべる","のぼる","のみもの","のやま","のらいぬ","のらねこ","のりもの","のりゆき","のれん","のんき","ばあい","はあく","ばあさん","ばいか","ばいく","はいけん","はいご","はいしん","はいすい","はいせん","はいそう","はいち","ばいばい","はいれつ","はえる","はおる","はかい","ばかり","はかる","はくしゅ","はけん","はこぶ","はさみ","はさん","はしご","ばしょ","はしる","はせる","ぱそこん","はそん","はたん","はちみつ","はつおん","はっかく","はづき","はっきり","はっくつ","はっけん","はっこう","はっさん","はっしん","はったつ","はっちゅう","はってん","はっぴょう","はっぽう","はなす","はなび","はにかむ","はぶらし","はみがき","はむかう","はめつ","はやい","はやし","はらう","はろうぃん","はわい","はんい","はんえい","はんおん","はんかく","はんきょう","ばんぐみ","はんこ","はんしゃ","はんすう","はんだん","ぱんち","ぱんつ","はんてい","はんとし","はんのう","はんぱ","はんぶん","はんぺん","はんぼうき","はんめい","はんらん","はんろん","ひいき","ひうん","ひえる","ひかく","ひかり","ひかる","ひかん","ひくい","ひけつ","ひこうき","ひこく","ひさい","ひさしぶり","ひさん","びじゅつかん","ひしょ","ひそか","ひそむ","ひたむき","ひだり","ひたる","ひつぎ","ひっこし","ひっし","ひつじゅひん","ひっす","ひつぜん","ぴったり","ぴっちり","ひつよう","ひてい","ひとごみ","ひなまつり","ひなん","ひねる","ひはん","ひびく","ひひょう","ひほう","ひまわり","ひまん","ひみつ","ひめい","ひめじし","ひやけ","ひやす","ひよう","びょうき","ひらがな","ひらく","ひりつ","ひりょう","ひるま","ひるやすみ","ひれい","ひろい","ひろう","ひろき","ひろゆき","ひんかく","ひんけつ","ひんこん","ひんしゅ","ひんそう","ぴんち","ひんぱん","びんぼう","ふあん","ふいうち","ふうけい","ふうせん","ぷうたろう","ふうとう","ふうふ","ふえる","ふおん","ふかい","ふきん","ふくざつ","ふくぶくろ","ふこう","ふさい","ふしぎ","ふじみ","ふすま","ふせい","ふせぐ","ふそく","ぶたにく","ふたん","ふちょう","ふつう","ふつか","ふっかつ","ふっき","ふっこく","ぶどう","ふとる","ふとん","ふのう","ふはい","ふひょう","ふへん","ふまん","ふみん","ふめつ","ふめん","ふよう","ふりこ","ふりる","ふるい","ふんいき","ぶんがく","ぶんぐ","ふんしつ","ぶんせき","ふんそう","ぶんぽう","へいあん","へいおん","へいがい","へいき","へいげん","へいこう","へいさ","へいしゃ","へいせつ","へいそ","へいたく","へいてん","へいねつ","へいわ","へきが","へこむ","べにいろ","べにしょうが","へらす","へんかん","べんきょう","べんごし","へんさい","へんたい","べんり","ほあん","ほいく","ぼうぎょ","ほうこく","ほうそう","ほうほう","ほうもん","ほうりつ","ほえる","ほおん","ほかん","ほきょう","ぼきん","ほくろ","ほけつ","ほけん","ほこう","ほこる","ほしい","ほしつ","ほしゅ","ほしょう","ほせい","ほそい","ほそく","ほたて","ほたる","ぽちぶくろ","ほっきょく","ほっさ","ほったん","ほとんど","ほめる","ほんい","ほんき","ほんけ","ほんしつ","ほんやく","まいにち","まかい","まかせる","まがる","まける","まこと","まさつ","まじめ","ますく","まぜる","まつり","まとめ","まなぶ","まぬけ","まねく","まほう","まもる","まゆげ","まよう","まろやか","まわす","まわり","まわる","まんが","まんきつ","まんぞく","まんなか","みいら","みうち","みえる","みがく","みかた","みかん","みけん","みこん","みじかい","みすい","みすえる","みせる","みっか","みつかる","みつける","みてい","みとめる","みなと","みなみかさい","みねらる","みのう","みのがす","みほん","みもと","みやげ","みらい","みりょく","みわく","みんか","みんぞく","むいか","むえき","むえん","むかい","むかう","むかえ","むかし","むぎちゃ","むける","むげん","むさぼる","むしあつい","むしば","むじゅん","むしろ","むすう","むすこ","むすぶ","むすめ","むせる","むせん","むちゅう","むなしい","むのう","むやみ","むよう","むらさき","むりょう","むろん","めいあん","めいうん","めいえん","めいかく","めいきょく","めいさい","めいし","めいそう","めいぶつ","めいれい","めいわく","めぐまれる","めざす","めした","めずらしい","めだつ","めまい","めやす","めんきょ","めんせき","めんどう","もうしあげる","もうどうけん","もえる","もくし","もくてき","もくようび","もちろん","もどる","もらう","もんく","もんだい","やおや","やける","やさい","やさしい","やすい","やすたろう","やすみ","やせる","やそう","やたい","やちん","やっと","やっぱり","やぶる","やめる","ややこしい","やよい","やわらかい","ゆうき","ゆうびんきょく","ゆうべ","ゆうめい","ゆけつ","ゆしゅつ","ゆせん","ゆそう","ゆたか","ゆちゃく","ゆでる","ゆにゅう","ゆびわ","ゆらい","ゆれる","ようい","ようか","ようきゅう","ようじ","ようす","ようちえん","よかぜ","よかん","よきん","よくせい","よくぼう","よけい","よごれる","よさん","よしゅう","よそう","よそく","よっか","よてい","よどがわく","よねつ","よやく","よゆう","よろこぶ","よろしい","らいう","らくがき","らくご","らくさつ","らくだ","らしんばん","らせん","らぞく","らたい","らっか","られつ","りえき","りかい","りきさく","りきせつ","りくぐん","りくつ","りけん","りこう","りせい","りそう","りそく","りてん","りねん","りゆう","りゅうがく","りよう","りょうり","りょかん","りょくちゃ","りょこう","りりく","りれき","りろん","りんご","るいけい","るいさい","るいじ","るいせき","るすばん","るりがわら","れいかん","れいぎ","れいせい","れいぞうこ","れいとう","れいぼう","れきし","れきだい","れんあい","れんけい","れんこん","れんさい","れんしゅう","れんぞく","れんらく","ろうか","ろうご","ろうじん","ろうそく","ろくが","ろこつ","ろじうら","ろしゅつ","ろせん","ろてん","ろめん","ろれつ","ろんぎ","ろんぱ","ろんぶん","ろんり","わかす","わかめ","わかやま","わかれる","わしつ","わじまし","わすれもの","わらう","われる"]},8676(e){"use strict";e.exports=["ábaco","abdomen","abeja","abierto","abogado","abono","aborto","abrazo","abrir","abuelo","abuso","acabar","academia","acceso","acción","aceite","acelga","acento","aceptar","ácido","aclarar","acné","acoger","acoso","activo","acto","actriz","actuar","acudir","acuerdo","acusar","adicto","admitir","adoptar","adorno","aduana","adulto","aéreo","afectar","afición","afinar","afirmar","ágil","agitar","agonía","agosto","agotar","agregar","agrio","agua","agudo","águila","aguja","ahogo","ahorro","aire","aislar","ajedrez","ajeno","ajuste","alacrán","alambre","alarma","alba","álbum","alcalde","aldea","alegre","alejar","alerta","aleta","alfiler","alga","algodón","aliado","aliento","alivio","alma","almeja","almíbar","altar","alteza","altivo","alto","altura","alumno","alzar","amable","amante","amapola","amargo","amasar","ámbar","ámbito","ameno","amigo","amistad","amor","amparo","amplio","ancho","anciano","ancla","andar","andén","anemia","ángulo","anillo","ánimo","anís","anotar","antena","antiguo","antojo","anual","anular","anuncio","añadir","añejo","año","apagar","aparato","apetito","apio","aplicar","apodo","aporte","apoyo","aprender","aprobar","apuesta","apuro","arado","araña","arar","árbitro","árbol","arbusto","archivo","arco","arder","ardilla","arduo","área","árido","aries","armonía","arnés","aroma","arpa","arpón","arreglo","arroz","arruga","arte","artista","asa","asado","asalto","ascenso","asegurar","aseo","asesor","asiento","asilo","asistir","asno","asombro","áspero","astilla","astro","astuto","asumir","asunto","atajo","ataque","atar","atento","ateo","ático","atleta","átomo","atraer","atroz","atún","audaz","audio","auge","aula","aumento","ausente","autor","aval","avance","avaro","ave","avellana","avena","avestruz","avión","aviso","ayer","ayuda","ayuno","azafrán","azar","azote","azúcar","azufre","azul","baba","babor","bache","bahía","baile","bajar","balanza","balcón","balde","bambú","banco","banda","baño","barba","barco","barniz","barro","báscula","bastón","basura","batalla","batería","batir","batuta","baúl","bazar","bebé","bebida","bello","besar","beso","bestia","bicho","bien","bingo","blanco","bloque","blusa","boa","bobina","bobo","boca","bocina","boda","bodega","boina","bola","bolero","bolsa","bomba","bondad","bonito","bono","bonsái","borde","borrar","bosque","bote","botín","bóveda","bozal","bravo","brazo","brecha","breve","brillo","brinco","brisa","broca","broma","bronce","brote","bruja","brusco","bruto","buceo","bucle","bueno","buey","bufanda","bufón","búho","buitre","bulto","burbuja","burla","burro","buscar","butaca","buzón","caballo","cabeza","cabina","cabra","cacao","cadáver","cadena","caer","café","caída","caimán","caja","cajón","cal","calamar","calcio","caldo","calidad","calle","calma","calor","calvo","cama","cambio","camello","camino","campo","cáncer","candil","canela","canguro","canica","canto","caña","cañón","caoba","caos","capaz","capitán","capote","captar","capucha","cara","carbón","cárcel","careta","carga","cariño","carne","carpeta","carro","carta","casa","casco","casero","caspa","castor","catorce","catre","caudal","causa","cazo","cebolla","ceder","cedro","celda","célebre","celoso","célula","cemento","ceniza","centro","cerca","cerdo","cereza","cero","cerrar","certeza","césped","cetro","chacal","chaleco","champú","chancla","chapa","charla","chico","chiste","chivo","choque","choza","chuleta","chupar","ciclón","ciego","cielo","cien","cierto","cifra","cigarro","cima","cinco","cine","cinta","ciprés","circo","ciruela","cisne","cita","ciudad","clamor","clan","claro","clase","clave","cliente","clima","clínica","cobre","cocción","cochino","cocina","coco","código","codo","cofre","coger","cohete","cojín","cojo","cola","colcha","colegio","colgar","colina","collar","colmo","columna","combate","comer","comida","cómodo","compra","conde","conejo","conga","conocer","consejo","contar","copa","copia","corazón","corbata","corcho","cordón","corona","correr","coser","cosmos","costa","cráneo","cráter","crear","crecer","creído","crema","cría","crimen","cripta","crisis","cromo","crónica","croqueta","crudo","cruz","cuadro","cuarto","cuatro","cubo","cubrir","cuchara","cuello","cuento","cuerda","cuesta","cueva","cuidar","culebra","culpa","culto","cumbre","cumplir","cuna","cuneta","cuota","cupón","cúpula","curar","curioso","curso","curva","cutis","dama","danza","dar","dardo","dátil","deber","débil","década","decir","dedo","defensa","definir","dejar","delfín","delgado","delito","demora","denso","dental","deporte","derecho","derrota","desayuno","deseo","desfile","desnudo","destino","desvío","detalle","detener","deuda","día","diablo","diadema","diamante","diana","diario","dibujo","dictar","diente","dieta","diez","difícil","digno","dilema","diluir","dinero","directo","dirigir","disco","diseño","disfraz","diva","divino","doble","doce","dolor","domingo","don","donar","dorado","dormir","dorso","dos","dosis","dragón","droga","ducha","duda","duelo","dueño","dulce","dúo","duque","durar","dureza","duro","ébano","ebrio","echar","eco","ecuador","edad","edición","edificio","editor","educar","efecto","eficaz","eje","ejemplo","elefante","elegir","elemento","elevar","elipse","élite","elixir","elogio","eludir","embudo","emitir","emoción","empate","empeño","empleo","empresa","enano","encargo","enchufe","encía","enemigo","enero","enfado","enfermo","engaño","enigma","enlace","enorme","enredo","ensayo","enseñar","entero","entrar","envase","envío","época","equipo","erizo","escala","escena","escolar","escribir","escudo","esencia","esfera","esfuerzo","espada","espejo","espía","esposa","espuma","esquí","estar","este","estilo","estufa","etapa","eterno","ética","etnia","evadir","evaluar","evento","evitar","exacto","examen","exceso","excusa","exento","exigir","exilio","existir","éxito","experto","explicar","exponer","extremo","fábrica","fábula","fachada","fácil","factor","faena","faja","falda","fallo","falso","faltar","fama","familia","famoso","faraón","farmacia","farol","farsa","fase","fatiga","fauna","favor","fax","febrero","fecha","feliz","feo","feria","feroz","fértil","fervor","festín","fiable","fianza","fiar","fibra","ficción","ficha","fideo","fiebre","fiel","fiera","fiesta","figura","fijar","fijo","fila","filete","filial","filtro","fin","finca","fingir","finito","firma","flaco","flauta","flecha","flor","flota","fluir","flujo","flúor","fobia","foca","fogata","fogón","folio","folleto","fondo","forma","forro","fortuna","forzar","fosa","foto","fracaso","frágil","franja","frase","fraude","freír","freno","fresa","frío","frito","fruta","fuego","fuente","fuerza","fuga","fumar","función","funda","furgón","furia","fusil","fútbol","futuro","gacela","gafas","gaita","gajo","gala","galería","gallo","gamba","ganar","gancho","ganga","ganso","garaje","garza","gasolina","gastar","gato","gavilán","gemelo","gemir","gen","género","genio","gente","geranio","gerente","germen","gesto","gigante","gimnasio","girar","giro","glaciar","globo","gloria","gol","golfo","goloso","golpe","goma","gordo","gorila","gorra","gota","goteo","gozar","grada","gráfico","grano","grasa","gratis","grave","grieta","grillo","gripe","gris","grito","grosor","grúa","grueso","grumo","grupo","guante","guapo","guardia","guerra","guía","guiño","guion","guiso","guitarra","gusano","gustar","haber","hábil","hablar","hacer","hacha","hada","hallar","hamaca","harina","haz","hazaña","hebilla","hebra","hecho","helado","helio","hembra","herir","hermano","héroe","hervir","hielo","hierro","hígado","higiene","hijo","himno","historia","hocico","hogar","hoguera","hoja","hombre","hongo","honor","honra","hora","hormiga","horno","hostil","hoyo","hueco","huelga","huerta","hueso","huevo","huida","huir","humano","húmedo","humilde","humo","hundir","huracán","hurto","icono","ideal","idioma","ídolo","iglesia","iglú","igual","ilegal","ilusión","imagen","imán","imitar","impar","imperio","imponer","impulso","incapaz","índice","inerte","infiel","informe","ingenio","inicio","inmenso","inmune","innato","insecto","instante","interés","íntimo","intuir","inútil","invierno","ira","iris","ironía","isla","islote","jabalí","jabón","jamón","jarabe","jardín","jarra","jaula","jazmín","jefe","jeringa","jinete","jornada","joroba","joven","joya","juerga","jueves","juez","jugador","jugo","juguete","juicio","junco","jungla","junio","juntar","júpiter","jurar","justo","juvenil","juzgar","kilo","koala","labio","lacio","lacra","lado","ladrón","lagarto","lágrima","laguna","laico","lamer","lámina","lámpara","lana","lancha","langosta","lanza","lápiz","largo","larva","lástima","lata","látex","latir","laurel","lavar","lazo","leal","lección","leche","lector","leer","legión","legumbre","lejano","lengua","lento","leña","león","leopardo","lesión","letal","letra","leve","leyenda","libertad","libro","licor","líder","lidiar","lienzo","liga","ligero","lima","límite","limón","limpio","lince","lindo","línea","lingote","lino","linterna","líquido","liso","lista","litera","litio","litro","llaga","llama","llanto","llave","llegar","llenar","llevar","llorar","llover","lluvia","lobo","loción","loco","locura","lógica","logro","lombriz","lomo","lonja","lote","lucha","lucir","lugar","lujo","luna","lunes","lupa","lustro","luto","luz","maceta","macho","madera","madre","maduro","maestro","mafia","magia","mago","maíz","maldad","maleta","malla","malo","mamá","mambo","mamut","manco","mando","manejar","manga","maniquí","manjar","mano","manso","manta","mañana","mapa","máquina","mar","marco","marea","marfil","margen","marido","mármol","marrón","martes","marzo","masa","máscara","masivo","matar","materia","matiz","matriz","máximo","mayor","mazorca","mecha","medalla","medio","médula","mejilla","mejor","melena","melón","memoria","menor","mensaje","mente","menú","mercado","merengue","mérito","mes","mesón","meta","meter","método","metro","mezcla","miedo","miel","miembro","miga","mil","milagro","militar","millón","mimo","mina","minero","mínimo","minuto","miope","mirar","misa","miseria","misil","mismo","mitad","mito","mochila","moción","moda","modelo","moho","mojar","molde","moler","molino","momento","momia","monarca","moneda","monja","monto","moño","morada","morder","moreno","morir","morro","morsa","mortal","mosca","mostrar","motivo","mover","móvil","mozo","mucho","mudar","mueble","muela","muerte","muestra","mugre","mujer","mula","muleta","multa","mundo","muñeca","mural","muro","músculo","museo","musgo","música","muslo","nácar","nación","nadar","naipe","naranja","nariz","narrar","nasal","natal","nativo","natural","náusea","naval","nave","navidad","necio","néctar","negar","negocio","negro","neón","nervio","neto","neutro","nevar","nevera","nicho","nido","niebla","nieto","niñez","niño","nítido","nivel","nobleza","noche","nómina","noria","norma","norte","nota","noticia","novato","novela","novio","nube","nuca","núcleo","nudillo","nudo","nuera","nueve","nuez","nulo","número","nutria","oasis","obeso","obispo","objeto","obra","obrero","observar","obtener","obvio","oca","ocaso","océano","ochenta","ocho","ocio","ocre","octavo","octubre","oculto","ocupar","ocurrir","odiar","odio","odisea","oeste","ofensa","oferta","oficio","ofrecer","ogro","oído","oír","ojo","ola","oleada","olfato","olivo","olla","olmo","olor","olvido","ombligo","onda","onza","opaco","opción","ópera","opinar","oponer","optar","óptica","opuesto","oración","orador","oral","órbita","orca","orden","oreja","órgano","orgía","orgullo","oriente","origen","orilla","oro","orquesta","oruga","osadía","oscuro","osezno","oso","ostra","otoño","otro","oveja","óvulo","óxido","oxígeno","oyente","ozono","pacto","padre","paella","página","pago","país","pájaro","palabra","palco","paleta","pálido","palma","paloma","palpar","pan","panal","pánico","pantera","pañuelo","papá","papel","papilla","paquete","parar","parcela","pared","parir","paro","párpado","parque","párrafo","parte","pasar","paseo","pasión","paso","pasta","pata","patio","patria","pausa","pauta","pavo","payaso","peatón","pecado","pecera","pecho","pedal","pedir","pegar","peine","pelar","peldaño","pelea","peligro","pellejo","pelo","peluca","pena","pensar","peñón","peón","peor","pepino","pequeño","pera","percha","perder","pereza","perfil","perico","perla","permiso","perro","persona","pesa","pesca","pésimo","pestaña","pétalo","petróleo","pez","pezuña","picar","pichón","pie","piedra","pierna","pieza","pijama","pilar","piloto","pimienta","pino","pintor","pinza","piña","piojo","pipa","pirata","pisar","piscina","piso","pista","pitón","pizca","placa","plan","plata","playa","plaza","pleito","pleno","plomo","pluma","plural","pobre","poco","poder","podio","poema","poesía","poeta","polen","policía","pollo","polvo","pomada","pomelo","pomo","pompa","poner","porción","portal","posada","poseer","posible","poste","potencia","potro","pozo","prado","precoz","pregunta","premio","prensa","preso","previo","primo","príncipe","prisión","privar","proa","probar","proceso","producto","proeza","profesor","programa","prole","promesa","pronto","propio","próximo","prueba","público","puchero","pudor","pueblo","puerta","puesto","pulga","pulir","pulmón","pulpo","pulso","puma","punto","puñal","puño","pupa","pupila","puré","quedar","queja","quemar","querer","queso","quieto","química","quince","quitar","rábano","rabia","rabo","ración","radical","raíz","rama","rampa","rancho","rango","rapaz","rápido","rapto","rasgo","raspa","rato","rayo","raza","razón","reacción","realidad","rebaño","rebote","recaer","receta","rechazo","recoger","recreo","recto","recurso","red","redondo","reducir","reflejo","reforma","refrán","refugio","regalo","regir","regla","regreso","rehén","reino","reír","reja","relato","relevo","relieve","relleno","reloj","remar","remedio","remo","rencor","rendir","renta","reparto","repetir","reposo","reptil","res","rescate","resina","respeto","resto","resumen","retiro","retorno","retrato","reunir","revés","revista","rey","rezar","rico","riego","rienda","riesgo","rifa","rígido","rigor","rincón","riñón","río","riqueza","risa","ritmo","rito","rizo","roble","roce","rociar","rodar","rodeo","rodilla","roer","rojizo","rojo","romero","romper","ron","ronco","ronda","ropa","ropero","rosa","rosca","rostro","rotar","rubí","rubor","rudo","rueda","rugir","ruido","ruina","ruleta","rulo","rumbo","rumor","ruptura","ruta","rutina","sábado","saber","sabio","sable","sacar","sagaz","sagrado","sala","saldo","salero","salir","salmón","salón","salsa","salto","salud","salvar","samba","sanción","sandía","sanear","sangre","sanidad","sano","santo","sapo","saque","sardina","sartén","sastre","satán","sauna","saxofón","sección","seco","secreto","secta","sed","seguir","seis","sello","selva","semana","semilla","senda","sensor","señal","señor","separar","sepia","sequía","ser","serie","sermón","servir","sesenta","sesión","seta","setenta","severo","sexo","sexto","sidra","siesta","siete","siglo","signo","sílaba","silbar","silencio","silla","símbolo","simio","sirena","sistema","sitio","situar","sobre","socio","sodio","sol","solapa","soldado","soledad","sólido","soltar","solución","sombra","sondeo","sonido","sonoro","sonrisa","sopa","soplar","soporte","sordo","sorpresa","sorteo","sostén","sótano","suave","subir","suceso","sudor","suegra","suelo","sueño","suerte","sufrir","sujeto","sultán","sumar","superar","suplir","suponer","supremo","sur","surco","sureño","surgir","susto","sutil","tabaco","tabique","tabla","tabú","taco","tacto","tajo","talar","talco","talento","talla","talón","tamaño","tambor","tango","tanque","tapa","tapete","tapia","tapón","taquilla","tarde","tarea","tarifa","tarjeta","tarot","tarro","tarta","tatuaje","tauro","taza","tazón","teatro","techo","tecla","técnica","tejado","tejer","tejido","tela","teléfono","tema","temor","templo","tenaz","tender","tener","tenis","tenso","teoría","terapia","terco","término","ternura","terror","tesis","tesoro","testigo","tetera","texto","tez","tibio","tiburón","tiempo","tienda","tierra","tieso","tigre","tijera","tilde","timbre","tímido","timo","tinta","tío","típico","tipo","tira","tirón","titán","títere","título","tiza","toalla","tobillo","tocar","tocino","todo","toga","toldo","tomar","tono","tonto","topar","tope","toque","tórax","torero","tormenta","torneo","toro","torpedo","torre","torso","tortuga","tos","tosco","toser","tóxico","trabajo","tractor","traer","tráfico","trago","traje","tramo","trance","trato","trauma","trazar","trébol","tregua","treinta","tren","trepar","tres","tribu","trigo","tripa","triste","triunfo","trofeo","trompa","tronco","tropa","trote","trozo","truco","trueno","trufa","tubería","tubo","tuerto","tumba","tumor","túnel","túnica","turbina","turismo","turno","tutor","ubicar","úlcera","umbral","unidad","unir","universo","uno","untar","uña","urbano","urbe","urgente","urna","usar","usuario","útil","utopía","uva","vaca","vacío","vacuna","vagar","vago","vaina","vajilla","vale","válido","valle","valor","válvula","vampiro","vara","variar","varón","vaso","vecino","vector","vehículo","veinte","vejez","vela","velero","veloz","vena","vencer","venda","veneno","vengar","venir","venta","venus","ver","verano","verbo","verde","vereda","verja","verso","verter","vía","viaje","vibrar","vicio","víctima","vida","vídeo","vidrio","viejo","viernes","vigor","vil","villa","vinagre","vino","viñedo","violín","viral","virgo","virtud","visor","víspera","vista","vitamina","viudo","vivaz","vivero","vivir","vivo","volcán","volumen","volver","voraz","votar","voto","voz","vuelo","vulgar","yacer","yate","yegua","yema","yerno","yeso","yodo","yoga","yogur","zafiro","zanja","zapato","zarza","zona","zorro","zumo","zurdo"]},1262(e,t,r){"use strict";var i=r(4799),n=r(3035),o=[],a={};function s(){}function u(e,t){if(~o.indexOf(e))return e;if(!t)return a[e];i.isArray(t)||(t=[t]);for(var r=0;r<o.length;r++){var n=o[r],s=i.pick(n,t);if(~i.values(s).indexOf(e))return n}}function c(e){for(var t=[],r=0;r<e.length;r++)t.push(31&e.charCodeAt(r));return t}function l(e){var t=new s;n.defineImmutable(t,{name:e.name,alias:e.alias,pubkeyhash:e.pubkeyhash,privatekey:e.privatekey,scripthash:e.scripthash,xpubkey:e.xpubkey,xprivkey:e.xprivkey});var r=e.indexBy||Object.keys(e);return e.cashAddrPrefix&&i.extend(t,{cashAddrPrefix:e.cashAddrPrefix,cashAddrPrefixArray:c(e.cashAddrPrefix)}),e.networkMagic&&i.extend(t,{networkMagic:n.integerAsBuffer(e.networkMagic)}),e.port&&i.extend(t,{port:e.port}),e.dnsSeeds&&i.extend(t,{dnsSeeds:e.dnsSeeds}),o.push(t),function(e,t){for(var r=0;r<t.length;r++){var n=e[t[r]];i.isUndefined(n)||i.isObject(n)||(a[n]=e)}}(t,r),t}s.prototype.toString=function(){return this.name};var h=["seed.bitcoinsv.org","seed.bitcoinunlimited.info"],f={PORT:18333,NETWORK_MAGIC:4108710900,DNS_SEEDS:h,PREFIX:"testnet",CASHADDRPREFIX:"bchtest"},p={PORT:18444,NETWORK_MAGIC:3669344250,DNS_SEEDS:[],PREFIX:"regtest",CASHADDRPREFIX:"bchreg"},d={PORT:9333,NETWORK_MAGIC:4224632057,DNS_SEEDS:["stn-seed.bitcoinsv.io"],PREFIX:"stn",CASHADDRPREFIX:"bsvstn"},g={name:"livenet",alias:"mainnet",prefix:"bitcoin",cashAddrPrefix:"bitcoincash",pubkeyhash:0,privatekey:128,scripthash:5,xpubkey:76067358,xprivkey:76066276,networkMagic:3823236072,port:8333,dnsSeeds:h},m={name:"testnet",prefix:f.PREFIX,cashAddrPrefix:f.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:f.NETWORK_MAGIC},y={name:"regtest",prefix:p.PREFIX,cashAddrPrefix:p.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:p.NETWORK_MAGIC,port:p.PORT,dnsSeeds:[],indexBy:["port","name","cashAddrPrefix","networkMagic"]},v={name:"stn",prefix:d.PREFIX,cashAddrPrefix:d.CASHADDRPREFIX,pubkeyhash:111,privatekey:239,scripthash:196,xpubkey:70617039,xprivkey:70615956,networkMagic:d.NETWORK_MAGIC,indexBy:["port","name","cashAddrPrefix","networkMagic"]};l(m),l(v),l(y),l(g);var b=u("livenet"),S=u("regtest"),w=u("testnet"),O=u("stn");Object.defineProperty(w,"port",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?p.PORT:this.stnEnabled?d.PORT:f.PORT}}),Object.defineProperty(w,"networkMagic",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?n.integerAsBuffer(p.NETWORK_MAGIC):this.stnEnabled?n.integerAsBuffer(d.NETWORK_MAGIC):n.integerAsBuffer(f.NETWORK_MAGIC)}}),Object.defineProperty(w,"dnsSeeds",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?p.DNS_SEEDS:this.stnEnabled?d.DNS_SEEDS:f.DNS_SEEDS}}),Object.defineProperty(w,"cashAddrPrefix",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?p.CASHADDRPREFIX:this.stnEnabled?d.CASHADDRPREFIX:f.CASHADDRPREFIX}}),Object.defineProperty(w,"cashAddrPrefixArray",{enumerable:!0,configurable:!1,get:function(){return this.regtestEnabled?c(p.CASHADDRPREFIX):this.stnEnabled?d.cashAddrPrefixToArray(d.CASHADDRPREFIX):c(f.CASHADDRPREFIX)}}),e.exports={add:l,remove:function(e){for(var t=0;t<o.length;t++)o[t]===e&&o.splice(t,1);!function(e,t){for(var r=0;r<t.length;r++){var i=t[r];a[i]===e&&delete a[i]}}(e,Object.keys(a))},defaultNetwork:b,livenet:b,mainnet:b,testnet:w,regtest:S,stn:O,get:u,enableRegtest:function(){w.regtestEnabled=!0},disableRegtest:function(){w.regtestEnabled=!1},enableStn:function(){w.stnEnabled=!0},disableStn:function(){w.stnEnabled=!1}}},7239(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(3035);function s(e){if(!(this instanceof s))return new s(e);var t;if(n.isNumber(e))t=e;else{if(!n.isString(e))throw new TypeError('Unrecognized num type: "'+typeof e+'" for Opcode');t=s.map[e]}return a.defineImmutable(this,{num:t}),this}for(var u in s.fromBuffer=function(e){return o.checkArgument(i.isBuffer(e)),new s(Number("0x"+e.toString("hex")))},s.fromNumber=function(e){return o.checkArgument(n.isNumber(e)),new s(e)},s.fromString=function(e){o.checkArgument(n.isString(e));var t=s.map[e];if(void 0===t)throw new TypeError("Invalid opcodestr");return new s(t)},s.prototype.toHex=function(){return this.num.toString(16)},s.prototype.toBuffer=function(){return i.from(this.toHex(),"hex")},s.prototype.toNumber=function(){return this.num},s.prototype.toString=function(){var e=s.reverseMap[this.num];if(void 0===e)throw new Error("Opcode does not have a string representation");return e},s.smallInt=function(e){return o.checkArgument(n.isNumber(e),"Invalid Argument: n should be number"),o.checkArgument(e>=0&&e<=16,"Invalid Argument: n must be between 0 and 16"),0===e?s("OP_0"):new s(s.map.OP_1+e-1)},s.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_CHECKLOCKTIMEVERIFY:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP2:177,OP_NOP3:178,OP_SUBSTR:179,OP_LEFT:180,OP_RIGHT:181,OP_NOP4:182,OP_NOP5:183,OP_NOP6:184,OP_NOP7:185,OP_NOP8:186,OP_NOP9:187,OP_NOP10:188,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},s.reverseMap=[],s.map)s.reverseMap[s.map[u]]=u;n.extend(s,s.map),s.isSmallIntOp=function(e){return e instanceof s&&(e=e.toNumber()),e===s.map.OP_0||e>=s.map.OP_1&&e<=s.map.OP_16},s.prototype.inspect=function(){return"<Opcode: "+this.toString()+", hex: "+this.toHex()+", decimal: "+this.num+">"},e.exports=s},3673(e,t,r){"use strict";var i=r(8287).Buffer,n=r(3470),o="application/bsv-20";function a(e,t){var r=function(e,t){if("number"==typeof e){if(!Number.isInteger(e)||e<0)throw new Error(t+" must be a non-negative integer");return String(e)}if(function(e){return"string"==typeof e&&/^\d+$/.test(e)}(e))return e.replace(/^0+(?=\d)/,"");throw new Error(t+" must be a non-negative integer (string or number)")}(e,t);if(!/[1-9]/.test(r))throw new Error(t+" must be greater than zero");return r}function s(e){if("string"!=typeof e||!e.length)throw new Error("tick is required");if(i.byteLength(e,"utf8")>4)throw new Error("tick must be 1–4 UTF-8 bytes");return e}function u(e){var t="string"==typeof e?Number(e):e;if(!Number.isInteger(t)||t<0||t>18)throw new Error("dec must be an integer 0…18");return String(t)}function c(e,t){return t=t||{},n.buildInscription({lock:t.lock,address:t.address,contentType:t.contentType||o,content:JSON.stringify(e)})}function l(e){var t={p:"bsv-20",op:"deploy",tick:s((e=e||{}).tick),max:a(e.max,"max")};return null!=e.lim&&(t.lim=a(e.lim,"lim")),null!=e.dec&&(t.dec=u(e.dec)),c(t,e)}function h(e){return c({p:"bsv-20",op:"mint",tick:s((e=e||{}).tick),amt:a(e.amt,"amt")},e)}function f(e){var t={p:"bsv-20",op:"transfer",amt:a((e=e||{}).amt,"amt")};return null!=e.id?t.id=function(e){if("string"!=typeof e||!/^[0-9a-fA-F]{64}_\d+$/.test(e))throw new Error('id must be "<txid>_<vout>" (64-hex txid, underscore, output index)');return e}(e.id):t.tick=s(e.tick),c(t,e)}function p(e){var t={p:"bsv-20",op:"deploy+mint",amt:a((e=e||{}).amt,"amt")};return null!=e.dec&&(t.dec=u(e.dec)),null!=e.sym&&(t.sym=String(e.sym)),null!=e.icon&&(t.icon=String(e.icon)),c(t,e)}function d(e,t){return new(r(5237).Transaction.Output)({script:e,satoshis:null!=t?t:1})}function g(e){try{var t=function(e){var t=r(5237);if(e&&"object"==typeof e&&!i.isBuffer(e)&&!(e instanceof t.Script))return e;if("string"==typeof e&&"{"===e.trim()[0])return e;var o=n.parseInscription(e);return o?o.contentText:null}(e);if(null==t)return null;var o="object"==typeof t?t:JSON.parse(t);return o&&"bsv-20"===o.p&&"string"==typeof o.op?o:null}catch(e){return null}}e.exports={CONTENT_TYPE:o,buildDeploy:l,buildMint:h,buildTransfer:f,buildDeployMint:p,createDeployOutput:function(e){return d(l(e),e&&e.satoshis)},createMintOutput:function(e){return d(h(e),e&&e.satoshis)},createTransferOutput:function(e){return d(f(e),e&&e.satoshis)},createDeployMintOutput:function(e){return d(p(e),e&&e.satoshis)},parseBsv20:g,isBsv20:function(e){return null!==g(e)}}},9648(e,t,r){"use strict";var i=r(3470),n=r(4572),o=r(3673);e.exports={buildInscription:i.buildInscription,parseInscription:i.parseInscription,isInscription:i.isInscription,createInscriptionOutput:i.createInscriptionOutput,batchInscriptionOutputs:function(e){if(!Array.isArray(e)||!e.length)throw new Error("batchInscriptionOutputs requires a non-empty array of items");return e.map(function(e){return i.createInscriptionOutput(e)})},ORDLOCK_SIGHASH:n.ORDLOCK_SIGHASH,buildOrdLock:n.buildOrdLock,parseOrdLock:n.parseOrdLock,isOrdLock:n.isOrdLock,listInscriptionOutput:n.listInscriptionOutput,payOutputFor:n.payOutputFor,purchaseOrdLock:n.purchase,cancelOrdLock:n.cancel,buildListingTx:n.buildListingTx,buildPurchaseTx:n.buildPurchaseTx,BSV20:o}},3470(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=i.from("ord","utf8");function a(){return n.Script}function s(){return n.Opcode}function u(e,t){return i.isBuffer(e)?e:null==e?i.alloc(0):i.from(String(e),t||"utf8")}function c(e){e=e||{};var t=s(),r=function(e){var t=a();if(e.lock){if(e.lock instanceof t)return e.lock;if(i.isBuffer(e.lock))return t.fromBuffer(e.lock);if("string"==typeof e.lock)return t.fromHex(e.lock);throw new Error("lock must be a Script, Buffer, or hex string")}if(e.address){var r=e.address instanceof n.Address?e.address:n.Address.fromString(String(e.address));return t.buildPublicKeyHashOut(r)}throw new Error("buildInscription requires an address or a lock script")}(e),c=u(e.contentType||"text/plain"),l=u(e.content),h=a().fromBuffer(r.toBuffer());return h.add(t.OP_FALSE),h.add(t.OP_IF),h.add(o),h.add(t.OP_1),h.add(c),h.add(t.OP_0),h.add(l),h.add(t.OP_ENDIF),h}function l(e,t){return e&&e.opcodenum===t&&null==e.buf}function h(e){for(var t=a(),r=s(),n=(e instanceof t?e:i.isBuffer(e)?t.fromBuffer(e):t.fromHex(e)).chunks,u=-1,c=0;c+2<n.length;c++)if(l(n[c],r.OP_FALSE)&&l(n[c+1],r.OP_IF)&&n[c+2].buf&&n[c+2].buf.equals(o)){u=c;break}if(-1===u)return null;for(var h=new t,f=0;f<u;f++)h.chunks.push(n[f]);for(var p=i.alloc(0),d=i.alloc(0),g=u+3;g<n.length;g++){var m=n[g];if(l(m,r.OP_ENDIF))break;l(m,r.OP_1)&&n[g+1]&&n[g+1].buf?(p=n[g+1].buf,g++):l(m,r.OP_0)&&n[g+1]&&n[g+1].buf&&(d=n[g+1].buf,g++)}return{contentType:p.toString("utf8"),content:d,contentText:d.toString("utf8"),lock:h}}e.exports={buildInscription:c,parseInscription:h,isInscription:function(e){try{return null!==h(e)}catch(e){return!1}},createInscriptionOutput:function(e){var t=null!=(e=e||{}).satoshis?e.satoshis:1;return new n.Transaction.Output({script:c(e),satoshis:t})}}},4572(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(4904),a=r(8866),s=r(3470),u=n.Script,c=n.Opcode,l=n.encoding.BufferReader,h=o.SIGHASH_ALL_ANYONECANPAY_FORKID;function f(e,t){return t&&t.length?e.add(i.from(t)):e.add(c.OP_0)}function p(e){return e.toBufferWriter().toBuffer()}function d(e,t){if("number"!=typeof e||!isFinite(e)||e<0||Math.floor(e)!==e)throw new Error(t+" must be a non-negative integer number of satoshis (got "+e+")");return e}function g(e){return e instanceof u?e:i.isBuffer(e)?u.fromBuffer(e):u.fromHex(e)}function m(e){return e instanceof n.Address?e:e&&"function"==typeof e.toAddress?e.toAddress():n.Address.fromString(String(e))}function y(e,t){return d(t,"payment price"),new n.Transaction.Output({script:u.buildPublicKeyHashOut(m(e)),satoshis:t})}function v(e){if(e instanceof n.Transaction.Output)return e;if(i.isBuffer(e))return n.Transaction.Output.fromBufferReader(new l(e));var t=null!=e.payTo?e.payTo:e.address,r=null!=e.satoshis?e.satoshis:e.price;if(null==t||null==r)throw new Error("payment spec needs {address|payTo, satoshis|price}");return y(t,r)}function b(e){if(null==(e=e||{}).seller)throw new Error("buildOrdLock requires a seller");var t,r=function(e){if(i.isBuffer(e)){if(20!==e.length)throw new Error("seller pubkeyhash buffer must be 20 bytes (HASH160)");return e}return e instanceof n.PublicKey?n.crypto.Hash.sha256ripemd160(e.toBuffer()):m(e).hashBuffer}(e.seller),a=(t=function(e){if(e.payOutputs){if(!e.payOutputs.length)throw new Error("payOutputs must be a non-empty array");return e.payOutputs.map(v)}if(null!=e.payOutput)return[v(e.payOutput)];if(null!=e.price){var t=null!=e.payTo?e.payTo:e.seller,r=[t instanceof n.Transaction.Output?t:y(t,e.price)];return e.royalties&&e.royalties.forEach(function(e){r.push(v(e))}),r}throw new Error("buildOrdLock requires a price, a payOutput, or payOutputs")}(e),i.concat(t.map(p))),l=new u;(l.add(c.OP_IF),l.add(c.OP_DUP).add(c.OP_HASH160),l.add(i.from(r)).add(c.OP_EQUALVERIFY).add(c.OP_CHECKSIG),l.add(c.OP_ELSE),l.add(c.OP_DUP),o.pushTxCore(l,{sighashType:h}),l.add(c.OP_VERIFY),o.assertSighashType(l,h),o.extractHashOutputs(l),l.add(c.OP_TOALTSTACK),l.add(i.from(a)).add(c.OP_CAT),l.add(c.OP_SWAP).add(c.OP_CAT),l.add(c.OP_HASH256),l.add(c.OP_FROMALTSTACK).add(c.OP_EQUAL),l.add(c.OP_ENDIF),e.inscription)&&s.buildInscription({lock:new u,contentType:e.inscription.contentType,content:e.inscription.content}).chunks.forEach(function(e){l.chunks.push(e)});return l}function S(e,t){return e&&e.opcodenum===t&&null==e.buf}function w(e,t){var r=t&&t.network;try{for(var i=g(e),o=i.chunks,a=0,u=-1,h=-1,f=-1,p=0;p<o.length;p++)if(S(o[p],c.OP_IF))0===a&&(u=p),a++;else if(S(o[p],c.OP_ELSE)&&1===a)h=p;else if(S(o[p],c.OP_ENDIF)&&0===--a){f=p;break}if(-1===u||-1===h||-1===f)return null;for(var d=null,m=u+1;m<h;m++)if(o[m].buf&&20===o[m].buf.length){d=o[m].buf;break}if(!d)return null;for(var y=null,v=h+1;v<f;v++)S(o[v],c.OP_TOALTSTACK)&&o[v+1]&&o[v+1].buf&&S(o[v+2],c.OP_CAT)&&S(o[v+3],c.OP_SWAP)&&(y=o[v+1].buf);if(!y)return null;var b=function(e){for(var t=new l(e),r=[];!t.eof();)r.push(n.Transaction.Output.fromBufferReader(t));return r}(y).map(function(e){var t=null;try{e.script.isPublicKeyHashOut()&&(t=e.script.toAddress(r).toString())}catch(e){}return{satoshis:e.satoshis,script:e.script,address:t}}),w=b.reduce(function(e,t){return e+t.satoshis},0),O=null,_=s.parseInscription(i);return _&&(O={contentType:_.contentType,content:_.content,contentText:_.contentText}),{seller:{pubKeyHash:d,address:n.Address.fromPublicKeyHash(d,r).toString()},payOutputs:b,payBlob:y,totalPrice:w,inscription:O}}catch(e){return null}}function O(e){var t=(e=e||{}).spend,r=e.lockingScript;if(!t||!r)throw new Error("purchase requires { spend, lockingScript }");var n=e.inputIndex||0,a=null!=e.payoutIndex?e.payoutIndex:1,s=null!=e.satoshis?e.satoshis:1,l=t.outputs||[],d=e.parsed||w(r),g=null!=e.payoutCount?e.payoutCount:d?d.payOutputs.length:1;if(a+g>l.length)throw new Error("purchase: spend has fewer outputs than the pinned block requires (need "+(a+g)+", have "+l.length+")");if(!1!==e.validate&&d&&!i.concat(l.slice(a,a+g).map(p)).equals(d.payBlob))throw new Error("purchase: outputs ["+a+".."+(a+g-1)+"] do not match the listing payment — the seller (or a royalty/fee payee) would not be paid");var m=i.concat(l.slice(0,a).map(p)),y=i.concat(l.slice(a+g).map(p)),v=Object.assign({sighashType:h},e.grind||{}),b=o.grind(t,n,r,s,v),S=new u;return f(S,y),f(S,m),S.add(i.from(b.preimage)),S.add(c.OP_FALSE),t.inputs[n].setScript(S),S}function _(e,t,r,i){e.addInput(new n.Transaction.Input({prevTxId:t.txid||t.prevTxId,outputIndex:null!=t.outputIndex?t.outputIndex:t.vout,script:u.empty()}),g(r),i)}function I(e,t,r){d(r.satoshis,"input "+t+" satoshis");var n=g(r.script),s=a.signInput(e,r.privateKey,t,n,r.satoshis,o.SIGHASH_ALL_FORKID),c=new u;c.add(i.from(s)),c.add(r.privateKey.toPublicKey().toBuffer()),e.inputs[t].setScript(c)}e.exports={ORDLOCK_SIGHASH:h,buildOrdLock:b,parseOrdLock:w,isOrdLock:function(e,t){return null!==w(e,t)},listInscriptionOutput:function(e){var t=null!=(e=e||{}).satoshis?e.satoshis:1;return new n.Transaction.Output({script:b(e),satoshis:t})},payOutputFor:y,purchase:O,cancel:function(e){var t=(e=e||{}).privateKey,r=e.spend,n=e.lockingScript;if(!t||!r||!n)throw new Error("cancel requires { privateKey, spend, lockingScript }");var o=e.inputIndex||0,s=null!=e.satoshis?e.satoshis:1,l=null!=e.sighashType?e.sighashType:a.SIGHASH,h=a.signInput(r,t,o,n,s,l),f=new u;return f.add(i.from(h)),f.add(t.toPublicKey().toBuffer()),f.add(c.OP_TRUE),r.inputs[o].setScript(f),f},buildListingTx:function(e){var t=(e=e||{}).ordinal;if(!t||!t.script||!t.privateKey)throw new Error("buildListingTx requires ordinal { script, privateKey, txid, outputIndex }");var r=d(null!=t.satoshis?t.satoshis:1,"ordinal satoshis"),i=b(e),o=e.funding||[],a=null!=e.fee?e.fee:500,s=o.reduce(function(e,t){return e+d(t.satoshis,"funding satoshis")},0),u=s-a;if(u<0)throw new Error("buildListingTx: insufficient funding — need "+a+" sat fee, funded "+s);var c=new n.Transaction;return _(c,t,t.script,r),o.forEach(function(e){_(c,e,e.script,e.satoshis)}),c.addOutput(new n.Transaction.Output({script:i,satoshis:r})),u>0&&c.addOutput(y(e.changeAddress||t.privateKey.toAddress(),u)),I(c,0,{script:t.script,privateKey:t.privateKey,satoshis:r}),o.forEach(function(e,t){I(c,1+t,e)}),{tx:c,listingScript:i,listingOutpoint:{txid:c.hash,outputIndex:0}}},buildPurchaseTx:function(e){var t=(e=e||{}).listing;if(!t||!t.script)throw new Error("buildPurchaseTx requires listing.script");if(!e.ordinalDestination)throw new Error("buildPurchaseTx requires ordinalDestination");if(!e.funding||!e.funding.length)throw new Error("buildPurchaseTx requires funding coins");var r=g(t.script),i=w(r);if(!i)throw new Error("buildPurchaseTx: listing.script is not a parseable OrdLock");var o=d(null!=t.satoshis?t.satoshis:1,"listing satoshis"),a=e.payOutputs?e.payOutputs.map(v):i.payOutputs.map(function(e){return new n.Transaction.Output({script:e.script,satoshis:e.satoshis})}),s=a.reduce(function(e,t){return e+t.satoshis},0),u=null!=e.fee?e.fee:500,c=e.funding.reduce(function(e,t){return e+d(t.satoshis,"funding satoshis")},0),l=c-s-u;if(l<0)throw new Error("buildPurchaseTx: insufficient funding — need "+(s+u)+" sat (payments "+s+" + fee "+u+"), funded "+c);var h=new n.Transaction;return _(h,t,r,o),e.funding.forEach(function(e){_(h,e,e.script,e.satoshis)}),h.addOutput(y(e.ordinalDestination,o)),a.forEach(function(e){h.addOutput(e)}),l>0&&h.addOutput(y(e.changeAddress||e.ordinalDestination,l)),O({spend:h,lockingScript:r,parsed:i,satoshis:o,inputIndex:0,payoutIndex:1,payoutCount:a.length,grind:e.grind}),e.funding.forEach(function(e,t){I(h,1+t,e)}),h}}},4339(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(617),a=r(9047),s=r(9043),u=r(3035),c=r(1262),l=r(4125),h=r(6161),f=r(9968),p=r(6365);function d(e,t){if(!(this instanceof d))return new d(e,t);if(e instanceof d)return e;var r=this._classifyArguments(e,t);if(!r.bn||0===r.bn.cmp(new s(0)))throw new TypeError("Number can not be equal to zero, undefined, null or false");if(!r.bn.lt(l.getN()))throw new TypeError("Number must be less than N");if(void 0===r.network)throw new TypeError('Must specify the network ("livenet" or "testnet")');return u.defineImmutable(this,{bn:r.bn,compressed:r.compressed,network:r.network}),Object.defineProperty(this,"publicKey",{configurable:!1,enumerable:!0,get:this.toPublicKey.bind(this)}),this}d.prototype._classifyArguments=function(e,t){var r={compressed:!0,network:t?c.get(t):c.defaultNetwork};if(n.isUndefined(e)||n.isNull(e))r.bn=d._getRandomBN();else if(e instanceof s)r.bn=e;else if(e instanceof i||e instanceof Uint8Array)r=d._transformBuffer(e,t);else if(e.bn&&e.network)r=d._transformObject(e);else if(!t&&c.get(e))r.bn=d._getRandomBN(),r.network=c.get(e);else{if("string"!=typeof e)throw new TypeError("First argument is an unrecognized data type.");u.isHexa(e)?r.bn=new s(i.from(e,"hex")):r=d._transformWIF(e,t)}return r},d._getRandomBN=function(){var e,t;do{var r=f.getRandomBuffer(32);e=(t=s.fromBuffer(r)).lt(l.getN())}while(!e);return t},d._transformBuffer=function(e,t){var r={};if(32===e.length)return d._transformBNBuffer(e,t);if(r.network=c.get(e[0],"privatekey"),!r.network)throw new Error("Invalid network");if(t&&r.network!==c.get(t))throw new TypeError("Private key network mismatch");if(34===e.length&&1===e[33])r.compressed=!0;else{if(33!==e.length)throw new Error("Length of buffer must be 33 (uncompressed) or 34 (compressed)");r.compressed=!1}return r.bn=s.fromBuffer(e.slice(1,33)),r},d._transformBNBuffer=function(e,t){var r={};return r.network=c.get(t)||c.defaultNetwork,r.bn=s.fromBuffer(e),r.compressed=!1,r},d._transformWIF=function(e,t){return d._transformBuffer(a.decode(e),t)},d.fromBuffer=function(e,t){return new d(e,t)},d.fromHex=function(e,t){return d.fromBuffer(i.from(e,"hex"),t)},d._transformObject=function(e){return{bn:new s(e.bn,"hex"),network:c.get(e.network),compressed:e.compressed}},d.fromString=d.fromWIF=function(e){return p.checkArgument(n.isString(e),"First argument is expected to be a string."),new d(e)},d.fromObject=d.fromJSON=function(e){return p.checkArgument(n.isObject(e),"First argument is expected to be an object."),new d(e)},d.fromRandom=function(e){var t=d._getRandomBN();return new d(t,e)},d.getValidationError=function(e,t){var r;try{new d(e,t)}catch(e){r=e}return r},d.isValid=function(e,t){return!!e&&!d.getValidationError(e,t)},d.prototype.toString=function(){return this.toWIF()},d.prototype.toWIF=function(){var e,t=this.network;return e=this.compressed?i.concat([i.from([t.privatekey]),this.bn.toBuffer({size:32}),i.from([1])]):i.concat([i.from([t.privatekey]),this.bn.toBuffer({size:32})]),a.encode(e)},d.prototype.toBigNumber=function(){return this.bn},d.prototype.toBuffer=function(){return this.bn.toBuffer({size:32})},d.prototype.toHex=function(){return this.toBuffer().toString("hex")},d.prototype.toPublicKey=function(){return this._pubkey||(this._pubkey=h.fromPrivateKey(this)),this._pubkey},d.prototype.toAddress=function(e){var t=this.toPublicKey();return o.fromPublicKey(t,e||this.network)},d.prototype.toObject=d.prototype.toJSON=function(){return{bn:this.bn.toString("hex"),compressed:this.compressed,network:this.network.toString()}},d.prototype.inspect=function(){var e=this.compressed?"":", uncompressed";return"<PrivateKey: "+this.toHex()+", network: "+this.network+e+">"},e.exports=d},6161(e,t,r){"use strict";var i=r(8287).Buffer,n=r(9043),o=r(4125),a=r(5067),s=r(3035),u=r(1262),c=r(4799),l=r(6365);function h(e,t){if(!(this instanceof h))return new h(e,t);if(l.checkArgument(e,"First argument is required, please include public key data."),e instanceof h)return e;t=t||{};var r=this._classifyArgs(e,t);return r.point.validate(),s.defineImmutable(this,{point:r.point,compressed:r.compressed,network:r.network||u.defaultNetwork}),this}h.prototype._classifyArgs=function(e,t){var r={compressed:c.isUndefined(t.compressed)||t.compressed};if(e instanceof o)r.point=e;else if(e.x&&e.y)r=h._transformObject(e);else if("string"==typeof e)r=h._transformDER(i.from(e,"hex"));else if(h._isBuffer(e))r=h._transformDER(e);else{if(!h._isPrivateKey(e))throw new TypeError("First argument is an unrecognized data format.");r=h._transformPrivateKey(e)}return r.network||(r.network=c.isUndefined(t.network)?void 0:u.get(t.network)),r},h._isPrivateKey=function(e){return e instanceof r(4339)},h._isBuffer=function(e){return e instanceof i||e instanceof Uint8Array},h._transformPrivateKey=function(e){l.checkArgument(h._isPrivateKey(e),"Must be an instance of PrivateKey");var t={};return t.point=o.getG().mul(e.bn),t.compressed=e.compressed,t.network=e.network,t},h._transformDER=function(e,t){l.checkArgument(h._isBuffer(e),"Must be a buffer of DER encoded public key");var r,i,a,s,u={};if(t=!!c.isUndefined(t)||t,4!==e[0]&&(t||6!==e[0]&&7!==e[0]))if(3===e[0])a=e.slice(1),r=new n(a),(u=h._transformX(!0,r)).compressed=!0;else{if(2!==e[0])throw new TypeError("Invalid DER format public key");a=e.slice(1),r=new n(a),(u=h._transformX(!1,r)).compressed=!0}else{if(a=e.slice(1,33),s=e.slice(33,65),32!==a.length||32!==s.length||65!==e.length)throw new TypeError("Length of x and y must be 32 bytes");r=new n(a),i=new n(s),u.point=new o(r,i),u.compressed=!1}return u},h._transformX=function(e,t){l.checkArgument("boolean"==typeof e,"Must specify whether y is odd or not (true or false)");var r={};return r.point=o.fromX(e,t),r},h._transformObject=function(e){var t=new n(e.x,"hex"),r=new n(e.y,"hex");return new h(new o(t,r),{compressed:e.compressed})},h.fromPrivateKey=function(e){l.checkArgument(h._isPrivateKey(e),"Must be an instance of PrivateKey");var t=h._transformPrivateKey(e);return new h(t.point,{compressed:t.compressed,network:t.network})},h.fromDER=h.fromBuffer=function(e,t){l.checkArgument(h._isBuffer(e),"Must be a buffer of DER encoded public key");var r=h._transformDER(e,t);return new h(r.point,{compressed:r.compressed})},h.fromPoint=function(e,t){return l.checkArgument(e instanceof o,"First argument must be an instance of Point."),new h(e,{compressed:t})},h.fromHex=h.fromString=function(e,t){var r=i.from(e,t||"hex"),n=h._transformDER(r);return new h(n.point,{compressed:n.compressed})},h.fromX=function(e,t){var r=h._transformX(e,t);return new h(r.point,{compressed:r.compressed})},h.getValidationError=function(e){var t;try{new h(e)}catch(e){t=e}return t},h.isValid=function(e){return!h.getValidationError(e)},h.prototype.toObject=h.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},h.prototype.toBuffer=h.prototype.toDER=function(){var e,t=this.point.getX(),r=this.point.getY(),n=t.toBuffer({size:32}),o=r.toBuffer({size:32});return this.compressed?(e=o[o.length-1]%2?i.from([3]):i.from([2]),i.concat([e,n])):(e=i.from([4]),i.concat([e,n,o]))},h.prototype._getID=function(){return a.sha256ripemd160(this.toBuffer())},h.prototype.toAddress=function(e){return r(617).fromPublicKey(this,e||this.network)},h.prototype.toString=h.prototype.toHex=function(){return this.toDER().toString("hex")},h.prototype.inspect=function(){return"<PublicKey: "+this.toHex()+(this.compressed?"":", uncompressed")+">"},e.exports=h},5133(e,t,r){e.exports=r(6286),e.exports.Interpreter=r(6375)},6375(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6286),a=r(7239),s=r(9043),u=r(5067),c=r(7881),l=r(6161),h=r(9155),f=function e(t){if(!(this instanceof e))return new e(t);t?(this.initialize(),this.set(t)):this.initialize()};f.prototype.verify=function(e,t,i,a,s,u){var c,l=r(6558);if(n.isUndefined(i)&&(i=new l),n.isUndefined(a)&&(a=0),n.isUndefined(s)&&(s=0),s&f.SCRIPT_ENABLE_SIGHASH_FORKID&&(s|=f.SCRIPT_VERIFY_STRICTENC,!u))throw new Error("internal error - need satoshisBN to verify FORKID transactions");if(this.set({script:e,tx:i,nin:a,flags:s,satoshisBN:u}),0!==(s&f.SCRIPT_VERIFY_SIGPUSHONLY)&&!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(!this.evaluate())return!1;s&f.SCRIPT_VERIFY_P2SH&&(c=this.stack.slice());var h=this.stack;if(this.initialize(),this.set({script:t,stack:h,tx:i,nin:a,flags:s,satoshisBN:u}),!this.evaluate())return!1;if(0===this.stack.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_RESULT",!1;var p=this.stack[this.stack.length-1];if(!f.castToBool(p))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_STACK",!1;if(s&f.SCRIPT_VERIFY_P2SH&&t.isScriptHashOut()){if(!e.isPushOnly())return this.errstr="SCRIPT_ERR_SIG_PUSHONLY",!1;if(0===c.length)throw new Error("internal error - stack copy empty");var d=c[c.length-1],g=o.fromBuffer(d);if(c.pop(),this.initialize(),this.set({script:g,stack:c,tx:i,nin:a,flags:s,satoshisBN:u}),!this.evaluate())return!1;if(0===c.length)return this.errstr="SCRIPT_ERR_EVAL_FALSE_NO_P2SH_STACK",!1;if(!f.castToBool(c[c.length-1]))return this.errstr="SCRIPT_ERR_EVAL_FALSE_IN_P2SH_STACK",!1}if(0!==(s&f.SCRIPT_VERIFY_CLEANSTACK)){if(0===(s&f.SCRIPT_VERIFY_P2SH))throw new Error("internal error - CLEANSTACK without P2SH");if(1!==c.length)return this.errstr="SCRIPT_ERR_CLEANSTACK",!1}return!0},e.exports=f,f.prototype.initialize=function(e){this.stack=[],this.altstack=[],this.pc=0,this.pbegincodehash=0,this.nOpCount=0,this.vfExec=[],this.errstr="",this.flags=0},f.prototype.set=function(e){this.script=e.script||this.script,this.tx=e.tx||this.tx,this.nin=void 0!==e.nin?e.nin:this.nin,this.satoshisBN=e.satoshisBN||this.satoshisBN,this.stack=e.stack||this.stack,this.altstack=e.altstack||this.altstack,this.pc=void 0!==e.pc?e.pc:this.pc,this.pbegincodehash=void 0!==e.pbegincodehash?e.pbegincodehash:this.pbegincodehash,this.nOpCount=void 0!==e.nOpCount?e.nOpCount:this.nOpCount,this.vfExec=e.vfExec||this.vfExec,this.errstr=e.errstr||this.errstr,this.flags=void 0!==e.flags?e.flags:this.flags},f.true=i.from([1]),f.false=i.from([]),f.MAX_SCRIPT_ELEMENT_SIZE=520,f.MAXIMUM_ELEMENT_SIZE=4,f.MAX_OPS_PER_SCRIPT=201,f.LOCKTIME_THRESHOLD_BN=new s(f.LOCKTIME_THRESHOLD=5e8),f.useGenesisLimits=function(e){return f.MAX_SCRIPT_ELEMENT_SIZE=e=e||2147483647,f.MAXIMUM_ELEMENT_SIZE=e,f.MAX_OPS_PER_SCRIPT=e,f},f.SCRIPT_VERIFY_NONE=0,f.SCRIPT_VERIFY_P2SH=1,f.SCRIPT_VERIFY_STRICTENC=2,f.SCRIPT_VERIFY_DERSIG=4,f.SCRIPT_VERIFY_LOW_S=8,f.SCRIPT_VERIFY_NULLDUMMY=16,f.SCRIPT_VERIFY_SIGPUSHONLY=32,f.SCRIPT_VERIFY_MINIMALDATA=64,f.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS=128,f.SCRIPT_VERIFY_CLEANSTACK=256,f.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY=512,f.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY=1024,f.SCRIPT_VERIFY_MINIMALIF=8192,f.SCRIPT_VERIFY_NULLFAIL=16384,f.SCRIPT_VERIFY_COMPRESSED_PUBKEYTYPE=32768,f.SCRIPT_ENABLE_SIGHASH_FORKID=65536,f.SCRIPT_ENABLE_REPLAY_PROTECTION=1<<17,f.SCRIPT_ENABLE_MONOLITH_OPCODES=1<<18,f.SCRIPT_ENABLE_MAGNETIC_OPCODES=1<<19,f.SEQUENCE_LOCKTIME_DISABLE_FLAG=1<<31,f.SEQUENCE_LOCKTIME_TYPE_FLAG=1<<22,f.SEQUENCE_LOCKTIME_MASK=65535,f.castToBool=function(e){for(var t=0;t<e.length;t++)if(0!==e[t])return t!==e.length-1||128!==e[t];return!1},f.prototype.checkSignatureEncoding=function(e){var t;if(0===e.length)return!0;if(0!==(this.flags&(f.SCRIPT_VERIFY_DERSIG|f.SCRIPT_VERIFY_LOW_S|f.SCRIPT_VERIFY_STRICTENC))&&!c.isTxDER(e))return this.errstr="SCRIPT_ERR_SIG_DER_INVALID_FORMAT",!1;if(0!==(this.flags&f.SCRIPT_VERIFY_LOW_S)){if(!(t=c.fromTxFormat(e)).hasLowS())return this.errstr="SCRIPT_ERR_SIG_DER_HIGH_S",!1}else if(0!==(this.flags&f.SCRIPT_VERIFY_STRICTENC)){if(!(t=c.fromTxFormat(e)).hasDefinedHashtype())return this.errstr="SCRIPT_ERR_SIG_HASHTYPE",!1;if(!(this.flags&f.SCRIPT_ENABLE_SIGHASH_FORKID)&&t.nhashtype&c.SIGHASH_FORKID)return this.errstr="SCRIPT_ERR_ILLEGAL_FORKID",!1;if(this.flags&f.SCRIPT_ENABLE_SIGHASH_FORKID&&!(t.nhashtype&c.SIGHASH_FORKID))return this.errstr="SCRIPT_ERR_MUST_USE_FORKID",!1}return!0},f.prototype.checkPubkeyEncoding=function(e){return!(0!==(this.flags&f.SCRIPT_VERIFY_STRICTENC)&&!l.isValid(e))||(this.errstr="SCRIPT_ERR_PUBKEYTYPE",!1)},f._isMinimallyEncoded=function(e,t){return t=t||f.MAXIMUM_ELEMENT_SIZE,!(e.length>t)&&!(e.length>0&&!(127&e[e.length-1]||!(e.length<=1)&&128&e[e.length-2]))},f._minimallyEncode=function(e){if(0===e.length)return e;var t=e[e.length-1];if(127&t)return e;if(1===e.length)return i.from("");if(128&e[e.length-2])return e;for(var r=e.length-1;r>0;r--)if(0!==e[r-1])return 128&e[r-1]?e[r++]=t:e[r-1]|=t,e.slice(0,r);return i.from("")},f.prototype.evaluate=function(){if(this.script.toBuffer().length>1e4)return this.errstr="SCRIPT_ERR_SCRIPT_SIZE",!1;try{for(;this.pc<this.script.chunks.length;){let e={pc:this.pc,opcode:a.fromNumber(this.script.chunks[this.pc].opcodenum)};if(!this.step())return!1;this._callbackStep(e)}if(this.stack.length+this.altstack.length>1e3)return this.errstr="SCRIPT_ERR_STACK_SIZE",!1}catch(e){return this.errstr="SCRIPT_ERR_UNKNOWN_ERROR: "+e,!1}return!(this.vfExec.length>0)||(this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1)},f.prototype._callbackStep=function(e){if("function"==typeof this.stepListener)try{this.stepListener(e,h(this.stack,!0),h(this.altstack,!0))}catch(e){console.log(`Error in Step callback:${e}`)}},f.prototype.checkLockTime=function(e){return!!(this.tx.nLockTime<f.LOCKTIME_THRESHOLD&&e.lt(f.LOCKTIME_THRESHOLD_BN)||this.tx.nLockTime>=f.LOCKTIME_THRESHOLD&&e.gte(f.LOCKTIME_THRESHOLD_BN))&&(!e.gt(new s(this.tx.nLockTime))&&!this.tx.inputs[this.nin].isFinal())},f.prototype.checkSequence=function(e){var t=this.tx.inputs[this.nin].sequenceNumber;if(this.tx.version<2)return!1;if(t&f.SEQUENCE_LOCKTIME_DISABLE_FLAG)return!1;var r=f.SEQUENCE_LOCKTIME_TYPE_FLAG|f.SEQUENCE_LOCKTIME_MASK,i=new s(t&r),n=e.and(r),o=new s(f.SEQUENCE_LOCKTIME_TYPE_FLAG);return!!(i.lt(o)&&n.lt(o)||i.gte(o)&&n.gte(o))&&!n.gt(i)},f.prototype.step=function(){var e=this;function t(t){return e.stack[e.stack.length+t]}var r,h,p,d,g,m,y,v,b,S,w,O,_,I,E,A,P,k=0!==(this.flags&f.SCRIPT_VERIFY_MINIMALDATA),x=-1===this.vfExec.indexOf(!1),T=this.script.chunks[this.pc];this.pc++;var R=T.opcodenum;if(n.isUndefined(R))return this.errstr="SCRIPT_ERR_UNDEFINED_OPCODE",!1;if(T.buf&&T.buf.length>f.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;if(R>a.OP_16&&++this.nOpCount>f.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;if(function(t){switch(t){case a.OP_2MUL:case a.OP_2DIV:return!0;case a.OP_INVERT:case a.OP_MUL:case a.OP_LSHIFT:case a.OP_RSHIFT:if(0===(e.flags&f.SCRIPT_ENABLE_MAGNETIC_OPCODES))return!0;break;case a.OP_DIV:case a.OP_MOD:case a.OP_SPLIT:case a.OP_CAT:case a.OP_AND:case a.OP_OR:case a.OP_XOR:case a.OP_BIN2NUM:case a.OP_NUM2BIN:return!1}return!1}(R))return this.errstr="SCRIPT_ERR_DISABLED_OPCODE",!1;if(x&&R>=0&&R<=a.OP_PUSHDATA4){if(k&&!this.script.checkMinimalPush(this.pc-1))return this.errstr="SCRIPT_ERR_MINIMALDATA",!1;if(T.buf){if(T.len!==T.buf.length)throw new Error(`Length of push value not equal to length of data (${T.len},${T.buf.length})`);this.stack.push(T.buf)}else this.stack.push(f.false)}else if(x||a.OP_IF<=R&&R<=a.OP_ENDIF)switch(R){case a.OP_1NEGATE:case a.OP_1:case a.OP_2:case a.OP_3:case a.OP_4:case a.OP_5:case a.OP_6:case a.OP_7:case a.OP_8:case a.OP_9:case a.OP_10:case a.OP_11:case a.OP_12:case a.OP_13:case a.OP_14:case a.OP_15:case a.OP_16:g=R-(a.OP_1-1),r=new s(g).toScriptNumBuffer(),this.stack.push(r);break;case a.OP_NOP:break;case a.OP_NOP2:case a.OP_CHECKLOCKTIMEVERIFY:if(!(this.flags&f.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY)){if(this.flags&f.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var B=s.fromScriptNumBuffer(this.stack[this.stack.length-1],k,5);if(B.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(!this.checkLockTime(B))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP3:case a.OP_CHECKSEQUENCEVERIFY:if(!(this.flags&f.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY)){if(this.flags&f.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var N=s.fromScriptNumBuffer(t(-1),k,5);if(N.lt(new s(0)))return this.errstr="SCRIPT_ERR_NEGATIVE_LOCKTIME",!1;if(0!==(N&f.SEQUENCE_LOCKTIME_DISABLE_FLAG))break;if(!this.checkSequence(N))return this.errstr="SCRIPT_ERR_UNSATISFIED_LOCKTIME",!1;break;case a.OP_NOP1:case a.OP_NOP4:case a.OP_NOP5:case a.OP_NOP6:case a.OP_NOP7:case a.OP_NOP8:case a.OP_NOP9:case a.OP_NOP10:if(this.flags&f.SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS)return this.errstr="SCRIPT_ERR_DISCOURAGE_UPGRADABLE_NOPS",!1;break;case a.OP_IF:case a.OP_NOTIF:if(A=!1,x){if(this.stack.length<1)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;if(r=t(-1),this.flags&f.SCRIPT_VERIFY_MINIMALIF){if(r.length>1)return this.errstr="SCRIPT_ERR_MINIMALIF",!1;if(1===r.length&&1!==r[0])return this.errstr="SCRIPT_ERR_MINIMALIF",!1}A=f.castToBool(r),R===a.OP_NOTIF&&(A=!A),this.stack.pop()}this.vfExec.push(A);break;case a.OP_ELSE:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec[this.vfExec.length-1]=!this.vfExec[this.vfExec.length-1];break;case a.OP_ENDIF:if(0===this.vfExec.length)return this.errstr="SCRIPT_ERR_UNBALANCED_CONDITIONAL",!1;this.vfExec.pop();break;case a.OP_VERIFY:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=t(-1),!(A=f.castToBool(r)))return this.errstr="SCRIPT_ERR_VERIFY",!1;this.stack.pop();break;case a.OP_RETURN:return this.errstr="SCRIPT_ERR_OP_RETURN",!1;case a.OP_TOALTSTACK:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.altstack.push(this.stack.pop());break;case a.OP_FROMALTSTACK:if(this.altstack.length<1)return this.errstr="SCRIPT_ERR_INVALID_ALTSTACK_OPERATION",!1;this.stack.push(this.altstack.pop());break;case a.OP_2DROP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop(),this.stack.pop();break;case a.OP_2DUP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-2),p=t(-1),this.stack.push(i.from(h)),this.stack.push(i.from(p));break;case a.OP_3DUP:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-3),p=t(-2);var C=t(-1);this.stack.push(i.from(h)),this.stack.push(i.from(p)),this.stack.push(i.from(C));break;case a.OP_2OVER:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-4),p=t(-3),this.stack.push(i.from(h)),this.stack.push(i.from(p));break;case a.OP_2ROT:if(this.stack.length<6)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=this.stack.splice(this.stack.length-6,2),this.stack.push(d[0]),this.stack.push(d[1]);break;case a.OP_2SWAP:if(this.stack.length<4)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;d=this.stack.splice(this.stack.length-4,2),this.stack.push(d[0]),this.stack.push(d[1]);break;case a.OP_IFDUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=t(-1),(A=f.castToBool(r))&&this.stack.push(i.from(r));break;case a.OP_DEPTH:r=new s(this.stack.length).toScriptNumBuffer(),this.stack.push(r);break;case a.OP_DROP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.pop();break;case a.OP_DUP:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(i.from(t(-1)));break;case a.OP_NIP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,1);break;case a.OP_OVER:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.push(i.from(t(-2)));break;case a.OP_PICK:case a.OP_ROLL:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(r=t(-1),g=(v=s.fromScriptNumBuffer(r,k)).toNumber(),this.stack.pop(),g<0||g>=this.stack.length)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;r=t(-g-1),R===a.OP_ROLL&&this.stack.splice(this.stack.length-g-1,1),this.stack.push(i.from(r));break;case a.OP_ROT:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=t(-3),y=t(-2);var D=t(-1);this.stack[this.stack.length-3]=y,this.stack[this.stack.length-2]=D,this.stack[this.stack.length-1]=m;break;case a.OP_SWAP:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;m=t(-2),y=t(-1),this.stack[this.stack.length-2]=y,this.stack[this.stack.length-1]=m;break;case a.OP_TUCK:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;this.stack.splice(this.stack.length-2,0,i.from(t(-1)));break;case a.OP_SIZE:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;v=new s(t(-1).length),this.stack.push(v.toScriptNumBuffer());break;case a.OP_AND:case a.OP_OR:case a.OP_XOR:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=t(-2),p=t(-1),h.length!==p.length)return this.errstr="SCRIPT_ERR_INVALID_OPERAND_SIZE",!1;switch(R){case a.OP_AND:for(let e=0;e<h.length;e++)h[e]&=p[e];break;case a.OP_OR:for(let e=0;e<h.length;e++)h[e]|=p[e];break;case a.OP_XOR:for(let e=0;e<h.length;e++)h[e]^=p[e]}this.stack.pop();break;case a.OP_INVERT:this.stack.length<1&&(this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION"),r=t(-1);for(let e=0;e<r.length;e++)r[e]=~r[e];break;case a.OP_LSHIFT:case a.OP_RSHIFT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(0===(h=t(-2)).length)this.stack.pop();else{if(b=new s(h),(g=(S=s.fromScriptNumBuffer(t(-1),k)).toNumber())<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;let e;this.stack.pop(),this.stack.pop(),R===a.OP_LSHIFT&&(e=b.ushln(g)),R===a.OP_RSHIFT&&(e=b.ushrn(g));let r=function(e,t){let r=e;for(;r.length<t;)r=i.concat([i.from([0]),r]);return r}(i.from(e.toArray().slice(-1*h.length)),h.length);this.stack.push(r)}break;case a.OP_EQUAL:case a.OP_EQUALVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-2),p=t(-1);var M=h.toString("hex")===p.toString("hex");if(this.stack.pop(),this.stack.pop(),this.stack.push(M?f.true:f.false),R===a.OP_EQUALVERIFY){if(!M)return this.errstr="SCRIPT_ERR_EQUALVERIFY",!1;this.stack.pop()}break;case a.OP_1ADD:case a.OP_1SUB:case a.OP_NEGATE:case a.OP_ABS:case a.OP_NOT:case a.OP_0NOTEQUAL:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(r=t(-1),v=s.fromScriptNumBuffer(r,k),R){case a.OP_1ADD:v=v.add(s.One);break;case a.OP_1SUB:v=v.sub(s.One);break;case a.OP_NEGATE:v=v.neg();break;case a.OP_ABS:v.cmp(s.Zero)<0&&(v=v.neg());break;case a.OP_NOT:v=new s((0===v.cmp(s.Zero))+0);break;case a.OP_0NOTEQUAL:v=new s((0!==v.cmp(s.Zero))+0)}this.stack.pop(),this.stack.push(v.toScriptNumBuffer());break;case a.OP_ADD:case a.OP_SUB:case a.OP_MUL:case a.OP_MOD:case a.OP_DIV:case a.OP_BOOLAND:case a.OP_BOOLOR:case a.OP_NUMEQUAL:case a.OP_NUMEQUALVERIFY:case a.OP_NUMNOTEQUAL:case a.OP_LESSTHAN:case a.OP_GREATERTHAN:case a.OP_LESSTHANOREQUAL:case a.OP_GREATERTHANOREQUAL:case a.OP_MIN:case a.OP_MAX:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;switch(b=s.fromScriptNumBuffer(t(-2),k,f.MAXIMUM_ELEMENT_SIZE),S=s.fromScriptNumBuffer(t(-1),k,f.MAXIMUM_ELEMENT_SIZE),v=new s(0),R){case a.OP_ADD:v=b.add(S);break;case a.OP_SUB:v=b.sub(S);break;case a.OP_MUL:v=b.mul(S);break;case a.OP_DIV:if(0===S)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;v=b.div(S);break;case a.OP_MOD:if(0===S)return this.errstr="SCRIPT_ERR_DIV_BY_ZERO",!1;v=b.mod(S);break;case a.OP_BOOLAND:v=new s((0!==b.cmp(s.Zero)&&0!==S.cmp(s.Zero))+0);break;case a.OP_BOOLOR:v=new s((0!==b.cmp(s.Zero)||0!==S.cmp(s.Zero))+0);break;case a.OP_NUMEQUAL:case a.OP_NUMEQUALVERIFY:v=new s((0===b.cmp(S))+0);break;case a.OP_NUMNOTEQUAL:v=new s((0!==b.cmp(S))+0);break;case a.OP_LESSTHAN:v=new s((b.cmp(S)<0)+0);break;case a.OP_GREATERTHAN:v=new s((b.cmp(S)>0)+0);break;case a.OP_LESSTHANOREQUAL:v=new s((b.cmp(S)<=0)+0);break;case a.OP_GREATERTHANOREQUAL:v=new s((b.cmp(S)>=0)+0);break;case a.OP_MIN:v=b.cmp(S)<0?b:S;break;case a.OP_MAX:v=b.cmp(S)>0?b:S}if(this.stack.pop(),this.stack.pop(),this.stack.push(v.toScriptNumBuffer()),R===a.OP_NUMEQUALVERIFY){if(!f.castToBool(t(-1)))return this.errstr="SCRIPT_ERR_NUMEQUALVERIFY",!1;this.stack.pop()}break;case a.OP_WITHIN:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;b=s.fromScriptNumBuffer(t(-3),k,f.MAXIMUM_ELEMENT_SIZE),S=s.fromScriptNumBuffer(t(-2),k,f.MAXIMUM_ELEMENT_SIZE);var L=s.fromScriptNumBuffer(t(-1),k,f.MAXIMUM_ELEMENT_SIZE);A=S.cmp(b)<=0&&b.cmp(L)<0,this.stack.pop(),this.stack.pop(),this.stack.pop(),this.stack.push(A?f.true:f.false);break;case a.OP_RIPEMD160:case a.OP_SHA1:case a.OP_SHA256:case a.OP_HASH160:case a.OP_HASH256:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var H;r=t(-1),R===a.OP_RIPEMD160?H=u.ripemd160(r):R===a.OP_SHA1?H=u.sha1(r):R===a.OP_SHA256?H=u.sha256(r):R===a.OP_HASH160?H=u.sha256ripemd160(r):R===a.OP_HASH256&&(H=u.sha256sha256(r)),this.stack.pop(),this.stack.push(H);break;case a.OP_CODESEPARATOR:this.pbegincodehash=this.pc;break;case a.OP_CHECKSIG:case a.OP_CHECKSIGVERIFY:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(w=t(-2),O=t(-1),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(O))return!1;_=(new o).set({chunks:this.script.chunks.slice(this.pbegincodehash)});var j=(new o).add(w);_.findAndDelete(j);try{I=c.fromTxFormat(w),E=l.fromBuffer(O,!1),P=this.tx.verifySignature(I,E,this.nin,_,this.satoshisBN,this.flags)}catch(e){P=!1}if(!P&&this.flags&f.SCRIPT_VERIFY_NULLFAIL&&w.length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;if(this.stack.pop(),this.stack.pop(),this.stack.push(P?f.true:f.false),R===a.OP_CHECKSIGVERIFY){if(!P)return this.errstr="SCRIPT_ERR_CHECKSIGVERIFY",!1;this.stack.pop()}break;case a.OP_CHECKMULTISIG:case a.OP_CHECKMULTISIGVERIFY:var U=1;if(this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var F=s.fromScriptNumBuffer(t(-U),k).toNumber();if(F<0||F>20)return this.errstr="SCRIPT_ERR_PUBKEY_COUNT",!1;if(this.nOpCount+=F,this.nOpCount>f.MAX_OPS_PER_SCRIPT)return this.errstr="SCRIPT_ERR_OP_COUNT",!1;var K=++U;U+=F;var z=F+2;if(this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var V=s.fromScriptNumBuffer(t(-U),k).toNumber();if(V<0||V>F)return this.errstr="SCRIPT_ERR_SIG_COUNT",!1;var q=++U;if(U+=V,this.stack.length<U)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;_=(new o).set({chunks:this.script.chunks.slice(this.pbegincodehash)});for(var G=0;G<V;G++)w=t(-q-G),_.findAndDelete((new o).add(w));for(P=!0;P&&V>0;){if(w=t(-q),O=t(-K),!this.checkSignatureEncoding(w)||!this.checkPubkeyEncoding(O))return!1;var Y;try{I=c.fromTxFormat(w),E=l.fromBuffer(O,!1),Y=this.tx.verifySignature(I,E,this.nin,_,this.satoshisBN,this.flags)}catch(e){Y=!1}Y&&(q++,V--),K++,V>--F&&(P=!1)}for(;U-- >1;){if(!P&&this.flags&f.SCRIPT_VERIFY_NULLFAIL&&!z&&t(-1).length)return this.errstr="SCRIPT_ERR_NULLFAIL",!1;z>0&&z--,this.stack.pop()}if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(this.flags&f.SCRIPT_VERIFY_NULLDUMMY&&t(-1).length)return this.errstr="SCRIPT_ERR_SIG_NULLDUMMY",!1;if(this.stack.pop(),this.stack.push(P?f.true:f.false),R===a.OP_CHECKMULTISIGVERIFY){if(!P)return this.errstr="SCRIPT_ERR_CHECKMULTISIGVERIFY",!1;this.stack.pop()}break;case a.OP_CAT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=t(-2),p=t(-1),h.length+p.length>f.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack[this.stack.length-2]=i.concat([h,p]),this.stack.pop();break;case a.OP_SPLIT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-2);var W=s.fromScriptNumBuffer(t(-1),k).toNumber();if(W<0||W>h.length)return this.errstr="SCRIPT_ERR_INVALID_SPLIT_RANGE",!1;var $=i.from(h);this.stack[this.stack.length-2]=$.slice(0,W),this.stack[this.stack.length-1]=$.slice(W);break;case a.OP_LEFT:case a.OP_RIGHT:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=t(-2),(g=s.fromScriptNumBuffer(t(-1),k).toNumber())<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;g>h.length&&(g=h.length),this.stack.pop(),R===a.OP_LEFT?this.stack[this.stack.length-1]=i.from(h).slice(0,g):this.stack[this.stack.length-1]=i.from(h).slice(h.length-g);break;case a.OP_SUBSTR:if(this.stack.length<3)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;h=t(-3);var X=s.fromScriptNumBuffer(t(-1),k).toNumber(),J=s.fromScriptNumBuffer(t(-2),k).toNumber();if(J<0||X<0)return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;J>h.length&&(J=h.length),J+X>h.length&&(X=h.length-J),this.stack.pop(),this.stack.pop(),this.stack[this.stack.length-1]=i.from(h).slice(J,J+X);break;case a.OP_NUM2BIN:if(this.stack.length<2)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;var Z=s.fromScriptNumBuffer(t(-1),k).toNumber();if(Z>f.MAX_SCRIPT_ELEMENT_SIZE)return this.errstr="SCRIPT_ERR_PUSH_SIZE",!1;this.stack.pop();var Q=t(-1);if((Q=f._minimallyEncode(Q)).length>Z)return this.errstr="SCRIPT_ERR_IMPOSSIBLE_ENCODING",!1;if(Q.length===Z){this.stack[this.stack.length-1]=Q;break}var ee=0;Q.length>0&&(ee=128&Q[Q.length-1],Q[Q.length-1]&=127);var te=i.alloc(Z);Q.copy(te,0);for(var re=Q.length-1;re++<Z-2;)te[re]=0;te[re]=ee,this.stack[this.stack.length-1]=te;break;case a.OP_BIN2NUM:if(this.stack.length<1)return this.errstr="SCRIPT_ERR_INVALID_STACK_OPERATION",!1;if(h=t(-1),p=f._minimallyEncode(h),this.stack[this.stack.length-1]=p,!f._isMinimallyEncoded(p))return this.errstr="SCRIPT_ERR_INVALID_NUMBER_RANGE",!1;break;default:return this.errstr="SCRIPT_ERR_BAD_OPCODE",!1}return!0}},6286(e,t,r){"use strict";var i=r(8287).Buffer,n=r(617),o=r(7798),a=r(5750),s=r(5067),u=r(7239),c=r(6161),l=r(7881),h=r(1262),f=r(6365),p=r(4799),d=r(3649),g=r(8287),m=r(3035),y=function e(t){return this instanceof e?(this.chunks=[],i.isBuffer(t)?e.fromBuffer(t):t instanceof n?e.fromAddress(t):t instanceof e?e.fromBuffer(t.toBuffer()):p.isString(t)?e.fromString(t):void(p.isObject(t)&&p.isArray(t.chunks)&&this.set(t))):new e(t)};y.prototype.set=function(e){return f.checkArgument(p.isObject(e)),f.checkArgument(p.isArray(e.chunks)),this.chunks=e.chunks,this},y.fromBuffer=function(e){var t=new y;t.chunks=[];for(var r=new o(e);!r.finished();)try{var i,n,a=r.readUInt8();a>0&&a<u.OP_PUSHDATA1?(i=a,t.chunks.push({buf:r.read(i),len:i,opcodenum:a})):a===u.OP_PUSHDATA1?(i=r.readUInt8(),n=r.read(i),t.chunks.push({buf:n,len:i,opcodenum:a})):a===u.OP_PUSHDATA2?(i=r.readUInt16LE(),n=r.read(i),t.chunks.push({buf:n,len:i,opcodenum:a})):a===u.OP_PUSHDATA4?(i=r.readUInt32LE(),n=r.read(i),t.chunks.push({buf:n,len:i,opcodenum:a})):t.chunks.push({opcodenum:a})}catch(t){if(t instanceof RangeError)throw new d.Script.InvalidBuffer(e.toString("hex"));throw t}return t},y.prototype.toBuffer=function(){for(var e=new a,t=0;t<this.chunks.length;t++){var r=this.chunks[t],i=r.opcodenum;e.writeUInt8(r.opcodenum),r.buf&&(i<u.OP_PUSHDATA1?e.write(r.buf):i===u.OP_PUSHDATA1?(e.writeUInt8(r.len),e.write(r.buf)):i===u.OP_PUSHDATA2?(e.writeUInt16LE(r.len),e.write(r.buf)):i===u.OP_PUSHDATA4&&(e.writeUInt32LE(r.len),e.write(r.buf)))}return e.concat()},y.fromASM=function(e){var t=new y;t.chunks=[];for(var r=e.split(" "),n=0;n<r.length;){var o=r[n],a=u(o).toNumber();if("0"===o)a=0,t.chunks.push({opcodenum:a}),n+=1;else if("-1"===o)a=u.OP_1NEGATE,t.chunks.push({opcodenum:a}),n+=1;else if(p.isUndefined(a)){var s=i.from(r[n],"hex");if(s.toString("hex")!==r[n])throw new Error("invalid hex string in script");var c=s.length;c>=0&&c<u.OP_PUSHDATA1?a=c:c<Math.pow(2,8)?a=u.OP_PUSHDATA1:c<Math.pow(2,16)?a=u.OP_PUSHDATA2:c<Math.pow(2,32)&&(a=u.OP_PUSHDATA4),t.chunks.push({buf:s,len:s.length,opcodenum:a}),n+=1}else t.chunks.push({opcodenum:a}),n+=1}return t},y.fromHex=function(e){return new y(g.Buffer.from(e,"hex"))},y.fromString=function(e){if(m.isHexa(e)||0===e.length)return new y(g.Buffer.from(e,"hex"));var t=new y;t.chunks=[];for(var r=e.split(" "),n=0;n<r.length;){var o=r[n],a=u(o).toNumber();if(p.isUndefined(a)){if(!((a=parseInt(o))>0&&a<u.OP_PUSHDATA1))throw new Error("Invalid script: "+JSON.stringify(e));t.chunks.push({buf:i.from(r[n+1].slice(2),"hex"),len:a,opcodenum:a}),n+=2}else if(a===u.OP_PUSHDATA1||a===u.OP_PUSHDATA2||a===u.OP_PUSHDATA4){if("0x"!==r[n+2].slice(0,2))throw new Error("Pushdata data must start with 0x");t.chunks.push({buf:i.from(r[n+2].slice(2),"hex"),len:parseInt(r[n+1]),opcodenum:a}),n+=3}else t.chunks.push({opcodenum:a}),n+=1}return t},y.prototype._chunkToString=function(e,t){var r=e.opcodenum,i="asm"===t,n="";if(e.buf)i||r!==u.OP_PUSHDATA1&&r!==u.OP_PUSHDATA2&&r!==u.OP_PUSHDATA4||(n=n+" "+u(r).toString()),e.len>0&&(n=i?n+" "+e.buf.toString("hex"):n+" "+e.len+" 0x"+e.buf.toString("hex"));else if(void 0!==u.reverseMap[r])i?0===r?n+=" 0":79===r?n+=" -1":n=n+" "+u(r).toString():n=n+" "+u(r).toString();else{var o=r.toString(16);o.length%2!=0&&(o="0"+o),n=i?n+" "+o:n+" 0x"+o}return n},y.prototype.toASM=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r,"asm")}return e.substr(1)},y.prototype.toString=function(){for(var e="",t=0;t<this.chunks.length;t++){var r=this.chunks[t];e+=this._chunkToString(r)}return e.substr(1)},y.prototype.toHex=function(){return this.toBuffer().toString("hex")},y.prototype.inspect=function(){return"<Script: "+this.toString()+">"},y.prototype.isPublicKeyHashOut=function(){return!(5!==this.chunks.length||this.chunks[0].opcodenum!==u.OP_DUP||this.chunks[1].opcodenum!==u.OP_HASH160||!this.chunks[2].buf||20!==this.chunks[2].buf.length||this.chunks[3].opcodenum!==u.OP_EQUALVERIFY||this.chunks[4].opcodenum!==u.OP_CHECKSIG)},y.prototype.isPublicKeyHashOutPrefix=function(){return!!(this.chunks.length>=5&&this.chunks[0].opcodenum===u.OP_DUP&&this.chunks[1].opcodenum===u.OP_HASH160&&this.chunks[2].buf&&20===this.chunks[2].buf.length&&this.chunks[3].opcodenum===u.OP_EQUALVERIFY&&this.chunks[4].opcodenum===u.OP_CHECKSIG)},y.prototype.isPublicKeyHashIn=function(){if(2===this.chunks.length){var e=this.chunks[0].buf,t=this.chunks[1].buf;if(e&&e.length&&48===e[0]&&t&&t.length){var r=t[0];if((4===r||6===r||7===r)&&65===t.length)return!0;if((3===r||2===r)&&33===t.length)return!0}}return!1},y.prototype.getPublicKey=function(){return f.checkState(this.isPublicKeyOut(),"Can't retrieve PublicKey from a non-PK output"),this.chunks[0].buf},y.prototype.getPublicKeyHash=function(){return f.checkState(this.isPublicKeyHashOut(),"Can't retrieve PublicKeyHash from a non-PKH output"),this.chunks[2].buf},y.prototype.isPublicKeyOut=function(){if(2===this.chunks.length&&this.chunks[0].buf&&this.chunks[0].buf.length&&this.chunks[1].opcodenum===u.OP_CHECKSIG){var e=this.chunks[0].buf,t=e[0],r=!1;if((4!==t&&6!==t&&7!==t||65!==e.length)&&(3!==t&&2!==t||33!==e.length)||(r=!0),r)return c.isValid(e)}return!1},y.prototype.isPublicKeyIn=function(){if(1===this.chunks.length){var e=this.chunks[0].buf;if(e&&e.length&&48===e[0])return!0}return!1},y.prototype.isScriptHashOut=function(){var e=this.toBuffer();return 23===e.length&&e[0]===u.OP_HASH160&&20===e[1]&&e[e.length-1]===u.OP_EQUAL},y.prototype.isScriptHashIn=function(){if(this.chunks.length<=1)return!1;var e,t=this.chunks[this.chunks.length-1].buf;if(!t)return!1;try{e=y.fromBuffer(t)}catch(e){if(e instanceof d.Script.InvalidBuffer)return!1;throw e}return e.classify()!==y.types.UNKNOWN},y.prototype.isMultisigOut=function(){return this.chunks.length>3&&u.isSmallIntOp(this.chunks[0].opcodenum)&&this.chunks.slice(1,this.chunks.length-2).every(function(e){return e.buf&&i.isBuffer(e.buf)})&&u.isSmallIntOp(this.chunks[this.chunks.length-2].opcodenum)&&this.chunks[this.chunks.length-1].opcodenum===u.OP_CHECKMULTISIG},y.prototype.isMultisigIn=function(){return this.chunks.length>=2&&0===this.chunks[0].opcodenum&&this.chunks.slice(1,this.chunks.length).every(function(e){return e.buf&&i.isBuffer(e.buf)&&l.isTxDER(e.buf)})},y.prototype.isDataOut=function(){if(!(this.chunks.length>=1&&this.chunks[0].opcodenum===u.OP_RETURN))return!1;var e=this.chunks.slice(1);return new y({chunks:e}).isPushOnly()},y.prototype.isSafeDataOut=function(){if(this.chunks.length<2)return!1;if(this.chunks[0].opcodenum!==u.OP_FALSE)return!1;var e=this.chunks.slice(1);return new y({chunks:e}).isDataOut()},y.prototype.getData=function(){if(this.isSafeDataOut())return this.chunks.slice(2).map(e=>e.buf);if(this.isDataOut()||this.isScriptHashOut())return p.isUndefined(this.chunks[1])?i.alloc(0):i.from(this.chunks[1].buf);if(this.isPublicKeyHashOut())return i.from(this.chunks[2].buf);throw new Error("Unrecognized script type to get data from")},y.prototype.isPushOnly=function(){return p.every(this.chunks,function(e){return e.opcodenum<=u.OP_16||e.opcodenum===u.OP_PUSHDATA1||e.opcodenum===u.OP_PUSHDATA2||e.opcodenum===u.OP_PUSHDATA4})},(y.types={}).UNKNOWN="Unknown",y.types.PUBKEY_OUT="Pay to public key",y.types.PUBKEY_IN="Spend from public key",y.types.PUBKEYHASH_OUT="Pay to public key hash",y.types.PUBKEYHASH_IN="Spend from public key hash",y.types.SCRIPTHASH_OUT="Pay to script hash",y.types.SCRIPTHASH_IN="Spend from script hash",y.types.MULTISIG_OUT="Pay to multisig",y.types.MULTISIG_IN="Spend from multisig",y.types.DATA_OUT="Data push",y.types.SAFE_DATA_OUT="Safe data push",y.OP_RETURN_STANDARD_SIZE=220,y.prototype.classify=function(){if(this._isInput)return this.classifyInput();if(this._isOutput)return this.classifyOutput();var e=this.classifyOutput();return e!==y.types.UNKNOWN?e:this.classifyInput()},(y.outputIdentifiers={}).PUBKEY_OUT=y.prototype.isPublicKeyOut,y.outputIdentifiers.PUBKEYHASH_OUT=y.prototype.isPublicKeyHashOut,y.outputIdentifiers.MULTISIG_OUT=y.prototype.isMultisigOut,y.outputIdentifiers.SCRIPTHASH_OUT=y.prototype.isScriptHashOut,y.outputIdentifiers.DATA_OUT=y.prototype.isDataOut,y.outputIdentifiers.SAFE_DATA_OUT=y.prototype.isSafeDataOut,y.prototype.classifyOutput=function(){for(var e in y.outputIdentifiers)if(y.outputIdentifiers[e].bind(this)())return y.types[e];return y.types.UNKNOWN},(y.inputIdentifiers={}).PUBKEY_IN=y.prototype.isPublicKeyIn,y.inputIdentifiers.PUBKEYHASH_IN=y.prototype.isPublicKeyHashIn,y.inputIdentifiers.MULTISIG_IN=y.prototype.isMultisigIn,y.inputIdentifiers.SCRIPTHASH_IN=y.prototype.isScriptHashIn,y.prototype.classifyInput=function(){for(var e in y.inputIdentifiers)if(y.inputIdentifiers[e].bind(this)())return y.types[e];return y.types.UNKNOWN},y.prototype.isStandard=function(){return this.classify()!==y.types.UNKNOWN},y.prototype.prepend=function(e){return this._addByType(e,!0),this},y.prototype.equals=function(e){if(f.checkState(e instanceof y,"Must provide another script"),this.chunks.length!==e.chunks.length)return!1;var t;for(t=0;t<this.chunks.length;t++){if(i.isBuffer(this.chunks[t].buf)&&!i.isBuffer(e.chunks[t].buf))return!1;if(i.isBuffer(this.chunks[t].buf)&&!this.chunks[t].buf.equals(e.chunks[t].buf))return!1;if(this.chunks[t].opcodenum!==e.chunks[t].opcodenum)return!1}return!0},y.prototype.add=function(e){return this._addByType(e,!1),this},y.prototype._addByType=function(e,t){if("string"==typeof e)this._addOpcode(e,t);else if("number"==typeof e)this._addOpcode(e,t);else if(e instanceof u)this._addOpcode(e,t);else if(i.isBuffer(e))this._addBuffer(e,t);else if(e instanceof y)this.chunks=this.chunks.concat(e.chunks);else{if("object"!=typeof e)throw new Error("Invalid script chunk");this._insertAtPosition(e,t)}},y.prototype._insertAtPosition=function(e,t){t?this.chunks.unshift(e):this.chunks.push(e)},y.prototype._addOpcode=function(e,t){var r;return r="number"==typeof e?e:e instanceof u?e.toNumber():u(e).toNumber(),this._insertAtPosition({opcodenum:r},t),this},y.prototype._addBuffer=function(e,t){var r,i=e.length;if(i>=0&&i<u.OP_PUSHDATA1)r=i;else if(i<Math.pow(2,8))r=u.OP_PUSHDATA1;else if(i<Math.pow(2,16))r=u.OP_PUSHDATA2;else{if(!(i<Math.pow(2,32)))throw new Error("You can't push that much data");r=u.OP_PUSHDATA4}return this._insertAtPosition({buf:e,len:i,opcodenum:r},t),this},y.prototype.removeCodeseparators=function(){for(var e=[],t=0;t<this.chunks.length;t++)this.chunks[t].opcodenum!==u.OP_CODESEPARATOR&&e.push(this.chunks[t]);return this.chunks=e,this},y.buildMultisigOut=function(e,t,r){f.checkArgument(t<=e.length,"Number of required signatures must be less than or equal to the number of public keys"),r=r||{};var i=new y;i.add(u.smallInt(t));var n=e=p.map(e,c);r.noSorting||(n=e.map(e=>e.toString("hex")).sort().map(e=>new c(e)));for(var o=0;o<n.length;o++){var a=n[o];i.add(a.toBuffer())}return i.add(u.smallInt(e.length)),i.add(u.OP_CHECKMULTISIG),i},y.buildMultisigIn=function(e,t,r,n){f.checkArgument(p.isArray(e)),f.checkArgument(p.isNumber(t)),f.checkArgument(p.isArray(r)),n=n||{};var o=new y;return o.add(u.OP_0),p.each(r,function(e){f.checkArgument(i.isBuffer(e),"Signatures must be an array of Buffers"),o.add(e)}),o},y.buildP2SHMultisigIn=function(e,t,r,n){f.checkArgument(p.isArray(e)),f.checkArgument(p.isNumber(t)),f.checkArgument(p.isArray(r)),n=n||{};var o=new y;return o.add(u.OP_0),p.each(r,function(e){f.checkArgument(i.isBuffer(e),"Signatures must be an array of Buffers"),o.add(e)}),o.add((n.cachedMultisig||y.buildMultisigOut(e,t,n)).toBuffer()),o},y.buildPublicKeyHashOut=function(e){f.checkArgument(!p.isUndefined(e)),f.checkArgument(e instanceof c||e instanceof n||p.isString(e)),e instanceof c?e=e.toAddress():p.isString(e)&&(e=new n(e));var t=new y;return t.add(u.OP_DUP).add(u.OP_HASH160).add(e.hashBuffer).add(u.OP_EQUALVERIFY).add(u.OP_CHECKSIG),t._network=e.network,t},y.buildPublicKeyOut=function(e){f.checkArgument(e instanceof c);var t=new y;return t.add(e.toBuffer()).add(u.OP_CHECKSIG),t},y.buildDataOut=function(e,t){f.checkArgument(p.isUndefined(e)||p.isString(e)||p.isArray(e)||i.isBuffer(e));var r=e;p.isArray(r)||(r=[e]);var n=new y;n.add(u.OP_RETURN);for(let e of r)f.checkArgument(p.isUndefined(e)||p.isString(e)||i.isBuffer(e)),p.isString(e)&&(e=i.from(e,t)),p.isUndefined(e)||n.add(e);return n},y.buildSafeDataOut=function(e,t){var r=y.buildDataOut(e,t),i=new y;return i.add(u.OP_FALSE),i.add(r),i},y.buildScriptHashOut=function(e){f.checkArgument(e instanceof y||e instanceof n&&e.isPayToScriptHash());var t=new y;return t.add(u.OP_HASH160).add(e instanceof n?e.hashBuffer:s.sha256ripemd160(e.toBuffer())).add(u.OP_EQUAL),t._network=e._network||e.network,t},y.buildPublicKeyIn=function(e,t){f.checkArgument(e instanceof l||i.isBuffer(e)),f.checkArgument(p.isUndefined(t)||p.isNumber(t)),e instanceof l&&(e=e.toBuffer());var r=new y;return r.add(i.concat([e,i.from([255&(t||l.SIGHASH_ALL)])])),r},y.buildPublicKeyHashIn=function(e,t,r){return f.checkArgument(t instanceof l||i.isBuffer(t)),f.checkArgument(p.isUndefined(r)||p.isNumber(r)),t instanceof l&&(t=t.toBuffer()),(new y).add(i.concat([t,i.from([255&(r||l.SIGHASH_ALL)])])).add(new c(e).toBuffer())},y.empty=function(){return new y},y.prototype.toScriptHashOut=function(){return y.buildScriptHashOut(this)},y.fromAddress=function(e){if((e=n(e)).isPayToScriptHash())return y.buildScriptHashOut(e);if(e.isPayToPublicKeyHash())return y.buildPublicKeyHashOut(e);throw new d.Script.UnrecognizedAddress(e)},y.prototype.getAddressInfo=function(e){if(this._isInput)return this._getInputAddressInfo();if(this._isOutput)return this._getOutputAddressInfo();var t=this._getOutputAddressInfo();return t||this._getInputAddressInfo()},y.prototype._getOutputAddressInfo=function(){var e={};if(this.isScriptHashOut())e.hashBuffer=this.getData(),e.type=n.PayToScriptHash;else{if(!this.isPublicKeyHashOut())return!1;e.hashBuffer=this.getData(),e.type=n.PayToPublicKeyHash}return e},y.prototype._getInputAddressInfo=function(){var e={};if(this.isPublicKeyHashIn())e.hashBuffer=s.sha256ripemd160(this.chunks[1].buf),e.type=n.PayToPublicKeyHash;else{if(!this.isScriptHashIn())return!1;e.hashBuffer=s.sha256ripemd160(this.chunks[this.chunks.length-1].buf),e.type=n.PayToScriptHash}return e},y.prototype.toAddress=function(e){var t=this.getAddressInfo();return!!t&&(t.network=h.get(e)||this._network||h.defaultNetwork,new n(t))},y.prototype.findAndDelete=function(e){for(var t=e.toBuffer().toString("hex"),r=0;r<this.chunks.length;r++){t===y({chunks:[this.chunks[r]]}).toBuffer().toString("hex")&&this.chunks.splice(r,1)}return this},y.prototype.checkMinimalPush=function(e){var t=this.chunks[e],r=t.buf,i=t.opcodenum;return!r||(0===r.length?i===u.OP_0:1===r.length&&r[0]>=1&&r[0]<=16?i===u.OP_1+(r[0]-1):1===r.length&&129===r[0]?i===u.OP_1NEGATE:r.length<=75?i===r.length:r.length<=255?i===u.OP_PUSHDATA1:!(r.length<=65535)||i===u.OP_PUSHDATA2)},y.prototype._decodeOP_N=function(e){if(e===u.OP_0)return 0;if(e>=u.OP_1&&e<=u.OP_16)return e-(u.OP_1-1);throw new Error("Invalid opcode: "+JSON.stringify(e))},y.prototype.getSignatureOperationsCount=function(e){e=!!p.isUndefined(e)||e;var t=this,r=0,i=u.OP_INVALIDOPCODE;return p.each(t.chunks,function(n){var o=n.opcodenum;o===u.OP_CHECKSIG||o===u.OP_CHECKSIGVERIFY?r++:o!==u.OP_CHECKMULTISIG&&o!==u.OP_CHECKMULTISIGVERIFY||(e&&i>=u.OP_1&&i<=u.OP_16?r+=t._decodeOP_N(i):r+=20),i=o}),r},e.exports=y},62(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(5067),a=r(8866),s=n.Opcode,u=a.scriptNum;function c(e){return e instanceof n.PrivateKey?e.toPublicKey().toBuffer():e instanceof n.PublicKey?e.toBuffer():e}function l(e,t){var r=t.length;if(e<1||e>r||r<1||r>16)throw new Error("multisig requires 1 <= m <= n <= 16");var o=(new n.Script).add(s["OP_"+e]);return t.forEach(function(e){o.add(i.from(e))}),o.add(s["OP_"+r]).add(s.OP_CHECKMULTISIG),o.toBuffer()}e.exports={singleKey:function(){return{name:"single-key",commit:function(e){return o.sha256ripemd160(c(e))},emit:function(e){return e.add(s.OP_OVER).add(s.OP_HASH160).add(s.OP_EQUALVERIFY),e.add(s.OP_CHECKSIGVERIFY),e},unlockArgs:function(e,t,r,i,n){return[a.signInput(e,n,t,r,i),n.toPublicKey().toBuffer()]}}},multisig:function(e,t){if(e<1||e>t||t<1||t>16)throw new Error("multisig requires 1 <= m <= n <= 16");return{name:e+"-of-"+t+"-multisig",m:e,n:t,commit:function(r){if(r.length!==t)throw new Error("expected "+t+" public keys");return o.sha256ripemd160(l(e,r.map(c)))},emit:function(e){e.add(s.OP_OVER).add(s.OP_HASH160).add(s.OP_EQUALVERIFY),e.add(u(1)).add(s.OP_SPLIT).add(s.OP_NIP),e.add(s.OP_SIZE).add(u(2)).add(s.OP_SUB).add(s.OP_SPLIT).add(s.OP_DROP);for(var t=0;t<this.n;t++)e.add(u(34)).add(s.OP_SPLIT),e.add(s.OP_SWAP).add(u(1)).add(s.OP_SPLIT).add(s.OP_NIP),e.add(s.OP_TOALTSTACK);for(e.add(s.OP_DROP),e.add(u(this.m)),t=0;t<this.n;t++)e.add(s.OP_FROMALTSTACK);return e.add(u(this.n)),e.add(s.OP_CHECKMULTISIGVERIFY),e},unlockArgs:function(r,i,n,o,u){var h=u.keys;if(h.length!==t)throw new Error("expected "+t+" public keys in signer.keys");var f=l(e,h.map(c)),p=h.map(c).map(function(e){return e.toString("hex")}),d=u.signWith.map(function(e){var t=p.indexOf(e.toPublicKey().toBuffer().toString("hex"));if(t<0)throw new Error("signWith key is not in the committed key set");return{idx:t,priv:e}}).sort(function(e,t){return t.idx-e.idx}).slice(0,e);if(d.length<e)throw new Error("need at least "+e+" signing keys");var g=d.map(function(e){return a.signInput(r,e.priv,i,n,o)});return[s.OP_0].concat(g).concat([f])}}},predicate:function(e){if(!e||"function"!=typeof e.emit||"function"!=typeof e.unlockArgs||"function"!=typeof e.commit)throw new Error("predicate authorizer needs { commit, emit, unlockArgs } functions");return{name:e.name||"predicate",commit:e.commit,emit:e.emit,unlockArgs:e.unlockArgs}},redeemScript:l}},2525(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237);function o(e,t){if(!(this instanceof o))return new o(e,t);this.privateKey=e,this.publicKey=e?e.publicKey:null,this.options=t||{},this.allowNonEnforcing=!0===this.options.allowNonEnforcing,this.conditions=[],this.preimageFields=[],this.scriptTemplate=null,this.validationRules=[],this.sighashType=this.options.sighashType||n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_FORKID}o.prototype._assertEnforcingAllowed=function(){if(!this.allowNonEnforcing)throw new Error("SmartContract.Builder produces a NON-ENFORCING script (constant hash-lock → plain P2PK; it does not constrain the spend). Use SmartContract.policy() (declarative OP_PUSH_TX), or SmartContract.PushTx / Token / valueCovenant for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.")},o.prototype.validateField=function(e,t,r){var i={field:e,expectedValue:t,operator:(r=r||{}).operator||"EQUAL",required:!1!==r.required,description:r.description||"Validate "+e};return this.validationRules.push(i),this},o.prototype.addCondition=function(e,t){var r={type:"function"==typeof e?"CUSTOM":"OPCODE",condition:e,description:(t=t||{}).description||"Custom condition",required:!1!==t.required};return this.conditions.push(r),this},o.prototype.useTemplate=function(e,t){return this.scriptTemplate={name:e,params:t||{},customScript:"object"==typeof e?e:null},this},o.prototype.buildLockingScript=function(e){this._assertEnforcingAllowed();new n.Script;return this.scriptTemplate?this._buildFromTemplate(e):this._buildMultiFieldCovenant(e)},o.prototype.buildUnlockingScript=function(e,t,r){var o=new n.Script,a=n.Script.fromHex(r.script),s=n.Transaction.sighash.sign(e,this.privateKey,this.sighashType,t,a,new n.crypto.BN(r.satoshis)),u=i.concat([s.toDER(),i.from([this.sighashType])]);return o.add(u),r.originalPreimage&&o.add(i.from(r.originalPreimage,"hex")),this.conditions.forEach(function(e){"UNLOCK_DATA"===e.type&&o.add(e.data)}),o},o.prototype.createCovenant=function(e,t){this._assertEnforcingAllowed(),t=t||{};var i=(new n.Transaction).from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.privateKey.toAddress(),e.satoshis-(t.fee||1e3)),o=n.Script.fromHex(e.script),a=n.Transaction.sighash.sighashPreimage(i,this.sighashType,0,o,new n.crypto.BN(e.satoshis)),s=new(r(3890))(a).extract(),u=this.buildLockingScript({preimage:a,fields:s,transaction:i});return i.outputs[0].setScript(u),i.sign(this.privateKey),{creationTx:i,covenantUtxo:{txid:i.id,vout:0,satoshis:e.satoshis-(t.fee||1e3),script:u.toHex(),originalPreimage:a.toString("hex"),preimageFields:s,validationRules:this.validationRules.slice(),conditions:this.conditions.slice(),template:this.scriptTemplate,createdAt:(new Date).toISOString(),type:"builder_covenant"},lockingScript:u,preimageData:{preimage:a,fields:s}}},o.prototype.validateSpending=function(e,t){var i={valid:!0,errors:[],warnings:[],fieldValidations:[]},o=n.Script.fromHex(t.script),a=n.Transaction.sighash.sighashPreimage(e,this.sighashType,0,o,new n.crypto.BN(t.satoshis)),s=new(r(3890))(a).extract();t.validationRules&&t.validationRules.forEach(function(e){var r=this._validateFieldRule(e,s,t.preimageFields);i.fieldValidations.push(r),!r.passed&&e.required&&(i.valid=!1,i.errors.push(r.error))}.bind(this));var u=new n.Script.Interpreter,c=n.Script.Interpreter.SCRIPT_VERIFY_P2SH|n.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|n.Script.Interpreter.SCRIPT_VERIFY_DERSIG|n.Script.Interpreter.SCRIPT_VERIFY_LOW_S|n.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,l=e.inputs[0].script,h=n.Script.fromHex(t.script);return u.verify(l,h,e,0,c,new n.crypto.BN(t.satoshis))||(i.valid=!1,i.errors.push("Script interpreter validation failed: "+u.errstr)),i},o.prototype._buildFromTemplate=function(e){var t=this.scriptTemplate;if("HASH_LOCK"===t.name)return this._buildHashLockTemplate(e,t.params);if("MULTI_FIELD"===t.name)return this._buildMultiFieldTemplate(e,t.params);if(t.customScript)return t.customScript;throw new Error("Unknown template: "+t.name)},o.prototype._buildMultiFieldCovenant=function(e){var t=new n.Script;return t.add("OP_DUP"),this.validationRules.forEach(function(e,r){if(r>0&&t.add("OP_DUP"),t.add("OP_HASH256"),e.expectedValue){var o=n.crypto.Hash.sha256sha256(i.from(e.expectedValue,"hex"));t.add(o),t.add("OP_EQUALVERIFY")}}),t.add("OP_DROP"),this.publicKey&&(t.add(this.publicKey.toBuffer()),t.add("OP_CHECKSIG")),t},o.prototype._buildHashLockTemplate=function(e,t){var r=new n.Script;r.add("OP_DUP"),r.add("OP_HASH256");var i=t.hash||n.crypto.Hash.sha256sha256(e.preimage);return r.add(i),r.add("OP_EQUALVERIFY"),r.add("OP_DROP"),this.publicKey&&(r.add(this.publicKey.toBuffer()),r.add("OP_CHECKSIG")),r},o.prototype._validateFieldRule=function(e,t,r){var i=t[e.field],n=e.expectedValue;if("string"==typeof n&&n.startsWith("ORIGINAL_")){var o=n.replace("ORIGINAL_","");n=r[o]}var a=!1,s=null;switch(e.operator){case"EQUAL":(a=i&&i.equals?i.equals(n):i===n)||(s=e.field+" does not equal expected value");break;case"NOT_EQUAL":(a=i&&i.equals?!i.equals(n):i!==n)||(s=e.field+" should not equal specified value");break;case"PRESENT":(a=!!i)||(s=e.field+" is required but not present");break;default:s="Unknown validation operator: "+e.operator}return{field:e.field,operator:e.operator,passed:a,error:s,description:e.description}},o.createHashLock=function(e,t){return new o(e).useTemplate("HASH_LOCK",{hash:t})},o.createMultiField=function(e,t){var r=new o(e);return t.forEach(function(e){r.validateField(e.field,e.expectedValue,e.options)}),r},e.exports=o},8924(e,t,r){"use strict";var i,n=r(5606),o=r(8287).Buffer,a=r(5237),s=r(3121);try{i=r(2949)}catch(e){i=null}function u(e,t){if(!(this instanceof u))return new u(e,t);this.privateKey=e,this.publicKey=e.publicKey,this.address=e.toAddress(),t=t||{},this.storageDir=t.storageDir||(void 0!==n?s.join(n.cwd(),".bsv-covenants"):".bsv-covenants"),this.covenantUtxoPath=s.join(this.storageDir,"covenant_utxos.json"),this.sighashType=a.crypto.Signature.SIGHASH_ALL|a.crypto.Signature.SIGHASH_FORKID,this.allowNonEnforcing=!0===t.allowNonEnforcing,i&&this._ensureStorageDir()}u.prototype.createFromP2PKH=function(e){if(!this.allowNonEnforcing)throw new Error("SmartContract.Covenant builds a NON-ENFORCING script that reduces to plain P2PK — it does not constrain the spend. Use SmartContract.PushTx.valueCovenant (output binding) or SmartContract.Token / perpetualCovenant (stateful covenants) for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.");e.script||(e.script=u.reconstructP2pkhScript(this.address));var t=(new a.Transaction).from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.address,e.satoshis-1e3),r=a.Script.fromHex(e.script),i=a.Transaction.sighash.sighashPreimage(t,this.sighashType,0,r,new a.crypto.BN(e.satoshis)),n=a.crypto.Hash.sha256sha256(i),o=(new a.Script).add("OP_DUP").add("OP_HASH256").add(n).add("OP_EQUALVERIFY").add("OP_DROP").add(this.publicKey.toBuffer()).add("OP_CHECKSIG");return t.outputs[0].setScript(o),t.sign(this.privateKey),{transaction:t,covenantUtxo:{txid:t.id,vout:0,satoshis:e.satoshis-1e3,script:o.toHex(),scriptPubKey:o.toHex(),preimageHash:n.toString("hex"),originalPreimage:i.toString("hex"),status:"local",createdAt:(new Date).toISOString(),type:"preimage_covenant"}}},u.prototype.createSpendingTx=function(e,t,r){var i=t||this.address,n=r||e.satoshis-500,s=new a.Transaction;s.addInput(new a.Transaction.Input({prevTxId:e.txid,outputIndex:e.vout,script:a.Script.empty()}),a.Script.fromHex(e.script),e.satoshis),s.to(i,n);var u=a.Script.fromHex(e.script),c=a.Transaction.sighash.sign(s,this.privateKey,this.sighashType,0,u,new a.crypto.BN(e.satoshis)),l=o.concat([c.toDER(),o.from([this.sighashType])]),h=o.from(e.originalPreimage,"hex"),f=(new a.Script).add(l).add(h);return s.inputs[0].setScript(f),s},u.prototype.validate=function(e,t){var r=new a.Script.Interpreter,i=a.Script.Interpreter.SCRIPT_VERIFY_P2SH|a.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|a.Script.Interpreter.SCRIPT_VERIFY_DERSIG|a.Script.Interpreter.SCRIPT_VERIFY_LOW_S|a.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n=e.inputs[0].script,o=a.Script.fromHex(t.script),s=r.verify(n,o,e,0,i,new a.crypto.BN(t.satoshis));return{valid:s,error:s?null:r.errstr}},u.prototype.save=function(e){if(!i)return function(){(void 0!==n&&n.env&&n.env.BSV_DEBUG||"undefined"!=typeof window&&window.BSV_DEBUG)&&console.log.apply(console,arguments)}("File system operations not available in browser environment"),e;var t=this.list();return t.push(e),i.writeFileSync(this.covenantUtxoPath,JSON.stringify(t,null,2)),e},u.prototype.load=function(e){var t=this.list();if(e){var r;if(!(r=t.find(function(t){return t.txid===e})))throw new Error("Covenant UTXO with TXID "+e+" not found");return r}if(!(r=t.find(function(e){return"preimage_covenant"===e.type})))throw new Error("No preimage covenant UTXO found");return r},u.prototype.list=function(){return i.existsSync(this.covenantUtxoPath)?JSON.parse(i.readFileSync(this.covenantUtxoPath,"utf8")):[]},u.prototype.getPortfolio=function(){var e=this.list(),t={total:e.length,totalValue:e.reduce(function(e,t){return e+t.satoshis},0),byStatus:{},recent:e.slice(-5)};return e.forEach(function(e){var r=e.status||"local";t.byStatus[r]||(t.byStatus[r]={count:0,value:0}),t.byStatus[r].count++,t.byStatus[r].value+=e.satoshis}),t},u.prototype.completeFlow=function(e,t){var r=this.createFromP2PKH(e),i=this.save(r.covenantUtxo);t&&t(r.transaction,"creation");var n=this.createSpendingTx(i),o=this.validate(n,i);return t&&o.valid&&t(n,"spending"),{creationTx:r.transaction,spendingTx:n,covenantUtxo:i,validation:o,success:o.valid}},u.prototype._ensureStorageDir=function(){i.existsSync(this.storageDir)||i.mkdirSync(this.storageDir,{recursive:!0})},u.reconstructP2pkhScript=function(e){return a.Script.buildPublicKeyHashOut(e).toHex()},e.exports=u},6428(e,t,r){"use strict";e=r.nmd(e);var i=r(8287).Buffer;const{opcodeMap:n,scriptNum:o,utils:a}=r(7955);class s{constructor(){this.operations=[],this.comments=[]}comment(e){return this.comments.push(`// ${e}`),this}push(e){if("number"==typeof e)if(e>=-1&&e<=16)-1===e?this.operations.push("OP_1NEGATE"):0===e?this.operations.push("OP_0"):this.operations.push(`OP_${e}`);else{const t=o.encode(e);this.operations.push(t.toString("hex"))}else if("string"==typeof e)this.operations.push(e);else{if(!i.isBuffer(e))throw new Error("Invalid value type: "+typeof e);this.operations.push(e.toString("hex"))}return this}dup(){return this.operations.push("OP_DUP"),this}drop(){return this.operations.push("OP_DROP"),this}nip(){return this.operations.push("OP_NIP"),this}swap(){return this.operations.push("OP_SWAP"),this}over(){return this.operations.push("OP_OVER"),this}rot(){return this.operations.push("OP_ROT"),this}pick(e){return this.push(e),this.operations.push("OP_PICK"),this}roll(e){return this.push(e),this.operations.push("OP_ROLL"),this}depth(){return this.operations.push("OP_DEPTH"),this}add(){return this.operations.push("OP_ADD"),this}sub(){return this.operations.push("OP_SUB"),this}mul(){return this.operations.push("OP_MUL"),this}div(){return this.operations.push("OP_DIV"),this}mod(){return this.operations.push("OP_MOD"),this}negate(){return this.operations.push("OP_NEGATE"),this}abs(){return this.operations.push("OP_ABS"),this}min(){return this.operations.push("OP_MIN"),this}max(){return this.operations.push("OP_MAX"),this}equal(){return this.operations.push("OP_EQUAL"),this}equalVerify(){return this.operations.push("OP_EQUALVERIFY"),this}numEqual(){return this.operations.push("OP_NUMEQUAL"),this}numNotEqual(){return this.operations.push("OP_NUMNOTEQUAL"),this}lessThan(){return this.operations.push("OP_LESSTHAN"),this}greaterThan(){return this.operations.push("OP_GREATERTHAN"),this}lessThanOrEqual(){return this.operations.push("OP_LESSTHANOREQUAL"),this}greaterThanOrEqual(){return this.operations.push("OP_GREATERTHANOREQUAL"),this}within(){return this.operations.push("OP_WITHIN"),this}not(){return this.operations.push("OP_NOT"),this}boolAnd(){return this.operations.push("OP_BOOLAND"),this}boolOr(){return this.operations.push("OP_BOOLOR"),this}and(){return this.operations.push("OP_AND"),this}or(){return this.operations.push("OP_OR"),this}xor(){return this.operations.push("OP_XOR"),this}invert(){return this.operations.push("OP_INVERT"),this}cat(){return this.operations.push("OP_CAT"),this}split(){return this.operations.push("OP_SPLIT"),this}size(){return this.operations.push("OP_SIZE"),this}left(e){return this.push(e),this.operations.push("OP_LEFT"),this}right(e){return this.push(e),this.operations.push("OP_RIGHT"),this}substr(e,t){return this.push(t).push(e),this.operations.push("OP_SUBSTR"),this}sha256(){return this.operations.push("OP_SHA256"),this}hash256(){return this.operations.push("OP_HASH256"),this}hash160(){return this.operations.push("OP_HASH160"),this}ripemd160(){return this.operations.push("OP_RIPEMD160"),this}verify(){return this.operations.push("OP_VERIFY"),this}return(){return this.operations.push("OP_RETURN"),this}extractField(e){this.comment(`Extract ${e} field from preimage`);const t={nVersion:{strategy:"LEFT",offset:0,length:4},hashPrevouts:{strategy:"LEFT",offset:4,length:32},hashSequence:{strategy:"LEFT",offset:36,length:32},outpoint:{strategy:"LEFT",offset:68,length:36},scriptLen:{strategy:"DYNAMIC",position:"after_outpoint"},scriptCode:{strategy:"DYNAMIC",variable_length:!0},value:{strategy:"RIGHT",offsetFromEnd:52,length:8},nSequence:{strategy:"RIGHT",offsetFromEnd:44,length:4},hashOutputs:{strategy:"RIGHT",offsetFromEnd:40,length:32},nLocktime:{strategy:"RIGHT",offsetFromEnd:8,length:4},sighashType:{strategy:"RIGHT",offsetFromEnd:4,length:4}}[e];if(!t)throw new Error(`Unknown field: ${e}`);if("LEFT"===t.strategy)this.push(t.offset+t.length).split().drop().push(t.offset).split().swap().drop();else if("RIGHT"===t.strategy)this.size().push(t.offsetFromEnd).sub().split().nip().push(t.length).split().drop();else if("DYNAMIC"===t.strategy){if("scriptLen"!==e)throw new Error(`Dynamic extraction for ${e} not implemented`);this.push(104).split().nip().push(1).split().drop()}return this}validateField(e,t){return this.comment(`Validate ${e} equals expected value`),this.extractField(e),this.push(t),this.equalVerify(),this}validateRange(e,t,r){return this.comment(`Validate ${e} is within range [${t}, ${r})`),this.extractField(e),this.dup(),this.push(t),this.greaterThanOrEqual(),this.verify(),this.push(r),this.lessThan(),this.verify(),this}validateFields(e){return this.comment("Multi-field validation"),Object.entries(e).forEach(([e,t])=>{t.equals?this.validateField(e,t.equals):void 0===t.min&&void 0===t.max||this.validateRange(e,t.min||0,t.max||Number.MAX_SAFE_INTEGER)}),this}if(e){return this.comment("Begin IF block"),"function"==typeof e&&e(this),this.operations.push("OP_IF"),this}else(){return this.comment("ELSE block"),this.operations.push("OP_ELSE"),this}endif(){return this.comment("End IF block"),this.operations.push("OP_ENDIF"),this}build(){const e=this.operations.join(" "),t=this._cleanASM(e);return{operations:[...this.operations],comments:[...this.comments],asm:e,cleanedASM:t,hex:this._asmToHex(t),size:t.split(" ").length}}_cleanASM(e){return e.split(" ").map(e=>{if(/^\d+$/.test(e)){const t=parseInt(e);return t>=1&&t<=75?t.toString(16).padStart(2,"0"):o.encode(t).toString("hex")}return e}).join(" ")}_asmToHex(e){return e.split(" ").map(e=>n[e]?n[e].code.toString(16).padStart(2,"0"):/^[0-9a-fA-F]+$/.test(e)?e:"00").join("")}simulate(e=[]){return a.simulate(this.operations,e)}document(){const e=this.build();return{title:"Covenant Script Documentation",operations:e.operations.length,size:e.size,asm:e.cleanedASM,comments:this.comments,structure:this._analyzeStructure()}}_analyzeStructure(){const e={stack_operations:0,arithmetic:0,comparisons:0,crypto:0,data_manipulation:0,flow_control:0};return this.operations.forEach(t=>{const r=n[t];if(r)switch(r.category){case"stack":e.stack_operations++;break;case"arithmetic":e.arithmetic++;break;case"bitwise":e.comparisons++;break;case"crypto":e.crypto++;break;case"data":e.data_manipulation++;break;case"flow_control":e.flow_control++}}),e}}const u={valueLock:e=>(new s).comment("Value Lock Covenant").comment(`Expected value: ${e}`).validateField("value",e).push(1),hashLock:e=>(new s).comment("Hash Lock Covenant").comment(`Expected hash: ${e}`).sha256().push(e).equalVerify().push(1),multiSigWithValidation:(e,t,r)=>{const i=(new s).comment("Multi-Signature Covenant with Field Validation").comment(`Required signatures: ${e}`);return i.validateFields(r),i.comment("Signature validation (placeholder)").push(1),i},timeLock:e=>(new s).comment("Time Lock Covenant").comment(`Locktime: ${e}`).validateField("nLocktime",e).push(1),complexValidation:e=>{const t=(new s).comment("Complex Validation Covenant");return e.valueRange&&t.validateRange("value",e.valueRange.min,e.valueRange.max),e.fields&&t.validateFields(e.fields),e.hashValidation&&t.sha256().push(e.hashValidation.expectedHash).equalVerify(),t.push(1),t}};if(e.exports={CovenantBuilder:s,CovenantTemplates:u},r.c[r.s]===e){console.log("🏗️ Covenant Builder Demonstration"),console.log("=================================="),console.log("\n📊 Example 1: Value Lock Covenant");const e=u.valueLock("50c3000000000000").build();console.log("ASM:",e.cleanedASM),console.log("Size:",e.size,"operations"),console.log("\n📊 Example 2: Custom Arithmetic Covenant");const t=(new s).comment("Validate that value field equals 5 + 3").extractField("value").push(5).push(3).add().numEqual().verify().push(1),r=t.build();console.log("Operations:",r.operations.length),console.log("ASM:",r.cleanedASM),console.log("\n📊 Example 3: Documentation Generation");const i=t.document();console.log("Structure analysis:",i.structure),console.log("Comments:"),i.comments.forEach(e=>console.log(" "+e))}},8866(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(9043),a=r(5067),s=r(7881),u=s.SIGHASH_ALL|s.SIGHASH_FORKID;function c(){var e=n.Script.Interpreter;return e.SCRIPT_VERIFY_P2SH|e.SCRIPT_VERIFY_STRICTENC|e.SCRIPT_VERIFY_DERSIG|e.SCRIPT_VERIFY_LOW_S|e.SCRIPT_VERIFY_MINIMALDATA|e.SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY|e.SCRIPT_VERIFY_CHECKSEQUENCEVERIFY|e.SCRIPT_ENABLE_SIGHASH_FORKID|e.SCRIPT_ENABLE_MAGNETIC_OPCODES|e.SCRIPT_ENABLE_MONOLITH_OPCODES}function l(e,t,r,i,a){return n.Transaction.sighash.sighashPreimage(e,a||u,t,r,new o(i))}e.exports={SIGHASH:u,flags:c,enableGenesis:function(e){return n.Script.Interpreter.useGenesisLimits(e)},verify:function(e,t,r){r=r||{};var i=new n.Script.Interpreter;return{ok:i.verify(e,t,r.tx||new n.Transaction,r.inputIndex||0,r.flags||c(),new o(r.satoshis||0)),err:i.errstr||""}},rawPreimage:l,sighashDigest:function(e,t,r,i,n){return a.sha256sha256(l(e,t,r,i,n))},signInput:function(e,t,r,a,s,c){c=c||u;var l=n.Transaction.sighash.sign(e,t,c,r,a,new o(s));return i.concat([l.toDER(),i.from([c])])},fundAndSpend:function(e,t,r){r=r||{};var i=(new n.Transaction).addOutput(new n.Transaction.Output({script:e,satoshis:t})),o=new n.Transaction;return o.addInput(new n.Transaction.Input({prevTxId:i.hash,outputIndex:0,script:n.Script.empty()}),e,t),r.outputs&&r.outputs.forEach(function(e){o.addOutput(e)}),{funding:i,spend:o}},p2pkhOutput:function(e,t){var r=e.toAddress?e.toAddress():e;return new n.Transaction.Output({script:n.Script.buildPublicKeyHashOut(r),satoshis:t})},scriptNum:function(e){return 0===e?n.Opcode.OP_0:-1===e?n.Opcode.OP_1NEGATE:e>=1&&e<=16?n.Opcode["OP_"+e]:new o(e).toScriptNumBuffer()}}},6195(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(8866);function a(e){if(0===e)return"OP_0";if(e>=1&&e<=75)return"PUSH("+e+")";if(76===e)return"OP_PUSHDATA1";if(77===e)return"OP_PUSHDATA2";if(78===e)return"OP_PUSHDATA4";try{return n.Opcode.fromNumber(e).toString()}catch(t){return"0x"+e.toString(16)}}function s(e,t){t=t||16;var r=i.from(e).toString("hex");return r.length<=2*t?r||"0":r.slice(0,2*t)+"...("+e.length+"B)"}function u(e){var t=[],r=null;return e.steps.forEach(function(e,i){e.phase!==r&&(t.push("-- "+e.phase+" script --"),r=e.phase);var n=e.stack.length?e.stack.join(" | "):"(empty)",o=e.altstack.length?" alt:["+e.altstack.join(" | ")+"]":"";t.push(String(i).padStart(3)+" "+e.op.padEnd(16)+" -> ["+n+"]"+o)}),t.push((e.ok?"VALID":"INVALID")+(e.err?" ("+e.err+")":"")),t.join("\n")}e.exports={trace:function(e,t,r){r=r||{};var i=new n.Script.Interpreter,u=[];return i.stepListener=function(e,r,n){u.push({phase:i.script===t?"lock":"unlock",op:a(e.opcode&&"function"==typeof e.opcode.toNumber?e.opcode.toNumber():e.opcode.num),stack:r.map(function(e){return s(e)}),altstack:n.map(function(e){return s(e)})})},{ok:i.verify(e,t,r.tx||new n.Transaction,r.inputIndex||0,"number"==typeof r.flags?r.flags:o.flags(),new n.crypto.BN(r.satoshis||0)),err:i.errstr||"",steps:u}},format:u,print:function(e){return console.log(u(e)),e},opLabel:a}},9973(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(4904),a=r(9450),s=r(9127),u=r(8866),c=n.Script,l=n.Opcode,h=n.Transaction,f=u.scriptNum;function p(){if(!(this instanceof p))return new p;this._outputs=[],this._minLockTime=null}function d(){return new p}p.prototype.payTo=function(e,t){return this._outputs.push(function(e,t){return e instanceof h.Output?e:e instanceof c?new h.Output({script:e,satoshis:t}):u.p2pkhOutput(e,t)}(e,t)),this},p.prototype.lockUntil=function(e){return this._minLockTime=e,this},p.prototype.outputs=function(){return this._outputs.map(function(e){return new h.Output(e.toObject())})},p.prototype.describe=function(){var e=[];return this._outputs.forEach(function(t,r){e.push("output["+r+"] = "+t.satoshis+" sat to "+t.script.toASM().slice(0,24)+"...")}),null!==this._minLockTime&&e.push("nLockTime >= "+this._minLockTime),"spend allowed iff: "+e.join(" AND ")},p.prototype.compile=function(){if(0===this._outputs.length&&null===this._minLockTime)throw new Error("empty policy: add at least one constraint (payTo / lockUntil)");var e=this,t=(new c).add(l.OP_DUP);if(o.pushTxCore(t),t.add(l.OP_VERIFY),this._outputs.length){var r=o.hashOutputs(this._outputs);t.add(l.OP_DUP),o.extractHashOutputs(t),t.add(i.from(r)).add(l.OP_EQUALVERIFY)}return null!==this._minLockTime&&(t.add(l.OP_DUP),t.add(f(8)).add(l.OP_RIGHT).add(f(4)).add(l.OP_LEFT),t.add(l.OP_BIN2NUM).add(f(this._minLockTime)).add(l.OP_GREATERTHANOREQUAL).add(l.OP_VERIFY)),t.add(l.OP_DROP).add(l.OP_1),{lock:t,outputs:e.outputs(),describe:function(){return e.describe()},unlock:function(r,i,n){n=n||0;var a=null===e._minLockTime?0:e._minLockTime;return null!==e._minLockTime&&(r.inputs[n].sequenceNumber=4294967294),(new c).add(function(e,t,r,i,n,a){a=a||5e4;for(var s=0;s<a;s++){e.nLockTime=n+s;var c=u.rawPreimage(e,t,r,i);if(o.sFromPreimage(c))return c}throw new Error("covenant grind failed after "+a+" tries")}(r,n,t,i,a))}}},d.perpetual=function(e){return a.pelsCovenant(e)},d.token=function(e,t){return s.ownershipToken(e,t)},e.exports={policy:d,Policy:p}},6306(e,t,r){"use strict";var i=r(5237),n={Covenant:r(8924),Preimage:r(3890),SIGHASH:r(1803),Builder:r(2525),UTXOGenerator:r(5426),ScriptTester:r(7501),CovenantBuilder:r(6428).CovenantBuilder,CovenantTemplates:r(6428).CovenantTemplates,OpcodeMap:r(7955),ScriptUtils:r(3109),StackExaminer:r(2318),ScriptInterpreter:r(7530),CovenantHelpers:r(8866),Locks:r(3750),PushTx:r(4904),PELS:r(9450),Token:r(9127),Authorizers:r(62),DSL:r(9973),Policy:r(9973).Policy,Debugger:r(6195)};n.policy=n.DSL.policy,n.trace=function(e,t,r){return n.Debugger.trace(e,t,r)},n.enableGenesis=function(e){return n.CovenantHelpers.enableGenesis(e)},n.verifyScript=function(e,t,r){return n.CovenantHelpers.verify(e,t,r)},n.perpetualCovenant=function(e){return n.PELS.pelsCovenant(e)},n.ownershipToken=function(e,t){return n.Token.ownershipToken(e,t)},n.valueCovenant=function(e){return n.PushTx.valueCovenant(e)},n.ordinalLock=function(e,t){return n.Token.ordinalLock(e,t)},n.transferOrdinal=function(e,t,r,i,o,a){return n.Token.transferOrdinal(e,t,r,i,o,a)},n.createCovenant=function(e,t){return new n.Covenant(e,t)},n.extractPreimage=function(e,t){return new n.Preimage(e,t)},n.analyzeSIGHASH=function(e){return new n.SIGHASH(e)},n.buildCovenant=function(e,t){return new n.Builder(e,t)},n.createUTXOGenerator=function(e){return new n.UTXOGenerator(e)},n.createTestEnvironment=function(e){return n.UTXOGenerator.createTestEnvironment(e)},n.testScript=function(e,t,r){return n.ScriptTester.test(e,t,r)},n.testCovenant=function(e,t,r){return n.ScriptTester.testCovenant(e,t,r)},n.testFieldExtraction=function(e,t,r){return n.ScriptTester.testFieldExtraction(e,t,r)},n.debugScript=function(e,t){return new n.ScriptTester(t).debug(e)},n.explainZeroHashes=function(){return n.SIGHASH.explainZeroMystery()},n.getAllSIGHASHTypes=function(){return n.SIGHASH.getAllTypes()},n.demonstrateAllSIGHASH=function(){return n.SIGHASH.generateAllDemonstrations()},n.createCovenantBuilder=function(){return new n.CovenantBuilder},n.createValueLockCovenant=function(e){return n.CovenantTemplates.valueLock(e)},n.createHashLockCovenant=function(e){return n.CovenantTemplates.hashLock(e)},n.createComplexValidationCovenant=function(e){return n.CovenantTemplates.complexValidation(e)},n.getOpcodeMap=function(){return n.OpcodeMap.opcodeMap},n.simulateScript=function(e,t){return n.OpcodeMap.utils.simulate(e,t)},n.createASMFromJS=function(e){return n.OpcodeMap.utils.createASM(e)},n.scriptToASM=function(e){return n.ScriptUtils.scriptToASM(e)},n.asmToScript=function(e){return n.ScriptUtils.asmToScript(e)},n.asmToHex=function(e){return n.ScriptUtils.asmToHex(e)},n.hexToASM=function(e){return n.ScriptUtils.hexToASM(e)},n.scriptToHex=function(e){return n.ScriptUtils.scriptToHex(e)},n.validateASM=function(e){return n.ScriptUtils.validateASM(e)},n.validateScript=function(e){return n.ScriptUtils.validateScript(e)},n.estimateScriptSize=function(e){return n.ScriptUtils.estimateScriptSize(e)},n.optimizeScript=function(e){return n.ScriptUtils.optimizeScript(e)},n.compareScripts=function(e,t){return n.ScriptUtils.compareScripts(e,t)},n.explainScript=function(e){return n.ScriptUtils.explainScript(e)},n.scriptMetrics=function(e){return n.ScriptUtils.scriptMetrics(e)},n.analyzeComplexity=function(e){return n.ScriptUtils.analyzeComplexity(e)},n.findOptimizations=function(e){return n.ScriptUtils.findOptimizations(e)},n.covenantToEnglish=function(e){return n.ScriptUtils.covenantToEnglish(e)},n.batchTestScripts=function(e,t){return n.ScriptUtils.batchTestScripts(e,t)},n.examineStack=function(e,t){return n.StackExaminer.runScript(e,t)},n.debugScriptExecution=function(e,t,r){return(r=r||{}).stepMode?n.ScriptInterpreter.stepThroughScript(n.ScriptInterpreter.parseScript(e+" "+t),new i.Transaction,!0):n.ScriptInterpreter.runFullEvaluation(n.ScriptInterpreter.parseScript(e),n.ScriptInterpreter.parseScript(t),new i.Transaction)},n.parseScript=function(e){return n.ScriptInterpreter.parseScript(e)},n.printStack=function(e,t){return n.ScriptInterpreter.printStack(e,t)},n.createQuickCovenant=function(e,t){const r=n.createCovenantBuilder();switch(e){case"value_lock":return r.comment(`Value lock: minimum ${t.value} satoshis`).extractField("value").push(t.value).greaterThanOrEqual().verify().build();case"hash_lock":return r.comment(`Hash lock: requires preimage of ${t.hash}`).push("secret_placeholder").sha256().push(t.hash).equalVerify().build();case"time_lock":return r.comment(`Time lock: requires nLockTime > ${t.timestamp}`).extractField("nLockTime").push(t.timestamp).greaterThan().verify().build();case"multi_condition":let i=r.comment("Multi-condition covenant");return t.conditions.forEach(e=>{switch(e.type){case"value":i=i.extractField("value").push(e.value).greaterThanOrEqual().verify();break;case"hash":i=i.push("secret_placeholder").sha256().push(e.hash).equalVerify();break;case"time":i=i.extractField("nLockTime").push(e.timestamp).greaterThan().verify()}}),i.build();default:throw new Error(`Unknown covenant type: ${e}`)}},n.completeCovenantFlow=function(e,t,r){return new n.Covenant(e).completeFlow(t,r)},n.getEducationalResources=function(){return{zeroHashMystery:n.SIGHASH.explainZeroMystery(),sighashTypes:n.SIGHASH.getAllTypes(),exampleDemonstrations:n.SIGHASH.generateAllDemonstrations()}},n.utils={},n.utils.reconstructP2pkhScript=function(e){return i.Script.buildPublicKeyHashOut(e).toHex()},n.utils.createCovenantAddress=function(e){var t=i.crypto.Hash.sha256ripemd160(e.toBuffer());return i.Address.fromScriptHash(t)},n.utils.decodeCompactSize=function(e,t){return n.Preimage.decodeCompactSize(e,t)},n.version=r(8330).rE,n.description="Smart Contract Framework for Bitcoin SV",n.features={BIP143_PREIMAGE:!0,COMPACT_SIZE_VARINT:!0,BIDIRECTIONAL_EXTRACTION:!0,SIGHASH_DETECTION:!0,ZERO_HASH_WARNINGS:!0,MULTI_FIELD_VALIDATION:!0,REAL_UTXO_GENERATION:!0,SCRIPT_TESTING:!0,LOCAL_VERIFICATION:!0,JAVASCRIPT_TO_SCRIPT:!0,OPCODE_MAPPING:!0,COVENANT_BUILDER:!0,SCRIPT_ANALYSIS:!0,SCRIPT_OPTIMIZATION:!0,SCRIPT_CONVERSION:!0,BATCH_TESTING:!0,QUICK_COVENANTS:!0,SCRIPT_EXPLANATIONS:!0,STACK_EXAMINATION:!0,SCRIPT_DEBUGGING:!0,STEP_BY_STEP_EXECUTION:!0,INTERACTIVE_DEBUGGING:!0},n.interpretScript=n.debugScriptExecution,n.getScriptMetrics=n.scriptMetrics,e.exports=n},3750(e,t,r){"use strict";var i=r(5237),n=r(5067),o=r(8866),a=i.Script,s=i.Opcode,u=o.signInput,c=o.scriptNum;e.exports={hashLock:function(e){var t=n.sha256(e);return{lock:(new a).add(s.OP_SHA256).add(t).add(s.OP_EQUAL),meta:{name:"hash-lock",digest:t.toString("hex")},unlock:function(t,r,i){return(new a).add(i||e)}}},p2pkh:function(e){var t=e.toPublicKey(),r=a.buildPublicKeyHashOut(t.toAddress());return{lock:r,meta:{name:"p2pkh",address:t.toAddress().toString()},unlock:function(i,n){return(new a).add(u(i,e,0,r,n)).add(t.toBuffer())}}},timeLockCLTV:function(e,t){var r=e.toPublicKey(),i=(new a).add(c(t)).add(s.OP_CHECKLOCKTIMEVERIFY).add(s.OP_DROP).add(r.toBuffer()).add(s.OP_CHECKSIG);return{lock:i,meta:{name:"cltv-timelock",locktime:t},unlock:function(t,r){return(new a).add(u(t,e,0,i,r))}}},multisig:function(e,t){var r=t.map(function(e){return e.toPublicKey()}),i=(new a).add(s["OP_"+e]);return r.forEach(function(e){i.add(e.toBuffer())}),i.add(s["OP_"+r.length]).add(s.OP_CHECKMULTISIG),{lock:i,meta:{name:e+"-of-"+r.length+"-multisig"},unlock:function(r,n,o){o=o||t.slice(0,e);var c=(new a).add(s.OP_0);return o.forEach(function(e){c.add(u(r,e,0,i,n))}),c}}},htlc:function(e){var t=n.sha256(e.secret),r=(new a).add(s.OP_IF).add(s.OP_SHA256).add(t).add(s.OP_EQUALVERIFY).add(e.receiver.toPublicKey().toBuffer()).add(s.OP_CHECKSIG).add(s.OP_ELSE).add(c(e.timeout)).add(s.OP_CHECKLOCKTIMEVERIFY).add(s.OP_DROP).add(e.sender.toPublicKey().toBuffer()).add(s.OP_CHECKSIG).add(s.OP_ENDIF);return{lock:r,meta:{name:"htlc",digest:t.toString("hex"),timeout:e.timeout},unlockClaim:function(t,i){return(new a).add(u(t,e.receiver,0,r,i)).add(e.secret).add(s.OP_1)},unlockRefund:function(t,i){return(new a).add(u(t,e.sender,0,r,i)).add(s.OP_0)}}}}},7955(e,t,r){e=r.nmd(e);var i=r(8287).Buffer;const n={encode:e=>{if(0===e)return i.alloc(0);const t=e<0,r=[];let n=Math.abs(e);for(;n>0;)r.push(255&n),n>>=8;return 128&r[r.length-1]?r.push(t?128:0):t&&(r[r.length-1]|=128),i.from(r)},decode:e=>{if(0===e.length)return 0;const t=Array.from(e),r=128&t[t.length-1];r&&(t[t.length-1]&=127);let i=0;for(let e=t.length-1;e>=0;e--)i=(i<<8)+t[e];return r?-i:i}},o={OP_FALSE:{code:0,category:"constants",description:"Push empty array (false value)",action:e=>e.push(i.alloc(0))},OP_0:{code:0,category:"constants",description:"Push empty array (alias for OP_FALSE)",action:e=>e.push(i.alloc(0))},OP_PUSHDATA1:{code:76,category:"pushdata",description:"Push next [1 byte] bytes of data",action:"Read next byte as length; push that many bytes"},OP_PUSHDATA2:{code:77,category:"pushdata",description:"Push next [2 bytes LE] bytes of data",action:"Read next 2 bytes as length; push that many bytes"},OP_PUSHDATA4:{code:78,category:"pushdata",description:"Push next [4 bytes LE] bytes of data",action:"Read next 4 bytes as length; push that many bytes"},OP_1NEGATE:{code:79,category:"constants",description:"Push number -1",action:e=>e.push(n.encode(-1))},OP_RESERVED:{code:80,category:"reserved",description:"Reserved opcode (makes transaction invalid)",action:()=>{throw new Error("OP_RESERVED encountered")}},OP_TRUE:{code:81,category:"constants",description:"Push number 1 (true value)",action:e=>e.push(n.encode(1))},OP_1:{code:81,category:"constants",description:"Push number 1 (alias for OP_TRUE)",action:e=>e.push(n.encode(1))},OP_2:{code:82,category:"constants",description:"Push number 2",action:e=>e.push(n.encode(2))},OP_3:{code:83,category:"constants",description:"Push number 3",action:e=>e.push(n.encode(3))},OP_4:{code:84,category:"constants",description:"Push number 4",action:e=>e.push(n.encode(4))},OP_5:{code:85,category:"constants",description:"Push number 5",action:e=>e.push(n.encode(5))},OP_6:{code:86,category:"constants",description:"Push number 6",action:e=>e.push(n.encode(6))},OP_7:{code:87,category:"constants",description:"Push number 7",action:e=>e.push(n.encode(7))},OP_8:{code:88,category:"constants",description:"Push number 8",action:e=>e.push(n.encode(8))},OP_9:{code:89,category:"constants",description:"Push number 9",action:e=>e.push(n.encode(9))},OP_10:{code:90,category:"constants",description:"Push number 10",action:e=>e.push(n.encode(10))},OP_11:{code:91,category:"constants",description:"Push number 11",action:e=>e.push(n.encode(11))},OP_12:{code:92,category:"constants",description:"Push number 12",action:e=>e.push(n.encode(12))},OP_13:{code:93,category:"constants",description:"Push number 13",action:e=>e.push(n.encode(13))},OP_14:{code:94,category:"constants",description:"Push number 14",action:e=>e.push(n.encode(14))},OP_15:{code:95,category:"constants",description:"Push number 15",action:e=>e.push(n.encode(15))},OP_16:{code:96,category:"constants",description:"Push number 16",action:e=>e.push(n.encode(16))},OP_NOP:{code:97,category:"flow_control",description:"No operation (do nothing)",action:e=>{}},OP_VER:{code:98,category:"flow_control",description:"Push transaction version (disabled)",action:()=>{throw new Error("OP_VER is disabled")}},OP_IF:{code:99,category:"flow_control",description:"Execute if top stack value is true",action:"// Conditional execution (requires parser state)"},OP_NOTIF:{code:100,category:"flow_control",description:"Execute if top stack value is false",action:"// Conditional execution (requires parser state)"},OP_VERIF:{code:101,category:"flow_control",description:"Conditional execution based on transaction version (disabled)",action:()=>{throw new Error("OP_VERIF is disabled")}},OP_VERNOTIF:{code:102,category:"flow_control",description:"Conditional execution based on transaction version (disabled)",action:()=>{throw new Error("OP_VERNOTIF is disabled")}},OP_ELSE:{code:103,category:"flow_control",description:"Else branch of conditional",action:"// Conditional execution (requires parser state)"},OP_ENDIF:{code:104,category:"flow_control",description:"End conditional block",action:"// Conditional execution (requires parser state)"},OP_VERIFY:{code:105,category:"flow_control",description:"Fail if top stack value is not true",action:e=>{const t=e.pop();if(!t||0===t.length||0===n.decode(t))throw new Error("OP_VERIFY failed")}},OP_RETURN:{code:106,category:"flow_control",description:"Terminate script execution immediately",action:()=>{throw new Error("Script terminated by OP_RETURN")}},OP_TOALTSTACK:{code:107,category:"stack",description:"Move top item from main stack to alt stack",action:(e,t)=>t.push(e.pop())},OP_FROMALTSTACK:{code:108,category:"stack",description:"Move top item from alt stack to main stack",action:(e,t)=>e.push(t.pop())},OP_2DROP:{code:109,category:"stack",description:"Remove top two stack items",action:e=>{e.pop(),e.pop()}},OP_2DUP:{code:110,category:"stack",description:"Duplicate top two stack items",action:e=>{const t=e[e.length-1],r=e[e.length-2];e.push(i.from(r),i.from(t))}},OP_3DUP:{code:111,category:"stack",description:"Duplicate top three stack items",action:e=>{const t=e[e.length-1],r=e[e.length-2],n=e[e.length-3];e.push(i.from(n),i.from(r),i.from(t))}},OP_2OVER:{code:112,category:"stack",description:"Copy 3rd and 4th items to top",action:e=>{const t=e[e.length-3],r=e[e.length-4];e.push(i.from(r),i.from(t))}},OP_2ROT:{code:113,category:"stack",description:"Move 5th and 6th items to top",action:e=>{const t=e.splice(-5,1)[0],r=e.splice(-5,1)[0];e.push(t,r)}},OP_2SWAP:{code:114,category:"stack",description:"Swap top two pairs of items",action:e=>{const t=e.pop(),r=e.pop(),i=e.pop(),n=e.pop();e.push(r,t,n,i)}},OP_IFDUP:{code:115,category:"stack",description:"Duplicate top item if it is not zero",action:e=>{const t=e[e.length-1];t.length>0&&0!==n.decode(t)&&e.push(i.from(t))}},OP_DEPTH:{code:116,category:"stack",description:"Push stack size as number",action:e=>e.push(n.encode(e.length))},OP_DROP:{code:117,category:"stack",description:"Remove top stack item",action:e=>e.pop()},OP_DUP:{code:118,category:"stack",description:"Duplicate top stack item",action:e=>e.push(i.from(e[e.length-1]))},OP_NIP:{code:119,category:"stack",description:"Remove second-to-top item",action:e=>{const t=e.pop();e.pop(),e.push(t)}},OP_OVER:{code:120,category:"stack",description:"Copy second-to-top item to top",action:e=>e.push(i.from(e[e.length-2]))},OP_PICK:{code:121,category:"stack",description:"Copy nth item to top (0-indexed from top)",action:e=>{const t=n.decode(e.pop());e.push(i.from(e[e.length-1-t]))}},OP_ROLL:{code:122,category:"stack",description:"Move nth item to top (0-indexed from top)",action:e=>{const t=n.decode(e.pop()),r=e.splice(e.length-1-t,1)[0];e.push(r)}},OP_ROT:{code:123,category:"stack",description:"Rotate top three items left",action:e=>{const t=e.pop(),r=e.pop(),i=e.pop();e.push(r,t,i)}},OP_SWAP:{code:124,category:"stack",description:"Swap top two items",action:e=>{const t=e.pop(),r=e.pop();e.push(t,r)}},OP_TUCK:{code:125,category:"stack",description:"Copy top item below second item",action:e=>{const t=e.pop(),r=e.pop();e.push(t,r,t)}},OP_CAT:{code:126,category:"data",description:"Concatenate top two items",action:e=>{const t=e.pop(),r=e.pop();e.push(i.concat([r,t]))}},OP_SPLIT:{code:127,category:"data",description:"Split item at position n",action:e=>{const t=n.decode(e.pop()),r=e.pop();e.push(r.slice(0,t),r.slice(t))}},OP_NUM2BIN:{code:128,category:"data",description:"Convert number to byte sequence of length n",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop()),o=i.alloc(t),a=n.encode(r);a.copy(o,0,0,Math.min(a.length,t)),e.push(o)}},OP_BIN2NUM:{code:129,category:"data",description:"Convert byte sequence to number",action:e=>{const t=e.pop();e.push(n.encode(n.decode(t)))}},OP_SIZE:{code:130,category:"data",description:"Push size of top item (without removing item)",action:e=>e.push(n.encode(e[e.length-1].length))},OP_INVERT:{code:131,category:"bitwise",description:"Bitwise NOT of top item",action:e=>{const t=e.pop();e.push(i.from(t.map(e=>~e)))}},OP_AND:{code:132,category:"bitwise",description:"Bitwise AND of top two items",action:e=>{const t=e.pop(),r=e.pop(),n=Math.max(t.length,r.length),o=i.alloc(n);for(let e=0;e<n;e++)o[e]=(t[e]||0)&(r[e]||0);e.push(o)}},OP_OR:{code:133,category:"bitwise",description:"Bitwise OR of top two items",action:e=>{const t=e.pop(),r=e.pop(),n=Math.max(t.length,r.length),o=i.alloc(n);for(let e=0;e<n;e++)o[e]=(t[e]||0)|(r[e]||0);e.push(o)}},OP_XOR:{code:134,category:"bitwise",description:"Bitwise XOR of top two items",action:e=>{const t=e.pop(),r=e.pop(),n=Math.max(t.length,r.length),o=i.alloc(n);for(let e=0;e<n;e++)o[e]=(t[e]||0)^(r[e]||0);e.push(o)}},OP_EQUAL:{code:135,category:"bitwise",description:"Push 1 if top two items are equal, 0 otherwise",action:e=>{const t=e.pop(),r=e.pop();e.push(t.equals(r)?n.encode(1):n.encode(0))}},OP_EQUALVERIFY:{code:136,category:"bitwise",description:"Fail if top two items are not equal",action:e=>{const t=e.pop(),r=e.pop();if(!t.equals(r))throw new Error("OP_EQUALVERIFY failed")}},OP_1ADD:{code:139,category:"arithmetic",description:"Add 1 to top item",action:e=>{const t=n.decode(e.pop());e.push(n.encode(t+1))}},OP_1SUB:{code:140,category:"arithmetic",description:"Subtract 1 from top item",action:e=>{const t=n.decode(e.pop());e.push(n.encode(t-1))}},OP_2MUL:{code:141,category:"arithmetic",description:"Multiply top item by 2 (disabled)",action:()=>{throw new Error("OP_2MUL is disabled")}},OP_2DIV:{code:142,category:"arithmetic",description:"Divide top item by 2 (disabled)",action:()=>{throw new Error("OP_2DIV is disabled")}},OP_NEGATE:{code:143,category:"arithmetic",description:"Negate top item",action:e=>{const t=n.decode(e.pop());e.push(n.encode(-t))}},OP_ABS:{code:144,category:"arithmetic",description:"Absolute value of top item",action:e=>{const t=n.decode(e.pop());e.push(n.encode(Math.abs(t)))}},OP_NOT:{code:145,category:"arithmetic",description:"Logical NOT (0→1, non-zero→0)",action:e=>{const t=n.decode(e.pop());e.push(n.encode(0===t?1:0))}},OP_0NOTEQUAL:{code:146,category:"arithmetic",description:"Push 1 if top item is not zero, 0 otherwise",action:e=>{const t=n.decode(e.pop());e.push(n.encode(0!==t?1:0))}},OP_ADD:{code:147,category:"arithmetic",description:"Add top two items",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r+t))}},OP_SUB:{code:148,category:"arithmetic",description:"Subtract: second - first",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r-t))}},OP_MUL:{code:149,category:"arithmetic",description:"Multiply top two items",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r*t))}},OP_DIV:{code:150,category:"arithmetic",description:"Divide: second / first",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());if(0===t)throw new Error("Division by zero");e.push(n.encode(Math.floor(r/t)))}},OP_MOD:{code:151,category:"arithmetic",description:"Modulo: second % first",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());if(0===t)throw new Error("Division by zero");e.push(n.encode(r%t))}},OP_LSHIFT:{code:152,category:"arithmetic",description:"Left shift: second << first",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r<<t))}},OP_RSHIFT:{code:153,category:"arithmetic",description:"Right shift: second >> first",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r>>t))}},OP_BOOLAND:{code:154,category:"arithmetic",description:"Boolean AND: 1 if both non-zero, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(0!==t&&0!==r?1:0))}},OP_BOOLOR:{code:155,category:"arithmetic",description:"Boolean OR: 1 if either non-zero, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(0!==t||0!==r?1:0))}},OP_NUMEQUAL:{code:156,category:"arithmetic",description:"Push 1 if numbers are equal, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(t===r?1:0))}},OP_NUMEQUALVERIFY:{code:157,category:"arithmetic",description:"Fail if numbers are not equal",action:e=>{if(n.decode(e.pop())!==n.decode(e.pop()))throw new Error("OP_NUMEQUALVERIFY failed")}},OP_NUMNOTEQUAL:{code:158,category:"arithmetic",description:"Push 1 if numbers are not equal, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(t!==r?1:0))}},OP_LESSTHAN:{code:159,category:"arithmetic",description:"Push 1 if second < first, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r<t?1:0))}},OP_GREATERTHAN:{code:160,category:"arithmetic",description:"Push 1 if second > first, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r>t?1:0))}},OP_LESSTHANOREQUAL:{code:161,category:"arithmetic",description:"Push 1 if second <= first, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r<=t?1:0))}},OP_GREATERTHANOREQUAL:{code:162,category:"arithmetic",description:"Push 1 if second >= first, 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(r>=t?1:0))}},OP_MIN:{code:163,category:"arithmetic",description:"Push smaller of top two numbers",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(Math.min(t,r)))}},OP_MAX:{code:164,category:"arithmetic",description:"Push larger of top two numbers",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop());e.push(n.encode(Math.max(t,r)))}},OP_WITHIN:{code:165,category:"arithmetic",description:"Push 1 if x is within [min, max), 0 otherwise",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop()),i=n.decode(e.pop());e.push(n.encode(i>=r&&i<t?1:0))}},OP_RIPEMD160:{code:166,category:"crypto",description:"RIPEMD-160 hash of top item",action:e=>{const t=r(4151).createHash("ripemd160").update(e.pop()).digest();e.push(t)}},OP_SHA1:{code:167,category:"crypto",description:"SHA-1 hash of top item",action:e=>{const t=r(4151).createHash("sha1").update(e.pop()).digest();e.push(t)}},OP_SHA256:{code:168,category:"crypto",description:"SHA-256 hash of top item",action:e=>{const t=r(4151).createHash("sha256").update(e.pop()).digest();e.push(t)}},OP_HASH160:{code:169,category:"crypto",description:"SHA-256 then RIPEMD-160 hash of top item",action:e=>{const t=r(4151),i=t.createHash("sha256").update(e.pop()).digest(),n=t.createHash("ripemd160").update(i).digest();e.push(n)}},OP_HASH256:{code:170,category:"crypto",description:"Double SHA-256 hash of top item",action:e=>{const t=r(4151),i=t.createHash("sha256").update(e.pop()).digest(),n=t.createHash("sha256").update(i).digest();e.push(n)}},OP_CODESEPARATOR:{code:171,category:"crypto",description:"Mark signature checking boundary",action:e=>{}},OP_CHECKSIG:{code:172,category:"crypto",description:"Verify signature against public key",action:"// Signature verification (requires transaction context)"},OP_CHECKSIGVERIFY:{code:173,category:"crypto",description:"Verify signature, then fail if invalid",action:"// Signature verification with VERIFY (requires transaction context)"},OP_CHECKMULTISIG:{code:174,category:"crypto",description:"Verify multiple signatures against public keys",action:"// Multi-signature verification (requires transaction context)"},OP_CHECKMULTISIGVERIFY:{code:175,category:"crypto",description:"Verify multiple signatures, then fail if invalid",action:"// Multi-signature verification with VERIFY (requires transaction context)"},OP_SUBSTR:{code:179,category:"string",description:"Extract substring: string[start:start+length]",action:e=>{const t=n.decode(e.pop()),r=n.decode(e.pop()),i=e.pop();e.push(i.slice(r,r+t))}},OP_LEFT:{code:180,category:"string",description:"Extract leftmost n bytes",action:e=>{const t=n.decode(e.pop()),r=e.pop();e.push(r.slice(0,t))}},OP_RIGHT:{code:181,category:"string",description:"Extract rightmost n bytes",action:e=>{const t=n.decode(e.pop()),r=e.pop();e.push(r.slice(-t))}},OP_NOP1:{code:176,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP2:{code:177,category:"nop",description:"No operation (formerly CHECKLOCKTIMEVERIFY)",action:e=>{}},OP_NOP3:{code:178,category:"nop",description:"No operation (formerly CHECKSEQUENCEVERIFY)",action:e=>{}},OP_NOP4:{code:182,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP5:{code:183,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP6:{code:184,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP7:{code:185,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP8:{code:186,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP9:{code:187,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_NOP10:{code:188,category:"nop",description:"No operation (reserved for future use)",action:e=>{}},OP_RESERVED1:{code:137,category:"reserved",description:"Reserved opcode (makes transaction invalid)",action:()=>{throw new Error("OP_RESERVED1 encountered")}},OP_RESERVED2:{code:138,category:"reserved",description:"Reserved opcode (makes transaction invalid)",action:()=>{throw new Error("OP_RESERVED2 encountered")}},OP_CHECKLOCKTIMEVERIFY:{code:177,category:"disabled",description:"Check locktime (disabled post-Genesis)",action:e=>{}},OP_CHECKSEQUENCEVERIFY:{code:178,category:"disabled",description:"Check sequence (disabled post-Genesis)",action:e=>{}},OP_PUBKEYHASH:{code:253,category:"pseudo",description:"Template matching: public key hash",action:"// Template matching only"},OP_PUBKEY:{code:254,category:"pseudo",description:"Template matching: public key",action:"// Template matching only"},OP_INVALIDOPCODE:{code:255,category:"pseudo",description:"Invalid opcode placeholder",action:()=>{throw new Error("Invalid opcode encountered")}}},a={getByCategory:e=>Object.entries(o).filter(([t,r])=>r.category===e).reduce((e,[t,r])=>({...e,[t]:r}),{}),getCategories:()=>{const e=new Set;return Object.values(o).forEach(t=>e.add(t.category)),Array.from(e).sort()},createASM:e=>{const t=[];return e.forEach(e=>{if("string"==typeof e&&o[e])t.push(e);else if("number"==typeof e)if(e>=1&&e<=16)t.push(`OP_${e}`);else if(0===e)t.push("OP_0");else if(-1===e)t.push("OP_1NEGATE");else{const r=n.encode(e);t.push(r.toString("hex"))}else{if(!i.isBuffer(e))throw new Error(`Invalid operation: ${e}`);t.push(e.toString("hex"))}}),t.join(" ")},simulate:(e,t=[])=>{const r=[...t],i=[],n=[];return e.forEach((e,t)=>{if(!o[e])throw new Error(`Unknown opcode: ${e}`);const a=o[e],s=[...r];if("function"==typeof a.action)try{a.action(r,i),n.push({step:t+1,opcode:e,beforeStack:s.map(e=>e.toString("hex")),afterStack:r.map(e=>e.toString("hex")),description:a.description})}catch(r){throw n.push({step:t+1,opcode:e,beforeStack:s.map(e=>e.toString("hex")),afterStack:[],error:r.message,description:a.description}),r}else n.push({step:t+1,opcode:e,beforeStack:s.map(e=>e.toString("hex")),afterStack:s.map(e=>e.toString("hex")),note:a.action,description:a.description})}),{finalStack:r.map(e=>e.toString("hex")),finalAltStack:i.map(e=>e.toString("hex")),history:n}},opcodeToName:e=>{const t=Object.entries(o).find(([t,r])=>r.code===e);return t?t[0]:`UNKNOWN_${e.toString(16).padStart(2,"0")}`},nameToOpcode:e=>o[e]&&o[e].code,generateCovenantTemplate:(e,t)=>{const r=[];return"value"===e&&(r.push("OP_SIZE"),r.push(52),r.push("OP_SUB"),r.push("OP_SPLIT"),r.push("OP_DROP"),r.push(8),r.push("OP_SPLIT"),r.push("OP_DROP")),t&&(r.push(i.from(t,"hex")),r.push("OP_EQUAL")),{operations:r,asm:a.createASM(r),description:`Extract ${e} field and compare with expected value`}}};if(e.exports={opcodeMap:o,scriptNum:n,utils:a},r.c[r.s]===e){console.log("🔧 Comprehensive Bitcoin Script Opcode Map"),console.log("=========================================="),console.log(`Total opcodes mapped: ${Object.keys(o).length}`),console.log("\n📊 Categories:"),a.getCategories().forEach(e=>{const t=Object.values(o).filter(t=>t.category===e).length;console.log(` ${e}: ${t} opcodes`)}),console.log("\n🧪 Example: Stack manipulation simulation");try{const e=["OP_1","OP_2","OP_ADD","OP_3","OP_EQUAL"],t=a.simulate(e);console.log("Operations:",e.join(" ")),console.log("Final stack:",t.finalStack),console.log("Expected: ['01'] (true, since 1+2=3)"),console.log("\n📝 Step-by-step execution:"),t.history.forEach(e=>{console.log(` ${e.step}. ${e.opcode}: ${e.description}`),console.log(` Stack: [${e.beforeStack.join(", ")}] → [${e.afterStack.join(", ")}]`)})}catch(e){console.log("❌ Simulation error:",e.message)}console.log("\n🎯 Example: Covenant template generation");const e=a.generateCovenantTemplate("value","50c3000000000000");console.log("Generated ASM:",e.asm),console.log("Description:",e.description)}},9450(e,t,r){"use strict";var i=r(5237),n=r(4904),o=r(8866),a=i.Script,s=i.Opcode,u=o.scriptNum;e.exports={pelsCovenant:function(e){var t=new a;return t.add(s.OP_DUP),n.pushTxCore(t),t.add(s.OP_VERIFY),n.assertSighashAll(t),t.add(s.OP_DUP),t.add(u(104)).add(s.OP_SPLIT).add(s.OP_NIP),t.add(s.OP_SIZE).add(u(52)).add(s.OP_SUB).add(s.OP_SPLIT).add(s.OP_DROP),t.add(s.OP_OVER),t.add(u(52)).add(s.OP_RIGHT).add(u(8)).add(s.OP_LEFT),t.add(s.OP_BIN2NUM).add(u(e)).add(s.OP_SUB),t.add(u(8)).add(s.OP_NUM2BIN),t.add(s.OP_SWAP).add(s.OP_CAT),t.add(s.OP_HASH256),t.add(s.OP_SWAP),n.extractHashOutputs(t),t.add(s.OP_EQUAL),t}}},3890(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237);r(4151);function o(e,t){if(!(this instanceof o))return new o(e,t);this.preimage=i.isBuffer(e)?e:i.from(e,"hex"),this.options=t||{},this.strategy=this.options.strategy||"DYNAMIC",this.fields=null,this.sighashInfo=null,this.options.deferExtraction||this._extractFields()}o.prototype.extract=function(e){return this.strategy=e||this.strategy,this._extractFields(),this.fields},o.prototype.getSighashInfo=function(){return this.fields||this._extractFields(),this.sighashInfo},o.prototype.getField=function(e){return this.fields||this._extractFields(),this.fields[e]},o.prototype.extractField=function(e,t){t=t||{},this.fields||this._extractFields();var r=this._parsePreimageStructure(),i=this._generateBidirectionalASM(e,r,t.includeComments),n=this._extractSpecificField(e,r),o=this._interpretField(e,n,r);return{field:e,value:n?n.toString("hex"):null,buffer:n,asm:i,interpretation:o,strategy:this._getExtractionStrategy(e),structure:r._structure}},o.prototype.generateASM=function(e,t){var r=this._parsePreimageStructure();return this._generateBidirectionalASM(e,r,t)},o.prototype.extractFields=function(e){var t={};return e.forEach(function(e){t[e]=this.extractField(e)}.bind(this)),t},o.prototype.validate=function(){this.fields||this._extractFields();var e=[],t=[];return["version","hashPrevouts","hashSequence","outpoint","scriptCode","amount","sequence","hashOutputs","locktime","sighash"].forEach(function(t){this.fields[t]||e.push("Missing required field: "+t)}.bind(this)),this.sighashInfo.hasZeroHashes&&t.push("Zero hashes detected - check SIGHASH flags: "+this.sighashInfo.zeroFields.join(", ")),this.preimage.length<104&&e.push("Preimage too short: "+this.preimage.length+" bytes (minimum 104)"),{valid:0===e.length,errors:e,warnings:t,sighashInfo:this.sighashInfo}},o.prototype.toObject=function(){return this.fields||this._extractFields(),{preimage:this.preimage.toString("hex"),length:this.preimage.length,strategy:this.strategy,fields:{version:this.fields.version?this.fields.version.toString("hex"):null,hashPrevouts:this.fields.hashPrevouts?this.fields.hashPrevouts.toString("hex"):null,hashSequence:this.fields.hashSequence?this.fields.hashSequence.toString("hex"):null,outpoint:this.fields.outpoint?this.fields.outpoint.toString("hex"):null,scriptCode:this.fields.scriptCode?this.fields.scriptCode.toString("hex"):null,scriptCodeLength:this.fields.scriptCodeLength,amount:this.fields.amount?this.fields.amount.toString("hex"):null,sequence:this.fields.sequence?this.fields.sequence.toString("hex"):null,hashOutputs:this.fields.hashOutputs?this.fields.hashOutputs.toString("hex"):null,locktime:this.fields.locktime?this.fields.locktime.toString("hex"):null,sighash:this.fields.sighash?this.fields.sighash.toString("hex"):null},sighashInfo:this.sighashInfo,validation:this.validate()}},o.prototype._extractFields=function(){this.fields={},this.sighashInfo={flag:null,hasZeroHashes:!1,zeroFields:[],warnings:[]};try{"LEFT"===this.strategy||"DYNAMIC"===this.strategy?this._extractFromLeft():"RIGHT"===this.strategy&&this._extractFromRight(),this._analyzeSighash()}catch(e){if("DYNAMIC"!==this.strategy)throw e;try{this.strategy="RIGHT",this._extractFromRight(),this._analyzeSighash()}catch(t){throw new Error("Failed to extract preimage fields with any strategy: "+e.message)}}},o.prototype._extractFromLeft=function(){var e=0;this.fields.version=this.preimage.slice(e,e+4),e+=4,this.fields.hashPrevouts=this.preimage.slice(e,e+32),e+=32,this.fields.hashSequence=this.preimage.slice(e,e+32),e+=32,this.fields.outpoint=this.preimage.slice(e,e+36),e+=36;var t=o.decodeCompactSize(this.preimage,e);this.fields.scriptCodeLength=t.value,e=t.nextOffset,this.fields.scriptCode=this.preimage.slice(e,e+this.fields.scriptCodeLength),e+=this.fields.scriptCodeLength,this.fields.amount=this.preimage.slice(e,e+8),e+=8,this.fields.sequence=this.preimage.slice(e,e+4),e+=4,this.fields.hashOutputs=this.preimage.slice(e,e+32),e+=32,this.fields.locktime=this.preimage.slice(e,e+4),e+=4,this.fields.sighash=this.preimage.slice(e,e+4)},o.prototype._extractFromRight=function(){var e=this.preimage.length;e-=4,this.fields.sighash=this.preimage.slice(e,e+4),e-=4,this.fields.locktime=this.preimage.slice(e,e+4),e-=32,this.fields.hashOutputs=this.preimage.slice(e,e+32),e-=4,this.fields.sequence=this.preimage.slice(e,e+4),e-=8,this.fields.amount=this.preimage.slice(e,e+8);var t=o.decodeCompactSize(this.preimage,104);this.fields.scriptCodeLength=t.value,this.fields.scriptCode=this.preimage.slice(t.nextOffset,t.nextOffset+this.fields.scriptCodeLength),this.fields.version=this.preimage.slice(0,4),this.fields.hashPrevouts=this.preimage.slice(4,36),this.fields.hashSequence=this.preimage.slice(36,68),this.fields.outpoint=this.preimage.slice(68,104)},o.prototype._analyzeSighash=function(){if(this.fields.sighash){var e=this.fields.sighash.readUInt32LE(0);this.sighashInfo.flag=e;var t=31&e,r=!!(128&e),n=!!(64&e),o=i.alloc(32);r&&this.fields.hashPrevouts.equals(o)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashPrevouts"),this.sighashInfo.warnings.push("ANYONECANPAY flag detected - hashPrevouts is zero")),2===t&&this.fields.hashSequence.equals(o)&&(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashSequence"),this.sighashInfo.warnings.push("SIGHASH_NONE flag detected - hashSequence is zero")),2!==t&&3!==t||!this.fields.hashOutputs.equals(o)||(this.sighashInfo.hasZeroHashes=!0,this.sighashInfo.zeroFields.push("hashOutputs"),this.sighashInfo.warnings.push("SIGHASH_NONE/SINGLE flag detected - hashOutputs is zero"));var a=[];1===t?a.push("ALL"):2===t?a.push("NONE"):3===t&&a.push("SINGLE"),r&&a.push("ANYONECANPAY"),n&&a.push("FORKID"),this.sighashInfo.flagName=a.join(" | ")}},o.prototype._parsePreimageStructure=function(){for(var e=this.preimage,t=0,r={},i=[{name:"nVersion",len:4},{name:"hashPrevouts",len:32},{name:"hashSequence",len:32},{name:"outpoint_txid",len:32},{name:"outpoint_vout",len:4}],n=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],a=0;a<i.length;a++){var s=i[a];r[s.name]=e.slice(t,t+s.len).toString("hex"),t+=s.len}var u=o.decodeCompactSize(e,t);r.scriptLen=u.value,r.scriptLenSize=u.bytes,r.scriptLenRaw=e.slice(t,t+u.bytes).toString("hex"),t+=u.bytes,r.scriptCode=e.slice(t,t+r.scriptLen).toString("hex"),t+=r.scriptLen;for(var c=0;c<n.length;c++){var l=n[c];r[l.name]=e.slice(t,t+l.len).toString("hex"),t+=l.len}var h=i.reduce(function(e,t){return e+t.len},0),f=n.reduce(function(e,t){return e+t.len},0);return r._structure={leftFixed:h,scriptLenVarint:u.bytes,scriptCode:r.scriptLen,rightFixed:f,totalCalculated:h+u.bytes+r.scriptLen+f,totalActual:e.length},r},o.prototype._generateBidirectionalASM=function(e,t,r){if(["value","nSequence","hashOutputs","nLocktime","sighashType"].includes(e))return this._generateRightExtractionASM(e,r);if(["nVersion","hashPrevouts","hashSequence","outpoint_txid","outpoint_vout"].includes(e))return this._generateLeftExtractionASM(e,r);if("scriptCode"===e)return this._generateDynamicExtractionASM(t,r);if("scriptLen"===e)return this._generateScriptLenExtractionASM(t,r);throw new Error("Unknown field: "+e)},o.prototype._generateRightExtractionASM=function(e,t){for(var r=[{name:"value",len:8},{name:"nSequence",len:4},{name:"hashOutputs",len:32},{name:"nLocktime",len:4},{name:"sighashType",len:4}],i=0,n=0,o=!1,a=0;a<r.length;a++){var s=r[a];if(s.name===e){n=s.len,o=!0;break}i+=s.len}if(!o)throw new Error("Field not found in RIGHT fields: "+e);var u=52-i,c=[];return t?(c.push("# 🔄 Extract "+e+" from RIGHT side (bidirectional strategy)"),c.push("OP_SIZE # Push preimage size: [preimage, size]")):c.push("OP_SIZE"),(c=t?c.concat([u+" OP_SUB # Calculate split point: [preimage, split_point]","OP_SPLIT # Split: [left_part, right_part]","OP_NIP # Drop left (OP_SPLIT leaves right on top): [right_part]",n+" OP_SPLIT # Extract field: ["+e+", remaining]","OP_DROP # Clean up: ["+e+"]","# ✅ Result: "+e+" is now on top of stack"]):c.concat([u+" OP_SUB","OP_SPLIT","OP_NIP",n+" OP_SPLIT","OP_DROP"])).join("\n")},o.prototype._generateLeftExtractionASM=function(e,t){var r=[{name:"nVersion",len:4,offset:0},{name:"hashPrevouts",len:32,offset:4},{name:"hashSequence",len:32,offset:36},{name:"outpoint_txid",len:32,offset:68},{name:"outpoint_vout",len:4,offset:100}].find(function(t){return t.name===e});if(!r)throw new Error("Field not found in LEFT fields: "+e);return(t?["# 🔄 Extract "+e+" from LEFT side (bidirectional strategy)",r.offset+" OP_SPLIT # Skip to field: [prefix, remainder]","OP_NIP # Drop prefix (OP_SPLIT leaves remainder on top): [remainder]",r.len+" OP_SPLIT # Extract field: ["+e+", suffix]","OP_DROP # Clean up: ["+e+"]","# ✅ Result: "+e+" is now on top of stack"]:[r.offset+" OP_SPLIT","OP_NIP",r.len+" OP_SPLIT","OP_DROP"]).join("\n")},o.prototype._generateDynamicExtractionASM=function(e,t){return["# 🎯 Extract scriptCode DYNAMICALLY with CompactSize varint support",104+e.scriptLenSize+" OP_SPLIT # Skip left zone + scriptLen varint: [left_zone, remainder]","OP_NIP # Drop left (OP_SPLIT leaves remainder on top): [remainder]",e.scriptLen+" OP_SPLIT # Extract scriptCode: [scriptCode, right_zone]","OP_DROP # Clean up: [scriptCode]","# ✅ Result: scriptCode extracted with "+e.scriptLenSize+"-byte varint awareness"].join("\n")},o.prototype._generateScriptLenExtractionASM=function(e,t){return["# 🎯 Extract scriptLen CompactSize varint ("+e.scriptLenSize+" bytes)","104 OP_SPLIT # Skip left fixed fields: [left_zone, remainder]","OP_NIP # Drop left (OP_SPLIT leaves remainder on top): [remainder]",e.scriptLenSize+" OP_SPLIT # Extract varint: [scriptLen_varint, suffix]","OP_DROP # Clean up: [scriptLen_varint]","# ✅ Result: CompactSize varint (decode off-chain to get "+e.scriptLen+")"].join("\n")},o.prototype._extractSpecificField=function(e,t){var r=t[e];return r?i.from(r,"hex"):null},o.prototype._interpretField=function(e,t,r){if(!t)return null;var n={raw:t.toString("hex"),bytes:t.length};try{switch(e){case"nVersion":n.value=t.readUInt32LE(0),n.description="Transaction version "+n.value;break;case"value":8===t.length&&(n.satoshis=t.readBigUInt64LE(0).toString(),n.description=n.satoshis+" satoshis");break;case"sighashType":var o=t.readUInt32LE(0);n.value=o,n.description={1:"SIGHASH_ALL",65:"SIGHASH_ALL | FORKID",2:"SIGHASH_NONE",66:"SIGHASH_NONE | FORKID",3:"SIGHASH_SINGLE",67:"SIGHASH_SINGLE | FORKID"}[o]||"Custom ("+o+")";break;case"outpoint_vout":n.value=t.readUInt32LE(0),n.description="Output index "+n.value;break;case"scriptLen":n.varintSize=r.scriptLenSize,n.scriptLength=r.scriptLen,n.description=r.scriptLen+" bytes encoded as "+r.scriptLenSize+"-byte varint";break;case"scriptCode":25===t.length&&118===t[0]&&169===t[1]?(n.description="Standard P2PKH script (25 bytes)",n.type="P2PKH"):t.length>0&&106===t[0]?(n.description="OP_RETURN data script ("+t.length+" bytes)",n.type="OP_RETURN"):(n.description="Custom script ("+t.length+" bytes)",n.type="CUSTOM");break;default:if(["hashPrevouts","hashSequence","hashOutputs"].includes(e)){var a=i.alloc(32);t.equals(a)?(n.isZero=!0,n.description="Zero hash (check SIGHASH flags)"):n.description="32-byte hash"}}}catch(e){n.error=e.message}return n},o.prototype._getExtractionStrategy=function(e){return["value","nSequence","hashOutputs","nLocktime","sighashType"].includes(e)?"RIGHT":["nVersion","hashPrevouts","hashSequence","outpoint_txid","outpoint_vout"].includes(e)?"LEFT":"scriptCode"===e?"DYNAMIC":"scriptLen"===e?"VARINT":"UNKNOWN"},o.decodeCompactSize=function(e,t){var r=e[t];if(r<253)return{value:r,nextOffset:t+1,bytes:1};if(253===r)return{value:e.readUInt16LE(t+1),nextOffset:t+3,bytes:3};if(254===r)return{value:e.readUInt32LE(t+1),nextOffset:t+5,bytes:5};console.warn("Encountered 8-byte CompactSize - this is very unusual for script lengths");try{return{value:e.readUInt32LE(t+1),nextOffset:t+9,bytes:9}}catch(e){throw new Error("Invalid 8-byte CompactSize encoding in preimage")}},o.fromTransaction=function(e,t,r,i,a){return new o(n.Transaction.sighash.sighashPreimage(e,a,t,r,new n.crypto.BN(i)),{transaction:e,inputIndex:t,subscript:r,satoshis:i,sighashType:a})},o.createExample=function(e){var t=n.PrivateKey.fromRandom().toAddress(),r={txId:"0".repeat(64),outputIndex:0,script:n.Script.buildPublicKeyHashOut(t).toHex(),satoshis:1e5},i=(new n.Transaction).from(r).to(t,99e3),a=n.Script.fromHex(r.script);return o.fromTransaction(i,0,a,r.satoshis,e)},o.extractFromHex=function(e,t,r){return new o(e,{deferExtraction:!0}).extractField(t,r)},o.generateASMFromHex=function(e,t,r){return new o(e,{deferExtraction:!0}).generateASM(t,r)},o.extractMultipleFromHex=function(e,t){return new o(e,{deferExtraction:!0}).extractFields(t)},o.validateFromHex=function(e){return new o(e).validate()},o.analyzeFromHex=function(e){var t=new o(e),r=t._parsePreimageStructure(),i=t.validate();return{hex:e,length:e.length/2,structure:r._structure,fields:r,validation:i,sighashInfo:t.getSighashInfo(),extractField:function(e){return t.extractField(e)},generateASM:function(e){return t.generateASM(e)},getSummary:function(){return{totalBytes:r._structure.totalActual,scriptLength:r.scriptLen,scriptVarintSize:r.scriptLenSize,sighashType:r.sighashType,valid:i.valid,warnings:i.warnings}}}},e.exports=o},4904(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(9043),a=r(5067),s=r(8866),u=n.Script,c=n.Opcode,l=s.SIGHASH,h=s.scriptNum,f=i.from("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","hex"),p=new o("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16),d=i.concat([i.from([2]),f]),g=i.from(f).reverse(),m=i.concat([i.from(p.toBuffer()).reverse(),i.from([0])]),y=i.concat([i.from([48,68,2,32]),f,i.from([2,32])]);function v(e,t){var r;for(r=0;r<t-1;r++)e.add(c.OP_1).add(c.OP_SPLIT);for(r=0;r<t-1;r++)e.add(c.OP_SWAP).add(c.OP_CAT);return e}var b=n.crypto.Signature,S=b.SIGHASH_ALL|b.SIGHASH_FORKID,w=b.SIGHASH_SINGLE|b.SIGHASH_FORKID,O=b.SIGHASH_SINGLE|b.SIGHASH_ANYONECANPAY|b.SIGHASH_FORKID,_=b.SIGHASH_ALL|b.SIGHASH_ANYONECANPAY|b.SIGHASH_FORKID;function I(e,t){var r=t&&t.sighashType||l;return e.add(c.OP_HASH256),v(e,32),e.add(g).add(c.OP_ADD),e.add(m).add(c.OP_MOD),e.add(h(32)).add(c.OP_NUM2BIN),v(e,32),e.add(f).add(c.OP_DUP),e.add(c.OP_2).add(c.OP_SWAP).add(c.OP_CAT),e.add(c.OP_TOALTSTACK),e.add(i.from([48,68,2,32])).add(c.OP_SWAP).add(c.OP_CAT),e.add(i.from([2,32])).add(c.OP_CAT),e.add(c.OP_SWAP).add(c.OP_CAT),e.add(i.from([r])).add(c.OP_CAT),e.add(c.OP_FROMALTSTACK).add(c.OP_CHECKSIG),e}function E(e){return e.add(h(40)).add(c.OP_RIGHT).add(h(32)).add(c.OP_LEFT),e}function A(e,t){var r=i.from([255&t,0,0,0]);return e.add(c.OP_DUP).add(h(4)).add(c.OP_RIGHT).add(r).add(c.OP_EQUALVERIFY),e}var P=new o("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex");function k(e){var t=a.sha256sha256(e);if(t[0]<1||t[0]>127)return null;var r=new o(t).add(new o(f)).mod(p);if(r.gt(P))return null;var i=r.toBuffer("be",32);return i[0]>=1?i:null}e.exports={Gx:f,N:p,PUBKEY:d,gxLe:g,N_LE:m,DER_PREFIX:y,reverseBytes:v,pushTxCore:I,authenticator:function(){return I(new u)},extractHashOutputs:E,assertSighashAll:function(e){return A(e,l)},assertSighashType:A,SIGHASH_ALL_FORKID:S,SIGHASH_SINGLE_FORKID:w,SIGHASH_SINGLE_ANYONECANPAY_FORKID:O,SIGHASH_ALL_ANYONECANPAY_FORKID:_,hashOutputs:function(e){var t=i.concat(e.map(function(e){return e.toBufferWriter().toBuffer()}));return a.sha256sha256(t)},valueCovenant:function(e){var t=(new u).add(c.OP_DUP);return I(t),t.add(c.OP_VERIFY),E(t),t.add(i.from(e)).add(c.OP_EQUAL),t},sFromPreimage:k,grind:function(e,t,r,i,n){"number"==typeof n&&(n={maxTries:n});var o=(n=n||{}).maxTries||5e3,a=n.start||0,u=n.field||"nLockTime",c=n.sighashType||l;if("nLockTime"!==u&&"sequence"!==u)throw new Error("grind field must be 'nLockTime' or 'sequence'");for(var h=e.inputs[t],f=0;f<o;f++){var p=a+f;"nLockTime"===u?e.nLockTime=p:h.sequenceNumber=4294967294-p;var d=s.rawPreimage(e,t,r,i,c);if(k(d))return{preimage:d,tries:f+1,field:u,nonce:p}}throw new Error("OP_PUSH_TX grind failed after "+o+" tries")}}},7530(e,t,r){e=r.nmd(e);var i=r(5606),n=r(8287).Buffer;let o=null;try{"undefined"==typeof window&&(o=r(3582))}catch(e){o=null}const a="undefined"!=typeof window&&window.bsv?window.bsv:r(5237);function s(e){if(!e)return new a.Script;const t=e.trim(),r=/^[0-9a-fA-F]+$/.test(t.replace(/\s+/g,""));try{return r?a.Script.fromHex(t):a.Script.fromASM(t)}catch(e){console.error("❌ Error parsing script:",e.message),i.exit(1)}}function u(e,t=[]){const r=e=>e.length?e.toString("hex"):"(empty)",i=e.map(r);console.log("Stack:",i.length?i:["(empty)"]),t.length&&console.log("AltStack:",t.map(r))}async function c(e,t,r=!0){const n=new a.Script.Interpreter;n.script=e,n.tx=t,n.nIn=0,n.flags=a.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID;const s=e.chunks;let c=null;o&&void 0!==i&&i.stdin&&(c=o.createInterface({input:i.stdin,output:i.stdout})),console.log("==========================================="),console.log("🔍 SCRIPT INTERPRETER DEBUGGER (STEP MODE)"),console.log("===========================================\n"),console.log("Script:",e.toASM()),console.log("-------------------------------------------");for(let e=0;e<s.length;e++){const t=s[e],i=a.Opcode.reverseMap[t.opcodenum]||"PUSH";r&&c?await new Promise(t=>c.question(`\n[${e+1}/${s.length}] Step (${i}) — press Enter to execute...`,t)):r&&console.log(`\n[${e+1}/${s.length}] Step (${i})`);try{if("function"!=typeof n.step){console.log("⚠️ Step-by-step execution not supported in this BSV version"),console.log("💡 Consider using runFullEvaluation instead");break}n.step(),console.log(`🧩 Executed: ${i}`),u(n.stack,n.altstack)}catch(e){console.log(`⚠️ Error executing ${i}: ${e.message}`);break}}c&&c.close(),console.log("\n==========================================="),console.log("✅ Final Stack State:"),u(n.stack||[],n.altstack||[]),console.log("===========================================")}function l(e,t,r){console.log("==========================================="),console.log("🔍 SCRIPT INTERPRETER DEBUGGER (FULL RUN)"),console.log("===========================================\n");const i=new a.Script.Interpreter,n=new a.crypto.BN(1e5),o=i.verify(e,t,r,0,a.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n);console.log("🔐 Locking Script:",t.toASM()),console.log("🔓 Unlocking Script:",e.toASM()),console.log("-------------------------------------------"),console.log("✅ Result:",o?"TRUE (Success)":"❌ FALSE (Failure)"),console.log("Final Stack:",i.stack.map(e=>e.toString("hex"))),console.log("AltStack:",i.altstack.map(e=>e.toString("hex"))),console.log("===========================================")}async function h(){if(void 0===i||!i.argv)return void console.log("⚙️ CLI mode not available in browser environment");const e=i.argv.slice(2),t=t=>{const r=e.indexOf(t);return-1!==r&&e[r+1]?e[r+1]:null},r=t("--unlocking"),o=t("--locking"),u=t("--combined"),h=e.includes("--step"),f=e.includes("--truth");let p,d,g;if(u)g=s(u);else{p=s(r),d=s(o);const e=n.concat([p.toBuffer(),d.toBuffer()]);g=a.Script.fromBuffer(e)}const m=new a.Transaction,y=new a.Transaction.Input({prevTxId:"0".repeat(64),outputIndex:0,script:a.Script.empty(),satoshis:1e5,output:new a.Transaction.Output({satoshis:1e5,script:a.Script.empty()})});m.addInput(y),m.addOutput(new a.Transaction.Output({satoshis:1e5,script:a.Script.empty()})),h?await c(g,m,!0):f?l(p||a.Script.empty(),d||a.Script.empty(),m):console.log("⚙️ No mode specified. Use --step or --truth")}e.exports={parseScript:s,printStack:u,stepThroughScript:c,runFullEvaluation:l,main:h},r.c[r.s]===e&&h()},7501(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237);function o(e){if(!(this instanceof o))return new o(e);this.options=e||{},this.flags=this.options.flags||n.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,this.satoshis=this.options.satoshis||1e5}o.prototype.execute=function(e){var t=this._parseScript(e.unlocking),r=this._parseScript(e.locking),i=this._createDummyTransaction(),o=new n.Script.Interpreter,a=new n.crypto.BN(this.satoshis);try{return{success:o.verify(t,r,i,0,this.flags,a),unlocking:t.toASM(),locking:r.toASM(),finalStack:o.stack.map(function(e){return e.toString("hex")}),altStack:o.altstack.map(function(e){return e.toString("hex")}),error:null}}catch(e){return{success:!1,unlocking:t.toASM(),locking:r.toASM(),finalStack:[],altStack:[],error:e.message}}},o.prototype.debug=function(e){var t=this._createCombinedScript(e),r=this._createDummyTransaction(),i=new n.Script.Interpreter;i.script=t,i.tx=r,i.nIn=0,i.flags=this.flags;var o=[],a=t.chunks;try{for(var s=0;s<a.length;s++){var u=a[s],c=n.Opcode.reverseMap[u.opcodenum]||"PUSH",l=i.stack.map(function(e){return e.toString("hex")}),h=i.altstack.map(function(e){return e.toString("hex")});try{i.step();var f=i.stack.map(function(e){return e.toString("hex")}),p=i.altstack.map(function(e){return e.toString("hex")});o.push({step:s+1,opcode:c,beforeStack:l,afterStack:f,beforeAltStack:h,afterAltStack:p,success:!0,error:null})}catch(e){o.push({step:s+1,opcode:c,beforeStack:l,afterStack:l,beforeAltStack:h,afterAltStack:h,success:!1,error:e.message});break}}}catch(e){o.push({step:0,opcode:"INITIALIZATION",beforeStack:[],afterStack:[],beforeAltStack:[],afterAltStack:[],success:!1,error:e.message})}return{script:t.toASM(),steps:o,totalSteps:a.length,success:o.length>0&&o[o.length-1].success}},o.prototype.testCovenant=function(e){var t=e.preimage,r=e.constraints||{},i=this._buildCovenantScript(r,t),n=this.execute({unlocking:t,locking:i});return n.covenant={preimageLength:t.length/2,constraints:r,constraintResults:this._analyzeConstraints(t,r)},n},o.prototype.testFieldExtraction=function(e,t){try{var i=r(3890).extractFromHex(e,t,{includeComments:!1}),n=this._cleanASM(i.asm),o=this.execute({unlocking:e,locking:n+" OP_DROP OP_TRUE"});return o.fieldExtraction={field:t,strategy:i.strategy,value:i.value,interpretation:i.interpretation,asmGenerated:i.asm,cleanedASM:n},o}catch(e){return{success:!1,error:e.message,fieldExtraction:{field:t,error:e.message}}}},o.prototype._parseScript=function(e){if(!e)return new n.Script;var t=e.trim(),r=/^[0-9a-fA-F]+$/.test(t.replace(/\s+/g,""));try{if(r){var o=t.length/2;return o>=180&&o<=250?(new n.Script).add(i.from(t,"hex")):n.Script.fromHex(t)}return n.Script.fromASM(t)}catch(e){throw new Error("Failed to parse script: "+e.message)}},o.prototype._createCombinedScript=function(e){if(e.combined)return this._parseScript(e.combined);var t=this._parseScript(e.unlocking),r=this._parseScript(e.locking),o=i.concat([t.toBuffer(),r.toBuffer()]);return n.Script.fromBuffer(o)},o.prototype._createDummyTransaction=function(){var e=new n.Transaction,t=new n.Transaction.Input({prevTxId:"0".repeat(64),outputIndex:0,script:n.Script.empty(),satoshis:this.satoshis,output:new n.Transaction.Output({satoshis:this.satoshis,script:n.Script.empty()})});return e.addInput(t),e.addOutput(new n.Transaction.Output({satoshis:this.satoshis,script:n.Script.empty()})),e},o.prototype._buildCovenantScript=function(e,t){var i=[];try{var n=r(3890);if(e.minimumAmount){var o=n.generateASMFromHex(t,"value",!1);i.push(o),i.push("OP_BIN2NUM"),i.push(e.minimumAmount.toString()),i.push("OP_GREATERTHANOREQUAL"),i.push("OP_VERIFY")}if(e.requiredSighash){var a=n.generateASMFromHex(t,"sighashType",!1);i.push(a),i.push("OP_BIN2NUM"),i.push(e.requiredSighash.toString()),i.push("OP_EQUAL"),i.push("OP_VERIFY")}i.push("OP_TRUE");var s=i.join(" ");return this._cleanASM(s)}catch(e){throw new Error("Failed to build covenant script: "+e.message)}},o.prototype._cleanASM=function(e){var t=e.split("\n").map(function(e){return e.split("#")[0].trim()}).filter(function(e){return e.length>0}).join(" ").replace(/\s+/g," ").trim();return t=t.replace(/\b(\d+)\b/g,function(e,t){var r=parseInt(t);if(r>=1&&r<=16)return"OP_"+r;if(0===r)return"OP_0";if(-1===r)return"OP_1NEGATE";var n=r,o=n<0;o&&(n=-n);for(var a=[];n>0;)a.push(255&n),n=Math.floor(n/256);return 0===a.length&&a.push(0),o?a[a.length-1]>=128?a.push(128):a[a.length-1]|=128:a.length>0&&a[a.length-1]>=128&&a.push(0),i.from(a).toString("hex")})},o.prototype._analyzeConstraints=function(e,t){var i={};try{var n=r(3890);if(t.minimumAmount){var o=n.extractFromHex(e,"value",{includeComments:!1}),a=parseInt(o.interpretation.satoshis);i.amountCheck={constraint:t.minimumAmount,actual:a,satisfied:a>=t.minimumAmount}}if(t.requiredSighash){var s=n.extractFromHex(e,"sighashType",{includeComments:!1}),u=parseInt(s.value,16);i.sighashCheck={constraint:t.requiredSighash,actual:u,satisfied:(255&u)===t.requiredSighash}}}catch(e){i.error=e.message}return i},o.test=function(e,t,r){return new o(r).execute({unlocking:e,locking:t})},o.testCovenant=function(e,t,r){return new o(r).testCovenant({preimage:e,constraints:t})},o.testFieldExtraction=function(e,t,r){return new o(r).testFieldExtraction(e,t)},e.exports=o},3109(e,t,r){"use strict";var i=r(8287).Buffer;const n=r(5237);function o(e){if(i.isBuffer(e)){return n.Script.fromBuffer(e).toASM()}if(e&&"function"==typeof e.toASM)return e.toASM();throw new Error("Input must be a Buffer or Script object")}function a(e){try{return n.Script.fromASM(e),{valid:!0,error:null}}catch(e){return{valid:!1,error:e.message}}}function s(e){try{let t;if("string"==typeof e)t=n.Script.fromASM(e);else if(i.isBuffer(e))t=n.Script.fromBuffer(e);else{if(!e||"function"!=typeof e.toBuffer)return{valid:!1,error:"Invalid script input type"};t=e}const r=t.toBuffer(),o=t.toASM();return{valid:!0,error:null,size:r.length,asm:o,operations:o.split(" ").length}}catch(e){return{valid:!1,error:e.message}}}function u(e){try{let t;if("string"==typeof e)t=n.Script.fromASM(e);else if(Array.isArray(e))t=n.Script.fromASM(e.join(" "));else{if(i.isBuffer(e))return e.length;if(!e||"function"!=typeof e.toBuffer)throw new Error("Invalid script input");t=e}return t.toBuffer().length}catch(e){return{error:e.message}}}function c(e){try{const t=s(e);if(!t.valid)return{error:t.error};const r=t.asm,i=r.split(" ").filter(e=>e.length>0),n=t.size,o=i.filter(e=>e.startsWith("OP_")).length,a=i.filter(e=>!e.startsWith("OP_")&&e.length>0).length;let u=0;return i.forEach(e=>{e.startsWith("OP_")&&(["OP_CHECKSIG","OP_CHECKSIGVERIFY"].includes(e)?u+=100:["OP_SHA256","OP_HASH160","OP_HASH256"].includes(e)?u+=10:u+=1)}),{length:n,size:n,operations:i.length,opcodeCount:o,opcodes:o,dataElements:a,estimatedCost:u,complexity:u>50?"high":u>10?"medium":"low",asm:r}}catch(e){return{error:e.message}}}function l(e){const t=c(e);if(t.error)return t;const r={size:t.size,operations:t.operations,complexity:t.complexity,recommendations:[]};return t.size>520&&r.recommendations.push("Script exceeds standard size limit (520 bytes)"),t.estimatedCost>100&&r.recommendations.push("High execution cost - consider optimization"),t.operations>200&&r.recommendations.push("Many operations - may hit operation limits"),r}function h(e){try{let t;t="string"==typeof e?e:o(e);const r=t.split(" "),i=[];return r.forEach((e,t)=>{let r="";if(e.startsWith("OP_"))switch(e){case"OP_DUP":r="Duplicate the top stack item";break;case"OP_DROP":r="Remove the top stack item";break;case"OP_SWAP":r="Swap the top two stack items";break;case"OP_ADD":r="Add the top two numbers";break;case"OP_SUB":r="Subtract: second - first";break;case"OP_EQUAL":r="Check if top two items are equal";break;case"OP_VERIFY":r="Assert that top item is true (non-zero)";break;case"OP_CHECKSIG":r="Verify signature against public key";break;case"OP_SHA256":r="Calculate SHA256 hash of top item";break;case"OP_HASH160":r="Calculate RIPEMD160(SHA256(x)) hash";break;case"OP_IF":r="Begin conditional execution";break;case"OP_ELSE":r="Alternative branch of conditional";break;case"OP_ENDIF":r="End conditional execution";break;default:r=`Execute ${e}`}else e.length>0&&(r=`Push data: ${e} (${e.length/2} bytes)`);r&&i.push({operation:e,position:t,explanation:r})}),{asm:t,operations:r.length,explanations:i,summary:`Script with ${r.length} operations: ${i.map(e=>e.explanation).join(" → ")}`}}catch(e){return{error:e.message}}}e.exports={scriptToASM:o,asmToScript:function(e){try{return n.Script.fromASM(e)}catch(e){throw new Error(`Invalid ASM string: ${e.message}`)}},asmToHex:function(e){try{return n.Script.fromASM(e).toBuffer().toString("hex")}catch(e){throw new Error(`Cannot convert ASM to hex: ${e.message}`)}},hexToASM:function(e){try{const t=i.from(e,"hex");return n.Script.fromBuffer(t).toASM()}catch(e){throw new Error(`Cannot convert hex to ASM: ${e.message}`)}},scriptToHex:function(e){if(i.isBuffer(e))return e.toString("hex");if(e&&"function"==typeof e.toBuffer)return e.toBuffer().toString("hex");throw new Error("Input must be a Buffer or Script object")},validateASM:a,validateScript:s,validateSyntax:function(e){const t=a(e);if(!t.valid)return t;const r=e.split(" "),i=[];for(let e=0;e<r.length;e++){const t=r[e];t.startsWith("OP_")&&!n.Opcode.map[t]&&i.push(`Unknown opcode: ${t} at position ${e}`),!t.startsWith("OP_")&&t.length>0&&(/^[0-9a-fA-F]*$/.test(t)||i.push(`Invalid hex data: ${t} at position ${e}`))}return{valid:0===i.length,error:i.length>0?i.join("; "):null,issues:i,operations:r.length}},estimateScriptSize:u,scriptMetrics:c,analyzeComplexity:l,optimizeScript:function(e){try{let t;t="string"==typeof e?e:Array.isArray(e)?e.join(" "):o(e);const r=t.split(" "),i=[];for(let e=0;e<r.length;e++){const t=r[e],n=r[e+1];t&&""!==t.trim()&&("OP_DUP"!==t||"OP_DROP"!==n?(t.startsWith("OP_")||!n||n.startsWith("OP_"),i.push(t)):e++)}const a=i.join(" "),s=u(t),c=u(a);let l=null;try{l=n.Script.fromASM(a)}catch(e){l=null}return{original:t,optimized:a,originalSize:s,optimizedSize:c,savings:s-c,improvement:s>0?((s-c)/s*100).toFixed(1)+"%":"0%",script:l}}catch(e){return{error:e.message}}},findOptimizations:function(e){const t=[];try{let r;r="string"==typeof e?e:o(e);const i=r.split(" ");for(let e=0;e<i.length-1;e++){const r=i[e],n=i[e+1];if("OP_DUP"===r&&"OP_DROP"===n&&t.push({type:"redundant_operation",position:e,description:"Remove redundant OP_DUP OP_DROP pair",savings:2}),r.match(/^[0-9a-fA-F]+$/)&&2===r.length){const i=parseInt(r,16);i>=1&&i<=16&&t.push({type:"inefficient_push",position:e,description:`Use OP_${i} instead of pushing ${r}`,savings:1})}}return{optimizations:t,totalSavings:t.reduce((e,t)=>e+t.savings,0)}}catch(e){return{error:e.message}}},compareScripts:function(e,t){try{let r,a;r="string"==typeof e?n.Script.fromASM(e).toBuffer():i.isBuffer(e)?e:e.toBuffer(),a="string"==typeof t?n.Script.fromASM(t).toBuffer():i.isBuffer(t)?t:t.toBuffer();return{identical:r.equals(a),scriptA:{size:r.length,asm:o(r)},scriptB:{size:a.length,asm:o(a)}}}catch(e){return{error:e.message}}},explainScript:h,covenantToEnglish:function(e){try{const t=h(e);if(t.error)return t;const r=[];return t.explanations.forEach(e=>{switch(e.operation){case"OP_VERIFY":r.push("The condition must be true for the script to succeed.");break;case"OP_CHECKSIG":r.push("A valid signature must be provided.");break;case"OP_EQUAL":r.push("Two values must be identical.");break;case"OP_ADD":r.push("Two numbers are added together.");break;default:e.explanation.includes("Push data")&&r.push("Some data is made available for processing.")}}),{english:r.join(" "),technical:t.summary,operations:t.operations}}catch(e){return{error:e.message}}},batchTestScripts:function(e,t={}){const r=[];e.forEach((e,t)=>{try{const i=s(e),n=c(e),a=l(e);r.push({index:t,script:"string"==typeof e?e:o(e),valid:i.valid,size:i.size,operations:i.operations,complexity:a.complexity,estimatedCost:n.estimatedCost,recommendations:a.recommendations})}catch(i){r.push({index:t,script:"string"==typeof e?e:"Invalid script",valid:!1,error:i.message})}});const i={total:e.length,valid:r.filter(e=>e.valid).length,invalid:r.filter(e=>!e.valid).length,averageSize:r.filter(e=>e.size).reduce((e,t)=>e+t.size,0)/r.filter(e=>e.size).length||0,complexityDistribution:{low:r.filter(e=>"low"===e.complexity).length,medium:r.filter(e=>"medium"===e.complexity).length,high:r.filter(e=>"high"===e.complexity).length}};return{results:r,summary:i}}}},1803(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237);function o(e){if(!(this instanceof o))return new o(e);this.sighashType=e||n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_FORKID,this.analysis=this._analyzeFlags()}o.prototype.analyze=function(){return this.analysis},o.prototype.getZeroHashBehavior=function(){var e={hashPrevouts:!1,hashSequence:!1,hashOutputs:!1,explanation:[],criticalNote:null};return this.analysis.anyoneCanPay&&(e.hashPrevouts=!0,e.explanation.push("ANYONECANPAY: hashPrevouts becomes zero hash (0x00...00)")),"NONE"===this.analysis.baseType&&(e.hashSequence=!0,e.hashOutputs=!0,e.explanation.push("SIGHASH_NONE: hashSequence and hashOutputs become zero hash")),"SINGLE"===this.analysis.baseType&&(e.hashSequence=!0,e.hashOutputs=!0,e.explanation.push("SIGHASH_SINGLE: hashSequence becomes zero hash, hashOutputs covers only corresponding output")),(e.hashPrevouts||e.hashSequence||e.hashOutputs)&&(e.criticalNote="These zero hashes are NOT bugs - they are correct BIP-143 behavior for the specified SIGHASH flags!"),e},o.prototype.generateExample=function(){var e=n.PrivateKey.fromRandom().toAddress(),t={txId:"a".repeat(64),outputIndex:0,script:n.Script.buildPublicKeyHashOut(e).toHex(),satoshis:1e5},i=(new n.Transaction).from(t).to(e,99e3),o=n.Script.fromHex(t.script),a=n.Transaction.sighash.sighashPreimage(i,this.sighashType,0,o,new n.crypto.BN(t.satoshis)),s=new(r(3890))(a);return{transaction:i,preimage:s,sighashType:this.sighashType,analysis:this.analysis,zeroHashBehavior:this.getZeroHashBehavior(),fields:s.extract(),validation:s.validate()}},o.prototype.createDemonstration=function(){var e=this.generateExample(),t=i.alloc(32).toString("hex"),r={sighashType:this.sighashType,analysis:this.analysis,zeroHashBehavior:this.getZeroHashBehavior(),preimageFields:{},observations:[],educationalNotes:[]},n=e.preimage.toObject().fields;return r.preimageFields=n,n.hashPrevouts===t&&r.observations.push({field:"hashPrevouts",value:"ZERO HASH (00...00)",reason:"ANYONECANPAY flag - this input can be combined with any other inputs"}),n.hashSequence===t&&r.observations.push({field:"hashSequence",value:"ZERO HASH (00...00)",reason:this.analysis.baseType+" flag - sequence numbers not covered by signature"}),n.hashOutputs===t&&r.observations.push({field:"hashOutputs",value:"ZERO HASH (00...00)",reason:this.analysis.baseType+" flag - outputs not fully covered by signature"}),r.educationalNotes=["Zero hashes in preimages are NOT errors - they indicate specific SIGHASH flag behavior","BIP-143 mandates these zero values when certain flags are used","ANYONECANPAY allows this input to be combined with different sets of inputs","SIGHASH_NONE means the signer doesn't care about any outputs","SIGHASH_SINGLE means the signer only cares about the corresponding output","Always check SIGHASH flags when you see 'mysterious' zero hashes in preimages"],r},o.prototype.checkCompliance=function(e){var t=e.toObject().fields,r=i.alloc(32).toString("hex"),n={compliant:!0,issues:[],expectedZeros:[],unexpectedZeros:[]},o=this.getZeroHashBehavior();return o.hashPrevouts&&t.hashPrevouts!==r?(n.compliant=!1,n.issues.push("hashPrevouts should be zero due to ANYONECANPAY flag")):o.hashPrevouts||t.hashPrevouts!==r||n.unexpectedZeros.push("hashPrevouts is zero but ANYONECANPAY not set"),o.hashSequence&&t.hashSequence!==r?(n.compliant=!1,n.issues.push("hashSequence should be zero due to "+this.analysis.baseType+" flag")):o.hashSequence||t.hashSequence!==r||n.unexpectedZeros.push("hashSequence is zero but "+this.analysis.baseType+" allows sequence coverage"),o.hashOutputs&&t.hashOutputs!==r?(n.compliant=!1,n.issues.push("hashOutputs should be zero due to "+this.analysis.baseType+" flag")):o.hashOutputs||t.hashOutputs!==r||n.unexpectedZeros.push("hashOutputs is zero but "+this.analysis.baseType+" should cover outputs"),n},o.prototype._analyzeFlags=function(){var e=31&this.sighashType,t=!!(128&this.sighashType),r=!!(64&this.sighashType),i="UNKNOWN";1===e?i="ALL":2===e?i="NONE":3===e&&(i="SINGLE");var n=[];return n.push(i),t&&n.push("ANYONECANPAY"),r&&n.push("FORKID"),{sighashType:this.sighashType,baseType:i,anyoneCanPay:t,forkId:r,flagName:n.join(" | "),hex:"0x"+this.sighashType.toString(16).padStart(8,"0"),binary:"0b"+this.sighashType.toString(2).padStart(32,"0")}},o.getAllTypes=function(){var e=n.crypto.Signature.SIGHASH_FORKID;return[{name:"ALL",value:n.crypto.Signature.SIGHASH_ALL|e},{name:"NONE",value:n.crypto.Signature.SIGHASH_NONE|e},{name:"SINGLE",value:n.crypto.Signature.SIGHASH_SINGLE|e},{name:"ALL | ANYONECANPAY",value:n.crypto.Signature.SIGHASH_ALL|n.crypto.Signature.SIGHASH_ANYONECANPAY|e},{name:"NONE | ANYONECANPAY",value:n.crypto.Signature.SIGHASH_NONE|n.crypto.Signature.SIGHASH_ANYONECANPAY|e},{name:"SINGLE | ANYONECANPAY",value:n.crypto.Signature.SIGHASH_SINGLE|n.crypto.Signature.SIGHASH_ANYONECANPAY|e}]},o.generateAllDemonstrations=function(){return o.getAllTypes().map(function(e){var t=new o(e.value);return{typeName:e.name,demonstration:t.createDemonstration()}})},o.explainZeroMystery=function(){return{title:"The 'Extra Zero' Mystery in Bitcoin Preimages",problem:"Developers often see zero hashes (0x00...00) in preimage fields and think it's a bug",reality:"These zeros are CORRECT behavior mandated by BIP-143 for specific SIGHASH flags",explanation:["ANYONECANPAY sets hashPrevouts to zero - allows input combination flexibility","SIGHASH_NONE sets hashSequence and hashOutputs to zero - signer doesn't care about outputs","SIGHASH_SINGLE sets hashSequence to zero - only corresponding output matters","These are features, not bugs - they enable advanced Bitcoin transaction patterns"],solution:"Always check SIGHASH flags when analyzing preimages with zero hashes",toolTip:"Use SIGHASH.checkCompliance() to verify if zero hashes match expected flag behavior"}},e.exports=o},2318(e,t,r){e=r.nmd(e);var i=r(8287).Buffer,n=r(5606);const o="undefined"!=typeof window&&window.bsv?window.bsv:r(5237);r(537);function a(e){return e.map(e=>e.toString("hex"))}function s(e,t){console.log("==========================================="),console.log("🔍 STACK EXAMINATION TOOL"),console.log("===========================================\n"),console.log("🔐 Locking Script:",e),console.log("🔓 Unlocking Script:",t),console.log("-------------------------------------------");try{const r=o.Script.fromHex(e),n=o.Script.fromHex(t),s=o.Script.fromBuffer(i.concat([n.toBuffer(),r.toBuffer()])),u=new o.Script.Interpreter,c=new o.Transaction,l=new o.Transaction.Input({prevTxId:"0".repeat(64),outputIndex:0,script:o.Script.empty()});c.addInput(l),c.addOutput(new o.Transaction.Output({satoshis:1e5,script:r}));const h=s.chunks,f=new o.Script.Interpreter;f.script=s,f.tx=c,f.nIn=0,f.flags=o.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID;for(let e=0;e<h.length;e++){const t=h[e];try{if("function"!=typeof f.step){console.log("⚠️ Step-by-step execution not supported in this BSV version");break}f.step(),console.log(`\n🧩 Step ${e+1}: ${o.Opcode.reverseMap[t.opcodenum]||"PUSH"}`),console.log("Stack:",a(f.stack)),console.log("AltStack:",a(f.altstack))}catch(t){console.log(`⚠️ Error executing opcode ${e+1}:`,t.message);break}}const p=new o.crypto.BN(1e5),d=u.verify(n,r,c,0,o.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,p);return console.log("\n==========================================="),console.log("✅ Final Result:",d?"TRUE (Success)":"❌ FALSE (Failure)"),console.log("Final Stack:",a(f.stack||[])),console.log("AltStack:",a(f.altstack||[])),console.log("==========================================="),d}catch(e){return console.error("❌ Error in script execution:",e.message),!1}}if(r.c[r.s]===e){n.argv.length<4&&(console.log("Usage: node stack_examiner.js <locking_script_hex> <unlocking_script_hex>"),n.exit(1));s(n.argv[2],n.argv[3])}e.exports={runScript:s,bufferToHexArray:a}},9127(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=r(4904),a=r(8866),s=r(62),u=n.Script,c=n.Opcode,l=a.scriptNum;function h(e,t){var r=i.isBuffer(e)?e:t.commit(e);if(20!==r.length)throw new Error("owner commitment must be 20 bytes (HASH160)");return r}function f(e,t){return t.length?e.add(i.from(t)):e.add(c.OP_0)}function p(e,t){return e.add(c.OP_DUP),o.pushTxCore(e),e.add(c.OP_VERIFY),o.assertSighashAll(e),e.add(c.OP_DUP).add(l(52)).add(c.OP_RIGHT).add(l(8)).add(c.OP_LEFT).add(c.OP_TOALTSTACK),e.add(c.OP_DUP),o.extractHashOutputs(e),e.add(c.OP_TOALTSTACK),e.add(l(104)).add(c.OP_SPLIT).add(c.OP_NIP).add(c.OP_SIZE).add(l(52)).add(c.OP_SUB).add(c.OP_SPLIT).add(c.OP_DROP),e.add(c.OP_DUP).add(l(4)).add(l(20)).add(c.OP_SUBSTR),e.add(c.OP_SWAP).add(c.OP_TOALTSTACK),t.emit(e),e.add(c.OP_FROMALTSTACK),e}function d(e){return e.add(l(4)).add(c.OP_SPLIT).add(l(20)).add(c.OP_SPLIT).add(c.OP_NIP),e.add(c.OP_TOALTSTACK),e.add(c.OP_SWAP).add(c.OP_CAT),e.add(c.OP_FROMALTSTACK).add(c.OP_CAT),e}function g(e){var t=e.toBuffer().length;if(t<=252||t>65535)throw new Error("token script length must use a 3-byte varint (253..65535); got "+t);return e}function m(e,t){t=t||s.singleKey();var r=new u;return r.add(h(e,t)),r.add(c.OP_DROP),p(r,t),d(r),r.add(c.OP_CAT),r.add(c.OP_SWAP).add(c.OP_CAT),r.add(c.OP_CAT),r.add(c.OP_FROMALTSTACK),r.add(c.OP_FROMALTSTACK).add(c.OP_DROP),r.add(c.OP_SWAP).add(c.OP_HASH256).add(c.OP_EQUAL),g(r)}function y(e,t,r,n,c,l,h){var p=(h=h||{}).auth||s.singleKey(),d=h.inputIndex||0;if(20!==t.length)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(!l||null==l.tokenValue||8!==l.tokenValue.length)throw new Error("layout.tokenValue must be the 8-byte LE value of the token output");o.grind(r,d,c,n,h.grind);var g=a.rawPreimage(r,d,c,n),m=p.unlockArgs(r,d,c,n,e),y=new u;return f(y,l.before||i.alloc(0)),f(y,l.after||i.alloc(0)),y.add(i.from(l.tokenValue)),y.add(i.from(t)),m.forEach(function(e){y.add(e)}),y.add(i.from(g)),y}e.exports={ownershipToken:function(e,t,r){r=r||s.singleKey();var i=new u;return i.add(h(t,r)),i.add(c.OP_DROP),p(i,r),d(i),i.add(c.OP_FROMALTSTACK),i.add(c.OP_SWAP),i.add(c.OP_FROMALTSTACK),i.add(c.OP_BIN2NUM).add(l(e)).add(c.OP_SUB).add(l(8)).add(c.OP_NUM2BIN),i.add(c.OP_SWAP).add(c.OP_CAT),i.add(c.OP_HASH256),i.add(c.OP_EQUAL),g(i)},ownershipTokenMulti:m,ordinalLock:function(e,t){return m(e,t)},ownerId:function(e){return s.singleKey().commit(e)},unlockTransfer:function(e,t,r,n,c,l){var h=(l=l||{}).auth||s.singleKey(),f=l.inputIndex||0;if(20!==t.length)throw new Error("newOwnerHash must be 20 bytes (HASH160)");if(n<=1&&!l.allowLowValue)throw new Error("unlockTransfer: single-output token sets output = input - fee, which burns a "+n+"-sat UTXO (e.g. a 1-sat ordinal). Use Token.transferOrdinal / ownershipTokenMulti to preserve the satoshi.");o.grind(r,f,c,n,l.grind);var p=a.rawPreimage(r,f,c,n),d=h.unlockArgs(r,f,c,n,e),g=(new u).add(i.from(t));return d.forEach(function(e){g.add(e)}),g.add(i.from(p)),g},unlockTransferMulti:y,transferOrdinal:function(e,t,r,o,a,s){null==o&&(o=1);var u=(s=s||{}).tokenIndex||0,c=r.outputs||[],l=c[u];if(!l)throw new Error("transferOrdinal: spend has no output at tokenIndex "+u);if(l.satoshis!==o)throw new Error("transferOrdinal: token output value ("+l.satoshis+" sat) must equal the ordinal value ("+o+" sat) to avoid burning the inscription");function h(e){return e.toBufferWriter().toBuffer()}return y(e,t,r,o,a,{before:i.concat(c.slice(0,u).map(h)),after:i.concat(c.slice(u+1).map(h)),tokenValue:new n.crypto.BN(o).toBuffer({endian:"little",size:8})},s)}}},5426(e,t,r){"use strict";var i=r(5237),n=r(4151);function o(e){if(!(this instanceof o))return new o(e);this.options=e||{},this.network=this.options.network||i.Networks.mainnet,this.keyRing={},this.utxoPool=[];try{var t=r(2408);this.smartUTXO=new t(this.options)}catch(e){}}o.prototype.generateKeypair=function(e){e=e||"key_"+Date.now();var t=i.PrivateKey.fromRandom(this.network),r=t.toPublicKey(),n=t.toAddress(this.network),o={label:e,privateKey:t,publicKey:r,address:n,wif:t.toWIF(),addressString:n.toString()};return this.keyRing[e]=o,o},o.prototype.createRealUTXOs=function(e){for(var t=(e=e||{}).count||3,r=e.satoshis||1e5,i=e.scriptType||"P2PKH",n=e.keypair||this.generateKeypair("utxo_owner"),o=[],a=0;a<t;a++){var s=this._createSingleUTXO({keypair:n,satoshis:r,scriptType:i,vout:a});o.push(s),this.utxoPool.push(s),this.smartUTXO&&this.smartUTXO.addUTXO(s)}return o},o.prototype._createSingleUTXO=function(e){var t,r,o=n.randomBytes(32).toString("hex");switch(e.scriptType){case"P2PKH":default:r=(t=i.Script.buildPublicKeyHashOut(e.keypair.address)).toHex();break;case"P2SH":var a=i.Script.buildMultisigOut([e.keypair.publicKey],1);r=(t=i.Script.buildScriptHashOut(a)).toHex();break;case"CUSTOM":r=(t=e.customScript||i.Script.buildPublicKeyHashOut(e.keypair.address)).toHex()}return{txid:o,vout:e.vout,address:e.keypair.addressString,script:r,satoshis:e.satoshis,keypair:e.keypair,scriptType:e.scriptType,scriptObj:t,created:(new Date).toISOString()}},o.prototype.createTestTransaction=function(e){var t=(e=e||{}).inputs||this.utxoPool.slice(0,1);if(0===t.length)throw new Error("No UTXOs available for transaction. Call createRealUTXOs() first.");var r=t.reduce(function(e,t){return e+t.satoshis},0),n=new i.Transaction;t.forEach(function(e){n.from({txId:e.txid,outputIndex:e.vout,address:e.address,script:e.script,satoshis:e.satoshis})});var o=e.outputAddress||t[0].keypair.addressString,a=e.outputAmount||r-1e4,s=e.fee||1e4;return n.to(o,a),n.fee(s),{transaction:n,inputUTXOs:t,unsignedHex:n.toString(),inputTotal:r,outputAmount:a,fee:s,sign:function(){return t.forEach(function(e){n.sign(e.keypair.privateKey)}),{signedTransaction:n,signedHex:n.toString(),txid:n.id}},generatePreimage:function(e,r){r=r||i.crypto.Signature.SIGHASH_ALL|i.crypto.Signature.SIGHASH_FORKID;var o=t[e];return i.Transaction.sighash.sighashPreimage(n,r,e,i.Script.fromHex(o.script),new i.crypto.BN(o.satoshis))}}},o.prototype.createCovenantTest=function(e){e=e||{};var t=this.generateKeypair("covenant_test"),i=this.createRealUTXOs({count:e.utxoCount||2,satoshis:e.satoshis||5e4,keypair:t,scriptType:e.scriptType||"P2PKH"}),n={inputs:i.slice(0,1),outputAmount:e.covenantAmount||4e4,fee:1e4},o=this.createTestTransaction(n),a=o.generatePreimage(0),s=a.toString("hex");return{keypair:t,utxos:i,transaction:o,preimage:{buffer:a,hex:s,length:a.length},extractField:function(e){try{return r(3890).extractFromHex(s,e)}catch(e){throw new Error("SmartContract.Preimage not available: "+e.message)}},validateCovenant:function(e){return{preimageValid:a.length>=182,covenantLogic:e,testPassed:!0}},getSummary:function(){return{keypair:t.addressString,utxoCount:i.length,totalValue:i.reduce(function(e,t){return e+t.satoshis},0),preimageLength:a.length,transactionId:o.transaction.id}}}},o.prototype.getKeypairs=function(){return this.keyRing},o.prototype.getUTXOs=function(){return this.utxoPool},o.prototype.reset=function(){this.keyRing={},this.utxoPool=[]},o.createTestEnvironment=function(e){var t=new o(e),i=t.createCovenantTest(e);return{generator:t,test:i,getPreimage:function(){return i.preimage.hex},getKeypair:function(){return i.keypair},extractField:function(e){return i.extractField(e)},generateASM:function(e){try{return r(3890).generateASMFromHex(i.preimage.hex,e)}catch(e){throw new Error("Cannot generate ASM: "+e.message)}}}},e.exports=o},3737(e,t,r){"use strict";var i=r(8287).Buffer;e.exports=class{constructor(e,t={}){this.bsv=e,this.options={difficulty:t.difficulty||1,blockTime:t.blockTime||1e4,validateScripts:!1!==t.validateScripts,logLevel:t.logLevel||"info",...t},this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[]}acceptTransaction(e){try{if(this.options.validateScripts){if(!this.validateTransactionSignatures(e))return this.log("warn","❌ Transaction rejected: Invalid signatures"),!1}return this.mempool.push(e),this.log("info",`✅ Transaction accepted into mempool: ${e.id||"unknown"}`),!0}catch(e){return this.log("error",`❌ Transaction rejected: ${e.message}`),!1}}validateTransactionSignatures(e){try{const t=e.verify();return this.log("debug",`📊 Transaction verification result: ${t}`),!0===t}catch(e){return this.log("warn",`⚠️ Signature validation error: ${e.message}`),!1}}mineBlock(e=10){const t=this.mempool.splice(0,e),r={height:this.currentBlock.height+1,timestamp:Date.now(),transactions:t,transactionCount:t.length,previousBlockHash:this.currentBlock.hash||"0000000000000000000000000000000000000000000000000000000000000000"},n=JSON.stringify({height:r.height,timestamp:r.timestamp,previousBlockHash:r.previousBlockHash,transactions:t.map(e=>e.id||e.toString())});return r.hash=this.bsv.crypto.Hash.sha256(i.from(n)).toString("hex"),this.currentBlock=r,this.log("info",`⛏️ Mined block ${r.height} with ${t.length} transactions`),this.log("debug",`📦 Block hash: ${r.hash}`),r}getMempoolStats(){return{transactionCount:this.mempool.length,transactions:this.mempool.map(e=>({id:e.id||"unknown",size:e.toBuffer?e.toBuffer().length:0,inputs:e.inputs?e.inputs.length:0,outputs:e.outputs?e.outputs.length:0}))}}getBlockchainStats(){return{currentHeight:this.currentBlock.height,currentBlockHash:this.currentBlock.hash,currentBlockTimestamp:this.currentBlock.timestamp,mempoolSize:this.mempool.length,difficulty:this.options.difficulty,blockTime:this.options.blockTime}}reset(){this.currentBlock={height:0,transactions:[],timestamp:Date.now()},this.mempool=[],this.log("info","🔄 Miner reset to genesis state")}log(e,t){const r={error:0,warn:1,info:2,debug:3},i=r[this.options.logLevel]||2;if(r[e]<=i){const r=(new Date).toISOString();console.log(`[${r}] [${e.toUpperCase()}] ${t}`)}}}},2408(e,t,r){"use strict";var i=r(5606);const n=function(){(void 0!==i&&i.env&&i.env.BSV_DEBUG||"undefined"!=typeof window&&window.BSV_DEBUG)&&console.log.apply(console,arguments)};let o,a,s,u;if("undefined"==typeof window)try{o=r(6686),a=r(5558),s=r(6060),u=r(514)}catch(e){n("SmartUTXO: Running in browser mode - some features may be limited")}e.exports=class{constructor(e={}){this.options=e||{},this.loadState()}loadState(){try{return u.loadBlockchainState()}catch(e){return n("⚠️ Could not load blockchain state:",e.message),null}}saveState(){try{const e=u.loadBlockchainState();u.saveBlockchainState(e);const t=Object.keys(e.globalUTXOSet||{}).length;n(`💾 Saved blockchain state with ${t} UTXOs`)}catch(e){n("⚠️ Could not save blockchain state:",e.message)}}getUTXOsForAddress(e){try{const t=u.loadBlockchainState();return t.wallets&&t.wallets[e]&&t.wallets[e].utxos||[]}catch(e){return n("⚠️ Error getting UTXOs:",e.message),[]}}addUTXO(e){try{u.addUTXO(e,e.address)}catch(e){n("⚠️ Error adding UTXO:",e.message)}}spendUTXOs(e,t="manual-spend"){try{for(const r of e)u.spendUTXO(r.txid,r.vout,t)}catch(e){n("⚠️ Error spending UTXOs:",e.message)}}createMockUTXOs(e,t=5,i=1e5){const n=r(5237),o=n.Script.buildPublicKeyHashOut(n.Address.fromString(e)).toHex(),a=[];for(let r=0;r<t;r++)a.push({txid:n.crypto.Random.getRandomBuffer(32).toString("hex"),vout:r,address:e,satoshis:i,script:o});return a}getBalance(e){try{const t=u.loadBlockchainState();return t.wallets&&t.wallets[e]&&t.wallets[e].totalValue||0}catch(e){return n("⚠️ Error getting balance:",e.message),0}}getStats(){try{const e=u.getBlockchainStats();return{totalUTXOs:e.metadata.totalUTXOs,totalValue:e.metadata.totalValue,totalWallets:e.metadata.totalWallets,blockHeight:e.metadata.blockHeight,lastUpdated:e.metadata.lastUpdated}}catch(e){return n("⚠️ Error getting stats:",e.message),{totalUTXOs:0,totalValue:0,totalWallets:0,blockHeight:0}}}reset(){try{const e=a.join("/","../utilities/blockchain-state.json");o.existsSync(e)&&(o.unlinkSync(e),n("🔄 Blockchain state reset"))}catch(e){n("⚠️ Could not reset blockchain state:",e.message)}}}},7631(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237);function o(e){return i.from(e).reverse()}function a(e){if(e&&"function"==typeof e.validProofOfWork)return e;if(i.isBuffer(e))return n.BlockHeader.fromBuffer(e);if("string"==typeof e)return n.BlockHeader.fromBuffer(i.from(e,"hex"));throw new Error("each header must be a BlockHeader, an 80-byte Buffer, or hex")}e.exports={verifyHeaderChain:function(e,t){if(t=t||{},!Array.isArray(e)||0===e.length)throw new Error("headers must be a non-empty array");for(var r=e.map(a),i=!1!==t.requirePow,n=0,s=0;s<r.length;s++){if(i&&!r[s].validProofOfWork())return{valid:!1,reason:"invalid proof-of-work at index "+s,count:r.length};if(n+=r[s].getDifficulty(),s>0)if(!(o(r[s].prevHash).toString("hex").toLowerCase()===r[s-1].id.toLowerCase()))return{valid:!1,reason:"broken link at index "+s,count:r.length}}var u=r[0].id,c=r[r.length-1].id;if(t.trustedHash){var l=String(t.trustedHash).toLowerCase();if(l!==c.toLowerCase()&&l!==u.toLowerCase())return{valid:!1,reason:"chain is not anchored at the trusted hash",count:r.length,anchorHash:u,tipHash:c}}return{valid:!0,count:r.length,anchorHash:u,tipHash:c,work:n}}}},2985(e,t,r){"use strict";var i=r(2397),n=r(7631);e.exports={merkleRootFromBranch:i.merkleRootFromBranch,verifyMerkleProof:i.verifyMerkleProof,verifyTxInclusion:i.verifyTxInclusion,verifyHeaderChain:n.verifyHeaderChain}},2397(e,t,r){"use strict";var i=r(8287).Buffer,n=r(5237),o=n.crypto.Hash,a=/^[0-9a-fA-F]{64}$/;function s(e){return i.from(e).reverse()}function u(e){return s(i.from(e,"hex"))}function c(e){return s(e).toString("hex")}function l(e,t,r){if(!a.test(String(e)))throw new Error("txid must be 32-byte hex");if(!Number.isInteger(t)||t<0)throw new Error("index must be a non-negative integer");r=r||[];for(var n=u(e),s=t,l=0;l<r.length;l++){var h,f=r[l];if("*"===f||""===f||null==f)h=n;else{if(!a.test(String(f)))throw new Error("proof node "+l+' must be 32-byte hex or "*"');h=u(f)}n=1&s?o.sha256sha256(i.concat([h,n])):o.sha256sha256(i.concat([n,h])),s=Math.floor(s/2)}return c(n)}e.exports={merkleRootFromBranch:l,verifyMerkleProof:function(e){if(!e||!e.merkleRoot)throw new Error("proof.merkleRoot is required");return l(e.txid,e.index,e.nodes).toLowerCase()===String(e.merkleRoot).toLowerCase()},verifyTxInclusion:function(e){var t=e.header;if((i.isBuffer(t)||"string"==typeof t)&&(t=n.BlockHeader.fromBuffer(i.isBuffer(t)?t:i.from(t,"hex"))),!t||!t.merkleRoot)throw new Error("a valid block header is required");var r=c(t.merkleRoot),o=l(e.txid,e.index,e.nodes),a=o.toLowerCase()===r.toLowerCase(),s=!1!==e.requirePow,u=t.validProofOfWork();return{valid:a&&(!s||u),rootMatches:a,powValid:u,merkleRoot:o,blockHash:t.id}}}},4096(e,t,r){"use strict";var i=r(8287).Buffer,n=r(6470),o=(r(8489),r(7593));function a(e,t){var r=t&&t.maxDecompressedBytes||8388608;return o.gunzipSync(i.from(e,"base64"),{maxOutputLength:r})}async function s(e,t){if(!t.expectedIssuerDid)throw new Error("expectedIssuerDid is required to verify a status list (issuer pinning); refusing to read revocation state from an unpinned/unverified JWT");var r=t.didResolver;if(!r){var i=t.issuerJwks||(t.issuerPublicJwk?{keys:[t.issuerPublicJwk]}:null);if(!i)throw new Error("Provide params.didResolver, params.issuerJwks, or params.issuerPublicJwk to verify the status list signature");r=async function(){return{jwks:i}}}var o=await n.verifyVcJwt(e,{didResolver:r,expectedIssuerDid:t.expectedIssuerDid,allowedAlgs:t.allowedAlgs,allowLegacyDER:t.allowLegacyDER,clockToleranceSec:t.clockToleranceSec});if(!o.valid)throw new Error("Status list signature verification failed: "+(o.error||"invalid signature"));return o.payload}e.exports={createStatusList:async function(e){if(!e.issuerDid||!e.privateJwk)throw new Error("issuerDid and privateJwk are required");var t=e.listId||e.issuerDid+"/status/"+Date.now(),o=e.listSize||1e5,a=Math.ceil(o/8),s=i.alloc(a,0),u=r(7593).gzipSync(s).toString("base64"),c={"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/vc/status-list/2021/v1"],type:["VerifiableCredential","StatusList2021Credential"],issuer:e.issuerDid,issuanceDate:(new Date).toISOString(),credentialSubject:{id:t,type:"StatusList2021",statusPurpose:"revocation",encodedList:u}};return{listVcJwt:(await n.issueVcJwt({issuerDid:e.issuerDid,subjectId:t,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:c.credentialSubject,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"})).jwt,listId:t}},updateStatusList:async function(e){if(!e.listVcJwt||void 0===e.index||!e.status||!e.privateJwk)throw new Error("listVcJwt, index, status, and privateJwk are required");var t=await s(e.listVcJwt,e),r=a(t.vc.credentialSubject.encodedList,e),i=Math.floor(e.index/8),u=e.index%8;if(i>=r.length)throw new Error("Index out of range");1===("revoked"===e.status||"suspended"===e.status?1:0)?r[i]|=1<<u:r[i]&=~(1<<u);var c=o.gzipSync(r).toString("base64"),l={id:t.vc.credentialSubject.id,type:"StatusList2021",statusPurpose:"revocation",encodedList:c};return{listVcJwt:(await n.issueVcJwt({issuerDid:t.iss,subjectId:t.vc.credentialSubject.id,types:["VerifiableCredential","StatusList2021Credential"],credentialSubject:l,privateJwk:e.privateJwk,alg:e.privateJwk.alg||"ES256"})).jwt}},getCredentialStatusEntry:async function(e){if(!e.listVcJwt||void 0===e.index)throw new Error("listVcJwt and index are required");var t=a((await s(e.listVcJwt,e)).vc.credentialSubject.encodedList,e),r=Math.floor(e.index/8),i=e.index%8;if(r>=t.length)throw new Error("Index out of range");return 1===(t[r]>>i&1)?"revoked":"valid"}}},6558(e,t,r){e.exports=r(5042),e.exports.Input=r(7589),e.exports.Output=r(7285),e.exports.UnspentOutput=r(7574),e.exports.Signature=r(3808),e.exports.Sighash=r(999)},7589(e,t,r){e.exports=r(5109),e.exports.PublicKey=r(3337),e.exports.PublicKeyHash=r(5045),e.exports.MultiSig=r(5295),e.exports.MultiSigScriptHash=r(3200)},5109(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(3649),s=r(5750),u=r(8287),c=r(3035),l=r(5133),h=r(999),f=r(7285),p=4294967295,d=p-2,g=p,m=p-1;function y(e){return this instanceof y?e?this._fromObject(e):void 0:new y(e)}y.MAXINT=p,y.DEFAULT_SEQNUMBER=g,y.DEFAULT_LOCKTIME_SEQNUMBER=m,y.DEFAULT_RBF_SEQNUMBER=d,y.BASE_SIZE=40,Object.defineProperty(y.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new l(this._scriptBuffer),this._script._isInput=!0),this._script)}}),y.fromObject=function(e){return o.checkArgument(n.isObject(e)),(new y)._fromObject(e)},y.prototype._fromObject=function(e){var t;if(t=n.isString(e.prevTxId)&&c.isHexa(e.prevTxId)?u.Buffer.from(e.prevTxId,"hex"):e.prevTxId,this.output=e.output?e.output instanceof f?e.output:new f(e.output):void 0,this.prevTxId=t||e.txidbuf,this.outputIndex=n.isUndefined(e.outputIndex)?e.txoutnum:e.outputIndex,this.sequenceNumber=n.isUndefined(e.sequenceNumber)?n.isUndefined(e.seqnum)?g:e.seqnum:e.sequenceNumber,n.isUndefined(e.script)&&n.isUndefined(e.scriptBuffer))throw new a.Transaction.Input.MissingScript;return this.setScript(e.scriptBuffer||e.script),this},y.prototype.toObject=y.prototype.toJSON=function(){var e={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(e.scriptString=this.script.toString()),this.output&&(e.output=this.output.toObject()),e},y.fromBufferReader=function(e){var t=new y;return t.prevTxId=e.readReverse(32),t.outputIndex=e.readUInt32LE(),t._scriptBuffer=e.readVarLengthBuffer(),t.sequenceNumber=e.readUInt32LE(),t},y.prototype.toBufferWriter=function(e){e||(e=new s),e.writeReverse(this.prevTxId),e.writeUInt32LE(this.outputIndex);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e.writeUInt32LE(this.sequenceNumber),e},y.prototype.setScript=function(e){if(this._script=null,e instanceof l)this._script=e,this._script._isInput=!0,this._scriptBuffer=e.toBuffer();else if(null===e)this._script=l.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(c.isHexa(e))this._scriptBuffer=u.Buffer.from(e,"hex");else if(n.isString(e))this._script=new l(e),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!i.isBuffer(e))throw new TypeError("Invalid argument type: script");this._scriptBuffer=u.Buffer.from(e)}return this},y.prototype.getSignatures=function(){throw new a.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},y.prototype.isFullySigned=function(){throw new a.AbstractMethodInvoked("Input#isFullySigned")},y.prototype.isFinal=function(){return this.sequenceNumber===y.MAXINT},y.prototype.addSignature=function(){throw new a.AbstractMethodInvoked("Input#addSignature")},y.prototype.clearSignatures=function(){throw new a.AbstractMethodInvoked("Input#clearSignatures")},y.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)},y.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},y.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},e.exports=y},5295(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6698),a=r(5109),s=r(7285),u=r(6365),c=r(5133),l=r(7881),h=r(999),f=r(3808),p=r(6161),d=r(3173);function g(e,t,r,i){a.apply(this,arguments);var o=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(e=>e.toString("hex")).sort().map(e=>new p(e)),u.checkState(c.buildMultisigOut(this.publicKeys,r).equals(this.output.script),"Provided public keys don't match to the provided output script"),this.publicKeyIndex={},n.each(this.publicKeys,function(e,t){o.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}o(g,a),g.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=n.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},g.prototype._deserializeSignatures=function(e){return n.map(e,function(e){if(e)return new f(e)})},g.prototype._serializeSignatures=function(){return n.map(this.signatures,function(e){if(e)return e.toObject()})},g.prototype.getSignatures=function(e,t,r,i){u.checkState(this.output instanceof s),i=i||l.SIGHASH_ALL|l.SIGHASH_FORKID;var o=this,a=[];return n.each(this.publicKeys,function(n){n.toString()===t.publicKey.toString()&&a.push(new f({publicKey:t.publicKey,prevTxId:o.prevTxId,outputIndex:o.outputIndex,inputIndex:r,signature:h.sign(e,t,i,r,o.output.script,o.output.satoshisBN),sigtype:i}))}),a},g.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!n.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},g.prototype._updateScript=function(){return this.setScript(c.buildMultisigIn(this.publicKeys,this.threshold,this._createSignatures())),this},g.prototype._createSignatures=function(){return n.map(n.filter(this.signatures,function(e){return!n.isUndefined(e)}),function(e){return i.concat([e.signature.toDER(),i.from([255&e.sigtype])])})},g.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},g.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},g.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},g.prototype.countSignatures=function(){return n.reduce(this.signatures,function(e,t){return e+!!t},0)},g.prototype.publicKeysWithoutSignature=function(){var e=this;return n.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})},g.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h.verify(e,t.signature,t.publicKey,t.inputIndex,this.output.script,this.output.satoshisBN)},g.normalizeSignatures=function(e,t,r,i,n){return n.map(function(n){var o=null;return i=i.filter(function(i){if(o)return!0;var a=new f({signature:l.fromTxFormat(i),publicKey:n,prevTxId:t.prevTxId,outputIndex:t.outputIndex,inputIndex:r,sigtype:l.SIGHASH_ALL});return a.signature.nhashtype=a.sigtype,!h.verify(e,a.signature,a.publicKey,a.inputIndex,t.output.script)||(o=a,!1)}),o||null})},g.SIGNATURE_SIZE=73,g.prototype._estimateSize=function(){var e=1+this.threshold*g.SIGNATURE_SIZE;return a.BASE_SIZE+d(e).toBuffer().length+e},e.exports=g},3200(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6698),a=r(5109),s=r(7285),u=r(6365),c=r(5133),l=r(7881),h=r(999),f=r(3808),p=r(6161),d=r(3173);function g(e,t,r,i){a.apply(this,arguments);var o=this;t=t||e.publicKeys,r=r||e.threshold,i=i||e.signatures,this.publicKeys=t.map(e=>e.toString("hex")).sort().map(e=>new p(e)),this.redeemScript=c.buildMultisigOut(this.publicKeys,r),u.checkState(c.buildScriptHashOut(this.redeemScript).equals(this.output.script),"Provided public keys don't hash to the provided output"),this.publicKeyIndex={},n.each(this.publicKeys,function(e,t){o.publicKeyIndex[e.toString()]=t}),this.threshold=r,this.signatures=i?this._deserializeSignatures(i):new Array(this.publicKeys.length)}o(g,a),g.prototype.toObject=function(){var e=a.prototype.toObject.apply(this,arguments);return e.threshold=this.threshold,e.publicKeys=n.map(this.publicKeys,function(e){return e.toString()}),e.signatures=this._serializeSignatures(),e},g.prototype._deserializeSignatures=function(e){return n.map(e,function(e){if(e)return new f(e)})},g.prototype._serializeSignatures=function(){return n.map(this.signatures,function(e){if(e)return e.toObject()})},g.prototype.getSignatures=function(e,t,r,i){u.checkState(this.output instanceof s),i=i||l.SIGHASH_ALL|l.SIGHASH_FORKID;var o=this,a=[];return n.each(this.publicKeys,function(n){n.toString()===t.publicKey.toString()&&a.push(new f({publicKey:t.publicKey,prevTxId:o.prevTxId,outputIndex:o.outputIndex,inputIndex:r,signature:h.sign(e,t,i,r,o.redeemScript,o.output.satoshisBN),sigtype:i}))}),a},g.prototype.addSignature=function(e,t){return u.checkState(!this.isFullySigned(),"All needed signatures have already been added"),u.checkArgument(!n.isUndefined(this.publicKeyIndex[t.publicKey.toString()]),"Signature has no matching public key"),u.checkState(this.isValidSignature(e,t)),this.signatures[this.publicKeyIndex[t.publicKey.toString()]]=t,this._updateScript(),this},g.prototype._updateScript=function(){return this.setScript(c.buildP2SHMultisigIn(this.publicKeys,this.threshold,this._createSignatures(),{cachedMultisig:this.redeemScript})),this},g.prototype._createSignatures=function(){return n.map(n.filter(this.signatures,function(e){return!n.isUndefined(e)}),function(e){return i.concat([e.signature.toDER(),i.from([255&e.sigtype])])})},g.prototype.clearSignatures=function(){this.signatures=new Array(this.publicKeys.length),this._updateScript()},g.prototype.isFullySigned=function(){return this.countSignatures()===this.threshold},g.prototype.countMissingSignatures=function(){return this.threshold-this.countSignatures()},g.prototype.countSignatures=function(){return n.reduce(this.signatures,function(e,t){return e+!!t},0)},g.prototype.publicKeysWithoutSignature=function(){var e=this;return n.filter(this.publicKeys,function(t){return!e.signatures[e.publicKeyIndex[t.toString()]]})},g.prototype.isValidSignature=function(e,t){return t.signature.nhashtype=t.sigtype,h.verify(e,t.signature,t.publicKey,t.inputIndex,this.redeemScript,this.output.satoshisBN)},g.SIGNATURE_SIZE=73,g.PUBKEY_SIZE=34,g.prototype._estimateSize=function(){var e=3+this.publicKeys.length*g.PUBKEY_SIZE,t=this.threshold*g.SIGNATURE_SIZE+1+(e<=75?1:e<=255?2:3)+e;return a.BASE_SIZE+d(t).toBuffer().length+t},e.exports=g},3337(e,t,r){"use strict";var i=r(6698),n=r(6365),o=r(5109),a=r(7285),s=r(999),u=r(5133),c=r(7881),l=r(3808);function h(){o.apply(this,arguments)}i(h,o),h.prototype.getSignatures=function(e,t,r,i){n.checkState(this.output instanceof a),i=i||c.SIGHASH_ALL|c.SIGHASH_FORKID;var o=t.toPublicKey();return o.toString()===this.output.script.getPublicKey().toString("hex")?[new l({publicKey:o,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:s.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]},h.prototype.addSignature=function(e,t){return n.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(u.buildPublicKeyIn(t.signature.toDER(),t.sigtype)),this},h.prototype.clearSignatures=function(){return this.setScript(u.empty()),this},h.prototype.isFullySigned=function(){return this.script.isPublicKeyIn()},h.SCRIPT_MAX_SIZE=74,h.prototype._estimateSize=function(){return o.BASE_SIZE+h.SCRIPT_MAX_SIZE},e.exports=h},5045(e,t,r){"use strict";var i=r(6698),n=r(6365),o=r(5067),a=r(5109),s=r(7285),u=r(999),c=r(5133),l=r(7881),h=r(3808);function f(){a.apply(this,arguments)}i(f,a),f.prototype.getSignatures=function(e,t,r,i,a){n.checkState(this.output instanceof s),a=a||o.sha256ripemd160(t.publicKey.toBuffer()),i=i||l.SIGHASH_ALL|l.SIGHASH_FORKID;var c=this.output.script.chunks[2]&&this.output.script.chunks[2].buf;return c&&a.equals(c)?[new h({publicKey:t.publicKey,prevTxId:this.prevTxId,outputIndex:this.outputIndex,inputIndex:r,signature:u.sign(e,t,i,r,this.output.script,this.output.satoshisBN),sigtype:i})]:[]},f.prototype.addSignature=function(e,t){return n.checkState(this.isValidSignature(e,t),"Signature is invalid"),this.setScript(c.buildPublicKeyHashIn(t.publicKey,t.signature.toDER(),t.sigtype)),this},f.prototype.clearSignatures=function(){return this.setScript(c.empty()),this},f.prototype.isFullySigned=function(){return this.script.isPublicKeyHashIn()},f.SCRIPT_MAX_SIZE=108,f.prototype._estimateSize=function(){return a.BASE_SIZE+f.SCRIPT_MAX_SIZE},e.exports=f},7285(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(9043),a=r(8287),s=r(3035),u=r(5750),c=r(3173),l=r(5133),h=r(6365),f=r(3649);function p(e){if(!(this instanceof p))return new p(e);if(!n.isObject(e))throw new TypeError("Unrecognized argument for Output");var t;this.satoshis=e.satoshis,i.isBuffer(e.script)?this._scriptBuffer=e.script:(t=n.isString(e.script)&&s.isHexa(e.script)?a.Buffer.from(e.script,"hex"):e.script,this.setScript(t))}Object.defineProperty(p.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this._script||this.setScriptFromBuffer(this._scriptBuffer),this._script}}),Object.defineProperty(p.prototype,"satoshis",{configurable:!1,enumerable:!0,get:function(){return this._satoshis},set:function(e){e instanceof o?(this._satoshisBN=e,this._satoshis=e.toNumber()):n.isString(e)?(this._satoshis=parseInt(e),this._satoshisBN=o.fromNumber(this._satoshis)):(h.checkArgument(s.isNaturalNumber(e),"Output satoshis is not a natural number"),this._satoshisBN=o.fromNumber(e),this._satoshis=e),h.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),p.prototype.invalidSatoshis=function(){return this._satoshis>9007199254740991?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0&&"transaction txout negative"},Object.defineProperty(p.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(e){this._satoshisBN=e,this._satoshis=e.toNumber(),h.checkState(s.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),p.prototype.toObject=p.prototype.toJSON=function(){var e={satoshis:this.satoshis};return e.script=this._scriptBuffer.toString("hex"),e},p.fromObject=function(e){return new p(e)},p.prototype.setScriptFromBuffer=function(e){this._scriptBuffer=e;try{this._script=l.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(e){if(!(e instanceof f.Script.InvalidBuffer))throw e;this._script=null}},p.prototype.setScript=function(e){if(e instanceof l)this._scriptBuffer=e.toBuffer(),this._script=e,this._script._isOutput=!0;else if(n.isString(e))this._script=l.fromString(e),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else{if(!i.isBuffer(e))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(e)}return this},p.prototype.inspect=function(){var e;return e=this.script?this.script.inspect():this._scriptBuffer.toString("hex"),"<Output ("+this.satoshis+" sats) "+e+">"},p.fromBufferReader=function(e){var t={};t.satoshis=e.readUInt64LEBN();var r=e.readVarintNum();return t.script=0!==r?e.read(r):a.Buffer.from([]),new p(t)},p.prototype.toBufferWriter=function(e){e||(e=new u),e.writeUInt64LEBN(this._satoshisBN);var t=this._scriptBuffer;return e.writeVarintNum(t.length),e.write(t),e},p.prototype.getSize=function(){var e=this.script.toBuffer().length;return 8+c(e).toBuffer().length+e},e.exports=p},999(e,t,r){"use strict";var i=r(8287).Buffer,n=r(8287),o=r(7881),a=r(5133),s=r(7285),u=r(7798),c=r(5750),l=r(9043),h=r(5067),f=r(1955),p=r(6365),d=r(6375),g=r(4799),m=i.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),y=d.SCRIPT_ENABLE_SIGHASH_FORKID,v=function(e,t,u,f,v,b){var S=r(5042),w=r(7589);g.isUndefined(b)&&(b=y);var O,_=S.shallowCopy(e);(f=new a(f),b&d.SCRIPT_ENABLE_REPLAY_PROTECTION)&&(t=(16711680|57005^t>>8)<<8|255&t);if(t&o.SIGHASH_FORKID&&b&d.SCRIPT_ENABLE_SIGHASH_FORKID)return function(e,t,r,n,a){var s=e.inputs[r];function u(e,t){var r=new c;g.isUndefined(t)?g.each(e.outputs,function(e){e.toBufferWriter(r)}):e.outputs[t].toBufferWriter(r);var i=r.toBuffer();return h.sha256sha256(i)}p.checkArgument(a instanceof l,"For ForkId=0 signatures, satoshis or complete input must be provided");var f=i.alloc(32),d=i.alloc(32),m=i.alloc(32);t&o.SIGHASH_ANYONECANPAY||(f=function(e){var t=new c;g.each(e.inputs,function(e){t.writeReverse(e.prevTxId),t.writeUInt32LE(e.outputIndex)});var r=t.toBuffer();return h.sha256sha256(r)}(e)),t&o.SIGHASH_ANYONECANPAY||(31&t)===o.SIGHASH_SINGLE||(31&t)===o.SIGHASH_NONE||(d=function(e){var t=new c;g.each(e.inputs,function(e){t.writeUInt32LE(e.sequenceNumber)});var r=t.toBuffer();return h.sha256sha256(r)}(e)),(31&t)!==o.SIGHASH_SINGLE&&(31&t)!==o.SIGHASH_NONE?m=u(e):(31&t)===o.SIGHASH_SINGLE&&r<e.outputs.length&&(m=u(e,r));var y=new c;y.writeInt32LE(e.version),y.write(f),y.write(d),y.writeReverse(s.prevTxId),y.writeUInt32LE(s.outputIndex),y.writeVarintNum(n.toBuffer().length),y.write(n.toBuffer()),y.writeUInt64LEBN(a);var v=s.sequenceNumber;return y.writeUInt32LE(v),y.write(m),y.writeUInt32LE(e.nLockTime),y.writeUInt32LE(t>>>0),y.toBuffer()}(_,t,u,f,v);for(f.removeCodeseparators(),O=0;O<_.inputs.length;O++)_.inputs[O]=new w(_.inputs[O]).setScript(a.empty());if(_.inputs[u]=new w(_.inputs[u]).setScript(f),(31&t)===o.SIGHASH_NONE||(31&t)===o.SIGHASH_SINGLE)for(O=0;O<_.inputs.length;O++)O!==u&&(_.inputs[O].sequenceNumber=0);if((31&t)===o.SIGHASH_NONE)_.outputs=[];else if((31&t)===o.SIGHASH_SINGLE){if(u>=_.outputs.length)return m;for(_.outputs.length=u+1,O=0;O<u;O++)_.outputs[O]=new s({satoshis:l.fromBuffer(n.Buffer.from("ffffffffffffffff","hex")),script:a.empty()})}return t&o.SIGHASH_ANYONECANPAY&&(_.inputs=[_.inputs[u]]),(new c).write(_.toBuffer()).writeInt32LE(t).toBuffer()},b=function(e,t,r,i,n,o){var a=v(e,t,r,i,n,o);if(0===a.compare(m))return a;var s=h.sha256sha256(a);return s=new u(s).readReverse()};e.exports={sighashPreimage:v,sighash:b,sign:function(e,t,r,i,n,o,a){var s=b(e,r,i,n,o,a);return f.sign(s,t,"little").set({nhashtype:r})},verify:function(e,t,r,i,n,o,a){p.checkArgument(!g.isUndefined(e)),p.checkArgument(!g.isUndefined(t)&&!g.isUndefined(t.nhashtype));var s=b(e,t.nhashtype,i,n,o,a);return f.verify(s,t,r,"little")}}},3808(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(6698),s=r(3035),u=r(6161),c=r(3649),l=r(7881);function h(e){if(!(this instanceof h))return new h(e);if(e instanceof h)return e;if(n.isObject(e))return this._fromObject(e);throw new c.InvalidArgument("TransactionSignatures must be instantiated from an object")}a(h,l),h.prototype._fromObject=function(e){return this._checkObjectArgs(e),this.publicKey=new u(e.publicKey),this.prevTxId=i.isBuffer(e.prevTxId)?e.prevTxId:i.from(e.prevTxId,"hex"),this.outputIndex=e.outputIndex,this.inputIndex=e.inputIndex,this.signature=e.signature instanceof l?e.signature:i.isBuffer(e.signature)?l.fromBuffer(e.signature):l.fromString(e.signature),this.sigtype=e.sigtype,this},h.prototype._checkObjectArgs=function(e){o.checkArgument(u(e.publicKey),"publicKey"),o.checkArgument(!n.isUndefined(e.inputIndex),"inputIndex"),o.checkArgument(!n.isUndefined(e.outputIndex),"outputIndex"),o.checkState(n.isNumber(e.inputIndex),"inputIndex must be a number"),o.checkState(n.isNumber(e.outputIndex),"outputIndex must be a number"),o.checkArgument(e.signature,"signature"),o.checkArgument(e.prevTxId,"prevTxId"),o.checkState(e.signature instanceof l||i.isBuffer(e.signature)||s.isHexa(e.signature),"signature must be a buffer or hexa value"),o.checkState(i.isBuffer(e.prevTxId)||s.isHexa(e.prevTxId),"prevTxId must be a buffer or hexa value"),o.checkArgument(e.sigtype,"sigtype"),o.checkState(n.isNumber(e.sigtype),"sigtype must be a number")},h.prototype.toObject=h.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},h.fromObject=function(e){return o.checkArgument(e),new h(e)},e.exports=h},5042(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=r(8287),s=r(3649),u=r(3035),c=r(7798),l=r(5750),h=r(3173),f=r(5067),p=r(7881),d=r(999),g=r(617),m=r(7574),y=r(7589),v=y.PublicKeyHash,b=y.PublicKey,S=y.MultiSigScriptHash,w=y.MultiSig,O=r(7285),_=r(5133),I=r(4339),E=r(9043),A=r(6375).SCRIPT_ENABLE_SIGHASH_FORKID;function P(e){if(!(this instanceof P))return new P(e);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,e){if(e instanceof P)return P.shallowCopy(e);if(u.isHexa(e))this.fromString(e);else if(i.isBuffer(e))this.fromBuffer(e);else{if(!n.isObject(e))throw new s.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(e)}}else this._newTransaction()}P.DUST_AMOUNT=546,P.FEE_SECURITY_MARGIN=150,P.MAX_MONEY=21e14,P.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,P.NLOCKTIME_MAX_VALUE=4294967295,P.FEE_PER_KB=500,P.CHANGE_OUTPUT_MAX_SIZE=62,P.shallowCopy=function(e){return new P(e.toBuffer())};var k={configurable:!1,enumerable:!0,get:function(){return this._hash=new c(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(P.prototype,"hash",k),Object.defineProperty(P.prototype,"id",k);var x={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(P.prototype,"inputAmount",x),x.get=function(){return this._getOutputAmount()},Object.defineProperty(P.prototype,"outputAmount",x),P.prototype._getHash=function(){return f.sha256sha256(this.toBuffer())},P.prototype.serialize=function(e){return!0===e||e&&e.disableAll?this.uncheckedSerialize():this.checkedSerialize(e)},P.prototype.uncheckedSerialize=P.prototype.toString=function(){return this.toBuffer().toString("hex")},P.prototype.checkedSerialize=function(e){var t=this.getSerializationError(e);if(t)throw t.message+=" - For more information please see: https://bsv.io/api/lib/transaction#serialization-checks",t;return this.uncheckedSerialize()},P.prototype.invalidSatoshis=function(){for(var e=!1,t=0;t<this.outputs.length;t++)this.outputs[t].invalidSatoshis()&&(e=!0);return e},P.prototype.getSerializationError=function(e){if(e=e||{},this.invalidSatoshis())return new s.Transaction.InvalidSatoshis;var t,r=this._getUnspentValue();return r<0?e.disableMoreOutputThanInput||(t=new s.Transaction.InvalidOutputAmountSum):t=this._hasFeeError(e,r),t||this._hasDustOutputs(e)||this._isMissingSignatures(e)},P.prototype._hasFeeError=function(e,t){if(!n.isUndefined(this._fee)&&this._fee!==t)return new s.Transaction.FeeError.Different("Unspent value is "+t+" but specified fee is "+this._fee);if(!e.disableLargeFees){var r=Math.floor(P.FEE_SECURITY_MARGIN*this._estimateFee());if(t>r)return this._missingChange()?new s.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new s.Transaction.FeeError.TooLarge("expected less than "+r+" but got "+t)}},P.prototype._missingChange=function(){return!this._changeScript},P.prototype._hasDustOutputs=function(e){var t,r;if(!e.disableDustOutputs)for(t in this.outputs)if((r=this.outputs[t]).satoshis<P.DUST_AMOUNT&&!r.script.isDataOut()&&!r.script.isSafeDataOut())return new s.Transaction.DustOutputs},P.prototype._isMissingSignatures=function(e){if(!e.disableIsFullySigned)return this.isFullySigned()?void 0:new s.Transaction.MissingSignatures},P.prototype.inspect=function(){return"<Transaction: "+this.uncheckedSerialize()+">"},P.prototype.toBuffer=function(){var e=new l;return this.toBufferWriter(e).toBuffer()},P.prototype.toBufferWriter=function(e){return e.writeInt32LE(this.version),e.writeVarintNum(this.inputs.length),n.each(this.inputs,function(t){t.toBufferWriter(e)}),e.writeVarintNum(this.outputs.length),n.each(this.outputs,function(t){t.toBufferWriter(e)}),e.writeUInt32LE(this.nLockTime),e},P.prototype.fromBuffer=function(e){var t=new c(e);return this.fromBufferReader(t)},P.prototype.fromBufferReader=function(e){var t,r,i;for(o.checkArgument(!e.finished(),"No transaction data received"),this.version=e.readInt32LE(),r=e.readVarintNum(),t=0;t<r;t++){var n=y.fromBufferReader(e);this.inputs.push(n)}for(i=e.readVarintNum(),t=0;t<i;t++)this.outputs.push(O.fromBufferReader(e));return this.nLockTime=e.readUInt32LE(),this},P.prototype.toObject=P.prototype.toJSON=function(){var e=[];this.inputs.forEach(function(t){e.push(t.toObject())});var t=[];this.outputs.forEach(function(e){t.push(e.toObject())});var r={hash:this.hash,version:this.version,inputs:e,outputs:t,nLockTime:this.nLockTime};return this._changeScript&&(r.changeScript=this._changeScript.toString()),n.isUndefined(this._changeIndex)||(r.changeIndex=this._changeIndex),n.isUndefined(this._fee)||(r.fee=this._fee),r},P.prototype.fromObject=function(e){o.checkArgument(n.isObject(e)||e instanceof P);var t,r=this;return t=e instanceof P?t.toObject():e,n.each(t.inputs,function(e){if(e.output&&e.output.script){var t,i=new _(e.output.script);if(i.isPublicKeyHashOut())t=new y.PublicKeyHash(e);else if(i.isScriptHashOut()&&e.publicKeys&&e.threshold)t=new y.MultiSigScriptHash(e,e.publicKeys,e.threshold,e.signatures);else{if(!i.isPublicKeyOut())throw new s.Transaction.Input.UnsupportedScript(e.output.script);t=new y.PublicKey(e)}r.addInput(t)}else r.uncheckedAddInput(new y(e))}),n.each(t.outputs,function(e){r.addOutput(new O(e))}),t.changeIndex&&(this._changeIndex=t.changeIndex),t.changeScript&&(this._changeScript=new _(t.changeScript)),t.fee&&(this._fee=t.fee),this.nLockTime=t.nLockTime,this.version=t.version,this._checkConsistency(e),this},P.prototype._checkConsistency=function(e){n.isUndefined(this._changeIndex)||(o.checkState(this._changeScript,"Change script is expected."),o.checkState(this.outputs[this._changeIndex],"Change index points to undefined output."),o.checkState(this.outputs[this._changeIndex].script.toString()===this._changeScript.toString(),"Change output has an unexpected script.")),e&&e.hash&&o.checkState(e.hash===this.hash,"Hash in object does not match transaction hash.")},P.prototype.lockUntilDate=function(e){if(o.checkArgument(e),n.isNumber(e)&&e<P.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new s.Transaction.LockTimeTooEarly;n.isDate(e)&&(e=e.getTime()/1e3);for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===y.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=y.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this},P.prototype.lockUntilBlockHeight=function(e){if(o.checkArgument(n.isNumber(e)),e>=P.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new s.Transaction.BlockHeightTooHigh;if(e<0)throw new s.Transaction.NLockTimeOutOfRange;for(var t=0;t<this.inputs.length;t++)this.inputs[t].sequenceNumber===y.DEFAULT_SEQNUMBER&&(this.inputs[t].sequenceNumber=y.DEFAULT_LOCKTIME_SEQNUMBER);return this.nLockTime=e,this},P.prototype.getLockTime=function(){return this.nLockTime?this.nLockTime<P.NLOCKTIME_BLOCKHEIGHT_LIMIT?this.nLockTime:new Date(1e3*this.nLockTime):null},P.prototype.fromString=function(e){this.fromBuffer(a.Buffer.from(e,"hex"))},P.prototype._newTransaction=function(){this.version=1,this.nLockTime=0},P.prototype.from=function(e,t,r){if(n.isArray(e)){var i=this;return n.each(e,function(e){i.from(e,t,r)}),this}return n.some(this.inputs,function(t){return t.prevTxId.toString("hex")===e.txId&&t.outputIndex===e.outputIndex})||(t&&r?this._fromMultisigUtxo(e,t,r):this._fromNonP2SH(e)),this},P.prototype._fromNonP2SH=function(e){var t;t=(e=new m(e)).script.isPublicKeyHashOutPrefix()?v:e.script.isPublicKeyOut()?b:y,this.addInput(new t({output:new O({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:_.empty()}))},P.prototype._fromMultisigUtxo=function(e,t,r){var i;if(o.checkArgument(r<=t.length,"Number of required signatures must be greater than the number of public keys"),(e=new m(e)).script.isMultisigOut())i=w;else{if(!e.script.isScriptHashOut())throw new s.Transaction.Input.UnsupportedScript(e.script.toString());i=S}this.addInput(new i({output:new O({script:e.script,satoshis:e.satoshis}),prevTxId:e.txId,outputIndex:e.outputIndex,script:_.empty()},t,r))},P.prototype.addInput=function(e,t,r){if(o.checkArgumentType(e,y,"input"),!e.output&&(n.isUndefined(t)||n.isUndefined(r)))throw new s.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return e.output||!t||n.isUndefined(r)||(t=t instanceof _?t:new _(t),o.checkArgumentType(r,"number","satoshis"),e.output=new O({script:t,satoshis:r})),this.uncheckedAddInput(e)},P.prototype.uncheckedAddInput=function(e){return o.checkArgumentType(e,y,"input"),this.inputs.push(e),this._inputAmount=void 0,this._updateChangeOutput(),this},P.prototype.hasAllUtxoInfo=function(){return n.every(this.inputs.map(function(e){return!!e.output}))},P.prototype.fee=function(e){return o.checkArgument(n.isNumber(e),"amount must be a number"),this._fee=e,this._updateChangeOutput(),this},P.prototype.feePerKb=function(e){return o.checkArgument(n.isNumber(e),"amount must be a number"),this._feePerKb=e,this._updateChangeOutput(),this},P.prototype.change=function(e){return o.checkArgument(e,"address is required"),this._changeScript=_.fromAddress(e),this._updateChangeOutput(),this},P.prototype.getChangeOutput=function(){return n.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]},P.prototype.to=function(e,t){if(n.isArray(e)){var r=this;return n.each(e,function(e){r.to(e.address,e.satoshis)}),this}return o.checkArgument(u.isNaturalNumber(t),"Amount is expected to be a positive integer"),this.addOutput(new O({script:_(new g(e)),satoshis:t})),this},P.prototype.addData=function(e){return this.addOutput(new O({script:_.buildDataOut(e),satoshis:0})),this},P.prototype.addSafeData=function(e){return this.addOutput(new O({script:_.buildSafeDataOut(e),satoshis:0})),this},P.prototype.addOutput=function(e){return o.checkArgumentType(e,O,"output"),this._addOutput(e),this._updateChangeOutput(),this},P.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this},P.prototype._addOutput=function(e){this.outputs.push(e),this._outputAmount=void 0},P.prototype._getOutputAmount=function(){if(n.isUndefined(this._outputAmount)){var e=this;this._outputAmount=0,n.each(this.outputs,function(t){e._outputAmount+=t.satoshis})}return this._outputAmount},P.prototype._getInputAmount=function(){if(n.isUndefined(this._inputAmount)){var e=this;this._inputAmount=0,n.each(this.inputs,function(t){if(n.isUndefined(t.output))throw new s.Transaction.Input.MissingPreviousOutput;e._inputAmount+=t.output.satoshis})}return this._inputAmount},P.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),n.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex),this._changeIndex=this.outputs.length,this._addOutput(new O({script:this._changeScript,satoshis:0}));var e=this._getUnspentValue()-this.getFee();this._removeOutput(this._changeIndex),this._changeIndex=void 0,e>=P.DUST_AMOUNT&&(this._changeIndex=this.outputs.length,this._addOutput(new O({script:this._changeScript,satoshis:e})))}},P.prototype.getFee=function(){return this.isCoinbase()?0:n.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},P.prototype._estimateFee=function(){var e=this._estimateSize();return Math.ceil(e/1e3*(this._feePerKb||P.FEE_PER_KB))},P.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},P.prototype._clearSignatures=function(){n.each(this.inputs,function(e){e.clearSignatures!==y.prototype.clearSignatures&&e.clearSignatures()})},P.prototype._estimateSize=function(){var e=8;return e+=h(this.inputs.length).toBuffer().length,e+=h(this.outputs.length).toBuffer().length,n.each(this.inputs,function(t){e+=t._estimateSize()}),n.each(this.outputs,function(t){e+=t.getSize()}),e},P.prototype._removeOutput=function(e){var t=this.outputs[e];this.outputs=n.without(this.outputs,t),this._outputAmount=void 0},P.prototype.removeOutput=function(e){this._removeOutput(e),this._updateChangeOutput()},P.prototype.sort=function(){return this.sortInputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(e,t){return e.prevTxId.compare(t.prevTxId)||e.outputIndex-t.outputIndex}),t}),this.sortOutputs(function(e){var t=Array.prototype.concat.apply([],e);return t.sort(function(e,t){return e.satoshis-t.satoshis||e.script.toBuffer().compare(t.script.toBuffer())}),t}),this},P.prototype.shuffleOutputs=function(){return this.sortOutputs(n.shuffle)},P.prototype.sortOutputs=function(e){var t=e(this.outputs);return this._newOutputOrder(t)},P.prototype.sortInputs=function(e){return this.inputs=e(this.inputs),this._clearSignatures(),this},P.prototype._newOutputOrder=function(e){if(this.outputs.length!==e.length||0!==n.difference(this.outputs,e).length)throw new s.Transaction.InvalidSorting;if(!n.isUndefined(this._changeIndex)){var t=this.outputs[this._changeIndex];this._changeIndex=e.indexOf(t)}return this.outputs=e,this},P.prototype.removeInput=function(e,t){var r;if(r=!t&&n.isNumber(e)?e:n.findIndex(this.inputs,function(r){return r.prevTxId.toString("hex")===e&&r.outputIndex===t}),r<0||r>=this.inputs.length)throw new s.Transaction.InvalidIndex(r,this.inputs.length);var i=this.inputs[r];this.inputs=n.without(this.inputs,i),this._inputAmount=void 0,this._updateChangeOutput()},P.prototype.sign=function(e,t){o.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return n.isArray(e)?(n.each(e,function(e){r.sign(e,t)}),this):(n.each(this.getSignatures(e,t),function(e){r.applySignature(e)}),this)},P.prototype.getSignatures=function(e,t){e=new I(e),t=t||p.SIGHASH_ALL|p.SIGHASH_FORKID;var r=this,i=[],o=f.sha256ripemd160(e.publicKey.toBuffer());return n.each(this.inputs,function(a,s){n.each(a.getSignatures(r,e,s,t,o),function(e){i.push(e)})}),i},P.prototype.applySignature=function(e){return this.inputs[e.inputIndex].addSignature(this,e),this},P.prototype.isFullySigned=function(){return n.each(this.inputs,function(e){if(e.isFullySigned===y.prototype.isFullySigned)throw new s.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")}),n.every(n.map(this.inputs,function(e){return e.isFullySigned()}))},P.prototype.isValidSignature=function(e){if(this.inputs[e.inputIndex].isValidSignature===y.prototype.isValidSignature)throw new s.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[e.inputIndex].isValidSignature(this,e)},P.prototype.verifySignature=function(e,t,r,i,n,o){return d.verify(this,e,t,r,i,n,o)},P.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var e=new E(0),t=0;t<this.outputs.length;t++){var r=this.outputs[t];if(r.invalidSatoshis())return"transaction txout "+t+" satoshis is invalid";if(r._satoshisBN.gt(new E(P.MAX_MONEY,10)))return"transaction txout "+t+" greater than MAX_MONEY";if((e=e.add(r._satoshisBN)).gt(new E(P.MAX_MONEY)))return"transaction txout "+t+" total output greater than MAX_MONEY"}if(this.toBuffer().length>1e6)return"transaction over the maximum block size";var i={};for(t=0;t<this.inputs.length;t++){var o=this.inputs[t],a=o.prevTxId+":"+o.outputIndex;if(!n.isUndefined(i[a]))return"transaction input "+t+" duplicate input";i[a]=!0}if(this.isCoinbase()){var s=this.inputs[0]._scriptBuffer;if(s.length<2||s.length>100)return"coinbase transaction script size invalid"}else for(t=0;t<this.inputs.length;t++)if(this.inputs[t].isNull())return"transaction input "+t+" has null input";return!0},P.prototype.isCoinbase=function(){return 1===this.inputs.length&&this.inputs[0].isNull()},P.prototype.sighash=function(e,t,r,i,n){t=t||p.SIGHASH_ALL|p.SIGHASH_FORKID;var o=this.inputs[e];if(!o)throw new Error("Input index "+e+" does not exist");return!r&&o.output&&(r=o.output.script),!i&&o.output&&(i=new E(o.output.satoshis)),n=n||A,d.sighash(this,t,e,r,i,n)},e.exports=P},7574(e,t,r){"use strict";var i=r(4799),n=r(6365),o=r(3035),a=r(5133),s=r(617);function u(e){if(!(this instanceof u))return new u(e);n.checkArgument(i.isObject(e),"Must provide an object from where to extract data");var t=e.address?new s(e.address):void 0,r=e.txid?e.txid:e.txId;if(!r||!o.isHexaString(r)||r.length>64)throw new Error("Invalid TXID in object",e);var c=i.isUndefined(e.vout)?e.outputIndex:e.vout;if(!i.isNumber(c))throw new Error("Invalid outputIndex, received "+c);n.checkArgument(!i.isUndefined(e.scriptPubKey)||!i.isUndefined(e.script),"Must provide the scriptPubKey for that output!");var l=new a(e.scriptPubKey||e.script);n.checkArgument(!i.isUndefined(e.amount)||!i.isUndefined(e.satoshis),"Must provide an amount for the output");var h=i.isUndefined(e.amount)?e.satoshis:Math.round(1e8*e.amount);n.checkArgument(i.isNumber(h),"Amount must be a number"),o.defineImmutable(this,{address:t,txId:r,outputIndex:c,script:l,satoshis:h})}u.prototype.inspect=function(){return"<UnspentOutput: "+this.txId+":"+this.outputIndex+", satoshis: "+this.satoshis+", address: "+this.address+">"},u.prototype.toString=function(){return this.txId+":"+this.outputIndex},u.fromObject=function(e){return new u(e)},u.prototype.toObject=u.prototype.toJSON=function(){return{address:this.address?this.address.toString():void 0,txid:this.txId,vout:this.outputIndex,scriptPubKey:this.script.toBuffer().toString("hex"),amount:Number.parseFloat((this.satoshis/1e8).toFixed(8))}},e.exports=u},4799(e,t,r){"use strict";var i=r(9968),n={isArray:e=>Array.isArray(e),isNumber:e=>"number"==typeof e,isObject:e=>e&&"object"==typeof e,isString:e=>"string"==typeof e,isUndefined:e=>void 0===e,isFunction:e=>"function"==typeof e,isNull:e=>null===e,isDate:e=>e instanceof Date,extend:(e,t)=>Object.assign(e,t),noop:()=>{},every:(e,t)=>e.every(t||(e=>e)),map:(e,t)=>Array.from(e).map(t||(e=>e)),includes:(e,t)=>e.includes(t),each:(e,t)=>e.forEach(t),clone:e=>Object.assign({},e),pick:(e,t)=>{const r={};return t.forEach(t=>{void 0!==e[t]&&(r[t]=e[t])}),r},values:e=>Object.values(e),filter:(e,t)=>e.filter(t),reduce:(e,t,r)=>e.reduce(t,r),without:(e,t)=>e.filter(e=>e!==t),shuffle:e=>{const t=e.slice(0);for(let e=t.length-1;e>0;e--){const r=i.getRandomBuffer(4).readUInt32BE(0)/4294967296,n=Math.floor(r*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},difference:(e,t)=>e.filter(e=>!t.includes(e)),findIndex:(e,t)=>e.findIndex(t),some:(e,t)=>e.some(t),range:e=>[...Array(e).keys()]};e.exports=n},3035(e,t,r){"use strict";var i=r(8287).Buffer,n=r(4799),o=r(6365),a=function(e){return!!n.isString(e)&&/^[0-9a-fA-F]+$/.test(e)};e.exports={isValidJSON:function(e){var t;if(!n.isString(e))return!1;try{t=JSON.parse(e)}catch(e){return!1}return"object"==typeof t},isHexa:a,isHexaString:a,defineImmutable:function(e,t){return Object.keys(t).forEach(function(r){Object.defineProperty(e,r,{configurable:!1,enumerable:!0,value:t[r]})}),e},isNaturalNumber:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0},integerAsBuffer:function(e){o.checkArgumentType(e,"number","integer");const t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6365(e,t,r){"use strict";var i=r(3649),n=r(4799);e.exports={checkState:function(e,t){if(!e)throw new i.InvalidState(t)},checkArgument:function(e,t,r,n){if(!e)throw new i.InvalidArgument(t,r,n)},checkArgumentType:function(e,t,o){if(o=o||"(unknown name)",n.isString(t)){if("Buffer"===t){if(!r(8287).Buffer.isBuffer(e))throw new i.InvalidArgumentType(e,t,o)}else if(typeof e!==t)throw new i.InvalidArgumentType(e,t,o)}else if(!(e instanceof t))throw new i.InvalidArgumentType(e,t.name,o)}}},6470(e,t,r){"use strict";var i=r(8287).Buffer,n=r(6751),o={ES256:"P-256",ES256K:"secp256k1"},a=["ES256","ES256K"];function s(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function u(e){for(e=e.replace(/-/g,"+").replace(/_/g,"/");e.length%4;)e+="=";return i.from(e,"base64")}e.exports={issueVcJwt:async function(e){if(!(e.issuerDid&&e.subjectId&&e.credentialSubject&&e.privateJwk))throw new Error("issuerDid, subjectId, credentialSubject, and privateJwk are required");var t=e.alg||"ES256";if(!o[t])throw new Error("Unsupported algorithm: "+t);if(e.privateJwk.crv&&e.privateJwk.crv!==o[t])throw new Error("Key curve "+e.privateJwk.crv+" does not match alg "+t);var r=e.kid||e.privateJwk.kid,a=e.types||["VerifiableCredential"],u=e.expSeconds||31536e3,c=Math.floor(Date.now()/1e3),l=(new Date).toISOString(),h={"@context":["https://www.w3.org/2018/credentials/v1"],type:a,issuer:e.issuerDid,issuanceDate:l,credentialSubject:Object.assign({id:e.subjectId},e.credentialSubject)},f={iss:e.issuerDid,sub:e.subjectId,iat:c,exp:c+u,vc:h},p={alg:t,typ:"JWT",kid:r},d=s(i.from(JSON.stringify(p)))+"."+s(i.from(JSON.stringify(f))),g=n.createPrivateKey({key:e.privateJwk,format:"jwk"});return{jwt:d+"."+s(n.sign("sha256",i.from(d),{key:g,dsaEncoding:"ieee-p1363"}))}},verifyVcJwt:async function(e,t){t=t||{};try{if("string"!=typeof e)return{valid:!1,error:"Invalid JWT format"};var r=e.split(".");if(3!==r.length)return{valid:!1,error:"Invalid JWT format"};var s=r[0],c=r[1],l=r[2],h=JSON.parse(u(s).toString()),f=JSON.parse(u(c).toString()),p=u(l),d=t.allowedAlgs||a;if(!h.alg||-1===d.indexOf(h.alg)||!o[h.alg])return{valid:!1,error:"Algorithm not allowed: "+h.alg,header:h,payload:f};var g,m=Math.floor(Date.now()/1e3),y=t.clockToleranceSec||60;if(t.requireExpiration&&!f.exp)return{valid:!1,error:"JWT missing required exp claim",header:h,payload:f};if(f.exp&&f.exp<m-y)return{valid:!1,error:"JWT expired",header:h,payload:f};if(f.nbf&&f.nbf>m+y)return{valid:!1,error:"JWT not yet valid",header:h,payload:f};if(t.expectedIssuerDid&&f.iss!==t.expectedIssuerDid)return{valid:!1,error:"Unexpected issuer",header:h,payload:f};if(!t.didResolver)return{valid:!1,error:"DID resolver required for verification",header:h,payload:f};var v=await t.didResolver(f.iss);if(!v||!v.jwks||!v.jwks.keys)return{valid:!1,error:"Failed to resolve issuer DID",header:h,payload:f};var b=v.jwks.keys.find(function(e){return e.kid===h.kid});if(!b)return{valid:!1,error:"Key not found in JWKS",header:h,payload:f};if((g=b).crv&&g.crv!==o[h.alg])return{valid:!1,error:"Key curve does not match algorithm",header:h,payload:f};var S=s+"."+c,w=n.createPublicKey({key:g,format:"jwk"}),O=n.verify("sha256",i.from(S),{key:w,dsaEncoding:"ieee-p1363"},p);if(!O&&t.allowLegacyDER)try{O=n.verify("sha256",i.from(S),{key:w,dsaEncoding:"der"},p)}catch(e){O=!1}return O?{valid:!0,header:h,payload:f}:{valid:!1,error:"Invalid signature",header:h,payload:f}}catch(e){return{valid:!1,error:e.message||"Verification failed"}}},base64UrlEncode:s,base64UrlDecode:u,ALG_TO_CRV:o}},4148(e,t,r){"use strict";var i=r(5606);function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}var u,c,l=r(9597).codes,h=l.ERR_AMBIGUOUS_ARGUMENT,f=l.ERR_INVALID_ARG_TYPE,p=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,g=l.ERR_MISSING_ARGS,m=r(3918),y=r(537).inspect,v=r(537).types,b=v.isPromise,S=v.isRegExp,w=r(9133)(),O=r(9394)(),_=r(8075)("RegExp.prototype.test");new Map;function I(){var e=r(2299);u=e.isDeepEqual,c=e.isDeepStrictEqual}var E=!1,A=e.exports=T,P={};function k(e){if(e.message instanceof Error)throw e.message;throw new m(e)}function x(e,t,r,i){if(!r){var n=!1;if(0===t)n=!0,i="No value argument passed to `assert.ok()`";else if(i instanceof Error)throw i;var o=new m({actual:r,expected:!0,message:i,operator:"==",stackStartFn:e});throw o.generatedMessage=n,o}}function T(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];x.apply(void 0,[T,t.length].concat(t))}A.fail=function e(t,r,n,o,a){var s,u=arguments.length;if(0===u)s="Failed";else if(1===u)n=t,t=void 0;else{if(!1===E)E=!0,(i.emitWarning?i.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094");2===u&&(o="!=")}if(n instanceof Error)throw n;var c={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:a||e};void 0!==n&&(c.message=n);var l=new m(c);throw s&&(l.message=s,l.generatedMessage=!0),l},A.AssertionError=m,A.ok=T,A.equal=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");t!=r&&k({actual:t,expected:r,message:i,operator:"==",stackStartFn:e})},A.notEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");t==r&&k({actual:t,expected:r,message:i,operator:"!=",stackStartFn:e})},A.deepEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");void 0===u&&I(),u(t,r)||k({actual:t,expected:r,message:i,operator:"deepEqual",stackStartFn:e})},A.notDeepEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");void 0===u&&I(),u(t,r)&&k({actual:t,expected:r,message:i,operator:"notDeepEqual",stackStartFn:e})},A.deepStrictEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");void 0===u&&I(),c(t,r)||k({actual:t,expected:r,message:i,operator:"deepStrictEqual",stackStartFn:e})},A.notDeepStrictEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");void 0===u&&I();c(t,r)&&k({actual:t,expected:r,message:i,operator:"notDeepStrictEqual",stackStartFn:e})},A.strictEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");O(t,r)||k({actual:t,expected:r,message:i,operator:"strictEqual",stackStartFn:e})},A.notStrictEqual=function e(t,r,i){if(arguments.length<2)throw new g("actual","expected");O(t,r)&&k({actual:t,expected:r,message:i,operator:"notStrictEqual",stackStartFn:e})};var R=a(function e(t,r,i){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==i&&"string"==typeof i[e]&&S(t[e])&&_(t[e],i[e])?n[e]=i[e]:n[e]=t[e])})});function B(e,t,r,i){if("function"!=typeof t){if(S(t))return _(t,e);if(2===arguments.length)throw new f("expected",["Function","RegExp"],t);if("object"!==n(e)||null===e){var o=new m({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:i});throw o.operator=i.name,o}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new p("error",t,"may not be an empty object");return void 0===u&&I(),a.forEach(function(n){"string"==typeof e[n]&&S(t[n])&&_(t[n],e[n])||function(e,t,r,i,n,o){if(!(r in e)||!c(e[r],t[r])){if(!i){var a=new R(e,n),s=new R(t,n,e),u=new m({actual:a,expected:s,operator:"deepStrictEqual",stackStartFn:o});throw u.actual=e,u.expected=t,u.operator=o.name,u}k({actual:e,expected:t,message:i,operator:o.name,stackStartFn:o})}}(e,t,n,r,a,i)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function N(e){if("function"!=typeof e)throw new f("fn","Function",e);try{e()}catch(e){return e}return P}function C(e){return b(e)||null!==e&&"object"===n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function D(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!C(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!C(e))throw new f("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return P}).catch(function(e){return e})})}function M(e,t,r,i){if("string"==typeof r){if(4===arguments.length)throw new f("error",["Object","Error","Function","RegExp"],r);if("object"===n(t)&&null!==t){if(t.message===r)throw new h("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new h("error/message",'The error "'.concat(t,'" is identical to the message.'));i=r,r=void 0}else if(null!=r&&"object"!==n(r)&&"function"!=typeof r)throw new f("error",["Object","Error","Function","RegExp"],r);if(t===P){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=i?": ".concat(i):".";var a="rejects"===e.name?"rejection":"exception";k({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(o),stackStartFn:e})}if(r&&!B(t,r,i,e))throw t}function L(e,t,r,i){if(t!==P){if("string"==typeof r&&(i=r,r=void 0),!r||B(t,r)){var n=i?": ".concat(i):".",o="doesNotReject"===e.name?"rejection":"exception";k({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(n,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function H(e,t,r,i,o){if(!S(t))throw new f("regexp","RegExp",t);var a="match"===o;if("string"!=typeof e||_(t,e)!==a){if(r instanceof Error)throw r;var s=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(n(e)," (").concat(y(e),")"):(a?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(t),". Input:\n\n").concat(y(e),"\n"));var u=new m({actual:e,expected:t,message:r,operator:o,stackStartFn:i});throw u.generatedMessage=s,u}}function j(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];x.apply(void 0,[j,t.length].concat(t))}A.throws=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];M.apply(void 0,[e,N(t)].concat(i))},A.rejects=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return D(t).then(function(t){return M.apply(void 0,[e,t].concat(i))})},A.doesNotThrow=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];L.apply(void 0,[e,N(t)].concat(i))},A.doesNotReject=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return D(t).then(function(t){return L.apply(void 0,[e,t].concat(i))})},A.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===n(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var i=new m({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var a=o.split("\n");a.shift();for(var s=i.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}i.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw i}},A.match=function e(t,r,i){H(t,r,i,e,"match")},A.doesNotMatch=function e(t,r,i){H(t,r,i,e,"doesNotMatch")},A.strict=w(j,A,{equal:A.strictEqual,deepEqual:A.deepStrictEqual,notEqual:A.notStrictEqual,notDeepEqual:A.notDeepStrictEqual}),A.strict.strict=A.strict},3918(e,t,r){"use strict";var i=r(5606);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return(t=u(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,u(i.key),i)}}function u(e){var t=function(e,t){if("object"!==m(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==m(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===m(t)?t:String(t)}function c(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){var t="function"==typeof Map?new Map:void 0;return h=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return f(e,arguments,g(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),d(i,e)},h(e)}function f(e,t,r){return f=p()?Reflect.construct.bind():function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&d(n,r.prototype),n},f.apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var y=r(537).inspect,v=r(9597).codes.ERR_INVALID_ARG_TYPE;function b(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var S="",w="",O="",_="",I={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function E(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function A(e){return y(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function P(e,t,r){var n="",o="",a=0,s="",u=!1,c=A(e),l=c.split("\n"),h=A(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var d=l[0].length+h[0].length;if(d<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(I[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r){if(d<(i.stderr&&i.stderr.isTTY?i.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}}for(var g=l[l.length-1],y=h[h.length-1];g===y&&(f++<2?s="\n ".concat(g).concat(s):n=g,l.pop(),h.pop(),0!==l.length&&0!==h.length);)g=l[l.length-1],y=h[h.length-1];var v=Math.max(l.length,h.length);if(0===v){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(S,"...").concat(_);E.length>27;)E.pop();return"".concat(I.notIdentical,"\n\n").concat(E.join("\n"),"\n")}f>3&&(s="\n".concat(S,"...").concat(_).concat(s),u=!0),""!==n&&(s="\n ".concat(n).concat(s),n="");var P=0,k=I[r]+"\n".concat(w,"+ actual").concat(_," ").concat(O,"- expected").concat(_),x=" ".concat(S,"...").concat(_," Lines skipped");for(f=0;f<v;f++){var T=f-a;if(l.length<f+1)T>1&&f>2&&(T>4?(o+="\n".concat(S,"...").concat(_),u=!0):T>3&&(o+="\n ".concat(h[f-2]),P++),o+="\n ".concat(h[f-1]),P++),a=f,n+="\n".concat(O,"-").concat(_," ").concat(h[f]),P++;else if(h.length<f+1)T>1&&f>2&&(T>4?(o+="\n".concat(S,"...").concat(_),u=!0):T>3&&(o+="\n ".concat(l[f-2]),P++),o+="\n ".concat(l[f-1]),P++),a=f,o+="\n".concat(w,"+").concat(_," ").concat(l[f]),P++;else{var R=h[f],B=l[f],N=B!==R&&(!b(B,",")||B.slice(0,-1)!==R);N&&b(R,",")&&R.slice(0,-1)===B&&(N=!1,B+=","),N?(T>1&&f>2&&(T>4?(o+="\n".concat(S,"...").concat(_),u=!0):T>3&&(o+="\n ".concat(l[f-2]),P++),o+="\n ".concat(l[f-1]),P++),a=f,o+="\n".concat(w,"+").concat(_," ").concat(B),n+="\n".concat(O,"-").concat(_," ").concat(R),P+=2):(o+=n,n="",1!==T&&0!==f||(o+="\n ".concat(B),P++))}if(P>20&&f<v-2)return"".concat(k).concat(x,"\n").concat(o,"\n").concat(S,"...").concat(_).concat(n,"\n")+"".concat(S,"...").concat(_)}return"".concat(k).concat(u?x:"","\n").concat(o).concat(n).concat(s).concat(p)}var k=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(b,e);var r,n,a,u,h,f=(r=b,n=p(),function(){var e,t=g(r);if(n){var i=g(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return c(this,e)});function b(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),"object"!==m(e)||null===e)throw new v("options","Object",e);var r=e.message,n=e.operator,o=e.stackStartFn,a=e.actual,s=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(i.stderr&&i.stderr.isTTY&&(i.stderr&&i.stderr.getColorDepth&&1!==i.stderr.getColorDepth()?(S="",w="",_="",O=""):(S="",w="",_="",O="")),"object"===m(a)&&null!==a&&"object"===m(s)&&null!==s&&"stack"in a&&a instanceof Error&&"stack"in s&&s instanceof Error&&(a=E(a),s=E(s)),"deepStrictEqual"===n||"strictEqual"===n)t=f.call(this,P(a,s,n));else if("notDeepStrictEqual"===n||"notStrictEqual"===n){var h=I[n],p=A(a).split("\n");if("notStrictEqual"===n&&"object"===m(a)&&null!==a&&(h=I.notStrictEqualObject),p.length>30)for(p[26]="".concat(S,"...").concat(_);p.length>27;)p.pop();t=1===p.length?f.call(this,"".concat(h," ").concat(p[0])):f.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var d=A(a),g="",y=I[n];"notDeepEqual"===n||"notEqual"===n?(d="".concat(I[n],"\n\n").concat(d)).length>1024&&(d="".concat(d.slice(0,1021),"...")):(g="".concat(A(s)),d.length>512&&(d="".concat(d.slice(0,509),"...")),g.length>512&&(g="".concat(g.slice(0,509),"...")),"deepEqual"===n||"equal"===n?d="".concat(y,"\n\n").concat(d,"\n\nshould equal\n\n"):g=" ".concat(n," ").concat(g)),t=f.call(this,"".concat(d).concat(g))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(l(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=s,t.operator=n,Error.captureStackTrace&&Error.captureStackTrace(l(t),o),t.stack,t.name="AssertionError",c(t)}return a=b,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return y(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),h&&s(a,h),Object.defineProperty(a,"prototype",{writable:!1}),b}(h(Error),y.custom);e.exports=k},9597(e,t,r){"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,o(i.key),i)}}function o(e){var t=function(e,t){if("object"!==i(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===i(t)?t:String(t)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return function(e,t){if(t&&("object"===i(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,r)}}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}var c,l,h={};function f(e,t,r){r||(r=Error);var i=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(l,r);var i,o,u,c=s(l);function l(r,i,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),o=c.call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,i,n)),o.code=e,o}return i=l,o&&n(i.prototype,o),u&&n(i,u),Object.defineProperty(i,"prototype",{writable:!1}),i}(r);h[e]=i}function p(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}f("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),f("ERR_INVALID_ARG_TYPE",function(e,t,n){var o,a,s,u;if(void 0===c&&(c=r(4148)),c("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(!s||s<0?0:+s,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(o," ").concat(p(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(l," ").concat(o," ").concat(p(t,"type"))}return u+=". Received type ".concat(i(n))},TypeError),f("ERR_INVALID_ARG_VALUE",function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===l&&(l=r(537));var n=l.inspect(t);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(i,". Received ").concat(n)},TypeError,RangeError),f("ERR_INVALID_RETURN_VALUE",function(e,t,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(i(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(n,".")},TypeError),f("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];void 0===c&&(c=r(4148)),c(t.length>0,"At least one arg needs to be specified");var n="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:n+="".concat(t[0]," argument");break;case 2:n+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:n+=t.slice(0,o-1).join(", "),n+=", and ".concat(t[o-1]," arguments")}return"".concat(n," must be specified")},TypeError),e.exports.codes=h},2299(e,t,r){"use strict";function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,o,a,s=[],u=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(i=o.call(r)).done)&&(s.push(i.value),s.length!==t);u=!0);}catch(e){c=!0,n=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw n}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},u=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},h=Number.isNaN?Number.isNaN:r(4133);function f(e){return e.call.bind(e)}var p=f(Object.prototype.hasOwnProperty),d=f(Object.prototype.propertyIsEnumerable),g=f(Object.prototype.toString),m=r(537).types,y=m.isAnyArrayBuffer,v=m.isArrayBufferView,b=m.isDate,S=m.isMap,w=m.isRegExp,O=m.isSet,_=m.isNativeError,I=m.isBoxedPrimitive,E=m.isNumberObject,A=m.isStringObject,P=m.isBooleanObject,k=m.isBigIntObject,x=m.isSymbolObject,T=m.isFloat32Array,R=m.isFloat64Array;function B(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function N(e){return Object.keys(e).filter(B).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}
2
- /*!
3
- * The buffer module from node.js, for the browser.
4
- *
5
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
6
- * @license MIT
7
- */function C(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}function D(e,t,r,i){if(e===t)return 0!==e||(!r||c(e,t));if(r){if("object"!==o(e))return"number"==typeof e&&h(e)&&h(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var n,s,u,l,f=g(e);if(f!==g(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=N(e),d=N(t);return p.length===d.length&&L(e,t,r,i,1,p)}if("[object Object]"===f&&(!S(e)&&S(t)||!O(e)&&O(t)))return!1;if(b(e)){if(!b(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(u=e,l=t,!(a?u.source===l.source&&u.flags===l.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(l))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!T(e)&&!R(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var m=N(e),B=N(t);return m.length===B.length&&L(e,t,r,i,0,m)}if(O(e))return!(!O(t)||e.size!==t.size)&&L(e,t,r,i,2);if(S(e))return!(!S(t)||e.size!==t.size)&&L(e,t,r,i,3);if(y(e)){if(s=t,(n=e).byteLength!==s.byteLength||0!==C(new Uint8Array(n),new Uint8Array(s)))return!1}else if(I(e)&&!function(e,t){return E(e)?E(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):P(e)?P(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):k(e)?k(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):x(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return L(e,t,r,i,0)}function M(e,t){return t.filter(function(t){return d(e,t)})}function L(e,t,r,n,a,c){if(5===arguments.length){c=Object.keys(e);var h=Object.keys(t);if(c.length!==h.length)return!1}for(var f=0;f<c.length;f++)if(!p(t,c[f]))return!1;if(r&&5===arguments.length){var g=l(e);if(0!==g.length){var m=0;for(f=0;f<g.length;f++){var y=g[f];if(d(e,y)){if(!d(t,y))return!1;c.push(y),m++}else if(d(t,y))return!1}var v=l(t);if(g.length!==v.length&&M(t,v).length!==m)return!1}else{var b=l(t);if(0!==b.length&&0!==M(t,b).length)return!1}}if(0===c.length&&(0===a||1===a&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var S=n.val1.get(e);if(void 0!==S){var w=n.val2.get(t);if(void 0!==w)return S===w}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var O=function(e,t,r,n,a,c){var l=0;if(2===c){if(!function(e,t,r,i){for(var n=null,a=s(e),u=0;u<a.length;u++){var c=a[u];if("object"===o(c)&&null!==c)null===n&&(n=new Set),n.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===n&&(n=new Set),n.add(c)}}if(null!==n){for(var l=s(t),h=0;h<l.length;h++){var f=l[h];if("object"===o(f)&&null!==f){if(!H(n,f,r,i))return!1}else if(!r&&!e.has(f)&&!H(n,f,r,i))return!1}return 0===n.size}return!0}(e,t,r,a))return!1}else if(3===c){if(!function(e,t,r,n){for(var a=null,s=u(e),c=0;c<s.length;c++){var l=i(s[c],2),h=l[0],f=l[1];if("object"===o(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var p=t.get(h);if(void 0===p&&!t.has(h)||!D(f,p,r,n)){if(r)return!1;if(!F(e,t,h,f,n))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var d=u(t),g=0;g<d.length;g++){var m=i(d[g],2),y=m[0],v=m[1];if("object"===o(y)&&null!==y){if(!K(a,e,y,v,r,n))return!1}else if(!(r||e.has(y)&&D(e.get(y),v,!1,n)||K(a,e,y,v,!1,n)))return!1}return 0===a.size}return!0}(e,t,r,a))return!1}else if(1===c)for(;l<e.length;l++){if(!p(e,l)){if(p(t,l))return!1;for(var h=Object.keys(e);l<h.length;l++){var f=h[l];if(!p(t,f)||!D(e[f],t[f],r,a))return!1}return h.length===Object.keys(t).length}if(!p(t,l)||!D(e[l],t[l],r,a))return!1}for(l=0;l<n.length;l++){var d=n[l];if(!D(e[d],t[d],r,a))return!1}return!0}(e,t,r,c,n,a);return n.val1.delete(e),n.val2.delete(t),O}function H(e,t,r,i){for(var n=s(e),o=0;o<n.length;o++){var a=n[o];if(D(t,a,r,i))return e.delete(a),!0}return!1}function j(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(h(e))return!1}return!0}function U(e,t,r){var i=j(r);return null!=i?i:t.has(i)&&!e.has(i)}function F(e,t,r,i,n){var o=j(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!D(i,a,!1,n))&&(!e.has(o)&&D(i,a,!1,n))}function K(e,t,r,i,n,o){for(var a=s(e),u=0;u<a.length;u++){var c=a[u];if(D(r,c,n,o)&&D(i,t.get(c),n,o))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return D(e,t,false)},isDeepStrictEqual:function(e,t){return D(e,t,true)}}},5364(e,t,r){"use strict";var i=r(2861).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var o=e.charAt(n),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=n}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),l=Math.log(256)/Math.log(s);function h(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return i.alloc(0);for(var r=0,n=0,o=0;e[r]===u;)n++,r++;for(var a=(e.length-r)*c+1>>>0,l=new Uint8Array(a);r<e.length;){var h=e.charCodeAt(r);if(h>255)return;var f=t[h];if(255===f)return;for(var p=0,d=a-1;(0!==f||p<o)&&-1!==d;d--,p++)f+=s*l[d]>>>0,l[d]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=p,r++}for(var g=a-o;g!==a&&0===l[g];)g++;var m=i.allocUnsafe(n+(a-g));m.fill(0,0,n);for(var y=n;g!==a;)m[y++]=l[g++];return m}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*l+1>>>0,h=new Uint8Array(c);o!==a;){for(var f=t[o],p=0,d=c-1;(0!==f||p<n)&&-1!==d;d--,p++)f+=256*h[d]>>>0,h[d]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=p,o++}for(var g=c-n;g!==c&&0===h[g];)g++;for(var m=u.repeat(r);g<c;++g)m+=e.charAt(h[g]);return m},decodeUnsafe:h,decode:function(e){var t=h(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},7526(e,t){"use strict";t.toByteArray=function(e){var t,r,o=s(e),a=o[0],u=o[1],c=new n(function(e,t,r){return 3*(t+r)/4-r}(0,a,u)),l=0,h=u>0?a-4:a;for(r=0;r<h;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===u&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,c[l++]=255&t);1===u&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,o=[],a=16383,s=0,u=i-n;s<u;s+=a)o.push(c(e,s,s+a>u?u:s+a));1===n?(t=e[i-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var i,n=[],o=t;o<r;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),n.push(u(i));return n.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},9404(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(7790).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var i=s(e,r);return r-1>=t&&(i|=s(e,r-1)<<4),i}function c(e,t,r,i){for(var n=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;n*=i,n+=s>=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,a,s=0;if("be"===r)for(n=e.length-1,o=0;n>=0;n-=3)a=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n<e.length;n+=3)a=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,o=0,a=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=u(e,t,i)<<o,this.words[a]|=67108863&n,o>=18?(o-=18,a+=1,this.words[a]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,l=r;l<s;l+=i)u=c(e,l,l+i,t),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var h=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)h*=t;this.imuln(h),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<i;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,t.length-1),p=Math.max(0,c-e.length+1);p<=f;p++){var d=c-p|0;l+=(a=(n=0|e.words[d])*(o=0|t.words[p])+h)/67108864|0,h=67108863&a}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<n|o)).toString(16);o=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,a--),r=0!==o||a!==this.length-1?l[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],p=f[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modn(p).toString(e);r=(d=d.idivn(p)).isZero()?g+r:l[c-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return i(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===t,c=new e(o),l=this.clone();if(u){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-n;s++)c[s]=0;for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),c[o-s-1]=a}return c},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return i(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return i(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return i(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,o=0;o<i.length;o++)t=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&t,n=t>>>26;for(;0!==n&&o<r.length;o++)t=(0|r.words[o])+n,this.words[o]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var o=0,a=0;a<i.length;a++)o=(t=(0|r.words[a])-(0|i.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var i,n,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],h=8191&l,f=l>>>13,p=0|a[1],d=8191&p,g=p>>>13,m=0|a[2],y=8191&m,v=m>>>13,b=0|a[3],S=8191&b,w=b>>>13,O=0|a[4],_=8191&O,I=O>>>13,E=0|a[5],A=8191&E,P=E>>>13,k=0|a[6],x=8191&k,T=k>>>13,R=0|a[7],B=8191&R,N=R>>>13,C=0|a[8],D=8191&C,M=C>>>13,L=0|a[9],H=8191&L,j=L>>>13,U=0|s[0],F=8191&U,K=U>>>13,z=0|s[1],V=8191&z,q=z>>>13,G=0|s[2],Y=8191&G,W=G>>>13,$=0|s[3],X=8191&$,J=$>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],he=8191&le,fe=le>>>13,pe=0|s[9],de=8191&pe,ge=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(h,F))|0)+((8191&(n=(n=Math.imul(h,K))+Math.imul(f,F)|0))<<13)|0;c=((o=Math.imul(f,K))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(d,F),n=(n=Math.imul(d,K))+Math.imul(g,F)|0,o=Math.imul(g,K);var ye=(c+(i=i+Math.imul(h,V)|0)|0)+((8191&(n=(n=n+Math.imul(h,q)|0)+Math.imul(f,V)|0))<<13)|0;c=((o=o+Math.imul(f,q)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(y,F),n=(n=Math.imul(y,K))+Math.imul(v,F)|0,o=Math.imul(v,K),i=i+Math.imul(d,V)|0,n=(n=n+Math.imul(d,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var ve=(c+(i=i+Math.imul(h,Y)|0)|0)+((8191&(n=(n=n+Math.imul(h,W)|0)+Math.imul(f,Y)|0))<<13)|0;c=((o=o+Math.imul(f,W)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(S,F),n=(n=Math.imul(S,K))+Math.imul(w,F)|0,o=Math.imul(w,K),i=i+Math.imul(y,V)|0,n=(n=n+Math.imul(y,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,i=i+Math.imul(d,Y)|0,n=(n=n+Math.imul(d,W)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,W)|0;var be=(c+(i=i+Math.imul(h,X)|0)|0)+((8191&(n=(n=n+Math.imul(h,J)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(_,F),n=(n=Math.imul(_,K))+Math.imul(I,F)|0,o=Math.imul(I,K),i=i+Math.imul(S,V)|0,n=(n=n+Math.imul(S,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,i=i+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,W)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,J)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,J)|0;var Se=(c+(i=i+Math.imul(h,Q)|0)|0)+((8191&(n=(n=n+Math.imul(h,ee)|0)+Math.imul(f,Q)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,K))+Math.imul(P,F)|0,o=Math.imul(P,K),i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,q)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,q)|0,i=i+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(w,Y)|0,o=o+Math.imul(w,W)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0;var we=(c+(i=i+Math.imul(h,re)|0)|0)+((8191&(n=(n=n+Math.imul(h,ie)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,K))+Math.imul(T,F)|0,o=Math.imul(T,K),i=i+Math.imul(A,V)|0,n=(n=n+Math.imul(A,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,W)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,W)|0,i=i+Math.imul(S,X)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(w,X)|0,o=o+Math.imul(w,J)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0,i=i+Math.imul(d,re)|0,n=(n=n+Math.imul(d,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0;var Oe=(c+(i=i+Math.imul(h,oe)|0)|0)+((8191&(n=(n=n+Math.imul(h,ae)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,ae)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,F),n=(n=Math.imul(B,K))+Math.imul(N,F)|0,o=Math.imul(N,K),i=i+Math.imul(x,V)|0,n=(n=n+Math.imul(x,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,i=i+Math.imul(A,Y)|0,n=(n=n+Math.imul(A,W)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,W)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,ee)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(y,re)|0,n=(n=n+Math.imul(y,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0,i=i+Math.imul(d,oe)|0,n=(n=n+Math.imul(d,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0;var _e=(c+(i=i+Math.imul(h,ue)|0)|0)+((8191&(n=(n=n+Math.imul(h,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,K))+Math.imul(M,F)|0,o=Math.imul(M,K),i=i+Math.imul(B,V)|0,n=(n=n+Math.imul(B,q)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,q)|0,i=i+Math.imul(x,Y)|0,n=(n=n+Math.imul(x,W)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,W)|0,i=i+Math.imul(A,X)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(P,X)|0,o=o+Math.imul(P,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,i=i+Math.imul(S,re)|0,n=(n=n+Math.imul(S,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(y,oe)|0,n=(n=n+Math.imul(y,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0,i=i+Math.imul(d,ue)|0,n=(n=n+Math.imul(d,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Ie=(c+(i=i+Math.imul(h,he)|0)|0)+((8191&(n=(n=n+Math.imul(h,fe)|0)+Math.imul(f,he)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(H,F),n=(n=Math.imul(H,K))+Math.imul(j,F)|0,o=Math.imul(j,K),i=i+Math.imul(D,V)|0,n=(n=n+Math.imul(D,q)|0)+Math.imul(M,V)|0,o=o+Math.imul(M,q)|0,i=i+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,W)|0,i=i+Math.imul(x,X)|0,n=(n=n+Math.imul(x,J)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,J)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ie)|0,i=i+Math.imul(S,oe)|0,n=(n=n+Math.imul(S,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(y,ue)|0,n=(n=n+Math.imul(y,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0,i=i+Math.imul(d,he)|0,n=(n=n+Math.imul(d,fe)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,fe)|0;var Ee=(c+(i=i+Math.imul(h,de)|0)|0)+((8191&(n=(n=n+Math.imul(h,ge)|0)+Math.imul(f,de)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(H,V),n=(n=Math.imul(H,q))+Math.imul(j,V)|0,o=Math.imul(j,q),i=i+Math.imul(D,Y)|0,n=(n=n+Math.imul(D,W)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,W)|0,i=i+Math.imul(B,X)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,J)|0,i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,i=i+Math.imul(S,ue)|0,n=(n=n+Math.imul(S,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(y,he)|0,n=(n=n+Math.imul(y,fe)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,fe)|0;var Ae=(c+(i=i+Math.imul(d,de)|0)|0)+((8191&(n=(n=n+Math.imul(d,ge)|0)+Math.imul(g,de)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(H,Y),n=(n=Math.imul(H,W))+Math.imul(j,Y)|0,o=Math.imul(j,W),i=i+Math.imul(D,X)|0,n=(n=n+Math.imul(D,J)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,J)|0,i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,i=i+Math.imul(x,re)|0,n=(n=n+Math.imul(x,ie)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,i=i+Math.imul(S,he)|0,n=(n=n+Math.imul(S,fe)|0)+Math.imul(w,he)|0,o=o+Math.imul(w,fe)|0;var Pe=(c+(i=i+Math.imul(y,de)|0)|0)+((8191&(n=(n=n+Math.imul(y,ge)|0)+Math.imul(v,de)|0))<<13)|0;c=((o=o+Math.imul(v,ge)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(H,X),n=(n=Math.imul(H,J))+Math.imul(j,X)|0,o=Math.imul(j,J),i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,i=i+Math.imul(B,re)|0,n=(n=n+Math.imul(B,ie)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ie)|0,i=i+Math.imul(x,oe)|0,n=(n=n+Math.imul(x,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,i=i+Math.imul(_,he)|0,n=(n=n+Math.imul(_,fe)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,fe)|0;var ke=(c+(i=i+Math.imul(S,de)|0)|0)+((8191&(n=(n=n+Math.imul(S,ge)|0)+Math.imul(w,de)|0))<<13)|0;c=((o=o+Math.imul(w,ge)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(H,Q),n=(n=Math.imul(H,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),i=i+Math.imul(D,re)|0,n=(n=n+Math.imul(D,ie)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ie)|0,i=i+Math.imul(B,oe)|0,n=(n=n+Math.imul(B,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,i=i+Math.imul(x,ue)|0,n=(n=n+Math.imul(x,ce)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,ce)|0,i=i+Math.imul(A,he)|0,n=(n=n+Math.imul(A,fe)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,fe)|0;var xe=(c+(i=i+Math.imul(_,de)|0)|0)+((8191&(n=(n=n+Math.imul(_,ge)|0)+Math.imul(I,de)|0))<<13)|0;c=((o=o+Math.imul(I,ge)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(H,re),n=(n=Math.imul(H,ie))+Math.imul(j,re)|0,o=Math.imul(j,ie),i=i+Math.imul(D,oe)|0,n=(n=n+Math.imul(D,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,i=i+Math.imul(B,ue)|0,n=(n=n+Math.imul(B,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,i=i+Math.imul(x,he)|0,n=(n=n+Math.imul(x,fe)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,fe)|0;var Te=(c+(i=i+Math.imul(A,de)|0)|0)+((8191&(n=(n=n+Math.imul(A,ge)|0)+Math.imul(P,de)|0))<<13)|0;c=((o=o+Math.imul(P,ge)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(H,oe),n=(n=Math.imul(H,ae))+Math.imul(j,oe)|0,o=Math.imul(j,ae),i=i+Math.imul(D,ue)|0,n=(n=n+Math.imul(D,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,i=i+Math.imul(B,he)|0,n=(n=n+Math.imul(B,fe)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,fe)|0;var Re=(c+(i=i+Math.imul(x,de)|0)|0)+((8191&(n=(n=n+Math.imul(x,ge)|0)+Math.imul(T,de)|0))<<13)|0;c=((o=o+Math.imul(T,ge)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(H,ue),n=(n=Math.imul(H,ce))+Math.imul(j,ue)|0,o=Math.imul(j,ce),i=i+Math.imul(D,he)|0,n=(n=n+Math.imul(D,fe)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,fe)|0;var Be=(c+(i=i+Math.imul(B,de)|0)|0)+((8191&(n=(n=n+Math.imul(B,ge)|0)+Math.imul(N,de)|0))<<13)|0;c=((o=o+Math.imul(N,ge)|0)+(n>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(H,he),n=(n=Math.imul(H,fe))+Math.imul(j,he)|0,o=Math.imul(j,fe);var Ne=(c+(i=i+Math.imul(D,de)|0)|0)+((8191&(n=(n=n+Math.imul(D,ge)|0)+Math.imul(M,de)|0))<<13)|0;c=((o=o+Math.imul(M,ge)|0)+(n>>>13)|0)+(Ne>>>26)|0,Ne&=67108863;var Ce=(c+(i=Math.imul(H,de))|0)+((8191&(n=(n=Math.imul(H,ge))+Math.imul(j,de)|0))<<13)|0;return c=((o=Math.imul(j,ge))+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ye,u[2]=ve,u[3]=be,u[4]=Se,u[5]=we,u[6]=Oe,u[7]=_e,u[8]=Ie,u[9]=Ee,u[10]=Ae,u[11]=Pe,u[12]=ke,u[13]=xe,u[14]=Te,u[15]=Re,u[16]=Be,u[17]=Ne,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function g(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=p),o.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?d(this,e,t):i<63?p(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var a=n;n=0;for(var s=67108863&i,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,h=(0|e.words[l])*(0|t.words[c]),f=67108863&h;s=67108863&(f=f+s|0),n+=(a=(a=a+(h/67108864|0)|0)+(f>>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):g(this,e,t),r},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},m.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a<o;a++)i[a]=t[e[a]],n[a]=r[e[a]]},m.prototype.transform=function(e,t,r,i,n,o){this.permute(o,e,t,r,i,n);for(var a=1;a<n;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<n;l+=s)for(var h=u,f=c,p=0;p<a;p++){var d=r[l+p],g=i[l+p],m=r[l+p+a],y=i[l+p+a],v=h*m-f*y;y=h*y+f*m,m=v,r[l+p]=d+m,i[l+p]=g+y,r[l+p+a]=d-m,i[l+p+a]=g-y,p!==s&&(v=u*h-c*f,f=u*f+c*h,h=v)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},m.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},m.prototype.convert13b=function(e,t,r,n){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<n;++a)r[a]=0;i(0===o),i(!(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),o=this.stub(i),a=new Array(i),s=new Array(i),u=new Array(i),c=new Array(i),l=new Array(i),h=new Array(i),f=r.words;f.length=i,this.convert13b(e.words,e.length,a,i),this.convert13b(t.words,t.length,c,i),this.transform(a,o,s,u,i,n),this.transform(c,o,l,h,i,n);for(var p=0;p<i;p++){var d=s[p]*l[p]-u[p]*h[p];u[p]=s[p]*h[p]+u[p]*l[p],s[p]=d}return this.conjugate(s,u,i),this.transform(s,u,f,o,i,n),this.conjugate(f,o,i),this.normalize13b(f,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,o=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1:this.length,this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new o(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(n-=a,n=Math.max(0,n),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=n);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return 0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var n,o,a=e.length+r;this._expand(a);var s=0;for(n=0;n<e.length;n++){o=(0|this.words[n+r])+s;var u=(0|e.words[n])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)s=(o=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&o;if(0===s)return this.strip();for(i(-1===s),s=0,n=0;n<this.length;n++)s=(o=-(0|this.words[n])+s)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=i.clone()._ishlnsubmul(n,1,u);0===l.negative&&(i=l,s&&(s.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|i.words[n.length+h])+(0|i.words[n.length+h-1]);for(f=Math.min(f/a|0,67108863),i._ishlnsubmul(n,f,h);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(n,1,h),i.isZero()||(i.negative^=1);s&&(s.words[h]=f)}return s&&s.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(n=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:n,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=t.clone();!t.isZero();){for(var f=0,p=1;0===(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(l),a.isub(h)),n.iushrn(1),a.iushrn(1);for(var d=0,g=1;0===(r.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(h)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(s),a.isub(u)):(r.isub(t),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var h=0,f=1;0===(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(n=0===t.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var o=t;t=r,r=o}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return!(1&this.words[0])},o.prototype.isOdd=function(){return!(1&~this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new _(e)},o.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(b,v),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,n=10;n<e.length;n++){var a=0|e.words[n];e.words[n-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[n-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(S,v),n(w,v),n(O,v),O.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new S;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return y[e]=t,t},_.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){i(0===(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,n),f=this.pow(e,n.addn(1).iushrn(1)),p=this.pow(e,n),d=a;0!==p.cmp(s);){for(var g=p,m=0;0!==g.cmp(s);m++)g=g.redSqr();i(m<d);var y=this.pow(h,new o(1).iushln(d-m-1));f=f.redMul(y),h=y.redSqr(),p=p.redMul(h),d=m}return f},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var c=t.words[i],l=u-1;l>=0;l--){var h=c>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==h||0!==a?(a<<=1,a|=h,(4===++s||0===i&&0===l)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new I(e)},n(I,_),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6763(e,t,r){var i=r(5364);e.exports=i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},8287(e,t,r){"use strict";
8
- /*!
9
- * The buffer module from node.js, for the browser.
10
- *
11
- * @author Feross Aboukhadijeh <https://feross.org>
12
- * @license MIT
13
- */const i=r(7526),n=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let i=s(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return u.from(i,t,r);const n=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||X(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return l(e),s(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=s(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,u.prototype),i}function d(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(e).length;default:if(n)return i?-1:G(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return x(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function y(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=u.from(t,i)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){let o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){let i=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===i?0:o-i)){if(-1===i&&(i=o),o-i+1===u)return i*a}else-1!==i&&(o-=o-i),i=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let i=0;i<u;i++)if(c(e,o+i)!==c(t,i)){r=!1;break}if(r)return o}return-1}function S(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const o=t.length;let a;for(i>o/2&&(i=o/2),a=0;a<i;++a){const i=parseInt(t.substr(2*a,2),16);if(X(i))return a;e[r+a]=i}return a}function w(e,t,r,i){return W(G(t,e.length-r),e,r,i)}function O(e,t,r,i){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function _(e,t,r,i){return W(Y(t),e,r,i)}function I(e,t,r,i){return W(function(e,t){let r,i,n;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),i=r>>8,n=r%256,o.push(n),o.push(i);return o}(t,e.length-r),e,r,i)}function E(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(n+a<=r){let r,i,s,u;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[n+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(u=(15&t)<<12|(63&r)<<6|63&i,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[n+1],i=e[n+2],s=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&s)&&(u=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|1023&o),i.push(o),n+=a}return function(e){const t=e.length;if(t<=P)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=P));return r}(i)}t.kMaxLength=a,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=u.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))n+t.length>i.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):m.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,i,n){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(i,n),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){o=c[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},u.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let o=!1;for(;;)switch(i){case"hex":return S(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return O(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function k(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function x(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function T(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=J[e[i]];return n}function R(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function B(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,i,n,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<o)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function C(e,t,r,i,n){K(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,i,n){K(t,i,n,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function H(e,t,r,i,o){return t=+t,r>>>=0,o||M(e,0,r,8),n.write(e,t,r,i,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,u.prototype),i},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return i},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Z(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))}),u.prototype.readBigUInt64BE=Z(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let i=this[e],n=1,o=0;for(;++o<t&&(n*=256);)i+=this[e+o]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);let i=t,n=1,o=this[e+--i];for(;i>0&&(n*=256);)o+=this[e+--i]*n;return n*=128,o>=n&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Z(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),u.prototype.readBigInt64BE=Z(function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),n.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),n.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,o=0;for(this[t]=255&e;++o<r&&(n*=256);)this[t+o]=e/n&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){N(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,o=1;for(this[t+n]=255&e;--n>=0&&(o*=256);)this[t+n]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Z(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=Z(function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}let n=0,o=1,a=0;for(this[t]=255&e;++n<r&&(o*=256);)e<0&&0===a&&0!==this[t+n-1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}let n=r-1,o=1,a=0;for(this[t+n]=255&e;--n>=0&&(o*=256);)e<0&&0===a&&0!==this[t+n+1]&&(a=1),this[t+n]=(e/o|0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Z(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=Z(function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return H(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return H(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,i){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},u.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!u.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const o=u.isBuffer(e)?e:u.from(e,i),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=o[n%a]}return this};const j={};function U(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function K(e,t,r,i,n,o){if(e>r||e<t){const i="bigint"==typeof t?"n":"";let n;throw n=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(o+1)}${i}`:`>= -(2${i} ** ${8*(o+1)-1}${i}) and < 2 ** ${8*(o+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(i,n,o)}function z(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=F(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=F(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i},RangeError);const q=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const i=e.length;let n=null;const o=[];for(let a=0;a<i;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Y(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function W(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function Z(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},3144(e,t,r){"use strict";var i=r(6743),n=r(1002),o=r(76),a=r(7119);e.exports=a||i.call(o,n)},2205(e,t,r){"use strict";var i=r(6743),n=r(1002),o=r(3144);e.exports=function(){return o(i,n,arguments)}},1002(e){"use strict";e.exports=Function.prototype.apply},76(e){"use strict";e.exports=Function.prototype.call},3126(e,t,r){"use strict";var i=r(6743),n=r(9675),o=r(76),a=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new n("a function is required");return a(i,o,e)}},7119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},8075(e,t,r){"use strict";var i=r(453),n=r(487),o=n(i("String.prototype.indexOf"));e.exports=function(e,t){var r=i(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?n(r):r}},487(e,t,r){"use strict";var i=r(6897),n=r(655),o=r(3126),a=r(2205);e.exports=function(e){var t=o(arguments),r=1+e.length-(arguments.length-1);return i(t,r>0?r:0,!0)},n?n(e.exports,"apply",{value:a}):e.exports.apply=a},6556(e,t,r){"use strict";var i=r(453),n=r(3126),o=n([i("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=i(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?n([r]):r}},9155(e,t,r){"use strict";const i=r(4427),n=r(2527),o=r(7128);function a(e,t){switch(n(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||o(e)){const r=new e.constructor;for(let i in e)r[i]=a(e[i],t);return r}return e}(e,t);case"array":return function(e,t){const r=new e.constructor(e.length);for(let i=0;i<e.length;i++)r[i]=a(e[i],t);return r}(e,t);default:return i(e)}}e.exports=a},41(e,t,r){"use strict";var i=r(655),n=r(8068),o=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!a&&a(e,t);if(i)i(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:r,writable:null===u&&h?h.writable:!u});else{if(!l&&(s||u||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},8452(e,t,r){"use strict";var i=r(1189),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=r(41),u=r(592)(),c=function(e,t,r,i){if(t in e)if(!0===i){if(e[t]===r)return}else if("function"!=typeof(n=i)||"[object Function]"!==o.call(n)||!i())return;var n;u?s(e,t,r,!0):s(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},o=i(t);n&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)c(e,o[s],t[o[s]],r[o[s]])};l.supportsDescriptors=!!u,e.exports=l},7176(e,t,r){"use strict";var i,n=r(3126),o=r(5795);try{i=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!i&&o&&o(Object.prototype,"__proto__"),s=Object,u=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?n([a.get]):"function"==typeof u&&function(e){return u(null==e?e:s(e))}},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237(e){"use strict";e.exports=EvalError},9383(e){"use strict";e.exports=Error},9290(e){"use strict";e.exports=RangeError},9538(e){"use strict";e.exports=ReferenceError},8068(e){"use strict";e.exports=SyntaxError},9675(e){"use strict";e.exports=TypeError},5345(e){"use strict";e.exports=URIError},9612(e){"use strict";e.exports=Object},2682(e,t,r){"use strict";var i=r(9600),n=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");var a,s;arguments.length>=3&&(a=r),s=e,"[object Array]"===n.call(s)?function(e,t,r){for(var i=0,n=e.length;i<n;i++)o.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,a):"string"==typeof e?function(e,t,r){for(var i=0,n=e.length;i<n;i++)null==r?t(e.charAt(i),i,e):t.call(r,e.charAt(i),i,e)}(e,t,a):function(e,t,r){for(var i in e)o.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,a)}},9353(e){"use strict";var t=Object.prototype.toString,r=Math.max,i=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var n=0;n<t.length;n+=1)r[n+e.length]=t[n];return r};e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==t.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var o,a=function(e,t){for(var r=[],i=t||0,n=0;i<e.length;i+=1,n+=1)r[n]=e[i];return r}(arguments,1),s=r(0,n.length-a.length),u=[],c=0;c<s;c++)u[c]="$"+c;if(o=Function("binder","return function ("+function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r}(u,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var t=n.apply(this,i(a,arguments));return Object(t)===t?t:this}return n.apply(e,i(a,arguments))}),n.prototype){var l=function(){};l.prototype=n.prototype,o.prototype=new l,l.prototype=null}return o}},6743(e,t,r){"use strict";var i=r(9353);e.exports=Function.prototype.bind||i},4233(e){"use strict";const t=function*(){}.constructor;e.exports=()=>t},453(e,t,r){"use strict";var i,n=r(9612),o=r(9383),a=r(1237),s=r(9290),u=r(9538),c=r(8068),l=r(9675),h=r(5345),f=r(1514),p=r(8968),d=r(6188),g=r(8002),m=r(5880),y=r(414),v=r(3093),b=Function,S=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=r(5795),O=r(655),_=function(){throw new l},I=w?function(){try{return _}catch(e){try{return w(arguments,"callee").get}catch(e){return _}}}():_,E=r(4039)(),A=r(3628),P=r(1064),k=r(8648),x=r(1002),T=r(76),R={},B="undefined"!=typeof Uint8Array&&A?A(Uint8Array):i,N={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":E&&A?A([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":R,"%AsyncGenerator%":R,"%AsyncGeneratorFunction%":R,"%AsyncIteratorPrototype%":R,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":R,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":E&&A?A(A([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&E&&A?A((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&E&&A?A((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":E&&A?A(""[Symbol.iterator]()):i,"%Symbol%":E?Symbol:i,"%SyntaxError%":c,"%ThrowTypeError%":I,"%TypedArray%":B,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":h,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":T,"%Function.prototype.apply%":x,"%Object.defineProperty%":O,"%Object.getPrototypeOf%":P,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":d,"%Math.min%":g,"%Math.pow%":m,"%Math.round%":y,"%Math.sign%":v,"%Reflect.getPrototypeOf%":k};if(A)try{null.error}catch(e){var C=A(A(e));N["%Error.prototype%"]=C}var D=function e(t){var r;if("%AsyncFunction%"===t)r=S("async function () {}");else if("%GeneratorFunction%"===t)r=S("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=S("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&A&&(r=A(n.prototype))}return N[t]=r,r},M={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},L=r(6743),H=r(9957),j=L.call(T,Array.prototype.concat),U=L.call(x,Array.prototype.splice),F=L.call(T,String.prototype.replace),K=L.call(T,String.prototype.slice),z=L.call(T,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,G=function(e,t){var r,i=e;if(H(M,i)&&(i="%"+(r=M[i])[0]+"%"),H(N,i)){var n=N[i];if(n===R&&(n=D(i)),void 0===n&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===z(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=K(e,0,1),r=K(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var i=[];return F(e,V,function(e,t,r,n){i[i.length]=r?F(n,q,"$1"):t||e}),i}(e),i=r.length>0?r[0]:"",n=G("%"+i+"%",t),o=n.name,a=n.value,s=!1,u=n.alias;u&&(i=u[0],U(r,j([0,1],u)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=K(p,0,1),g=K(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===g||"'"===g||"`"===g)&&d!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==p&&f||(s=!0),H(N,o="%"+(i+="."+p)+"%"))a=N[o];else if(null!=a){if(!(p in a)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&h+1>=r.length){var m=w(a,p);a=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:a[p]}else f=H(a,p),a=a[p];f&&!s&&(N[o]=a)}}return a}},1064(e,t,r){"use strict";var i=r(9612);e.exports=i.getPrototypeOf||null},8648(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},3628(e,t,r){"use strict";var i=r(8648),n=r(1064),o=r(7176);e.exports=i?function(e){return i(e)}:n?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return n(e)}:o?function(e){return o(e)}:null},6549(e){"use strict";e.exports=Object.getOwnPropertyDescriptor},5795(e,t,r){"use strict";var i=r(6549);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},592(e,t,r){"use strict";var i=r(655),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(e){return!0}},e.exports=n},4039(e,t,r){"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(1333);e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},1333(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},9092(e,t,r){"use strict";var i=r(1333);e.exports=function(){return i()&&!!Symbol.toStringTag}},7952(e,t,r){var i=t;i.utils=r(7426),i.common=r(6166),i.sha=r(6229),i.ripemd=r(6784),i.hmac=r(8948),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},6166(e,t,r){"use strict";var i=r(7426),n=r(3349);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o<this.padLength;o++)i[n++]=0;return i}},8948(e,t,r){"use strict";var i=r(7426),n=r(3349);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},6784(e,t,r){"use strict";var i=r(7426),n=r(6166),o=i.rotl32,a=i.sum32,s=i.sum32_3,u=i.sum32_4,c=n.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function h(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function f(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function p(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],c=this.h[3],l=this.h[4],v=r,b=i,S=n,w=c,O=l,_=0;_<80;_++){var I=a(o(u(r,h(_,i,n,c),e[d[_]+t],f(_)),m[_]),l);r=l,l=c,c=o(n,10),n=i,i=I,I=a(o(u(v,h(79-_,b,S,w),e[g[_]+t],p(_)),y[_]),O),v=O,O=w,w=o(S,10),S=b,b=I}I=s(this.h[1],n,w),this.h[1]=s(this.h[2],c,O),this.h[2]=s(this.h[3],l,v),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],i,S),this.h[0]=I},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},6229(e,t,r){"use strict";t.sha1=r(3917),t.sha224=r(7714),t.sha256=r(2287),t.sha384=r(1911),t.sha512=r(7766)},3917(e,t,r){"use strict";var i=r(7426),n=r(6166),o=r(6225),a=i.rotl32,s=i.sum32,u=i.sum32_5,c=o.ft_1,l=n.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(f,l),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=a(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],o=this.h[1],l=this.h[2],f=this.h[3],p=this.h[4];for(i=0;i<r.length;i++){var d=~~(i/20),g=u(a(n,5),c(d,o,l,f),p,r[i],h[d]);p=f,f=l,l=a(o,30),o=n,n=g}this.h[0]=s(this.h[0],n),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],l),this.h[3]=s(this.h[3],f),this.h[4]=s(this.h[4],p)},f.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},7714(e,t,r){"use strict";var i=r(7426),n=r(2287);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},2287(e,t,r){"use strict";var i=r(7426),n=r(6166),o=r(6225),a=r(3349),s=i.sum32,u=i.sum32_4,c=i.sum32_5,l=o.ch32,h=o.maj32,f=o.s0_256,p=o.s1_256,d=o.g0_256,g=o.g1_256,m=n.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function v(){if(!(this instanceof v))return new v;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}i.inherits(v,m),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=u(g(r[i-2]),r[i-7],d(r[i-15]),r[i-16]);var n=this.h[0],o=this.h[1],m=this.h[2],y=this.h[3],v=this.h[4],b=this.h[5],S=this.h[6],w=this.h[7];for(a(this.k.length===r.length),i=0;i<r.length;i++){var O=c(w,p(v),l(v,b,S),this.k[i],r[i]),_=s(f(n),h(n,o,m));w=S,S=b,b=v,v=s(y,O),y=m,m=o,o=n,n=s(O,_)}this.h[0]=s(this.h[0],n),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],v),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],S),this.h[7]=s(this.h[7],w)},v.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},1911(e,t,r){"use strict";var i=r(7426),n=r(7766);function o(){if(!(this instanceof o))return new o;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(o,n),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},7766(e,t,r){"use strict";var i=r(7426),n=r(6166),o=r(3349),a=i.rotr64_hi,s=i.rotr64_lo,u=i.shr64_hi,c=i.shr64_lo,l=i.sum64,h=i.sum64_hi,f=i.sum64_lo,p=i.sum64_4_hi,d=i.sum64_4_lo,g=i.sum64_5_hi,m=i.sum64_5_lo,y=n.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function S(e,t,r,i,n){var o=e&r^~e&n;return o<0&&(o+=4294967296),o}function w(e,t,r,i,n,o){var a=t&i^~t&o;return a<0&&(a+=4294967296),a}function O(e,t,r,i,n){var o=e&r^e&n^r&n;return o<0&&(o+=4294967296),o}function _(e,t,r,i,n,o){var a=t&i^t&o^i&o;return a<0&&(a+=4294967296),a}function I(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function E(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(b,y),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=T(r[i-4],r[i-3]),o=R(r[i-4],r[i-3]),a=r[i-14],s=r[i-13],u=k(r[i-30],r[i-29]),c=x(r[i-30],r[i-29]),l=r[i-32],h=r[i-31];r[i]=p(n,o,a,s,u,c,l,h),r[i+1]=d(n,o,a,s,u,c,l,h)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],p=this.h[6],d=this.h[7],y=this.h[8],v=this.h[9],b=this.h[10],k=this.h[11],x=this.h[12],T=this.h[13],R=this.h[14],B=this.h[15];o(this.k.length===r.length);for(var N=0;N<r.length;N+=2){var C=R,D=B,M=A(y,v),L=P(y,v),H=S(y,v,b,k,x),j=w(y,v,b,k,x,T),U=this.k[N],F=this.k[N+1],K=r[N],z=r[N+1],V=g(C,D,M,L,H,j,U,F,K,z),q=m(C,D,M,L,H,j,U,F,K,z);C=I(i,n),D=E(i,n),M=O(i,n,a,s,u),L=_(i,n,a,s,u,c);var G=h(C,D,M,L),Y=f(C,D,M,L);R=x,B=T,x=b,T=k,b=y,k=v,y=h(p,d,V,q),v=f(d,d,V,q),p=u,d=c,u=a,c=s,a=i,s=n,i=h(V,q,G,Y),n=f(V,q,G,Y)}l(this.h,0,i,n),l(this.h,2,a,s),l(this.h,4,u,c),l(this.h,6,p,d),l(this.h,8,y,v),l(this.h,10,b,k),l(this.h,12,x,T),l(this.h,14,R,B)},b.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},6225(e,t,r){"use strict";var i=r(7426).rotr32;function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?a(t,r,i):2===e?o(t,r,i):void 0},t.ch32=n,t.maj32=o,t.p32=a,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},7426(e,t,r){"use strict";var i=r(3349),n=r(6698);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=n,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var a=e.charCodeAt(n);a<128?r[i++]=a:a<2048?(r[i++]=a>>6|192,r[i++]=63&a|128):o(e,n)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128,r[i++]=a>>6&63|128,r[i++]=63&a|128):(r[i++]=a>>12|224,r[i++]=a>>6&63|128,r[i++]=63&a|128)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=a(n)),r+=u(n.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,n){var o=r-t;i(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===n?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var o=e[i];"big"===t?(r[n]=o>>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o<i?1:0)+r+n;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+n+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},t.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,h=t;return l+=(h=h+i>>>0)<t?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+s>>>0)<s?1:0,e+r+n+a+u+(l+=(h=h+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},9957(e,t,r){"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,o=r(6743);e.exports=o.call(i,n)},251(e,t){
14
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
15
- t.read=function(e,t,r,i,n){var o,a,s=8*n-i-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?n-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=i;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),o-=c}return(p?-1:1)*a*Math.pow(2,o-i)},t.write=function(e,t,r,i,n,o){var a,s,u,c=8*o-n-1,l=(1<<c)-1,h=l>>1,f=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,d=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*u-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[r+p]=255&s,p+=d,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;e[r+p]=255&a,p+=d,a/=256,c-=8);e[r+p-d]|=128*g}},6698(e){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},7244(e,t,r){"use strict";var i=r(9092)(),n=r(6556)("Object.prototype.toString"),o=function(e){return!(i&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"callee"in e&&"[object Function]"===n(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},9600(e){"use strict";var t,r,i=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n(function(){throw 42},null,t)}catch(e){e!==r&&(n=null)}else n=null;var o=/^\s*class\b/,a=function(e){try{var t=i.call(e);return o.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(i.call(e),!0)}catch(e){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=n?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{n(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return s(e);if(a(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},8184(e,t,r){"use strict";var i=r(6556),n=r(9721)(/^\s*(?:function)?\*/),o=r(9092)(),a=r(3628),s=i("Object.prototype.toString"),u=i("Function.prototype.toString"),c=r(9294).c;e.exports=function(e){if("function"!=typeof e)return!1;if(n(u(e)))return!0;if(!o)return"[object GeneratorFunction]"===s(e);if(!a)return!1;var t=c();return t&&a(e)===t.prototype}},3003(e){"use strict";e.exports=function(e){return e!=e}},4133(e,t,r){"use strict";var i=r(487),n=r(8452),o=r(3003),a=r(6642),s=r(2464),u=i(a(),Number);n(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},6642(e,t,r){"use strict";var i=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:i}},2464(e,t,r){"use strict";var i=r(8452),n=r(6642);e.exports=function(){var e=n();return i(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},7128(e,t,r){"use strict";
16
- /*!
17
- * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
18
- *
19
- * Copyright (c) 2014-2017, Jon Schlinkert.
20
- * Released under the MIT License.
21
- */var i=r(3798);function n(e){return!0===i(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}},4035(e,t,r){"use strict";var i,n=r(6556),o=r(9092)(),a=r(9957),s=r(5795);if(o){var u=n("RegExp.prototype.exec"),c={},l=function(){throw c},h={toString:l,valueOf:l};"symbol"==typeof Symbol.toPrimitive&&(h[Symbol.toPrimitive]=l),i=function(e){if(!e||"object"!=typeof e)return!1;var t=s(e,"lastIndex");if(!(t&&a(t,"value")))return!1;try{u(e,h)}catch(e){return e===c}}}else{var f=n("Object.prototype.toString");i=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===f(e)}}e.exports=i},5680(e,t,r){"use strict";var i=r(5767);e.exports=function(e){return!!i(e)}},3798(e){"use strict";
22
- /*!
23
- * isobject <https://github.com/jonschlinkert/isobject>
24
- *
25
- * Copyright (c) 2014-2017, Jon Schlinkert.
26
- * Released under the MIT License.
27
- */e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},2527(e){var t=Object.prototype.toString;function r(e){return"function"==typeof e.constructor?e.constructor.name:null}e.exports=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var i=typeof e;if("boolean"===i)return"boolean";if("string"===i)return"string";if("number"===i)return"number";if("symbol"===i)return"symbol";if("function"===i)return"GeneratorFunction"===r(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(r(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(i=t.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return i.slice(8,-1).toLowerCase().replace(/\s/g,"")}},1514(e){"use strict";e.exports=Math.abs},8968(e){"use strict";e.exports=Math.floor},4459(e){"use strict";e.exports=Number.isNaN||function(e){return e!=e}},6188(e){"use strict";e.exports=Math.max},8002(e){"use strict";e.exports=Math.min},5880(e){"use strict";e.exports=Math.pow},414(e){"use strict";e.exports=Math.round},3093(e,t,r){"use strict";var i=r(4459);e.exports=function(e){return i(e)||0===e?e:e<0?-1:1}},3349(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},9211(e){"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7653(e,t,r){"use strict";var i=r(8452),n=r(487),o=r(9211),a=r(9394),s=r(6576),u=n(a(),Object);i(u,{getPolyfill:a,implementation:o,shim:s}),e.exports=u},9394(e,t,r){"use strict";var i=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:i}},6576(e,t,r){"use strict";var i=r(9394),n=r(8452);e.exports=function(){var e=i();return n(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8875(e,t,r){"use strict";var i;if(!Object.keys){var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(1093),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();i=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),i=a(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var d=c&&r;if(s&&e.length>0&&!n.call(e,0))for(var g=0;g<e.length;++g)f.push(String(g));if(i&&e.length>0)for(var m=0;m<e.length;++m)f.push(String(m));else for(var y in e)d&&"prototype"===y||!n.call(e,y)||f.push(String(y));if(u)for(var v=function(e){if("undefined"==typeof window||!p)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)v&&"constructor"===l[b]||!n.call(e,l[b])||f.push(l[b]);return f}}e.exports=i},1189(e,t,r){"use strict";var i=Array.prototype.slice,n=r(1093),o=Object.keys,a=o?function(e){return o(e)}:r(8875),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return n(e)?s(i.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},1093(e){"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),i="[object Arguments]"===r;return i||(i="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),i}},8403(e,t,r){"use strict";var i=r(1189),n=r(1333)(),o=r(6556),a=r(9612),s=o("Array.prototype.push"),u=o("Object.prototype.propertyIsEnumerable"),c=n?a.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=a(e);if(1===arguments.length)return r;for(var o=1;o<arguments.length;++o){var l=a(arguments[o]),h=i(l),f=n&&(a.getOwnPropertySymbols||c);if(f)for(var p=f(l),d=0;d<p.length;++d){var g=p[d];u(l,g)&&s(h,g)}for(var m=0;m<h.length;++m){var y=h[m];if(u(l,y)){var v=l[y];r[y]=v}}}return r}},9133(e,t,r){"use strict";var i=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},i=0;i<t.length;++i)r[t[i]]=t[i];var n=Object.assign({},r),o="";for(var a in n)o+=a;return e!==o}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?i:Object.assign:i}},6578(e){"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606(e){var t,r,i=e.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(e){t=n}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var e=a(h);c=!0;for(var t=u.length;t;){for(s=u,u=[];++l<t;)s&&s[l].run();l=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];u.push(new p(e,t)),1!==u.length||c||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=d,i.addListener=d,i.once=d,i.off=d,i.removeListener=d,i.removeAllListeners=d,i.emit=d,i.prependListener=d,i.prependOnceListener=d,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},2861(e,t,r){
28
- /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
29
- var i=r(8287),n=i.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(o(i,t),t.Buffer=a),a.prototype=Object.create(n.prototype),o(n,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},9721(e,t,r){"use strict";var i=r(6556),n=r(4035),o=i("RegExp.prototype.exec"),a=r(9675);e.exports=function(e){if(!n(e))throw new a("`regex` must be a RegExp");return function(t){return null!==o(e,t)}}},8015(e,t){var r;// @preserve author Alexander Stetsyuk
30
- // @preserve author Glenn Rempe <glenn@rempe.us>
31
- // @license MIT
32
- !function(i){"use strict";void 0===(r=function(){return i.secrets=function(e){var t,r,i,n,o;function a(){t={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},r={},i=new Array(1024).join("0"),n=!0,o=["nodeCryptoRandomBytes","browserCryptoGetRandomValues","testRandom"]}function s(){return!(!r||!r.rng||"function"!=typeof r.rng)}function u(e,t){var n;if(0===t||1===t)return e;if(t&&t>1024)throw new Error("Padding must be multiples of no larger than 1024 bits.");return t=t||r.bits,e&&(n=e.length%t),n?(i+e).slice(-(t-n+e.length)):e}function c(e){var t,r,i="";for(r=e.length-1;r>=0;r--){if(t=parseInt(e[r],16),isNaN(t))throw new Error("Invalid hex character.");i=u(t.toString(2),4)+i}return i}function l(e){var t,r,i="";for(r=(e=u(e,4)).length;r>=4;r-=4){if(t=parseInt(e.slice(r-4,r),2),isNaN(t))throw new Error("Invalid binary character.");i=t.toString(16)+i}return i}function h(){return!(!e||"object"!=typeof e||"function"!=typeof e.getRandomValues&&"object"!=typeof e.getRandomValues||"function"!=typeof Uint32Array&&"object"!=typeof Uint32Array)}function f(){return"object"==typeof e&&"function"==typeof e.randomBytes}function p(t){function i(e,t,r,i){var n,o=0,a="";for(t&&(n=t.length-1);o<n||a.length<e;)a+=u(Math.abs(parseInt(t[o],r)).toString(2),i),o++;return((a=a.substr(-e)).match(/0/g)||[]).length===a.length?null:a}function n(t){var r,n,o,a=null;for(n=16,o=4,r=Math.ceil(t/8);null===a;)a=i(t,e.randomBytes(r).toString("hex"),n,o);return a}function o(t){var r,n,o,a=null;for(n=10,o=32,r=Math.ceil(t/32);null===a;)a=i(t,e.getRandomValues(new Uint32Array(r)),n,o);return a}function a(e){var t,r,n,o,a,s=null;o=10,a=32,r=Math.ceil(e/32),n=123456789,t=new Uint32Array(r);for(var u=0;u<t.length;u++)t[u]=n;for(;null===s;)s=i(e,t,o,a);return s}return t&&"testRandom"===t?(r.typeCSPRNG=t,a):t&&"nodeCryptoRandomBytes"===t?(r.typeCSPRNG=t,n):t&&"browserCryptoGetRandomValues"===t?(r.typeCSPRNG=t,o):f()?(r.typeCSPRNG="nodeCryptoRandomBytes",n):h()?(r.typeCSPRNG="browserCryptoGetRandomValues",o):void 0}function d(e,t){var i,n=[];for(t&&(e=u(e,t)),i=e.length;i>r.bits;i-=r.bits)n.push(parseInt(e.slice(i-r.bits,i),2));return n.push(parseInt(e.slice(0,i),2)),n}function g(e,t){var i,n=r.logs[e],o=0;for(i=t.length-1;i>=0;i--)o=0!==o?r.exps[(n+r.logs[o])%r.maxShares]^t[i]:t[i];return o}function m(e,t,i){var n,o,a,s,u=0;for(a=0,n=t.length;a<n;a++)if(i[a]){for(o=r.logs[i[a]],s=0;s<n;s++)if(a!==s){if(e===t[s]){o=-1;break}o=(o+r.logs[e^t[s]]-r.logs[t[a]^t[s]]+r.maxShares)%r.maxShares}u=-1===o?u:u^r.exps[o]}return u}function y(e,t,i){var n,o,a=[],s=[e];for(n=1;n<i;n++)s[n]=parseInt(r.rng(r.bits),2);for(n=1,o=t+1;n<o;n++)a[n-1]={x:n,y:g(n,s)};return a}function v(e,t,i){var n,o,a,s;if(t=parseInt(t,r.radix),n=(e=parseInt(e,10)||r.bits).toString(36).toUpperCase(),s=(a=Math.pow(2,e)-1).toString(r.radix).length,o=u(t.toString(r.radix),s),"number"!=typeof t||t%1!=0||t<1||t>a)throw new Error("Share id must be an integer between 1 and "+a+", inclusive.");return n+o+i}var b={init:function(e,i){var n,u,c=[],l=[],h=1;if(a(),e&&("number"!=typeof e||e%1!=0||e<t.minBits||e>t.maxBits))throw new Error("Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(i&&-1===o.indexOf(i))throw new Error("Invalid RNG type argument : '"+i+"'");for(r.radix=t.radix,r.bits=e||t.bits,r.size=Math.pow(2,r.bits),r.maxShares=r.size-1,n=t.primitivePolynomials[r.bits],u=0;u<r.size;u++)l[u]=h,c[h]=u,(h<<=1)>=r.size&&(h^=n,h&=r.maxShares);if(r.logs=c,r.exps=l,i&&this.setRNG(i),s()||this.setRNG(),!(s()&&r.bits&&r.size&&r.maxShares&&r.logs&&r.exps&&r.logs.length===r.size&&r.exps.length===r.size))throw new Error("Initialization failed.")},combine:function(e,t){var i,n,o,a,s,h,f,p="",g=[],y=[];for(t=t||0,i=0,o=e.length;i<o;i++){if(h=this.extractShareComponents(e[i]),void 0===s)s=h.bits;else if(h.bits!==s)throw new Error("Mismatched shares: Different bit settings.");if(r.bits!==s&&this.init(s),-1===g.indexOf(h.id))for(g.push(h.id),n=0,a=(f=d(c(h.data))).length;n<a;n++)y[n]=y[n]||[],y[n][g.length-1]=f[n]}for(i=0,o=y.length;i<o;i++)p=u(m(t,g,y[i]).toString(2))+p;return l(t>=1?p:p.slice(p.indexOf("1")+1))},getConfig:function(){var e={};return e.radix=r.radix,e.bits=r.bits,e.maxShares=r.maxShares,e.hasCSPRNG=s(),e.typeCSPRNG=r.typeCSPRNG,e},extractShareComponents:function(e){var i,n,o,a,s,u={};if((i=parseInt(e.substr(0,1),36))&&("number"!=typeof i||i%1!=0||i<t.minBits||i>t.maxBits))throw new Error("Invalid share : Number of bits must be an integer between "+t.minBits+" and "+t.maxBits+", inclusive.");if(a=Math.pow(2,i)-1,o=(Math.pow(2,i)-1).toString(r.radix).length,(s=new RegExp("^([a-kA-K3-9]{1})([a-fA-F0-9]{"+o+"})([a-fA-F0-9]+)$").exec(e))&&(n=parseInt(s[2],r.radix)),"number"!=typeof n||n%1!=0||n<1||n>a)throw new Error("Invalid share : Share id must be an integer between 1 and "+r.maxShares+", inclusive.");if(s&&s[3])return u.bits=i,u.id=n,u.data=s[3],u;throw new Error("The share data provided is invalid : "+e)},setRNG:function(e){var t="Random number generator is invalid ",i=" Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.";if(e&&"string"==typeof e&&-1===o.indexOf(e))throw new Error("Invalid RNG type argument : '"+e+"'");if(e||(e=p()),e&&"string"==typeof e&&(e=p(e)),n){if(e&&"function"!=typeof e)throw new Error(t+"(Not a function)."+i);if(e&&"string"!=typeof e(r.bits))throw new Error(t+"(Output is not a string)."+i);if(e&&!parseInt(e(r.bits),2))throw new Error(t+"(Binary string output not parseable to an Integer)."+i);if(e&&e(r.bits).length>r.bits)throw new Error(t+"(Output length is greater than config.bits)."+i);if(e&&e(r.bits).length<r.bits)throw new Error(t+"(Output length is less than config.bits)."+i)}return r.rng=e,!0},str2hex:function(e,r){var i,n,o,a,s,c,l="";if("string"!=typeof e)throw new Error("Input must be a character string.");if(r||(r=t.bytesPerChar),"number"!=typeof r||r<1||r>t.maxBytesPerChar||r%1!=0)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(i=2*r,n=Math.pow(16,i)-1,s=0,c=e.length;s<c;s++){if(a=e[s].charCodeAt(),isNaN(a))throw new Error("Invalid character: "+e[s]);if(a>n)throw o=Math.ceil(Math.log(a+1)/Math.log(256)),new Error("Invalid character code ("+a+"). Maximum allowable is 256^bytes-1 ("+n+"). To convert this character, use at least "+o+" bytes.");l=u(a.toString(16),i)+l}return l},hex2str:function(e,r){var i,n,o,a="";if("string"!=typeof e)throw new Error("Input must be a hexadecimal string.");if("number"!=typeof(r=r||t.bytesPerChar)||r%1!=0||r<1||r>t.maxBytesPerChar)throw new Error("Bytes per character must be an integer between 1 and "+t.maxBytesPerChar+", inclusive.");for(n=0,o=(e=u(e,i=2*r)).length;n<o;n+=i)a=String.fromCharCode(parseInt(e.slice(n,n+i),16))+a;return a},random:function(e){if("number"!=typeof e||e%1!=0||e<2||e>65536)throw new Error("Number of bits must be an Integer between 1 and 65536.");return l(r.rng(e))},share:function(e,t,i,n){var o,a,s,h,f,p=new Array(t),g=new Array(t);if(n=n||128,"string"!=typeof e)throw new Error("Secret must be a string.");if("number"!=typeof t||t%1!=0||t<2)throw new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(t>r.maxShares)throw o=Math.ceil(Math.log(t+1)/Math.LN2),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To create "+t+" shares, use at least "+o+" bits.");if("number"!=typeof i||i%1!=0||i<2)throw new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive.");if(i>r.maxShares)throw o=Math.ceil(Math.log(i+1)/Math.LN2),new Error("Threshold number of shares must be an integer between 2 and 2^bits-1 ("+r.maxShares+"), inclusive. To use a threshold of "+i+", use at least "+o+" bits.");if(i>t)throw new Error("Threshold number of shares was "+i+" but must be less than or equal to the "+t+" shares specified as the total to generate.");if("number"!=typeof n||n%1!=0||n<0||n>1024)throw new Error("Zero-pad length must be an integer between 0 and 1024 inclusive.");for(s=0,f=(e=d(e="1"+c(e),n)).length;s<f;s++)for(a=y(e[s],t,i),h=0;h<t;h++)p[h]=p[h]||a[h].x.toString(r.radix),g[h]=u(a[h].y.toString(2))+(g[h]||"");for(s=0;s<t;s++)p[s]=v(r.bits,p[s],l(g[s]));return p},newShare:function(e,t){var i;if(e&&"string"==typeof e&&(e=parseInt(e,r.radix)),i=e.toString(r.radix),e&&i&&t&&t[0])return v(this.extractShareComponents(t[0]).bits,i,this.combine(t,e));throw new Error("Invalid 'id' or 'shares' Array argument to newShare().")},_reset:a,_padLeft:u,_hex2bin:c,_bin2hex:l,_hasCryptoGetRandomValues:h,_hasCryptoRandomBytes:f,_getRNG:p,_isSetRNG:s,_splitNumStringToIntArray:d,_horner:g,_lagrange:m,_getShares:y,_constructPublicShareString:v};return b.init(),b}()}.apply(t,[]))||(e.exports=r)}(this)},6897(e,t,r){"use strict";var i=r(453),n=r(41),o=r(592)(),a=r(5795),s=r(9675),u=i("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||u(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,c=!0;if("length"in e&&a){var l=a(e,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(c=!1)}return(i||c||!r)&&(o?n(e,"length",t,!0,!0):n(e,"length",t)),e}},4427(e,t,r){"use strict";var i=r(8287).Buffer;
33
- /*!
34
- * shallow-clone <https://github.com/jonschlinkert/shallow-clone>
35
- *
36
- * Copyright (c) 2015-present, Jon Schlinkert.
37
- * Released under the MIT License.
38
- */const n=Symbol.prototype.valueOf,o=r(2527);e.exports=function(e,t){switch(o(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return function(e){const t=e.length,r=i.allocUnsafe?i.allocUnsafe(t):i.from(t);return e.copy(r),r}(e);case"symbol":return function(e){return n?Object(n.call(e)):{}}(e);case"arraybuffer":return function(e){const t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(e){return new e.constructor(e.buffer,e.byteOffset,e.length)}(e);case"regexp":return function(e){const t=void 0!==e.flags?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}(e);case"error":return Object.create(e);default:return e}}},7063(e){!function(){"use strict";for(var t=[null,0,{}],r=44032,i=4352,n=function(e,t){this.codepoint=e,this.feature=t},o={},a=[],s=0;s<=255;++s)a[s]=0;var u=[function(e,r,i){return r<60||13311<r&&r<42607?new n(r,t):e(r,i)},function(e,t,r){var i=o[t];return i||(i=e(t,r)).feature&&++a[t>>8&255]>10&&(o[t]=i),i},function(e,t,r){return r?e(t,r):new n(t,null)},function(e,t,o){var a;if(t<i||4371<=t&&t<r||55204<t)return e(t,o);if(i<=t&&t<4371){var s={},u=21*(t-i);for(a=0;a<21;++a)s[4449+a]=r+28*(a+u);return new n(t,[,,s])}var c=t-r,l=c%28,h=[];if(0!==l)h[0]=[r+c-l,4519+l];else for(h[0]=[i+Math.floor(c/588),4449+Math.floor(c%588/28)],h[2]={},a=1;a<28;++a)h[2][4519+a]=t+a;return new n(t,h)},function(e,r,i){var o=(n.udata[65280&r]||{})[r];return new n(r,o||t)}];n.fromCharCode=u.reduceRight(function(e,t){return function(r,i){return t(e,r,i)}},null),n.isHighSurrogate=function(e){return e>=55296&&e<=56319},n.isLowSurrogate=function(e){return e>=56320&&e<=57343},n.prototype.prepFeature=function(){this.feature||(this.feature=n.fromCharCode(this.codepoint,!0).feature)},n.prototype.toString=function(){if(this.codepoint<65536)return String.fromCharCode(this.codepoint);var e=this.codepoint-65536;return String.fromCharCode(Math.floor(e/1024)+55296,e%1024+56320)},n.prototype.getDecomp=function(){return this.prepFeature(),this.feature[0]||null},n.prototype.isCompatibility=function(){return this.prepFeature(),!!this.feature[1]&&256&this.feature[1]},n.prototype.isExclude=function(){return this.prepFeature(),!!this.feature[1]&&512&this.feature[1]},n.prototype.getCanonicalClass=function(){return this.prepFeature(),this.feature[1]?255&this.feature[1]:0},n.prototype.getComposite=function(e){if(this.prepFeature(),!this.feature[2])return null;var t=this.feature[2][e.codepoint];return t?n.fromCharCode(t):null};var c=function(e){this.str=e,this.cursor=0};c.prototype.next=function(){if(this.str&&this.cursor<this.str.length){var e,t=this.str.charCodeAt(this.cursor++);return n.isHighSurrogate(t)&&this.cursor<this.str.length&&n.isLowSurrogate(e=this.str.charCodeAt(this.cursor))&&(t=1024*(t-55296)+(e-56320)+65536,++this.cursor),n.fromCharCode(t)}return this.str=null,null};var l=function(e,t){this.it=e,this.canonical=t,this.resBuf=[]};l.prototype.next=function(){if(0===this.resBuf.length){var e=this.it.next();if(!e)return null;this.resBuf=function e(t,r){var i=r.getDecomp();if(!i||t&&r.isCompatibility())return[r];for(var o=[],a=0;a<i.length;++a){var s=e(t,n.fromCharCode(i[a]));o=o.concat(s)}return o}(this.canonical,e)}return this.resBuf.shift()};var h=function(e){this.it=e,this.resBuf=[]};h.prototype.next=function(){var e;if(0===this.resBuf.length)do{var t=this.it.next();if(!t)break;e=t.getCanonicalClass();var r=this.resBuf.length;if(0!==e)for(;r>0;--r){if(this.resBuf[r-1].getCanonicalClass()<=e)break}this.resBuf.splice(r,0,t)}while(0!==e);return this.resBuf.shift()};var f=function(e){this.it=e,this.procBuf=[],this.resBuf=[],this.lastClass=null};f.prototype.next=function(){for(;0===this.resBuf.length;){var e=this.it.next();if(!e){this.resBuf=this.procBuf,this.procBuf=[];break}if(0===this.procBuf.length)this.lastClass=e.getCanonicalClass(),this.procBuf.push(e);else{var t=this.procBuf[0].getComposite(e),r=e.getCanonicalClass();t&&(this.lastClass<r||0===this.lastClass)?this.procBuf[0]=t:(0===r&&(this.resBuf=this.procBuf,this.procBuf=[]),this.lastClass=r,this.procBuf.push(e))}}return this.resBuf.shift()};var p=function(e,t){for(var r,i=function(e,t){switch(e){case"NFD":return new h(new l(new c(t),!0));case"NFKD":return new h(new l(new c(t),!1));case"NFC":return new f(new h(new l(new c(t),!0)));case"NFKC":return new f(new h(new l(new c(t),!1)))}throw e+" is invalid"}(e,t),n="";r=i.next();)n+=r.toString();return n};n.udata={0:{60:[,,{824:8814}],61:[,,{824:8800}],62:[,,{824:8815}],65:[,,{768:192,769:193,770:194,771:195,772:256,774:258,775:550,776:196,777:7842,778:197,780:461,783:512,785:514,803:7840,805:7680,808:260}],66:[,,{775:7682,803:7684,817:7686}],67:[,,{769:262,770:264,775:266,780:268,807:199}],68:[,,{775:7690,780:270,803:7692,807:7696,813:7698,817:7694}],69:[,,{768:200,769:201,770:202,771:7868,772:274,774:276,775:278,776:203,777:7866,780:282,783:516,785:518,803:7864,807:552,808:280,813:7704,816:7706}],70:[,,{775:7710}],71:[,,{769:500,770:284,772:7712,774:286,775:288,780:486,807:290}],72:[,,{770:292,775:7714,776:7718,780:542,803:7716,807:7720,814:7722}],73:[,,{768:204,769:205,770:206,771:296,772:298,774:300,775:304,776:207,777:7880,780:463,783:520,785:522,803:7882,808:302,816:7724}],74:[,,{770:308}],75:[,,{769:7728,780:488,803:7730,807:310,817:7732}],76:[,,{769:313,780:317,803:7734,807:315,813:7740,817:7738}],77:[,,{769:7742,775:7744,803:7746}],78:[,,{768:504,769:323,771:209,775:7748,780:327,803:7750,807:325,813:7754,817:7752}],79:[,,{768:210,769:211,770:212,771:213,772:332,774:334,775:558,776:214,777:7886,779:336,780:465,783:524,785:526,795:416,803:7884,808:490}],80:[,,{769:7764,775:7766}],82:[,,{769:340,775:7768,780:344,783:528,785:530,803:7770,807:342,817:7774}],83:[,,{769:346,770:348,775:7776,780:352,803:7778,806:536,807:350}],84:[,,{775:7786,780:356,803:7788,806:538,807:354,813:7792,817:7790}],85:[,,{768:217,769:218,770:219,771:360,772:362,774:364,776:220,777:7910,778:366,779:368,780:467,783:532,785:534,795:431,803:7908,804:7794,808:370,813:7798,816:7796}],86:[,,{771:7804,803:7806}],87:[,,{768:7808,769:7810,770:372,775:7814,776:7812,803:7816}],88:[,,{775:7818,776:7820}],89:[,,{768:7922,769:221,770:374,771:7928,772:562,775:7822,776:376,777:7926,803:7924}],90:[,,{769:377,770:7824,775:379,780:381,803:7826,817:7828}],97:[,,{768:224,769:225,770:226,771:227,772:257,774:259,775:551,776:228,777:7843,778:229,780:462,783:513,785:515,803:7841,805:7681,808:261}],98:[,,{775:7683,803:7685,817:7687}],99:[,,{769:263,770:265,775:267,780:269,807:231}],100:[,,{775:7691,780:271,803:7693,807:7697,813:7699,817:7695}],101:[,,{768:232,769:233,770:234,771:7869,772:275,774:277,775:279,776:235,777:7867,780:283,783:517,785:519,803:7865,807:553,808:281,813:7705,816:7707}],102:[,,{775:7711}],103:[,,{769:501,770:285,772:7713,774:287,775:289,780:487,807:291}],104:[,,{770:293,775:7715,776:7719,780:543,803:7717,807:7721,814:7723,817:7830}],105:[,,{768:236,769:237,770:238,771:297,772:299,774:301,776:239,777:7881,780:464,783:521,785:523,803:7883,808:303,816:7725}],106:[,,{770:309,780:496}],107:[,,{769:7729,780:489,803:7731,807:311,817:7733}],108:[,,{769:314,780:318,803:7735,807:316,813:7741,817:7739}],109:[,,{769:7743,775:7745,803:7747}],110:[,,{768:505,769:324,771:241,775:7749,780:328,803:7751,807:326,813:7755,817:7753}],111:[,,{768:242,769:243,770:244,771:245,772:333,774:335,775:559,776:246,777:7887,779:337,780:466,783:525,785:527,795:417,803:7885,808:491}],112:[,,{769:7765,775:7767}],114:[,,{769:341,775:7769,780:345,783:529,785:531,803:7771,807:343,817:7775}],115:[,,{769:347,770:349,775:7777,780:353,803:7779,806:537,807:351}],116:[,,{775:7787,776:7831,780:357,803:7789,806:539,807:355,813:7793,817:7791}],117:[,,{768:249,769:250,770:251,771:361,772:363,774:365,776:252,777:7911,778:367,779:369,780:468,783:533,785:535,795:432,803:7909,804:7795,808:371,813:7799,816:7797}],118:[,,{771:7805,803:7807}],119:[,,{768:7809,769:7811,770:373,775:7815,776:7813,778:7832,803:7817}],120:[,,{775:7819,776:7821}],121:[,,{768:7923,769:253,770:375,771:7929,772:563,775:7823,776:255,777:7927,778:7833,803:7925}],122:[,,{769:378,770:7825,775:380,780:382,803:7827,817:7829}],160:[[32],256],168:[[32,776],256,{768:8173,769:901,834:8129}],170:[[97],256],175:[[32,772],256],178:[[50],256],179:[[51],256],180:[[32,769],256],181:[[956],256],184:[[32,807],256],185:[[49],256],186:[[111],256],188:[[49,8260,52],256],189:[[49,8260,50],256],190:[[51,8260,52],256],192:[[65,768]],193:[[65,769]],194:[[65,770],,{768:7846,769:7844,771:7850,777:7848}],195:[[65,771]],196:[[65,776],,{772:478}],197:[[65,778],,{769:506}],198:[,,{769:508,772:482}],199:[[67,807],,{769:7688}],200:[[69,768]],201:[[69,769]],202:[[69,770],,{768:7872,769:7870,771:7876,777:7874}],203:[[69,776]],204:[[73,768]],205:[[73,769]],206:[[73,770]],207:[[73,776],,{769:7726}],209:[[78,771]],210:[[79,768]],211:[[79,769]],212:[[79,770],,{768:7890,769:7888,771:7894,777:7892}],213:[[79,771],,{769:7756,772:556,776:7758}],214:[[79,776],,{772:554}],216:[,,{769:510}],217:[[85,768]],218:[[85,769]],219:[[85,770]],220:[[85,776],,{768:475,769:471,772:469,780:473}],221:[[89,769]],224:[[97,768]],225:[[97,769]],226:[[97,770],,{768:7847,769:7845,771:7851,777:7849}],227:[[97,771]],228:[[97,776],,{772:479}],229:[[97,778],,{769:507}],230:[,,{769:509,772:483}],231:[[99,807],,{769:7689}],232:[[101,768]],233:[[101,769]],234:[[101,770],,{768:7873,769:7871,771:7877,777:7875}],235:[[101,776]],236:[[105,768]],237:[[105,769]],238:[[105,770]],239:[[105,776],,{769:7727}],241:[[110,771]],242:[[111,768]],243:[[111,769]],244:[[111,770],,{768:7891,769:7889,771:7895,777:7893}],245:[[111,771],,{769:7757,772:557,776:7759}],246:[[111,776],,{772:555}],248:[,,{769:511}],249:[[117,768]],250:[[117,769]],251:[[117,770]],252:[[117,776],,{768:476,769:472,772:470,780:474}],253:[[121,769]],255:[[121,776]]},256:{256:[[65,772]],257:[[97,772]],258:[[65,774],,{768:7856,769:7854,771:7860,777:7858}],259:[[97,774],,{768:7857,769:7855,771:7861,777:7859}],260:[[65,808]],261:[[97,808]],262:[[67,769]],263:[[99,769]],264:[[67,770]],265:[[99,770]],266:[[67,775]],267:[[99,775]],268:[[67,780]],269:[[99,780]],270:[[68,780]],271:[[100,780]],274:[[69,772],,{768:7700,769:7702}],275:[[101,772],,{768:7701,769:7703}],276:[[69,774]],277:[[101,774]],278:[[69,775]],279:[[101,775]],280:[[69,808]],281:[[101,808]],282:[[69,780]],283:[[101,780]],284:[[71,770]],285:[[103,770]],286:[[71,774]],287:[[103,774]],288:[[71,775]],289:[[103,775]],290:[[71,807]],291:[[103,807]],292:[[72,770]],293:[[104,770]],296:[[73,771]],297:[[105,771]],298:[[73,772]],299:[[105,772]],300:[[73,774]],301:[[105,774]],302:[[73,808]],303:[[105,808]],304:[[73,775]],306:[[73,74],256],307:[[105,106],256],308:[[74,770]],309:[[106,770]],310:[[75,807]],311:[[107,807]],313:[[76,769]],314:[[108,769]],315:[[76,807]],316:[[108,807]],317:[[76,780]],318:[[108,780]],319:[[76,183],256],320:[[108,183],256],323:[[78,769]],324:[[110,769]],325:[[78,807]],326:[[110,807]],327:[[78,780]],328:[[110,780]],329:[[700,110],256],332:[[79,772],,{768:7760,769:7762}],333:[[111,772],,{768:7761,769:7763}],334:[[79,774]],335:[[111,774]],336:[[79,779]],337:[[111,779]],340:[[82,769]],341:[[114,769]],342:[[82,807]],343:[[114,807]],344:[[82,780]],345:[[114,780]],346:[[83,769],,{775:7780}],347:[[115,769],,{775:7781}],348:[[83,770]],349:[[115,770]],350:[[83,807]],351:[[115,807]],352:[[83,780],,{775:7782}],353:[[115,780],,{775:7783}],354:[[84,807]],355:[[116,807]],356:[[84,780]],357:[[116,780]],360:[[85,771],,{769:7800}],361:[[117,771],,{769:7801}],362:[[85,772],,{776:7802}],363:[[117,772],,{776:7803}],364:[[85,774]],365:[[117,774]],366:[[85,778]],367:[[117,778]],368:[[85,779]],369:[[117,779]],370:[[85,808]],371:[[117,808]],372:[[87,770]],373:[[119,770]],374:[[89,770]],375:[[121,770]],376:[[89,776]],377:[[90,769]],378:[[122,769]],379:[[90,775]],380:[[122,775]],381:[[90,780]],382:[[122,780]],383:[[115],256,{775:7835}],416:[[79,795],,{768:7900,769:7898,771:7904,777:7902,803:7906}],417:[[111,795],,{768:7901,769:7899,771:7905,777:7903,803:7907}],431:[[85,795],,{768:7914,769:7912,771:7918,777:7916,803:7920}],432:[[117,795],,{768:7915,769:7913,771:7919,777:7917,803:7921}],439:[,,{780:494}],452:[[68,381],256],453:[[68,382],256],454:[[100,382],256],455:[[76,74],256],456:[[76,106],256],457:[[108,106],256],458:[[78,74],256],459:[[78,106],256],460:[[110,106],256],461:[[65,780]],462:[[97,780]],463:[[73,780]],464:[[105,780]],465:[[79,780]],466:[[111,780]],467:[[85,780]],468:[[117,780]],469:[[220,772]],470:[[252,772]],471:[[220,769]],472:[[252,769]],473:[[220,780]],474:[[252,780]],475:[[220,768]],476:[[252,768]],478:[[196,772]],479:[[228,772]],480:[[550,772]],481:[[551,772]],482:[[198,772]],483:[[230,772]],486:[[71,780]],487:[[103,780]],488:[[75,780]],489:[[107,780]],490:[[79,808],,{772:492}],491:[[111,808],,{772:493}],492:[[490,772]],493:[[491,772]],494:[[439,780]],495:[[658,780]],496:[[106,780]],497:[[68,90],256],498:[[68,122],256],499:[[100,122],256],500:[[71,769]],501:[[103,769]],504:[[78,768]],505:[[110,768]],506:[[197,769]],507:[[229,769]],508:[[198,769]],509:[[230,769]],510:[[216,769]],511:[[248,769]],66045:[,220]},512:{512:[[65,783]],513:[[97,783]],514:[[65,785]],515:[[97,785]],516:[[69,783]],517:[[101,783]],518:[[69,785]],519:[[101,785]],520:[[73,783]],521:[[105,783]],522:[[73,785]],523:[[105,785]],524:[[79,783]],525:[[111,783]],526:[[79,785]],527:[[111,785]],528:[[82,783]],529:[[114,783]],530:[[82,785]],531:[[114,785]],532:[[85,783]],533:[[117,783]],534:[[85,785]],535:[[117,785]],536:[[83,806]],537:[[115,806]],538:[[84,806]],539:[[116,806]],542:[[72,780]],543:[[104,780]],550:[[65,775],,{772:480}],551:[[97,775],,{772:481}],552:[[69,807],,{774:7708}],553:[[101,807],,{774:7709}],554:[[214,772]],555:[[246,772]],556:[[213,772]],557:[[245,772]],558:[[79,775],,{772:560}],559:[[111,775],,{772:561}],560:[[558,772]],561:[[559,772]],562:[[89,772]],563:[[121,772]],658:[,,{780:495}],688:[[104],256],689:[[614],256],690:[[106],256],691:[[114],256],692:[[633],256],693:[[635],256],694:[[641],256],695:[[119],256],696:[[121],256],728:[[32,774],256],729:[[32,775],256],730:[[32,778],256],731:[[32,808],256],732:[[32,771],256],733:[[32,779],256],736:[[611],256],737:[[108],256],738:[[115],256],739:[[120],256],740:[[661],256],66272:[,220]},768:{768:[,230],769:[,230],770:[,230],771:[,230],772:[,230],773:[,230],774:[,230],775:[,230],776:[,230,{769:836}],777:[,230],778:[,230],779:[,230],780:[,230],781:[,230],782:[,230],783:[,230],784:[,230],785:[,230],786:[,230],787:[,230],788:[,230],789:[,232],790:[,220],791:[,220],792:[,220],793:[,220],794:[,232],795:[,216],796:[,220],797:[,220],798:[,220],799:[,220],800:[,220],801:[,202],802:[,202],803:[,220],804:[,220],805:[,220],806:[,220],807:[,202],808:[,202],809:[,220],810:[,220],811:[,220],812:[,220],813:[,220],814:[,220],815:[,220],816:[,220],817:[,220],818:[,220],819:[,220],820:[,1],821:[,1],822:[,1],823:[,1],824:[,1],825:[,220],826:[,220],827:[,220],828:[,220],829:[,230],830:[,230],831:[,230],832:[[768],230],833:[[769],230],834:[,230],835:[[787],230],836:[[776,769],230],837:[,240],838:[,230],839:[,220],840:[,220],841:[,220],842:[,230],843:[,230],844:[,230],845:[,220],846:[,220],848:[,230],849:[,230],850:[,230],851:[,220],852:[,220],853:[,220],854:[,220],855:[,230],856:[,232],857:[,220],858:[,220],859:[,230],860:[,233],861:[,234],862:[,234],863:[,233],864:[,234],865:[,234],866:[,233],867:[,230],868:[,230],869:[,230],870:[,230],871:[,230],872:[,230],873:[,230],874:[,230],875:[,230],876:[,230],877:[,230],878:[,230],879:[,230],884:[[697]],890:[[32,837],256],894:[[59]],900:[[32,769],256],901:[[168,769]],902:[[913,769]],903:[[183]],904:[[917,769]],905:[[919,769]],906:[[921,769]],908:[[927,769]],910:[[933,769]],911:[[937,769]],912:[[970,769]],913:[,,{768:8122,769:902,772:8121,774:8120,787:7944,788:7945,837:8124}],917:[,,{768:8136,769:904,787:7960,788:7961}],919:[,,{768:8138,769:905,787:7976,788:7977,837:8140}],921:[,,{768:8154,769:906,772:8153,774:8152,776:938,787:7992,788:7993}],927:[,,{768:8184,769:908,787:8008,788:8009}],929:[,,{788:8172}],933:[,,{768:8170,769:910,772:8169,774:8168,776:939,788:8025}],937:[,,{768:8186,769:911,787:8040,788:8041,837:8188}],938:[[921,776]],939:[[933,776]],940:[[945,769],,{837:8116}],941:[[949,769]],942:[[951,769],,{837:8132}],943:[[953,769]],944:[[971,769]],945:[,,{768:8048,769:940,772:8113,774:8112,787:7936,788:7937,834:8118,837:8115}],949:[,,{768:8050,769:941,787:7952,788:7953}],951:[,,{768:8052,769:942,787:7968,788:7969,834:8134,837:8131}],953:[,,{768:8054,769:943,772:8145,774:8144,776:970,787:7984,788:7985,834:8150}],959:[,,{768:8056,769:972,787:8e3,788:8001}],961:[,,{787:8164,788:8165}],965:[,,{768:8058,769:973,772:8161,774:8160,776:971,787:8016,788:8017,834:8166}],969:[,,{768:8060,769:974,787:8032,788:8033,834:8182,837:8179}],970:[[953,776],,{768:8146,769:912,834:8151}],971:[[965,776],,{768:8162,769:944,834:8167}],972:[[959,769]],973:[[965,769]],974:[[969,769],,{837:8180}],976:[[946],256],977:[[952],256],978:[[933],256,{769:979,776:980}],979:[[978,769]],980:[[978,776]],981:[[966],256],982:[[960],256],1008:[[954],256],1009:[[961],256],1010:[[962],256],1012:[[920],256],1013:[[949],256],1017:[[931],256],66422:[,230],66423:[,230],66424:[,230],66425:[,230],66426:[,230]},1024:{1024:[[1045,768]],1025:[[1045,776]],1027:[[1043,769]],1030:[,,{776:1031}],1031:[[1030,776]],1036:[[1050,769]],1037:[[1048,768]],1038:[[1059,774]],1040:[,,{774:1232,776:1234}],1043:[,,{769:1027}],1045:[,,{768:1024,774:1238,776:1025}],1046:[,,{774:1217,776:1244}],1047:[,,{776:1246}],1048:[,,{768:1037,772:1250,774:1049,776:1252}],1049:[[1048,774]],1050:[,,{769:1036}],1054:[,,{776:1254}],1059:[,,{772:1262,774:1038,776:1264,779:1266}],1063:[,,{776:1268}],1067:[,,{776:1272}],1069:[,,{776:1260}],1072:[,,{774:1233,776:1235}],1075:[,,{769:1107}],1077:[,,{768:1104,774:1239,776:1105}],1078:[,,{774:1218,776:1245}],1079:[,,{776:1247}],1080:[,,{768:1117,772:1251,774:1081,776:1253}],1081:[[1080,774]],1082:[,,{769:1116}],1086:[,,{776:1255}],1091:[,,{772:1263,774:1118,776:1265,779:1267}],1095:[,,{776:1269}],1099:[,,{776:1273}],1101:[,,{776:1261}],1104:[[1077,768]],1105:[[1077,776]],1107:[[1075,769]],1110:[,,{776:1111}],1111:[[1110,776]],1116:[[1082,769]],1117:[[1080,768]],1118:[[1091,774]],1140:[,,{783:1142}],1141:[,,{783:1143}],1142:[[1140,783]],1143:[[1141,783]],1155:[,230],1156:[,230],1157:[,230],1158:[,230],1159:[,230],1217:[[1046,774]],1218:[[1078,774]],1232:[[1040,774]],1233:[[1072,774]],1234:[[1040,776]],1235:[[1072,776]],1238:[[1045,774]],1239:[[1077,774]],1240:[,,{776:1242}],1241:[,,{776:1243}],1242:[[1240,776]],1243:[[1241,776]],1244:[[1046,776]],1245:[[1078,776]],1246:[[1047,776]],1247:[[1079,776]],1250:[[1048,772]],1251:[[1080,772]],1252:[[1048,776]],1253:[[1080,776]],1254:[[1054,776]],1255:[[1086,776]],1256:[,,{776:1258}],1257:[,,{776:1259}],1258:[[1256,776]],1259:[[1257,776]],1260:[[1069,776]],1261:[[1101,776]],1262:[[1059,772]],1263:[[1091,772]],1264:[[1059,776]],1265:[[1091,776]],1266:[[1059,779]],1267:[[1091,779]],1268:[[1063,776]],1269:[[1095,776]],1272:[[1067,776]],1273:[[1099,776]]},1280:{1415:[[1381,1410],256],1425:[,220],1426:[,230],1427:[,230],1428:[,230],1429:[,230],1430:[,220],1431:[,230],1432:[,230],1433:[,230],1434:[,222],1435:[,220],1436:[,230],1437:[,230],1438:[,230],1439:[,230],1440:[,230],1441:[,230],1442:[,220],1443:[,220],1444:[,220],1445:[,220],1446:[,220],1447:[,220],1448:[,230],1449:[,230],1450:[,220],1451:[,230],1452:[,230],1453:[,222],1454:[,228],1455:[,230],1456:[,10],1457:[,11],1458:[,12],1459:[,13],1460:[,14],1461:[,15],1462:[,16],1463:[,17],1464:[,18],1465:[,19],1466:[,19],1467:[,20],1468:[,21],1469:[,22],1471:[,23],1473:[,24],1474:[,25],1476:[,230],1477:[,220],1479:[,18]},1536:{1552:[,230],1553:[,230],1554:[,230],1555:[,230],1556:[,230],1557:[,230],1558:[,230],1559:[,230],1560:[,30],1561:[,31],1562:[,32],1570:[[1575,1619]],1571:[[1575,1620]],1572:[[1608,1620]],1573:[[1575,1621]],1574:[[1610,1620]],1575:[,,{1619:1570,1620:1571,1621:1573}],1608:[,,{1620:1572}],1610:[,,{1620:1574}],1611:[,27],1612:[,28],1613:[,29],1614:[,30],1615:[,31],1616:[,32],1617:[,33],1618:[,34],1619:[,230],1620:[,230],1621:[,220],1622:[,220],1623:[,230],1624:[,230],1625:[,230],1626:[,230],1627:[,230],1628:[,220],1629:[,230],1630:[,230],1631:[,220],1648:[,35],1653:[[1575,1652],256],1654:[[1608,1652],256],1655:[[1735,1652],256],1656:[[1610,1652],256],1728:[[1749,1620]],1729:[,,{1620:1730}],1730:[[1729,1620]],1746:[,,{1620:1747}],1747:[[1746,1620]],1749:[,,{1620:1728}],1750:[,230],1751:[,230],1752:[,230],1753:[,230],1754:[,230],1755:[,230],1756:[,230],1759:[,230],1760:[,230],1761:[,230],1762:[,230],1763:[,220],1764:[,230],1767:[,230],1768:[,230],1770:[,220],1771:[,230],1772:[,230],1773:[,220]},1792:{1809:[,36],1840:[,230],1841:[,220],1842:[,230],1843:[,230],1844:[,220],1845:[,230],1846:[,230],1847:[,220],1848:[,220],1849:[,220],1850:[,230],1851:[,220],1852:[,220],1853:[,230],1854:[,220],1855:[,230],1856:[,230],1857:[,230],1858:[,220],1859:[,230],1860:[,220],1861:[,230],1862:[,220],1863:[,230],1864:[,220],1865:[,230],1866:[,230],2027:[,230],2028:[,230],2029:[,230],2030:[,230],2031:[,230],2032:[,230],2033:[,230],2034:[,220],2035:[,230]},2048:{2070:[,230],2071:[,230],2072:[,230],2073:[,230],2075:[,230],2076:[,230],2077:[,230],2078:[,230],2079:[,230],2080:[,230],2081:[,230],2082:[,230],2083:[,230],2085:[,230],2086:[,230],2087:[,230],2089:[,230],2090:[,230],2091:[,230],2092:[,230],2093:[,230],2137:[,220],2138:[,220],2139:[,220],2276:[,230],2277:[,230],2278:[,220],2279:[,230],2280:[,230],2281:[,220],2282:[,230],2283:[,230],2284:[,230],2285:[,220],2286:[,220],2287:[,220],2288:[,27],2289:[,28],2290:[,29],2291:[,230],2292:[,230],2293:[,230],2294:[,220],2295:[,230],2296:[,230],2297:[,220],2298:[,220],2299:[,230],2300:[,230],2301:[,230],2302:[,230],2303:[,230]},2304:{2344:[,,{2364:2345}],2345:[[2344,2364]],2352:[,,{2364:2353}],2353:[[2352,2364]],2355:[,,{2364:2356}],2356:[[2355,2364]],2364:[,7],2381:[,9],2385:[,230],2386:[,220],2387:[,230],2388:[,230],2392:[[2325,2364],512],2393:[[2326,2364],512],2394:[[2327,2364],512],2395:[[2332,2364],512],2396:[[2337,2364],512],2397:[[2338,2364],512],2398:[[2347,2364],512],2399:[[2351,2364],512],2492:[,7],2503:[,,{2494:2507,2519:2508}],2507:[[2503,2494]],2508:[[2503,2519]],2509:[,9],2524:[[2465,2492],512],2525:[[2466,2492],512],2527:[[2479,2492],512]},2560:{2611:[[2610,2620],512],2614:[[2616,2620],512],2620:[,7],2637:[,9],2649:[[2582,2620],512],2650:[[2583,2620],512],2651:[[2588,2620],512],2654:[[2603,2620],512],2748:[,7],2765:[,9],68109:[,220],68111:[,230],68152:[,230],68153:[,1],68154:[,220],68159:[,9],68325:[,230],68326:[,220]},2816:{2876:[,7],2887:[,,{2878:2891,2902:2888,2903:2892}],2888:[[2887,2902]],2891:[[2887,2878]],2892:[[2887,2903]],2893:[,9],2908:[[2849,2876],512],2909:[[2850,2876],512],2962:[,,{3031:2964}],2964:[[2962,3031]],3014:[,,{3006:3018,3031:3020}],3015:[,,{3006:3019}],3018:[[3014,3006]],3019:[[3015,3006]],3020:[[3014,3031]],3021:[,9]},3072:{3142:[,,{3158:3144}],3144:[[3142,3158]],3149:[,9],3157:[,84],3158:[,91],3260:[,7],3263:[,,{3285:3264}],3264:[[3263,3285]],3270:[,,{3266:3274,3285:3271,3286:3272}],3271:[[3270,3285]],3272:[[3270,3286]],3274:[[3270,3266],,{3285:3275}],3275:[[3274,3285]],3277:[,9]},3328:{3398:[,,{3390:3402,3415:3404}],3399:[,,{3390:3403}],3402:[[3398,3390]],3403:[[3399,3390]],3404:[[3398,3415]],3405:[,9],3530:[,9],3545:[,,{3530:3546,3535:3548,3551:3550}],3546:[[3545,3530]],3548:[[3545,3535],,{3530:3549}],3549:[[3548,3530]],3550:[[3545,3551]]},3584:{3635:[[3661,3634],256],3640:[,103],3641:[,103],3642:[,9],3656:[,107],3657:[,107],3658:[,107],3659:[,107],3763:[[3789,3762],256],3768:[,118],3769:[,118],3784:[,122],3785:[,122],3786:[,122],3787:[,122],3804:[[3755,3737],256],3805:[[3755,3745],256]},3840:{3852:[[3851],256],3864:[,220],3865:[,220],3893:[,220],3895:[,220],3897:[,216],3907:[[3906,4023],512],3917:[[3916,4023],512],3922:[[3921,4023],512],3927:[[3926,4023],512],3932:[[3931,4023],512],3945:[[3904,4021],512],3953:[,129],3954:[,130],3955:[[3953,3954],512],3956:[,132],3957:[[3953,3956],512],3958:[[4018,3968],512],3959:[[4018,3969],256],3960:[[4019,3968],512],3961:[[4019,3969],256],3962:[,130],3963:[,130],3964:[,130],3965:[,130],3968:[,130],3969:[[3953,3968],512],3970:[,230],3971:[,230],3972:[,9],3974:[,230],3975:[,230],3987:[[3986,4023],512],3997:[[3996,4023],512],4002:[[4001,4023],512],4007:[[4006,4023],512],4012:[[4011,4023],512],4025:[[3984,4021],512],4038:[,220]},4096:{4133:[,,{4142:4134}],4134:[[4133,4142]],4151:[,7],4153:[,9],4154:[,9],4237:[,220],4348:[[4316],256],69702:[,9],69759:[,9],69785:[,,{69818:69786}],69786:[[69785,69818]],69787:[,,{69818:69788}],69788:[[69787,69818]],69797:[,,{69818:69803}],69803:[[69797,69818]],69817:[,9],69818:[,7]},4352:{69888:[,230],69889:[,230],69890:[,230],69934:[[69937,69927]],69935:[[69938,69927]],69937:[,,{69927:69934}],69938:[,,{69927:69935}],69939:[,9],69940:[,9],70003:[,7],70080:[,9]},4608:{70197:[,9],70198:[,7],70377:[,7],70378:[,9]},4864:{4957:[,230],4958:[,230],4959:[,230],70460:[,7],70471:[,,{70462:70475,70487:70476}],70475:[[70471,70462]],70476:[[70471,70487]],70477:[,9],70502:[,230],70503:[,230],70504:[,230],70505:[,230],70506:[,230],70507:[,230],70508:[,230],70512:[,230],70513:[,230],70514:[,230],70515:[,230],70516:[,230]},5120:{70841:[,,{70832:70844,70842:70843,70845:70846}],70843:[[70841,70842]],70844:[[70841,70832]],70846:[[70841,70845]],70850:[,9],70851:[,7]},5376:{71096:[,,{71087:71098}],71097:[,,{71087:71099}],71098:[[71096,71087]],71099:[[71097,71087]],71103:[,9],71104:[,7]},5632:{71231:[,9],71350:[,9],71351:[,7]},5888:{5908:[,9],5940:[,9],6098:[,9],6109:[,230]},6144:{6313:[,228]},6400:{6457:[,222],6458:[,230],6459:[,220]},6656:{6679:[,230],6680:[,220],6752:[,9],6773:[,230],6774:[,230],6775:[,230],6776:[,230],6777:[,230],6778:[,230],6779:[,230],6780:[,230],6783:[,220],6832:[,230],6833:[,230],6834:[,230],6835:[,230],6836:[,230],6837:[,220],6838:[,220],6839:[,220],6840:[,220],6841:[,220],6842:[,220],6843:[,230],6844:[,230],6845:[,220]},6912:{6917:[,,{6965:6918}],6918:[[6917,6965]],6919:[,,{6965:6920}],6920:[[6919,6965]],6921:[,,{6965:6922}],6922:[[6921,6965]],6923:[,,{6965:6924}],6924:[[6923,6965]],6925:[,,{6965:6926}],6926:[[6925,6965]],6929:[,,{6965:6930}],6930:[[6929,6965]],6964:[,7],6970:[,,{6965:6971}],6971:[[6970,6965]],6972:[,,{6965:6973}],6973:[[6972,6965]],6974:[,,{6965:6976}],6975:[,,{6965:6977}],6976:[[6974,6965]],6977:[[6975,6965]],6978:[,,{6965:6979}],6979:[[6978,6965]],6980:[,9],7019:[,230],7020:[,220],7021:[,230],7022:[,230],7023:[,230],7024:[,230],7025:[,230],7026:[,230],7027:[,230],7082:[,9],7083:[,9],7142:[,7],7154:[,9],7155:[,9]},7168:{7223:[,7],7376:[,230],7377:[,230],7378:[,230],7380:[,1],7381:[,220],7382:[,220],7383:[,220],7384:[,220],7385:[,220],7386:[,230],7387:[,230],7388:[,220],7389:[,220],7390:[,220],7391:[,220],7392:[,230],7394:[,1],7395:[,1],7396:[,1],7397:[,1],7398:[,1],7399:[,1],7400:[,1],7405:[,220],7412:[,230],7416:[,230],7417:[,230]},7424:{7468:[[65],256],7469:[[198],256],7470:[[66],256],7472:[[68],256],7473:[[69],256],7474:[[398],256],7475:[[71],256],7476:[[72],256],7477:[[73],256],7478:[[74],256],7479:[[75],256],7480:[[76],256],7481:[[77],256],7482:[[78],256],7484:[[79],256],7485:[[546],256],7486:[[80],256],7487:[[82],256],7488:[[84],256],7489:[[85],256],7490:[[87],256],7491:[[97],256],7492:[[592],256],7493:[[593],256],7494:[[7426],256],7495:[[98],256],7496:[[100],256],7497:[[101],256],7498:[[601],256],7499:[[603],256],7500:[[604],256],7501:[[103],256],7503:[[107],256],7504:[[109],256],7505:[[331],256],7506:[[111],256],7507:[[596],256],7508:[[7446],256],7509:[[7447],256],7510:[[112],256],7511:[[116],256],7512:[[117],256],7513:[[7453],256],7514:[[623],256],7515:[[118],256],7516:[[7461],256],7517:[[946],256],7518:[[947],256],7519:[[948],256],7520:[[966],256],7521:[[967],256],7522:[[105],256],7523:[[114],256],7524:[[117],256],7525:[[118],256],7526:[[946],256],7527:[[947],256],7528:[[961],256],7529:[[966],256],7530:[[967],256],7544:[[1085],256],7579:[[594],256],7580:[[99],256],7581:[[597],256],7582:[[240],256],7583:[[604],256],7584:[[102],256],7585:[[607],256],7586:[[609],256],7587:[[613],256],7588:[[616],256],7589:[[617],256],7590:[[618],256],7591:[[7547],256],7592:[[669],256],7593:[[621],256],7594:[[7557],256],7595:[[671],256],7596:[[625],256],7597:[[624],256],7598:[[626],256],7599:[[627],256],7600:[[628],256],7601:[[629],256],7602:[[632],256],7603:[[642],256],7604:[[643],256],7605:[[427],256],7606:[[649],256],7607:[[650],256],7608:[[7452],256],7609:[[651],256],7610:[[652],256],7611:[[122],256],7612:[[656],256],7613:[[657],256],7614:[[658],256],7615:[[952],256],7616:[,230],7617:[,230],7618:[,220],7619:[,230],7620:[,230],7621:[,230],7622:[,230],7623:[,230],7624:[,230],7625:[,230],7626:[,220],7627:[,230],7628:[,230],7629:[,234],7630:[,214],7631:[,220],7632:[,202],7633:[,230],7634:[,230],7635:[,230],7636:[,230],7637:[,230],7638:[,230],7639:[,230],7640:[,230],7641:[,230],7642:[,230],7643:[,230],7644:[,230],7645:[,230],7646:[,230],7647:[,230],7648:[,230],7649:[,230],7650:[,230],7651:[,230],7652:[,230],7653:[,230],7654:[,230],7655:[,230],7656:[,230],7657:[,230],7658:[,230],7659:[,230],7660:[,230],7661:[,230],7662:[,230],7663:[,230],7664:[,230],7665:[,230],7666:[,230],7667:[,230],7668:[,230],7669:[,230],7676:[,233],7677:[,220],7678:[,230],7679:[,220]},7680:{7680:[[65,805]],7681:[[97,805]],7682:[[66,775]],7683:[[98,775]],7684:[[66,803]],7685:[[98,803]],7686:[[66,817]],7687:[[98,817]],7688:[[199,769]],7689:[[231,769]],7690:[[68,775]],7691:[[100,775]],7692:[[68,803]],7693:[[100,803]],7694:[[68,817]],7695:[[100,817]],7696:[[68,807]],7697:[[100,807]],7698:[[68,813]],7699:[[100,813]],7700:[[274,768]],7701:[[275,768]],7702:[[274,769]],7703:[[275,769]],7704:[[69,813]],7705:[[101,813]],7706:[[69,816]],7707:[[101,816]],7708:[[552,774]],7709:[[553,774]],7710:[[70,775]],7711:[[102,775]],7712:[[71,772]],7713:[[103,772]],7714:[[72,775]],7715:[[104,775]],7716:[[72,803]],7717:[[104,803]],7718:[[72,776]],7719:[[104,776]],7720:[[72,807]],7721:[[104,807]],7722:[[72,814]],7723:[[104,814]],7724:[[73,816]],7725:[[105,816]],7726:[[207,769]],7727:[[239,769]],7728:[[75,769]],7729:[[107,769]],7730:[[75,803]],7731:[[107,803]],7732:[[75,817]],7733:[[107,817]],7734:[[76,803],,{772:7736}],7735:[[108,803],,{772:7737}],7736:[[7734,772]],7737:[[7735,772]],7738:[[76,817]],7739:[[108,817]],7740:[[76,813]],7741:[[108,813]],7742:[[77,769]],7743:[[109,769]],7744:[[77,775]],7745:[[109,775]],7746:[[77,803]],7747:[[109,803]],7748:[[78,775]],7749:[[110,775]],7750:[[78,803]],7751:[[110,803]],7752:[[78,817]],7753:[[110,817]],7754:[[78,813]],7755:[[110,813]],7756:[[213,769]],7757:[[245,769]],7758:[[213,776]],7759:[[245,776]],7760:[[332,768]],7761:[[333,768]],7762:[[332,769]],7763:[[333,769]],7764:[[80,769]],7765:[[112,769]],7766:[[80,775]],7767:[[112,775]],7768:[[82,775]],7769:[[114,775]],7770:[[82,803],,{772:7772}],7771:[[114,803],,{772:7773}],7772:[[7770,772]],7773:[[7771,772]],7774:[[82,817]],7775:[[114,817]],7776:[[83,775]],7777:[[115,775]],7778:[[83,803],,{775:7784}],7779:[[115,803],,{775:7785}],7780:[[346,775]],7781:[[347,775]],7782:[[352,775]],7783:[[353,775]],7784:[[7778,775]],7785:[[7779,775]],7786:[[84,775]],7787:[[116,775]],7788:[[84,803]],7789:[[116,803]],7790:[[84,817]],7791:[[116,817]],7792:[[84,813]],7793:[[116,813]],7794:[[85,804]],7795:[[117,804]],7796:[[85,816]],7797:[[117,816]],7798:[[85,813]],7799:[[117,813]],7800:[[360,769]],7801:[[361,769]],7802:[[362,776]],7803:[[363,776]],7804:[[86,771]],7805:[[118,771]],7806:[[86,803]],7807:[[118,803]],7808:[[87,768]],7809:[[119,768]],7810:[[87,769]],7811:[[119,769]],7812:[[87,776]],7813:[[119,776]],7814:[[87,775]],7815:[[119,775]],7816:[[87,803]],7817:[[119,803]],7818:[[88,775]],7819:[[120,775]],7820:[[88,776]],7821:[[120,776]],7822:[[89,775]],7823:[[121,775]],7824:[[90,770]],7825:[[122,770]],7826:[[90,803]],7827:[[122,803]],7828:[[90,817]],7829:[[122,817]],7830:[[104,817]],7831:[[116,776]],7832:[[119,778]],7833:[[121,778]],7834:[[97,702],256],7835:[[383,775]],7840:[[65,803],,{770:7852,774:7862}],7841:[[97,803],,{770:7853,774:7863}],7842:[[65,777]],7843:[[97,777]],7844:[[194,769]],7845:[[226,769]],7846:[[194,768]],7847:[[226,768]],7848:[[194,777]],7849:[[226,777]],7850:[[194,771]],7851:[[226,771]],7852:[[7840,770]],7853:[[7841,770]],7854:[[258,769]],7855:[[259,769]],7856:[[258,768]],7857:[[259,768]],7858:[[258,777]],7859:[[259,777]],7860:[[258,771]],7861:[[259,771]],7862:[[7840,774]],7863:[[7841,774]],7864:[[69,803],,{770:7878}],7865:[[101,803],,{770:7879}],7866:[[69,777]],7867:[[101,777]],7868:[[69,771]],7869:[[101,771]],7870:[[202,769]],7871:[[234,769]],7872:[[202,768]],7873:[[234,768]],7874:[[202,777]],7875:[[234,777]],7876:[[202,771]],7877:[[234,771]],7878:[[7864,770]],7879:[[7865,770]],7880:[[73,777]],7881:[[105,777]],7882:[[73,803]],7883:[[105,803]],7884:[[79,803],,{770:7896}],7885:[[111,803],,{770:7897}],7886:[[79,777]],7887:[[111,777]],7888:[[212,769]],7889:[[244,769]],7890:[[212,768]],7891:[[244,768]],7892:[[212,777]],7893:[[244,777]],7894:[[212,771]],7895:[[244,771]],7896:[[7884,770]],7897:[[7885,770]],7898:[[416,769]],7899:[[417,769]],7900:[[416,768]],7901:[[417,768]],7902:[[416,777]],7903:[[417,777]],7904:[[416,771]],7905:[[417,771]],7906:[[416,803]],7907:[[417,803]],7908:[[85,803]],7909:[[117,803]],7910:[[85,777]],7911:[[117,777]],7912:[[431,769]],7913:[[432,769]],7914:[[431,768]],7915:[[432,768]],7916:[[431,777]],7917:[[432,777]],7918:[[431,771]],7919:[[432,771]],7920:[[431,803]],7921:[[432,803]],7922:[[89,768]],7923:[[121,768]],7924:[[89,803]],7925:[[121,803]],7926:[[89,777]],7927:[[121,777]],7928:[[89,771]],7929:[[121,771]]},7936:{7936:[[945,787],,{768:7938,769:7940,834:7942,837:8064}],7937:[[945,788],,{768:7939,769:7941,834:7943,837:8065}],7938:[[7936,768],,{837:8066}],7939:[[7937,768],,{837:8067}],7940:[[7936,769],,{837:8068}],7941:[[7937,769],,{837:8069}],7942:[[7936,834],,{837:8070}],7943:[[7937,834],,{837:8071}],7944:[[913,787],,{768:7946,769:7948,834:7950,837:8072}],7945:[[913,788],,{768:7947,769:7949,834:7951,837:8073}],7946:[[7944,768],,{837:8074}],7947:[[7945,768],,{837:8075}],7948:[[7944,769],,{837:8076}],7949:[[7945,769],,{837:8077}],7950:[[7944,834],,{837:8078}],7951:[[7945,834],,{837:8079}],7952:[[949,787],,{768:7954,769:7956}],7953:[[949,788],,{768:7955,769:7957}],7954:[[7952,768]],7955:[[7953,768]],7956:[[7952,769]],7957:[[7953,769]],7960:[[917,787],,{768:7962,769:7964}],7961:[[917,788],,{768:7963,769:7965}],7962:[[7960,768]],7963:[[7961,768]],7964:[[7960,769]],7965:[[7961,769]],7968:[[951,787],,{768:7970,769:7972,834:7974,837:8080}],7969:[[951,788],,{768:7971,769:7973,834:7975,837:8081}],7970:[[7968,768],,{837:8082}],7971:[[7969,768],,{837:8083}],7972:[[7968,769],,{837:8084}],7973:[[7969,769],,{837:8085}],7974:[[7968,834],,{837:8086}],7975:[[7969,834],,{837:8087}],7976:[[919,787],,{768:7978,769:7980,834:7982,837:8088}],7977:[[919,788],,{768:7979,769:7981,834:7983,837:8089}],7978:[[7976,768],,{837:8090}],7979:[[7977,768],,{837:8091}],7980:[[7976,769],,{837:8092}],7981:[[7977,769],,{837:8093}],7982:[[7976,834],,{837:8094}],7983:[[7977,834],,{837:8095}],7984:[[953,787],,{768:7986,769:7988,834:7990}],7985:[[953,788],,{768:7987,769:7989,834:7991}],7986:[[7984,768]],7987:[[7985,768]],7988:[[7984,769]],7989:[[7985,769]],7990:[[7984,834]],7991:[[7985,834]],7992:[[921,787],,{768:7994,769:7996,834:7998}],7993:[[921,788],,{768:7995,769:7997,834:7999}],7994:[[7992,768]],7995:[[7993,768]],7996:[[7992,769]],7997:[[7993,769]],7998:[[7992,834]],7999:[[7993,834]],8e3:[[959,787],,{768:8002,769:8004}],8001:[[959,788],,{768:8003,769:8005}],8002:[[8e3,768]],8003:[[8001,768]],8004:[[8e3,769]],8005:[[8001,769]],8008:[[927,787],,{768:8010,769:8012}],8009:[[927,788],,{768:8011,769:8013}],8010:[[8008,768]],8011:[[8009,768]],8012:[[8008,769]],8013:[[8009,769]],8016:[[965,787],,{768:8018,769:8020,834:8022}],8017:[[965,788],,{768:8019,769:8021,834:8023}],8018:[[8016,768]],8019:[[8017,768]],8020:[[8016,769]],8021:[[8017,769]],8022:[[8016,834]],8023:[[8017,834]],8025:[[933,788],,{768:8027,769:8029,834:8031}],8027:[[8025,768]],8029:[[8025,769]],8031:[[8025,834]],8032:[[969,787],,{768:8034,769:8036,834:8038,837:8096}],8033:[[969,788],,{768:8035,769:8037,834:8039,837:8097}],8034:[[8032,768],,{837:8098}],8035:[[8033,768],,{837:8099}],8036:[[8032,769],,{837:8100}],8037:[[8033,769],,{837:8101}],8038:[[8032,834],,{837:8102}],8039:[[8033,834],,{837:8103}],8040:[[937,787],,{768:8042,769:8044,834:8046,837:8104}],8041:[[937,788],,{768:8043,769:8045,834:8047,837:8105}],8042:[[8040,768],,{837:8106}],8043:[[8041,768],,{837:8107}],8044:[[8040,769],,{837:8108}],8045:[[8041,769],,{837:8109}],8046:[[8040,834],,{837:8110}],8047:[[8041,834],,{837:8111}],8048:[[945,768],,{837:8114}],8049:[[940]],8050:[[949,768]],8051:[[941]],8052:[[951,768],,{837:8130}],8053:[[942]],8054:[[953,768]],8055:[[943]],8056:[[959,768]],8057:[[972]],8058:[[965,768]],8059:[[973]],8060:[[969,768],,{837:8178}],8061:[[974]],8064:[[7936,837]],8065:[[7937,837]],8066:[[7938,837]],8067:[[7939,837]],8068:[[7940,837]],8069:[[7941,837]],8070:[[7942,837]],8071:[[7943,837]],8072:[[7944,837]],8073:[[7945,837]],8074:[[7946,837]],8075:[[7947,837]],8076:[[7948,837]],8077:[[7949,837]],8078:[[7950,837]],8079:[[7951,837]],8080:[[7968,837]],8081:[[7969,837]],8082:[[7970,837]],8083:[[7971,837]],8084:[[7972,837]],8085:[[7973,837]],8086:[[7974,837]],8087:[[7975,837]],8088:[[7976,837]],8089:[[7977,837]],8090:[[7978,837]],8091:[[7979,837]],8092:[[7980,837]],8093:[[7981,837]],8094:[[7982,837]],8095:[[7983,837]],8096:[[8032,837]],8097:[[8033,837]],8098:[[8034,837]],8099:[[8035,837]],8100:[[8036,837]],8101:[[8037,837]],8102:[[8038,837]],8103:[[8039,837]],8104:[[8040,837]],8105:[[8041,837]],8106:[[8042,837]],8107:[[8043,837]],8108:[[8044,837]],8109:[[8045,837]],8110:[[8046,837]],8111:[[8047,837]],8112:[[945,774]],8113:[[945,772]],8114:[[8048,837]],8115:[[945,837]],8116:[[940,837]],8118:[[945,834],,{837:8119}],8119:[[8118,837]],8120:[[913,774]],8121:[[913,772]],8122:[[913,768]],8123:[[902]],8124:[[913,837]],8125:[[32,787],256],8126:[[953]],8127:[[32,787],256,{768:8141,769:8142,834:8143}],8128:[[32,834],256],8129:[[168,834]],8130:[[8052,837]],8131:[[951,837]],8132:[[942,837]],8134:[[951,834],,{837:8135}],8135:[[8134,837]],8136:[[917,768]],8137:[[904]],8138:[[919,768]],8139:[[905]],8140:[[919,837]],8141:[[8127,768]],8142:[[8127,769]],8143:[[8127,834]],8144:[[953,774]],8145:[[953,772]],8146:[[970,768]],8147:[[912]],8150:[[953,834]],8151:[[970,834]],8152:[[921,774]],8153:[[921,772]],8154:[[921,768]],8155:[[906]],8157:[[8190,768]],8158:[[8190,769]],8159:[[8190,834]],8160:[[965,774]],8161:[[965,772]],8162:[[971,768]],8163:[[944]],8164:[[961,787]],8165:[[961,788]],8166:[[965,834]],8167:[[971,834]],8168:[[933,774]],8169:[[933,772]],8170:[[933,768]],8171:[[910]],8172:[[929,788]],8173:[[168,768]],8174:[[901]],8175:[[96]],8178:[[8060,837]],8179:[[969,837]],8180:[[974,837]],8182:[[969,834],,{837:8183}],8183:[[8182,837]],8184:[[927,768]],8185:[[908]],8186:[[937,768]],8187:[[911]],8188:[[937,837]],8189:[[180]],8190:[[32,788],256,{768:8157,769:8158,834:8159}]},8192:{8192:[[8194]],8193:[[8195]],8194:[[32],256],8195:[[32],256],8196:[[32],256],8197:[[32],256],8198:[[32],256],8199:[[32],256],8200:[[32],256],8201:[[32],256],8202:[[32],256],8209:[[8208],256],8215:[[32,819],256],8228:[[46],256],8229:[[46,46],256],8230:[[46,46,46],256],8239:[[32],256],8243:[[8242,8242],256],8244:[[8242,8242,8242],256],8246:[[8245,8245],256],8247:[[8245,8245,8245],256],8252:[[33,33],256],8254:[[32,773],256],8263:[[63,63],256],8264:[[63,33],256],8265:[[33,63],256],8279:[[8242,8242,8242,8242],256],8287:[[32],256],8304:[[48],256],8305:[[105],256],8308:[[52],256],8309:[[53],256],8310:[[54],256],8311:[[55],256],8312:[[56],256],8313:[[57],256],8314:[[43],256],8315:[[8722],256],8316:[[61],256],8317:[[40],256],8318:[[41],256],8319:[[110],256],8320:[[48],256],8321:[[49],256],8322:[[50],256],8323:[[51],256],8324:[[52],256],8325:[[53],256],8326:[[54],256],8327:[[55],256],8328:[[56],256],8329:[[57],256],8330:[[43],256],8331:[[8722],256],8332:[[61],256],8333:[[40],256],8334:[[41],256],8336:[[97],256],8337:[[101],256],8338:[[111],256],8339:[[120],256],8340:[[601],256],8341:[[104],256],8342:[[107],256],8343:[[108],256],8344:[[109],256],8345:[[110],256],8346:[[112],256],8347:[[115],256],8348:[[116],256],8360:[[82,115],256],8400:[,230],8401:[,230],8402:[,1],8403:[,1],8404:[,230],8405:[,230],8406:[,230],8407:[,230],8408:[,1],8409:[,1],8410:[,1],8411:[,230],8412:[,230],8417:[,230],8421:[,1],8422:[,1],8423:[,230],8424:[,220],8425:[,230],8426:[,1],8427:[,1],8428:[,220],8429:[,220],8430:[,220],8431:[,220],8432:[,230]},8448:{8448:[[97,47,99],256],8449:[[97,47,115],256],8450:[[67],256],8451:[[176,67],256],8453:[[99,47,111],256],8454:[[99,47,117],256],8455:[[400],256],8457:[[176,70],256],8458:[[103],256],8459:[[72],256],8460:[[72],256],8461:[[72],256],8462:[[104],256],8463:[[295],256],8464:[[73],256],8465:[[73],256],8466:[[76],256],8467:[[108],256],8469:[[78],256],8470:[[78,111],256],8473:[[80],256],8474:[[81],256],8475:[[82],256],8476:[[82],256],8477:[[82],256],8480:[[83,77],256],8481:[[84,69,76],256],8482:[[84,77],256],8484:[[90],256],8486:[[937]],8488:[[90],256],8490:[[75]],8491:[[197]],8492:[[66],256],8493:[[67],256],8495:[[101],256],8496:[[69],256],8497:[[70],256],8499:[[77],256],8500:[[111],256],8501:[[1488],256],8502:[[1489],256],8503:[[1490],256],8504:[[1491],256],8505:[[105],256],8507:[[70,65,88],256],8508:[[960],256],8509:[[947],256],8510:[[915],256],8511:[[928],256],8512:[[8721],256],8517:[[68],256],8518:[[100],256],8519:[[101],256],8520:[[105],256],8521:[[106],256],8528:[[49,8260,55],256],8529:[[49,8260,57],256],8530:[[49,8260,49,48],256],8531:[[49,8260,51],256],8532:[[50,8260,51],256],8533:[[49,8260,53],256],8534:[[50,8260,53],256],8535:[[51,8260,53],256],8536:[[52,8260,53],256],8537:[[49,8260,54],256],8538:[[53,8260,54],256],8539:[[49,8260,56],256],8540:[[51,8260,56],256],8541:[[53,8260,56],256],8542:[[55,8260,56],256],8543:[[49,8260],256],8544:[[73],256],8545:[[73,73],256],8546:[[73,73,73],256],8547:[[73,86],256],8548:[[86],256],8549:[[86,73],256],8550:[[86,73,73],256],8551:[[86,73,73,73],256],8552:[[73,88],256],8553:[[88],256],8554:[[88,73],256],8555:[[88,73,73],256],8556:[[76],256],8557:[[67],256],8558:[[68],256],8559:[[77],256],8560:[[105],256],8561:[[105,105],256],8562:[[105,105,105],256],8563:[[105,118],256],8564:[[118],256],8565:[[118,105],256],8566:[[118,105,105],256],8567:[[118,105,105,105],256],8568:[[105,120],256],8569:[[120],256],8570:[[120,105],256],8571:[[120,105,105],256],8572:[[108],256],8573:[[99],256],8574:[[100],256],8575:[[109],256],8585:[[48,8260,51],256],8592:[,,{824:8602}],8594:[,,{824:8603}],8596:[,,{824:8622}],8602:[[8592,824]],8603:[[8594,824]],8622:[[8596,824]],8653:[[8656,824]],8654:[[8660,824]],8655:[[8658,824]],8656:[,,{824:8653}],8658:[,,{824:8655}],8660:[,,{824:8654}]},8704:{8707:[,,{824:8708}],8708:[[8707,824]],8712:[,,{824:8713}],8713:[[8712,824]],8715:[,,{824:8716}],8716:[[8715,824]],8739:[,,{824:8740}],8740:[[8739,824]],8741:[,,{824:8742}],8742:[[8741,824]],8748:[[8747,8747],256],8749:[[8747,8747,8747],256],8751:[[8750,8750],256],8752:[[8750,8750,8750],256],8764:[,,{824:8769}],8769:[[8764,824]],8771:[,,{824:8772}],8772:[[8771,824]],8773:[,,{824:8775}],8775:[[8773,824]],8776:[,,{824:8777}],8777:[[8776,824]],8781:[,,{824:8813}],8800:[[61,824]],8801:[,,{824:8802}],8802:[[8801,824]],8804:[,,{824:8816}],8805:[,,{824:8817}],8813:[[8781,824]],8814:[[60,824]],8815:[[62,824]],8816:[[8804,824]],8817:[[8805,824]],8818:[,,{824:8820}],8819:[,,{824:8821}],8820:[[8818,824]],8821:[[8819,824]],8822:[,,{824:8824}],8823:[,,{824:8825}],8824:[[8822,824]],8825:[[8823,824]],8826:[,,{824:8832}],8827:[,,{824:8833}],8828:[,,{824:8928}],8829:[,,{824:8929}],8832:[[8826,824]],8833:[[8827,824]],8834:[,,{824:8836}],8835:[,,{824:8837}],8836:[[8834,824]],8837:[[8835,824]],8838:[,,{824:8840}],8839:[,,{824:8841}],8840:[[8838,824]],8841:[[8839,824]],8849:[,,{824:8930}],8850:[,,{824:8931}],8866:[,,{824:8876}],8872:[,,{824:8877}],8873:[,,{824:8878}],8875:[,,{824:8879}],8876:[[8866,824]],8877:[[8872,824]],8878:[[8873,824]],8879:[[8875,824]],8882:[,,{824:8938}],8883:[,,{824:8939}],8884:[,,{824:8940}],8885:[,,{824:8941}],8928:[[8828,824]],8929:[[8829,824]],8930:[[8849,824]],8931:[[8850,824]],8938:[[8882,824]],8939:[[8883,824]],8940:[[8884,824]],8941:[[8885,824]]},8960:{9001:[[12296]],9002:[[12297]]},9216:{9312:[[49],256],9313:[[50],256],9314:[[51],256],9315:[[52],256],9316:[[53],256],9317:[[54],256],9318:[[55],256],9319:[[56],256],9320:[[57],256],9321:[[49,48],256],9322:[[49,49],256],9323:[[49,50],256],9324:[[49,51],256],9325:[[49,52],256],9326:[[49,53],256],9327:[[49,54],256],9328:[[49,55],256],9329:[[49,56],256],9330:[[49,57],256],9331:[[50,48],256],9332:[[40,49,41],256],9333:[[40,50,41],256],9334:[[40,51,41],256],9335:[[40,52,41],256],9336:[[40,53,41],256],9337:[[40,54,41],256],9338:[[40,55,41],256],9339:[[40,56,41],256],9340:[[40,57,41],256],9341:[[40,49,48,41],256],9342:[[40,49,49,41],256],9343:[[40,49,50,41],256],9344:[[40,49,51,41],256],9345:[[40,49,52,41],256],9346:[[40,49,53,41],256],9347:[[40,49,54,41],256],9348:[[40,49,55,41],256],9349:[[40,49,56,41],256],9350:[[40,49,57,41],256],9351:[[40,50,48,41],256],9352:[[49,46],256],9353:[[50,46],256],9354:[[51,46],256],9355:[[52,46],256],9356:[[53,46],256],9357:[[54,46],256],9358:[[55,46],256],9359:[[56,46],256],9360:[[57,46],256],9361:[[49,48,46],256],9362:[[49,49,46],256],9363:[[49,50,46],256],9364:[[49,51,46],256],9365:[[49,52,46],256],9366:[[49,53,46],256],9367:[[49,54,46],256],9368:[[49,55,46],256],9369:[[49,56,46],256],9370:[[49,57,46],256],9371:[[50,48,46],256],9372:[[40,97,41],256],9373:[[40,98,41],256],9374:[[40,99,41],256],9375:[[40,100,41],256],9376:[[40,101,41],256],9377:[[40,102,41],256],9378:[[40,103,41],256],9379:[[40,104,41],256],9380:[[40,105,41],256],9381:[[40,106,41],256],9382:[[40,107,41],256],9383:[[40,108,41],256],9384:[[40,109,41],256],9385:[[40,110,41],256],9386:[[40,111,41],256],9387:[[40,112,41],256],9388:[[40,113,41],256],9389:[[40,114,41],256],9390:[[40,115,41],256],9391:[[40,116,41],256],9392:[[40,117,41],256],9393:[[40,118,41],256],9394:[[40,119,41],256],9395:[[40,120,41],256],9396:[[40,121,41],256],9397:[[40,122,41],256],9398:[[65],256],9399:[[66],256],9400:[[67],256],9401:[[68],256],9402:[[69],256],9403:[[70],256],9404:[[71],256],9405:[[72],256],9406:[[73],256],9407:[[74],256],9408:[[75],256],9409:[[76],256],9410:[[77],256],9411:[[78],256],9412:[[79],256],9413:[[80],256],9414:[[81],256],9415:[[82],256],9416:[[83],256],9417:[[84],256],9418:[[85],256],9419:[[86],256],9420:[[87],256],9421:[[88],256],9422:[[89],256],9423:[[90],256],9424:[[97],256],9425:[[98],256],9426:[[99],256],9427:[[100],256],9428:[[101],256],9429:[[102],256],9430:[[103],256],9431:[[104],256],9432:[[105],256],9433:[[106],256],9434:[[107],256],9435:[[108],256],9436:[[109],256],9437:[[110],256],9438:[[111],256],9439:[[112],256],9440:[[113],256],9441:[[114],256],9442:[[115],256],9443:[[116],256],9444:[[117],256],9445:[[118],256],9446:[[119],256],9447:[[120],256],9448:[[121],256],9449:[[122],256],9450:[[48],256]},10752:{10764:[[8747,8747,8747,8747],256],10868:[[58,58,61],256],10869:[[61,61],256],10870:[[61,61,61],256],10972:[[10973,824],512]},11264:{11388:[[106],256],11389:[[86],256],11503:[,230],11504:[,230],11505:[,230]},11520:{11631:[[11617],256],11647:[,9],11744:[,230],11745:[,230],11746:[,230],11747:[,230],11748:[,230],11749:[,230],11750:[,230],11751:[,230],11752:[,230],11753:[,230],11754:[,230],11755:[,230],11756:[,230],11757:[,230],11758:[,230],11759:[,230],11760:[,230],11761:[,230],11762:[,230],11763:[,230],11764:[,230],11765:[,230],11766:[,230],11767:[,230],11768:[,230],11769:[,230],11770:[,230],11771:[,230],11772:[,230],11773:[,230],11774:[,230],11775:[,230]},11776:{11935:[[27597],256],12019:[[40863],256]},12032:{12032:[[19968],256],12033:[[20008],256],12034:[[20022],256],12035:[[20031],256],12036:[[20057],256],12037:[[20101],256],12038:[[20108],256],12039:[[20128],256],12040:[[20154],256],12041:[[20799],256],12042:[[20837],256],12043:[[20843],256],12044:[[20866],256],12045:[[20886],256],12046:[[20907],256],12047:[[20960],256],12048:[[20981],256],12049:[[20992],256],12050:[[21147],256],12051:[[21241],256],12052:[[21269],256],12053:[[21274],256],12054:[[21304],256],12055:[[21313],256],12056:[[21340],256],12057:[[21353],256],12058:[[21378],256],12059:[[21430],256],12060:[[21448],256],12061:[[21475],256],12062:[[22231],256],12063:[[22303],256],12064:[[22763],256],12065:[[22786],256],12066:[[22794],256],12067:[[22805],256],12068:[[22823],256],12069:[[22899],256],12070:[[23376],256],12071:[[23424],256],12072:[[23544],256],12073:[[23567],256],12074:[[23586],256],12075:[[23608],256],12076:[[23662],256],12077:[[23665],256],12078:[[24027],256],12079:[[24037],256],12080:[[24049],256],12081:[[24062],256],12082:[[24178],256],12083:[[24186],256],12084:[[24191],256],12085:[[24308],256],12086:[[24318],256],12087:[[24331],256],12088:[[24339],256],12089:[[24400],256],12090:[[24417],256],12091:[[24435],256],12092:[[24515],256],12093:[[25096],256],12094:[[25142],256],12095:[[25163],256],12096:[[25903],256],12097:[[25908],256],12098:[[25991],256],12099:[[26007],256],12100:[[26020],256],12101:[[26041],256],12102:[[26080],256],12103:[[26085],256],12104:[[26352],256],12105:[[26376],256],12106:[[26408],256],12107:[[27424],256],12108:[[27490],256],12109:[[27513],256],12110:[[27571],256],12111:[[27595],256],12112:[[27604],256],12113:[[27611],256],12114:[[27663],256],12115:[[27668],256],12116:[[27700],256],12117:[[28779],256],12118:[[29226],256],12119:[[29238],256],12120:[[29243],256],12121:[[29247],256],12122:[[29255],256],12123:[[29273],256],12124:[[29275],256],12125:[[29356],256],12126:[[29572],256],12127:[[29577],256],12128:[[29916],256],12129:[[29926],256],12130:[[29976],256],12131:[[29983],256],12132:[[29992],256],12133:[[3e4],256],12134:[[30091],256],12135:[[30098],256],12136:[[30326],256],12137:[[30333],256],12138:[[30382],256],12139:[[30399],256],12140:[[30446],256],12141:[[30683],256],12142:[[30690],256],12143:[[30707],256],12144:[[31034],256],12145:[[31160],256],12146:[[31166],256],12147:[[31348],256],12148:[[31435],256],12149:[[31481],256],12150:[[31859],256],12151:[[31992],256],12152:[[32566],256],12153:[[32593],256],12154:[[32650],256],12155:[[32701],256],12156:[[32769],256],12157:[[32780],256],12158:[[32786],256],12159:[[32819],256],12160:[[32895],256],12161:[[32905],256],12162:[[33251],256],12163:[[33258],256],12164:[[33267],256],12165:[[33276],256],12166:[[33292],256],12167:[[33307],256],12168:[[33311],256],12169:[[33390],256],12170:[[33394],256],12171:[[33400],256],12172:[[34381],256],12173:[[34411],256],12174:[[34880],256],12175:[[34892],256],12176:[[34915],256],12177:[[35198],256],12178:[[35211],256],12179:[[35282],256],12180:[[35328],256],12181:[[35895],256],12182:[[35910],256],12183:[[35925],256],12184:[[35960],256],12185:[[35997],256],12186:[[36196],256],12187:[[36208],256],12188:[[36275],256],12189:[[36523],256],12190:[[36554],256],12191:[[36763],256],12192:[[36784],256],12193:[[36789],256],12194:[[37009],256],12195:[[37193],256],12196:[[37318],256],12197:[[37324],256],12198:[[37329],256],12199:[[38263],256],12200:[[38272],256],12201:[[38428],256],12202:[[38582],256],12203:[[38585],256],12204:[[38632],256],12205:[[38737],256],12206:[[38750],256],12207:[[38754],256],12208:[[38761],256],12209:[[38859],256],12210:[[38893],256],12211:[[38899],256],12212:[[38913],256],12213:[[39080],256],12214:[[39131],256],12215:[[39135],256],12216:[[39318],256],12217:[[39321],256],12218:[[39340],256],12219:[[39592],256],12220:[[39640],256],12221:[[39647],256],12222:[[39717],256],12223:[[39727],256],12224:[[39730],256],12225:[[39740],256],12226:[[39770],256],12227:[[40165],256],12228:[[40565],256],12229:[[40575],256],12230:[[40613],256],12231:[[40635],256],12232:[[40643],256],12233:[[40653],256],12234:[[40657],256],12235:[[40697],256],12236:[[40701],256],12237:[[40718],256],12238:[[40723],256],12239:[[40736],256],12240:[[40763],256],12241:[[40778],256],12242:[[40786],256],12243:[[40845],256],12244:[[40860],256],12245:[[40864],256]},12288:{12288:[[32],256],12330:[,218],12331:[,228],12332:[,232],12333:[,222],12334:[,224],12335:[,224],12342:[[12306],256],12344:[[21313],256],12345:[[21316],256],12346:[[21317],256],12358:[,,{12441:12436}],12363:[,,{12441:12364}],12364:[[12363,12441]],12365:[,,{12441:12366}],12366:[[12365,12441]],12367:[,,{12441:12368}],12368:[[12367,12441]],12369:[,,{12441:12370}],12370:[[12369,12441]],12371:[,,{12441:12372}],12372:[[12371,12441]],12373:[,,{12441:12374}],12374:[[12373,12441]],12375:[,,{12441:12376}],12376:[[12375,12441]],12377:[,,{12441:12378}],12378:[[12377,12441]],12379:[,,{12441:12380}],12380:[[12379,12441]],12381:[,,{12441:12382}],12382:[[12381,12441]],12383:[,,{12441:12384}],12384:[[12383,12441]],12385:[,,{12441:12386}],12386:[[12385,12441]],12388:[,,{12441:12389}],12389:[[12388,12441]],12390:[,,{12441:12391}],12391:[[12390,12441]],12392:[,,{12441:12393}],12393:[[12392,12441]],12399:[,,{12441:12400,12442:12401}],12400:[[12399,12441]],12401:[[12399,12442]],12402:[,,{12441:12403,12442:12404}],12403:[[12402,12441]],12404:[[12402,12442]],12405:[,,{12441:12406,12442:12407}],12406:[[12405,12441]],12407:[[12405,12442]],12408:[,,{12441:12409,12442:12410}],12409:[[12408,12441]],12410:[[12408,12442]],12411:[,,{12441:12412,12442:12413}],12412:[[12411,12441]],12413:[[12411,12442]],12436:[[12358,12441]],12441:[,8],12442:[,8],12443:[[32,12441],256],12444:[[32,12442],256],12445:[,,{12441:12446}],12446:[[12445,12441]],12447:[[12424,12426],256],12454:[,,{12441:12532}],12459:[,,{12441:12460}],12460:[[12459,12441]],12461:[,,{12441:12462}],12462:[[12461,12441]],12463:[,,{12441:12464}],12464:[[12463,12441]],12465:[,,{12441:12466}],12466:[[12465,12441]],12467:[,,{12441:12468}],12468:[[12467,12441]],12469:[,,{12441:12470}],12470:[[12469,12441]],12471:[,,{12441:12472}],12472:[[12471,12441]],12473:[,,{12441:12474}],12474:[[12473,12441]],12475:[,,{12441:12476}],12476:[[12475,12441]],12477:[,,{12441:12478}],12478:[[12477,12441]],12479:[,,{12441:12480}],12480:[[12479,12441]],12481:[,,{12441:12482}],12482:[[12481,12441]],12484:[,,{12441:12485}],12485:[[12484,12441]],12486:[,,{12441:12487}],12487:[[12486,12441]],12488:[,,{12441:12489}],12489:[[12488,12441]],12495:[,,{12441:12496,12442:12497}],12496:[[12495,12441]],12497:[[12495,12442]],12498:[,,{12441:12499,12442:12500}],12499:[[12498,12441]],12500:[[12498,12442]],12501:[,,{12441:12502,12442:12503}],12502:[[12501,12441]],12503:[[12501,12442]],12504:[,,{12441:12505,12442:12506}],12505:[[12504,12441]],12506:[[12504,12442]],12507:[,,{12441:12508,12442:12509}],12508:[[12507,12441]],12509:[[12507,12442]],12527:[,,{12441:12535}],12528:[,,{12441:12536}],12529:[,,{12441:12537}],12530:[,,{12441:12538}],12532:[[12454,12441]],12535:[[12527,12441]],12536:[[12528,12441]],12537:[[12529,12441]],12538:[[12530,12441]],12541:[,,{12441:12542}],12542:[[12541,12441]],12543:[[12467,12488],256]},12544:{12593:[[4352],256],12594:[[4353],256],12595:[[4522],256],12596:[[4354],256],12597:[[4524],256],12598:[[4525],256],12599:[[4355],256],12600:[[4356],256],12601:[[4357],256],12602:[[4528],256],12603:[[4529],256],12604:[[4530],256],12605:[[4531],256],12606:[[4532],256],12607:[[4533],256],12608:[[4378],256],12609:[[4358],256],12610:[[4359],256],12611:[[4360],256],12612:[[4385],256],12613:[[4361],256],12614:[[4362],256],12615:[[4363],256],12616:[[4364],256],12617:[[4365],256],12618:[[4366],256],12619:[[4367],256],12620:[[4368],256],12621:[[4369],256],12622:[[4370],256],12623:[[4449],256],12624:[[4450],256],12625:[[4451],256],12626:[[4452],256],12627:[[4453],256],12628:[[4454],256],12629:[[4455],256],12630:[[4456],256],12631:[[4457],256],12632:[[4458],256],12633:[[4459],256],12634:[[4460],256],12635:[[4461],256],12636:[[4462],256],12637:[[4463],256],12638:[[4464],256],12639:[[4465],256],12640:[[4466],256],12641:[[4467],256],12642:[[4468],256],12643:[[4469],256],12644:[[4448],256],12645:[[4372],256],12646:[[4373],256],12647:[[4551],256],12648:[[4552],256],12649:[[4556],256],12650:[[4558],256],12651:[[4563],256],12652:[[4567],256],12653:[[4569],256],12654:[[4380],256],12655:[[4573],256],12656:[[4575],256],12657:[[4381],256],12658:[[4382],256],12659:[[4384],256],12660:[[4386],256],12661:[[4387],256],12662:[[4391],256],12663:[[4393],256],12664:[[4395],256],12665:[[4396],256],12666:[[4397],256],12667:[[4398],256],12668:[[4399],256],12669:[[4402],256],12670:[[4406],256],12671:[[4416],256],12672:[[4423],256],12673:[[4428],256],12674:[[4593],256],12675:[[4594],256],12676:[[4439],256],12677:[[4440],256],12678:[[4441],256],12679:[[4484],256],12680:[[4485],256],12681:[[4488],256],12682:[[4497],256],12683:[[4498],256],12684:[[4500],256],12685:[[4510],256],12686:[[4513],256],12690:[[19968],256],12691:[[20108],256],12692:[[19977],256],12693:[[22235],256],12694:[[19978],256],12695:[[20013],256],12696:[[19979],256],12697:[[30002],256],12698:[[20057],256],12699:[[19993],256],12700:[[19969],256],12701:[[22825],256],12702:[[22320],256],12703:[[20154],256]},12800:{12800:[[40,4352,41],256],12801:[[40,4354,41],256],12802:[[40,4355,41],256],12803:[[40,4357,41],256],12804:[[40,4358,41],256],12805:[[40,4359,41],256],12806:[[40,4361,41],256],12807:[[40,4363,41],256],12808:[[40,4364,41],256],12809:[[40,4366,41],256],12810:[[40,4367,41],256],12811:[[40,4368,41],256],12812:[[40,4369,41],256],12813:[[40,4370,41],256],12814:[[40,4352,4449,41],256],12815:[[40,4354,4449,41],256],12816:[[40,4355,4449,41],256],12817:[[40,4357,4449,41],256],12818:[[40,4358,4449,41],256],12819:[[40,4359,4449,41],256],12820:[[40,4361,4449,41],256],12821:[[40,4363,4449,41],256],12822:[[40,4364,4449,41],256],12823:[[40,4366,4449,41],256],12824:[[40,4367,4449,41],256],12825:[[40,4368,4449,41],256],12826:[[40,4369,4449,41],256],12827:[[40,4370,4449,41],256],12828:[[40,4364,4462,41],256],12829:[[40,4363,4457,4364,4453,4523,41],256],12830:[[40,4363,4457,4370,4462,41],256],12832:[[40,19968,41],256],12833:[[40,20108,41],256],12834:[[40,19977,41],256],12835:[[40,22235,41],256],12836:[[40,20116,41],256],12837:[[40,20845,41],256],12838:[[40,19971,41],256],12839:[[40,20843,41],256],12840:[[40,20061,41],256],12841:[[40,21313,41],256],12842:[[40,26376,41],256],12843:[[40,28779,41],256],12844:[[40,27700,41],256],12845:[[40,26408,41],256],12846:[[40,37329,41],256],12847:[[40,22303,41],256],12848:[[40,26085,41],256],12849:[[40,26666,41],256],12850:[[40,26377,41],256],12851:[[40,31038,41],256],12852:[[40,21517,41],256],12853:[[40,29305,41],256],12854:[[40,36001,41],256],12855:[[40,31069,41],256],12856:[[40,21172,41],256],12857:[[40,20195,41],256],12858:[[40,21628,41],256],12859:[[40,23398,41],256],12860:[[40,30435,41],256],12861:[[40,20225,41],256],12862:[[40,36039,41],256],12863:[[40,21332,41],256],12864:[[40,31085,41],256],12865:[[40,20241,41],256],12866:[[40,33258,41],256],12867:[[40,33267,41],256],12868:[[21839],256],12869:[[24188],256],12870:[[25991],256],12871:[[31631],256],12880:[[80,84,69],256],12881:[[50,49],256],12882:[[50,50],256],12883:[[50,51],256],12884:[[50,52],256],12885:[[50,53],256],12886:[[50,54],256],12887:[[50,55],256],12888:[[50,56],256],12889:[[50,57],256],12890:[[51,48],256],12891:[[51,49],256],12892:[[51,50],256],12893:[[51,51],256],12894:[[51,52],256],12895:[[51,53],256],12896:[[4352],256],12897:[[4354],256],12898:[[4355],256],12899:[[4357],256],12900:[[4358],256],12901:[[4359],256],12902:[[4361],256],12903:[[4363],256],12904:[[4364],256],12905:[[4366],256],12906:[[4367],256],12907:[[4368],256],12908:[[4369],256],12909:[[4370],256],12910:[[4352,4449],256],12911:[[4354,4449],256],12912:[[4355,4449],256],12913:[[4357,4449],256],12914:[[4358,4449],256],12915:[[4359,4449],256],12916:[[4361,4449],256],12917:[[4363,4449],256],12918:[[4364,4449],256],12919:[[4366,4449],256],12920:[[4367,4449],256],12921:[[4368,4449],256],12922:[[4369,4449],256],12923:[[4370,4449],256],12924:[[4366,4449,4535,4352,4457],256],12925:[[4364,4462,4363,4468],256],12926:[[4363,4462],256],12928:[[19968],256],12929:[[20108],256],12930:[[19977],256],12931:[[22235],256],12932:[[20116],256],12933:[[20845],256],12934:[[19971],256],12935:[[20843],256],12936:[[20061],256],12937:[[21313],256],12938:[[26376],256],12939:[[28779],256],12940:[[27700],256],12941:[[26408],256],12942:[[37329],256],12943:[[22303],256],12944:[[26085],256],12945:[[26666],256],12946:[[26377],256],12947:[[31038],256],12948:[[21517],256],12949:[[29305],256],12950:[[36001],256],12951:[[31069],256],12952:[[21172],256],12953:[[31192],256],12954:[[30007],256],12955:[[22899],256],12956:[[36969],256],12957:[[20778],256],12958:[[21360],256],12959:[[27880],256],12960:[[38917],256],12961:[[20241],256],12962:[[20889],256],12963:[[27491],256],12964:[[19978],256],12965:[[20013],256],12966:[[19979],256],12967:[[24038],256],12968:[[21491],256],12969:[[21307],256],12970:[[23447],256],12971:[[23398],256],12972:[[30435],256],12973:[[20225],256],12974:[[36039],256],12975:[[21332],256],12976:[[22812],256],12977:[[51,54],256],12978:[[51,55],256],12979:[[51,56],256],12980:[[51,57],256],12981:[[52,48],256],12982:[[52,49],256],12983:[[52,50],256],12984:[[52,51],256],12985:[[52,52],256],12986:[[52,53],256],12987:[[52,54],256],12988:[[52,55],256],12989:[[52,56],256],12990:[[52,57],256],12991:[[53,48],256],12992:[[49,26376],256],12993:[[50,26376],256],12994:[[51,26376],256],12995:[[52,26376],256],12996:[[53,26376],256],12997:[[54,26376],256],12998:[[55,26376],256],12999:[[56,26376],256],13e3:[[57,26376],256],13001:[[49,48,26376],256],13002:[[49,49,26376],256],13003:[[49,50,26376],256],13004:[[72,103],256],13005:[[101,114,103],256],13006:[[101,86],256],13007:[[76,84,68],256],13008:[[12450],256],13009:[[12452],256],13010:[[12454],256],13011:[[12456],256],13012:[[12458],256],13013:[[12459],256],13014:[[12461],256],13015:[[12463],256],13016:[[12465],256],13017:[[12467],256],13018:[[12469],256],13019:[[12471],256],13020:[[12473],256],13021:[[12475],256],13022:[[12477],256],13023:[[12479],256],13024:[[12481],256],13025:[[12484],256],13026:[[12486],256],13027:[[12488],256],13028:[[12490],256],13029:[[12491],256],13030:[[12492],256],13031:[[12493],256],13032:[[12494],256],13033:[[12495],256],13034:[[12498],256],13035:[[12501],256],13036:[[12504],256],13037:[[12507],256],13038:[[12510],256],13039:[[12511],256],13040:[[12512],256],13041:[[12513],256],13042:[[12514],256],13043:[[12516],256],13044:[[12518],256],13045:[[12520],256],13046:[[12521],256],13047:[[12522],256],13048:[[12523],256],13049:[[12524],256],13050:[[12525],256],13051:[[12527],256],13052:[[12528],256],13053:[[12529],256],13054:[[12530],256]},13056:{13056:[[12450,12497,12540,12488],256],13057:[[12450,12523,12501,12449],256],13058:[[12450,12531,12506,12450],256],13059:[[12450,12540,12523],256],13060:[[12452,12491,12531,12464],256],13061:[[12452,12531,12481],256],13062:[[12454,12457,12531],256],13063:[[12456,12473,12463,12540,12489],256],13064:[[12456,12540,12459,12540],256],13065:[[12458,12531,12473],256],13066:[[12458,12540,12512],256],13067:[[12459,12452,12522],256],13068:[[12459,12521,12483,12488],256],13069:[[12459,12525,12522,12540],256],13070:[[12460,12525,12531],256],13071:[[12460,12531,12510],256],13072:[[12462,12460],256],13073:[[12462,12491,12540],256],13074:[[12461,12517,12522,12540],256],13075:[[12462,12523,12480,12540],256],13076:[[12461,12525],256],13077:[[12461,12525,12464,12521,12512],256],13078:[[12461,12525,12513,12540,12488,12523],256],13079:[[12461,12525,12527,12483,12488],256],13080:[[12464,12521,12512],256],13081:[[12464,12521,12512,12488,12531],256],13082:[[12463,12523,12476,12452,12525],256],13083:[[12463,12525,12540,12493],256],13084:[[12465,12540,12473],256],13085:[[12467,12523,12490],256],13086:[[12467,12540,12509],256],13087:[[12469,12452,12463,12523],256],13088:[[12469,12531,12481,12540,12512],256],13089:[[12471,12522,12531,12464],256],13090:[[12475,12531,12481],256],13091:[[12475,12531,12488],256],13092:[[12480,12540,12473],256],13093:[[12487,12471],256],13094:[[12489,12523],256],13095:[[12488,12531],256],13096:[[12490,12494],256],13097:[[12494,12483,12488],256],13098:[[12495,12452,12484],256],13099:[[12497,12540,12475,12531,12488],256],13100:[[12497,12540,12484],256],13101:[[12496,12540,12524,12523],256],13102:[[12500,12450,12473,12488,12523],256],13103:[[12500,12463,12523],256],13104:[[12500,12467],256],13105:[[12499,12523],256],13106:[[12501,12449,12521,12483,12489],256],13107:[[12501,12451,12540,12488],256],13108:[[12502,12483,12471,12455,12523],256],13109:[[12501,12521,12531],256],13110:[[12504,12463,12479,12540,12523],256],13111:[[12506,12477],256],13112:[[12506,12491,12498],256],13113:[[12504,12523,12484],256],13114:[[12506,12531,12473],256],13115:[[12506,12540,12472],256],13116:[[12505,12540,12479],256],13117:[[12509,12452,12531,12488],256],13118:[[12508,12523,12488],256],13119:[[12507,12531],256],13120:[[12509,12531,12489],256],13121:[[12507,12540,12523],256],13122:[[12507,12540,12531],256],13123:[[12510,12452,12463,12525],256],13124:[[12510,12452,12523],256],13125:[[12510,12483,12495],256],13126:[[12510,12523,12463],256],13127:[[12510,12531,12471,12519,12531],256],13128:[[12511,12463,12525,12531],256],13129:[[12511,12522],256],13130:[[12511,12522,12496,12540,12523],256],13131:[[12513,12460],256],13132:[[12513,12460,12488,12531],256],13133:[[12513,12540,12488,12523],256],13134:[[12516,12540,12489],256],13135:[[12516,12540,12523],256],13136:[[12518,12450,12531],256],13137:[[12522,12483,12488,12523],256],13138:[[12522,12521],256],13139:[[12523,12500,12540],256],13140:[[12523,12540,12502,12523],256],13141:[[12524,12512],256],13142:[[12524,12531,12488,12466,12531],256],13143:[[12527,12483,12488],256],13144:[[48,28857],256],13145:[[49,28857],256],13146:[[50,28857],256],13147:[[51,28857],256],13148:[[52,28857],256],13149:[[53,28857],256],13150:[[54,28857],256],13151:[[55,28857],256],13152:[[56,28857],256],13153:[[57,28857],256],13154:[[49,48,28857],256],13155:[[49,49,28857],256],13156:[[49,50,28857],256],13157:[[49,51,28857],256],13158:[[49,52,28857],256],13159:[[49,53,28857],256],13160:[[49,54,28857],256],13161:[[49,55,28857],256],13162:[[49,56,28857],256],13163:[[49,57,28857],256],13164:[[50,48,28857],256],13165:[[50,49,28857],256],13166:[[50,50,28857],256],13167:[[50,51,28857],256],13168:[[50,52,28857],256],13169:[[104,80,97],256],13170:[[100,97],256],13171:[[65,85],256],13172:[[98,97,114],256],13173:[[111,86],256],13174:[[112,99],256],13175:[[100,109],256],13176:[[100,109,178],256],13177:[[100,109,179],256],13178:[[73,85],256],13179:[[24179,25104],256],13180:[[26157,21644],256],13181:[[22823,27491],256],13182:[[26126,27835],256],13183:[[26666,24335,20250,31038],256],13184:[[112,65],256],13185:[[110,65],256],13186:[[956,65],256],13187:[[109,65],256],13188:[[107,65],256],13189:[[75,66],256],13190:[[77,66],256],13191:[[71,66],256],13192:[[99,97,108],256],13193:[[107,99,97,108],256],13194:[[112,70],256],13195:[[110,70],256],13196:[[956,70],256],13197:[[956,103],256],13198:[[109,103],256],13199:[[107,103],256],13200:[[72,122],256],13201:[[107,72,122],256],13202:[[77,72,122],256],13203:[[71,72,122],256],13204:[[84,72,122],256],13205:[[956,8467],256],13206:[[109,8467],256],13207:[[100,8467],256],13208:[[107,8467],256],13209:[[102,109],256],13210:[[110,109],256],13211:[[956,109],256],13212:[[109,109],256],13213:[[99,109],256],13214:[[107,109],256],13215:[[109,109,178],256],13216:[[99,109,178],256],13217:[[109,178],256],13218:[[107,109,178],256],13219:[[109,109,179],256],13220:[[99,109,179],256],13221:[[109,179],256],13222:[[107,109,179],256],13223:[[109,8725,115],256],13224:[[109,8725,115,178],256],13225:[[80,97],256],13226:[[107,80,97],256],13227:[[77,80,97],256],13228:[[71,80,97],256],13229:[[114,97,100],256],13230:[[114,97,100,8725,115],256],13231:[[114,97,100,8725,115,178],256],13232:[[112,115],256],13233:[[110,115],256],13234:[[956,115],256],13235:[[109,115],256],13236:[[112,86],256],13237:[[110,86],256],13238:[[956,86],256],13239:[[109,86],256],13240:[[107,86],256],13241:[[77,86],256],13242:[[112,87],256],13243:[[110,87],256],13244:[[956,87],256],13245:[[109,87],256],13246:[[107,87],256],13247:[[77,87],256],13248:[[107,937],256],13249:[[77,937],256],13250:[[97,46,109,46],256],13251:[[66,113],256],13252:[[99,99],256],13253:[[99,100],256],13254:[[67,8725,107,103],256],13255:[[67,111,46],256],13256:[[100,66],256],13257:[[71,121],256],13258:[[104,97],256],13259:[[72,80],256],13260:[[105,110],256],13261:[[75,75],256],13262:[[75,77],256],13263:[[107,116],256],13264:[[108,109],256],13265:[[108,110],256],13266:[[108,111,103],256],13267:[[108,120],256],13268:[[109,98],256],13269:[[109,105,108],256],13270:[[109,111,108],256],13271:[[80,72],256],13272:[[112,46,109,46],256],13273:[[80,80,77],256],13274:[[80,82],256],13275:[[115,114],256],13276:[[83,118],256],13277:[[87,98],256],13278:[[86,8725,109],256],13279:[[65,8725,109],256],13280:[[49,26085],256],13281:[[50,26085],256],13282:[[51,26085],256],13283:[[52,26085],256],13284:[[53,26085],256],13285:[[54,26085],256],13286:[[55,26085],256],13287:[[56,26085],256],13288:[[57,26085],256],13289:[[49,48,26085],256],13290:[[49,49,26085],256],13291:[[49,50,26085],256],13292:[[49,51,26085],256],13293:[[49,52,26085],256],13294:[[49,53,26085],256],13295:[[49,54,26085],256],13296:[[49,55,26085],256],13297:[[49,56,26085],256],13298:[[49,57,26085],256],13299:[[50,48,26085],256],13300:[[50,49,26085],256],13301:[[50,50,26085],256],13302:[[50,51,26085],256],13303:[[50,52,26085],256],13304:[[50,53,26085],256],13305:[[50,54,26085],256],13306:[[50,55,26085],256],13307:[[50,56,26085],256],13308:[[50,57,26085],256],13309:[[51,48,26085],256],13310:[[51,49,26085],256],13311:[[103,97,108],256]},27136:{92912:[,1],92913:[,1],92914:[,1],92915:[,1],92916:[,1]},27392:{92976:[,230],92977:[,230],92978:[,230],92979:[,230],92980:[,230],92981:[,230],92982:[,230]},42496:{42607:[,230],42612:[,230],42613:[,230],42614:[,230],42615:[,230],42616:[,230],42617:[,230],42618:[,230],42619:[,230],42620:[,230],42621:[,230],42652:[[1098],256],42653:[[1100],256],42655:[,230],42736:[,230],42737:[,230]},42752:{42864:[[42863],256],43e3:[[294],256],43001:[[339],256]},43008:{43014:[,9],43204:[,9],43232:[,230],43233:[,230],43234:[,230],43235:[,230],43236:[,230],43237:[,230],43238:[,230],43239:[,230],43240:[,230],43241:[,230],43242:[,230],43243:[,230],43244:[,230],43245:[,230],43246:[,230],43247:[,230],43248:[,230],43249:[,230]},43264:{43307:[,220],43308:[,220],43309:[,220],43347:[,9],43443:[,7],43456:[,9]},43520:{43696:[,230],43698:[,230],43699:[,230],43700:[,220],43703:[,230],43704:[,230],43710:[,230],43711:[,230],43713:[,230],43766:[,9]},43776:{43868:[[42791],256],43869:[[43831],256],43870:[[619],256],43871:[[43858],256],44013:[,9]},48128:{113822:[,1]},53504:{119134:[[119127,119141],512],119135:[[119128,119141],512],119136:[[119135,119150],512],119137:[[119135,119151],512],119138:[[119135,119152],512],119139:[[119135,119153],512],119140:[[119135,119154],512],119141:[,216],119142:[,216],119143:[,1],119144:[,1],119145:[,1],119149:[,226],119150:[,216],119151:[,216],119152:[,216],119153:[,216],119154:[,216],119163:[,220],119164:[,220],119165:[,220],119166:[,220],119167:[,220],119168:[,220],119169:[,220],119170:[,220],119173:[,230],119174:[,230],119175:[,230],119176:[,230],119177:[,230],119178:[,220],119179:[,220],119210:[,230],119211:[,230],119212:[,230],119213:[,230],119227:[[119225,119141],512],119228:[[119226,119141],512],119229:[[119227,119150],512],119230:[[119228,119150],512],119231:[[119227,119151],512],119232:[[119228,119151],512]},53760:{119362:[,230],119363:[,230],119364:[,230]},54272:{119808:[[65],256],119809:[[66],256],119810:[[67],256],119811:[[68],256],119812:[[69],256],119813:[[70],256],119814:[[71],256],119815:[[72],256],119816:[[73],256],119817:[[74],256],119818:[[75],256],119819:[[76],256],119820:[[77],256],119821:[[78],256],119822:[[79],256],119823:[[80],256],119824:[[81],256],119825:[[82],256],119826:[[83],256],119827:[[84],256],119828:[[85],256],119829:[[86],256],119830:[[87],256],119831:[[88],256],119832:[[89],256],119833:[[90],256],119834:[[97],256],119835:[[98],256],119836:[[99],256],119837:[[100],256],119838:[[101],256],119839:[[102],256],119840:[[103],256],119841:[[104],256],119842:[[105],256],119843:[[106],256],119844:[[107],256],119845:[[108],256],119846:[[109],256],119847:[[110],256],119848:[[111],256],119849:[[112],256],119850:[[113],256],119851:[[114],256],119852:[[115],256],119853:[[116],256],119854:[[117],256],119855:[[118],256],119856:[[119],256],119857:[[120],256],119858:[[121],256],119859:[[122],256],119860:[[65],256],119861:[[66],256],119862:[[67],256],119863:[[68],256],119864:[[69],256],119865:[[70],256],119866:[[71],256],119867:[[72],256],119868:[[73],256],119869:[[74],256],119870:[[75],256],119871:[[76],256],119872:[[77],256],119873:[[78],256],119874:[[79],256],119875:[[80],256],119876:[[81],256],119877:[[82],256],119878:[[83],256],119879:[[84],256],119880:[[85],256],119881:[[86],256],119882:[[87],256],119883:[[88],256],119884:[[89],256],119885:[[90],256],119886:[[97],256],119887:[[98],256],119888:[[99],256],119889:[[100],256],119890:[[101],256],119891:[[102],256],119892:[[103],256],119894:[[105],256],119895:[[106],256],119896:[[107],256],119897:[[108],256],119898:[[109],256],119899:[[110],256],119900:[[111],256],119901:[[112],256],119902:[[113],256],119903:[[114],256],119904:[[115],256],119905:[[116],256],119906:[[117],256],119907:[[118],256],119908:[[119],256],119909:[[120],256],119910:[[121],256],119911:[[122],256],119912:[[65],256],119913:[[66],256],119914:[[67],256],119915:[[68],256],119916:[[69],256],119917:[[70],256],119918:[[71],256],119919:[[72],256],119920:[[73],256],119921:[[74],256],119922:[[75],256],119923:[[76],256],119924:[[77],256],119925:[[78],256],119926:[[79],256],119927:[[80],256],119928:[[81],256],119929:[[82],256],119930:[[83],256],119931:[[84],256],119932:[[85],256],119933:[[86],256],119934:[[87],256],119935:[[88],256],119936:[[89],256],119937:[[90],256],119938:[[97],256],119939:[[98],256],119940:[[99],256],119941:[[100],256],119942:[[101],256],119943:[[102],256],119944:[[103],256],119945:[[104],256],119946:[[105],256],119947:[[106],256],119948:[[107],256],119949:[[108],256],119950:[[109],256],119951:[[110],256],119952:[[111],256],119953:[[112],256],119954:[[113],256],119955:[[114],256],119956:[[115],256],119957:[[116],256],119958:[[117],256],119959:[[118],256],119960:[[119],256],119961:[[120],256],119962:[[121],256],119963:[[122],256],119964:[[65],256],119966:[[67],256],119967:[[68],256],119970:[[71],256],119973:[[74],256],119974:[[75],256],119977:[[78],256],119978:[[79],256],119979:[[80],256],119980:[[81],256],119982:[[83],256],119983:[[84],256],119984:[[85],256],119985:[[86],256],119986:[[87],256],119987:[[88],256],119988:[[89],256],119989:[[90],256],119990:[[97],256],119991:[[98],256],119992:[[99],256],119993:[[100],256],119995:[[102],256],119997:[[104],256],119998:[[105],256],119999:[[106],256],12e4:[[107],256],120001:[[108],256],120002:[[109],256],120003:[[110],256],120005:[[112],256],120006:[[113],256],120007:[[114],256],120008:[[115],256],120009:[[116],256],120010:[[117],256],120011:[[118],256],120012:[[119],256],120013:[[120],256],120014:[[121],256],120015:[[122],256],120016:[[65],256],120017:[[66],256],120018:[[67],256],120019:[[68],256],120020:[[69],256],120021:[[70],256],120022:[[71],256],120023:[[72],256],120024:[[73],256],120025:[[74],256],120026:[[75],256],120027:[[76],256],120028:[[77],256],120029:[[78],256],120030:[[79],256],120031:[[80],256],120032:[[81],256],120033:[[82],256],120034:[[83],256],120035:[[84],256],120036:[[85],256],120037:[[86],256],120038:[[87],256],120039:[[88],256],120040:[[89],256],120041:[[90],256],120042:[[97],256],120043:[[98],256],120044:[[99],256],120045:[[100],256],120046:[[101],256],120047:[[102],256],120048:[[103],256],120049:[[104],256],120050:[[105],256],120051:[[106],256],120052:[[107],256],120053:[[108],256],120054:[[109],256],120055:[[110],256],120056:[[111],256],120057:[[112],256],120058:[[113],256],120059:[[114],256],120060:[[115],256],120061:[[116],256],120062:[[117],256],120063:[[118],256]},54528:{120064:[[119],256],120065:[[120],256],120066:[[121],256],120067:[[122],256],120068:[[65],256],120069:[[66],256],120071:[[68],256],120072:[[69],256],120073:[[70],256],120074:[[71],256],120077:[[74],256],120078:[[75],256],120079:[[76],256],120080:[[77],256],120081:[[78],256],120082:[[79],256],120083:[[80],256],120084:[[81],256],120086:[[83],256],120087:[[84],256],120088:[[85],256],120089:[[86],256],120090:[[87],256],120091:[[88],256],120092:[[89],256],120094:[[97],256],120095:[[98],256],120096:[[99],256],120097:[[100],256],120098:[[101],256],120099:[[102],256],120100:[[103],256],120101:[[104],256],120102:[[105],256],120103:[[106],256],120104:[[107],256],120105:[[108],256],120106:[[109],256],120107:[[110],256],120108:[[111],256],120109:[[112],256],120110:[[113],256],120111:[[114],256],120112:[[115],256],120113:[[116],256],120114:[[117],256],120115:[[118],256],120116:[[119],256],120117:[[120],256],120118:[[121],256],120119:[[122],256],120120:[[65],256],120121:[[66],256],120123:[[68],256],120124:[[69],256],120125:[[70],256],120126:[[71],256],120128:[[73],256],120129:[[74],256],120130:[[75],256],120131:[[76],256],120132:[[77],256],120134:[[79],256],120138:[[83],256],120139:[[84],256],120140:[[85],256],120141:[[86],256],120142:[[87],256],120143:[[88],256],120144:[[89],256],120146:[[97],256],120147:[[98],256],120148:[[99],256],120149:[[100],256],120150:[[101],256],120151:[[102],256],120152:[[103],256],120153:[[104],256],120154:[[105],256],120155:[[106],256],120156:[[107],256],120157:[[108],256],120158:[[109],256],120159:[[110],256],120160:[[111],256],120161:[[112],256],120162:[[113],256],120163:[[114],256],120164:[[115],256],120165:[[116],256],120166:[[117],256],120167:[[118],256],120168:[[119],256],120169:[[120],256],120170:[[121],256],120171:[[122],256],120172:[[65],256],120173:[[66],256],120174:[[67],256],120175:[[68],256],120176:[[69],256],120177:[[70],256],120178:[[71],256],120179:[[72],256],120180:[[73],256],120181:[[74],256],120182:[[75],256],120183:[[76],256],120184:[[77],256],120185:[[78],256],120186:[[79],256],120187:[[80],256],120188:[[81],256],120189:[[82],256],120190:[[83],256],120191:[[84],256],120192:[[85],256],120193:[[86],256],120194:[[87],256],120195:[[88],256],120196:[[89],256],120197:[[90],256],120198:[[97],256],120199:[[98],256],120200:[[99],256],120201:[[100],256],120202:[[101],256],120203:[[102],256],120204:[[103],256],120205:[[104],256],120206:[[105],256],120207:[[106],256],120208:[[107],256],120209:[[108],256],120210:[[109],256],120211:[[110],256],120212:[[111],256],120213:[[112],256],120214:[[113],256],120215:[[114],256],120216:[[115],256],120217:[[116],256],120218:[[117],256],120219:[[118],256],120220:[[119],256],120221:[[120],256],120222:[[121],256],120223:[[122],256],120224:[[65],256],120225:[[66],256],120226:[[67],256],120227:[[68],256],120228:[[69],256],120229:[[70],256],120230:[[71],256],120231:[[72],256],120232:[[73],256],120233:[[74],256],120234:[[75],256],120235:[[76],256],120236:[[77],256],120237:[[78],256],120238:[[79],256],120239:[[80],256],120240:[[81],256],120241:[[82],256],120242:[[83],256],120243:[[84],256],120244:[[85],256],120245:[[86],256],120246:[[87],256],120247:[[88],256],120248:[[89],256],120249:[[90],256],120250:[[97],256],120251:[[98],256],120252:[[99],256],120253:[[100],256],120254:[[101],256],120255:[[102],256],120256:[[103],256],120257:[[104],256],120258:[[105],256],120259:[[106],256],120260:[[107],256],120261:[[108],256],120262:[[109],256],120263:[[110],256],120264:[[111],256],120265:[[112],256],120266:[[113],256],120267:[[114],256],120268:[[115],256],120269:[[116],256],120270:[[117],256],120271:[[118],256],120272:[[119],256],120273:[[120],256],120274:[[121],256],120275:[[122],256],120276:[[65],256],120277:[[66],256],120278:[[67],256],120279:[[68],256],120280:[[69],256],120281:[[70],256],120282:[[71],256],120283:[[72],256],120284:[[73],256],120285:[[74],256],120286:[[75],256],120287:[[76],256],120288:[[77],256],120289:[[78],256],120290:[[79],256],120291:[[80],256],120292:[[81],256],120293:[[82],256],120294:[[83],256],120295:[[84],256],120296:[[85],256],120297:[[86],256],120298:[[87],256],120299:[[88],256],120300:[[89],256],120301:[[90],256],120302:[[97],256],120303:[[98],256],120304:[[99],256],120305:[[100],256],120306:[[101],256],120307:[[102],256],120308:[[103],256],120309:[[104],256],120310:[[105],256],120311:[[106],256],120312:[[107],256],120313:[[108],256],120314:[[109],256],120315:[[110],256],120316:[[111],256],120317:[[112],256],120318:[[113],256],120319:[[114],256]},54784:{120320:[[115],256],120321:[[116],256],120322:[[117],256],120323:[[118],256],120324:[[119],256],120325:[[120],256],120326:[[121],256],120327:[[122],256],120328:[[65],256],120329:[[66],256],120330:[[67],256],120331:[[68],256],120332:[[69],256],120333:[[70],256],120334:[[71],256],120335:[[72],256],120336:[[73],256],120337:[[74],256],120338:[[75],256],120339:[[76],256],120340:[[77],256],120341:[[78],256],120342:[[79],256],120343:[[80],256],120344:[[81],256],120345:[[82],256],120346:[[83],256],120347:[[84],256],120348:[[85],256],120349:[[86],256],120350:[[87],256],120351:[[88],256],120352:[[89],256],120353:[[90],256],120354:[[97],256],120355:[[98],256],120356:[[99],256],120357:[[100],256],120358:[[101],256],120359:[[102],256],120360:[[103],256],120361:[[104],256],120362:[[105],256],120363:[[106],256],120364:[[107],256],120365:[[108],256],120366:[[109],256],120367:[[110],256],120368:[[111],256],120369:[[112],256],120370:[[113],256],120371:[[114],256],120372:[[115],256],120373:[[116],256],120374:[[117],256],120375:[[118],256],120376:[[119],256],120377:[[120],256],120378:[[121],256],120379:[[122],256],120380:[[65],256],120381:[[66],256],120382:[[67],256],120383:[[68],256],120384:[[69],256],120385:[[70],256],120386:[[71],256],120387:[[72],256],120388:[[73],256],120389:[[74],256],120390:[[75],256],120391:[[76],256],120392:[[77],256],120393:[[78],256],120394:[[79],256],120395:[[80],256],120396:[[81],256],120397:[[82],256],120398:[[83],256],120399:[[84],256],120400:[[85],256],120401:[[86],256],120402:[[87],256],120403:[[88],256],120404:[[89],256],120405:[[90],256],120406:[[97],256],120407:[[98],256],120408:[[99],256],120409:[[100],256],120410:[[101],256],120411:[[102],256],120412:[[103],256],120413:[[104],256],120414:[[105],256],120415:[[106],256],120416:[[107],256],120417:[[108],256],120418:[[109],256],120419:[[110],256],120420:[[111],256],120421:[[112],256],120422:[[113],256],120423:[[114],256],120424:[[115],256],120425:[[116],256],120426:[[117],256],120427:[[118],256],120428:[[119],256],120429:[[120],256],120430:[[121],256],120431:[[122],256],120432:[[65],256],120433:[[66],256],120434:[[67],256],120435:[[68],256],120436:[[69],256],120437:[[70],256],120438:[[71],256],120439:[[72],256],120440:[[73],256],120441:[[74],256],120442:[[75],256],120443:[[76],256],120444:[[77],256],120445:[[78],256],120446:[[79],256],120447:[[80],256],120448:[[81],256],120449:[[82],256],120450:[[83],256],120451:[[84],256],120452:[[85],256],120453:[[86],256],120454:[[87],256],120455:[[88],256],120456:[[89],256],120457:[[90],256],120458:[[97],256],120459:[[98],256],120460:[[99],256],120461:[[100],256],120462:[[101],256],120463:[[102],256],120464:[[103],256],120465:[[104],256],120466:[[105],256],120467:[[106],256],120468:[[107],256],120469:[[108],256],120470:[[109],256],120471:[[110],256],120472:[[111],256],120473:[[112],256],120474:[[113],256],120475:[[114],256],120476:[[115],256],120477:[[116],256],120478:[[117],256],120479:[[118],256],120480:[[119],256],120481:[[120],256],120482:[[121],256],120483:[[122],256],120484:[[305],256],120485:[[567],256],120488:[[913],256],120489:[[914],256],120490:[[915],256],120491:[[916],256],120492:[[917],256],120493:[[918],256],120494:[[919],256],120495:[[920],256],120496:[[921],256],120497:[[922],256],120498:[[923],256],120499:[[924],256],120500:[[925],256],120501:[[926],256],120502:[[927],256],120503:[[928],256],120504:[[929],256],120505:[[1012],256],120506:[[931],256],120507:[[932],256],120508:[[933],256],120509:[[934],256],120510:[[935],256],120511:[[936],256],120512:[[937],256],120513:[[8711],256],120514:[[945],256],120515:[[946],256],120516:[[947],256],120517:[[948],256],120518:[[949],256],120519:[[950],256],120520:[[951],256],120521:[[952],256],120522:[[953],256],120523:[[954],256],120524:[[955],256],120525:[[956],256],120526:[[957],256],120527:[[958],256],120528:[[959],256],120529:[[960],256],120530:[[961],256],120531:[[962],256],120532:[[963],256],120533:[[964],256],120534:[[965],256],120535:[[966],256],120536:[[967],256],120537:[[968],256],120538:[[969],256],120539:[[8706],256],120540:[[1013],256],120541:[[977],256],120542:[[1008],256],120543:[[981],256],120544:[[1009],256],120545:[[982],256],120546:[[913],256],120547:[[914],256],120548:[[915],256],120549:[[916],256],120550:[[917],256],120551:[[918],256],120552:[[919],256],120553:[[920],256],120554:[[921],256],120555:[[922],256],120556:[[923],256],120557:[[924],256],120558:[[925],256],120559:[[926],256],120560:[[927],256],120561:[[928],256],120562:[[929],256],120563:[[1012],256],120564:[[931],256],120565:[[932],256],120566:[[933],256],120567:[[934],256],120568:[[935],256],120569:[[936],256],120570:[[937],256],120571:[[8711],256],120572:[[945],256],120573:[[946],256],120574:[[947],256],120575:[[948],256]},55040:{120576:[[949],256],120577:[[950],256],120578:[[951],256],120579:[[952],256],120580:[[953],256],120581:[[954],256],120582:[[955],256],120583:[[956],256],120584:[[957],256],120585:[[958],256],120586:[[959],256],120587:[[960],256],120588:[[961],256],120589:[[962],256],120590:[[963],256],120591:[[964],256],120592:[[965],256],120593:[[966],256],120594:[[967],256],120595:[[968],256],120596:[[969],256],120597:[[8706],256],120598:[[1013],256],120599:[[977],256],120600:[[1008],256],120601:[[981],256],120602:[[1009],256],120603:[[982],256],120604:[[913],256],120605:[[914],256],120606:[[915],256],120607:[[916],256],120608:[[917],256],120609:[[918],256],120610:[[919],256],120611:[[920],256],120612:[[921],256],120613:[[922],256],120614:[[923],256],120615:[[924],256],120616:[[925],256],120617:[[926],256],120618:[[927],256],120619:[[928],256],120620:[[929],256],120621:[[1012],256],120622:[[931],256],120623:[[932],256],120624:[[933],256],120625:[[934],256],120626:[[935],256],120627:[[936],256],120628:[[937],256],120629:[[8711],256],120630:[[945],256],120631:[[946],256],120632:[[947],256],120633:[[948],256],120634:[[949],256],120635:[[950],256],120636:[[951],256],120637:[[952],256],120638:[[953],256],120639:[[954],256],120640:[[955],256],120641:[[956],256],120642:[[957],256],120643:[[958],256],120644:[[959],256],120645:[[960],256],120646:[[961],256],120647:[[962],256],120648:[[963],256],120649:[[964],256],120650:[[965],256],120651:[[966],256],120652:[[967],256],120653:[[968],256],120654:[[969],256],120655:[[8706],256],120656:[[1013],256],120657:[[977],256],120658:[[1008],256],120659:[[981],256],120660:[[1009],256],120661:[[982],256],120662:[[913],256],120663:[[914],256],120664:[[915],256],120665:[[916],256],120666:[[917],256],120667:[[918],256],120668:[[919],256],120669:[[920],256],120670:[[921],256],120671:[[922],256],120672:[[923],256],120673:[[924],256],120674:[[925],256],120675:[[926],256],120676:[[927],256],120677:[[928],256],120678:[[929],256],120679:[[1012],256],120680:[[931],256],120681:[[932],256],120682:[[933],256],120683:[[934],256],120684:[[935],256],120685:[[936],256],120686:[[937],256],120687:[[8711],256],120688:[[945],256],120689:[[946],256],120690:[[947],256],120691:[[948],256],120692:[[949],256],120693:[[950],256],120694:[[951],256],120695:[[952],256],120696:[[953],256],120697:[[954],256],120698:[[955],256],120699:[[956],256],120700:[[957],256],120701:[[958],256],120702:[[959],256],120703:[[960],256],120704:[[961],256],120705:[[962],256],120706:[[963],256],120707:[[964],256],120708:[[965],256],120709:[[966],256],120710:[[967],256],120711:[[968],256],120712:[[969],256],120713:[[8706],256],120714:[[1013],256],120715:[[977],256],120716:[[1008],256],120717:[[981],256],120718:[[1009],256],120719:[[982],256],120720:[[913],256],120721:[[914],256],120722:[[915],256],120723:[[916],256],120724:[[917],256],120725:[[918],256],120726:[[919],256],120727:[[920],256],120728:[[921],256],120729:[[922],256],120730:[[923],256],120731:[[924],256],120732:[[925],256],120733:[[926],256],120734:[[927],256],120735:[[928],256],120736:[[929],256],120737:[[1012],256],120738:[[931],256],120739:[[932],256],120740:[[933],256],120741:[[934],256],120742:[[935],256],120743:[[936],256],120744:[[937],256],120745:[[8711],256],120746:[[945],256],120747:[[946],256],120748:[[947],256],120749:[[948],256],120750:[[949],256],120751:[[950],256],120752:[[951],256],120753:[[952],256],120754:[[953],256],120755:[[954],256],120756:[[955],256],120757:[[956],256],120758:[[957],256],120759:[[958],256],120760:[[959],256],120761:[[960],256],120762:[[961],256],120763:[[962],256],120764:[[963],256],120765:[[964],256],120766:[[965],256],120767:[[966],256],120768:[[967],256],120769:[[968],256],120770:[[969],256],120771:[[8706],256],120772:[[1013],256],120773:[[977],256],120774:[[1008],256],120775:[[981],256],120776:[[1009],256],120777:[[982],256],120778:[[988],256],120779:[[989],256],120782:[[48],256],120783:[[49],256],120784:[[50],256],120785:[[51],256],120786:[[52],256],120787:[[53],256],120788:[[54],256],120789:[[55],256],120790:[[56],256],120791:[[57],256],120792:[[48],256],120793:[[49],256],120794:[[50],256],120795:[[51],256],120796:[[52],256],120797:[[53],256],120798:[[54],256],120799:[[55],256],120800:[[56],256],120801:[[57],256],120802:[[48],256],120803:[[49],256],120804:[[50],256],120805:[[51],256],120806:[[52],256],120807:[[53],256],120808:[[54],256],120809:[[55],256],120810:[[56],256],120811:[[57],256],120812:[[48],256],120813:[[49],256],120814:[[50],256],120815:[[51],256],120816:[[52],256],120817:[[53],256],120818:[[54],256],120819:[[55],256],120820:[[56],256],120821:[[57],256],120822:[[48],256],120823:[[49],256],120824:[[50],256],120825:[[51],256],120826:[[52],256],120827:[[53],256],120828:[[54],256],120829:[[55],256],120830:[[56],256],120831:[[57],256]},59392:{125136:[,220],125137:[,220],125138:[,220],125139:[,220],125140:[,220],125141:[,220],125142:[,220]},60928:{126464:[[1575],256],126465:[[1576],256],126466:[[1580],256],126467:[[1583],256],126469:[[1608],256],126470:[[1586],256],126471:[[1581],256],126472:[[1591],256],126473:[[1610],256],126474:[[1603],256],126475:[[1604],256],126476:[[1605],256],126477:[[1606],256],126478:[[1587],256],126479:[[1593],256],126480:[[1601],256],126481:[[1589],256],126482:[[1602],256],126483:[[1585],256],126484:[[1588],256],126485:[[1578],256],126486:[[1579],256],126487:[[1582],256],126488:[[1584],256],126489:[[1590],256],126490:[[1592],256],126491:[[1594],256],126492:[[1646],256],126493:[[1722],256],126494:[[1697],256],126495:[[1647],256],126497:[[1576],256],126498:[[1580],256],126500:[[1607],256],126503:[[1581],256],126505:[[1610],256],126506:[[1603],256],126507:[[1604],256],126508:[[1605],256],126509:[[1606],256],126510:[[1587],256],126511:[[1593],256],126512:[[1601],256],126513:[[1589],256],126514:[[1602],256],126516:[[1588],256],126517:[[1578],256],126518:[[1579],256],126519:[[1582],256],126521:[[1590],256],126523:[[1594],256],126530:[[1580],256],126535:[[1581],256],126537:[[1610],256],126539:[[1604],256],126541:[[1606],256],126542:[[1587],256],126543:[[1593],256],126545:[[1589],256],126546:[[1602],256],126548:[[1588],256],126551:[[1582],256],126553:[[1590],256],126555:[[1594],256],126557:[[1722],256],126559:[[1647],256],126561:[[1576],256],126562:[[1580],256],126564:[[1607],256],126567:[[1581],256],126568:[[1591],256],126569:[[1610],256],126570:[[1603],256],126572:[[1605],256],126573:[[1606],256],126574:[[1587],256],126575:[[1593],256],126576:[[1601],256],126577:[[1589],256],126578:[[1602],256],126580:[[1588],256],126581:[[1578],256],126582:[[1579],256],126583:[[1582],256],126585:[[1590],256],126586:[[1592],256],126587:[[1594],256],126588:[[1646],256],126590:[[1697],256],126592:[[1575],256],126593:[[1576],256],126594:[[1580],256],126595:[[1583],256],126596:[[1607],256],126597:[[1608],256],126598:[[1586],256],126599:[[1581],256],126600:[[1591],256],126601:[[1610],256],126603:[[1604],256],126604:[[1605],256],126605:[[1606],256],126606:[[1587],256],126607:[[1593],256],126608:[[1601],256],126609:[[1589],256],126610:[[1602],256],126611:[[1585],256],126612:[[1588],256],126613:[[1578],256],126614:[[1579],256],126615:[[1582],256],126616:[[1584],256],126617:[[1590],256],126618:[[1592],256],126619:[[1594],256],126625:[[1576],256],126626:[[1580],256],126627:[[1583],256],126629:[[1608],256],126630:[[1586],256],126631:[[1581],256],126632:[[1591],256],126633:[[1610],256],126635:[[1604],256],126636:[[1605],256],126637:[[1606],256],126638:[[1587],256],126639:[[1593],256],126640:[[1601],256],126641:[[1589],256],126642:[[1602],256],126643:[[1585],256],126644:[[1588],256],126645:[[1578],256],126646:[[1579],256],126647:[[1582],256],126648:[[1584],256],126649:[[1590],256],126650:[[1592],256],126651:[[1594],256]},61696:{127232:[[48,46],256],127233:[[48,44],256],127234:[[49,44],256],127235:[[50,44],256],127236:[[51,44],256],127237:[[52,44],256],127238:[[53,44],256],127239:[[54,44],256],127240:[[55,44],256],127241:[[56,44],256],127242:[[57,44],256],127248:[[40,65,41],256],127249:[[40,66,41],256],127250:[[40,67,41],256],127251:[[40,68,41],256],127252:[[40,69,41],256],127253:[[40,70,41],256],127254:[[40,71,41],256],127255:[[40,72,41],256],127256:[[40,73,41],256],127257:[[40,74,41],256],127258:[[40,75,41],256],127259:[[40,76,41],256],127260:[[40,77,41],256],127261:[[40,78,41],256],127262:[[40,79,41],256],127263:[[40,80,41],256],127264:[[40,81,41],256],127265:[[40,82,41],256],127266:[[40,83,41],256],127267:[[40,84,41],256],127268:[[40,85,41],256],127269:[[40,86,41],256],127270:[[40,87,41],256],127271:[[40,88,41],256],127272:[[40,89,41],256],127273:[[40,90,41],256],127274:[[12308,83,12309],256],127275:[[67],256],127276:[[82],256],127277:[[67,68],256],127278:[[87,90],256],127280:[[65],256],127281:[[66],256],127282:[[67],256],127283:[[68],256],127284:[[69],256],127285:[[70],256],127286:[[71],256],127287:[[72],256],127288:[[73],256],127289:[[74],256],127290:[[75],256],127291:[[76],256],127292:[[77],256],127293:[[78],256],127294:[[79],256],127295:[[80],256],127296:[[81],256],127297:[[82],256],127298:[[83],256],127299:[[84],256],127300:[[85],256],127301:[[86],256],127302:[[87],256],127303:[[88],256],127304:[[89],256],127305:[[90],256],127306:[[72,86],256],127307:[[77,86],256],127308:[[83,68],256],127309:[[83,83],256],127310:[[80,80,86],256],127311:[[87,67],256],127338:[[77,67],256],127339:[[77,68],256],127376:[[68,74],256]},61952:{127488:[[12411,12363],256],127489:[[12467,12467],256],127490:[[12469],256],127504:[[25163],256],127505:[[23383],256],127506:[[21452],256],127507:[[12487],256],127508:[[20108],256],127509:[[22810],256],127510:[[35299],256],127511:[[22825],256],127512:[[20132],256],127513:[[26144],256],127514:[[28961],256],127515:[[26009],256],127516:[[21069],256],127517:[[24460],256],127518:[[20877],256],127519:[[26032],256],127520:[[21021],256],127521:[[32066],256],127522:[[29983],256],127523:[[36009],256],127524:[[22768],256],127525:[[21561],256],127526:[[28436],256],127527:[[25237],256],127528:[[25429],256],127529:[[19968],256],127530:[[19977],256],127531:[[36938],256],127532:[[24038],256],127533:[[20013],256],127534:[[21491],256],127535:[[25351],256],127536:[[36208],256],127537:[[25171],256],127538:[[31105],256],127539:[[31354],256],127540:[[21512],256],127541:[[28288],256],127542:[[26377],256],127543:[[26376],256],127544:[[30003],256],127545:[[21106],256],127546:[[21942],256],127552:[[12308,26412,12309],256],127553:[[12308,19977,12309],256],127554:[[12308,20108,12309],256],127555:[[12308,23433,12309],256],127556:[[12308,28857,12309],256],127557:[[12308,25171,12309],256],127558:[[12308,30423,12309],256],127559:[[12308,21213,12309],256],127560:[[12308,25943,12309],256],127568:[[24471],256],127569:[[21487],256]},63488:{194560:[[20029]],194561:[[20024]],194562:[[20033]],194563:[[131362]],194564:[[20320]],194565:[[20398]],194566:[[20411]],194567:[[20482]],194568:[[20602]],194569:[[20633]],194570:[[20711]],194571:[[20687]],194572:[[13470]],194573:[[132666]],194574:[[20813]],194575:[[20820]],194576:[[20836]],194577:[[20855]],194578:[[132380]],194579:[[13497]],194580:[[20839]],194581:[[20877]],194582:[[132427]],194583:[[20887]],194584:[[20900]],194585:[[20172]],194586:[[20908]],194587:[[20917]],194588:[[168415]],194589:[[20981]],194590:[[20995]],194591:[[13535]],194592:[[21051]],194593:[[21062]],194594:[[21106]],194595:[[21111]],194596:[[13589]],194597:[[21191]],194598:[[21193]],194599:[[21220]],194600:[[21242]],194601:[[21253]],194602:[[21254]],194603:[[21271]],194604:[[21321]],194605:[[21329]],194606:[[21338]],194607:[[21363]],194608:[[21373]],194609:[[21375]],194610:[[21375]],194611:[[21375]],194612:[[133676]],194613:[[28784]],194614:[[21450]],194615:[[21471]],194616:[[133987]],194617:[[21483]],194618:[[21489]],194619:[[21510]],194620:[[21662]],194621:[[21560]],194622:[[21576]],194623:[[21608]],194624:[[21666]],194625:[[21750]],194626:[[21776]],194627:[[21843]],194628:[[21859]],194629:[[21892]],194630:[[21892]],194631:[[21913]],194632:[[21931]],194633:[[21939]],194634:[[21954]],194635:[[22294]],194636:[[22022]],194637:[[22295]],194638:[[22097]],194639:[[22132]],194640:[[20999]],194641:[[22766]],194642:[[22478]],194643:[[22516]],194644:[[22541]],194645:[[22411]],194646:[[22578]],194647:[[22577]],194648:[[22700]],194649:[[136420]],194650:[[22770]],194651:[[22775]],194652:[[22790]],194653:[[22810]],194654:[[22818]],194655:[[22882]],194656:[[136872]],194657:[[136938]],194658:[[23020]],194659:[[23067]],194660:[[23079]],194661:[[23e3]],194662:[[23142]],194663:[[14062]],194664:[[14076]],194665:[[23304]],194666:[[23358]],194667:[[23358]],194668:[[137672]],194669:[[23491]],194670:[[23512]],194671:[[23527]],194672:[[23539]],194673:[[138008]],194674:[[23551]],194675:[[23558]],194676:[[24403]],194677:[[23586]],194678:[[14209]],194679:[[23648]],194680:[[23662]],194681:[[23744]],194682:[[23693]],194683:[[138724]],194684:[[23875]],194685:[[138726]],194686:[[23918]],194687:[[23915]],194688:[[23932]],194689:[[24033]],194690:[[24034]],194691:[[14383]],194692:[[24061]],194693:[[24104]],194694:[[24125]],194695:[[24169]],194696:[[14434]],194697:[[139651]],194698:[[14460]],194699:[[24240]],194700:[[24243]],194701:[[24246]],194702:[[24266]],194703:[[172946]],194704:[[24318]],194705:[[140081]],194706:[[140081]],194707:[[33281]],194708:[[24354]],194709:[[24354]],194710:[[14535]],194711:[[144056]],194712:[[156122]],194713:[[24418]],194714:[[24427]],194715:[[14563]],194716:[[24474]],194717:[[24525]],194718:[[24535]],194719:[[24569]],194720:[[24705]],194721:[[14650]],194722:[[14620]],194723:[[24724]],194724:[[141012]],194725:[[24775]],194726:[[24904]],194727:[[24908]],194728:[[24910]],194729:[[24908]],194730:[[24954]],194731:[[24974]],194732:[[25010]],194733:[[24996]],194734:[[25007]],194735:[[25054]],194736:[[25074]],194737:[[25078]],194738:[[25104]],194739:[[25115]],194740:[[25181]],194741:[[25265]],194742:[[25300]],194743:[[25424]],194744:[[142092]],194745:[[25405]],194746:[[25340]],194747:[[25448]],194748:[[25475]],194749:[[25572]],194750:[[142321]],194751:[[25634]],194752:[[25541]],194753:[[25513]],194754:[[14894]],194755:[[25705]],194756:[[25726]],194757:[[25757]],194758:[[25719]],194759:[[14956]],194760:[[25935]],194761:[[25964]],194762:[[143370]],194763:[[26083]],194764:[[26360]],194765:[[26185]],194766:[[15129]],194767:[[26257]],194768:[[15112]],194769:[[15076]],194770:[[20882]],194771:[[20885]],194772:[[26368]],194773:[[26268]],194774:[[32941]],194775:[[17369]],194776:[[26391]],194777:[[26395]],194778:[[26401]],194779:[[26462]],194780:[[26451]],194781:[[144323]],194782:[[15177]],194783:[[26618]],194784:[[26501]],194785:[[26706]],194786:[[26757]],194787:[[144493]],194788:[[26766]],194789:[[26655]],194790:[[26900]],194791:[[15261]],194792:[[26946]],194793:[[27043]],194794:[[27114]],194795:[[27304]],194796:[[145059]],194797:[[27355]],194798:[[15384]],194799:[[27425]],194800:[[145575]],194801:[[27476]],194802:[[15438]],194803:[[27506]],194804:[[27551]],194805:[[27578]],194806:[[27579]],194807:[[146061]],194808:[[138507]],194809:[[146170]],194810:[[27726]],194811:[[146620]],194812:[[27839]],194813:[[27853]],194814:[[27751]],194815:[[27926]]},63744:{63744:[[35912]],63745:[[26356]],63746:[[36554]],63747:[[36040]],63748:[[28369]],63749:[[20018]],63750:[[21477]],63751:[[40860]],63752:[[40860]],63753:[[22865]],63754:[[37329]],63755:[[21895]],63756:[[22856]],63757:[[25078]],63758:[[30313]],63759:[[32645]],63760:[[34367]],63761:[[34746]],63762:[[35064]],63763:[[37007]],63764:[[27138]],63765:[[27931]],63766:[[28889]],63767:[[29662]],63768:[[33853]],63769:[[37226]],63770:[[39409]],63771:[[20098]],63772:[[21365]],63773:[[27396]],63774:[[29211]],63775:[[34349]],63776:[[40478]],63777:[[23888]],63778:[[28651]],63779:[[34253]],63780:[[35172]],63781:[[25289]],63782:[[33240]],63783:[[34847]],63784:[[24266]],63785:[[26391]],63786:[[28010]],63787:[[29436]],63788:[[37070]],63789:[[20358]],63790:[[20919]],63791:[[21214]],63792:[[25796]],63793:[[27347]],63794:[[29200]],63795:[[30439]],63796:[[32769]],63797:[[34310]],63798:[[34396]],63799:[[36335]],63800:[[38706]],63801:[[39791]],63802:[[40442]],63803:[[30860]],63804:[[31103]],63805:[[32160]],63806:[[33737]],63807:[[37636]],63808:[[40575]],63809:[[35542]],63810:[[22751]],63811:[[24324]],63812:[[31840]],63813:[[32894]],63814:[[29282]],63815:[[30922]],63816:[[36034]],63817:[[38647]],63818:[[22744]],63819:[[23650]],63820:[[27155]],63821:[[28122]],63822:[[28431]],63823:[[32047]],63824:[[32311]],63825:[[38475]],63826:[[21202]],63827:[[32907]],63828:[[20956]],63829:[[20940]],63830:[[31260]],63831:[[32190]],63832:[[33777]],63833:[[38517]],63834:[[35712]],63835:[[25295]],63836:[[27138]],63837:[[35582]],63838:[[20025]],63839:[[23527]],63840:[[24594]],63841:[[29575]],63842:[[30064]],63843:[[21271]],63844:[[30971]],63845:[[20415]],63846:[[24489]],63847:[[19981]],63848:[[27852]],63849:[[25976]],63850:[[32034]],63851:[[21443]],63852:[[22622]],63853:[[30465]],63854:[[33865]],63855:[[35498]],63856:[[27578]],63857:[[36784]],63858:[[27784]],63859:[[25342]],63860:[[33509]],63861:[[25504]],63862:[[30053]],63863:[[20142]],63864:[[20841]],63865:[[20937]],63866:[[26753]],63867:[[31975]],63868:[[33391]],63869:[[35538]],63870:[[37327]],63871:[[21237]],63872:[[21570]],63873:[[22899]],63874:[[24300]],63875:[[26053]],63876:[[28670]],63877:[[31018]],63878:[[38317]],63879:[[39530]],63880:[[40599]],63881:[[40654]],63882:[[21147]],63883:[[26310]],63884:[[27511]],63885:[[36706]],63886:[[24180]],63887:[[24976]],63888:[[25088]],63889:[[25754]],63890:[[28451]],63891:[[29001]],63892:[[29833]],63893:[[31178]],63894:[[32244]],63895:[[32879]],63896:[[36646]],63897:[[34030]],63898:[[36899]],63899:[[37706]],63900:[[21015]],63901:[[21155]],63902:[[21693]],63903:[[28872]],63904:[[35010]],63905:[[35498]],63906:[[24265]],63907:[[24565]],63908:[[25467]],63909:[[27566]],63910:[[31806]],63911:[[29557]],63912:[[20196]],63913:[[22265]],63914:[[23527]],63915:[[23994]],63916:[[24604]],63917:[[29618]],63918:[[29801]],63919:[[32666]],63920:[[32838]],63921:[[37428]],63922:[[38646]],63923:[[38728]],63924:[[38936]],63925:[[20363]],63926:[[31150]],63927:[[37300]],63928:[[38584]],63929:[[24801]],63930:[[20102]],63931:[[20698]],63932:[[23534]],63933:[[23615]],63934:[[26009]],63935:[[27138]],63936:[[29134]],63937:[[30274]],63938:[[34044]],63939:[[36988]],63940:[[40845]],63941:[[26248]],63942:[[38446]],63943:[[21129]],63944:[[26491]],63945:[[26611]],63946:[[27969]],63947:[[28316]],63948:[[29705]],63949:[[30041]],63950:[[30827]],63951:[[32016]],63952:[[39006]],63953:[[20845]],63954:[[25134]],63955:[[38520]],63956:[[20523]],63957:[[23833]],63958:[[28138]],63959:[[36650]],63960:[[24459]],63961:[[24900]],63962:[[26647]],63963:[[29575]],63964:[[38534]],63965:[[21033]],63966:[[21519]],63967:[[23653]],63968:[[26131]],63969:[[26446]],63970:[[26792]],63971:[[27877]],63972:[[29702]],63973:[[30178]],63974:[[32633]],63975:[[35023]],63976:[[35041]],63977:[[37324]],63978:[[38626]],63979:[[21311]],63980:[[28346]],63981:[[21533]],63982:[[29136]],63983:[[29848]],63984:[[34298]],63985:[[38563]],63986:[[40023]],63987:[[40607]],63988:[[26519]],63989:[[28107]],63990:[[33256]],63991:[[31435]],63992:[[31520]],63993:[[31890]],63994:[[29376]],63995:[[28825]],63996:[[35672]],63997:[[20160]],63998:[[33590]],63999:[[21050]],194816:[[27966]],194817:[[28023]],194818:[[27969]],194819:[[28009]],194820:[[28024]],194821:[[28037]],194822:[[146718]],194823:[[27956]],194824:[[28207]],194825:[[28270]],194826:[[15667]],194827:[[28363]],194828:[[28359]],194829:[[147153]],194830:[[28153]],194831:[[28526]],194832:[[147294]],194833:[[147342]],194834:[[28614]],194835:[[28729]],194836:[[28702]],194837:[[28699]],194838:[[15766]],194839:[[28746]],194840:[[28797]],194841:[[28791]],194842:[[28845]],194843:[[132389]],194844:[[28997]],194845:[[148067]],194846:[[29084]],194847:[[148395]],194848:[[29224]],194849:[[29237]],194850:[[29264]],194851:[[149e3]],194852:[[29312]],194853:[[29333]],194854:[[149301]],194855:[[149524]],194856:[[29562]],194857:[[29579]],194858:[[16044]],194859:[[29605]],194860:[[16056]],194861:[[16056]],194862:[[29767]],194863:[[29788]],194864:[[29809]],194865:[[29829]],194866:[[29898]],194867:[[16155]],194868:[[29988]],194869:[[150582]],194870:[[30014]],194871:[[150674]],194872:[[30064]],194873:[[139679]],194874:[[30224]],194875:[[151457]],194876:[[151480]],194877:[[151620]],194878:[[16380]],194879:[[16392]],194880:[[30452]],194881:[[151795]],194882:[[151794]],194883:[[151833]],194884:[[151859]],194885:[[30494]],194886:[[30495]],194887:[[30495]],194888:[[30538]],194889:[[16441]],194890:[[30603]],194891:[[16454]],194892:[[16534]],194893:[[152605]],194894:[[30798]],194895:[[30860]],194896:[[30924]],194897:[[16611]],194898:[[153126]],194899:[[31062]],194900:[[153242]],194901:[[153285]],194902:[[31119]],194903:[[31211]],194904:[[16687]],194905:[[31296]],194906:[[31306]],194907:[[31311]],194908:[[153980]],194909:[[154279]],194910:[[154279]],194911:[[31470]],194912:[[16898]],194913:[[154539]],194914:[[31686]],194915:[[31689]],194916:[[16935]],194917:[[154752]],194918:[[31954]],194919:[[17056]],194920:[[31976]],194921:[[31971]],194922:[[32e3]],194923:[[155526]],194924:[[32099]],194925:[[17153]],194926:[[32199]],194927:[[32258]],194928:[[32325]],194929:[[17204]],194930:[[156200]],194931:[[156231]],194932:[[17241]],194933:[[156377]],194934:[[32634]],194935:[[156478]],194936:[[32661]],194937:[[32762]],194938:[[32773]],194939:[[156890]],194940:[[156963]],194941:[[32864]],194942:[[157096]],194943:[[32880]],194944:[[144223]],194945:[[17365]],194946:[[32946]],194947:[[33027]],194948:[[17419]],194949:[[33086]],194950:[[23221]],194951:[[157607]],194952:[[157621]],194953:[[144275]],194954:[[144284]],194955:[[33281]],194956:[[33284]],194957:[[36766]],194958:[[17515]],194959:[[33425]],194960:[[33419]],194961:[[33437]],194962:[[21171]],194963:[[33457]],194964:[[33459]],194965:[[33469]],194966:[[33510]],194967:[[158524]],194968:[[33509]],194969:[[33565]],194970:[[33635]],194971:[[33709]],194972:[[33571]],194973:[[33725]],194974:[[33767]],194975:[[33879]],194976:[[33619]],194977:[[33738]],194978:[[33740]],194979:[[33756]],194980:[[158774]],194981:[[159083]],194982:[[158933]],194983:[[17707]],194984:[[34033]],194985:[[34035]],194986:[[34070]],194987:[[160714]],194988:[[34148]],194989:[[159532]],194990:[[17757]],194991:[[17761]],194992:[[159665]],194993:[[159954]],194994:[[17771]],194995:[[34384]],194996:[[34396]],194997:[[34407]],194998:[[34409]],194999:[[34473]],195e3:[[34440]],195001:[[34574]],195002:[[34530]],195003:[[34681]],195004:[[34600]],195005:[[34667]],195006:[[34694]],195007:[[17879]],195008:[[34785]],195009:[[34817]],195010:[[17913]],195011:[[34912]],195012:[[34915]],195013:[[161383]],195014:[[35031]],195015:[[35038]],195016:[[17973]],195017:[[35066]],195018:[[13499]],195019:[[161966]],195020:[[162150]],195021:[[18110]],195022:[[18119]],195023:[[35488]],195024:[[35565]],195025:[[35722]],195026:[[35925]],195027:[[162984]],195028:[[36011]],195029:[[36033]],195030:[[36123]],195031:[[36215]],195032:[[163631]],195033:[[133124]],195034:[[36299]],195035:[[36284]],195036:[[36336]],195037:[[133342]],195038:[[36564]],195039:[[36664]],195040:[[165330]],195041:[[165357]],195042:[[37012]],195043:[[37105]],195044:[[37137]],195045:[[165678]],195046:[[37147]],195047:[[37432]],195048:[[37591]],195049:[[37592]],195050:[[37500]],195051:[[37881]],195052:[[37909]],195053:[[166906]],195054:[[38283]],195055:[[18837]],195056:[[38327]],195057:[[167287]],195058:[[18918]],195059:[[38595]],195060:[[23986]],195061:[[38691]],195062:[[168261]],195063:[[168474]],195064:[[19054]],195065:[[19062]],195066:[[38880]],195067:[[168970]],195068:[[19122]],195069:[[169110]],195070:[[38923]],195071:[[38923]]},64e3:{64e3:[[20999]],64001:[[24230]],64002:[[25299]],64003:[[31958]],64004:[[23429]],64005:[[27934]],64006:[[26292]],64007:[[36667]],64008:[[34892]],64009:[[38477]],64010:[[35211]],64011:[[24275]],64012:[[20800]],64013:[[21952]],64016:[[22618]],64018:[[26228]],64021:[[20958]],64022:[[29482]],64023:[[30410]],64024:[[31036]],64025:[[31070]],64026:[[31077]],64027:[[31119]],64028:[[38742]],64029:[[31934]],64030:[[32701]],64032:[[34322]],64034:[[35576]],64037:[[36920]],64038:[[37117]],64042:[[39151]],64043:[[39164]],64044:[[39208]],64045:[[40372]],64046:[[37086]],64047:[[38583]],64048:[[20398]],64049:[[20711]],64050:[[20813]],64051:[[21193]],64052:[[21220]],64053:[[21329]],64054:[[21917]],64055:[[22022]],64056:[[22120]],64057:[[22592]],64058:[[22696]],64059:[[23652]],64060:[[23662]],64061:[[24724]],64062:[[24936]],64063:[[24974]],64064:[[25074]],64065:[[25935]],64066:[[26082]],64067:[[26257]],64068:[[26757]],64069:[[28023]],64070:[[28186]],64071:[[28450]],64072:[[29038]],64073:[[29227]],64074:[[29730]],64075:[[30865]],64076:[[31038]],64077:[[31049]],64078:[[31048]],64079:[[31056]],64080:[[31062]],64081:[[31069]],64082:[[31117]],64083:[[31118]],64084:[[31296]],64085:[[31361]],64086:[[31680]],64087:[[32244]],64088:[[32265]],64089:[[32321]],64090:[[32626]],64091:[[32773]],64092:[[33261]],64093:[[33401]],64094:[[33401]],64095:[[33879]],64096:[[35088]],64097:[[35222]],64098:[[35585]],64099:[[35641]],64100:[[36051]],64101:[[36104]],64102:[[36790]],64103:[[36920]],64104:[[38627]],64105:[[38911]],64106:[[38971]],64107:[[24693]],64108:[[148206]],64109:[[33304]],64112:[[20006]],64113:[[20917]],64114:[[20840]],64115:[[20352]],64116:[[20805]],64117:[[20864]],64118:[[21191]],64119:[[21242]],64120:[[21917]],64121:[[21845]],64122:[[21913]],64123:[[21986]],64124:[[22618]],64125:[[22707]],64126:[[22852]],64127:[[22868]],64128:[[23138]],64129:[[23336]],64130:[[24274]],64131:[[24281]],64132:[[24425]],64133:[[24493]],64134:[[24792]],64135:[[24910]],64136:[[24840]],64137:[[24974]],64138:[[24928]],64139:[[25074]],64140:[[25140]],64141:[[25540]],64142:[[25628]],64143:[[25682]],64144:[[25942]],64145:[[26228]],64146:[[26391]],64147:[[26395]],64148:[[26454]],64149:[[27513]],64150:[[27578]],64151:[[27969]],64152:[[28379]],64153:[[28363]],64154:[[28450]],64155:[[28702]],64156:[[29038]],64157:[[30631]],64158:[[29237]],64159:[[29359]],64160:[[29482]],64161:[[29809]],64162:[[29958]],64163:[[30011]],64164:[[30237]],64165:[[30239]],64166:[[30410]],64167:[[30427]],64168:[[30452]],64169:[[30538]],64170:[[30528]],64171:[[30924]],64172:[[31409]],64173:[[31680]],64174:[[31867]],64175:[[32091]],64176:[[32244]],64177:[[32574]],64178:[[32773]],64179:[[33618]],64180:[[33775]],64181:[[34681]],64182:[[35137]],64183:[[35206]],64184:[[35222]],64185:[[35519]],64186:[[35576]],64187:[[35531]],64188:[[35585]],64189:[[35582]],64190:[[35565]],64191:[[35641]],64192:[[35722]],64193:[[36104]],64194:[[36664]],64195:[[36978]],64196:[[37273]],64197:[[37494]],64198:[[38524]],64199:[[38627]],64200:[[38742]],64201:[[38875]],64202:[[38911]],64203:[[38923]],64204:[[38971]],64205:[[39698]],64206:[[40860]],64207:[[141386]],64208:[[141380]],64209:[[144341]],64210:[[15261]],64211:[[16408]],64212:[[16441]],64213:[[152137]],64214:[[154832]],64215:[[163539]],64216:[[40771]],64217:[[40846]],195072:[[38953]],195073:[[169398]],195074:[[39138]],195075:[[19251]],195076:[[39209]],195077:[[39335]],195078:[[39362]],195079:[[39422]],195080:[[19406]],195081:[[170800]],195082:[[39698]],195083:[[4e4]],195084:[[40189]],195085:[[19662]],195086:[[19693]],195087:[[40295]],195088:[[172238]],195089:[[19704]],195090:[[172293]],195091:[[172558]],195092:[[172689]],195093:[[40635]],195094:[[19798]],195095:[[40697]],195096:[[40702]],195097:[[40709]],195098:[[40719]],195099:[[40726]],195100:[[40763]],195101:[[173568]]},64256:{64256:[[102,102],256],64257:[[102,105],256],64258:[[102,108],256],64259:[[102,102,105],256],64260:[[102,102,108],256],64261:[[383,116],256],64262:[[115,116],256],64275:[[1396,1398],256],64276:[[1396,1381],256],64277:[[1396,1387],256],64278:[[1406,1398],256],64279:[[1396,1389],256],64285:[[1497,1460],512],64286:[,26],64287:[[1522,1463],512],64288:[[1506],256],64289:[[1488],256],64290:[[1491],256],64291:[[1492],256],64292:[[1499],256],64293:[[1500],256],64294:[[1501],256],64295:[[1512],256],64296:[[1514],256],64297:[[43],256],64298:[[1513,1473],512],64299:[[1513,1474],512],64300:[[64329,1473],512],64301:[[64329,1474],512],64302:[[1488,1463],512],64303:[[1488,1464],512],64304:[[1488,1468],512],64305:[[1489,1468],512],64306:[[1490,1468],512],64307:[[1491,1468],512],64308:[[1492,1468],512],64309:[[1493,1468],512],64310:[[1494,1468],512],64312:[[1496,1468],512],64313:[[1497,1468],512],64314:[[1498,1468],512],64315:[[1499,1468],512],64316:[[1500,1468],512],64318:[[1502,1468],512],64320:[[1504,1468],512],64321:[[1505,1468],512],64323:[[1507,1468],512],64324:[[1508,1468],512],64326:[[1510,1468],512],64327:[[1511,1468],512],64328:[[1512,1468],512],64329:[[1513,1468],512],64330:[[1514,1468],512],64331:[[1493,1465],512],64332:[[1489,1471],512],64333:[[1499,1471],512],64334:[[1508,1471],512],64335:[[1488,1500],256],64336:[[1649],256],64337:[[1649],256],64338:[[1659],256],64339:[[1659],256],64340:[[1659],256],64341:[[1659],256],64342:[[1662],256],64343:[[1662],256],64344:[[1662],256],64345:[[1662],256],64346:[[1664],256],64347:[[1664],256],64348:[[1664],256],64349:[[1664],256],64350:[[1658],256],64351:[[1658],256],64352:[[1658],256],64353:[[1658],256],64354:[[1663],256],64355:[[1663],256],64356:[[1663],256],64357:[[1663],256],64358:[[1657],256],64359:[[1657],256],64360:[[1657],256],64361:[[1657],256],64362:[[1700],256],64363:[[1700],256],64364:[[1700],256],64365:[[1700],256],64366:[[1702],256],64367:[[1702],256],64368:[[1702],256],64369:[[1702],256],64370:[[1668],256],64371:[[1668],256],64372:[[1668],256],64373:[[1668],256],64374:[[1667],256],64375:[[1667],256],64376:[[1667],256],64377:[[1667],256],64378:[[1670],256],64379:[[1670],256],64380:[[1670],256],64381:[[1670],256],64382:[[1671],256],64383:[[1671],256],64384:[[1671],256],64385:[[1671],256],64386:[[1677],256],64387:[[1677],256],64388:[[1676],256],64389:[[1676],256],64390:[[1678],256],64391:[[1678],256],64392:[[1672],256],64393:[[1672],256],64394:[[1688],256],64395:[[1688],256],64396:[[1681],256],64397:[[1681],256],64398:[[1705],256],64399:[[1705],256],64400:[[1705],256],64401:[[1705],256],64402:[[1711],256],64403:[[1711],256],64404:[[1711],256],64405:[[1711],256],64406:[[1715],256],64407:[[1715],256],64408:[[1715],256],64409:[[1715],256],64410:[[1713],256],64411:[[1713],256],64412:[[1713],256],64413:[[1713],256],64414:[[1722],256],64415:[[1722],256],64416:[[1723],256],64417:[[1723],256],64418:[[1723],256],64419:[[1723],256],64420:[[1728],256],64421:[[1728],256],64422:[[1729],256],64423:[[1729],256],64424:[[1729],256],64425:[[1729],256],64426:[[1726],256],64427:[[1726],256],64428:[[1726],256],64429:[[1726],256],64430:[[1746],256],64431:[[1746],256],64432:[[1747],256],64433:[[1747],256],64467:[[1709],256],64468:[[1709],256],64469:[[1709],256],64470:[[1709],256],64471:[[1735],256],64472:[[1735],256],64473:[[1734],256],64474:[[1734],256],64475:[[1736],256],64476:[[1736],256],64477:[[1655],256],64478:[[1739],256],64479:[[1739],256],64480:[[1733],256],64481:[[1733],256],64482:[[1737],256],64483:[[1737],256],64484:[[1744],256],64485:[[1744],256],64486:[[1744],256],64487:[[1744],256],64488:[[1609],256],64489:[[1609],256],64490:[[1574,1575],256],64491:[[1574,1575],256],64492:[[1574,1749],256],64493:[[1574,1749],256],64494:[[1574,1608],256],64495:[[1574,1608],256],64496:[[1574,1735],256],64497:[[1574,1735],256],64498:[[1574,1734],256],64499:[[1574,1734],256],64500:[[1574,1736],256],64501:[[1574,1736],256],64502:[[1574,1744],256],64503:[[1574,1744],256],64504:[[1574,1744],256],64505:[[1574,1609],256],64506:[[1574,1609],256],64507:[[1574,1609],256],64508:[[1740],256],64509:[[1740],256],64510:[[1740],256],64511:[[1740],256]},64512:{64512:[[1574,1580],256],64513:[[1574,1581],256],64514:[[1574,1605],256],64515:[[1574,1609],256],64516:[[1574,1610],256],64517:[[1576,1580],256],64518:[[1576,1581],256],64519:[[1576,1582],256],64520:[[1576,1605],256],64521:[[1576,1609],256],64522:[[1576,1610],256],64523:[[1578,1580],256],64524:[[1578,1581],256],64525:[[1578,1582],256],64526:[[1578,1605],256],64527:[[1578,1609],256],64528:[[1578,1610],256],64529:[[1579,1580],256],64530:[[1579,1605],256],64531:[[1579,1609],256],64532:[[1579,1610],256],64533:[[1580,1581],256],64534:[[1580,1605],256],64535:[[1581,1580],256],64536:[[1581,1605],256],64537:[[1582,1580],256],64538:[[1582,1581],256],64539:[[1582,1605],256],64540:[[1587,1580],256],64541:[[1587,1581],256],64542:[[1587,1582],256],64543:[[1587,1605],256],64544:[[1589,1581],256],64545:[[1589,1605],256],64546:[[1590,1580],256],64547:[[1590,1581],256],64548:[[1590,1582],256],64549:[[1590,1605],256],64550:[[1591,1581],256],64551:[[1591,1605],256],64552:[[1592,1605],256],64553:[[1593,1580],256],64554:[[1593,1605],256],64555:[[1594,1580],256],64556:[[1594,1605],256],64557:[[1601,1580],256],64558:[[1601,1581],256],64559:[[1601,1582],256],64560:[[1601,1605],256],64561:[[1601,1609],256],64562:[[1601,1610],256],64563:[[1602,1581],256],64564:[[1602,1605],256],64565:[[1602,1609],256],64566:[[1602,1610],256],64567:[[1603,1575],256],64568:[[1603,1580],256],64569:[[1603,1581],256],64570:[[1603,1582],256],64571:[[1603,1604],256],64572:[[1603,1605],256],64573:[[1603,1609],256],64574:[[1603,1610],256],64575:[[1604,1580],256],64576:[[1604,1581],256],64577:[[1604,1582],256],64578:[[1604,1605],256],64579:[[1604,1609],256],64580:[[1604,1610],256],64581:[[1605,1580],256],64582:[[1605,1581],256],64583:[[1605,1582],256],64584:[[1605,1605],256],64585:[[1605,1609],256],64586:[[1605,1610],256],64587:[[1606,1580],256],64588:[[1606,1581],256],64589:[[1606,1582],256],64590:[[1606,1605],256],64591:[[1606,1609],256],64592:[[1606,1610],256],64593:[[1607,1580],256],64594:[[1607,1605],256],64595:[[1607,1609],256],64596:[[1607,1610],256],64597:[[1610,1580],256],64598:[[1610,1581],256],64599:[[1610,1582],256],64600:[[1610,1605],256],64601:[[1610,1609],256],64602:[[1610,1610],256],64603:[[1584,1648],256],64604:[[1585,1648],256],64605:[[1609,1648],256],64606:[[32,1612,1617],256],64607:[[32,1613,1617],256],64608:[[32,1614,1617],256],64609:[[32,1615,1617],256],64610:[[32,1616,1617],256],64611:[[32,1617,1648],256],64612:[[1574,1585],256],64613:[[1574,1586],256],64614:[[1574,1605],256],64615:[[1574,1606],256],64616:[[1574,1609],256],64617:[[1574,1610],256],64618:[[1576,1585],256],64619:[[1576,1586],256],64620:[[1576,1605],256],64621:[[1576,1606],256],64622:[[1576,1609],256],64623:[[1576,1610],256],64624:[[1578,1585],256],64625:[[1578,1586],256],64626:[[1578,1605],256],64627:[[1578,1606],256],64628:[[1578,1609],256],64629:[[1578,1610],256],64630:[[1579,1585],256],64631:[[1579,1586],256],64632:[[1579,1605],256],64633:[[1579,1606],256],64634:[[1579,1609],256],64635:[[1579,1610],256],64636:[[1601,1609],256],64637:[[1601,1610],256],64638:[[1602,1609],256],64639:[[1602,1610],256],64640:[[1603,1575],256],64641:[[1603,1604],256],64642:[[1603,1605],256],64643:[[1603,1609],256],64644:[[1603,1610],256],64645:[[1604,1605],256],64646:[[1604,1609],256],64647:[[1604,1610],256],64648:[[1605,1575],256],64649:[[1605,1605],256],64650:[[1606,1585],256],64651:[[1606,1586],256],64652:[[1606,1605],256],64653:[[1606,1606],256],64654:[[1606,1609],256],64655:[[1606,1610],256],64656:[[1609,1648],256],64657:[[1610,1585],256],64658:[[1610,1586],256],64659:[[1610,1605],256],64660:[[1610,1606],256],64661:[[1610,1609],256],64662:[[1610,1610],256],64663:[[1574,1580],256],64664:[[1574,1581],256],64665:[[1574,1582],256],64666:[[1574,1605],256],64667:[[1574,1607],256],64668:[[1576,1580],256],64669:[[1576,1581],256],64670:[[1576,1582],256],64671:[[1576,1605],256],64672:[[1576,1607],256],64673:[[1578,1580],256],64674:[[1578,1581],256],64675:[[1578,1582],256],64676:[[1578,1605],256],64677:[[1578,1607],256],64678:[[1579,1605],256],64679:[[1580,1581],256],64680:[[1580,1605],256],64681:[[1581,1580],256],64682:[[1581,1605],256],64683:[[1582,1580],256],64684:[[1582,1605],256],64685:[[1587,1580],256],64686:[[1587,1581],256],64687:[[1587,1582],256],64688:[[1587,1605],256],64689:[[1589,1581],256],64690:[[1589,1582],256],64691:[[1589,1605],256],64692:[[1590,1580],256],64693:[[1590,1581],256],64694:[[1590,1582],256],64695:[[1590,1605],256],64696:[[1591,1581],256],64697:[[1592,1605],256],64698:[[1593,1580],256],64699:[[1593,1605],256],64700:[[1594,1580],256],64701:[[1594,1605],256],64702:[[1601,1580],256],64703:[[1601,1581],256],64704:[[1601,1582],256],64705:[[1601,1605],256],64706:[[1602,1581],256],64707:[[1602,1605],256],64708:[[1603,1580],256],64709:[[1603,1581],256],64710:[[1603,1582],256],64711:[[1603,1604],256],64712:[[1603,1605],256],64713:[[1604,1580],256],64714:[[1604,1581],256],64715:[[1604,1582],256],64716:[[1604,1605],256],64717:[[1604,1607],256],64718:[[1605,1580],256],64719:[[1605,1581],256],64720:[[1605,1582],256],64721:[[1605,1605],256],64722:[[1606,1580],256],64723:[[1606,1581],256],64724:[[1606,1582],256],64725:[[1606,1605],256],64726:[[1606,1607],256],64727:[[1607,1580],256],64728:[[1607,1605],256],64729:[[1607,1648],256],64730:[[1610,1580],256],64731:[[1610,1581],256],64732:[[1610,1582],256],64733:[[1610,1605],256],64734:[[1610,1607],256],64735:[[1574,1605],256],64736:[[1574,1607],256],64737:[[1576,1605],256],64738:[[1576,1607],256],64739:[[1578,1605],256],64740:[[1578,1607],256],64741:[[1579,1605],256],64742:[[1579,1607],256],64743:[[1587,1605],256],64744:[[1587,1607],256],64745:[[1588,1605],256],64746:[[1588,1607],256],64747:[[1603,1604],256],64748:[[1603,1605],256],64749:[[1604,1605],256],64750:[[1606,1605],256],64751:[[1606,1607],256],64752:[[1610,1605],256],64753:[[1610,1607],256],64754:[[1600,1614,1617],256],64755:[[1600,1615,1617],256],64756:[[1600,1616,1617],256],64757:[[1591,1609],256],64758:[[1591,1610],256],64759:[[1593,1609],256],64760:[[1593,1610],256],64761:[[1594,1609],256],64762:[[1594,1610],256],64763:[[1587,1609],256],64764:[[1587,1610],256],64765:[[1588,1609],256],64766:[[1588,1610],256],64767:[[1581,1609],256]},64768:{64768:[[1581,1610],256],64769:[[1580,1609],256],64770:[[1580,1610],256],64771:[[1582,1609],256],64772:[[1582,1610],256],64773:[[1589,1609],256],64774:[[1589,1610],256],64775:[[1590,1609],256],64776:[[1590,1610],256],64777:[[1588,1580],256],64778:[[1588,1581],256],64779:[[1588,1582],256],64780:[[1588,1605],256],64781:[[1588,1585],256],64782:[[1587,1585],256],64783:[[1589,1585],256],64784:[[1590,1585],256],64785:[[1591,1609],256],64786:[[1591,1610],256],64787:[[1593,1609],256],64788:[[1593,1610],256],64789:[[1594,1609],256],64790:[[1594,1610],256],64791:[[1587,1609],256],64792:[[1587,1610],256],64793:[[1588,1609],256],64794:[[1588,1610],256],64795:[[1581,1609],256],64796:[[1581,1610],256],64797:[[1580,1609],256],64798:[[1580,1610],256],64799:[[1582,1609],256],64800:[[1582,1610],256],64801:[[1589,1609],256],64802:[[1589,1610],256],64803:[[1590,1609],256],64804:[[1590,1610],256],64805:[[1588,1580],256],64806:[[1588,1581],256],64807:[[1588,1582],256],64808:[[1588,1605],256],64809:[[1588,1585],256],64810:[[1587,1585],256],64811:[[1589,1585],256],64812:[[1590,1585],256],64813:[[1588,1580],256],64814:[[1588,1581],256],64815:[[1588,1582],256],64816:[[1588,1605],256],64817:[[1587,1607],256],64818:[[1588,1607],256],64819:[[1591,1605],256],64820:[[1587,1580],256],64821:[[1587,1581],256],64822:[[1587,1582],256],64823:[[1588,1580],256],64824:[[1588,1581],256],64825:[[1588,1582],256],64826:[[1591,1605],256],64827:[[1592,1605],256],64828:[[1575,1611],256],64829:[[1575,1611],256],64848:[[1578,1580,1605],256],64849:[[1578,1581,1580],256],64850:[[1578,1581,1580],256],64851:[[1578,1581,1605],256],64852:[[1578,1582,1605],256],64853:[[1578,1605,1580],256],64854:[[1578,1605,1581],256],64855:[[1578,1605,1582],256],64856:[[1580,1605,1581],256],64857:[[1580,1605,1581],256],64858:[[1581,1605,1610],256],64859:[[1581,1605,1609],256],64860:[[1587,1581,1580],256],64861:[[1587,1580,1581],256],64862:[[1587,1580,1609],256],64863:[[1587,1605,1581],256],64864:[[1587,1605,1581],256],64865:[[1587,1605,1580],256],64866:[[1587,1605,1605],256],64867:[[1587,1605,1605],256],64868:[[1589,1581,1581],256],64869:[[1589,1581,1581],256],64870:[[1589,1605,1605],256],64871:[[1588,1581,1605],256],64872:[[1588,1581,1605],256],64873:[[1588,1580,1610],256],64874:[[1588,1605,1582],256],64875:[[1588,1605,1582],256],64876:[[1588,1605,1605],256],64877:[[1588,1605,1605],256],64878:[[1590,1581,1609],256],64879:[[1590,1582,1605],256],64880:[[1590,1582,1605],256],64881:[[1591,1605,1581],256],64882:[[1591,1605,1581],256],64883:[[1591,1605,1605],256],64884:[[1591,1605,1610],256],64885:[[1593,1580,1605],256],64886:[[1593,1605,1605],256],64887:[[1593,1605,1605],256],64888:[[1593,1605,1609],256],64889:[[1594,1605,1605],256],64890:[[1594,1605,1610],256],64891:[[1594,1605,1609],256],64892:[[1601,1582,1605],256],64893:[[1601,1582,1605],256],64894:[[1602,1605,1581],256],64895:[[1602,1605,1605],256],64896:[[1604,1581,1605],256],64897:[[1604,1581,1610],256],64898:[[1604,1581,1609],256],64899:[[1604,1580,1580],256],64900:[[1604,1580,1580],256],64901:[[1604,1582,1605],256],64902:[[1604,1582,1605],256],64903:[[1604,1605,1581],256],64904:[[1604,1605,1581],256],64905:[[1605,1581,1580],256],64906:[[1605,1581,1605],256],64907:[[1605,1581,1610],256],64908:[[1605,1580,1581],256],64909:[[1605,1580,1605],256],64910:[[1605,1582,1580],256],64911:[[1605,1582,1605],256],64914:[[1605,1580,1582],256],64915:[[1607,1605,1580],256],64916:[[1607,1605,1605],256],64917:[[1606,1581,1605],256],64918:[[1606,1581,1609],256],64919:[[1606,1580,1605],256],64920:[[1606,1580,1605],256],64921:[[1606,1580,1609],256],64922:[[1606,1605,1610],256],64923:[[1606,1605,1609],256],64924:[[1610,1605,1605],256],64925:[[1610,1605,1605],256],64926:[[1576,1582,1610],256],64927:[[1578,1580,1610],256],64928:[[1578,1580,1609],256],64929:[[1578,1582,1610],256],64930:[[1578,1582,1609],256],64931:[[1578,1605,1610],256],64932:[[1578,1605,1609],256],64933:[[1580,1605,1610],256],64934:[[1580,1581,1609],256],64935:[[1580,1605,1609],256],64936:[[1587,1582,1609],256],64937:[[1589,1581,1610],256],64938:[[1588,1581,1610],256],64939:[[1590,1581,1610],256],64940:[[1604,1580,1610],256],64941:[[1604,1605,1610],256],64942:[[1610,1581,1610],256],64943:[[1610,1580,1610],256],64944:[[1610,1605,1610],256],64945:[[1605,1605,1610],256],64946:[[1602,1605,1610],256],64947:[[1606,1581,1610],256],64948:[[1602,1605,1581],256],64949:[[1604,1581,1605],256],64950:[[1593,1605,1610],256],64951:[[1603,1605,1610],256],64952:[[1606,1580,1581],256],64953:[[1605,1582,1610],256],64954:[[1604,1580,1605],256],64955:[[1603,1605,1605],256],64956:[[1604,1580,1605],256],64957:[[1606,1580,1581],256],64958:[[1580,1581,1610],256],64959:[[1581,1580,1610],256],64960:[[1605,1580,1610],256],64961:[[1601,1605,1610],256],64962:[[1576,1581,1610],256],64963:[[1603,1605,1605],256],64964:[[1593,1580,1605],256],64965:[[1589,1605,1605],256],64966:[[1587,1582,1610],256],64967:[[1606,1580,1610],256],65008:[[1589,1604,1746],256],65009:[[1602,1604,1746],256],65010:[[1575,1604,1604,1607],256],65011:[[1575,1603,1576,1585],256],65012:[[1605,1581,1605,1583],256],65013:[[1589,1604,1593,1605],256],65014:[[1585,1587,1608,1604],256],65015:[[1593,1604,1610,1607],256],65016:[[1608,1587,1604,1605],256],65017:[[1589,1604,1609],256],65018:[[1589,1604,1609,32,1575,1604,1604,1607,32,1593,1604,1610,1607,32,1608,1587,1604,1605],256],65019:[[1580,1604,32,1580,1604,1575,1604,1607],256],65020:[[1585,1740,1575,1604],256]},65024:{65040:[[44],256],65041:[[12289],256],65042:[[12290],256],65043:[[58],256],65044:[[59],256],65045:[[33],256],65046:[[63],256],65047:[[12310],256],65048:[[12311],256],65049:[[8230],256],65056:[,230],65057:[,230],65058:[,230],65059:[,230],65060:[,230],65061:[,230],65062:[,230],65063:[,220],65064:[,220],65065:[,220],65066:[,220],65067:[,220],65068:[,220],65069:[,220],65072:[[8229],256],65073:[[8212],256],65074:[[8211],256],65075:[[95],256],65076:[[95],256],65077:[[40],256],65078:[[41],256],65079:[[123],256],65080:[[125],256],65081:[[12308],256],65082:[[12309],256],65083:[[12304],256],65084:[[12305],256],65085:[[12298],256],65086:[[12299],256],65087:[[12296],256],65088:[[12297],256],65089:[[12300],256],65090:[[12301],256],65091:[[12302],256],65092:[[12303],256],65095:[[91],256],65096:[[93],256],65097:[[8254],256],65098:[[8254],256],65099:[[8254],256],65100:[[8254],256],65101:[[95],256],65102:[[95],256],65103:[[95],256],65104:[[44],256],65105:[[12289],256],65106:[[46],256],65108:[[59],256],65109:[[58],256],65110:[[63],256],65111:[[33],256],65112:[[8212],256],65113:[[40],256],65114:[[41],256],65115:[[123],256],65116:[[125],256],65117:[[12308],256],65118:[[12309],256],65119:[[35],256],65120:[[38],256],65121:[[42],256],65122:[[43],256],65123:[[45],256],65124:[[60],256],65125:[[62],256],65126:[[61],256],65128:[[92],256],65129:[[36],256],65130:[[37],256],65131:[[64],256],65136:[[32,1611],256],65137:[[1600,1611],256],65138:[[32,1612],256],65140:[[32,1613],256],65142:[[32,1614],256],65143:[[1600,1614],256],65144:[[32,1615],256],65145:[[1600,1615],256],65146:[[32,1616],256],65147:[[1600,1616],256],65148:[[32,1617],256],65149:[[1600,1617],256],65150:[[32,1618],256],65151:[[1600,1618],256],65152:[[1569],256],65153:[[1570],256],65154:[[1570],256],65155:[[1571],256],65156:[[1571],256],65157:[[1572],256],65158:[[1572],256],65159:[[1573],256],65160:[[1573],256],65161:[[1574],256],65162:[[1574],256],65163:[[1574],256],65164:[[1574],256],65165:[[1575],256],65166:[[1575],256],65167:[[1576],256],65168:[[1576],256],65169:[[1576],256],65170:[[1576],256],65171:[[1577],256],65172:[[1577],256],65173:[[1578],256],65174:[[1578],256],65175:[[1578],256],65176:[[1578],256],65177:[[1579],256],65178:[[1579],256],65179:[[1579],256],65180:[[1579],256],65181:[[1580],256],65182:[[1580],256],65183:[[1580],256],65184:[[1580],256],65185:[[1581],256],65186:[[1581],256],65187:[[1581],256],65188:[[1581],256],65189:[[1582],256],65190:[[1582],256],65191:[[1582],256],65192:[[1582],256],65193:[[1583],256],65194:[[1583],256],65195:[[1584],256],65196:[[1584],256],65197:[[1585],256],65198:[[1585],256],65199:[[1586],256],65200:[[1586],256],65201:[[1587],256],65202:[[1587],256],65203:[[1587],256],65204:[[1587],256],65205:[[1588],256],65206:[[1588],256],65207:[[1588],256],65208:[[1588],256],65209:[[1589],256],65210:[[1589],256],65211:[[1589],256],65212:[[1589],256],65213:[[1590],256],65214:[[1590],256],65215:[[1590],256],65216:[[1590],256],65217:[[1591],256],65218:[[1591],256],65219:[[1591],256],65220:[[1591],256],65221:[[1592],256],65222:[[1592],256],65223:[[1592],256],65224:[[1592],256],65225:[[1593],256],65226:[[1593],256],65227:[[1593],256],65228:[[1593],256],65229:[[1594],256],65230:[[1594],256],65231:[[1594],256],65232:[[1594],256],65233:[[1601],256],65234:[[1601],256],65235:[[1601],256],65236:[[1601],256],65237:[[1602],256],65238:[[1602],256],65239:[[1602],256],65240:[[1602],256],65241:[[1603],256],65242:[[1603],256],65243:[[1603],256],65244:[[1603],256],65245:[[1604],256],65246:[[1604],256],65247:[[1604],256],65248:[[1604],256],65249:[[1605],256],65250:[[1605],256],65251:[[1605],256],65252:[[1605],256],65253:[[1606],256],65254:[[1606],256],65255:[[1606],256],65256:[[1606],256],65257:[[1607],256],65258:[[1607],256],65259:[[1607],256],65260:[[1607],256],65261:[[1608],256],65262:[[1608],256],65263:[[1609],256],65264:[[1609],256],65265:[[1610],256],65266:[[1610],256],65267:[[1610],256],65268:[[1610],256],65269:[[1604,1570],256],65270:[[1604,1570],256],65271:[[1604,1571],256],65272:[[1604,1571],256],65273:[[1604,1573],256],65274:[[1604,1573],256],65275:[[1604,1575],256],65276:[[1604,1575],256]},65280:{65281:[[33],256],65282:[[34],256],65283:[[35],256],65284:[[36],256],65285:[[37],256],65286:[[38],256],65287:[[39],256],65288:[[40],256],65289:[[41],256],65290:[[42],256],65291:[[43],256],65292:[[44],256],65293:[[45],256],65294:[[46],256],65295:[[47],256],65296:[[48],256],65297:[[49],256],65298:[[50],256],65299:[[51],256],65300:[[52],256],65301:[[53],256],65302:[[54],256],65303:[[55],256],65304:[[56],256],65305:[[57],256],65306:[[58],256],65307:[[59],256],65308:[[60],256],65309:[[61],256],65310:[[62],256],65311:[[63],256],65312:[[64],256],65313:[[65],256],65314:[[66],256],65315:[[67],256],65316:[[68],256],65317:[[69],256],65318:[[70],256],65319:[[71],256],65320:[[72],256],65321:[[73],256],65322:[[74],256],65323:[[75],256],65324:[[76],256],65325:[[77],256],65326:[[78],256],65327:[[79],256],65328:[[80],256],65329:[[81],256],65330:[[82],256],65331:[[83],256],65332:[[84],256],65333:[[85],256],65334:[[86],256],65335:[[87],256],65336:[[88],256],65337:[[89],256],65338:[[90],256],65339:[[91],256],65340:[[92],256],65341:[[93],256],65342:[[94],256],65343:[[95],256],65344:[[96],256],65345:[[97],256],65346:[[98],256],65347:[[99],256],65348:[[100],256],65349:[[101],256],65350:[[102],256],65351:[[103],256],65352:[[104],256],65353:[[105],256],65354:[[106],256],65355:[[107],256],65356:[[108],256],65357:[[109],256],65358:[[110],256],65359:[[111],256],65360:[[112],256],65361:[[113],256],65362:[[114],256],65363:[[115],256],65364:[[116],256],65365:[[117],256],65366:[[118],256],65367:[[119],256],65368:[[120],256],65369:[[121],256],65370:[[122],256],65371:[[123],256],65372:[[124],256],65373:[[125],256],65374:[[126],256],65375:[[10629],256],65376:[[10630],256],65377:[[12290],256],65378:[[12300],256],65379:[[12301],256],65380:[[12289],256],65381:[[12539],256],65382:[[12530],256],65383:[[12449],256],65384:[[12451],256],65385:[[12453],256],65386:[[12455],256],65387:[[12457],256],65388:[[12515],256],65389:[[12517],256],65390:[[12519],256],65391:[[12483],256],65392:[[12540],256],65393:[[12450],256],65394:[[12452],256],65395:[[12454],256],65396:[[12456],256],65397:[[12458],256],65398:[[12459],256],65399:[[12461],256],65400:[[12463],256],65401:[[12465],256],65402:[[12467],256],65403:[[12469],256],65404:[[12471],256],65405:[[12473],256],65406:[[12475],256],65407:[[12477],256],65408:[[12479],256],65409:[[12481],256],65410:[[12484],256],65411:[[12486],256],65412:[[12488],256],65413:[[12490],256],65414:[[12491],256],65415:[[12492],256],65416:[[12493],256],65417:[[12494],256],65418:[[12495],256],65419:[[12498],256],65420:[[12501],256],65421:[[12504],256],65422:[[12507],256],65423:[[12510],256],65424:[[12511],256],65425:[[12512],256],65426:[[12513],256],65427:[[12514],256],65428:[[12516],256],65429:[[12518],256],65430:[[12520],256],65431:[[12521],256],65432:[[12522],256],65433:[[12523],256],65434:[[12524],256],65435:[[12525],256],65436:[[12527],256],65437:[[12531],256],65438:[[12441],256],65439:[[12442],256],65440:[[12644],256],65441:[[12593],256],65442:[[12594],256],65443:[[12595],256],65444:[[12596],256],65445:[[12597],256],65446:[[12598],256],65447:[[12599],256],65448:[[12600],256],65449:[[12601],256],65450:[[12602],256],65451:[[12603],256],65452:[[12604],256],65453:[[12605],256],65454:[[12606],256],65455:[[12607],256],65456:[[12608],256],65457:[[12609],256],65458:[[12610],256],65459:[[12611],256],65460:[[12612],256],65461:[[12613],256],65462:[[12614],256],65463:[[12615],256],65464:[[12616],256],65465:[[12617],256],65466:[[12618],256],65467:[[12619],256],65468:[[12620],256],65469:[[12621],256],65470:[[12622],256],65474:[[12623],256],65475:[[12624],256],65476:[[12625],256],65477:[[12626],256],65478:[[12627],256],65479:[[12628],256],65482:[[12629],256],65483:[[12630],256],65484:[[12631],256],65485:[[12632],256],65486:[[12633],256],65487:[[12634],256],65490:[[12635],256],65491:[[12636],256],65492:[[12637],256],65493:[[12638],256],65494:[[12639],256],65495:[[12640],256],65498:[[12641],256],65499:[[12642],256],65500:[[12643],256],65504:[[162],256],65505:[[163],256],65506:[[172],256],65507:[[175],256],65508:[[166],256],65509:[[165],256],65510:[[8361],256],65512:[[9474],256],65513:[[8592],256],65514:[[8593],256],65515:[[8594],256],65516:[[8595],256],65517:[[9632],256],65518:[[9675],256]}};var d={nfc:function(e){return p("NFC",e)},nfd:function(e){return p("NFD",e)},nfkc:function(e){return p("NFKC",e)},nfkd:function(e){return p("NFKD",e)}};e.exports=d,d.shimApplied=!1,String.prototype.normalize||(String.prototype.normalize=function(e){var t=""+this;if("NFC"===(e=void 0===e?"NFC":e))return d.nfc(t);if("NFD"===e)return d.nfd(t);if("NFKC"===e)return d.nfkc(t);if("NFKD"===e)return d.nfkd(t);throw new RangeError("Invalid normalization form: "+e)},d.shimApplied=!0)}()},1135(e){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},9032(e,t,r){"use strict";var i=r(7244),n=r(8184),o=r(5767),a=r(5680);function s(e){return e.call.bind(e)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(c)var g=s(Symbol.prototype.valueOf);function m(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===l(e)}function v(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function S(e){return"[object WeakSet]"===l(e)}function w(e){return"[object ArrayBuffer]"===l(e)}function O(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===l(e)}function I(e){return"undefined"!=typeof DataView&&(_.working?_(e):e instanceof DataView)}t.isArgumentsObject=i,t.isGeneratorFunction=n,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||I(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},S.working="undefined"!=typeof WeakSet&&S(new WeakSet),t.isWeakSet=function(e){return S(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=O,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=I;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function A(e){return"[object SharedArrayBuffer]"===l(e)}function P(e){return void 0!==E&&(void 0===A.working&&(A.working=A(new E)),A.working?A(e):e instanceof E)}function k(e){return m(e,h)}function x(e){return m(e,f)}function T(e){return m(e,p)}function R(e){return u&&m(e,d)}function B(e){return c&&m(e,g)}t.isSharedArrayBuffer=P,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=k,t.isStringObject=x,t.isBooleanObject=T,t.isBigIntObject=R,t.isSymbolObject=B,t.isBoxedPrimitive=function(e){return k(e)||x(e)||T(e)||R(e)||B(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(O(e)||P(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},537(e,t,r){var i=r(5606),n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i<t.length;i++)r[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return r},o=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var i=arguments,n=i.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=n)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}}),s=i[r];r<n;s=i[++r])y(s)||!O(s)?a+=" "+s:a+=" "+c(s);return a},t.deprecate=function(e,r){if(void 0!==i&&!0===i.noDeprecation)return e;if(void 0===i)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(i.throwDeprecation)throw new Error(r);i.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(i.env.NODE_DEBUG){var u=i.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+u+"$","i")}function c(e,r){var i={seen:[],stylize:h};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),m(r)?i.showHidden=r:r&&t._extend(i,r),S(i.showHidden)&&(i.showHidden=!1),S(i.depth)&&(i.depth=2),S(i.colors)&&(i.colors=!1),S(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=l),f(i,e,i.depth)}function l(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function h(e,t){return e}function f(e,r,i){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,e);return b(n)||(n=f(e,n,i)),n}var o=function(e,t){if(S(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(v(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(y(t))return e.stylize("null","null")}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),I(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(w(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(I(r))return p(r)}var c,l="",h=!1,O=["{","}"];(g(r)&&(h=!0,O=["[","]"]),E(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return w(r)&&(l=" "+RegExp.prototype.toString.call(r)),_(r)&&(l=" "+Date.prototype.toUTCString.call(r)),I(r)&&(l=" "+p(r)),0!==a.length||h&&0!=r.length?i<0?w(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,i,n){for(var o=[],a=0,s=t.length;a<s;++a)x(t,String(a))?o.push(d(e,t,r,i,String(a),!0)):o.push("");return n.forEach(function(n){n.match(/^\d+$/)||o.push(d(e,t,r,i,n,!0))}),o}(e,r,i,s,a):a.map(function(t){return d(e,r,i,s,t,h)}),e.seen.pop(),function(e,t,r){var i=e.reduce(function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(i>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(c,l,O)):O[0]+l+O[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,i,n,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),x(i,n)||(a="["+n+"]"),s||(e.seen.indexOf(u.value)<0?(s=y(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),S(a)){if(o&&n.match(/^\d+$/))return s;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function g(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function y(e){return null===e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function S(e){return void 0===e}function w(e){return O(e)&&"[object RegExp]"===A(e)}function O(e){return"object"==typeof e&&null!==e}function _(e){return O(e)&&"[object Date]"===A(e)}function I(e){return O(e)&&("[object Error]"===A(e)||e instanceof Error)}function E(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function P(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=i.pid;a[e]=function(){var i=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,i)}}else a[e]=function(){};return a[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=g,t.isBoolean=m,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=S,t.isRegExp=w,t.types.isRegExp=w,t.isObject=O,t.isDate=_,t.types.isDate=_,t.isError=I,t.types.isNativeError=I,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[P(e.getHours()),P(e.getMinutes()),P(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!O(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var T="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(T&&e[T]){var t;if("function"!=typeof(t=e[T]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,i=new Promise(function(e,i){t=e,r=i}),n=[],o=0;o<arguments.length;o++)n.push(arguments[o]);n.push(function(e,i){e?r(e):t(i)});try{e.apply(this,n)}catch(e){r(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),T&&Object.defineProperty(t,T,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=T,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!=typeof n)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return n.apply(o,arguments)};e.apply(this,t).then(function(e){i.nextTick(a.bind(null,null,e))},function(e){i.nextTick(R.bind(null,e,a))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,n(e)),t}},5767(e,t,r){"use strict";var i=r(2682),n=r(9209),o=r(487),a=r(6556),s=r(5795),u=r(3628),c=a("Object.prototype.toString"),l=r(9092)(),h="undefined"==typeof globalThis?r.g:globalThis,f=n(),p=a("String.prototype.slice"),d=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},g={__proto__:null};i(f,l&&s&&u?function(e){var t=new h[e];if(Symbol.toStringTag in t&&u){var r=u(t),i=s(r,Symbol.toStringTag);if(!i&&r){var n=u(r);i=s(n,Symbol.toStringTag)}if(i&&i.get){var a=o(i.get);g["$"+e]=a}}}:function(e){var t=new h[e],r=t.slice||t.set;if(r){var i=o(r);g["$"+e]=i}});e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=p(c(e),8,-1);return d(f,t)>-1?t:"Object"===t&&function(e){var t=!1;return i(g,function(r,i){if(!t)try{r(e),t=p(i,1)}catch(e){}}),t}(e)}return s?function(e){var t=!1;return i(g,function(r,i){if(!t)try{"$"+r(e)===i&&(t=p(i,1))}catch(e){}}),t}(e):null}},514(e,t,r){e=r.nmd(e);var i=r(5606);const n=function(){(void 0!==i&&i.env&&i.env.BSV_DEBUG||"undefined"!=typeof window&&window.BSV_DEBUG)&&console.log.apply(console,arguments)};let o,a,s,u;if("undefined"==typeof window)try{a=r(1145),s=r(5621),u=s.join("/","blockchain-state.json")}catch(e){n("BlockchainState: Running in browser mode - persistence disabled")}else o="undefined"!=typeof window&&window.bsv||r(8722);function c(){return{metadata:{createdAt:(new Date).toISOString(),lastUpdated:(new Date).toISOString(),totalWallets:0,totalUTXOs:0,totalValue:0,blockHeight:0},wallets:{},globalUTXOSet:{},spentUTXOs:{},transactionHistory:[]}}function l(){try{if(!a||!u)return c();if(!a.existsSync(u)){n("🆕 Creating new blockchain state...");const e=c();return h(e),e}const e=JSON.parse(a.readFileSync(u,"utf8"));return n("📖 Loaded existing blockchain state"),e}catch(e){return console.error("❌ Error loading blockchain state:",e.message),c()}}function h(e){try{e.metadata.lastUpdated=(new Date).toISOString(),a&&u&&(a.writeFileSync(u,JSON.stringify(e,null,2)),n("💾 Blockchain state saved"))}catch(e){console.error("❌ Error saving blockchain state:",e.message)}}function f(e,t){n(`📝 Registering wallet: ${e}`);const r=l();return r.wallets[e]&&n("ℹ️ Wallet already exists, updating..."),r.wallets[e]={address:e,registeredAt:t.registeredAt||(new Date).toISOString(),utxos:t.utxos||[],totalValue:0},t.utxos&&t.utxos.forEach(t=>{const i=`${t.txid}:${t.vout}`;r.globalUTXOSet[i]={...t,ownerAddress:e}}),r.metadata.totalWallets=Object.keys(r.wallets).length,d(r),h(r),n(`✅ Wallet registered: ${e}`),r}function p(e,t){const r=l(),i=`${e}:${t}`;return r.spentUTXOs[i]?{exists:!1,spent:!0,utxo:r.spentUTXOs[i]}:r.globalUTXOSet[i]?{exists:!0,spent:!1,utxo:r.globalUTXOSet[i]}:{exists:!1,spent:!1,utxo:null}}function d(e){const t=Object.keys(e.globalUTXOSet).length,r=Object.values(e.globalUTXOSet).reduce((e,t)=>e+t.satoshis,0);e.metadata.totalUTXOs=t,e.metadata.totalValue=r,Object.values(e.wallets).forEach(e=>{e.totalValue=e.utxos.reduce((e,t)=>e+t.satoshis,0)})}function g(){const e=l();return n("🌐 Blockchain State Statistics:"),n("═══════════════════════════════════════════"),n(`📊 Total Wallets: ${e.metadata.totalWallets}`),n(`💰 Total UTXOs: ${e.metadata.totalUTXOs}`),n(`💎 Total Value: ${e.metadata.totalValue} satoshis`),n(`🏗️ Block Height: ${e.metadata.blockHeight}`),n(`🕐 Last Updated: ${e.metadata.lastUpdated}\n`),Object.keys(e.wallets).length>0&&(n("👛 Registered Wallets:"),Object.entries(e.wallets).forEach(([e,t])=>{n(` ${e}: ${t.utxos.length} UTXOs, ${t.totalValue} sats`)})),e}function m(){const e=s.join("/","wallet.json");if(!a.existsSync(e))return n("❌ No wallet.json found to import"),!1;try{const t=JSON.parse(a.readFileSync(e,"utf8"));n("📥 Importing wallet from wallet.json...");const r={registeredAt:(new Date).toISOString(),utxos:t.availableUTXOs||[t.utxo]};return f(t.wallet.address,r),n("✅ Wallet imported successfully"),!0}catch(e){return console.error("❌ Error importing wallet:",e.message),!1}}if(r.c[r.s]===e){const e=i.argv.slice(2);if("import"===e[0])m();else if("init"===e[0]){h(c()),n("🆕 Initialized new blockchain state")}g()}e.exports={loadBlockchainState:l,saveBlockchainState:h,registerWallet:f,getUTXO:p,isUTXOAvailable:function(e,t){const r=p(e,t);return r.exists&&!r.spent},spendUTXO:function(e,t,r){const i=l(),o=`${e}:${t}`;if(!i.globalUTXOSet[o])throw new Error(`UTXO ${o} does not exist`);if(i.spentUTXOs[o])throw new Error(`UTXO ${o} already spent`);const a=i.globalUTXOSet[o];i.spentUTXOs[o]={...a,spentInTx:r,spentAt:(new Date).toISOString()},delete i.globalUTXOSet[o];const s=i.wallets[a.ownerAddress];s&&(s.utxos=s.utxos.filter(r=>!(r.txid===e&&r.vout===t))),d(i),h(i),n(`❌ UTXO spent: ${o} in tx ${r}`)},addUTXO:function(e,t){const r=l(),i=`${e.txid}:${e.vout}`;if(r.globalUTXOSet[i])return void n(`⚠️ UTXO ${i} already exists, skipping`);r.globalUTXOSet[i]={...e,ownerAddress:t,createdAt:(new Date).toISOString()},r.wallets[t]||(r.wallets[t]={address:t,registeredAt:(new Date).toISOString(),utxos:[],totalValue:0}),r.wallets[t].utxos.some(t=>t.txid===e.txid&&t.vout===e.vout)||r.wallets[t].utxos.push(e),d(r),h(r),n(`✅ UTXO added: ${i} for ${t}`)},getBlockchainStats:g,importWalletFromFile:m}},8722(e){"use strict";e.exports=bsv},2338(){},8738(){},9550(){},9775(){},6039(){},4151(){},2949(){},3121(){},3582(){},8489(){},7593(){},6751(){},6060(){},6686(){},5558(){},7790(){},1145(){},5621(){},9209(e,t,r){"use strict";var i=r(6578),n="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<i.length;t++)"function"==typeof n[i[t]]&&(e[e.length]=i[t]);return e}},2405(e,t,r){"use strict";function i(e,t,r=""){const i=(n=e)instanceof Uint8Array||ArrayBuffer.isView(n)&&"Uint8Array"===n.constructor.name&&"BYTES_PER_ELEMENT"in n&&1===n.BYTES_PER_ELEMENT;
39
- /*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
40
- var n;const o=e?.length,a=void 0!==t;if(!i||a&&o!==t){const n=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(i?`length=${o}`:"type="+typeof e);if(!i)throw new TypeError(n);throw new RangeError(n)}return e}function n(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function o(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}r.d(t,{cbc:()=>L});const a=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])(),s=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,u=a?e=>e:e=>{for(let t=0;t<e.length;t++)e[t]=s(e[t]);return e};function c(e,t){return!(!e.byteLength||!t.byteLength)&&(e.buffer===t.buffer&&e.byteOffset<t.byteOffset+t.byteLength&&t.byteOffset<e.byteOffset+e.byteLength)}function l(e,t){if(c(e,t)&&e.byteOffset<t.byteOffset)throw new Error("complex overlap of input and output is not supported")}const h=(e,t)=>{function r(r,...n){if(i(r,void 0,"key"),void 0!==e.nonceLength){i(n[0],e.varSizeNonce?void 0:e.nonceLength,"nonce")}const o=e.tagLength;o&&void 0!==n[1]&&i(n[1],void 0,"AAD");const a=t(r,...n),s=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");i(t,void 0,"output")}};let u=!1;return{encrypt(e,t){if(u)throw new Error("cannot encrypt() twice with same key + nonce");return u=!0,i(e),s(a.encrypt.length,t),a.encrypt(e,t)},decrypt(e,t){if(i(e),o&&e.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return s(a.decrypt.length,t),a.decrypt(e,t)}}}return Object.assign(r,e),r};function f(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(i(t,void 0,"output"),t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&!p(t))throw new Error("invalid output, must be aligned");return t}function p(e){return e.byteOffset%4==0}function d(e){return Uint8Array.from(i(e))}const g=16;function m(e){if(![16,24,32].includes(e.length))throw new Error('"aes key" expected Uint8Array of length 16/24/32, got length='+e.length)}function y(e){return e<<1^283&-(e>>7)}function v(e,t){let r=0;for(;t>0;t>>=1)r^=e&-(1&t),e=y(e);return r}const b=(()=>{const e=new Uint8Array(256);for(let t=0,r=1;t<256;t++,r^=y(r))e[t]=r;const t=new Uint8Array(256);t[0]=99;for(let r=0;r<255;r++){let i=e[255-r];i|=i<<8,t[e[r]]=255&(i^i>>4^i>>5^i>>6^i>>7^99)}return o(e),t})(),S=b.map((e,t)=>b.indexOf(t)),w=e=>e<<24|e>>>8,O=e=>e<<8|e>>>24;function _(e,t){if(256!==e.length)throw new Error("Wrong sbox length");const r=new Uint32Array(256).map((r,i)=>t(e[i])),i=r.map(O),n=i.map(O),o=n.map(O),a=new Uint32Array(65536),s=new Uint32Array(65536),u=new Uint16Array(65536);for(let t=0;t<256;t++)for(let c=0;c<256;c++){const l=256*t+c;a[l]=r[t]^i[c],s[l]=n[t]^o[c],u[l]=e[t]<<8|e[c]}return{sbox:e,sbox2:u,T0:r,T1:i,T2:n,T3:o,T01:a,T23:s}}const I=_(b,e=>v(e,3)<<24|e<<16|e<<8|v(e,2)),E=_(S,e=>v(e,11)<<24|v(e,13)<<16|v(e,9)<<8|v(e,14)),A=(()=>{const e=new Uint8Array(16);for(let t=0,r=1;t<16;t++,r=y(r))e[t]=r;return e})();function P(e){i(e);const t=e.length;m(e);const{sbox2:r}=I,s=[];a&&p(e)||s.push(e=d(e));const c=u(n(e)),l=c.length,h=e=>T(r,e,e,e,e),f=new Uint32Array(t+28);f.set(c);for(let e=l;e<f.length;e++){let t=f[e-1];e%l===0?t=h(w(t))^A[e/l-1]:l>6&&e%l===4&&(t=h(t)),f[e]=f[e-l]^t}return o(...s),f}function k(e){const t=P(e),r=t.slice(),i=t.length,{sbox2:n}=I,{T0:a,T1:s,T2:u,T3:c}=E;for(let e=0;e<i;e+=4)for(let n=0;n<4;n++)r[e+n]=t[i-e-4+n];o(t);for(let e=4;e<i-4;e++){const t=r[e],i=T(n,t,t,t,t);r[e]=a[255&i]^s[i>>>8&255]^u[i>>>16&255]^c[i>>>24]}return r}function x(e,t,r,i,n,o){return e[r<<8&65280|i>>>8&255]^t[n>>>8&65280|o>>>24&255]}function T(e,t,r,i,n){return e[255&t|65280&r]|e[i>>>16&255|n>>>16&65280]<<16}function R(e,t,r,i,n){const{sbox2:o,T01:a,T23:s}=I;let u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];const c=e.length/4-2;for(let o=0;o<c;o++){const o=e[u++]^x(a,s,t,r,i,n),c=e[u++]^x(a,s,r,i,n,t),l=e[u++]^x(a,s,i,n,t,r),h=e[u++]^x(a,s,n,t,r,i);t=o,r=c,i=l,n=h}return{s0:e[u++]^T(o,t,r,i,n),s1:e[u++]^T(o,r,i,n,t),s2:e[u++]^T(o,i,n,t,r),s3:e[u++]^T(o,n,t,r,i)}}function B(e,t,r,i,n){const{sbox2:o,T01:a,T23:s}=E;let u=0;t^=e[u++],r^=e[u++],i^=e[u++],n^=e[u++];const c=e.length/4-2;for(let o=0;o<c;o++){const o=e[u++]^x(a,s,t,n,i,r),c=e[u++]^x(a,s,r,t,n,i),l=e[u++]^x(a,s,i,r,t,n),h=e[u++]^x(a,s,n,i,r,t);t=o,r=c,i=l,n=h}return{s0:e[u++]^T(o,t,n,i,r),s1:e[u++]^T(o,r,t,n,i),s2:e[u++]^T(o,i,r,t,n),s3:e[u++]^T(o,n,i,r,t)}}function N(e){if(i(e),e.length%g!==0)throw new Error("aes-(cbc/ecb).decrypt ciphertext should consist of blocks with size 16")}function C(e,t,r){i(e);let o=e.length;const s=o%g;if(!t&&0!==s)throw new Error("aec/(cbc-ecb): unpadded plaintext with disabled padding");if(t){let e=g-s;e||(e=g),o+=e}l(e,r=f(o,r)),a&&p(e)||(e=d(e));const c=n(e);u(c);return{b:c,o:n(r),out:r}}function D(e,t){if(!t)return e;const r=e.length;if(0===r)throw new Error("aes/pkcs7: empty ciphertext not allowed");const i=e[r-1];let n=1;n&=i-1>>>31^1,n&=16-i>>>31^1;for(let t=0;t<16;t++){const o=t-i>>>31;n&=(0===(e[r-1-t]^i)?1:0)|1^o}if(!n)throw new Error("aes/pkcs7: wrong padding");return e.subarray(0,r-i)}function M(e){const t=new Uint8Array(16),r=n(t);t.set(e);const i=g-e.length;for(let e=g-i;e<g;e++)t[e]=i;return r}const L=h({blockSize:16,nonceLength:16},function(e,t,r={}){const i=!r.disablePadding;return{encrypt(r,s){const c=P(e),{b:l,o:h,out:f}=C(r,i,s);let g=t;const m=[c];a&&p(g)||m.push(g=d(g));const y=n(g);u(y);let v=y[0],b=y[1],S=y[2],w=y[3],O=0;for(;O+4<=l.length;)v^=l[O+0],b^=l[O+1],S^=l[O+2],w^=l[O+3],({s0:v,s1:b,s2:S,s3:w}=R(c,v,b,S,w)),h[O++]=v,h[O++]=b,h[O++]=S,h[O++]=w;if(i){const e=M(r.subarray(4*O));u(e),v^=e[0],b^=e[1],S^=e[2],w^=e[3],({s0:v,s1:b,s2:S,s3:w}=R(c,v,b,S,w)),h[O++]=v,h[O++]=b,h[O++]=S,h[O++]=w}return u(h),o(...m),f},decrypt(r,s){N(r);const c=k(e);let h=t;const g=[c];a&&p(h)||g.push(h=d(h));const m=n(h);u(m),l(r,s=f(r.length,s)),a&&p(r)||g.push(r=d(r));const y=n(r),v=n(s);u(y);let b=m[0],S=m[1],w=m[2],O=m[3];for(let e=0;e+4<=y.length;){const t=b,r=S,i=w,n=O;b=y[e+0],S=y[e+1],w=y[e+2],O=y[e+3];const{s0:o,s1:a,s2:s,s3:u}=B(c,b,S,w,O);v[e++]=o^t,v[e++]=a^r,v[e++]=s^i,v[e++]=u^n}return u(v),o(...g),D(s,i)}}})},4554(e,t,r){"use strict";r.d(t,{secp256k1:()=>De});var i=r(8087),n=r(508);
41
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
42
- const o=(e,t,r)=>(0,n.DO)(e,t,r),a=n.Fe,s=n.My,u=(...e)=>(0,n.Id)(...e),c=e=>(0,n.aT)(e),l=n.aY,h=e=>(0,n.po)(e),f=BigInt(0),p=BigInt(1);function d(e,t=""){if("boolean"!=typeof e){throw new TypeError((t&&`"${t}" `)+"expected boolean, got type="+typeof e)}return e}function g(e){if("bigint"==typeof e){if(!_(e))throw new RangeError("positive bigint expected, got "+e)}else a(e);return e}function m(e,t=""){if("number"!=typeof e){throw new TypeError((t&&`"${t}" `)+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){throw new RangeError((t&&`"${t}" `)+"expected safe integer, got "+e)}}function y(e){const t=g(e).toString(16);return 1&t.length?"0"+t:t}function v(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);return""===e?f:BigInt("0x"+e)}function b(e){return v((0,n.My)(e))}function S(e){return v((0,n.My)(function(e){return Uint8Array.from(o(e))}((0,n.DO)(e)).reverse()))}function w(e,t){if((0,n.Fe)(t),0===t)throw new RangeError("zero length");const r=(e=g(e)).toString(16);if(r.length>2*t)throw new RangeError("number too large");return(0,n.aT)(r.padStart(2*t,"0"))}function O(e,t){return w(e,t).reverse()}const _=e=>"bigint"==typeof e&&f<=e;function I(e,t,r,i){if(!function(e,t,r){return _(e)&&_(t)&&_(r)&&t<=e&&e<r}(t,r,i))throw new RangeError("expected valid "+e+": "+r+" <= n < "+i+", got "+t)}function E(e){if(e<f)throw new Error("expected non-negative bigint, got "+e);let t;for(t=0;e>f;e>>=p,t+=1);return t}const A=e=>(p<<BigInt(e))-p;function P(e,t={},r={}){if("[object Object]"!==Object.prototype.toString.call(e))throw new TypeError("expected valid options object");const i=(t,r)=>Object.entries(t).forEach(([t,i])=>function(t,r,i){if(!i&&"function"!==r&&!Object.hasOwn(e,t))throw new TypeError(`param "${t}" is invalid: expected own property`);const n=e[t];if(i&&void 0===n)return;const o=typeof n;if(o!==r||null===n)throw new TypeError(`param "${t}" is invalid: expected ${r}, got ${o}`)}(t,i,r));i(t,!1),i(r,!0)}const k=BigInt(0),x=BigInt(1),T=BigInt(2),R=BigInt(3),B=BigInt(4),N=BigInt(5),C=BigInt(7),D=BigInt(8),M=BigInt(9),L=BigInt(16);function H(e,t){if(t<=k)throw new Error("mod: expected positive modulus, got "+t);const r=e%t;return r>=k?r:t+r}function j(e,t,r){if(t<k)throw new Error("pow2: expected non-negative exponent, got "+t);let i=e;for(;t-- >k;)i*=i,i%=r;return i}function U(e,t){if(e===k)throw new Error("invert: expected non-zero number");if(t<=k)throw new Error("invert: expected positive modulus, got "+t);let r=H(e,t),i=t,n=k,o=x,a=x,s=k;for(;r!==k;){const e=i/r,t=i-r*e,u=n-a*e,c=o-s*e;i=r,r=t,n=a,o=s,a=u,s=c}if(i!==x)throw new Error("invert: does not exist");return H(n,t)}function F(e,t,r){const i=e;if(!i.eql(i.sqr(t),r))throw new Error("Cannot find square root")}function K(e,t){const r=e,i=(r.ORDER+x)/B,n=r.pow(t,i);return F(r,n,t),n}function z(e,t){const r=e,i=(r.ORDER-N)/D,n=r.mul(t,T),o=r.pow(n,i),a=r.mul(t,o),s=r.mul(r.mul(a,T),o),u=r.mul(a,r.sub(s,r.ONE));return F(r,u,t),u}function V(e){if(e<R)throw new Error("sqrt is not defined for small field");let t=e-x,r=0;for(;t%T===k;)t/=T,r++;let i=T;const n=Z(e);for(;1===$(n,i);)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===r)return K;let o=n.pow(i,t);const a=(t+x)/T;return function(e,i){const n=e;if(n.is0(i))return i;if(1!==$(n,i))throw new Error("Cannot find square root");let s=r,u=n.mul(n.ONE,o),c=n.pow(i,t),l=n.pow(i,a);for(;!n.eql(c,n.ONE);){if(n.is0(c))return n.ZERO;let e=1,t=n.sqr(c);for(;!n.eql(t,n.ONE);)if(e++,t=n.sqr(t),e===s)throw new Error("Cannot find square root");const r=x<<BigInt(s-e-1),i=n.pow(u,r);s=e,u=n.sqr(i),c=n.mul(c,u),l=n.mul(l,i)}return l}}function q(e){return e%B===R?K:e%D===N?z:e%L===M?function(e){const t=Z(e),r=V(e),i=r(t,t.neg(t.ONE)),n=r(t,i),o=r(t,t.neg(i)),a=(e+C)/L;return(e,t)=>{const r=e;let s=r.pow(t,a),u=r.mul(s,i);const c=r.mul(s,n),l=r.mul(s,o),h=r.eql(r.sqr(u),t),f=r.eql(r.sqr(c),t);s=r.cmov(s,u,h),u=r.cmov(l,c,f);const p=r.eql(r.sqr(u),t),d=r.cmov(s,u,p);return F(r,d,t),d}}(e):V(e)}const G=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Y(e,t,r){const i=e;if(r<k)throw new Error("invalid exponent, negatives unsupported");if(r===k)return i.ONE;if(r===x)return t;let n=i.ONE,o=t;for(;r>k;)r&x&&(n=i.mul(n,o)),o=i.sqr(o),r>>=x;return n}function W(e,t,r=!1){const i=e,n=new Array(t.length).fill(r?i.ZERO:void 0),o=t.reduce((e,t,r)=>i.is0(t)?e:(n[r]=e,i.mul(e,t)),i.ONE),a=i.inv(o);return t.reduceRight((e,t,r)=>i.is0(t)?e:(n[r]=i.mul(e,n[r]),i.mul(e,t)),a),n}function $(e,t){const r=e,i=(r.ORDER-x)/T,n=r.pow(t,i),o=r.eql(n,r.ONE),a=r.eql(n,r.ZERO),s=r.eql(n,r.neg(r.ONE));if(!o&&!a&&!s)throw new Error("invalid Legendre symbol result");return o?1:a?0:-1}const X=new WeakMap;class J{ORDER;BITS;BYTES;isLE;ZERO=k;ONE=x;_lengths;_mod;constructor(e,t={}){if(e<=x)throw new Error("invalid field: expected ORDER > 1, got "+e);let r;this.isLE=!1,null!=t&&"object"==typeof t&&("number"==typeof t.BITS&&(r=t.BITS),"function"==typeof t.sqrt&&Object.defineProperty(this,"sqrt",{value:t.sqrt,enumerable:!0}),"boolean"==typeof t.isLE&&(this.isLE=t.isLE),t.allowedLengths&&(this._lengths=Object.freeze(t.allowedLengths.slice())),"boolean"==typeof t.modFromBytes&&(this._mod=t.modFromBytes));const{nBitLength:i,nByteLength:n}=function(e,t){if(void 0!==t&&a(t),e<=k)throw new Error("invalid n length: expected positive n, got "+e);if(void 0!==t&&t<1)throw new Error("invalid n length: expected positive bit length, got "+t);const r=E(e);if(void 0!==t&&t<r)throw new Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);const i=void 0!==t?t:r;return{nBitLength:i,nByteLength:Math.ceil(i/8)}}(e,r);if(n>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=i,this.BYTES=n,Object.freeze(this)}create(e){return H(e,this.ORDER)}isValid(e){if("bigint"!=typeof e)throw new TypeError("invalid field element: expected bigint, got "+typeof e);return k<=e&&e<this.ORDER}is0(e){return e===k}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&x)===x}neg(e){return H(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return H(e*e,this.ORDER)}add(e,t){return H(e+t,this.ORDER)}sub(e,t){return H(e-t,this.ORDER)}mul(e,t){return H(e*t,this.ORDER)}pow(e,t){return Y(this,e,t)}div(e,t){return H(e*U(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return U(e,this.ORDER)}sqrt(e){let t=X.get(this);return t||X.set(this,t=q(this.ORDER)),t(this,e)}toBytes(e){return this.isLE?O(e,this.BYTES):w(e,this.BYTES)}fromBytes(e,t=!1){o(e);const{_lengths:r,BYTES:i,isLE:n,ORDER:a,_mod:s}=this;if(r){if(e.length<1||!r.includes(e.length)||e.length>i)throw new Error("Field.fromBytes: expected "+r+" bytes, got "+e.length);const t=new Uint8Array(i);t.set(e,n?0:t.length-e.length),e=t}if(e.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);let u=n?S(e):b(e);if(s&&(u=H(u,a)),!t&&!this.isValid(u))throw new Error("invalid field element: outside of range 0..ORDER");return u}invertBatch(e){return W(this,e)}cmov(e,t,r){return d(r,"condition"),r?t:e}}function Z(e,t={}){return new J(e,t)}function Q(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");if(e<=x)throw new Error("field order must be greater than 1");const t=E(e-x);return Math.ceil(t/8)}function ee(e){const t=Q(e);return t+Math.ceil(t/2)}Object.freeze(J.prototype);var te=r(7474);
43
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
44
- const re=BigInt(0),ie=BigInt(1);function ne(e,t){const r=t.negate();return e?r:t}function oe(e,t){const r=W(e.Fp,t.map(e=>e.Z));return t.map((t,i)=>e.fromAffine(t.toAffine(r[i])))}function ae(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function se(e,t){ae(e,t);const r=2**e;return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1),mask:A(e),maxNumber:r,shiftBy:BigInt(e)}}function ue(e,t,r){const{windowSize:i,mask:n,maxNumber:o,shiftBy:a}=r;let s=Number(e&n),u=e>>a;s>i&&(s-=o,u+=ie);const c=t*i;return{nextN:u,offset:c+Math.abs(s)-1,isZero:0===s,isNeg:s<0,isNegF:t%2!=0,offsetF:c}}const ce=new WeakMap,le=new WeakMap;function he(e){return le.get(e)||1}function fe(e){if(e!==re)throw new Error("invalid wNAF")}class pe{BASE;ZERO;Fn;bits;constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let i=e;for(;t>re;)t&ie&&(r=r.add(i)),i=i.double(),t>>=ie;return r}precomputeWindow(e,t){const{windows:r,windowSize:i}=se(t,this.bits),n=[];let o=e,a=o;for(let e=0;e<r;e++){a=o,n.push(a);for(let e=1;e<i;e++)a=a.add(o),n.push(a);o=a.double()}return n}wNAF(e,t,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,n=this.BASE;const o=se(e,this.bits);for(let e=0;e<o.windows;e++){const{nextN:a,offset:s,isZero:u,isNeg:c,isNegF:l,offsetF:h}=ue(r,e,o);r=a,u?n=n.add(ne(l,t[h])):i=i.add(ne(c,t[s]))}return fe(r),{p:i,f:n}}wNAFUnsafe(e,t,r,i=this.ZERO){const n=se(e,this.bits);for(let e=0;e<n.windows&&r!==re;e++){const{nextN:o,offset:a,isZero:s,isNeg:u}=ue(r,e,n);if(r=o,!s){const e=t[a];i=i.add(u?e.negate():e)}}return fe(r),i}getPrecomputes(e,t,r){let i=ce.get(t);return i||(i=this.precomputeWindow(t,e),1!==e&&("function"==typeof r&&(i=r(i)),ce.set(t,i))),i}cached(e,t,r){const i=he(e);return this.wNAF(i,this.getPrecomputes(i,e,r),t)}unsafe(e,t,r,i){const n=he(e);return 1===n?this._unsafeLadder(e,t,i):this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,i)}createCache(e,t){ae(t,this.bits),le.set(e,t),ce.delete(e)}hasCache(e){return 1!==he(e)}}function de(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return function(e){if(P(e,G.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",BYTES:"number",BITS:"number"})),m(e.BYTES,"BYTES"),m(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw new Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=x)throw new Error("invalid field: expected ORDER > 1, got "+e.ORDER)}(t),t}return Z(e,{isLE:r})}
45
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
46
- const ge=(e,t)=>(e+(e>=0?t:-t)/Oe)/t;function me(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ye(e,t){P(e);const r={};for(let i of Object.keys(t))r[i]=void 0===e[i]?t[i]:e[i];return d(r.lowS,"lowS"),d(r.prehash,"prehash"),void 0!==r.format&&me(r.format),r}class ve extends Error{constructor(e=""){super(e)}}const be={Err:ve,_tlv:{encode:(e,t)=>{const{Err:r}=be;if(m(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if("string"!=typeof t)throw new TypeError('"data" expected string, got type='+typeof t);if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,n=y(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?y(n.length/2|128):"";return y(e)+o+n+t},decode(e,t){const{Err:r}=be;t=o(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const n=t[i++];let a=0;if(!!(128&n)){const e=127&n;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const o=t.subarray(i,i+e);if(o.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===o[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of o)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=n;const s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=be;if(g(e),e<Se)throw new t("integer: negative integers are not allowed");let r=y(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=be;if(e.length<1)throw new t("invalid signature integer: empty");if(128&e[0])throw new t("invalid signature integer: negative");if(e.length>1&&0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return b(e)}},toSig(e){const{Err:t,_int:r,_tlv:i}=be,n=o(e,void 0,"signature"),{v:a,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:u,l:c}=i.decode(2,a),{v:l,l:h}=i.decode(2,c);if(h.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(l)}},hexFromSig(e){const{_tlv:t,_int:r}=be,i=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,i)}};Object.freeze(be._tlv),Object.freeze(be._int),Object.freeze(be);const Se=BigInt(0),we=BigInt(1),Oe=BigInt(2),_e=BigInt(3),Ie=BigInt(4);function Ee(e,t={}){const r=function(e,t,r={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>re))throw new Error(`CURVE.${e} must be positive bigint`)}const n=de(t.p,r.Fp,i),o=de(t.n,r.Fn,i),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!n.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:o}}("weierstrass",e,t),i=r.Fp,n=r.Fn;let a=r.CURVE;const{h:l,n:h}=a;P(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});const{endo:f,allowInfinityPoint:p}=t;if(f&&(!i.is0(a.a)||"bigint"!=typeof f.beta||!Array.isArray(f.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const g=Pe(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const y=void 0===t.toBytes?function(e,t,r){if(p&&t.is0())return Uint8Array.of(0);const{x:n,y:o}=t.toAffine(),a=i.toBytes(n);if(d(r,"isCompressed"),r){m();const e=!i.isOdd(o);return u(Ae(e),a)}return u(Uint8Array.of(4),a,i.toBytes(o))}:t.toBytes,v=void 0===t.fromBytes?function(e){o(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=g,n=e.length,a=e[0],s=e.subarray(1);if(p&&1===n&&0===a)return{x:i.ZERO,y:i.ZERO};if(n!==t||2!==a&&3!==a){if(n===r&&4===a){const e=i.BYTES,t=i.fromBytes(s.subarray(0,e)),r=i.fromBytes(s.subarray(e,2*e));if(!S(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${r}`)}{const e=i.fromBytes(s);if(!i.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=b(e);let r;try{r=i.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}m();return!(1&~a)!==i.isOdd(r)&&(r=i.neg(r)),{x:e,y:r}}}:t.fromBytes;function b(e){const t=i.sqr(e),r=i.mul(t,e);return i.add(i.add(r,i.mul(e,a.a)),a.b)}function S(e,t){const r=i.sqr(t),n=b(e);return i.eql(r,n)}if(!S(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const w=i.mul(i.pow(a.a,_e),Ie),O=i.mul(i.sqr(a.b),BigInt(27));if(i.is0(i.add(w,O)))throw new Error("bad curve params: a or b");function _(e,t,r=!1){if(!i.isValid(t)||r&&i.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function k(e){if(!(e instanceof R))throw new Error("Weierstrass Point expected")}function x(e){if(!f||!f.basises)throw new Error("no endo");return function(e,t,r){I("scalar",e,Se,r);const[[i,n],[o,a]]=t,s=ge(a*e,r),u=ge(-n*e,r);let c=e-s*i-u*o,l=-s*n-u*a;const h=c<Se,f=l<Se;h&&(c=-c),f&&(l=-l);const p=A(Math.ceil(E(r)/2))+we;if(c<Se||c>=p||l<Se||l>=p)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:h,k1:c,k2neg:f,k2:l}}(e,f.basises,n.ORDER)}function T(e,t,r,n,o){return r=new R(i.mul(r.X,e),r.Y,r.Z),t=ne(n,t),r=ne(o,r),t.add(r)}class R{static BASE=new R(a.Gx,a.Gy,i.ONE);static ZERO=new R(i.ZERO,i.ONE,i.ZERO);static Fp=i;static Fn=n;X;Y;Z;constructor(e,t,r){this.X=_("x",e),this.Y=_("y",t,!0),this.Z=_("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw new Error("invalid affine point");if(e instanceof R)throw new Error("projective point not allowed");return i.is0(t)&&i.is0(r)?R.ZERO:new R(t,r,i.ONE)}static fromBytes(e){const t=R.fromAffine(v(o(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return R.fromBytes(c(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return N.createCache(this,e),t||this.multiply(_e),this}assertValidity(){const e=this;if(e.is0()){if(t.allowInfinityPoint&&i.is0(e.X)&&i.eql(e.Y,i.ONE)&&i.is0(e.Z))return;throw new Error("bad point: ZERO")}const{x:r,y:n}=e.toAffine();if(!i.isValid(r)||!i.isValid(n))throw new Error("bad point: x or y not field elements");if(!S(r,n))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(e)}equals(e){k(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:a,Z:s}=e,u=i.eql(i.mul(t,s),i.mul(o,n)),c=i.eql(i.mul(r,s),i.mul(a,n));return u&&c}negate(){return new R(this.X,i.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,r=i.mul(t,_e),{X:n,Y:o,Z:s}=this;let u=i.ZERO,c=i.ZERO,l=i.ZERO,h=i.mul(n,n),f=i.mul(o,o),p=i.mul(s,s),d=i.mul(n,o);return d=i.add(d,d),l=i.mul(n,s),l=i.add(l,l),u=i.mul(e,l),c=i.mul(r,p),c=i.add(u,c),u=i.sub(f,c),c=i.add(f,c),c=i.mul(u,c),u=i.mul(d,u),l=i.mul(r,l),p=i.mul(e,p),d=i.sub(h,p),d=i.mul(e,d),d=i.add(d,l),l=i.add(h,h),h=i.add(l,h),h=i.add(h,p),h=i.mul(h,d),c=i.add(c,h),p=i.mul(o,s),p=i.add(p,p),h=i.mul(p,d),u=i.sub(u,h),l=i.mul(p,f),l=i.add(l,l),l=i.add(l,l),new R(u,c,l)}add(e){k(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:s,Z:u}=e;let c=i.ZERO,l=i.ZERO,h=i.ZERO;const f=a.a,p=i.mul(a.b,_e);let d=i.mul(t,o),g=i.mul(r,s),m=i.mul(n,u),y=i.add(t,r),v=i.add(o,s);y=i.mul(y,v),v=i.add(d,g),y=i.sub(y,v),v=i.add(t,n);let b=i.add(o,u);return v=i.mul(v,b),b=i.add(d,m),v=i.sub(v,b),b=i.add(r,n),c=i.add(s,u),b=i.mul(b,c),c=i.add(g,m),b=i.sub(b,c),h=i.mul(f,v),c=i.mul(p,m),h=i.add(c,h),c=i.sub(g,h),h=i.add(g,h),l=i.mul(c,h),g=i.add(d,d),g=i.add(g,d),m=i.mul(f,m),v=i.mul(p,v),g=i.add(g,m),m=i.sub(d,m),m=i.mul(f,m),v=i.add(v,m),d=i.mul(g,v),l=i.add(l,d),d=i.mul(b,v),c=i.mul(y,c),c=i.sub(c,d),d=i.mul(y,g),h=i.mul(b,h),h=i.add(h,d),new R(c,l,h)}subtract(e){return k(e),this.add(e.negate())}is0(){return this.equals(R.ZERO)}multiply(e){const{endo:r}=t;if(!n.isValidNot0(e))throw new RangeError("invalid scalar: out of range");let i,o;const a=e=>N.cached(this,e,e=>oe(R,e));if(r){const{k1neg:t,k1:n,k2neg:s,k2:u}=x(e),{p:c,f:l}=a(n),{p:h,f}=a(u);o=l.add(f),i=T(r.beta,c,h,t,s)}else{const{p:t,f:r}=a(e);i=t,o=r}return oe(R,[i,o])[0]}multiplyUnsafe(e){const{endo:r}=t,i=this,o=e;if(!n.isValid(o))throw new RangeError("invalid scalar: out of range");if(o===Se||i.is0())return R.ZERO;if(o===we)return i;if(N.hasCache(this))return this.multiply(o);if(r){const{k1neg:e,k1:t,k2neg:n,k2:a}=x(o),{p1:s,p2:u}=function(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>re||i>re;)r&ie&&(o=o.add(n)),i&ie&&(a=a.add(n)),n=n.double(),r>>=ie,i>>=ie;return{p1:o,p2:a}}(R,i,t,a);return T(r.beta,s,u,e,n)}return N.unsafe(i,o)}toAffine(e){let t=e;const{X:r,Y:n,Z:o}=this;if(i.eql(o,i.ONE))return{x:r,y:n};const a=this.is0();null==t&&(t=a?i.ONE:i.inv(o));const s=i.mul(r,t),u=i.mul(n,t),c=i.mul(o,t);if(a)return{x:i.ZERO,y:i.ZERO};if(!i.eql(c,i.ONE))throw new Error("invZ was invalid");return{x:s,y:u}}isTorsionFree(){const{isTorsionFree:e}=t;return l===we||(e?e(R,this):N.unsafe(this,h).is0())}clearCofactor(){const{clearCofactor:e}=t;return l===we?this:e?e(R,this):this.multiplyUnsafe(l)}isSmallOrder(){return l===we?this.is0():this.clearCofactor().is0()}toBytes(e=!0){return d(e,"isCompressed"),this.assertValidity(),y(R,this,e)}toHex(e=!0){return s(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const B=n.BITS,N=new pe(R,t.endo?Math.ceil(B/2):B);return B>=8&&R.BASE.precompute(8),Object.freeze(R.prototype),Object.freeze(R),R}function Ae(e){return Uint8Array.of(e?2:3)}function Pe(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function ke(e,t={}){const{Fn:r}=e,i=void 0===t.randomBytes?h:t.randomBytes,n=Object.assign(Pe(e.Fp,r),{seed:Math.max(ee(r.ORDER),16)});function a(e){return e=void 0===e?i(n.seed):e,function(e,t,r=!1){o(e);const i=e.length,n=Q(t),a=Math.max(ee(t),16);if(i<a||i>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+i);const s=H(r?S(e):b(e),t-x)+x;return r?O(s,n):w(s,n)}(o(e,n.seed,"seed"),r.ORDER)}function s(t,i=!0){return e.BASE.multiply(r.fromBytes(t)).toBytes(i)}function u(e){const{secretKey:t,publicKey:i,publicKeyUncompressed:a}=n,s=r._lengths;if(!l(e))return;const u=o(e,void 0,"key").length,c=u===i||u===a,h=u===t||!!s?.includes(u);return c&&h?void 0:c}const c={isValidSecretKey:function(e){try{const t=r.fromBytes(e);return r.isValidNot0(t)}catch(e){return!1}},isValidPublicKey:function(t,r){const{publicKey:i,publicKeyUncompressed:o}=n;try{const n=t.length;return(!0!==r||n===i)&&((!1!==r||n===o)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:a},f=function(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}(a,s);return Object.freeze(c),Object.freeze(n),Object.freeze({getPublicKey:s,getSharedSecret:function(t,i,n=!0){if(!0===u(t))throw new Error("first arg must be private key");if(!1===u(i))throw new Error("second arg must be public key");const o=r.fromBytes(t);return e.fromBytes(i).multiply(o).toBytes(n)},keygen:f,Point:e,utils:c,lengths:n})}function xe(e,t,r={}){const i=t;(0,n.sd)(i),P(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=void 0===(r=Object.assign({},r)).randomBytes?h:r.randomBytes,f=void 0===r.hmac?(e,t)=>(0,te.hmac)(i,e,t):r.hmac,{Fp:p,Fn:d}=e,{ORDER:g,BITS:m}=d,{keygen:y,getPublicKey:v,getSharedSecret:S,utils:w,lengths:O}=ke(e,r),_={prehash:!0,lowS:"boolean"!=typeof r.lowS||r.lowS,format:"compact",extraEntropy:!1},E=g*Oe+we<p.ORDER;function k(e){return e>g>>we}function x(e,t){if(!d.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function T(){if(E)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function R(e,t){me(t);const r=O.signature;return o(e,"compact"===t?r:"recovered"===t?r+1:void 0)}class B{r;s;recovery;constructor(e,t,r){if(this.r=x("r",e),this.s=x("s",t),null!=r){if(T(),![0,1,2,3].includes(r))throw new Error("invalid recovery id");this.recovery=r}Object.freeze(this)}static fromBytes(e,t=_.format){let r;if(R(e,t),"der"===t){const{r:t,s:r}=be.toSig(o(e));return new B(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const i=O.signature/2,n=e.subarray(0,i),a=e.subarray(i,2*i);return new B(d.fromBytes(n),d.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes(c(e),t)}assertRecovery(){const{recovery:e}=this;if(null==e)throw new Error("invalid recovery id: must be present");return e}addRecoveryBit(e){return new B(this.r,this.s,e)}recoverPublicKey(t){const{r,s:i}=this,n=this.assertRecovery(),a=2===n||3===n?r+g:r;if(!p.isValid(a))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const s=p.toBytes(a),c=e.fromBytes(u(Ae(!(1&n)),s)),l=d.inv(a),h=C(o(t,void 0,"msgHash")),f=d.create(-h*l),m=d.create(i*l),y=e.BASE.multiplyUnsafe(f).add(c.multiplyUnsafe(m));if(y.is0())throw new Error("invalid recovery: point at infinify");return y.assertValidity(),y}hasHighS(){return k(this.s)}toBytes(e=_.format){if(me(e),"der"===e)return c(be.hexFromSig(this));const{r:t,s:r}=this,i=d.toBytes(t),n=d.toBytes(r);return"recovered"===e?(T(),u(Uint8Array.of(this.assertRecovery()),i,n)):u(i,n)}toHex(e){return s(this.toBytes(e))}}Object.freeze(B.prototype),Object.freeze(B);const N=void 0===r.bits2int?function(e){if(e.length>8192)throw new Error("input is too large");const t=b(e),r=8*e.length-m;return r>0?t>>BigInt(r):t}:r.bits2int,C=void 0===r.bits2int_modN?function(e){return d.create(N(e))}:r.bits2int_modN,D=A(m);function M(e){return I("num < 2^"+m,e,Se,D),d.toBytes(e)}function L(e,t){return o(e,void 0,"message"),t?o(i(e),void 0,"prehashed message"):e}return Object.freeze({keygen:y,getPublicKey:v,getSharedSecret:S,utils:w,lengths:O,Point:e,sign:function(t,r,s={}){const{seed:c,k2sig:l}=function(t,r,i){const{lowS:n,prehash:s,extraEntropy:c}=ye(i,_);t=L(t,s);const l=C(t),h=d.fromBytes(r);if(!d.isValidNot0(h))throw new Error("invalid private key");const f=[M(h),M(l)];if(null!=c&&!1!==c){const e=!0===c?a(O.secretKey):c;f.push(o(e,void 0,"extraEntropy"))}const p=u(...f),g=l;return{seed:p,k2sig:function(t){const r=N(t);if(!d.isValidNot0(r))return;const i=d.inv(r),o=e.BASE.multiply(r).toAffine(),a=d.create(o.x);if(a===Se)return;const s=d.create(i*d.create(g+a*h));if(s===Se)return;let u=(o.x===a?0:2)|Number(o.y&we),c=s;return n&&k(s)&&(c=d.neg(s),u^=1),new B(a,c,E?void 0:u)}}}(t,r,s);return function(e,t,r){if((0,n.Fe)(e,"hashLen"),(0,n.Fe)(t,"qByteLen"),"function"!=typeof r)throw new TypeError("hmacFn must be a function");const i=e=>new Uint8Array(e),o=Uint8Array.of(),a=Uint8Array.of(0),s=Uint8Array.of(1);let c=i(e),l=i(e),h=0;const f=()=>{c.fill(1),l.fill(0),h=0},p=(...e)=>r(l,u(c,...e)),d=(e=o)=>{l=p(a,e),c=p(),0!==e.length&&(l=p(s,e),c=p())},g=()=>{if(h++>=1e3)throw new Error("drbg: tried max amount of iterations");let e=0;const r=[];for(;e<t;){c=p();const t=c.slice();r.push(t),e+=c.length}return u(...r)};return(e,t)=>{let r;for(f(),d(e);void 0===(r=t(g()));)d();return f(),r}}(i.outputLen,d.BYTES,f)(c,l).toBytes(s.format)},verify:function(t,r,i,n={}){const{lowS:a,prehash:s,format:u}=ye(n,_);if(i=o(i,void 0,"publicKey"),r=L(r,s),!l(t)){throw new Error("verify expects Uint8Array signature"+(t instanceof B?", use sig.toBytes()":""))}R(t,u);try{const n=B.fromBytes(t,u),o=e.fromBytes(i);if(a&&n.hasHighS())return!1;const{r:s,s:c}=n,l=C(r),h=d.inv(c),f=d.create(l*h),p=d.create(s*h),g=e.BASE.multiplyUnsafe(f).add(o.multiplyUnsafe(p));if(g.is0())return!1;return d.create(g.x)===s}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:i}=ye(r,_);return t=L(t,i),B.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:B,hash:i})}
47
- /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
48
- const Te={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Re={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Be=BigInt(2);const Ne=Z(Te.p,{sqrt:function(e){const t=Te.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,l=c*c*e%t,h=j(l,r,t)*l%t,f=j(h,r,t)*l%t,p=j(f,Be,t)*c%t,d=j(p,n,t)*p%t,g=j(d,o,t)*d%t,m=j(g,s,t)*g%t,y=j(m,u,t)*m%t,v=j(y,s,t)*g%t,b=j(v,r,t)*l%t,S=j(b,a,t)*d%t,w=j(S,i,t)*c%t,O=j(w,Be,t);if(!Ne.eql(Ne.sqr(O),e))throw new Error("Cannot find square root");return O}}),Ce=Ee(Te,{Fp:Ne,endo:Re}),De=xe(Ce,i.sha256)},7474(e,t,r){"use strict";r.d(t,{hmac:()=>o});var i=r(508);class n{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,i.sd)(e),(0,i.DO)(t,void 0,"key"),this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,n=new Uint8Array(r);n.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),(0,i.uH)(n)}update(e){return(0,i.CC)(this),this.iHash.update(e),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const o=(()=>{const e=(e,t,r)=>new n(e,t).update(r).digest();return e.create=(e,t)=>new n(e,t),e})()},8087(e,t,r){"use strict";r.d(t,{sha256:()=>L,sha512:()=>H});var i=r(508);function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}class a{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,i.O8)(this.buffer)}update(e){(0,i.CC)(this),(0,i.DO)(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);if(s===n){const t=(0,i.O8)(e);for(;n<=o-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:a}=this;t[a++]=128,(0,i.uH)(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const s=(0,i.O8)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=u/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,l[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const s=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),c=BigInt(2**32-1),l=BigInt(32);function h(e,t=!1){return t?{h:Number(e&c),l:Number(e>>l&c)}:{h:0|Number(e>>l&c),l:0|Number(e&c)}}function f(e,t=!1){const r=e.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:a}=h(e[o],t);[i[o],n[o]]=[r,a]}return[i,n]}const p=(e,t,r)=>e>>>r,d=(e,t,r)=>e<<32-r|t>>>r,g=(e,t,r)=>e>>>r|t<<32-r,m=(e,t,r)=>e<<32-r|t>>>r,y=(e,t,r)=>e<<64-r|t>>>r-32,v=(e,t,r)=>e>>>r-32|t<<64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}const S=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,O=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),_=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,I=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),E=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0;const A=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),P=new Uint32Array(64);class k extends a{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:i,E:n,F:o,G:a,H:s}=this;return[e,t,r,i,n,o,a,s]}set(e,t,r,i,n,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)P[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=P[e-15],r=P[e-2],n=(0,i.Ow)(t,7)^(0,i.Ow)(t,18)^t>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;P[e]=o+P[e-7]+n+P[e-16]|0}let{A:r,B:a,C:s,D:u,E:c,F:l,G:h,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+n(c,l,h)+A[e]+P[e]|0,p=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+o(r,a,s)|0;f=h,h=l,l=c,c=u+t|0,u=s,s=a,a=r,r=t+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,u=u+this.D|0,c=c+this.E|0,l=l+this.F|0,h=h+this.G|0,f=f+this.H|0,this.set(r,a,s,u,c,l,h,f)}roundClean(){(0,i.uH)(P)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}class x extends k{A=0|s[0];B=0|s[1];C=0|s[2];D=0|s[3];E=0|s[4];F=0|s[5];G=0|s[6];H=0|s[7];constructor(){super(32)}}const T=(()=>f(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))))(),R=(()=>T[0])(),B=(()=>T[1])(),N=new Uint32Array(80),C=new Uint32Array(80);class D extends a{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:l,Fl:h,Gh:f,Gl:p,Hh:d,Hl:g}=this;return[e,t,r,i,n,o,a,s,u,c,l,h,f,p,d,g]}set(e,t,r,i,n,o,a,s,u,c,l,h,f,p,d,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|l,this.Fl=0|h,this.Gh=0|f,this.Gl=0|p,this.Hh=0|d,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)N[r]=e.getUint32(t),C[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|N[e-15],r=0|C[e-15],i=g(t,r,1)^g(t,r,8)^p(t,0,7),n=m(t,r,1)^m(t,r,8)^d(t,r,7),o=0|N[e-2],a=0|C[e-2],s=g(o,a,19)^y(o,a,61)^p(o,0,6),u=m(o,a,19)^v(o,a,61)^d(o,a,6),c=O(n,u,C[e-7],C[e-16]),l=_(c,i,s,N[e-7],N[e-16]);N[e]=0|l,C[e]=0|c}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:a,Cl:s,Dh:u,Dl:c,Eh:l,El:h,Fh:f,Fl:A,Gh:P,Gl:k,Hh:x,Hl:T}=this;for(let e=0;e<80;e++){const t=g(l,h,14)^g(l,h,18)^y(l,h,41),p=m(l,h,14)^m(l,h,18)^v(l,h,41),d=l&f^~l&P,O=I(T,p,h&A^~h&k,B[e],C[e]),_=E(O,x,t,d,R[e],N[e]),D=0|O,M=g(r,i,28)^y(r,i,34)^y(r,i,39),L=m(r,i,28)^v(r,i,34)^v(r,i,39),H=r&n^r&a^n&a,j=i&o^i&s^o&s;x=0|P,T=0|k,P=0|f,k=0|A,f=0|l,A=0|h,({h:l,l:h}=b(0|u,0|c,0|_,0|D)),u=0|a,c=0|s,a=0|n,s=0|o,n=0|r,o=0|i;const U=S(D,L,j);r=w(U,_,M,H),i=0|U}({h:r,l:i}=b(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=b(0|this.Bh,0|this.Bl,0|n,0|o)),({h:a,l:s}=b(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=b(0|this.Dh,0|this.Dl,0|u,0|c)),({h:l,l:h}=b(0|this.Eh,0|this.El,0|l,0|h)),({h:f,l:A}=b(0|this.Fh,0|this.Fl,0|f,0|A)),({h:P,l:k}=b(0|this.Gh,0|this.Gl,0|P,0|k)),({h:x,l:T}=b(0|this.Hh,0|this.Hl,0|x,0|T)),this.set(r,i,n,o,a,s,u,c,l,h,f,A,P,k,x,T)}roundClean(){(0,i.uH)(N,C)}destroy(){this.destroyed=!0,(0,i.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class M extends D{Ah=0|u[0];Al=0|u[1];Bh=0|u[2];Bl=0|u[3];Ch=0|u[4];Cl=0|u[5];Dh=0|u[6];Dl=0|u[7];Eh=0|u[8];El=0|u[9];Fh=0|u[10];Fl=0|u[11];Gh=0|u[12];Gl=0|u[13];Hh=0|u[14];Hl=0|u[15];constructor(){super(64)}}const L=(0,i.qj)(()=>new x,(0,i.nx)(1)),H=(0,i.qj)(()=>new M,(0,i.nx)(3))},508(e,t,r){"use strict";function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}function n(e,t=""){if("number"!=typeof e){throw new TypeError(`${t&&`"${t}" `}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){throw new RangeError(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function o(e,t,r=""){const n=i(e),o=e?.length,a=void 0!==t;if(!n||a&&o!==t){const i=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e);if(!n)throw new TypeError(i);throw new RangeError(i)}return e}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new TypeError("Hash must wrapped by utils.createHasher");if(n(e.outputLen),n(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>s,DO:()=>o,Fe:()=>n,Ht:()=>u,Id:()=>_,My:()=>d,O8:()=>l,Ow:()=>h,aT:()=>O,aY:()=>i,nx:()=>A,po:()=>E,qj:()=>I,sd:()=>a,uH:()=>c});const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(o(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}const g=48,m=57,y=65,v=70,b=97,S=102;function w(e){return e>=g&&e<=m?e-g:e>=y&&e<=v?e-(y-10):e>=b&&e<=S?e-(b-10):void 0}function O(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);if(f)try{return Uint8Array.fromHex(e)}catch(e){if(e instanceof SyntaxError)throw new RangeError(e.message);throw e}const t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=w(e.charCodeAt(n)),o=w(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new RangeError('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function _(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];o(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r}function I(e,t={}){const r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}function E(e=32){n(e,"bytesLength");const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const A=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})},9294(e,t,r){"use strict";r.d(t,{c:()=>i});var i=r(4233)},8330(e){"use strict";e.exports={rE:"6.1.2"}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var o=t[i]={id:i,loaded:!1,exports:{}};return e[i].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.c=t,r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i=r(r.s=5424);bsvCovenant=i})();
1
+ var bsvCovenant=(()=>{var qr=Object.create;var cr=Object.defineProperty;var Yr=Object.getOwnPropertyDescriptor;var Kr=Object.getOwnPropertyNames;var Vr=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty;var Wr=(e,r,t)=>()=>{if(t)throw t[0];try{return e&&(r=e(e=0)),r}catch(i){throw t=[i],i}};var P=(e,r)=>()=>{try{return r||e((r={exports:{}}).exports,r),r.exports}catch(t){throw r=0,t}};var Xr=(e,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Kr(r))!jr.call(e,n)&&n!==t&&cr(e,n,{get:()=>r[n],enumerable:!(i=Yr(r,n))||i.enumerable});return e};var sr=(e,r,t)=>(t=e!=null?qr(Vr(e)):{},Xr(r||!e||!e.__esModule?cr(t,"default",{value:e,enumerable:!0}):t,e));var lr=P((bt,pr)=>{d();var y=pr.exports={},F,S;function W(){throw new Error("setTimeout has not been defined")}function X(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?F=setTimeout:F=W}catch{F=W}try{typeof clearTimeout=="function"?S=clearTimeout:S=X}catch{S=X}})();function hr(e){if(F===setTimeout)return setTimeout(e,0);if((F===W||!F)&&setTimeout)return F=setTimeout,setTimeout(e,0);try{return F(e,0)}catch{try{return F.call(null,e,0)}catch{return F.call(this,e,0)}}}function Jr(e){if(S===clearTimeout)return clearTimeout(e);if((S===X||!S)&&clearTimeout)return S=clearTimeout,clearTimeout(e);try{return S(e)}catch{try{return S.call(null,e)}catch{return S.call(this,e)}}}var U=[],M=!1,b,q=-1;function Qr(){!M||!b||(M=!1,b.length?U=b.concat(U):q=-1,U.length&&ar())}function ar(){if(!M){var e=hr(Qr);M=!0;for(var r=U.length;r;){for(b=U,U=[];++q<r;)b&&b[q].run();q=-1,r=U.length}b=null,M=!1,Jr(e)}}y.nextTick=function(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];U.push(new fr(e,r)),U.length===1&&!M&&hr(ar)};function fr(e,r){this.fun=e,this.array=r}fr.prototype.run=function(){this.fun.apply(null,this.array)};y.title="browser";y.browser=!0;y.env={};y.argv=[];y.version="";y.versions={};function R(){}y.on=R;y.addListener=R;y.once=R;y.off=R;y.removeListener=R;y.removeAllListeners=R;y.emit=R;y.prependListener=R;y.prependOnceListener=R;y.listeners=function(e){return[]};y.binding=function(e){throw new Error("process.binding is not supported")};y.cwd=function(){return"/"};y.chdir=function(e){throw new Error("process.chdir is not supported")};y.umask=function(){return 0}});var dr=P(Y=>{"use strict";d();Y.byteLength=Zr;Y.toByteArray=tt;Y.fromByteArray=nt;var A=[],E=[],zr=typeof Uint8Array<"u"?Uint8Array:Array,J="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(L=0,yr=J.length;L<yr;++L)A[L]=J[L],E[J.charCodeAt(L)]=L;var L,yr;E[45]=62;E[95]=63;function wr(e){var r=e.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=e.indexOf("=");t===-1&&(t=r);var i=t===r?0:4-t%4;return[t,i]}function Zr(e){var r=wr(e),t=r[0],i=r[1];return(t+i)*3/4-i}function rt(e,r,t){return(r+t)*3/4-t}function tt(e){var r,t=wr(e),i=t[0],n=t[1],o=new zr(rt(e,i,n)),u=0,s=n>0?i-4:i,h;for(h=0;h<s;h+=4)r=E[e.charCodeAt(h)]<<18|E[e.charCodeAt(h+1)]<<12|E[e.charCodeAt(h+2)]<<6|E[e.charCodeAt(h+3)],o[u++]=r>>16&255,o[u++]=r>>8&255,o[u++]=r&255;return n===2&&(r=E[e.charCodeAt(h)]<<2|E[e.charCodeAt(h+1)]>>4,o[u++]=r&255),n===1&&(r=E[e.charCodeAt(h)]<<10|E[e.charCodeAt(h+1)]<<4|E[e.charCodeAt(h+2)]>>2,o[u++]=r>>8&255,o[u++]=r&255),o}function et(e){return A[e>>18&63]+A[e>>12&63]+A[e>>6&63]+A[e&63]}function it(e,r,t){for(var i,n=[],o=r;o<t;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),n.push(et(i));return n.join("")}function nt(e){for(var r,t=e.length,i=t%3,n=[],o=16383,u=0,s=t-i;u<s;u+=o)n.push(it(e,u,u+o>s?s:u+o));return i===1?(r=e[t-1],n.push(A[r>>2]+A[r<<4&63]+"==")):i===2&&(r=(e[t-2]<<8)+e[t-1],n.push(A[r>>10]+A[r>>4&63]+A[r<<2&63]+"=")),n.join("")}});var xr=P(Q=>{d();Q.read=function(e,r,t,i,n){var o,u,s=n*8-i-1,h=(1<<s)-1,p=h>>1,f=-7,a=t?n-1:0,k=t?-1:1,I=e[r+a];for(a+=k,o=I&(1<<-f)-1,I>>=-f,f+=s;f>0;o=o*256+e[r+a],a+=k,f-=8);for(u=o&(1<<-f)-1,o>>=-f,f+=i;f>0;u=u*256+e[r+a],a+=k,f-=8);if(o===0)o=1-p;else{if(o===h)return u?NaN:(I?-1:1)*(1/0);u=u+Math.pow(2,i),o=o-p}return(I?-1:1)*u*Math.pow(2,o-i)};Q.write=function(e,r,t,i,n,o){var u,s,h,p=o*8-n-1,f=(1<<p)-1,a=f>>1,k=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=i?0:o-1,j=i?1:-1,Gr=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(s=isNaN(r)?1:0,u=f):(u=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+a>=1?r+=k/h:r+=k*Math.pow(2,1-a),r*h>=2&&(u++,h/=2),u+a>=f?(s=0,u=f):u+a>=1?(s=(r*h-1)*Math.pow(2,n),u=u+a):(s=r*Math.pow(2,a-1)*Math.pow(2,n),u=0));n>=8;e[t+I]=s&255,I+=j,s/=256,n-=8);for(u=u<<n|s,p+=n;p>0;e[t+I]=u&255,I+=j,u/=256,p-=8);e[t+I-j]|=Gr*128}});var Lr=P(H=>{"use strict";d();var z=dr(),$=xr(),gr=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;H.Buffer=c;H.SlowBuffer=at;H.INSPECT_MAX_BYTES=50;var K=2147483647;H.kMaxLength=K;c.TYPED_ARRAY_SUPPORT=ot();!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ot(){try{let e=new Uint8Array(1),r={foo:function(){return 42}};return Object.setPrototypeOf(r,Uint8Array.prototype),Object.setPrototypeOf(e,r),e.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}});Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function C(e){if(e>K)throw new RangeError('The value "'+e+'" is invalid for option "size"');let r=new Uint8Array(e);return Object.setPrototypeOf(r,c.prototype),r}function c(e,r,t){if(typeof e=="number"){if(typeof r=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return er(e)}return Ir(e,r,t)}c.poolSize=8192;function Ir(e,r,t){if(typeof e=="string")return ct(e,r);if(ArrayBuffer.isView(e))return st(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return rr(e,r,t);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=e.valueOf&&e.valueOf();if(i!=null&&i!==e)return c.from(i,r,t);let n=ht(e);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return c.from(e[Symbol.toPrimitive]("string"),r,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}c.from=function(e,r,t){return Ir(e,r,t)};Object.setPrototypeOf(c.prototype,Uint8Array.prototype);Object.setPrototypeOf(c,Uint8Array);function Fr(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function ut(e,r,t){return Fr(e),e<=0?C(e):r!==void 0?typeof t=="string"?C(e).fill(r,t):C(e).fill(r):C(e)}c.alloc=function(e,r,t){return ut(e,r,t)};function er(e){return Fr(e),C(e<0?0:ir(e)|0)}c.allocUnsafe=function(e){return er(e)};c.allocUnsafeSlow=function(e){return er(e)};function ct(e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!c.isEncoding(r))throw new TypeError("Unknown encoding: "+r);let t=Sr(e,r)|0,i=C(t),n=i.write(e,r);return n!==t&&(i=i.slice(0,n)),i}function Z(e){let r=e.length<0?0:ir(e.length)|0,t=C(r);for(let i=0;i<r;i+=1)t[i]=e[i]&255;return t}function st(e){if(T(e,Uint8Array)){let r=new Uint8Array(e);return rr(r.buffer,r.byteOffset,r.byteLength)}return Z(e)}function rr(e,r,t){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return r===void 0&&t===void 0?i=new Uint8Array(e):t===void 0?i=new Uint8Array(e,r):i=new Uint8Array(e,r,t),Object.setPrototypeOf(i,c.prototype),i}function ht(e){if(c.isBuffer(e)){let r=ir(e.length)|0,t=C(r);return t.length===0||e.copy(t,0,0,r),t}if(e.length!==void 0)return typeof e.length!="number"||or(e.length)?C(0):Z(e);if(e.type==="Buffer"&&Array.isArray(e.data))return Z(e.data)}function ir(e){if(e>=K)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K.toString(16)+" bytes");return e|0}function at(e){return+e!=e&&(e=0),c.alloc(+e)}c.isBuffer=function(r){return r!=null&&r._isBuffer===!0&&r!==c.prototype};c.compare=function(r,t){if(T(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),T(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(r)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(r===t)return 0;let i=r.length,n=t.length;for(let o=0,u=Math.min(i,n);o<u;++o)if(r[o]!==t[o]){i=r[o],n=t[o];break}return i<n?-1:n<i?1:0};c.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};c.concat=function(r,t){if(!Array.isArray(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return c.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<r.length;++i)t+=r[i].length;let n=c.allocUnsafe(t),o=0;for(i=0;i<r.length;++i){let u=r[i];if(T(u,Uint8Array))o+u.length>n.length?(c.isBuffer(u)||(u=c.from(u)),u.copy(n,o)):Uint8Array.prototype.set.call(n,u,o);else if(c.isBuffer(u))u.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=u.length}return n};function Sr(e,r){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let t=e.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return tr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return br(e).length;default:if(n)return i?-1:tr(e).length;r=(""+r).toLowerCase(),n=!0}}c.byteLength=Sr;function ft(e,r,t){let i=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return mt(this,r,t);case"utf8":case"utf-8":return Tr(this,r,t);case"ascii":return Bt(this,r,t);case"latin1":case"binary":return Et(this,r,t);case"base64":return xt(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,r,t);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}c.prototype._isBuffer=!0;function D(e,r,t){let i=e[r];e[r]=e[t],e[t]=i}c.prototype.swap16=function(){let r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<r;t+=2)D(this,t,t+1);return this};c.prototype.swap32=function(){let r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<r;t+=4)D(this,t,t+3),D(this,t+1,t+2);return this};c.prototype.swap64=function(){let r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<r;t+=8)D(this,t,t+7),D(this,t+1,t+6),D(this,t+2,t+5),D(this,t+3,t+4);return this};c.prototype.toString=function(){let r=this.length;return r===0?"":arguments.length===0?Tr(this,0,r):ft.apply(this,arguments)};c.prototype.toLocaleString=c.prototype.toString;c.prototype.equals=function(r){if(!c.isBuffer(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:c.compare(this,r)===0};c.prototype.inspect=function(){let r="",t=H.INSPECT_MAX_BYTES;return r=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(r+=" ... "),"<Buffer "+r+">"};gr&&(c.prototype[gr]=c.prototype.inspect);c.prototype.compare=function(r,t,i,n,o){if(T(r,Uint8Array)&&(r=c.from(r,r.offset,r.byteLength)),!c.isBuffer(r))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof r);if(t===void 0&&(t=0),i===void 0&&(i=r?r.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>r.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===r)return 0;let u=o-n,s=i-t,h=Math.min(u,s),p=this.slice(n,o),f=r.slice(t,i);for(let a=0;a<h;++a)if(p[a]!==f[a]){u=p[a],s=f[a];break}return u<s?-1:s<u?1:0};function Ar(e,r,t,i,n){if(e.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,or(t)&&(t=n?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(n)return-1;t=e.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof r=="string"&&(r=c.from(r,i)),c.isBuffer(r))return r.length===0?-1:Br(e,r,t,i,n);if(typeof r=="number")return r=r&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):Br(e,[r],t,i,n);throw new TypeError("val must be string, number or Buffer")}function Br(e,r,t,i,n){let o=1,u=e.length,s=r.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||r.length<2)return-1;o=2,u/=2,s/=2,t/=2}function h(f,a){return o===1?f[a]:f.readUInt16BE(a*o)}let p;if(n){let f=-1;for(p=t;p<u;p++)if(h(e,p)===h(r,f===-1?0:p-f)){if(f===-1&&(f=p),p-f+1===s)return f*o}else f!==-1&&(p-=p-f),f=-1}else for(t+s>u&&(t=u-s),p=t;p>=0;p--){let f=!0;for(let a=0;a<s;a++)if(h(e,p+a)!==h(r,a)){f=!1;break}if(f)return p}return-1}c.prototype.includes=function(r,t,i){return this.indexOf(r,t,i)!==-1};c.prototype.indexOf=function(r,t,i){return Ar(this,r,t,i,!0)};c.prototype.lastIndexOf=function(r,t,i){return Ar(this,r,t,i,!1)};function pt(e,r,t,i){t=Number(t)||0;let n=e.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let o=r.length;i>o/2&&(i=o/2);let u;for(u=0;u<i;++u){let s=parseInt(r.substr(u*2,2),16);if(or(s))return u;e[t+u]=s}return u}function lt(e,r,t,i){return V(tr(r,e.length-t),e,t,i)}function yt(e,r,t,i){return V(Tt(r),e,t,i)}function wt(e,r,t,i){return V(br(r),e,t,i)}function dt(e,r,t,i){return V(Ut(r,e.length-t),e,t,i)}c.prototype.write=function(r,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),r.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let u=!1;for(;;)switch(n){case"hex":return pt(this,r,t,i);case"utf8":case"utf-8":return lt(this,r,t,i);case"ascii":case"latin1":case"binary":return yt(this,r,t,i);case"base64":return wt(this,r,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dt(this,r,t,i);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}};c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xt(e,r,t){return r===0&&t===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(r,t))}function Tr(e,r,t){t=Math.min(e.length,t);let i=[],n=r;for(;n<t;){let o=e[n],u=null,s=o>239?4:o>223?3:o>191?2:1;if(n+s<=t){let h,p,f,a;switch(s){case 1:o<128&&(u=o);break;case 2:h=e[n+1],(h&192)===128&&(a=(o&31)<<6|h&63,a>127&&(u=a));break;case 3:h=e[n+1],p=e[n+2],(h&192)===128&&(p&192)===128&&(a=(o&15)<<12|(h&63)<<6|p&63,a>2047&&(a<55296||a>57343)&&(u=a));break;case 4:h=e[n+1],p=e[n+2],f=e[n+3],(h&192)===128&&(p&192)===128&&(f&192)===128&&(a=(o&15)<<18|(h&63)<<12|(p&63)<<6|f&63,a>65535&&a<1114112&&(u=a))}}u===null?(u=65533,s=1):u>65535&&(u-=65536,i.push(u>>>10&1023|55296),u=56320|u&1023),i.push(u),n+=s}return gt(i)}var Er=4096;function gt(e){let r=e.length;if(r<=Er)return String.fromCharCode.apply(String,e);let t="",i=0;for(;i<r;)t+=String.fromCharCode.apply(String,e.slice(i,i+=Er));return t}function Bt(e,r,t){let i="";t=Math.min(e.length,t);for(let n=r;n<t;++n)i+=String.fromCharCode(e[n]&127);return i}function Et(e,r,t){let i="";t=Math.min(e.length,t);for(let n=r;n<t;++n)i+=String.fromCharCode(e[n]);return i}function mt(e,r,t){let i=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>i)&&(t=i);let n="";for(let o=r;o<t;++o)n+=Rt[e[o]];return n}function It(e,r,t){let i=e.slice(r,t),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}c.prototype.slice=function(r,t){let i=this.length;r=~~r,t=t===void 0?i:~~t,r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<r&&(t=r);let n=this.subarray(r,t);return Object.setPrototypeOf(n,c.prototype),n};function w(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u<t&&(o*=256);)n+=this[r+u]*o;return n};c.prototype.readUintBE=c.prototype.readUIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r+--t],o=1;for(;t>0&&(o*=256);)n+=this[r+--t]*o;return n};c.prototype.readUint8=c.prototype.readUInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]};c.prototype.readUint16LE=c.prototype.readUInt16LE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]|this[r+1]<<8};c.prototype.readUint16BE=c.prototype.readUInt16BE=function(r,t){return r=r>>>0,t||w(r,2,this.length),this[r]<<8|this[r+1]};c.prototype.readUint32LE=c.prototype.readUInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216};c.prototype.readUint32BE=c.prototype.readUInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])};c.prototype.readBigUInt64LE=N(function(r){r=r>>>0,v(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&G(r,this.length-8);let n=t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24,o=this[++r]+this[++r]*2**8+this[++r]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});c.prototype.readBigUInt64BE=N(function(r){r=r>>>0,v(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&G(r,this.length-8);let n=t*2**24+this[++r]*2**16+this[++r]*2**8+this[++r],o=this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)});c.prototype.readIntLE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=this[r],o=1,u=0;for(;++u<t&&(o*=256);)n+=this[r+u]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};c.prototype.readIntBE=function(r,t,i){r=r>>>0,t=t>>>0,i||w(r,t,this.length);let n=t,o=1,u=this[r+--n];for(;n>0&&(o*=256);)u+=this[r+--n]*o;return o*=128,u>=o&&(u-=Math.pow(2,8*t)),u};c.prototype.readInt8=function(r,t){return r=r>>>0,t||w(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]};c.prototype.readInt16LE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r]|this[r+1]<<8;return i&32768?i|4294901760:i};c.prototype.readInt16BE=function(r,t){r=r>>>0,t||w(r,2,this.length);let i=this[r+1]|this[r]<<8;return i&32768?i|4294901760:i};c.prototype.readInt32LE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24};c.prototype.readInt32BE=function(r,t){return r=r>>>0,t||w(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]};c.prototype.readBigInt64LE=N(function(r){r=r>>>0,v(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&G(r,this.length-8);let n=this[r+4]+this[r+5]*2**8+this[r+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++r]*2**8+this[++r]*2**16+this[++r]*2**24)});c.prototype.readBigInt64BE=N(function(r){r=r>>>0,v(r,"offset");let t=this[r],i=this[r+7];(t===void 0||i===void 0)&&G(r,this.length-8);let n=(t<<24)+this[++r]*2**16+this[++r]*2**8+this[++r];return(BigInt(n)<<BigInt(32))+BigInt(this[++r]*2**24+this[++r]*2**16+this[++r]*2**8+i)});c.prototype.readFloatLE=function(r,t){return r=r>>>0,t||w(r,4,this.length),$.read(this,r,!0,23,4)};c.prototype.readFloatBE=function(r,t){return r=r>>>0,t||w(r,4,this.length),$.read(this,r,!1,23,4)};c.prototype.readDoubleLE=function(r,t){return r=r>>>0,t||w(r,8,this.length),$.read(this,r,!0,52,8)};c.prototype.readDoubleBE=function(r,t){return r=r>>>0,t||w(r,8,this.length),$.read(this,r,!1,52,8)};function x(e,r,t,i,n,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>n||r<o)throw new RangeError('"value" argument is out of bounds');if(t+i>e.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let s=Math.pow(2,8*i)-1;x(this,r,t,i,s,0)}let o=1,u=0;for(this[t]=r&255;++u<i&&(o*=256);)this[t+u]=r/o&255;return t+i};c.prototype.writeUintBE=c.prototype.writeUIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,i=i>>>0,!n){let s=Math.pow(2,8*i)-1;x(this,r,t,i,s,0)}let o=i-1,u=1;for(this[t+o]=r&255;--o>=0&&(u*=256);)this[t+o]=r/u&255;return t+i};c.prototype.writeUint8=c.prototype.writeUInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,255,0),this[t]=r&255,t+1};c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,65535,0),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255,t+4};c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,4294967295,0),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};function Ur(e,r,t,i,n){Nr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o,o=o>>8,e[t++]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,u=u>>8,e[t++]=u,t}function Rr(e,r,t,i,n){Nr(r,i,n,e,t,7);let o=Number(r&BigInt(4294967295));e[t+7]=o,o=o>>8,e[t+6]=o,o=o>>8,e[t+5]=o,o=o>>8,e[t+4]=o;let u=Number(r>>BigInt(32)&BigInt(4294967295));return e[t+3]=u,u=u>>8,e[t+2]=u,u=u>>8,e[t+1]=u,u=u>>8,e[t]=u,t+8}c.prototype.writeBigUInt64LE=N(function(r,t=0){return Ur(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeBigUInt64BE=N(function(r,t=0){return Rr(this,r,t,BigInt(0),BigInt("0xffffffffffffffff"))});c.prototype.writeIntLE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let h=Math.pow(2,8*i-1);x(this,r,t,i,h-1,-h)}let o=0,u=1,s=0;for(this[t]=r&255;++o<i&&(u*=256);)r<0&&s===0&&this[t+o-1]!==0&&(s=1),this[t+o]=(r/u>>0)-s&255;return t+i};c.prototype.writeIntBE=function(r,t,i,n){if(r=+r,t=t>>>0,!n){let h=Math.pow(2,8*i-1);x(this,r,t,i,h-1,-h)}let o=i-1,u=1,s=0;for(this[t+o]=r&255;--o>=0&&(u*=256);)r<0&&s===0&&this[t+o+1]!==0&&(s=1),this[t+o]=(r/u>>0)-s&255;return t+i};c.prototype.writeInt8=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,1,127,-128),r<0&&(r=255+r+1),this[t]=r&255,t+1};c.prototype.writeInt16LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r&255,this[t+1]=r>>>8,t+2};c.prototype.writeInt16BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,2,32767,-32768),this[t]=r>>>8,this[t+1]=r&255,t+2};c.prototype.writeInt32LE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24,t+4};c.prototype.writeInt32BE=function(r,t,i){return r=+r,t=t>>>0,i||x(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255,t+4};c.prototype.writeBigInt64LE=N(function(r,t=0){return Ur(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});c.prototype.writeBigInt64BE=N(function(r,t=0){return Rr(this,r,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Cr(e,r,t,i,n,o){if(t+i>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function _r(e,r,t,i,n){return r=+r,t=t>>>0,n||Cr(e,r,t,4,34028234663852886e22,-34028234663852886e22),$.write(e,r,t,i,23,4),t+4}c.prototype.writeFloatLE=function(r,t,i){return _r(this,r,t,!0,i)};c.prototype.writeFloatBE=function(r,t,i){return _r(this,r,t,!1,i)};function Pr(e,r,t,i,n){return r=+r,t=t>>>0,n||Cr(e,r,t,8,17976931348623157e292,-17976931348623157e292),$.write(e,r,t,i,52,8),t+8}c.prototype.writeDoubleLE=function(r,t,i){return Pr(this,r,t,!0,i)};c.prototype.writeDoubleBE=function(r,t,i){return Pr(this,r,t,!1,i)};c.prototype.copy=function(r,t,i,n){if(!c.isBuffer(r))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=r.length&&(t=r.length),t||(t=0),n>0&&n<i&&(n=i),n===i||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),r.length-t<n-i&&(n=r.length-t+i);let o=n-i;return this===r&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(r,this.subarray(i,n),t),o};c.prototype.fill=function(r,t,i,n){if(typeof r=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(r.length===1){let u=r.charCodeAt(0);(n==="utf8"&&u<128||n==="latin1")&&(r=u)}}else typeof r=="number"?r=r&255:typeof r=="boolean"&&(r=Number(r));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,r||(r=0);let o;if(typeof r=="number")for(o=t;o<i;++o)this[o]=r;else{let u=c.isBuffer(r)?r:c.from(r,n),s=u.length;if(s===0)throw new TypeError('The value "'+r+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=u[o%s]}return this};var O={};function nr(e,r,t){O[e]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:r.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}nr("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);nr("ERR_INVALID_ARG_TYPE",function(e,r){return`The "${e}" argument must be of type number. Received type ${typeof r}`},TypeError);nr("ERR_OUT_OF_RANGE",function(e,r,t){let i=`The value of "${e}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=mr(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=mr(n)),n+="n"),i+=` It must be ${r}. Received ${n}`,i},RangeError);function mr(e){let r="",t=e.length,i=e[0]==="-"?1:0;for(;t>=i+4;t-=3)r=`_${e.slice(t-3,t)}${r}`;return`${e.slice(0,t)}${r}`}function Ft(e,r,t){v(r,"offset"),(e[r]===void 0||e[r+t]===void 0)&&G(r,e.length-(t+1))}function Nr(e,r,t,i,n,o){if(e>t||e<r){let u=typeof r=="bigint"?"n":"",s;throw o>3?r===0||r===BigInt(0)?s=`>= 0${u} and < 2${u} ** ${(o+1)*8}${u}`:s=`>= -(2${u} ** ${(o+1)*8-1}${u}) and < 2 ** ${(o+1)*8-1}${u}`:s=`>= ${r}${u} and <= ${t}${u}`,new O.ERR_OUT_OF_RANGE("value",s,e)}Ft(i,n,o)}function v(e,r){if(typeof e!="number")throw new O.ERR_INVALID_ARG_TYPE(r,"number",e)}function G(e,r,t){throw Math.floor(e)!==e?(v(e,t),new O.ERR_OUT_OF_RANGE(t||"offset","an integer",e)):r<0?new O.ERR_BUFFER_OUT_OF_BOUNDS:new O.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${r}`,e)}var St=/[^+/0-9A-Za-z-_]/g;function At(e){if(e=e.split("=")[0],e=e.trim().replace(St,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function tr(e,r){r=r||1/0;let t,i=e.length,n=null,o=[];for(let u=0;u<i;++u){if(t=e.charCodeAt(u),t>55295&&t<57344){if(!n){if(t>56319){(r-=3)>-1&&o.push(239,191,189);continue}else if(u+1===i){(r-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(r-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(r-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((r-=1)<0)break;o.push(t)}else if(t<2048){if((r-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function Tt(e){let r=[];for(let t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function Ut(e,r){let t,i,n,o=[];for(let u=0;u<e.length&&!((r-=2)<0);++u)t=e.charCodeAt(u),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function br(e){return z.toByteArray(At(e))}function V(e,r,t,i){let n;for(n=0;n<i&&!(n+t>=r.length||n>=e.length);++n)r[n+t]=e[n];return n}function T(e,r){return e instanceof r||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===r.name}function or(e){return e!==e}var Rt=(function(){let e="0123456789abcdef",r=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)r[i+n]=e[t]+e[n]}return r})();function N(e){return typeof BigInt>"u"?Ct:e}function Ct(){throw new Error("BigInt not supported")}});var B,m,d=Wr(()=>{B=sr(lr()),m=sr(Lr())});var kr=P((qt,Dr)=>{d();Dr.exports=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:window).bsv});var ur=P((Kt,Mr)=>{"use strict";d();Mr.exports={}});var vr=P((jt,$r)=>{"use strict";d();var l=kr(),Or=ur(),_;try{_=ur()}catch{_=null}var _t=function(){var e=typeof B.default<"u"&&B.default.env&&B.default.env.BSV_DEBUG||typeof window<"u"&&window.BSV_DEBUG;e&&console.log.apply(console,arguments)};function g(e,r){if(!(this instanceof g))return new g(e,r);this.privateKey=e,this.publicKey=e.publicKey,this.address=e.toAddress(),r=r||{},this.storageDir=r.storageDir||(typeof B.default<"u"?Or.join(B.default.cwd(),".bsv-covenants"):".bsv-covenants"),this.covenantUtxoPath=Or.join(this.storageDir,"covenant_utxos.json"),this.sighashType=l.crypto.Signature.SIGHASH_ALL|l.crypto.Signature.SIGHASH_FORKID,this.allowNonEnforcing=r.allowNonEnforcing===!0,_&&this._ensureStorageDir()}g.prototype.createFromP2PKH=function(e){if(!this.allowNonEnforcing)throw new Error("SmartContract.Covenant builds a NON-ENFORCING script that reduces to plain P2PK \u2014 it does not constrain the spend. Use SmartContract.PushTx.valueCovenant (output binding) or SmartContract.Token / perpetualCovenant (stateful covenants) for real covenants. To use this demo anyway, construct with { allowNonEnforcing: true }.");e.script||(e.script=g.reconstructP2pkhScript(this.address));var r=new l.Transaction().from({txId:e.txid,outputIndex:e.vout,script:e.script,satoshis:e.satoshis}).to(this.address,e.satoshis-1e3),t=l.Script.fromHex(e.script),i=l.Transaction.sighash.sighashPreimage(r,this.sighashType,0,t,new l.crypto.BN(e.satoshis)),n=l.crypto.Hash.sha256sha256(i),o=new l.Script().add("OP_DUP").add("OP_HASH256").add(n).add("OP_EQUALVERIFY").add("OP_DROP").add(this.publicKey.toBuffer()).add("OP_CHECKSIG");r.outputs[0].setScript(o),r.sign(this.privateKey);var u={txid:r.id,vout:0,satoshis:e.satoshis-1e3,script:o.toHex(),scriptPubKey:o.toHex(),preimageHash:n.toString("hex"),originalPreimage:i.toString("hex"),status:"local",createdAt:new Date().toISOString(),type:"preimage_covenant"};return{transaction:r,covenantUtxo:u}};g.prototype.createSpendingTx=function(e,r,t){var i=r||this.address,n=t||e.satoshis-500,o=new l.Transaction;o.addInput(new l.Transaction.Input({prevTxId:e.txid,outputIndex:e.vout,script:l.Script.empty()}),l.Script.fromHex(e.script),e.satoshis),o.to(i,n);var u=l.Script.fromHex(e.script),s=l.Transaction.sighash.sign(o,this.privateKey,this.sighashType,0,u,new l.crypto.BN(e.satoshis)),h=m.Buffer.concat([s.toDER(),m.Buffer.from([this.sighashType])]),p=m.Buffer.from(e.originalPreimage,"hex"),f=new l.Script().add(h).add(p);return o.inputs[0].setScript(f),o};g.prototype.validate=function(e,r){var t=new l.Script.Interpreter,i=l.Script.Interpreter.SCRIPT_VERIFY_P2SH|l.Script.Interpreter.SCRIPT_VERIFY_STRICTENC|l.Script.Interpreter.SCRIPT_VERIFY_DERSIG|l.Script.Interpreter.SCRIPT_VERIFY_LOW_S|l.Script.Interpreter.SCRIPT_ENABLE_SIGHASH_FORKID,n=e.inputs[0].script,o=l.Script.fromHex(r.script),u=t.verify(n,o,e,0,i,new l.crypto.BN(r.satoshis));return{valid:u,error:u?null:t.errstr}};g.prototype.save=function(e){if(!_)return _t("File system operations not available in browser environment"),e;var r=this.list();return r.push(e),_.writeFileSync(this.covenantUtxoPath,JSON.stringify(r,null,2)),e};g.prototype.load=function(e){var r=this.list();if(e){var t=r.find(function(i){return i.txid===e});if(!t)throw new Error("Covenant UTXO with TXID "+e+" not found");return t}else{var t=r.find(function(n){return n.type==="preimage_covenant"});if(!t)throw new Error("No preimage covenant UTXO found");return t}};g.prototype.list=function(){return _.existsSync(this.covenantUtxoPath)?JSON.parse(_.readFileSync(this.covenantUtxoPath,"utf8")):[]};g.prototype.getPortfolio=function(){var e=this.list(),r={total:e.length,totalValue:e.reduce(function(t,i){return t+i.satoshis},0),byStatus:{},recent:e.slice(-5)};return e.forEach(function(t){var i=t.status||"local";r.byStatus[i]||(r.byStatus[i]={count:0,value:0}),r.byStatus[i].count++,r.byStatus[i].value+=t.satoshis}),r};g.prototype.completeFlow=function(e,r){var t=this.createFromP2PKH(e),i=this.save(t.covenantUtxo);r&&r(t.transaction,"creation");var n=this.createSpendingTx(i),o=this.validate(n,i);return r&&o.valid&&r(n,"spending"),{creationTx:t.transaction,spendingTx:n,covenantUtxo:i,validation:o,success:o.valid}};g.prototype._ensureStorageDir=function(){_.existsSync(this.storageDir)||_.mkdirSync(this.storageDir,{recursive:!0})};g.reconstructP2pkhScript=function(e){return l.Script.buildPublicKeyHashOut(e).toHex()};$r.exports=g});var Pt=P((Xt,Hr)=>{d();Hr.exports=vr()});return Pt();})();
2
+ if(typeof module!=="undefined"&&module.exports){module.exports=bsvCovenant}else if(typeof define==="function"&&define.amd){define([],function(){return bsvCovenant})}