@dodoex/wallet-web3 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tslib-cf28c574.js +1 -0
- package/dist/{alchemy-provider-5870b6fa-7183581f.js → alchemy-provider-5870b6fa-e4fa48d3.js} +1 -1
- package/dist/{alchemy-websocket-provider-213da986-d5a91aac.js → alchemy-websocket-provider-213da986-dc2bcf5c.js} +1 -1
- package/dist/{blocto-0ec2fc36.js → blocto-2fb1d4e9.js} +1 -1
- package/dist/browser-3f7e560e.js +1 -0
- package/dist/{ccip-d1141d3a.js → ccip-3c08ea13.js} +1 -1
- package/dist/cjs/__tslib-c375fca0.cjs +1 -0
- package/dist/cjs/{alchemy-provider-5870b6fa-94b8a05d.cjs → alchemy-provider-5870b6fa-00140867.cjs} +1 -1
- package/dist/cjs/{alchemy-websocket-provider-213da986-cb2dca69.cjs → alchemy-websocket-provider-213da986-b2e3ea59.cjs} +1 -1
- package/dist/cjs/{blocto-c4470598.cjs → blocto-b086f036.cjs} +1 -1
- package/dist/cjs/browser-d0e333da.cjs +1 -0
- package/dist/cjs/{ccip-466d4e59.cjs → ccip-248539f9.cjs} +1 -1
- package/dist/cjs/{draggabilly-53856a31.cjs → draggabilly-f7eacd66.cjs} +1 -1
- package/dist/cjs/id-a6c483f9.cjs +1 -0
- package/dist/cjs/{index-9075d9c2.cjs → index-1a09310e.cjs} +1 -1
- package/dist/cjs/{index-6aa1755b.cjs → index-24e8d66c.cjs} +2 -2
- package/dist/cjs/index-2659a245.cjs +2 -0
- package/dist/cjs/{index-63b5eebb.cjs → index-54591c6b.cjs} +1 -1
- package/dist/cjs/{index-9d9946f3.cjs → index-83b277b8.cjs} +7 -7
- package/dist/cjs/index-908a0281.cjs +27 -0
- package/dist/cjs/index-97619c59.cjs +15 -0
- package/dist/cjs/{index-86ef4f22.cjs → index-9dd3dd7e.cjs} +1 -1
- package/dist/cjs/{index-c4c73f44.cjs → index-ace56b81.cjs} +1 -1
- package/dist/cjs/index-b64e1d7e.cjs +1 -0
- package/dist/cjs/{index-56fff369.cjs → index-d297664c.cjs} +1 -1
- package/dist/cjs/index-d965eac9.cjs +1 -0
- package/dist/cjs/index-e65f9734.cjs +15 -0
- package/dist/cjs/{index-76cccf0c.cjs → index-fd28b030.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.es-e98c5ee4.cjs +9 -0
- package/dist/cjs/{interface-d5ec613a.cjs → interface-eb633eac.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-afe9c8e7.cjs → lib-typedarrays-f699b687.cjs} +1 -1
- package/dist/cjs/mm-install-modal_2.entry-4950a7e9.cjs +1 -0
- package/dist/cjs/{portis-9af3489b.cjs → portis-0c036243.cjs} +1 -1
- package/dist/cjs/rainbow-57ada25b.cjs +1 -0
- package/dist/cjs/{sha224-8f3f5508.cjs → sha224-267753d8.cjs} +1 -1
- package/dist/cjs/{sha256-6785be1d.cjs → sha256-d6829c39.cjs} +1 -1
- package/dist/cjs/{typed-data-a102eb38.cjs → typed-data-12a9baf4.cjs} +1 -1
- package/dist/cjs/{uAuth-22dae0a4.cjs → uAuth-0858f962.cjs} +1 -1
- package/dist/cjs/{walletConnect-d4368503.cjs → walletConnect-c55b3f29.cjs} +1 -1
- package/dist/cjs/{walletLink-1b5e5056.cjs → walletLink-961041df.cjs} +2 -2
- package/dist/{draggabilly-96bd4e8a.js → draggabilly-921a68cb.js} +1 -1
- package/dist/id-d72ad2e3.js +1 -0
- package/dist/index-022bd88c.js +27 -0
- package/dist/{index-9a72391b.js → index-18f1c3bb.js} +1 -1
- package/dist/index-21067fcb.js +15 -0
- package/dist/index-2dc796bb.js +2 -0
- package/dist/{index-d9690f1f.js → index-3b7c9150.js} +1 -1
- package/dist/{index-aa09ffe2.js → index-621d68a7.js} +1 -1
- package/dist/index-6b5aff68.js +1 -0
- package/dist/index-7b0eeb5c.js +1 -0
- package/dist/{index-0534a22e.js → index-82e4bb0d.js} +3 -3
- package/dist/{index-de489272.js → index-a98e886d.js} +5 -5
- package/dist/{index-ec77233b.js → index-d3e54bda.js} +1 -1
- package/dist/{index-29d50f5e.js → index-d815c390.js} +1 -1
- package/dist/{index-b27ec2be.js → index-e0e62601.js} +1 -1
- package/dist/{index-25f5dd77.js → index-ff4c01ce.js} +1 -1
- package/dist/index.es-e17cf755.js +9 -0
- package/dist/index.js +1 -1
- package/dist/{interface-501ba1ce.js → interface-b09eb8d7.js} +1 -1
- package/dist/lib-typedarrays-8b3801fe.js +1 -0
- package/dist/mm-install-modal_2.entry-e9e33358.js +1 -0
- package/dist/{portis-59e75b95.js → portis-57c88ff3.js} +1 -1
- package/dist/rainbow-c820ccae.js +1 -0
- package/dist/sha224-5ae0e997.js +1 -0
- package/dist/{sha256-cdb06d7c.js → sha256-260a708c.js} +1 -1
- package/dist/{typed-data-d46cb643.js → typed-data-7ba4540a.js} +1 -1
- package/dist/{uAuth-a93ad1ec.js → uAuth-253510eb.js} +1 -1
- package/dist/{walletConnect-23af88ec.js → walletConnect-fc6f0e52.js} +1 -1
- package/dist/{walletLink-782b101e.js → walletLink-d75a8dc8.js} +2 -2
- package/package.json +2 -2
- package/dist/cjs/id-07cfd31e.cjs +0 -1
- package/dist/cjs/index-af8c9c8e.cjs +0 -15
- package/dist/cjs/index-b82ccec9.cjs +0 -9
- package/dist/cjs/index.es-d9e722ea.cjs +0 -9
- package/dist/cjs/rainbow-4b5d0839.cjs +0 -1
- package/dist/cjs/v4-3e682452.cjs +0 -1
- package/dist/id-6dc2a6aa.js +0 -1
- package/dist/index-66392fdc.js +0 -9
- package/dist/index.es-d60f6859.js +0 -9
- package/dist/lib-typedarrays-5ac4ff04.js +0 -1
- package/dist/rainbow-2c04e9df.js +0 -1
- package/dist/sha224-b20bdf3b.js +0 -1
- package/dist/v4-95658a31.js +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{c as t,y as e,ar as n,as as r,at as i,au as s,av as o,aw as a,ax as u,ay as c,az as l,aA as d,$ as h,z as f}from"./index-a98e886d.js";import{Buffer as p}from"buffer";import"@ethersproject/address";import"@ethersproject/providers";import"zustand";import"@ethersproject/bytes";import"@ethersproject/properties";import"@ethersproject/abstract-signer";import"@ethersproject/abstract-provider";import"@ethersproject/contracts";import"events";import"@ethersproject/constants";import"@ethersproject/transactions";var m,g,_={exports:{}};function v(){if(g)return m;g=1;var t=1e3,e=60*t,n=60*e,r=24*n,i=7*r,s=365.25*r;function o(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}return m=function(a,u){u=u||{};var c=typeof a;if("string"===c&&a.length>0)return function(o){if((o=String(o)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!a)return;var u=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*s;case"weeks":case"week":case"w":return u*i;case"days":case"day":case"d":return u*r;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*e;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(a);if("number"===c&&isFinite(a))return u.long?function(i){var s=Math.abs(i);if(s>=r)return o(i,s,r,"day");if(s>=n)return o(i,s,n,"hour");if(s>=e)return o(i,s,e,"minute");if(s>=t)return o(i,s,t,"second");return i+" ms"}(a):function(i){var s=Math.abs(i);if(s>=r)return Math.round(i/r)+"d";if(s>=n)return Math.round(i/n)+"h";if(s>=e)return Math.round(i/e)+"m";if(s>=t)return Math.round(i/t)+"s";return i+"ms"}(a);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(a))}}var y=function(t){function e(t){let r,i,s,o=null;function a(...t){if(!a.enabled)return;const n=a,i=Number(new Date),s=i-(r||i);n.diff=s,n.prev=r,n.curr=i,r=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,((r,i)=>{if("%%"===r)return"%";o++;const s=e.formatters[i];if("function"==typeof s){const e=t[o];r=s.call(n,e),t.splice(o,1),o--}return r})),e.formatArgs.call(n,t);(n.log||e.log).apply(n,t)}return a.namespace=t,a.useColors=e.useColors(),a.color=e.selectColor(t),a.extend=n,a.destroy=e.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,s=e.enabled(t)),s),set:t=>{o=t}}),"function"==typeof e.init&&e.init(a),a}function n(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function r(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(r),...e.skips.map(r).map((t=>"-"+t))].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.slice(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=v(),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach((n=>{e[n]=t[n]})),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e};!function(t,e){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))})),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=y(e);const{formatters:n}=t.exports;n.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}(_,_.exports);var w=_.exports,b={exports:{}},k=e(b.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=90)}({17:function(t,e,n){e.__esModule=!0,e.default=void 0;var r=n(18),i=function(){function t(){}return t.getFirstMatch=function(t,e){var n=e.match(t);return n&&n.length>0&&n[1]||""},t.getSecondMatch=function(t,e){var n=e.match(t);return n&&n.length>1&&n[2]||""},t.matchAndReturnConst=function(t,e,n){if(t.test(e))return n},t.getWindowsVersionName=function(t){switch(t){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},t.getMacOSVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),10===e[0])switch(e[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},t.getAndroidVersionName=function(t){var e=t.split(".").splice(0,2).map((function(t){return parseInt(t,10)||0}));if(e.push(0),!(1===e[0]&&e[1]<5))return 1===e[0]&&e[1]<6?"Cupcake":1===e[0]&&e[1]>=6?"Donut":2===e[0]&&e[1]<2?"Eclair":2===e[0]&&2===e[1]?"Froyo":2===e[0]&&e[1]>2?"Gingerbread":3===e[0]?"Honeycomb":4===e[0]&&e[1]<1?"Ice Cream Sandwich":4===e[0]&&e[1]<4?"Jelly Bean":4===e[0]&&e[1]>=4?"KitKat":5===e[0]?"Lollipop":6===e[0]?"Marshmallow":7===e[0]?"Nougat":8===e[0]?"Oreo":9===e[0]?"Pie":void 0},t.getVersionPrecision=function(t){return t.split(".").length},t.compareVersions=function(e,n,r){void 0===r&&(r=!1);var i=t.getVersionPrecision(e),s=t.getVersionPrecision(n),o=Math.max(i,s),a=0,u=t.map([e,n],(function(e){var n=o-t.getVersionPrecision(e),r=e+new Array(n+1).join(".0");return t.map(r.split("."),(function(t){return new Array(20-t.length).join("0")+t})).reverse()}));for(r&&(a=o-Math.min(i,s)),o-=1;o>=a;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===a)return 0;o-=1}else if(u[0][o]<u[1][o])return-1}},t.map=function(t,e){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(t,e);for(n=0;n<t.length;n+=1)r.push(e(t[n]));return r},t.find=function(t,e){var n,r;if(Array.prototype.find)return Array.prototype.find.call(t,e);for(n=0,r=t.length;n<r;n+=1){var i=t[n];if(e(i,n))return i}},t.assign=function(t){for(var e,n,r=t,i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[t].concat(s));var a=function(){var t=s[e];"object"==typeof t&&null!==t&&Object.keys(t).forEach((function(e){r[e]=t[e]}))};for(e=0,n=s.length;e<n;e+=1)a();return t},t.getBrowserAlias=function(t){return r.BROWSER_ALIASES_MAP[t]},t.getBrowserTypeByAlias=function(t){return r.BROWSER_MAP[t]||""},t}();e.default=i,t.exports=e.default},18:function(t,e,n){e.__esModule=!0,e.ENGINE_MAP=e.OS_MAP=e.PLATFORMS_MAP=e.BROWSER_MAP=e.BROWSER_ALIASES_MAP=void 0,e.BROWSER_ALIASES_MAP={"Amazon Silk":"amazon_silk","Android Browser":"android",Bada:"bada",BlackBerry:"blackberry",Chrome:"chrome",Chromium:"chromium",Electron:"electron",Epiphany:"epiphany",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot","Internet Explorer":"ie","K-Meleon":"k_meleon",Maxthon:"maxthon","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver",Opera:"opera","Opera Coast":"opera_coast",PhantomJS:"phantomjs",Puffin:"puffin",QupZilla:"qupzilla",QQ:"qq",QQLite:"qqlite",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat","Yandex Browser":"yandex",Roku:"roku"},e.BROWSER_MAP={amazon_silk:"Amazon Silk",android:"Android Browser",bada:"Bada",blackberry:"BlackBerry",chrome:"Chrome",chromium:"Chromium",electron:"Electron",epiphany:"Epiphany",firefox:"Firefox",focus:"Focus",generic:"Generic",googlebot:"Googlebot",google_search:"Google Search",ie:"Internet Explorer",k_meleon:"K-Meleon",maxthon:"Maxthon",edge:"Microsoft Edge",mz:"MZ Browser",naver:"NAVER Whale Browser",opera:"Opera",opera_coast:"Opera Coast",phantomjs:"PhantomJS",puffin:"Puffin",qupzilla:"QupZilla",qq:"QQ Browser",qqlite:"QQ Browser Lite",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yandex:"Yandex Browser"},e.PLATFORMS_MAP={tablet:"tablet",mobile:"mobile",desktop:"desktop",tv:"tv"},e.OS_MAP={WindowsPhone:"Windows Phone",Windows:"Windows",MacOS:"macOS",iOS:"iOS",Android:"Android",WebOS:"WebOS",BlackBerry:"BlackBerry",Bada:"Bada",Tizen:"Tizen",Linux:"Linux",ChromeOS:"Chrome OS",PlayStation4:"PlayStation 4",Roku:"Roku"},e.ENGINE_MAP={EdgeHTML:"EdgeHTML",Blink:"Blink",Trident:"Trident",Presto:"Presto",Gecko:"Gecko",WebKit:"WebKit"}},90:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},s=n(18);function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var a=function(){function t(){}var e,n,r;return t.getParser=function(t,e){if(void 0===e&&(e=!1),"string"!=typeof t)throw new Error("UserAgent should be a string");return new i.default(t,e)},t.parse=function(t){return new i.default(t).getResult()},e=t,r=[{key:"BROWSER_MAP",get:function(){return s.BROWSER_MAP}},{key:"ENGINE_MAP",get:function(){return s.ENGINE_MAP}},{key:"OS_MAP",get:function(){return s.OS_MAP}},{key:"PLATFORMS_MAP",get:function(){return s.PLATFORMS_MAP}}],(n=null)&&o(e.prototype,n),r&&o(e,r),t}();e.default=a,t.exports=e.default},91:function(t,e,n){e.__esModule=!0,e.default=void 0;var r=u(n(92)),i=u(n(93)),s=u(n(94)),o=u(n(95)),a=u(n(17));function u(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(t,e){if(void 0===e&&(e=!1),null==t||""===t)throw new Error("UserAgent parameter can't be empty");this._ua=t,this.parsedResult={},!0!==e&&this.parse()}var e=t.prototype;return e.getUA=function(){return this._ua},e.test=function(t){return t.test(this._ua)},e.parseBrowser=function(){var t=this;this.parsedResult.browser={};var e=a.default.find(r.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.browser=e.describe(this.getUA())),this.parsedResult.browser},e.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},e.getBrowserName=function(t){return t?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""},e.getBrowserVersion=function(){return this.getBrowser().version},e.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},e.parseOS=function(){var t=this;this.parsedResult.os={};var e=a.default.find(i.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.os=e.describe(this.getUA())),this.parsedResult.os},e.getOSName=function(t){var e=this.getOS().name;return t?String(e).toLowerCase()||"":e||""},e.getOSVersion=function(){return this.getOS().version},e.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},e.getPlatformType=function(t){void 0===t&&(t=!1);var e=this.getPlatform().type;return t?String(e).toLowerCase()||"":e||""},e.parsePlatform=function(){var t=this;this.parsedResult.platform={};var e=a.default.find(s.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.platform=e.describe(this.getUA())),this.parsedResult.platform},e.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},e.getEngineName=function(t){return t?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""},e.parseEngine=function(){var t=this;this.parsedResult.engine={};var e=a.default.find(o.default,(function(e){if("function"==typeof e.test)return e.test(t);if(e.test instanceof Array)return e.test.some((function(e){return t.test(e)}));throw new Error("Browser's test function is not valid")}));return e&&(this.parsedResult.engine=e.describe(this.getUA())),this.parsedResult.engine},e.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},e.getResult=function(){return a.default.assign({},this.parsedResult)},e.satisfies=function(t){var e=this,n={},r=0,i={},s=0;if(Object.keys(t).forEach((function(e){var o=t[e];"string"==typeof o?(i[e]=o,s+=1):"object"==typeof o&&(n[e]=o,r+=1)})),r>0){var o=Object.keys(n),u=a.default.find(o,(function(t){return e.isOS(t)}));if(u){var c=this.satisfies(n[u]);if(void 0!==c)return c}var l=a.default.find(o,(function(t){return e.isPlatform(t)}));if(l){var d=this.satisfies(n[l]);if(void 0!==d)return d}}if(s>0){var h=Object.keys(i),f=a.default.find(h,(function(t){return e.isBrowser(t,!0)}));if(void 0!==f)return this.compareVersion(i[f])}},e.isBrowser=function(t,e){void 0===e&&(e=!1);var n=this.getBrowserName().toLowerCase(),r=t.toLowerCase(),i=a.default.getBrowserTypeByAlias(r);return e&&i&&(r=i.toLowerCase()),r===n},e.compareVersion=function(t){var e=[0],n=t,r=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===t[0]||"<"===t[0]?(n=t.substr(1),"="===t[1]?(r=!0,n=t.substr(2)):e=[],">"===t[0]?e.push(1):e.push(-1)):"="===t[0]?n=t.substr(1):"~"===t[0]&&(r=!0,n=t.substr(1)),e.indexOf(a.default.compareVersions(i,n,r))>-1},e.isOS=function(t){return this.getOSName(!0)===String(t).toLowerCase()},e.isPlatform=function(t){return this.getPlatformType(!0)===String(t).toLowerCase()},e.isEngine=function(t){return this.getEngineName(!0)===String(t).toLowerCase()},e.is=function(t,e){return void 0===e&&(e=!1),this.isBrowser(t,e)||this.isOS(t)||this.isPlatform(t)},e.some=function(t){var e=this;return void 0===t&&(t=[]),t.some((function(t){return e.is(t)}))},t}();e.default=c,t.exports=e.default},92:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(t){var e={name:"Googlebot"},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/opera/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opr\/|opios/i],describe:function(t){var e={name:"Opera"},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/SamsungBrowser/i],describe:function(t){var e={name:"Samsung Internet for Android"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Whale/i],describe:function(t){var e={name:"NAVER Whale Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MZBrowser/i],describe:function(t){var e={name:"MZ Browser"},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/focus/i],describe:function(t){var e={name:"Focus"},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/swing/i],describe:function(t){var e={name:"Swing"},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/coast/i],describe:function(t){var e={name:"Opera Coast"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(t){var e={name:"Opera Touch"},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/yabrowser/i],describe:function(t){var e={name:"Yandex Browser"},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/ucbrowser/i],describe:function(t){var e={name:"UC Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/Maxthon|mxios/i],describe:function(t){var e={name:"Maxthon"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/epiphany/i],describe:function(t){var e={name:"Epiphany"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/puffin/i],describe:function(t){var e={name:"Puffin"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sleipnir/i],describe:function(t){var e={name:"Sleipnir"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/k-meleon/i],describe:function(t){var e={name:"K-Meleon"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/micromessenger/i],describe:function(t){var e={name:"WeChat"},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/qqbrowser/i],describe:function(t){var e={name:/qqbrowserlite/i.test(t)?"QQ Browser Lite":"QQ Browser"},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/msie|trident/i],describe:function(t){var e={name:"Internet Explorer"},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/\sedg\//i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/edg([ea]|ios)/i],describe:function(t){var e={name:"Microsoft Edge"},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/vivaldi/i],describe:function(t){var e={name:"Vivaldi"},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/seamonkey/i],describe:function(t){var e={name:"SeaMonkey"},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/sailfish/i],describe:function(t){var e={name:"Sailfish"},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,t);return n&&(e.version=n),e}},{test:[/silk/i],describe:function(t){var e={name:"Amazon Silk"},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/phantom/i],describe:function(t){var e={name:"PhantomJS"},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/slimerjs/i],describe:function(t){var e={name:"SlimerJS"},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e={name:"BlackBerry"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e={name:"WebOS Browser"},n=i.default.getFirstMatch(s,t)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/bada/i],describe:function(t){var e={name:"Bada"},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/tizen/i],describe:function(t){var e={name:"Tizen"},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/qupzilla/i],describe:function(t){var e={name:"QupZilla"},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/firefox|iceweasel|fxios/i],describe:function(t){var e={name:"Firefox"},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/electron/i],describe:function(t){var e={name:"Electron"},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/MiuiBrowser/i],describe:function(t){var e={name:"Miui"},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/chromium/i],describe:function(t){var e={name:"Chromium"},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,t)||i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/chrome|crios|crmo/i],describe:function(t){var e={name:"Chrome"},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/GSA/i],describe:function(t){var e={name:"Google Search"},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e={name:"Android Browser"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/playstation 4/i],describe:function(t){var e={name:"PlayStation 4"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/safari|applewebkit/i],describe:function(t){var e={name:"Safari"},n=i.default.getFirstMatch(s,t);return n&&(e.version=n),e}},{test:[/.*/i],describe:function(t){var e=-1!==t.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(e,t),version:i.default.getSecondMatch(e,t)}}}];e.default=o,t.exports=e.default},93:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/Roku\/DVP/],describe:function(t){var e=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,t);return{name:s.OS_MAP.Roku,version:e}}},{test:[/windows phone/i],describe:function(t){var e=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.WindowsPhone,version:e}}},{test:[/windows /i],describe:function(t){var e=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,t),n=i.default.getWindowsVersionName(e);return{name:s.OS_MAP.Windows,version:e,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(t){var e={name:s.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,t);return n&&(e.version=n),e}},{test:[/macintosh/i],describe:function(t){var e=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,t).replace(/[_\s]/g,"."),n=i.default.getMacOSVersionName(e),r={name:s.OS_MAP.MacOS,version:e};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(t){var e=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,t).replace(/[_\s]/g,".");return{name:s.OS_MAP.iOS,version:e}}},{test:function(t){var e=!t.test(/like android/i),n=t.test(/android/i);return e&&n},describe:function(t){var e=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,t),n=i.default.getAndroidVersionName(e),r={name:s.OS_MAP.Android,version:e};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(t){var e=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,t),n={name:s.OS_MAP.WebOS};return e&&e.length&&(n.version=e),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(t){var e=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,t)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,t)||i.default.getFirstMatch(/\bbb(\d+)/i,t);return{name:s.OS_MAP.BlackBerry,version:e}}},{test:[/bada/i],describe:function(t){var e=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.Bada,version:e}}},{test:[/tizen/i],describe:function(t){var e=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.Tizen,version:e}}},{test:[/linux/i],describe:function(){return{name:s.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:s.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(t){var e=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,t);return{name:s.OS_MAP.PlayStation4,version:e}}}];e.default=o,t.exports=e.default},94:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(t){var e=i.default.getFirstMatch(/(can-l01)/i,t)&&"Nova",n={type:s.PLATFORMS_MAP.mobile,vendor:"Huawei"};return e&&(n.model=e),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(t){var e=t.test(/ipod|iphone/i),n=t.test(/like (ipod|iphone)/i);return e&&!n},describe:function(t){var e=i.default.getFirstMatch(/(ipod|iphone)/i,t);return{type:s.PLATFORMS_MAP.mobile,vendor:"Apple",model:e}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"blackberry"===t.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(t){return"bada"===t.getBrowserName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"windows phone"===t.getBrowserName()},describe:function(){return{type:s.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(t){var e=Number(String(t.getOSVersion()).split(".")[0]);return"android"===t.getOSName(!0)&&e>=3},describe:function(){return{type:s.PLATFORMS_MAP.tablet}}},{test:function(t){return"android"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.mobile}}},{test:function(t){return"macos"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(t){return"windows"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(t){return"linux"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.desktop}}},{test:function(t){return"playstation 4"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}},{test:function(t){return"roku"===t.getOSName(!0)},describe:function(){return{type:s.PLATFORMS_MAP.tv}}}];e.default=o,t.exports=e.default},95:function(t,e,n){e.__esModule=!0,e.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},s=n(18),o=[{test:function(t){return"microsoft edge"===t.getBrowserName(!0)},describe:function(t){if(/\sedg\//i.test(t))return{name:s.ENGINE_MAP.Blink};var e=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,t);return{name:s.ENGINE_MAP.EdgeHTML,version:e}}},{test:[/trident/i],describe:function(t){var e={name:s.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){return t.test(/presto/i)},describe:function(t){var e={name:s.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:function(t){var e=t.test(/gecko/i),n=t.test(/like gecko/i);return e&&!n},describe:function(t){var e={name:s.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:s.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(t){var e={name:s.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,t);return n&&(e.version=n),e}}];e.default=o,t.exports=e.default}}));class E extends TypeError{constructor(t,e){let n;const{message:r,explanation:i,...s}=t,{path:o}=t,a=0===o.length?r:`At path: ${o.join(".")} -- ${r}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...e()])}}function A(t){return"object"==typeof t&&null!==t}function C(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function S(t,e,n,r){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:s}=e,{type:o}=n,{refinement:a,message:u=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${C(r)}\``}=t;return{value:r,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:u}}function*x(t,e,n,r){(function(t){return A(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=S(i,e,n,r);t&&(yield t)}}function*M(t,e,n={}){const{path:r=[],branch:i=[t],coerce:s=!1,mask:o=!1}=n,a={path:r,branch:i};if(s&&(t=e.coercer(t,a),o&&"type"!==e.type&&A(e.schema)&&A(t)&&!Array.isArray(t)))for(const n in t)void 0===e.schema[n]&&delete t[n];let u="valid";for(const r of e.validator(t,a))r.explanation=n.message,u="not_valid",yield[r,void 0];for(let[c,l,d]of e.entries(t,a)){const e=M(l,d,{path:void 0===c?r:[...r,c],branch:void 0===c?i:[...i,l],coerce:s,mask:o,message:n.message});for(const n of e)n[0]?(u=null===n[0].refinement||void 0===n[0].refinement?"not_valid":"not_refined",yield[n[0],void 0]):s&&(l=n[1],void 0===c?t=l:t instanceof Map?t.set(c,l):t instanceof Set?t.add(l):A(t)&&(void 0!==l||c in t)&&(t[c]=l))}if("not_valid"!==u)for(const r of e.refiner(t,a))r.explanation=n.message,u="not_refined",yield[r,void 0];"valid"===u&&(yield[void 0,t])}class O{constructor(t){const{type:e,schema:n,validator:r,refiner:i,coercer:s=(t=>t),entries:o=function*(){}}=t;this.type=e,this.schema=n,this.entries=o,this.coercer=s,this.validator=r?(t,e)=>x(r(t,e),e,this,t):()=>[],this.refiner=i?(t,e)=>x(i(t,e),e,this,t):()=>[]}assert(t,e){return function(t,e,n){const r=j(t,e,{message:n});if(r[0])throw r[0]}(t,this,e)}create(t,e){return T(t,this,e)}is(t){return P(t,this)}mask(t,e){return function(t,e,n){const r=j(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}(t,this,e)}validate(t,e={}){return j(t,this,e)}}const I="EXACT_OPTIONAL";class R extends O{constructor(t){super({...t,type:`exact optional ${t.type}`}),this.brand=I}static isExactOptional(t){return A(t)&&"brand"in t&&t.brand===I}}function T(t,e,n){const r=j(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function P(t,e){return!j(t,e)[0]}function j(t,e,n={}){const r=M(t,e,n),i=function(t){const{done:e,value:n}=t.next();return e?void 0:n}(r);if(i[0]){return[new E(i[0],(function*(){for(const t of r)t[0]&&(yield t[0])})),void 0]}return[void 0,i[1]]}function F(t,e){return new O({type:t,schema:null,validator:e})}function N(t){const e=t?Object.keys(t):[],n=F("never",(()=>!1));return new O({type:"object",schema:t??null,*entries(r){if(t&&A(r)){const i=new Set(Object.keys(r));for(const n of e){i.delete(n);const e=t[n];R.isExactOptional(e)&&!Object.prototype.hasOwnProperty.call(r,n)||(yield[n,r[n],t[n]])}for(const t of i)yield[t,r[t],n]}},validator:t=>A(t)||`Expected an object, but received: ${C(t)}`,coercer:t=>A(t)?{...t}:t})}function z(t){return new O({...t,validator:(e,n)=>void 0===e||t.validator(e,n),refiner:(e,n)=>void 0===e||t.refiner(e,n)})}function B(){return F("string",(t=>"string"==typeof t||`Expected a string, but received: ${C(t)}`))}function L(t){const e=t.map((t=>t.type)).join(" | ");return new O({type:"union",schema:null,coercer(e){for(const n of t){const[t,r]=n.validate(e,{coerce:!0});if(!t)return r}return e},validator(n,r){const i=[];for(const e of t){const[...t]=M(n,e,r),[s]=t;if(!s?.[0])return[];for(const[e]of t)e&&i.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${C(n)}`,...i]}})}function U(t,e){return D(t,"pattern",(n=>e.test(n)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${n}"`))}function D(t,e,n){return new O({...t,*refiner(r,i){yield*t.refiner(r,i);const s=x(n(r,i),i,t,r);for(const t of s)yield{...t,refinement:e}}})}function q(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)}const $=(t,e)=>Object.hasOwnProperty.call(t,e);var W;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(W=W||(W={}));const Z=BigInt(2**32-1),H=BigInt(32);function G(t,e=!1){return e?{h:Number(t&Z),l:Number(t>>H&Z)}:{h:0|Number(t>>H&Z),l:0|Number(t&Z)}}function J(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:s,l:o}=G(t[i],e);[n[i],r[i]]=[s,o]}return[n,r]}const V=[],K=[],Q=[],X=BigInt(0),Y=BigInt(1),tt=BigInt(2),et=BigInt(7),nt=BigInt(256),rt=BigInt(113);for(let t=0,e=Y,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],V.push(2*(5*r+n)),K.push((t+1)*(t+2)/2%64);let i=X;for(let t=0;t<7;t++)e=(e<<Y^(e>>et)*rt)%nt,e&tt&&(i^=Y<<(Y<<BigInt(t))-Y);Q.push(i)}const[it,st]=J(Q,!0),ot=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),at=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class ut extends r{constructor(t,e,n,r=!1,o=24){if(super(),this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,i(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=s(this.state)}keccak(){o||a(this.state32),function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,i=(e+2)%10,s=n[i],o=n[i+1],a=ot(s,o,1)^n[r],u=at(s,o,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=a,t[e+n+1]^=u}let e=t[2],i=t[3];for(let n=0;n<24;n++){const r=K[n],s=ot(e,i,r),o=at(e,i,r),a=V[n];e=t[a],i=t[a+1],t[a]=s,t[a+1]=o}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=it[r],t[1]^=st[r]}n.fill(0)}(this.state32,this.rounds),o||a(this.state32),this.posOut=0,this.pos=0}update(t){u(this);const{blockLen:e,state:n}=this,r=(t=c(t)).length;for(let i=0;i<r;){const s=Math.min(e-this.pos,r-i);for(let e=0;e<s;e++)n[this.pos++]^=t[i++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,0!=(128&e)&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){u(this,!1),l(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,i=t.length;r<i;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,i-r);t.set(e.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return i(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(d(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:i,enableXOF:s}=this;return t||(t=new ut(e,n,r,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=r,t.enableXOF=s,t.destroyed=this.destroyed,t}}const ct=((t,e,r)=>n((()=>new ut(e,t,r))))(1,136,32);var lt,dt,ht={exports:{}};lt=ht,dt=ht.exports,function(){var e,n="Expected a function",r="__lodash_hash_undefined__",i="__lodash_placeholder__",s=16,o=32,a=64,u=128,c=256,l=1/0,d=9007199254740991,h=NaN,f=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",o],["partialRight",a],["rearg",c]],m="[object Arguments]",g="[object Array]",_="[object Boolean]",v="[object Date]",y="[object Error]",w="[object Function]",b="[object GeneratorFunction]",k="[object Map]",E="[object Number]",A="[object Object]",C="[object Promise]",S="[object RegExp]",x="[object Set]",M="[object String]",O="[object Symbol]",I="[object WeakMap]",R="[object ArrayBuffer]",T="[object DataView]",P="[object Float32Array]",j="[object Float64Array]",F="[object Int8Array]",N="[object Int16Array]",z="[object Int32Array]",B="[object Uint8Array]",L="[object Uint8ClampedArray]",U="[object Uint16Array]",D="[object Uint32Array]",q=/\b__p \+= '';/g,$=/\b(__p \+=) '' \+/g,W=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,H=/[&<>"']/g,G=RegExp(Z.source),J=RegExp(H.source),V=/<%-([\s\S]+?)%>/g,K=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Y=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,nt=RegExp(et.source),rt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ct=/[()=,{}\[\]\/\s]/,ht=/\\(\\)?/g,ft=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pt=/\w*$/,mt=/^[-+]0x[0-9a-f]+$/i,gt=/^0b[01]+$/i,_t=/^\[object .+?Constructor\]$/,vt=/^0o[0-7]+$/i,yt=/^(?:0|[1-9]\d*)$/,wt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,bt=/($^)/,kt=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",At="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ct="\\u2700-\\u27bf",St="a-z\\xdf-\\xf6\\xf8-\\xff",xt="A-Z\\xc0-\\xd6\\xd8-\\xde",Mt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",It="['’]",Rt="["+Et+"]",Tt="["+Ot+"]",Pt="["+At+"]",jt="\\d+",Ft="["+Ct+"]",Nt="["+St+"]",zt="[^"+Et+Ot+jt+Ct+St+xt+"]",Bt="\\ud83c[\\udffb-\\udfff]",Lt="[^"+Et+"]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",Dt="[\\ud800-\\udbff][\\udc00-\\udfff]",qt="["+xt+"]",$t="\\u200d",Wt="(?:"+Nt+"|"+zt+")",Zt="(?:"+qt+"|"+zt+")",Ht="(?:['’](?:d|ll|m|re|s|t|ve))?",Gt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Jt="(?:"+Pt+"|"+Bt+")?",Vt="["+Mt+"]?",Kt=Vt+Jt+"(?:"+$t+"(?:"+[Lt,Ut,Dt].join("|")+")"+Vt+Jt+")*",Qt="(?:"+[Ft,Ut,Dt].join("|")+")"+Kt,Xt="(?:"+[Lt+Pt+"?",Pt,Ut,Dt,Rt].join("|")+")",Yt=RegExp(It,"g"),te=RegExp(Pt,"g"),ee=RegExp(Bt+"(?="+Bt+")|"+Xt+Kt,"g"),ne=RegExp([qt+"?"+Nt+"+"+Ht+"(?="+[Tt,qt,"$"].join("|")+")",Zt+"+"+Gt+"(?="+[Tt,qt+Wt,"$"].join("|")+")",qt+"?"+Wt+"+"+Ht,qt+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",jt,Qt].join("|"),"g"),re=RegExp("["+$t+Et+At+Mt+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],oe=-1,ae={};ae[P]=ae[j]=ae[F]=ae[N]=ae[z]=ae[B]=ae[L]=ae[U]=ae[D]=!0,ae[m]=ae[g]=ae[R]=ae[_]=ae[T]=ae[v]=ae[y]=ae[w]=ae[k]=ae[E]=ae[A]=ae[S]=ae[x]=ae[M]=ae[I]=!1;var ue={};ue[m]=ue[g]=ue[R]=ue[T]=ue[_]=ue[v]=ue[P]=ue[j]=ue[F]=ue[N]=ue[z]=ue[k]=ue[E]=ue[A]=ue[S]=ue[x]=ue[M]=ue[O]=ue[B]=ue[L]=ue[U]=ue[D]=!0,ue[y]=ue[w]=ue[I]=!1;var ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},le=parseFloat,de=parseInt,he="object"==typeof t&&t&&t.Object===Object&&t,fe="object"==typeof self&&self&&self.Object===Object&&self,pe=he||fe||Function("return this")(),me=dt&&!dt.nodeType&&dt,ge=me&<&&!lt.nodeType&<,_e=ge&&ge.exports===me,ve=_e&&he.process,ye=function(){try{var t=ge&&ge.require&&ge.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(t){}}(),we=ye&&ye.isArrayBuffer,be=ye&&ye.isDate,ke=ye&&ye.isMap,Ee=ye&&ye.isRegExp,Ae=ye&&ye.isSet,Ce=ye&&ye.isTypedArray;function Se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function xe(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function Me(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function Oe(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Ie(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Re(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function Te(t,e){return!(null==t||!t.length)&&qe(t,e,0)>-1}function Pe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function Fe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function Ne(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function ze(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function Be(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Le=He("length");function Ue(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function De(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function qe(t,e,n){return e==e?function(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):De(t,We,n)}function $e(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function We(t){return t!=t}function Ze(t,e){var n=null==t?0:t.length;return n?Ve(t,e)/n:h}function He(t){return function(n){return null==n?e:n[t]}}function Ge(t){return function(n){return null==t?e:t[n]}}function Je(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function Ve(t,n){for(var r,i=-1,s=t.length;++i<s;){var o=n(t[i]);o!==e&&(r=r===e?o:r+o)}return r}function Ke(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Qe(t){return t?t.slice(0,mn(t)+1).replace(rt,""):t}function Xe(t){return function(e){return t(e)}}function Ye(t,e){return je(e,(function(e){return t[e]}))}function tn(t,e){return t.has(e)}function en(t,e){for(var n=-1,r=t.length;++n<r&&qe(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length;n--&&qe(e,t[n],0)>-1;);return n}var rn=Ge({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),sn=Ge({"&":"&","<":"<",">":">",'"':""","'":"'"});function on(t){return"\\"+ce[t]}function an(t){return re.test(t)}function un(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function ln(t,e){for(var n=-1,r=t.length,s=0,o=[];++n<r;){var a=t[n];a!==e&&a!==i||(t[n]=i,o[s++]=n)}return o}function dn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function hn(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function fn(t){return an(t)?function(t){for(var e=ee.lastIndex=0;ee.test(t);)++e;return e}(t):Le(t)}function pn(t){return an(t)?function(t){return t.match(ee)||[]}(t):function(t){return t.split("")}(t)}function mn(t){for(var e=t.length;e--&&it.test(t.charAt(e)););return e}var gn=Ge({"&":"&","<":"<",">":">",""":'"',"'":"'"}),_n=function t(it){var lt,dt=(it=null==it?pe:_n.defaults(pe.Object(),it,_n.pick(pe,se))).Array,Et=it.Date,At=it.Error,Ct=it.Function,St=it.Math,xt=it.Object,Mt=it.RegExp,Ot=it.String,It=it.TypeError,Rt=dt.prototype,Tt=Ct.prototype,Pt=xt.prototype,jt=it["__core-js_shared__"],Ft=Tt.toString,Nt=Pt.hasOwnProperty,zt=0,Bt=(lt=/[^.]+$/.exec(jt&&jt.keys&&jt.keys.IE_PROTO||""))?"Symbol(src)_1."+lt:"",Lt=Pt.toString,Ut=Ft.call(xt),Dt=pe._,qt=Mt("^"+Ft.call(Nt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$t=_e?it.Buffer:e,Wt=it.Symbol,Zt=it.Uint8Array,Ht=$t?$t.allocUnsafe:e,Gt=cn(xt.getPrototypeOf,xt),Jt=xt.create,Vt=Pt.propertyIsEnumerable,Kt=Rt.splice,Qt=Wt?Wt.isConcatSpreadable:e,Xt=Wt?Wt.iterator:e,ee=Wt?Wt.toStringTag:e,re=function(){try{var t=hs(xt,"defineProperty");return t({},"",{}),t}catch(t){}}(),ce=it.clearTimeout!==pe.clearTimeout&&it.clearTimeout,he=Et&&Et.now!==pe.Date.now&&Et.now,fe=it.setTimeout!==pe.setTimeout&&it.setTimeout,me=St.ceil,ge=St.floor,ve=xt.getOwnPropertySymbols,ye=$t?$t.isBuffer:e,Le=it.isFinite,Ge=Rt.join,vn=cn(xt.keys,xt),yn=St.max,wn=St.min,bn=Et.now,kn=it.parseInt,En=St.random,An=Rt.reverse,Cn=hs(it,"DataView"),Sn=hs(it,"Map"),xn=hs(it,"Promise"),Mn=hs(it,"Set"),On=hs(it,"WeakMap"),In=hs(xt,"create"),Rn=On&&new On,Tn={},Pn=Bs(Cn),jn=Bs(Sn),Fn=Bs(xn),Nn=Bs(Mn),zn=Bs(On),Bn=Wt?Wt.prototype:e,Ln=Bn?Bn.valueOf:e,Un=Bn?Bn.toString:e;function Dn(t){if(na(t)&&!Zo(t)&&!(t instanceof Zn)){if(t instanceof Wn)return t;if(Nt.call(t,"__wrapped__"))return Ls(t)}return new Wn(t)}var qn=function(){function t(){}return function(n){if(!ea(n))return{};if(Jt)return Jt(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function $n(){}function Wn(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Zn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=f,this.__views__=[]}function Hn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Vn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Jn;++e<n;)this.add(t[e])}function Kn(t){var e=this.__data__=new Gn(t);this.size=e.size}function Qn(t,e){var n=Zo(t),r=!n&&Wo(t),i=!n&&!r&&Vo(t),s=!n&&!r&&!i&&la(t),o=n||r||i||s,a=o?Ke(t.length,Ot):[],u=a.length;for(var c in t)!e&&!Nt.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||ys(c,u))||a.push(c);return a}function Xn(t){var n=t.length;return n?t[Vr(0,n-1)]:e}function Yn(t,e){return Fs(Ii(t),ur(e,0,t.length))}function tr(t){return Fs(Ii(t))}function er(t,n,r){(r!==e&&!Do(t[n],r)||r===e&&!(n in t))&&or(t,n,r)}function nr(t,n,r){var i=t[n];Nt.call(t,n)&&Do(i,r)&&(r!==e||n in t)||or(t,n,r)}function rr(t,e){for(var n=t.length;n--;)if(Do(t[n][0],e))return n;return-1}function ir(t,e,n,r){return fr(t,(function(t,i,s){e(r,t,n(t),s)})),r}function sr(t,e){return t&&Ri(e,Ta(e),t)}function or(t,e,n){"__proto__"==e&&re?re(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function ar(t,n){for(var r=-1,i=n.length,s=dt(i),o=null==t;++r<i;)s[r]=o?e:xa(t,n[r]);return s}function ur(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function cr(t,n,r,i,s,o){var a,u=1&n,c=2&n,l=4&n;if(r&&(a=s?r(t,i,s,o):r(t)),a!==e)return a;if(!ea(t))return t;var d=Zo(t);if(d){if(a=function(t){var e=t.length,n=new t.constructor(e);return e&&"string"==typeof t[0]&&Nt.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(t),!u)return Ii(t,a)}else{var h=ms(t),f=h==w||h==b;if(Vo(t))return Ai(t,u);if(h==A||h==m||f&&!s){if(a=c||f?{}:_s(t),!u)return c?function(t,e){return Ri(t,ps(t),e)}(t,function(t,e){return t&&Ri(e,Pa(e),t)}(a,t)):function(t,e){return Ri(t,fs(t),e)}(t,sr(a,t))}else{if(!ue[h])return s?t:{};a=function(t,e,n){var r,i=t.constructor;switch(e){case R:return Ci(t);case _:case v:return new i(+t);case T:return function(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case P:case j:case F:case N:case z:case B:case L:case U:case D:return Si(t,n);case k:return new i;case E:case M:return new i(t);case S:return function(t){var e=new t.constructor(t.source,pt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case x:return new i;case O:return r=t,Ln?xt(Ln.call(r)):{}}}(t,h,u)}}o||(o=new Kn);var p=o.get(t);if(p)return p;o.set(t,a),aa(t)?t.forEach((function(e){a.add(cr(e,n,r,e,t,o))})):ra(t)&&t.forEach((function(e,i){a.set(i,cr(e,n,r,i,t,o))}));var g=d?e:(l?c?ss:is:c?Pa:Ta)(t);return Me(g||t,(function(e,i){g&&(e=t[i=e]),nr(a,i,cr(e,n,r,i,t,o))})),a}function lr(t,n,r){var i=r.length;if(null==t)return!i;for(t=xt(t);i--;){var s=r[i],o=n[s],a=t[s];if(a===e&&!(s in t)||!o(a))return!1}return!0}function dr(t,r,i){if("function"!=typeof t)throw new It(n);return Rs((function(){t.apply(e,i)}),r)}function hr(t,e,n,r){var i=-1,s=Te,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=je(e,Xe(n))),r?(s=Pe,o=!1):e.length>=200&&(s=tn,o=!1,e=new Vn(e));t:for(;++i<a;){var l=t[i],d=null==n?l:n(l);if(l=r||0!==l?l:0,o&&d==d){for(var h=c;h--;)if(e[h]===d)continue t;u.push(l)}else s(e,d,r)||u.push(l)}return u}Dn.templateSettings={escape:V,evaluate:K,interpolate:Q,variable:"",imports:{_:Dn}},Dn.prototype=$n.prototype,Dn.prototype.constructor=Dn,Wn.prototype=qn($n.prototype),Wn.prototype.constructor=Wn,Zn.prototype=qn($n.prototype),Zn.prototype.constructor=Zn,Hn.prototype.clear=function(){this.__data__=In?In(null):{},this.size=0},Hn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Hn.prototype.get=function(t){var n=this.__data__;if(In){var i=n[t];return i===r?e:i}return Nt.call(n,t)?n[t]:e},Hn.prototype.has=function(t){var n=this.__data__;return In?n[t]!==e:Nt.call(n,t)},Hn.prototype.set=function(t,n){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=In&&n===e?r:n,this},Gn.prototype.clear=function(){this.__data__=[],this.size=0},Gn.prototype.delete=function(t){var e=this.__data__,n=rr(e,t);return!(n<0||(n==e.length-1?e.pop():Kt.call(e,n,1),--this.size,0))},Gn.prototype.get=function(t){var n=this.__data__,r=rr(n,t);return r<0?e:n[r][1]},Gn.prototype.has=function(t){return rr(this.__data__,t)>-1},Gn.prototype.set=function(t,e){var n=this.__data__,r=rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Jn.prototype.clear=function(){this.size=0,this.__data__={hash:new Hn,map:new(Sn||Gn),string:new Hn}},Jn.prototype.delete=function(t){var e=ls(this,t).delete(t);return this.size-=e?1:0,e},Jn.prototype.get=function(t){return ls(this,t).get(t)},Jn.prototype.has=function(t){return ls(this,t).has(t)},Jn.prototype.set=function(t,e){var n=ls(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Vn.prototype.add=Vn.prototype.push=function(t){return this.__data__.set(t,r),this},Vn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.clear=function(){this.__data__=new Gn,this.size=0},Kn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Kn.prototype.get=function(t){return this.__data__.get(t)},Kn.prototype.has=function(t){return this.__data__.has(t)},Kn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Gn){var r=n.__data__;if(!Sn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Jn(r)}return n.set(t,e),this.size=n.size,this};var fr=ji(br),pr=ji(kr,!0);function mr(t,e){var n=!0;return fr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function gr(t,n,r){for(var i=-1,s=t.length;++i<s;){var o=t[i],a=n(o);if(null!=a&&(u===e?a==a&&!ca(a):r(a,u)))var u=a,c=o}return c}function _r(t,e){var n=[];return fr(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function vr(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=vs),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?vr(a,e-1,n,r,i):Fe(i,a):r||(i[i.length]=a)}return i}var yr=Fi(),wr=Fi(!0);function br(t,e){return t&&yr(t,e,Ta)}function kr(t,e){return t&&wr(t,e,Ta)}function Er(t,e){return Re(e,(function(e){return Xo(t[e])}))}function Ar(t,n){for(var r=0,i=(n=wi(n,t)).length;null!=t&&r<i;)t=t[zs(n[r++])];return r&&r==i?t:e}function Cr(t,e,n){var r=e(t);return Zo(t)?r:Fe(r,n(t))}function Sr(t){return null==t?t===e?"[object Undefined]":"[object Null]":ee&&ee in xt(t)?function(t){var n=Nt.call(t,ee),r=t[ee];try{t[ee]=e;var i=!0}catch(t){}var s=Lt.call(t);return i&&(n?t[ee]=r:delete t[ee]),s}(t):function(t){return Lt.call(t)}(t)}function xr(t,e){return t>e}function Mr(t,e){return null!=t&&Nt.call(t,e)}function Or(t,e){return null!=t&&e in xt(t)}function Ir(t,n,r){for(var i=r?Pe:Te,s=t[0].length,o=t.length,a=o,u=dt(o),c=1/0,l=[];a--;){var d=t[a];a&&n&&(d=je(d,Xe(n))),c=wn(d.length,c),u[a]=!r&&(n||s>=120&&d.length>=120)?new Vn(a&&d):e}d=t[0];var h=-1,f=u[0];t:for(;++h<s&&l.length<c;){var p=d[h],m=n?n(p):p;if(p=r||0!==p?p:0,!(f?tn(f,m):i(l,m,r))){for(a=o;--a;){var g=u[a];if(!(g?tn(g,m):i(t[a],m,r)))continue t}f&&f.push(m),l.push(p)}}return l}function Rr(t,n,r){var i=null==(t=Ms(t,n=wi(n,t)))?t:t[zs(Ks(n))];return null==i?e:Se(i,t,r)}function Tr(t){return na(t)&&Sr(t)==m}function Pr(t,n,r,i,s){return t===n||(null==t||null==n||!na(t)&&!na(n)?t!=t&&n!=n:function(t,n,r,i,s,o){var a=Zo(t),u=Zo(n),c=a?g:ms(t),l=u?g:ms(n),d=(c=c==m?A:c)==A,h=(l=l==m?A:l)==A,f=c==l;if(f&&Vo(t)){if(!Vo(n))return!1;a=!0,d=!1}if(f&&!d)return o||(o=new Kn),a||la(t)?ns(t,n,r,i,s,o):function(t,e,n,r,i,s,o){switch(n){case T:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case R:return!(t.byteLength!=e.byteLength||!s(new Zt(t),new Zt(e)));case _:case v:case E:return Do(+t,+e);case y:return t.name==e.name&&t.message==e.message;case S:case M:return t==e+"";case k:var a=un;case x:var u=1&r;if(a||(a=dn),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var l=ns(a(t),a(e),r,i,s,o);return o.delete(t),l;case O:if(Ln)return Ln.call(t)==Ln.call(e)}return!1}(t,n,c,r,i,s,o);if(!(1&r)){var p=d&&Nt.call(t,"__wrapped__"),w=h&&Nt.call(n,"__wrapped__");if(p||w){var b=p?t.value():t,C=w?n.value():n;return o||(o=new Kn),s(b,C,r,i,o)}}return!!f&&(o||(o=new Kn),function(t,n,r,i,s,o){var a=1&r,u=is(t),c=u.length,l=is(n),d=l.length;if(c!=d&&!a)return!1;for(var h=c;h--;){var f=u[h];if(!(a?f in n:Nt.call(n,f)))return!1}var p=o.get(t),m=o.get(n);if(p&&m)return p==n&&m==t;var g=!0;o.set(t,n),o.set(n,t);for(var _=a;++h<c;){var v=t[f=u[h]],y=n[f];if(i)var w=a?i(y,v,f,n,t,o):i(v,y,f,t,n,o);if(!(w===e?v===y||s(v,y,r,i,o):w)){g=!1;break}_||(_="constructor"==f)}if(g&&!_){var b=t.constructor,k=n.constructor;b==k||!("constructor"in t)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof k&&k instanceof k||(g=!1)}return o.delete(t),o.delete(n),g}(t,n,r,i,s,o))}(t,n,r,i,Pr,s))}function jr(t,n,r,i){var s=r.length,o=s,a=!i;if(null==t)return!o;for(t=xt(t);s--;){var u=r[s];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++s<o;){var c=(u=r[s])[0],l=t[c],d=u[1];if(a&&u[2]){if(l===e&&!(c in t))return!1}else{var h=new Kn;if(i)var f=i(l,d,c,t,n,h);if(!(f===e?Pr(d,l,3,i,h):f))return!1}}return!0}function Fr(t){return!(!ea(t)||(e=t,Bt&&Bt in e))&&(Xo(t)?qt:_t).test(Bs(t));var e}function Nr(t){return"function"==typeof t?t:null==t?iu:"object"==typeof t?Zo(t)?qr(t[0],t[1]):Dr(t):fu(t)}function zr(t){if(!As(t))return vn(t);var e=[];for(var n in xt(t))Nt.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Br(t){if(!ea(t))return function(t){var e=[];if(null!=t)for(var n in xt(t))e.push(n);return e}(t);var e=As(t),n=[];for(var r in t)("constructor"!=r||!e&&Nt.call(t,r))&&n.push(r);return n}function Lr(t,e){return t<e}function Ur(t,e){var n=-1,r=Go(t)?dt(t.length):[];return fr(t,(function(t,i,s){r[++n]=e(t,i,s)})),r}function Dr(t){var e=ds(t);return 1==e.length&&e[0][2]?Ss(e[0][0],e[0][1]):function(n){return n===t||jr(n,t,e)}}function qr(t,n){return bs(t)&&Cs(n)?Ss(zs(t),n):function(r){var i=xa(r,t);return i===e&&i===n?Ma(r,t):Pr(n,i,3)}}function $r(t,n,r,i,s){t!==n&&yr(n,(function(o,a){if(s||(s=new Kn),ea(o))!function(t,n,r,i,s,o,a){var u=Os(t,r),c=Os(n,r),l=a.get(c);if(l)er(t,r,l);else{var d=o?o(u,c,r+"",t,n,a):e,h=d===e;if(h){var f=Zo(c),p=!f&&Vo(c),m=!f&&!p&&la(c);d=c,f||p||m?Zo(u)?d=u:Jo(u)?d=Ii(u):p?(h=!1,d=Ai(c,!0)):m?(h=!1,d=Si(c,!0)):d=[]:sa(c)||Wo(c)?(d=u,Wo(u)?d=va(u):ea(u)&&!Xo(u)||(d=_s(c))):h=!1}h&&(a.set(c,d),s(d,c,i,o,a),a.delete(c)),er(t,r,d)}}(t,n,a,r,$r,i,s);else{var u=i?i(Os(t,a),o,a+"",t,n,s):e;u===e&&(u=o),er(t,a,u)}}),Pa)}function Wr(t,n){var r=t.length;if(r)return ys(n+=n<0?r:0,r)?t[n]:e}function Zr(t,e,n){e=e.length?je(e,(function(t){return Zo(t)?function(e){return Ar(e,1===t.length?t[0]:t)}:t})):[iu];var r=-1;e=je(e,Xe(cs()));var i=Ur(t,(function(t,n,i){var s=je(e,(function(e){return e(t)}));return{criteria:s,index:++r,value:t}}));return function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(i,(function(t,e){return function(t,e,n){for(var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;++r<o;){var u=xi(i[r],s[r]);if(u)return r>=a?u:u*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function Hr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=Ar(t,o);n(a,o)&&ti(s,wi(o,t),a)}return s}function Gr(t,e,n,r){var i=r?$e:qe,s=-1,o=e.length,a=t;for(t===e&&(e=Ii(e)),n&&(a=je(t,Xe(n)));++s<o;)for(var u=0,c=e[s],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Kt.call(a,u,1),Kt.call(t,u,1);return t}function Jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;ys(i)?Kt.call(t,i,1):hi(t,i)}}return t}function Vr(t,e){return t+ge(En()*(e-t+1))}function Kr(t,e){var n="";if(!t||e<1||e>d)return n;do{e%2&&(n+=t),(e=ge(e/2))&&(t+=t)}while(e);return n}function Qr(t,e){return Ts(xs(t,e,iu),t+"")}function Xr(t){return Xn(Da(t))}function Yr(t,e){var n=Da(t);return Fs(n,ur(e,0,n.length))}function ti(t,n,r,i){if(!ea(t))return t;for(var s=-1,o=(n=wi(n,t)).length,a=o-1,u=t;null!=u&&++s<o;){var c=zs(n[s]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(s!=a){var d=u[c];(l=i?i(d,c,u):e)===e&&(l=ea(d)?d:ys(n[s+1])?[]:{})}nr(u,c,l),u=u[c]}return t}var ei=Rn?function(t,e){return Rn.set(t,e),t}:iu,ni=re?function(t,e){return re(t,"toString",{configurable:!0,enumerable:!1,value:eu(e),writable:!0})}:iu;function ri(t){return Fs(Da(t))}function ii(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=dt(i);++r<i;)s[r]=t[r+e];return s}function si(t,e){var n;return fr(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function oi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!ca(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return ai(t,e,iu,n)}function ai(t,n,r,i){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(n=r(n))!=n,u=null===n,c=ca(n),l=n===e;s<o;){var d=ge((s+o)/2),h=r(t[d]),f=h!==e,p=null===h,m=h==h,g=ca(h);if(a)var _=i||m;else _=l?m&&(i||f):u?m&&f&&(i||!p):c?m&&f&&!p&&(i||!g):!p&&!g&&(i?h<=n:h<n);_?s=d+1:o=d}return wn(o,4294967294)}function ui(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],a=e?e(o):o;if(!n||!Do(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function ci(t){return"number"==typeof t?t:ca(t)?h:+t}function li(t){if("string"==typeof t)return t;if(Zo(t))return je(t,li)+"";if(ca(t))return Un?Un.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function di(t,e,n){var r=-1,i=Te,s=t.length,o=!0,a=[],u=a;if(n)o=!1,i=Pe;else if(s>=200){var c=e?null:Ki(t);if(c)return dn(c);o=!1,i=tn,u=new Vn}else u=e?[]:a;t:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=n||0!==l?l:0,o&&d==d){for(var h=u.length;h--;)if(u[h]===d)continue t;e&&u.push(d),a.push(l)}else i(u,d,n)||(u!==a&&u.push(d),a.push(l))}return a}function hi(t,e){return null==(t=Ms(t,e=wi(e,t)))||delete t[zs(Ks(e))]}function fi(t,e,n,r){return ti(t,e,n(Ar(t,e)),r)}function pi(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?ii(t,r?0:s,r?s+1:i):ii(t,r?s+1:0,r?i:s)}function mi(t,e){var n=t;return n instanceof Zn&&(n=n.value()),Ne(e,(function(t,e){return e.func.apply(e.thisArg,Fe([t],e.args))}),n)}function gi(t,e,n){var r=t.length;if(r<2)return r?di(t[0]):[];for(var i=-1,s=dt(r);++i<r;)for(var o=t[i],a=-1;++a<r;)a!=i&&(s[i]=hr(s[i]||o,t[a],e,n));return di(vr(s,1),e,n)}function _i(t,n,r){for(var i=-1,s=t.length,o=n.length,a={};++i<s;){var u=i<o?n[i]:e;r(a,t[i],u)}return a}function vi(t){return Jo(t)?t:[]}function yi(t){return"function"==typeof t?t:iu}function wi(t,e){return Zo(t)?t:bs(t,e)?[t]:Ns(ya(t))}var bi=Qr;function ki(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:ii(t,n,r)}var Ei=ce||function(t){return pe.clearTimeout(t)};function Ai(t,e){if(e)return t.slice();var n=t.length,r=Ht?Ht(n):new t.constructor(n);return t.copy(r),r}function Ci(t){var e=new t.constructor(t.byteLength);return new Zt(e).set(new Zt(t)),e}function Si(t,e){var n=e?Ci(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function xi(t,n){if(t!==n){var r=t!==e,i=null===t,s=t==t,o=ca(t),a=n!==e,u=null===n,c=n==n,l=ca(n);if(!u&&!l&&!o&&t>n||o&&a&&c&&!u&&!l||i&&a&&c||!r&&c||!s)return 1;if(!i&&!o&&!l&&t<n||l&&r&&s&&!i&&!o||u&&r&&s||!a&&s||!c)return-1}return 0}function Mi(t,e,n,r){for(var i=-1,s=t.length,o=n.length,a=-1,u=e.length,c=yn(s-o,0),l=dt(u+c),d=!r;++a<u;)l[a]=e[a];for(;++i<o;)(d||i<s)&&(l[n[i]]=t[i]);for(;c--;)l[a++]=t[i++];return l}function Oi(t,e,n,r){for(var i=-1,s=t.length,o=-1,a=n.length,u=-1,c=e.length,l=yn(s-a,0),d=dt(l+c),h=!r;++i<l;)d[i]=t[i];for(var f=i;++u<c;)d[f+u]=e[u];for(;++o<a;)(h||i<s)&&(d[f+n[o]]=t[i++]);return d}function Ii(t,e){var n=-1,r=t.length;for(e||(e=dt(r));++n<r;)e[n]=t[n];return e}function Ri(t,n,r,i){var s=!r;r||(r={});for(var o=-1,a=n.length;++o<a;){var u=n[o],c=i?i(r[u],t[u],u,r,t):e;c===e&&(c=t[u]),s?or(r,u,c):nr(r,u,c)}return r}function Ti(t,e){return function(n,r){var i=Zo(n)?xe:ir,s=e?e():{};return i(n,t,cs(r,2),s)}}function Pi(t){return Qr((function(n,r){var i=-1,s=r.length,o=s>1?r[s-1]:e,a=s>2?r[2]:e;for(o=t.length>3&&"function"==typeof o?(s--,o):e,a&&ws(r[0],r[1],a)&&(o=s<3?e:o,s=1),n=xt(n);++i<s;){var u=r[i];u&&t(n,u,i,o)}return n}))}function ji(t,e){return function(n,r){if(null==n)return n;if(!Go(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=xt(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Fi(t){return function(e,n,r){for(var i=-1,s=xt(e),o=r(e),a=o.length;a--;){var u=o[t?a:++i];if(!1===n(s[u],u,s))break}return e}}function Ni(t){return function(n){var r=an(n=ya(n))?pn(n):e,i=r?r[0]:n.charAt(0),s=r?ki(r,1).join(""):n.slice(1);return i[t]()+s}}function zi(t){return function(e){return Ne(Xa(Wa(e).replace(Yt,"")),t,"")}}function Bi(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=qn(t.prototype),r=t.apply(n,e);return ea(r)?r:n}}function Li(t){return function(n,r,i){var s=xt(n);if(!Go(n)){var o=cs(r,3);n=Ta(n),r=function(t){return o(s[t],t,s)}}var a=t(n,r,i);return a>-1?s[o?n[a]:a]:e}}function Ui(t){return rs((function(r){var i=r.length,s=i,o=Wn.prototype.thru;for(t&&r.reverse();s--;){var a=r[s];if("function"!=typeof a)throw new It(n);if(o&&!u&&"wrapper"==as(a))var u=new Wn([],!0)}for(s=u?s:i;++s<i;){var c=as(a=r[s]),l="wrapper"==c?os(a):e;u=l&&ks(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[as(l[0])].apply(u,l[3]):1==a.length&&ks(a)?u[c]():u.thru(a)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&Zo(e))return u.plant(e).value();for(var n=0,s=i?r[n].apply(this,t):e;++n<i;)s=r[n].call(this,s);return s}}))}function Di(t,n,r,i,s,o,a,c,l,d){var h=n&u,f=1&n,p=2&n,m=24&n,g=512&n,_=p?e:Bi(t);return function u(){for(var v=arguments.length,y=dt(v),w=v;w--;)y[w]=arguments[w];if(m)var b=us(u),k=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(y,b);if(i&&(y=Mi(y,i,s,m)),o&&(y=Oi(y,o,a,m)),v-=k,m&&v<d){var E=ln(y,b);return Ji(t,n,Di,u.placeholder,r,y,E,c,l,d-v)}var A=f?r:this,C=p?A[t]:t;return v=y.length,c?y=function(t,n){for(var r=t.length,i=wn(n.length,r),s=Ii(t);i--;){var o=n[i];t[i]=ys(o,r)?s[o]:e}return t}(y,c):g&&v>1&&y.reverse(),h&&l<v&&(y.length=l),this&&this!==pe&&this instanceof u&&(C=_||Bi(C)),C.apply(A,y)}}function qi(t,e){return function(n,r){return function(t,e,n,r){return br(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function $i(t,n){return function(r,i){var s;if(r===e&&i===e)return n;if(r!==e&&(s=r),i!==e){if(s===e)return i;"string"==typeof r||"string"==typeof i?(r=li(r),i=li(i)):(r=ci(r),i=ci(i)),s=t(r,i)}return s}}function Wi(t){return rs((function(e){return e=je(e,Xe(cs())),Qr((function(n){var r=this;return t(e,(function(t){return Se(t,r,n)}))}))}))}function Zi(t,n){var r=(n=n===e?" ":li(n)).length;if(r<2)return r?Kr(n,t):n;var i=Kr(n,me(t/fn(n)));return an(n)?ki(pn(i),0,t).join(""):i.slice(0,t)}function Hi(t){return function(n,r,i){return i&&"number"!=typeof i&&ws(n,r,i)&&(r=i=e),n=pa(n),r===e?(r=n,n=0):r=pa(r),function(t,e,n,r){for(var i=-1,s=yn(me((e-t)/(n||1)),0),o=dt(s);s--;)o[r?s:++i]=t,t+=n;return o}(n,r,i=i===e?n<r?1:-1:pa(i),t)}}function Gi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=_a(e),n=_a(n)),t(e,n)}}function Ji(t,n,r,i,s,u,c,l,d,h){var f=8&n;n|=f?o:a,4&(n&=~(f?a:o))||(n&=-4);var p=[t,n,s,f?u:e,f?c:e,f?e:u,f?e:c,l,d,h],m=r.apply(e,p);return ks(t)&&Is(m,p),m.placeholder=i,Ps(m,t,n)}function Vi(t){var e=St[t];return function(t,n){if(t=_a(t),(n=null==n?0:wn(ma(n),292))&&Le(t)){var r=(ya(t)+"e").split("e");return+((r=(ya(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ki=Mn&&1/dn(new Mn([,-0]))[1]==l?function(t){return new Mn(t)}:cu;function Qi(t){return function(e){var n=ms(e);return n==k?un(e):n==x?hn(e):function(t,e){return je(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Xi(t,r,l,d,h,f,p,m){var g=2&r;if(!g&&"function"!=typeof t)throw new It(n);var _=d?d.length:0;if(_||(r&=-97,d=h=e),p=p===e?p:yn(ma(p),0),m=m===e?m:ma(m),_-=h?h.length:0,r&a){var v=d,y=h;d=h=e}var w=g?e:os(t),b=[t,r,l,d,h,v,y,f,p,m];if(w&&function(t,e){var n=t[1],r=e[1],s=n|r,o=s<131,a=r==u&&8==n||r==u&&n==c&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!o&&!a)return t;1&r&&(t[2]=e[2],s|=1&n?0:4);var l=e[3];if(l){var d=t[3];t[3]=d?Mi(d,l,e[4]):l,t[4]=d?ln(t[3],i):e[4]}(l=e[5])&&(d=t[5],t[5]=d?Oi(d,l,e[6]):l,t[6]=d?ln(t[5],i):e[6]),(l=e[7])&&(t[7]=l),r&u&&(t[8]=null==t[8]?e[8]:wn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=s}(b,w),t=b[0],r=b[1],l=b[2],d=b[3],h=b[4],!(m=b[9]=b[9]===e?g?0:t.length:yn(b[9]-_,0))&&24&r&&(r&=-25),r&&1!=r)k=8==r||r==s?function(t,n,r){var i=Bi(t);return function s(){for(var o=arguments.length,a=dt(o),u=o,c=us(s);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:ln(a,c);return(o-=l.length)<r?Ji(t,n,Di,s.placeholder,e,a,l,e,e,r-o):Se(this&&this!==pe&&this instanceof s?i:t,this,a)}}(t,r,m):r!=o&&33!=r||h.length?Di.apply(e,b):function(t,e,n,r){var i=1&e,s=Bi(t);return function e(){for(var o=-1,a=arguments.length,u=-1,c=r.length,l=dt(c+a),d=this&&this!==pe&&this instanceof e?s:t;++u<c;)l[u]=r[u];for(;a--;)l[u++]=arguments[++o];return Se(d,i?n:this,l)}}(t,r,l,d);else var k=function(t,e,n){var r=1&e,i=Bi(t);return function e(){return(this&&this!==pe&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,r,l);return Ps((w?ei:Is)(k,b),t,r)}function Yi(t,n,r,i){return t===e||Do(t,Pt[r])&&!Nt.call(i,r)?n:t}function ts(t,n,r,i,s,o){return ea(t)&&ea(n)&&(o.set(n,t),$r(t,n,e,ts,o),o.delete(n)),t}function es(t){return sa(t)?e:t}function ns(t,n,r,i,s,o){var a=1&r,u=t.length,c=n.length;if(u!=c&&!(a&&c>u))return!1;var l=o.get(t),d=o.get(n);if(l&&d)return l==n&&d==t;var h=-1,f=!0,p=2&r?new Vn:e;for(o.set(t,n),o.set(n,t);++h<u;){var m=t[h],g=n[h];if(i)var _=a?i(g,m,h,n,t,o):i(m,g,h,t,n,o);if(_!==e){if(_)continue;f=!1;break}if(p){if(!Be(n,(function(t,e){if(!tn(p,e)&&(m===t||s(m,t,r,i,o)))return p.push(e)}))){f=!1;break}}else if(m!==g&&!s(m,g,r,i,o)){f=!1;break}}return o.delete(t),o.delete(n),f}function rs(t){return Ts(xs(t,e,Zs),t+"")}function is(t){return Cr(t,Ta,fs)}function ss(t){return Cr(t,Pa,ps)}var os=Rn?function(t){return Rn.get(t)}:cu;function as(t){for(var e=t.name+"",n=Tn[e],r=Nt.call(Tn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function us(t){return(Nt.call(Dn,"placeholder")?Dn:t).placeholder}function cs(){var t=Dn.iteratee||su;return t=t===su?Nr:t,arguments.length?t(arguments[0],arguments[1]):t}function ls(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function ds(t){for(var e=Ta(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,Cs(i)]}return e}function hs(t,n){var r=function(t,n){return null==t?e:t[n]}(t,n);return Fr(r)?r:e}var fs=ve?function(t){return null==t?[]:(t=xt(t),Re(ve(t),(function(e){return Vt.call(t,e)})))}:gu,ps=ve?function(t){for(var e=[];t;)Fe(e,fs(t)),t=Gt(t);return e}:gu,ms=Sr;function gs(t,e,n){for(var r=-1,i=(e=wi(e,t)).length,s=!1;++r<i;){var o=zs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&ta(i)&&ys(o,i)&&(Zo(t)||Wo(t))}function _s(t){return"function"!=typeof t.constructor||As(t)?{}:qn(Gt(t))}function vs(t){return Zo(t)||Wo(t)||!!(Qt&&t&&t[Qt])}function ys(t,e){var n=typeof t;return!!(e=null==e?d:e)&&("number"==n||"symbol"!=n&&yt.test(t))&&t>-1&&t%1==0&&t<e}function ws(t,e,n){if(!ea(n))return!1;var r=typeof e;return!!("number"==r?Go(n)&&ys(e,n.length):"string"==r&&e in n)&&Do(n[e],t)}function bs(t,e){if(Zo(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!ca(t))||Y.test(t)||!X.test(t)||null!=e&&t in xt(e)}function ks(t){var e=as(t),n=Dn[e];if("function"!=typeof n||!(e in Zn.prototype))return!1;if(t===n)return!0;var r=os(n);return!!r&&t===r[0]}(Cn&&ms(new Cn(new ArrayBuffer(1)))!=T||Sn&&ms(new Sn)!=k||xn&&ms(xn.resolve())!=C||Mn&&ms(new Mn)!=x||On&&ms(new On)!=I)&&(ms=function(t){var n=Sr(t),r=n==A?t.constructor:e,i=r?Bs(r):"";if(i)switch(i){case Pn:return T;case jn:return k;case Fn:return C;case Nn:return x;case zn:return I}return n});var Es=jt?Xo:_u;function As(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)}function Cs(t){return t==t&&!ea(t)}function Ss(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in xt(r))}}function xs(t,n,r){return n=yn(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,s=yn(e.length-n,0),o=dt(s);++i<s;)o[i]=e[n+i];i=-1;for(var a=dt(n+1);++i<n;)a[i]=e[i];return a[n]=r(o),Se(t,this,a)}}function Ms(t,e){return e.length<2?t:Ar(t,ii(e,0,-1))}function Os(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Is=js(ei),Rs=fe||function(t,e){return pe.setTimeout(t,e)},Ts=js(ni);function Ps(t,e,n){var r=e+"";return Ts(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Me(p,(function(n){var r="_."+n[0];e&n[1]&&!Te(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(at):[]}(r),n)))}function js(t){var n=0,r=0;return function(){var i=bn(),s=16-(i-r);if(r=i,s>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(e,arguments)}}function Fs(t,n){var r=-1,i=t.length,s=i-1;for(n=n===e?i:n;++r<n;){var o=Vr(r,s),a=t[o];t[o]=t[r],t[r]=a}return t.length=n,t}var Ns=function(t){var e=Fo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(tt,(function(t,n,r,i){e.push(r?i.replace(ht,"$1"):n||t)})),e}));function zs(t){if("string"==typeof t||ca(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Bs(t){if(null!=t){try{return Ft.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ls(t){if(t instanceof Zn)return t.clone();var e=new Wn(t.__wrapped__,t.__chain__);return e.__actions__=Ii(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Us=Qr((function(t,e){return Jo(t)?hr(t,vr(e,1,Jo,!0)):[]})),Ds=Qr((function(t,n){var r=Ks(n);return Jo(r)&&(r=e),Jo(t)?hr(t,vr(n,1,Jo,!0),cs(r,2)):[]})),qs=Qr((function(t,n){var r=Ks(n);return Jo(r)&&(r=e),Jo(t)?hr(t,vr(n,1,Jo,!0),e,r):[]}));function $s(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ma(n);return i<0&&(i=yn(r+i,0)),De(t,cs(e,3),i)}function Ws(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var s=i-1;return r!==e&&(s=ma(r),s=r<0?yn(i+s,0):wn(s,i-1)),De(t,cs(n,3),s,!0)}function Zs(t){return null!=t&&t.length?vr(t,1):[]}function Hs(t){return t&&t.length?t[0]:e}var Gs=Qr((function(t){var e=je(t,vi);return e.length&&e[0]===t[0]?Ir(e):[]})),Js=Qr((function(t){var n=Ks(t),r=je(t,vi);return n===Ks(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Ir(r,cs(n,2)):[]})),Vs=Qr((function(t){var n=Ks(t),r=je(t,vi);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Ir(r,e,n):[]}));function Ks(t){var n=null==t?0:t.length;return n?t[n-1]:e}var Qs=Qr(Xs);function Xs(t,e){return t&&t.length&&e&&e.length?Gr(t,e):t}var Ys=rs((function(t,e){var n=null==t?0:t.length,r=ar(t,e);return Jr(t,je(e,(function(t){return ys(t,n)?+t:t})).sort(xi)),r}));function to(t){return null==t?t:An.call(t)}var eo=Qr((function(t){return di(vr(t,1,Jo,!0))})),no=Qr((function(t){var n=Ks(t);return Jo(n)&&(n=e),di(vr(t,1,Jo,!0),cs(n,2))})),ro=Qr((function(t){var n=Ks(t);return n="function"==typeof n?n:e,di(vr(t,1,Jo,!0),e,n)}));function io(t){if(!t||!t.length)return[];var e=0;return t=Re(t,(function(t){if(Jo(t))return e=yn(t.length,e),!0})),Ke(e,(function(e){return je(t,He(e))}))}function so(t,n){if(!t||!t.length)return[];var r=io(t);return null==n?r:je(r,(function(t){return Se(n,e,t)}))}var oo=Qr((function(t,e){return Jo(t)?hr(t,e):[]})),ao=Qr((function(t){return gi(Re(t,Jo))})),uo=Qr((function(t){var n=Ks(t);return Jo(n)&&(n=e),gi(Re(t,Jo),cs(n,2))})),co=Qr((function(t){var n=Ks(t);return n="function"==typeof n?n:e,gi(Re(t,Jo),e,n)})),lo=Qr(io),ho=Qr((function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,so(t,r)}));function fo(t){var e=Dn(t);return e.__chain__=!0,e}function po(t,e){return e(t)}var mo=rs((function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,s=function(e){return ar(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Zn&&ys(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:po,args:[s],thisArg:e}),new Wn(i,this.__chain__).thru((function(t){return n&&!t.length&&t.push(e),t}))):this.thru(s)})),go=Ti((function(t,e,n){Nt.call(t,n)?++t[n]:or(t,n,1)})),_o=Li($s),vo=Li(Ws);function yo(t,e){return(Zo(t)?Me:fr)(t,cs(e,3))}function wo(t,e){return(Zo(t)?Oe:pr)(t,cs(e,3))}var bo=Ti((function(t,e,n){Nt.call(t,n)?t[n].push(e):or(t,n,[e])})),ko=Qr((function(t,e,n){var r=-1,i="function"==typeof e,s=Go(t)?dt(t.length):[];return fr(t,(function(t){s[++r]=i?Se(e,t,n):Rr(t,e,n)})),s})),Eo=Ti((function(t,e,n){or(t,n,e)}));function Ao(t,e){return(Zo(t)?je:Ur)(t,cs(e,3))}var Co=Ti((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]})),So=Qr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&ws(t,e[0],e[1])?e=[]:n>2&&ws(e[0],e[1],e[2])&&(e=[e[0]]),Zr(t,vr(e,1),[])})),xo=he||function(){return pe.Date.now()};function Mo(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,Xi(t,u,e,e,e,e,n)}function Oo(t,r){var i;if("function"!=typeof r)throw new It(n);return t=ma(t),function(){return--t>0&&(i=r.apply(this,arguments)),t<=1&&(r=e),i}}var Io=Qr((function(t,e,n){var r=1;if(n.length){var i=ln(n,us(Io));r|=o}return Xi(t,r,e,n,i)})),Ro=Qr((function(t,e,n){var r=3;if(n.length){var i=ln(n,us(Ro));r|=o}return Xi(e,r,t,n,i)}));function To(t,r,i){var s,o,a,u,c,l,d=0,h=!1,f=!1,p=!0;if("function"!=typeof t)throw new It(n);function m(n){var r=s,i=o;return s=o=e,d=n,u=t.apply(i,r)}function g(t){var n=t-l;return l===e||n>=r||n<0||f&&t-d>=a}function _(){var t=xo();if(g(t))return v(t);c=Rs(_,function(t){var e=r-(t-l);return f?wn(e,a-(t-d)):e}(t))}function v(t){return c=e,p&&s?m(t):(s=o=e,u)}function y(){var t=xo(),n=g(t);if(s=arguments,o=this,l=t,n){if(c===e)return function(t){return d=t,c=Rs(_,r),h?m(t):u}(l);if(f)return Ei(c),c=Rs(_,r),m(l)}return c===e&&(c=Rs(_,r)),u}return r=_a(r)||0,ea(i)&&(h=!!i.leading,a=(f="maxWait"in i)?yn(_a(i.maxWait)||0,r):a,p="trailing"in i?!!i.trailing:p),y.cancel=function(){c!==e&&Ei(c),d=0,s=l=o=c=e},y.flush=function(){return c===e?u:v(xo())},y}var Po=Qr((function(t,e){return dr(t,1,e)})),jo=Qr((function(t,e,n){return dr(t,_a(e)||0,n)}));function Fo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new It(n);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=t.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Fo.Cache||Jn),r}function No(t){if("function"!=typeof t)throw new It(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Fo.Cache=Jn;var zo=bi((function(t,e){var n=(e=1==e.length&&Zo(e[0])?je(e[0],Xe(cs())):je(vr(e,1),Xe(cs()))).length;return Qr((function(r){for(var i=-1,s=wn(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return Se(t,this,r)}))})),Bo=Qr((function(t,n){var r=ln(n,us(Bo));return Xi(t,o,e,n,r)})),Lo=Qr((function(t,n){var r=ln(n,us(Lo));return Xi(t,a,e,n,r)})),Uo=rs((function(t,n){return Xi(t,c,e,e,e,n)}));function Do(t,e){return t===e||t!=t&&e!=e}var qo=Gi(xr),$o=Gi((function(t,e){return t>=e})),Wo=Tr(function(){return arguments}())?Tr:function(t){return na(t)&&Nt.call(t,"callee")&&!Vt.call(t,"callee")},Zo=dt.isArray,Ho=we?Xe(we):function(t){return na(t)&&Sr(t)==R};function Go(t){return null!=t&&ta(t.length)&&!Xo(t)}function Jo(t){return na(t)&&Go(t)}var Vo=ye||_u,Ko=be?Xe(be):function(t){return na(t)&&Sr(t)==v};function Qo(t){if(!na(t))return!1;var e=Sr(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Xo(t){if(!ea(t))return!1;var e=Sr(t);return e==w||e==b||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Yo(t){return"number"==typeof t&&t==ma(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function na(t){return null!=t&&"object"==typeof t}var ra=ke?Xe(ke):function(t){return na(t)&&ms(t)==k};function ia(t){return"number"==typeof t||na(t)&&Sr(t)==E}function sa(t){if(!na(t)||Sr(t)!=A)return!1;var e=Gt(t);if(null===e)return!0;var n=Nt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Ft.call(n)==Ut}var oa=Ee?Xe(Ee):function(t){return na(t)&&Sr(t)==S},aa=Ae?Xe(Ae):function(t){return na(t)&&ms(t)==x};function ua(t){return"string"==typeof t||!Zo(t)&&na(t)&&Sr(t)==M}function ca(t){return"symbol"==typeof t||na(t)&&Sr(t)==O}var la=Ce?Xe(Ce):function(t){return na(t)&&ta(t.length)&&!!ae[Sr(t)]},da=Gi(Lr),ha=Gi((function(t,e){return t<=e}));function fa(t){if(!t)return[];if(Go(t))return ua(t)?pn(t):Ii(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=ms(t);return(e==k?un:e==x?dn:Da)(t)}function pa(t){return t?(t=_a(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ma(t){var e=pa(t),n=e%1;return e==e?n?e-n:e:0}function ga(t){return t?ur(ma(t),0,f):0}function _a(t){if("number"==typeof t)return t;if(ca(t))return h;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Qe(t);var n=gt.test(t);return n||vt.test(t)?de(t.slice(2),n?2:8):mt.test(t)?h:+t}function va(t){return Ri(t,Pa(t))}function ya(t){return null==t?"":li(t)}var wa=Pi((function(t,e){if(As(e)||Go(e))Ri(e,Ta(e),t);else for(var n in e)Nt.call(e,n)&&nr(t,n,e[n])})),ba=Pi((function(t,e){Ri(e,Pa(e),t)})),ka=Pi((function(t,e,n,r){Ri(e,Pa(e),t,r)})),Ea=Pi((function(t,e,n,r){Ri(e,Ta(e),t,r)})),Aa=rs(ar),Ca=Qr((function(t,n){t=xt(t);var r=-1,i=n.length,s=i>2?n[2]:e;for(s&&ws(n[0],n[1],s)&&(i=1);++r<i;)for(var o=n[r],a=Pa(o),u=-1,c=a.length;++u<c;){var l=a[u],d=t[l];(d===e||Do(d,Pt[l])&&!Nt.call(t,l))&&(t[l]=o[l])}return t})),Sa=Qr((function(t){return t.push(e,ts),Se(Fa,e,t)}));function xa(t,n,r){var i=null==t?e:Ar(t,n);return i===e?r:i}function Ma(t,e){return null!=t&&gs(t,e,Or)}var Oa=qi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),t[e]=n}),eu(iu)),Ia=qi((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Lt.call(e)),Nt.call(t,e)?t[e].push(n):t[e]=[n]}),cs),Ra=Qr(Rr);function Ta(t){return Go(t)?Qn(t):zr(t)}function Pa(t){return Go(t)?Qn(t,!0):Br(t)}var ja=Pi((function(t,e,n){$r(t,e,n)})),Fa=Pi((function(t,e,n,r){$r(t,e,n,r)})),Na=rs((function(t,e){var n={};if(null==t)return n;var r=!1;e=je(e,(function(e){return e=wi(e,t),r||(r=e.length>1),e})),Ri(t,ss(t),n),r&&(n=cr(n,7,es));for(var i=e.length;i--;)hi(n,e[i]);return n})),za=rs((function(t,e){return null==t?{}:function(t,e){return Hr(t,e,(function(e,n){return Ma(t,n)}))}(t,e)}));function Ba(t,e){if(null==t)return{};var n=je(ss(t),(function(t){return[t]}));return e=cs(e),Hr(t,n,(function(t,n){return e(t,n[0])}))}var La=Qi(Ta),Ua=Qi(Pa);function Da(t){return null==t?[]:Ye(t,Ta(t))}var qa=zi((function(t,e,n){return e=e.toLowerCase(),t+(n?$a(e):e)}));function $a(t){return Qa(ya(t).toLowerCase())}function Wa(t){return(t=ya(t))&&t.replace(wt,rn).replace(te,"")}var Za=zi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Ha=zi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Ga=Ni("toLowerCase"),Ja=zi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()})),Va=zi((function(t,e,n){return t+(n?" ":"")+Qa(e)})),Ka=zi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qa=Ni("toUpperCase");function Xa(t,n,r){return t=ya(t),(n=r?e:n)===e?function(t){return ie.test(t)}(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.match(ut)||[]}(t):t.match(n)||[]}var Ya=Qr((function(t,n){try{return Se(t,e,n)}catch(t){return Qo(t)?t:new At(t)}})),tu=rs((function(t,e){return Me(e,(function(e){e=zs(e),or(t,e,Io(t[e],t))})),t}));function eu(t){return function(){return t}}var nu=Ui(),ru=Ui(!0);function iu(t){return t}function su(t){return Nr("function"==typeof t?t:cr(t,1))}var ou=Qr((function(t,e){return function(n){return Rr(n,t,e)}})),au=Qr((function(t,e){return function(n){return Rr(t,n,e)}}));function uu(t,e,n){var r=Ta(e),i=Er(e,r);null!=n||ea(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Er(e,Ta(e)));var s=!(ea(n)&&"chain"in n&&!n.chain),o=Xo(t);return Me(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__);return(n.__actions__=Ii(this.__actions__)).push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Fe([this.value()],arguments))})})),t}function cu(){}var lu=Wi(je),du=Wi(Ie),hu=Wi(Be);function fu(t){return bs(t)?He(zs(t)):function(t){return function(e){return Ar(e,t)}}(t)}var pu=Hi(),mu=Hi(!0);function gu(){return[]}function _u(){return!1}var vu,yu=$i((function(t,e){return t+e}),0),wu=Vi("ceil"),bu=$i((function(t,e){return t/e}),1),ku=Vi("floor"),Eu=$i((function(t,e){return t*e}),1),Au=Vi("round"),Cu=$i((function(t,e){return t-e}),0);return Dn.after=function(t,e){if("function"!=typeof e)throw new It(n);return t=ma(t),function(){if(--t<1)return e.apply(this,arguments)}},Dn.ary=Mo,Dn.assign=wa,Dn.assignIn=ba,Dn.assignInWith=ka,Dn.assignWith=Ea,Dn.at=Aa,Dn.before=Oo,Dn.bind=Io,Dn.bindAll=tu,Dn.bindKey=Ro,Dn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Zo(t)?t:[t]},Dn.chain=fo,Dn.chunk=function(t,n,r){n=(r?ws(t,n,r):n===e)?1:yn(ma(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var s=0,o=0,a=dt(me(i/n));s<i;)a[o++]=ii(t,s,s+=n);return a},Dn.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},Dn.concat=function(){var t=arguments.length;if(!t)return[];for(var e=dt(t-1),n=arguments[0],r=t;r--;)e[r-1]=arguments[r];return Fe(Zo(n)?Ii(n):[n],vr(e,1))},Dn.cond=function(t){var e=null==t?0:t.length,r=cs();return t=e?je(t,(function(t){if("function"!=typeof t[1])throw new It(n);return[r(t[0]),t[1]]})):[],Qr((function(n){for(var r=-1;++r<e;){var i=t[r];if(Se(i[0],this,n))return Se(i[1],this,n)}}))},Dn.conforms=function(t){return function(t){var e=Ta(t);return function(n){return lr(n,t,e)}}(cr(t,1))},Dn.constant=eu,Dn.countBy=go,Dn.create=function(t,e){var n=qn(t);return null==e?n:sr(n,e)},Dn.curry=function t(n,r,i){var s=Xi(n,8,e,e,e,e,e,r=i?e:r);return s.placeholder=t.placeholder,s},Dn.curryRight=function t(n,r,i){var o=Xi(n,s,e,e,e,e,e,r=i?e:r);return o.placeholder=t.placeholder,o},Dn.debounce=To,Dn.defaults=Ca,Dn.defaultsDeep=Sa,Dn.defer=Po,Dn.delay=jo,Dn.difference=Us,Dn.differenceBy=Ds,Dn.differenceWith=qs,Dn.drop=function(t,n,r){var i=null==t?0:t.length;return i?ii(t,(n=r||n===e?1:ma(n))<0?0:n,i):[]},Dn.dropRight=function(t,n,r){var i=null==t?0:t.length;return i?ii(t,0,(n=i-(n=r||n===e?1:ma(n)))<0?0:n):[]},Dn.dropRightWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!0,!0):[]},Dn.dropWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!0):[]},Dn.fill=function(t,n,r,i){var s=null==t?0:t.length;return s?(r&&"number"!=typeof r&&ws(t,n,r)&&(r=0,i=s),function(t,n,r,i){var s=t.length;for((r=ma(r))<0&&(r=-r>s?0:s+r),(i=i===e||i>s?s:ma(i))<0&&(i+=s),i=r>i?0:ga(i);r<i;)t[r++]=n;return t}(t,n,r,i)):[]},Dn.filter=function(t,e){return(Zo(t)?Re:_r)(t,cs(e,3))},Dn.flatMap=function(t,e){return vr(Ao(t,e),1)},Dn.flatMapDeep=function(t,e){return vr(Ao(t,e),l)},Dn.flatMapDepth=function(t,n,r){return r=r===e?1:ma(r),vr(Ao(t,n),r)},Dn.flatten=Zs,Dn.flattenDeep=function(t){return null!=t&&t.length?vr(t,l):[]},Dn.flattenDepth=function(t,n){return null!=t&&t.length?vr(t,n=n===e?1:ma(n)):[]},Dn.flip=function(t){return Xi(t,512)},Dn.flow=nu,Dn.flowRight=ru,Dn.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},Dn.functions=function(t){return null==t?[]:Er(t,Ta(t))},Dn.functionsIn=function(t){return null==t?[]:Er(t,Pa(t))},Dn.groupBy=bo,Dn.initial=function(t){return null!=t&&t.length?ii(t,0,-1):[]},Dn.intersection=Gs,Dn.intersectionBy=Js,Dn.intersectionWith=Vs,Dn.invert=Oa,Dn.invertBy=Ia,Dn.invokeMap=ko,Dn.iteratee=su,Dn.keyBy=Eo,Dn.keys=Ta,Dn.keysIn=Pa,Dn.map=Ao,Dn.mapKeys=function(t,e){var n={};return e=cs(e,3),br(t,(function(t,r,i){or(n,e(t,r,i),t)})),n},Dn.mapValues=function(t,e){var n={};return e=cs(e,3),br(t,(function(t,r,i){or(n,r,e(t,r,i))})),n},Dn.matches=function(t){return Dr(cr(t,1))},Dn.matchesProperty=function(t,e){return qr(t,cr(e,1))},Dn.memoize=Fo,Dn.merge=ja,Dn.mergeWith=Fa,Dn.method=ou,Dn.methodOf=au,Dn.mixin=uu,Dn.negate=No,Dn.nthArg=function(t){return t=ma(t),Qr((function(e){return Wr(e,t)}))},Dn.omit=Na,Dn.omitBy=function(t,e){return Ba(t,No(cs(e)))},Dn.once=function(t){return Oo(2,t)},Dn.orderBy=function(t,n,r,i){return null==t?[]:(Zo(n)||(n=null==n?[]:[n]),Zo(r=i?e:r)||(r=null==r?[]:[r]),Zr(t,n,r))},Dn.over=lu,Dn.overArgs=zo,Dn.overEvery=du,Dn.overSome=hu,Dn.partial=Bo,Dn.partialRight=Lo,Dn.partition=Co,Dn.pick=za,Dn.pickBy=Ba,Dn.property=fu,Dn.propertyOf=function(t){return function(n){return null==t?e:Ar(t,n)}},Dn.pull=Qs,Dn.pullAll=Xs,Dn.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Gr(t,e,cs(n,2)):t},Dn.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?Gr(t,n,e,r):t},Dn.pullAt=Ys,Dn.range=pu,Dn.rangeRight=mu,Dn.rearg=Uo,Dn.reject=function(t,e){return(Zo(t)?Re:_r)(t,No(cs(e,3)))},Dn.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=cs(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return Jr(t,i),n},Dn.rest=function(t,r){if("function"!=typeof t)throw new It(n);return Qr(t,r=r===e?r:ma(r))},Dn.reverse=to,Dn.sampleSize=function(t,n,r){return n=(r?ws(t,n,r):n===e)?1:ma(n),(Zo(t)?Yn:Yr)(t,n)},Dn.set=function(t,e,n){return null==t?t:ti(t,e,n)},Dn.setWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:ti(t,n,r,i)},Dn.shuffle=function(t){return(Zo(t)?tr:ri)(t)},Dn.slice=function(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&ws(t,n,r)?(n=0,r=i):(n=null==n?0:ma(n),r=r===e?i:ma(r)),ii(t,n,r)):[]},Dn.sortBy=So,Dn.sortedUniq=function(t){return t&&t.length?ui(t):[]},Dn.sortedUniqBy=function(t,e){return t&&t.length?ui(t,cs(e,2)):[]},Dn.split=function(t,n,r){return r&&"number"!=typeof r&&ws(t,n,r)&&(n=r=e),(r=r===e?f:r>>>0)?(t=ya(t))&&("string"==typeof n||null!=n&&!oa(n))&&!(n=li(n))&&an(t)?ki(pn(t),0,r):t.split(n,r):[]},Dn.spread=function(t,e){if("function"!=typeof t)throw new It(n);return e=null==e?0:yn(ma(e),0),Qr((function(n){var r=n[e],i=ki(n,0,e);return r&&Fe(i,r),Se(t,this,i)}))},Dn.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Dn.take=function(t,n,r){return t&&t.length?ii(t,0,(n=r||n===e?1:ma(n))<0?0:n):[]},Dn.takeRight=function(t,n,r){var i=null==t?0:t.length;return i?ii(t,(n=i-(n=r||n===e?1:ma(n)))<0?0:n,i):[]},Dn.takeRightWhile=function(t,e){return t&&t.length?pi(t,cs(e,3),!1,!0):[]},Dn.takeWhile=function(t,e){return t&&t.length?pi(t,cs(e,3)):[]},Dn.tap=function(t,e){return e(t),t},Dn.throttle=function(t,e,r){var i=!0,s=!0;if("function"!=typeof t)throw new It(n);return ea(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),To(t,e,{leading:i,maxWait:e,trailing:s})},Dn.thru=po,Dn.toArray=fa,Dn.toPairs=La,Dn.toPairsIn=Ua,Dn.toPath=function(t){return Zo(t)?je(t,zs):ca(t)?[t]:Ii(Ns(ya(t)))},Dn.toPlainObject=va,Dn.transform=function(t,e,n){var r=Zo(t),i=r||Vo(t)||la(t);if(e=cs(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:ea(t)&&Xo(s)?qn(Gt(t)):{}}return(i?Me:br)(t,(function(t,r,i){return e(n,t,r,i)})),n},Dn.unary=function(t){return Mo(t,1)},Dn.union=eo,Dn.unionBy=no,Dn.unionWith=ro,Dn.uniq=function(t){return t&&t.length?di(t):[]},Dn.uniqBy=function(t,e){return t&&t.length?di(t,cs(e,2)):[]},Dn.uniqWith=function(t,n){return n="function"==typeof n?n:e,t&&t.length?di(t,e,n):[]},Dn.unset=function(t,e){return null==t||hi(t,e)},Dn.unzip=io,Dn.unzipWith=so,Dn.update=function(t,e,n){return null==t?t:fi(t,e,yi(n))},Dn.updateWith=function(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:fi(t,n,yi(r),i)},Dn.values=Da,Dn.valuesIn=function(t){return null==t?[]:Ye(t,Pa(t))},Dn.without=oo,Dn.words=Xa,Dn.wrap=function(t,e){return Bo(yi(e),t)},Dn.xor=ao,Dn.xorBy=uo,Dn.xorWith=co,Dn.zip=lo,Dn.zipObject=function(t,e){return _i(t||[],e||[],nr)},Dn.zipObjectDeep=function(t,e){return _i(t||[],e||[],ti)},Dn.zipWith=ho,Dn.entries=La,Dn.entriesIn=Ua,Dn.extend=ba,Dn.extendWith=ka,uu(Dn,Dn),Dn.add=yu,Dn.attempt=Ya,Dn.camelCase=qa,Dn.capitalize=$a,Dn.ceil=wu,Dn.clamp=function(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=_a(r))==r?r:0),n!==e&&(n=(n=_a(n))==n?n:0),ur(_a(t),n,r)},Dn.clone=function(t){return cr(t,4)},Dn.cloneDeep=function(t){return cr(t,5)},Dn.cloneDeepWith=function(t,n){return cr(t,5,n="function"==typeof n?n:e)},Dn.cloneWith=function(t,n){return cr(t,4,n="function"==typeof n?n:e)},Dn.conformsTo=function(t,e){return null==e||lr(t,e,Ta(e))},Dn.deburr=Wa,Dn.defaultTo=function(t,e){return null==t||t!=t?e:t},Dn.divide=bu,Dn.endsWith=function(t,n,r){t=ya(t),n=li(n);var i=t.length,s=r=r===e?i:ur(ma(r),0,i);return(r-=n.length)>=0&&t.slice(r,s)==n},Dn.eq=Do,Dn.escape=function(t){return(t=ya(t))&&J.test(t)?t.replace(H,sn):t},Dn.escapeRegExp=function(t){return(t=ya(t))&&nt.test(t)?t.replace(et,"\\$&"):t},Dn.every=function(t,n,r){var i=Zo(t)?Ie:mr;return r&&ws(t,n,r)&&(n=e),i(t,cs(n,3))},Dn.find=_o,Dn.findIndex=$s,Dn.findKey=function(t,e){return Ue(t,cs(e,3),br)},Dn.findLast=vo,Dn.findLastIndex=Ws,Dn.findLastKey=function(t,e){return Ue(t,cs(e,3),kr)},Dn.floor=ku,Dn.forEach=yo,Dn.forEachRight=wo,Dn.forIn=function(t,e){return null==t?t:yr(t,cs(e,3),Pa)},Dn.forInRight=function(t,e){return null==t?t:wr(t,cs(e,3),Pa)},Dn.forOwn=function(t,e){return t&&br(t,cs(e,3))},Dn.forOwnRight=function(t,e){return t&&kr(t,cs(e,3))},Dn.get=xa,Dn.gt=qo,Dn.gte=$o,Dn.has=function(t,e){return null!=t&&gs(t,e,Mr)},Dn.hasIn=Ma,Dn.head=Hs,Dn.identity=iu,Dn.includes=function(t,e,n,r){t=Go(t)?t:Da(t),n=n&&!r?ma(n):0;var i=t.length;return n<0&&(n=yn(i+n,0)),ua(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&qe(t,e,n)>-1},Dn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ma(n);return i<0&&(i=yn(r+i,0)),qe(t,e,i)},Dn.inRange=function(t,n,r){return n=pa(n),r===e?(r=n,n=0):r=pa(r),function(t,e,n){return t>=wn(e,n)&&t<yn(e,n)}(t=_a(t),n,r)},Dn.invoke=Ra,Dn.isArguments=Wo,Dn.isArray=Zo,Dn.isArrayBuffer=Ho,Dn.isArrayLike=Go,Dn.isArrayLikeObject=Jo,Dn.isBoolean=function(t){return!0===t||!1===t||na(t)&&Sr(t)==_},Dn.isBuffer=Vo,Dn.isDate=Ko,Dn.isElement=function(t){return na(t)&&1===t.nodeType&&!sa(t)},Dn.isEmpty=function(t){if(null==t)return!0;if(Go(t)&&(Zo(t)||"string"==typeof t||"function"==typeof t.splice||Vo(t)||la(t)||Wo(t)))return!t.length;var e=ms(t);if(e==k||e==x)return!t.size;if(As(t))return!zr(t).length;for(var n in t)if(Nt.call(t,n))return!1;return!0},Dn.isEqual=function(t,e){return Pr(t,e)},Dn.isEqualWith=function(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Pr(t,n,e,r):!!i},Dn.isError=Qo,Dn.isFinite=function(t){return"number"==typeof t&&Le(t)},Dn.isFunction=Xo,Dn.isInteger=Yo,Dn.isLength=ta,Dn.isMap=ra,Dn.isMatch=function(t,e){return t===e||jr(t,e,ds(e))},Dn.isMatchWith=function(t,n,r){return r="function"==typeof r?r:e,jr(t,n,ds(n),r)},Dn.isNaN=function(t){return ia(t)&&t!=+t},Dn.isNative=function(t){if(Es(t))throw new At("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fr(t)},Dn.isNil=function(t){return null==t},Dn.isNull=function(t){return null===t},Dn.isNumber=ia,Dn.isObject=ea,Dn.isObjectLike=na,Dn.isPlainObject=sa,Dn.isRegExp=oa,Dn.isSafeInteger=function(t){return Yo(t)&&t>=-9007199254740991&&t<=d},Dn.isSet=aa,Dn.isString=ua,Dn.isSymbol=ca,Dn.isTypedArray=la,Dn.isUndefined=function(t){return t===e},Dn.isWeakMap=function(t){return na(t)&&ms(t)==I},Dn.isWeakSet=function(t){return na(t)&&"[object WeakSet]"==Sr(t)},Dn.join=function(t,e){return null==t?"":Ge.call(t,e)},Dn.kebabCase=Za,Dn.last=Ks,Dn.lastIndexOf=function(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var s=i;return r!==e&&(s=(s=ma(r))<0?yn(i+s,0):wn(s,i-1)),n==n?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,n,s):De(t,We,s,!0)},Dn.lowerCase=Ha,Dn.lowerFirst=Ga,Dn.lt=da,Dn.lte=ha,Dn.max=function(t){return t&&t.length?gr(t,iu,xr):e},Dn.maxBy=function(t,n){return t&&t.length?gr(t,cs(n,2),xr):e},Dn.mean=function(t){return Ze(t,iu)},Dn.meanBy=function(t,e){return Ze(t,cs(e,2))},Dn.min=function(t){return t&&t.length?gr(t,iu,Lr):e},Dn.minBy=function(t,n){return t&&t.length?gr(t,cs(n,2),Lr):e},Dn.stubArray=gu,Dn.stubFalse=_u,Dn.stubObject=function(){return{}},Dn.stubString=function(){return""},Dn.stubTrue=function(){return!0},Dn.multiply=Eu,Dn.nth=function(t,n){return t&&t.length?Wr(t,ma(n)):e},Dn.noConflict=function(){return pe._===this&&(pe._=Dt),this},Dn.noop=cu,Dn.now=xo,Dn.pad=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Zi(ge(i),n)+t+Zi(me(i),n)},Dn.padEnd=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;return e&&r<e?t+Zi(e-r,n):t},Dn.padStart=function(t,e,n){t=ya(t);var r=(e=ma(e))?fn(t):0;return e&&r<e?Zi(e-r,n)+t:t},Dn.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),kn(ya(t).replace(rt,""),e||0)},Dn.random=function(t,n,r){if(r&&"boolean"!=typeof r&&ws(t,n,r)&&(n=r=e),r===e&&("boolean"==typeof n?(r=n,n=e):"boolean"==typeof t&&(r=t,t=e)),t===e&&n===e?(t=0,n=1):(t=pa(t),n===e?(n=t,t=0):n=pa(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var s=En();return wn(t+s*(n-t+le("1e-"+((s+"").length-1))),n)}return Vr(t,n)},Dn.reduce=function(t,e,n){var r=Zo(t)?Ne:Je,i=arguments.length<3;return r(t,cs(e,4),n,i,fr)},Dn.reduceRight=function(t,e,n){var r=Zo(t)?ze:Je,i=arguments.length<3;return r(t,cs(e,4),n,i,pr)},Dn.repeat=function(t,n,r){return n=(r?ws(t,n,r):n===e)?1:ma(n),Kr(ya(t),n)},Dn.replace=function(){var t=arguments,e=ya(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Dn.result=function(t,n,r){var i=-1,s=(n=wi(n,t)).length;for(s||(s=1,t=e);++i<s;){var o=null==t?e:t[zs(n[i])];o===e&&(i=s,o=r),t=Xo(o)?o.call(t):o}return t},Dn.round=Au,Dn.runInContext=t,Dn.sample=function(t){return(Zo(t)?Xn:Xr)(t)},Dn.size=function(t){if(null==t)return 0;if(Go(t))return ua(t)?fn(t):t.length;var e=ms(t);return e==k||e==x?t.size:zr(t).length},Dn.snakeCase=Ja,Dn.some=function(t,n,r){var i=Zo(t)?Be:si;return r&&ws(t,n,r)&&(n=e),i(t,cs(n,3))},Dn.sortedIndex=function(t,e){return oi(t,e)},Dn.sortedIndexBy=function(t,e,n){return ai(t,e,cs(n,2))},Dn.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=oi(t,e);if(r<n&&Do(t[r],e))return r}return-1},Dn.sortedLastIndex=function(t,e){return oi(t,e,!0)},Dn.sortedLastIndexBy=function(t,e,n){return ai(t,e,cs(n,2),!0)},Dn.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=oi(t,e,!0)-1;if(Do(t[n],e))return n}return-1},Dn.startCase=Va,Dn.startsWith=function(t,e,n){return t=ya(t),n=null==n?0:ur(ma(n),0,t.length),e=li(e),t.slice(n,n+e.length)==e},Dn.subtract=Cu,Dn.sum=function(t){return t&&t.length?Ve(t,iu):0},Dn.sumBy=function(t,e){return t&&t.length?Ve(t,cs(e,2)):0},Dn.template=function(t,n,r){var i=Dn.templateSettings;r&&ws(t,n,r)&&(n=e),t=ya(t),n=ka({},n,i,Yi);var s,o,a=ka({},n.imports,i.imports,Yi),u=Ta(a),c=Ye(a,u),l=0,d=n.interpolate||bt,h="__p += '",f=Mt((n.escape||bt).source+"|"+d.source+"|"+(d===Q?ft:bt).source+"|"+(n.evaluate||bt).source+"|$","g"),p="//# sourceURL="+(Nt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oe+"]")+"\n";t.replace(f,(function(e,n,r,i,a,u){return r||(r=i),h+=t.slice(l,u).replace(kt,on),n&&(s=!0,h+="' +\n__e("+n+") +\n'"),a&&(o=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var m=Nt.call(n,"variable")&&n.variable;if(m){if(ct.test(m))throw new At("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(o?h.replace(q,""):h).replace($,"$1").replace(W,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Ya((function(){return Ct(u,p+"return "+h).apply(e,c)}));if(g.source=h,Qo(g))throw g;return g},Dn.times=function(t,e){if((t=ma(t))<1||t>d)return[];var n=f,r=wn(t,f);e=cs(e),t-=f;for(var i=Ke(r,e);++n<t;)e(n);return i},Dn.toFinite=pa,Dn.toInteger=ma,Dn.toLength=ga,Dn.toLower=function(t){return ya(t).toLowerCase()},Dn.toNumber=_a,Dn.toSafeInteger=function(t){return t?ur(ma(t),-9007199254740991,d):0===t?t:0},Dn.toString=ya,Dn.toUpper=function(t){return ya(t).toUpperCase()},Dn.trim=function(t,n,r){if((t=ya(t))&&(r||n===e))return Qe(t);if(!t||!(n=li(n)))return t;var i=pn(t),s=pn(n);return ki(i,en(i,s),nn(i,s)+1).join("")},Dn.trimEnd=function(t,n,r){if((t=ya(t))&&(r||n===e))return t.slice(0,mn(t)+1);if(!t||!(n=li(n)))return t;var i=pn(t);return ki(i,0,nn(i,pn(n))+1).join("")},Dn.trimStart=function(t,n,r){if((t=ya(t))&&(r||n===e))return t.replace(rt,"");if(!t||!(n=li(n)))return t;var i=pn(t);return ki(i,en(i,pn(n))).join("")},Dn.truncate=function(t,n){var r=30,i="...";if(ea(n)){var s="separator"in n?n.separator:s;r="length"in n?ma(n.length):r,i="omission"in n?li(n.omission):i}var o=(t=ya(t)).length;if(an(t)){var a=pn(t);o=a.length}if(r>=o)return t;var u=r-fn(i);if(u<1)return i;var c=a?ki(a,0,u).join(""):t.slice(0,u);if(s===e)return c+i;if(a&&(u+=c.length-u),oa(s)){if(t.slice(u).search(s)){var l,d=c;for(s.global||(s=Mt(s.source,ya(pt.exec(s))+"g")),s.lastIndex=0;l=s.exec(d);)var h=l.index;c=c.slice(0,h===e?u:h)}}else if(t.indexOf(li(s),u)!=u){var f=c.lastIndexOf(s);f>-1&&(c=c.slice(0,f))}return c+i},Dn.unescape=function(t){return(t=ya(t))&&G.test(t)?t.replace(Z,gn):t},Dn.uniqueId=function(t){var e=++zt;return ya(t)+e},Dn.upperCase=Ka,Dn.upperFirst=Qa,Dn.each=yo,Dn.eachRight=wo,Dn.first=Hs,uu(Dn,(vu={},br(Dn,(function(t,e){Nt.call(Dn.prototype,e)||(vu[e]=t)})),vu),{chain:!1}),Dn.VERSION="4.17.21",Me(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Dn[t].placeholder=Dn})),Me(["drop","take"],(function(t,n){Zn.prototype[t]=function(r){r=r===e?1:yn(ma(r),0);var i=this.__filtered__&&!n?new Zn(this):this.clone();return i.__filtered__?i.__takeCount__=wn(r,i.__takeCount__):i.__views__.push({size:wn(r,f),type:t+(i.__dir__<0?"Right":"")}),i},Zn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Me(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Zn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:cs(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),Me(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Zn.prototype[t]=function(){return this[n](1).value()[0]}})),Me(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Zn.prototype[t]=function(){return this.__filtered__?new Zn(this):this[n](1)}})),Zn.prototype.compact=function(){return this.filter(iu)},Zn.prototype.find=function(t){return this.filter(t).head()},Zn.prototype.findLast=function(t){return this.reverse().find(t)},Zn.prototype.invokeMap=Qr((function(t,e){return"function"==typeof t?new Zn(this):this.map((function(n){return Rr(n,t,e)}))})),Zn.prototype.reject=function(t){return this.filter(No(cs(t)))},Zn.prototype.slice=function(t,n){t=ma(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Zn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=ma(n))<0?r.dropRight(-n):r.take(n-t)),r)},Zn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Zn.prototype.toArray=function(){return this.take(f)},br(Zn.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),s=Dn[i?"take"+("last"==n?"Right":""):n],o=i||/^find/.test(n);s&&(Dn.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,u=n instanceof Zn,c=a[0],l=u||Zo(n),d=function(t){var e=s.apply(Dn,Fe([t],a));return i&&h?e[0]:e};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,m=u&&!f;if(!o&&l){n=m?n:new Zn(this);var g=t.apply(n,a);return g.__actions__.push({func:po,args:[d],thisArg:e}),new Wn(g,h)}return p&&m?t.apply(this,a):(g=this.thru(d),p?i?g.value()[0]:g.value():g)})})),Me(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Rt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Dn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Zo(i)?i:[],t)}return this[n]((function(n){return e.apply(Zo(n)?n:[],t)}))}})),br(Zn.prototype,(function(t,e){var n=Dn[e];if(n){var r=n.name+"";Nt.call(Tn,r)||(Tn[r]=[]),Tn[r].push({name:e,func:n})}})),Tn[Di(e,2).name]=[{name:"wrapper",func:e}],Zn.prototype.clone=function(){var t=new Zn(this.__wrapped__);return t.__actions__=Ii(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ii(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ii(this.__views__),t},Zn.prototype.reverse=function(){if(this.__filtered__){var t=new Zn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Zn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Zo(t),r=e<0,i=n?t.length:0,s=function(t,e,n){for(var r=-1,i=n.length;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=wn(e,t+o);break;case"takeRight":t=yn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,c=r?a:o-1,l=this.__iteratees__,d=l.length,h=0,f=wn(u,this.__takeCount__);if(!n||!r&&i==u&&f==u)return mi(t,this.__actions__);var p=[];t:for(;u--&&h<f;){for(var m=-1,g=t[c+=e];++m<d;){var _=l[m],v=_.iteratee,y=_.type,w=v(g);if(2==y)g=w;else if(!w){if(1==y)continue t;break t}}p[h++]=g}return p},Dn.prototype.at=mo,Dn.prototype.chain=function(){return fo(this)},Dn.prototype.commit=function(){return new Wn(this.value(),this.__chain__)},Dn.prototype.next=function(){this.__values__===e&&(this.__values__=fa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},Dn.prototype.plant=function(t){for(var n,r=this;r instanceof $n;){var i=Ls(r);i.__index__=0,i.__values__=e,n?s.__wrapped__=i:n=i;var s=i;r=r.__wrapped__}return s.__wrapped__=t,n},Dn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Zn){var n=t;return this.__actions__.length&&(n=new Zn(this)),(n=n.reverse()).__actions__.push({func:po,args:[to],thisArg:e}),new Wn(n,this.__chain__)}return this.thru(to)},Dn.prototype.toJSON=Dn.prototype.valueOf=Dn.prototype.value=function(){return mi(this.__wrapped__,this.__actions__)},Dn.prototype.first=Dn.prototype.head,Xt&&(Dn.prototype[Xt]=function(){return this}),Dn}();ge?((ge.exports=_n)._=_n,me._=_n):pe._=_n}.call(t);var ft=ht.exports;function pt(t,e){return F(t,(t=>"string"==typeof t&&e.test(t)))}const mt=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,gt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u;var _t;function vt(t){const e=mt.exec(t);if(!e?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:e.groups.namespace,reference:e.groups.reference}}function yt(t){const e=gt.exec(t);if(!e?.groups)throw new Error("Invalid CAIP account ID.");return{address:e.groups.accountAddress,chainId:e.groups.chainId,chain:{namespace:e.groups.namespace,reference:e.groups.reference}}}pt("CaipChainId",mt),pt("CaipNamespace",/^[-a-z0-9]{3,8}$/u),pt("CaipReference",/^[-_a-zA-Z0-9]{1,32}$/u),pt("CaipAccountId",gt),pt("CaipAccountAddress",/^[-.%a-zA-Z0-9]{1,128}$/u),pt("CaipAssetNamespace",/^[-a-z0-9]{3,8}$/u),pt("CaipAssetReference",/^[-.%a-zA-Z0-9]{1,128}$/u),pt("CaipTokenId",/^[-.%a-zA-Z0-9]{1,78}$/u),pt("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u),pt("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u),pt("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(t){t.Bip122="bip122",t.Solana="solana",t.Stellar="stellar",t.Tron="tron",t.Eip155="eip155",t.Wallet="wallet"}(_t=_t||(_t={}));const wt=t=>N(t);function bt({path:t,branch:e}){const n=t[t.length-1];return $(e[e.length-2],n)}function kt(t){return new O({...t,type:`optional ${t.type}`,validator:(e,n)=>!bt(n)||t.validator(e,n),refiner:(e,n)=>!bt(n)||t.refiner(e,n)})}function Et(t){if(null===t||"boolean"==typeof t||"string"==typeof t)return!0;if("number"==typeof t&&Number.isFinite(t))return!0;if("object"==typeof t){let e=!0;if(Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Et(t[n])){e=!1;break}return e}const n=Object.entries(t);for(let t=0;t<n.length;t++)if("string"!=typeof n[t][0]||!Et(n[t][1])){e=!1;break}return e}return!1}const At=F("JSON",(t=>Et(t))),Ct=(St=At,xt=D(F("any",(()=>!0)),"JSON",(t=>P(t,At))),Mt=t=>JSON.parse(JSON.stringify(t,((t,e)=>{if("__proto__"!==t&&"constructor"!==t)return e}))),new O({...St,coercer:(t,e)=>P(t,xt)?St.coercer(Mt(t,e),e):St.coercer(t,e)}));var St,xt,Mt;function Ot(t){try{return function(t){T(t,Ct)}(t),!0}catch{return!1}}const It=function(t){const e=C(t),n=typeof t;return new O({type:"literal",schema:"string"===n||"number"===n||"boolean"===n?t:null,validator:n=>n===t||`Expected the literal \`${e}\`, but received: ${C(n)}`})}("2.0"),Rt=function(t){return new O({...t,validator:(e,n)=>null===e||t.validator(e,n),refiner:(e,n)=>null===e||t.refiner(e,n)})}(L([F("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${C(t)}`)),B()])),Tt=wt({code:F("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${C(t)}`)),message:B(),data:kt(Ct),stack:kt(B())}),Pt=L([(Ft=B(),Nt=Ct,new O({type:"record",schema:null,*entries(t){if(A(t))for(const e in t){const n=t[e];yield[e,e,Ft],yield[e,n,Nt]}},validator:t=>A(t)||`Expected an object, but received: ${C(t)}`})),(jt=Ct,new O({type:"array",schema:jt,*entries(t){if(jt&&Array.isArray(t))for(const[e,n]of t.entries())yield[e,n,jt]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${C(t)}`}))]);var jt,Ft,Nt;wt({id:Rt,jsonrpc:It,method:B(),params:kt(Pt)}),wt({jsonrpc:It,method:B(),params:kt(Pt)}),N({id:Rt,jsonrpc:It,result:z(F("unknown",(()=>!0))),error:z(Tt)});L([wt({id:Rt,jsonrpc:It,result:Ct}),wt({id:Rt,jsonrpc:It,error:Tt})]);function zt(t){let e=t.length;for(;--e>=0;)t[e]=0}const Bt=256,Lt=286,Ut=30,Dt=15,qt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$t=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Wt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Zt=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ht=new Array(576);zt(Ht);const Gt=new Array(60);zt(Gt);const Jt=new Array(512);zt(Jt);const Vt=new Array(256);zt(Vt);const Kt=new Array(29);zt(Kt);const Qt=new Array(Ut);function Xt(t,e,n,r,i){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=t&&t.length}let Yt,te,ee;function ne(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}zt(Qt);const re=t=>t<256?Jt[t]:Jt[256+(t>>>7)],ie=(t,e)=>{t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},se=(t,e,n)=>{t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,ie(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)},oe=(t,e,n)=>{se(t,n[2*e],n[2*e+1])},ae=(t,e)=>{let n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1},ue=(t,e,n)=>{const r=new Array(16);let i,s,o=0;for(i=1;i<=Dt;i++)o=o+n[i-1]<<1,r[i]=o;for(s=0;s<=e;s++){let e=t[2*s+1];0!==e&&(t[2*s]=ae(r[e]++,e))}},ce=t=>{let e;for(e=0;e<Lt;e++)t.dyn_ltree[2*e]=0;for(e=0;e<Ut;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},le=t=>{t.bi_valid>8?ie(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},de=(t,e,n,r)=>{const i=2*e,s=2*n;return t[i]<t[s]||t[i]===t[s]&&r[e]<=r[n]},he=(t,e,n)=>{const r=t.heap[n];let i=n<<1;for(;i<=t.heap_len&&(i<t.heap_len&&de(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!de(e,r,t.heap[i],t.depth));)t.heap[n]=t.heap[i],n=i,i<<=1;t.heap[n]=r},fe=(t,e,n)=>{let r,i,s,o,a=0;if(0!==t.sym_next)do{r=255&t.pending_buf[t.sym_buf+a++],r+=(255&t.pending_buf[t.sym_buf+a++])<<8,i=t.pending_buf[t.sym_buf+a++],0===r?oe(t,i,e):(s=Vt[i],oe(t,s+Bt+1,e),o=qt[s],0!==o&&(i-=Kt[s],se(t,i,o)),r--,s=re(r),oe(t,s,n),o=$t[s],0!==o&&(r-=Qt[s],se(t,r,o)))}while(a<t.sym_next);oe(t,256,e)},pe=(t,e)=>{const n=e.dyn_tree,r=e.stat_desc.static_tree,i=e.stat_desc.has_stree,s=e.stat_desc.elems;let o,a,u,c=-1;for(t.heap_len=0,t.heap_max=573,o=0;o<s;o++)0!==n[2*o]?(t.heap[++t.heap_len]=c=o,t.depth[o]=0):n[2*o+1]=0;for(;t.heap_len<2;)u=t.heap[++t.heap_len]=c<2?++c:0,n[2*u]=1,t.depth[u]=0,t.opt_len--,i&&(t.static_len-=r[2*u+1]);for(e.max_code=c,o=t.heap_len>>1;o>=1;o--)he(t,n,o);u=s;do{o=t.heap[1],t.heap[1]=t.heap[t.heap_len--],he(t,n,1),a=t.heap[1],t.heap[--t.heap_max]=o,t.heap[--t.heap_max]=a,n[2*u]=n[2*o]+n[2*a],t.depth[u]=(t.depth[o]>=t.depth[a]?t.depth[o]:t.depth[a])+1,n[2*o+1]=n[2*a+1]=u,t.heap[1]=u++,he(t,n,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],((t,e)=>{const n=e.dyn_tree,r=e.max_code,i=e.stat_desc.static_tree,s=e.stat_desc.has_stree,o=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,u=e.stat_desc.max_length;let c,l,d,h,f,p,m=0;for(h=0;h<=Dt;h++)t.bl_count[h]=0;for(n[2*t.heap[t.heap_max]+1]=0,c=t.heap_max+1;c<573;c++)l=t.heap[c],h=n[2*n[2*l+1]+1]+1,h>u&&(h=u,m++),n[2*l+1]=h,l>r||(t.bl_count[h]++,f=0,l>=a&&(f=o[l-a]),p=n[2*l],t.opt_len+=p*(h+f),s&&(t.static_len+=p*(i[2*l+1]+f)));if(0!==m){do{for(h=u-1;0===t.bl_count[h];)h--;t.bl_count[h]--,t.bl_count[h+1]+=2,t.bl_count[u]--,m-=2}while(m>0);for(h=u;0!==h;h--)for(l=t.bl_count[h];0!==l;)d=t.heap[--c],d>r||(n[2*d+1]!==h&&(t.opt_len+=(h-n[2*d+1])*n[2*d],n[2*d+1]=h),l--)}})(t,e),ue(n,c,t.bl_count)},me=(t,e,n)=>{let r,i,s=-1,o=e[1],a=0,u=7,c=4;for(0===o&&(u=138,c=3),e[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=e[2*(r+1)+1],++a<u&&i===o||(a<c?t.bl_tree[2*i]+=a:0!==i?(i!==s&&t.bl_tree[2*i]++,t.bl_tree[32]++):a<=10?t.bl_tree[34]++:t.bl_tree[36]++,a=0,s=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4))},ge=(t,e,n)=>{let r,i,s=-1,o=e[1],a=0,u=7,c=4;for(0===o&&(u=138,c=3),r=0;r<=n;r++)if(i=o,o=e[2*(r+1)+1],!(++a<u&&i===o)){if(a<c)do{oe(t,i,t.bl_tree)}while(0!=--a);else 0!==i?(i!==s&&(oe(t,i,t.bl_tree),a--),oe(t,16,t.bl_tree),se(t,a-3,2)):a<=10?(oe(t,17,t.bl_tree),se(t,a-3,3)):(oe(t,18,t.bl_tree),se(t,a-11,7));a=0,s=i,0===o?(u=138,c=3):i===o?(u=6,c=3):(u=7,c=4)}};let _e=!1;const ve=(t,e,n,r)=>{se(t,0+(r?1:0),3),le(t),ie(t,n),ie(t,~n),n&&t.pending_buf.set(t.window.subarray(e,e+n),t.pending),t.pending+=n};var ye=(t,e,n,r)=>{let i,s,o=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=(t=>{let e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<Bt;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0})(t)),pe(t,t.l_desc),pe(t,t.d_desc),o=(t=>{let e;for(me(t,t.dyn_ltree,t.l_desc.max_code),me(t,t.dyn_dtree,t.d_desc.max_code),pe(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*Zt[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e})(t),i=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?ve(t,e,n,r):4===t.strategy||s===i?(se(t,2+(r?1:0),3),fe(t,Ht,Gt)):(se(t,4+(r?1:0),3),((t,e,n,r)=>{let i;for(se(t,e-257,5),se(t,n-1,5),se(t,r-4,4),i=0;i<r;i++)se(t,t.bl_tree[2*Zt[i]+1],3);ge(t,t.dyn_ltree,e-1),ge(t,t.dyn_dtree,n-1)})(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),fe(t,t.dyn_ltree,t.dyn_dtree)),ce(t),r&&le(t)},we={_tr_init:t=>{_e||((()=>{let t,e,n,r,i;const s=new Array(16);for(n=0,r=0;r<28;r++)for(Kt[r]=n,t=0;t<1<<qt[r];t++)Vt[n++]=r;for(Vt[n-1]=r,i=0,r=0;r<16;r++)for(Qt[r]=i,t=0;t<1<<$t[r];t++)Jt[i++]=r;for(i>>=7;r<Ut;r++)for(Qt[r]=i<<7,t=0;t<1<<$t[r]-7;t++)Jt[256+i++]=r;for(e=0;e<=Dt;e++)s[e]=0;for(t=0;t<=143;)Ht[2*t+1]=8,t++,s[8]++;for(;t<=255;)Ht[2*t+1]=9,t++,s[9]++;for(;t<=279;)Ht[2*t+1]=7,t++,s[7]++;for(;t<=287;)Ht[2*t+1]=8,t++,s[8]++;for(ue(Ht,287,s),t=0;t<Ut;t++)Gt[2*t+1]=5,Gt[2*t]=ae(t,5);Yt=new Xt(Ht,qt,257,Lt,Dt),te=new Xt(Gt,$t,0,Ut,Dt),ee=new Xt(new Array(0),Wt,0,19,7)})(),_e=!0),t.l_desc=new ne(t.dyn_ltree,Yt),t.d_desc=new ne(t.dyn_dtree,te),t.bl_desc=new ne(t.bl_tree,ee),t.bi_buf=0,t.bi_valid=0,ce(t)},_tr_stored_block:ve,_tr_flush_block:ye,_tr_tally:(t,e,n)=>(t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=n,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(Vt[n]+Bt+1)]++,t.dyn_dtree[2*re(e)]++),t.sym_next===t.sym_end),_tr_align:t=>{se(t,2,3),oe(t,256,Ht),(t=>{16===t.bi_valid?(ie(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)})(t)}};var be=(t,e,n,r)=>{let i=65535&t|0,s=t>>>16&65535|0,o=0;for(;0!==n;){o=n>2e3?2e3:n,n-=o;do{i=i+e[r++]|0,s=s+i|0}while(--o);i%=65521,s%=65521}return i|s<<16|0};const ke=new Uint32Array((()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e})());var Ee=(t,e,n,r)=>{const i=ke,s=r+n;t^=-1;for(let n=r;n<s;n++)t=t>>>8^i[255&(t^e[n])];return-1^t},Ae={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ce={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Se,_tr_stored_block:xe,_tr_flush_block:Me,_tr_tally:Oe,_tr_align:Ie}=we,{Z_NO_FLUSH:Re,Z_PARTIAL_FLUSH:Te,Z_FULL_FLUSH:Pe,Z_FINISH:je,Z_BLOCK:Fe,Z_OK:Ne,Z_STREAM_END:ze,Z_STREAM_ERROR:Be,Z_DATA_ERROR:Le,Z_BUF_ERROR:Ue,Z_DEFAULT_COMPRESSION:De,Z_FILTERED:qe,Z_HUFFMAN_ONLY:$e,Z_RLE:We,Z_FIXED:Ze,Z_DEFAULT_STRATEGY:He,Z_UNKNOWN:Ge,Z_DEFLATED:Je}=Ce,Ve=258,Ke=262,Qe=42,Xe=113,Ye=666,tn=(t,e)=>(t.msg=Ae[e],e),en=t=>2*t-(t>4?9:0),nn=t=>{let e=t.length;for(;--e>=0;)t[e]=0},rn=t=>{let e,n,r,i=t.w_size;e=t.hash_size,r=e;do{n=t.head[--r],t.head[r]=n>=i?n-i:0}while(--e);e=i,r=e;do{n=t.prev[--r],t.prev[r]=n>=i?n-i:0}while(--e)};let sn=(t,e,n)=>(e<<t.hash_shift^n)&t.hash_mask;const on=t=>{const e=t.state;let n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+n),t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))},an=(t,e)=>{Me(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,on(t.strm)},un=(t,e)=>{t.pending_buf[t.pending++]=e},cn=(t,e)=>{t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},ln=(t,e,n,r)=>{let i=t.avail_in;return i>r&&(i=r),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),n),1===t.state.wrap?t.adler=be(t.adler,e,i,n):2===t.state.wrap&&(t.adler=Ee(t.adler,e,i,n)),t.next_in+=i,t.total_in+=i,i)},dn=(t,e)=>{let n,r,i=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match;const u=t.strstart>t.w_size-Ke?t.strstart-(t.w_size-Ke):0,c=t.window,l=t.w_mask,d=t.prev,h=t.strstart+Ve;let f=c[s+o-1],p=c[s+o];t.prev_length>=t.good_match&&(i>>=2),a>t.lookahead&&(a=t.lookahead);do{if(n=e,c[n+o]===p&&c[n+o-1]===f&&c[n]===c[s]&&c[++n]===c[s+1]){s+=2,n++;do{}while(c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&c[++s]===c[++n]&&s<h);if(r=Ve-(h-s),s=h-Ve,r>o){if(t.match_start=e,o=r,r>=a)break;f=c[s+o-1],p=c[s+o]}}}while((e=d[e&l])>u&&0!=--i);return o<=t.lookahead?o:t.lookahead},hn=t=>{const e=t.w_size;let n,r,i;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Ke)&&(t.window.set(t.window.subarray(e,e+e-r),0),t.match_start-=e,t.strstart-=e,t.block_start-=e,t.insert>t.strstart&&(t.insert=t.strstart),rn(t),r+=e),0===t.strm.avail_in)break;if(n=ln(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=n,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=sn(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=sn(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Ke&&0!==t.strm.avail_in)},fn=(t,e)=>{let n,r,i,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(n=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,r=t.strstart-t.block_start,n>r+t.strm.avail_in&&(n=r+t.strm.avail_in),n>i&&(n=i),n<s&&(0===n&&e!==je||e===Re||n!==r+t.strm.avail_in))break;o=e===je&&n===r+t.strm.avail_in?1:0,xe(t,0,0,o),t.pending_buf[t.pending-4]=n,t.pending_buf[t.pending-3]=n>>8,t.pending_buf[t.pending-2]=~n,t.pending_buf[t.pending-1]=~n>>8,on(t.strm),r&&(r>n&&(r=n),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+r),t.strm.next_out),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r,t.block_start+=r,n-=r),n&&(ln(t.strm,t.strm.output,t.strm.next_out,n),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n)}while(0===o);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),o?4:e!==Re&&e!==je&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(ln(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i,s=i>t.w_size?t.w_size:i,r=t.strstart-t.block_start,(r>=s||(r||e===je)&&e!==Re&&0===t.strm.avail_in&&r<=i)&&(n=r>i?i:r,o=e===je&&0===t.strm.avail_in&&n===r?1:0,xe(t,t.block_start,n,o),t.block_start+=n,on(t.strm)),o?3:1)},pn=(t,e)=>{let n,r;for(;;){if(t.lookahead<Ke){if(hn(t),t.lookahead<Ke&&e===Re)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=sn(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Ke&&(t.match_length=dn(t,n)),t.match_length>=3)if(r=Oe(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=sn(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=sn(t,t.ins_h,t.window[t.strstart+1]);else r=Oe(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(r&&(an(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===je?(an(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(an(t,!1),0===t.strm.avail_out)?1:2},mn=(t,e)=>{let n,r,i;for(;;){if(t.lookahead<Ke){if(hn(t),t.lookahead<Ke&&e===Re)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=sn(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Ke&&(t.match_length=dn(t,n),t.match_length<=5&&(t.strategy===qe||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,r=Oe(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=sn(t,t.ins_h,t.window[t.strstart+3-1]),n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,r&&(an(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if(r=Oe(t,0,t.window[t.strstart-1]),r&&an(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(r=Oe(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===je?(an(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(an(t,!1),0===t.strm.avail_out)?1:2};function gn(t,e,n,r,i){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=r,this.func=i}const _n=[new gn(0,0,0,0,fn),new gn(4,4,8,4,pn),new gn(4,5,16,8,pn),new gn(4,6,32,32,pn),new gn(4,4,16,16,mn),new gn(8,16,32,32,mn),new gn(8,16,128,128,mn),new gn(8,32,128,256,mn),new gn(32,128,258,1024,mn),new gn(32,258,258,4096,mn)];function vn(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Je,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),nn(this.dyn_ltree),nn(this.dyn_dtree),nn(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),nn(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),nn(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const yn=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.status!==Qe&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==Xe&&e.status!==Ye?1:0},wn=t=>{if(yn(t))return tn(t,Be);t.total_in=t.total_out=0,t.data_type=Ge;const e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?Qe:Xe,t.adler=2===e.wrap?0:1,e.last_flush=-2,Se(e),Ne},bn=t=>{const e=wn(t);var n;return e===Ne&&((n=t.state).window_size=2*n.w_size,nn(n.head),n.max_lazy_match=_n[n.level].max_lazy,n.good_match=_n[n.level].good_length,n.nice_match=_n[n.level].nice_length,n.max_chain_length=_n[n.level].max_chain,n.strstart=0,n.block_start=0,n.lookahead=0,n.insert=0,n.match_length=n.prev_length=2,n.match_available=0,n.ins_h=0),e},kn=(t,e,n,r,i,s)=>{if(!t)return Be;let o=1;if(e===De&&(e=6),r<0?(o=0,r=-r):r>15&&(o=2,r-=16),i<1||i>9||n!==Je||r<8||r>15||e<0||e>9||s<0||s>Ze||8===r&&1!==o)return tn(t,Be);8===r&&(r=9);const a=new vn;return t.state=a,a.strm=t,a.status=Qe,a.wrap=o,a.gzhead=null,a.w_bits=r,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=i+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+3-1)/3),a.window=new Uint8Array(2*a.w_size),a.head=new Uint16Array(a.hash_size),a.prev=new Uint16Array(a.w_size),a.lit_bufsize=1<<i+6,a.pending_buf_size=4*a.lit_bufsize,a.pending_buf=new Uint8Array(a.pending_buf_size),a.sym_buf=a.lit_bufsize,a.sym_end=3*(a.lit_bufsize-1),a.level=e,a.strategy=s,a.method=n,bn(t)};var En={deflateInit:(t,e)=>kn(t,e,Je,15,8,He),deflateInit2:kn,deflateReset:bn,deflateResetKeep:wn,deflateSetHeader:(t,e)=>yn(t)||2!==t.state.wrap?Be:(t.state.gzhead=e,Ne),deflate:(t,e)=>{if(yn(t)||e>Fe||e<0)return t?tn(t,Be):Be;const n=t.state;if(!t.output||0!==t.avail_in&&!t.input||n.status===Ye&&e!==je)return tn(t,0===t.avail_out?Ue:Be);const r=n.last_flush;if(n.last_flush=e,0!==n.pending){if(on(t),0===t.avail_out)return n.last_flush=-1,Ne}else if(0===t.avail_in&&en(e)<=en(r)&&e!==je)return tn(t,Ue);if(n.status===Ye&&0!==t.avail_in)return tn(t,Ue);if(n.status===Qe&&0===n.wrap&&(n.status=Xe),n.status===Qe){let e=Je+(n.w_bits-8<<4)<<8,r=-1;if(r=n.strategy>=$e||n.level<2?0:n.level<6?1:6===n.level?2:3,e|=r<<6,0!==n.strstart&&(e|=32),e+=31-e%31,cn(n,e),0!==n.strstart&&(cn(n,t.adler>>>16),cn(n,65535&t.adler)),t.adler=1,n.status=Xe,on(t),0!==n.pending)return n.last_flush=-1,Ne}if(57===n.status)if(t.adler=0,un(n,31),un(n,139),un(n,8),n.gzhead)un(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),un(n,255&n.gzhead.time),un(n,n.gzhead.time>>8&255),un(n,n.gzhead.time>>16&255),un(n,n.gzhead.time>>24&255),un(n,9===n.level?2:n.strategy>=$e||n.level<2?4:0),un(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(un(n,255&n.gzhead.extra.length),un(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Ee(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(un(n,0),un(n,0),un(n,0),un(n,0),un(n,0),un(n,9===n.level?2:n.strategy>=$e||n.level<2?4:0),un(n,3),n.status=Xe,on(t),0!==n.pending)return n.last_flush=-1,Ne;if(69===n.status){if(n.gzhead.extra){let e=n.pending,r=(65535&n.gzhead.extra.length)-n.gzindex;for(;n.pending+r>n.pending_buf_size;){let i=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+i),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>e&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex+=i,on(t),0!==n.pending)return n.last_flush=-1,Ne;e=0,r-=i}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+r),n.pending),n.pending+=r,n.gzhead.hcrc&&n.pending>e&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-e,e)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-r,r)),on(t),0!==n.pending)return n.last_flush=-1,Ne;r=0}e=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,un(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-r,r)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){let e,r=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>r&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-r,r)),on(t),0!==n.pending)return n.last_flush=-1,Ne;r=0}e=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,un(n,e)}while(0!==e);n.gzhead.hcrc&&n.pending>r&&(t.adler=Ee(t.adler,n.pending_buf,n.pending-r,r))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(on(t),0!==n.pending))return n.last_flush=-1,Ne;un(n,255&t.adler),un(n,t.adler>>8&255),t.adler=0}if(n.status=Xe,on(t),0!==n.pending)return n.last_flush=-1,Ne}if(0!==t.avail_in||0!==n.lookahead||e!==Re&&n.status!==Ye){let r=0===n.level?fn(n,e):n.strategy===$e?((t,e)=>{let n;for(;;){if(0===t.lookahead&&(hn(t),0===t.lookahead)){if(e===Re)return 1;break}if(t.match_length=0,n=Oe(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(an(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===je?(an(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(an(t,!1),0===t.strm.avail_out)?1:2})(n,e):n.strategy===We?((t,e)=>{let n,r,i,s;const o=t.window;for(;;){if(t.lookahead<=Ve){if(hn(t),t.lookahead<=Ve&&e===Re)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=t.strstart-1,r=o[i],r===o[++i]&&r===o[++i]&&r===o[++i])){s=t.strstart+Ve;do{}while(r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&r===o[++i]&&i<s);t.match_length=Ve-(s-i),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=Oe(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=Oe(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(an(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===je?(an(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(an(t,!1),0===t.strm.avail_out)?1:2})(n,e):_n[n.level].func(n,e);if(3!==r&&4!==r||(n.status=Ye),1===r||3===r)return 0===t.avail_out&&(n.last_flush=-1),Ne;if(2===r&&(e===Te?Ie(n):e!==Fe&&(xe(n,0,0,!1),e===Pe&&(nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),on(t),0===t.avail_out))return n.last_flush=-1,Ne}return e!==je?Ne:n.wrap<=0?ze:(2===n.wrap?(un(n,255&t.adler),un(n,t.adler>>8&255),un(n,t.adler>>16&255),un(n,t.adler>>24&255),un(n,255&t.total_in),un(n,t.total_in>>8&255),un(n,t.total_in>>16&255),un(n,t.total_in>>24&255)):(cn(n,t.adler>>>16),cn(n,65535&t.adler)),on(t),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?Ne:ze)},deflateEnd:t=>{if(yn(t))return Be;const e=t.state.status;return t.state=null,e===Xe?tn(t,Le):Ne},deflateSetDictionary:(t,e)=>{let n=e.length;if(yn(t))return Be;const r=t.state,i=r.wrap;if(2===i||1===i&&r.status!==Qe||r.lookahead)return Be;if(1===i&&(t.adler=be(t.adler,e,n,0)),r.wrap=0,n>=r.w_size){0===i&&(nn(r.head),r.strstart=0,r.block_start=0,r.insert=0);let t=new Uint8Array(r.w_size);t.set(e.subarray(n-r.w_size,n),0),e=t,n=r.w_size}const s=t.avail_in,o=t.next_in,a=t.input;for(t.avail_in=n,t.next_in=0,t.input=e,hn(r);r.lookahead>=3;){let t=r.strstart,e=r.lookahead-2;do{r.ins_h=sn(r,r.ins_h,r.window[t+3-1]),r.prev[t&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=t,t++}while(--e);r.strstart=t,r.lookahead=2,hn(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,t.next_in=o,t.input=a,t.avail_in=s,r.wrap=i,Ne},deflateInfo:"pako deflate (from Nodeca project)"};const An=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Cn={assign:function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(const e in n)An(n,e)&&(t[e]=n[e])}}return t},flattenChunks:t=>{let e=0;for(let n=0,r=t.length;n<r;n++)e+=t[n].length;const n=new Uint8Array(e);for(let e=0,r=0,i=t.length;e<i;e++){let i=t[e];n.set(i,r),r+=i.length}return n}};let Sn=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Sn=!1}const xn=new Uint8Array(256);for(let t=0;t<256;t++)xn[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;xn[254]=xn[254]=1;var Mn={string2buf:t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,n,r,i,s,o=t.length,a=0;for(i=0;i<o;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<o&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),a+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(a),s=0,i=0;s<a;i++)n=t.charCodeAt(i),55296==(64512&n)&&i+1<o&&(r=t.charCodeAt(i+1),56320==(64512&r)&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},buf2string:(t,e)=>{const n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let r,i;const s=new Array(2*n);for(i=0,r=0;r<n;){let e=t[r++];if(e<128){s[i++]=e;continue}let o=xn[e];if(o>4)s[i++]=65533,r+=o-1;else{for(e&=2===o?31:3===o?15:7;o>1&&r<n;)e=e<<6|63&t[r++],o--;o>1?s[i++]=65533:e<65536?s[i++]=e:(e-=65536,s[i++]=55296|e>>10&1023,s[i++]=56320|1023&e)}}return((t,e)=>{if(e<65534&&t.subarray&&Sn)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n})(s,i)},utf8border:(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let n=e-1;for(;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+xn[t[n]]>e?n:e}};var On=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const In=Object.prototype.toString,{Z_NO_FLUSH:Rn,Z_SYNC_FLUSH:Tn,Z_FULL_FLUSH:Pn,Z_FINISH:jn,Z_OK:Fn,Z_STREAM_END:Nn,Z_DEFAULT_COMPRESSION:zn,Z_DEFAULT_STRATEGY:Bn,Z_DEFLATED:Ln}=Ce;function Un(t){this.options=Cn.assign({level:zn,method:Ln,chunkSize:16384,windowBits:15,memLevel:8,strategy:Bn},t||{});let e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new On,this.strm.avail_out=0;let n=En.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==Fn)throw new Error(Ae[n]);if(e.header&&En.deflateSetHeader(this.strm,e.header),e.dictionary){let t;if(t="string"==typeof e.dictionary?Mn.string2buf(e.dictionary):"[object ArrayBuffer]"===In.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,n=En.deflateSetDictionary(this.strm,t),n!==Fn)throw new Error(Ae[n]);this._dict_set=!0}}function Dn(t,e){const n=new Un(e);if(n.push(t,!0),n.err)throw n.msg||Ae[n.err];return n.result}Un.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize;let i,s;if(this.ended)return!1;for(s=e===~~e?e:!0===e?jn:Rn,"string"==typeof t?n.input=Mn.string2buf(t):"[object ArrayBuffer]"===In.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(s===Tn||s===Pn)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(i=En.deflate(n,s),i===Nn)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=En.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Fn;if(0!==n.avail_out){if(s>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Un.prototype.onData=function(t){this.chunks.push(t)},Un.prototype.onEnd=function(t){t===Fn&&(this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var qn={Deflate:Un,deflate:Dn,deflateRaw:function(t,e){return(e=e||{}).raw=!0,Dn(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,Dn(t,e)},constants:Ce};const $n=16209;var Wn=function(t,e){let n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_,v,y,w,b,k,E,A,C;const S=t.state;n=t.next_in,A=t.input,r=n+(t.avail_in-5),i=t.next_out,C=t.output,s=i-(e-t.avail_out),o=i+(t.avail_out-257),a=S.dmax,u=S.wsize,c=S.whave,l=S.wnext,d=S.window,h=S.hold,f=S.bits,p=S.lencode,m=S.distcode,g=(1<<S.lenbits)-1,_=(1<<S.distbits)-1;t:do{f<15&&(h+=A[n++]<<f,f+=8,h+=A[n++]<<f,f+=8),v=p[h&g];e:for(;;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,0===y)C[i++]=65535&v;else{if(!(16&y)){if(0==(64&y)){v=p[(65535&v)+(h&(1<<y)-1)];continue e}if(32&y){S.mode=16191;break t}t.msg="invalid literal/length code",S.mode=$n;break t}w=65535&v,y&=15,y&&(f<y&&(h+=A[n++]<<f,f+=8),w+=h&(1<<y)-1,h>>>=y,f-=y),f<15&&(h+=A[n++]<<f,f+=8,h+=A[n++]<<f,f+=8),v=m[h&_];n:for(;;){if(y=v>>>24,h>>>=y,f-=y,y=v>>>16&255,!(16&y)){if(0==(64&y)){v=m[(65535&v)+(h&(1<<y)-1)];continue n}t.msg="invalid distance code",S.mode=$n;break t}if(b=65535&v,y&=15,f<y&&(h+=A[n++]<<f,f+=8,f<y&&(h+=A[n++]<<f,f+=8)),b+=h&(1<<y)-1,b>a){t.msg="invalid distance too far back",S.mode=$n;break t}if(h>>>=y,f-=y,y=i-s,b>y){if(y=b-y,y>c&&S.sane){t.msg="invalid distance too far back",S.mode=$n;break t}if(k=0,E=d,0===l){if(k+=u-y,y<w){w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}}else if(l<y){if(k+=u+l-y,y-=l,y<w){w-=y;do{C[i++]=d[k++]}while(--y);if(k=0,l<w){y=l,w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}}}else if(k+=l-y,y<w){w-=y;do{C[i++]=d[k++]}while(--y);k=i-b,E=C}for(;w>2;)C[i++]=E[k++],C[i++]=E[k++],C[i++]=E[k++],w-=3;w&&(C[i++]=E[k++],w>1&&(C[i++]=E[k++]))}else{k=i-b;do{C[i++]=C[k++],C[i++]=C[k++],C[i++]=C[k++],w-=3}while(w>2);w&&(C[i++]=C[k++],w>1&&(C[i++]=C[k++]))}break}}break}}while(n<r&&i<o);w=f>>3,n-=w,f-=w<<3,h&=(1<<f)-1,t.next_in=n,t.next_out=i,t.avail_in=n<r?r-n+5:5-(n-r),t.avail_out=i<o?o-i+257:257-(i-o),S.hold=h,S.bits=f};const Zn=15,Hn=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Gn=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Jn=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Vn=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Kn=(t,e,n,r,i,s,o,a)=>{const u=a.bits;let c,l,d,h,f,p,m=0,g=0,_=0,v=0,y=0,w=0,b=0,k=0,E=0,A=0,C=null;const S=new Uint16Array(16),x=new Uint16Array(16);let M,O,I,R=null;for(m=0;m<=Zn;m++)S[m]=0;for(g=0;g<r;g++)S[e[n+g]]++;for(y=u,v=Zn;v>=1&&0===S[v];v--);if(y>v&&(y=v),0===v)return i[s++]=20971520,i[s++]=20971520,a.bits=1,0;for(_=1;_<v&&0===S[_];_++);for(y<_&&(y=_),k=1,m=1;m<=Zn;m++)if(k<<=1,k-=S[m],k<0)return-1;if(k>0&&(0===t||1!==v))return-1;for(x[1]=0,m=1;m<Zn;m++)x[m+1]=x[m]+S[m];for(g=0;g<r;g++)0!==e[n+g]&&(o[x[e[n+g]]++]=g);if(0===t?(C=R=o,p=20):1===t?(C=Hn,R=Gn,p=257):(C=Jn,R=Vn,p=0),A=0,g=0,m=_,f=s,w=y,b=0,d=-1,E=1<<y,h=E-1,1===t&&E>852||2===t&&E>592)return 1;for(;;){M=m-b,o[g]+1<p?(O=0,I=o[g]):o[g]>=p?(O=R[o[g]-p],I=C[o[g]-p]):(O=96,I=0),c=1<<m-b,l=1<<w,_=l;do{l-=c,i[f+(A>>b)+l]=M<<24|O<<16|I|0}while(0!==l);for(c=1<<m-1;A&c;)c>>=1;if(0!==c?(A&=c-1,A+=c):A=0,g++,0==--S[m]){if(m===v)break;m=e[n+o[g]]}if(m>y&&(A&h)!==d){for(0===b&&(b=y),f+=_,w=m-b,k=1<<w;w+b<v&&(k-=S[w+b],!(k<=0));)w++,k<<=1;if(E+=1<<w,1===t&&E>852||2===t&&E>592)return 1;d=A&h,i[d]=y<<24|w<<16|f-s|0}}return 0!==A&&(i[f+A]=m-b<<24|64<<16|0),a.bits=y,0};const{Z_FINISH:Qn,Z_BLOCK:Xn,Z_TREES:Yn,Z_OK:tr,Z_STREAM_END:er,Z_NEED_DICT:nr,Z_STREAM_ERROR:rr,Z_DATA_ERROR:ir,Z_MEM_ERROR:sr,Z_BUF_ERROR:or,Z_DEFLATED:ar}=Ce,ur=16180,cr=16190,lr=16191,dr=16192,hr=16194,fr=16199,pr=16200,mr=16206,gr=16209,_r=t=>(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24);function vr(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const yr=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<ur||e.mode>16211?1:0},wr=t=>{if(yr(t))return rr;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=ur,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,tr},br=t=>{if(yr(t))return rr;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,wr(t)},kr=(t,e)=>{let n;if(yr(t))return rr;const r=t.state;return e<0?(n=0,e=-e):(n=5+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?rr:(null!==r.window&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,br(t))},Er=(t,e)=>{if(!t)return rr;const n=new vr;t.state=n,n.strm=t,n.window=null,n.mode=ur;const r=kr(t,e);return r!==tr&&(t.state=null),r};let Ar,Cr,Sr=!0;const xr=t=>{if(Sr){Ar=new Int32Array(512),Cr=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Kn(1,t.lens,0,288,Ar,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Kn(2,t.lens,0,32,Cr,0,t.work,{bits:5}),Sr=!1}t.lencode=Ar,t.lenbits=9,t.distcode=Cr,t.distbits=5},Mr=(t,e,n,r)=>{let i;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(i=s.wsize-s.wnext,i>r&&(i=r),s.window.set(e.subarray(n-r,n-r+i),s.wnext),(r-=i)?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=i,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=i))),0};var Or=(t,e)=>{let n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_,v,y,w,b,k,E,A=0;const C=new Uint8Array(4);let S,x;const M=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(yr(t)||!t.output||!t.input&&0!==t.avail_in)return rr;n=t.state,n.mode===lr&&(n.mode=dr),o=t.next_out,i=t.output,u=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,c=n.hold,l=n.bits,d=a,h=u,E=tr;t:for(;;)switch(n.mode){case ur:if(0===n.wrap){n.mode=dr;break}for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(2&n.wrap&&35615===c){0===n.wbits&&(n.wbits=15),n.check=0,C[0]=255&c,C[1]=c>>>8&255,n.check=Ee(n.check,C,2,0),c=0,l=0,n.mode=16181;break}if(n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",n.mode=gr;break}if((15&c)!==ar){t.msg="unknown compression method",n.mode=gr;break}if(c>>>=4,l-=4,k=8+(15&c),0===n.wbits&&(n.wbits=k),k>15||k>n.wbits){t.msg="invalid window size",n.mode=gr;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=512&c?16189:lr,c=0,l=0;break;case 16181:for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(n.flags=c,(255&n.flags)!==ar){t.msg="unknown compression method",n.mode=gr;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=gr;break}n.head&&(n.head.text=c>>8&1),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Ee(n.check,C,2,0)),c=0,l=0,n.mode=16182;case 16182:for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,n.check=Ee(n.check,C,4,0)),c=0,l=0,n.mode=16183;case 16183:for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Ee(n.check,C,2,0)),c=0,l=0,n.mode=16184;case 16184:if(1024&n.flags){for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&4&n.wrap&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Ee(n.check,C,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=16185;case 16185:if(1024&n.flags&&(f=n.length,f>a&&(f=a),f&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+f),k)),512&n.flags&&4&n.wrap&&(n.check=Ee(n.check,r,f,s)),a-=f,s+=f,n.length-=f),n.length))break t;n.length=0,n.mode=16186;case 16186:if(2048&n.flags){if(0===a)break t;f=0;do{k=r[s+f++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=Ee(n.check,r,f,s)),a-=f,s+=f,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=16187;case 16187:if(4096&n.flags){if(0===a)break t;f=0;do{k=r[s+f++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k))}while(k&&f<a);if(512&n.flags&&4&n.wrap&&(n.check=Ee(n.check,r,f,s)),a-=f,s+=f,k)break t}else n.head&&(n.head.comment=null);n.mode=16188;case 16188:if(512&n.flags){for(;l<16;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(4&n.wrap&&c!==(65535&n.check)){t.msg="header crc mismatch",n.mode=gr;break}c=0,l=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=lr;break;case 16189:for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}t.adler=n.check=_r(c),c=0,l=0,n.mode=cr;case cr:if(0===n.havedict)return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,nr;t.adler=n.check=1,n.mode=lr;case lr:if(e===Xn||e===Yn)break t;case dr:if(n.last){c>>>=7&l,l-=7&l,n.mode=mr;break}for(;l<3;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}switch(n.last=1&c,c>>>=1,l-=1,3&c){case 0:n.mode=16193;break;case 1:if(xr(n),n.mode=fr,e===Yn){c>>>=2,l-=2;break t}break;case 2:n.mode=16196;break;case 3:t.msg="invalid block type",n.mode=gr}c>>>=2,l-=2;break;case 16193:for(c>>>=7&l,l-=7&l;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",n.mode=gr;break}if(n.length=65535&c,c=0,l=0,n.mode=hr,e===Yn)break t;case hr:n.mode=16195;case 16195:if(f=n.length,f){if(f>a&&(f=a),f>u&&(f=u),0===f)break t;i.set(r.subarray(s,s+f),o),a-=f,s+=f,u-=f,o+=f,n.length-=f;break}n.mode=lr;break;case 16196:for(;l<14;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=gr;break}n.have=0,n.mode=16197;case 16197:for(;n.have<n.ncode;){for(;l<3;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.lens[M[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[M[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,S={bits:n.lenbits},E=Kn(0,n.lens,0,19,n.lencode,0,n.work,S),n.lenbits=S.bits,E){t.msg="invalid code lengths set",n.mode=gr;break}n.have=0,n.mode=16198;case 16198:for(;n.have<n.nlen+n.ndist;){for(;A=n.lencode[c&(1<<n.lenbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(v<16)c>>>=g,l-=g,n.lens[n.have++]=v;else{if(16===v){for(x=g+2;l<x;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(c>>>=g,l-=g,0===n.have){t.msg="invalid bit length repeat",n.mode=gr;break}k=n.lens[n.have-1],f=3+(3&c),c>>>=2,l-=2}else if(17===v){for(x=g+3;l<x;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=g,l-=g,k=0,f=3+(7&c),c>>>=3,l-=3}else{for(x=g+7;l<x;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=g,l-=g,k=0,f=11+(127&c),c>>>=7,l-=7}if(n.have+f>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=gr;break}for(;f--;)n.lens[n.have++]=k}}if(n.mode===gr)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=gr;break}if(n.lenbits=9,S={bits:n.lenbits},E=Kn(1,n.lens,0,n.nlen,n.lencode,0,n.work,S),n.lenbits=S.bits,E){t.msg="invalid literal/lengths set",n.mode=gr;break}if(n.distbits=6,n.distcode=n.distdyn,S={bits:n.distbits},E=Kn(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,S),n.distbits=S.bits,E){t.msg="invalid distances set",n.mode=gr;break}if(n.mode=fr,e===Yn)break t;case fr:n.mode=pr;case pr:if(a>=6&&u>=258){t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,Wn(t,h),o=t.next_out,i=t.output,u=t.avail_out,s=t.next_in,r=t.input,a=t.avail_in,c=n.hold,l=n.bits,n.mode===lr&&(n.back=-1);break}for(n.back=0;A=n.lencode[c&(1<<n.lenbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(_&&0==(240&_)){for(y=g,w=_,b=v;A=n.lencode[b+((c&(1<<y+w)-1)>>y)],g=A>>>24,_=A>>>16&255,v=65535&A,!(y+g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,n.length=v,0===_){n.mode=16205;break}if(32&_){n.back=-1,n.mode=lr;break}if(64&_){t.msg="invalid literal/length code",n.mode=gr;break}n.extra=15&_,n.mode=16201;case 16201:if(n.extra){for(x=n.extra;l<x;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=16202;case 16202:for(;A=n.distcode[c&(1<<n.distbits)-1],g=A>>>24,_=A>>>16&255,v=65535&A,!(g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(0==(240&_)){for(y=g,w=_,b=v;A=n.distcode[b+((c&(1<<y+w)-1)>>y)],g=A>>>24,_=A>>>16&255,v=65535&A,!(y+g<=l);){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}c>>>=y,l-=y,n.back+=y}if(c>>>=g,l-=g,n.back+=g,64&_){t.msg="invalid distance code",n.mode=gr;break}n.offset=v,n.extra=15&_,n.mode=16203;case 16203:if(n.extra){for(x=n.extra;l<x;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=gr;break}n.mode=16204;case 16204:if(0===u)break t;if(f=h-u,n.offset>f){if(f=n.offset-f,f>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=gr;break}f>n.wnext?(f-=n.wnext,p=n.wsize-f):p=n.wnext-f,f>n.length&&(f=n.length),m=n.window}else m=i,p=o-n.offset,f=n.length;f>u&&(f=u),u-=f,n.length-=f;do{i[o++]=m[p++]}while(--f);0===n.length&&(n.mode=pr);break;case 16205:if(0===u)break t;i[o++]=n.length,u--,n.mode=pr;break;case mr:if(n.wrap){for(;l<32;){if(0===a)break t;a--,c|=r[s++]<<l,l+=8}if(h-=u,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?Ee(n.check,i,h,o-h):be(n.check,i,h,o-h)),h=u,4&n.wrap&&(n.flags?c:_r(c))!==n.check){t.msg="incorrect data check",n.mode=gr;break}c=0,l=0}n.mode=16207;case 16207:if(n.wrap&&n.flags){for(;l<32;){if(0===a)break t;a--,c+=r[s++]<<l,l+=8}if(4&n.wrap&&c!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=gr;break}c=0,l=0}n.mode=16208;case 16208:E=er;break t;case gr:E=ir;break t;case 16210:return sr;default:return rr}return t.next_out=o,t.avail_out=u,t.next_in=s,t.avail_in=a,n.hold=c,n.bits=l,(n.wsize||h!==t.avail_out&&n.mode<gr&&(n.mode<mr||e!==Qn))&&Mr(t,t.output,t.next_out,h-t.avail_out),d-=t.avail_in,h-=t.avail_out,t.total_in+=d,t.total_out+=h,n.total+=h,4&n.wrap&&h&&(t.adler=n.check=n.flags?Ee(n.check,i,h,t.next_out-h):be(n.check,i,h,t.next_out-h)),t.data_type=n.bits+(n.last?64:0)+(n.mode===lr?128:0)+(n.mode===fr||n.mode===hr?256:0),(0===d&&0===h||e===Qn)&&E===tr&&(E=or),E},Ir={inflateReset:br,inflateReset2:kr,inflateResetKeep:wr,inflateInit:t=>Er(t,15),inflateInit2:Er,inflate:Or,inflateEnd:t=>{if(yr(t))return rr;let e=t.state;return e.window&&(e.window=null),t.state=null,tr},inflateGetHeader:(t,e)=>{if(yr(t))return rr;const n=t.state;return 0==(2&n.wrap)?rr:(n.head=e,e.done=!1,tr)},inflateSetDictionary:(t,e)=>{const n=e.length;let r,i,s;return yr(t)?rr:(r=t.state,0!==r.wrap&&r.mode!==cr?rr:r.mode===cr&&(i=1,i=be(i,e,n,0),i!==r.check)?ir:(s=Mr(t,e,n,n),s?(r.mode=16210,sr):(r.havedict=1,tr)))},inflateInfo:"pako inflate (from Nodeca project)"};var Rr=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Tr=Object.prototype.toString,{Z_NO_FLUSH:Pr,Z_FINISH:jr,Z_OK:Fr,Z_STREAM_END:Nr,Z_NEED_DICT:zr,Z_STREAM_ERROR:Br,Z_DATA_ERROR:Lr,Z_MEM_ERROR:Ur}=Ce;function Dr(t){this.options=Cn.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new On,this.strm.avail_out=0;let n=Ir.inflateInit2(this.strm,e.windowBits);if(n!==Fr)throw new Error(Ae[n]);if(this.header=new Rr,Ir.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=Mn.string2buf(e.dictionary):"[object ArrayBuffer]"===Tr.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Ir.inflateSetDictionary(this.strm,e.dictionary),n!==Fr)))throw new Error(Ae[n])}Dr.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=e===~~e?e:!0===e?jr:Pr,"[object ArrayBuffer]"===Tr.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(0===n.avail_out&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=Ir.inflate(n,o),s===zr&&i&&(s=Ir.inflateSetDictionary(n,i),s===Fr?s=Ir.inflate(n,o):s===Lr&&(s=zr));n.avail_in>0&&s===Nr&&n.state.wrap>0&&0!==t[n.next_in];)Ir.inflateReset(n),s=Ir.inflate(n,o);switch(s){case Br:case Lr:case zr:case Ur:return this.onEnd(s),this.ended=!0,!1}if(a=n.avail_out,n.next_out&&(0===n.avail_out||s===Nr))if("string"===this.options.to){let t=Mn.utf8border(n.output,n.next_out),e=n.next_out-t,i=Mn.buf2string(n.output,t);n.next_out=e,n.avail_out=r-e,e&&n.output.set(n.output.subarray(t,t+e),0),this.onData(i)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(s!==Fr||0!==a){if(s===Nr)return s=Ir.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===n.avail_in)break}}return!0},Dr.prototype.onData=function(t){this.chunks.push(t)},Dr.prototype.onEnd=function(t){t===Fr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Cn.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};const{Deflate:qr,deflate:$r,deflateRaw:Wr,gzip:Zr}=qn;var Hr=$r;const Gr=4294967295;let Jr=Math.floor(Math.random()*Gr);const Vr=()=>(Jr=(Jr+1)%Gr,Jr);function Kr(t,e,n){return-1===e?t:new Promise(((r,i)=>{const s=setTimeout((()=>{i(n?n():new Error(`Timeout after ${e}ms`))}),e);t.then((t=>{clearTimeout(s),r(t)})).catch((t=>{clearTimeout(s),i(t)}))}))}class Qr extends Error{constructor(t){super(t.message),this.name=this.constructor.name,this.cause=t,Object.setPrototypeOf(this,this.constructor.prototype)}}class Xr extends Error{constructor(t,e){super(t),this.name=this.constructor.name,this.cause=e,Object.setPrototypeOf(this,this.constructor.prototype)}}class Yr extends Xr{constructor(t="Transport request timed out",e){super(t,e)}}function ti({transport:t}){let e,n;async function r(){t.isConnected()||(n||(n=t.connect()),await n)}async function i(){return e||(e=(async()=>{await r(),await async function(t,e={}){const{maxRetries:n=10,retryDelay:r=200,timeoutErrorClass:i}=e;for(let e=0;e<=n;e++)try{return await t()}catch(t){if(e>=n)throw t;if(i&&"function"==typeof i&&t instanceof i)continue;await new Promise((t=>setTimeout(t,r)))}throw new Error("Max retries exceeded")}((()=>t.request({method:"wallet_getSession"},{timeout:t.warmupTimeout??1e3})))})()),await e}return r(),{createSession:async e=>(await i(),await ei({transport:t,method:"wallet_createSession",params:e})),getSession:async()=>(await i(),await ei({transport:t,method:"wallet_getSession"})),revokeSession:async r=>{await i(),e=void 0,n=void 0,await ei({transport:t,method:"wallet_revokeSession",params:r}),await t.disconnect()},invokeMethod:async e=>(await i(),await ei({transport:t,method:"wallet_invokeMethod",params:e})),extendsRpcApi:()=>ti({transport:t}),onNotification:e=>t.onNotification(e)}}async function ei({transport:t,method:e,params:n,timeout:r}){const i=await t.request({method:e,params:n},{timeout:r});if(i?.error)throw new Qr(i.error);return i.result}const ni="caip-348",ri="metamask-contentscript",ii="metamask-inpage",si="metamask-multichain-provider",oi="metamask-provider",ai="METAMASK_EXTENSION_CONNECT_CAN_RETRY",ui=-1,ci=200;async function li(){return new Promise(((t,e)=>{const n=e=>{if(function(t){const{target:e,data:n}=t.data;return e===ii&&n?.name===oi&&t.origin===location.origin}(e)){const i=e?.data?.data?.data;if(i?.method===ai)di();else if(i?.result?.extensionId){const e=i?.result?.extensionId;t(e),window.removeEventListener("message",n),clearTimeout(r)}}},r=setTimeout((()=>{window.removeEventListener("message",n),e(new Error("MetaMask extension not found"))}),1e4);window.addEventListener("message",n),di()}))}function di(){window.postMessage({target:ri,data:{name:oi,data:{method:"metamask_getProviderState"}}},location.origin)}function hi(t={}){let{extensionId:e}=t;const{defaultTimeout:n=ui,warmupTimeout:r=ci}=t;let i,s=Vr();const o=new Map,a=new Set;function u(t){const{data:e}=t;if(null==e?.id)!function(t){for(const e of a)try{e(t)}catch(t){console.log("[ChromeTransport] notifyCallbacks error:",t)}}(e);else if(o.has(e.id)){const t=o.get(e.id);o.delete(e.id),t?.(e)}}return{warmupTimeout:r,connect:async()=>{try{e||(e=await li());const t=chrome.runtime.connect(e);let n=!0;if(t.onDisconnect.addListener((()=>{console.log("[ChromeTransport] chromePort disconnected"),i=void 0,n=!1})),await new Promise((t=>setTimeout(t,10))),!n)throw new Error(`No extension found with id: ${e}`);t.onMessage.addListener(u),i=t}catch(t){throw new Xr("Failed to connect to MetaMask",t)}},disconnect:async()=>{if(i)try{i.disconnect(),i=void 0,a.clear(),o.clear()}catch(t){console.log("[ChromeTransport] disconnect error:",t)}},isConnected:()=>void 0!==i,request:async(t,e={})=>{const{timeout:r=n}=e,a=i;if(!a)throw new Xr("Chrome port not connected");const u=s++,c={id:u,jsonrpc:"2.0",...t};try{return await Kr(new Promise((t=>{o.set(u,t),a.postMessage({type:ni,data:c})})),r,(()=>new Yr))}catch(t){throw o.has(u)&&o.delete(u),t}},onNotification:t=>(a.add(t),()=>{a.delete(t)})}}function fi(t={}){const{defaultTimeout:e=ui,warmupTimeout:n=ci}=t;let r=null;const i=new Map,s=new Set;function o(t){if(null==t?.id)!function(t){for(const e of s)try{e(t)}catch(t){console.log("[WindowPostMessageTransport] notifyCallbacks error:",t)}}(t);else if(i.has(t.id)){const e=i.get(t.id);i.delete(t.id),e?.(t)}}async function a(){r&&(window.removeEventListener("message",r),r=null),i.clear(),s.clear()}const u=()=>Boolean(r);return{warmupTimeout:n,connect:async()=>{u()&&await a(),r=t=>{const{target:e,data:n}=t.data;e===ii&&n?.name===si&&t.origin===location.origin&&o(n.data)},window.addEventListener("message",r)},disconnect:a,isConnected:u,request:(t,n={})=>{const{timeout:r=e}=n;if(!u())throw new Xr("Transport not connected");const s=Vr(),o={jsonrpc:"2.0",id:s,...t};return Kr(new Promise((t=>{i.set(s,(e=>t(e))),function(t){window.postMessage({target:ri,data:{name:si,data:t}},location.origin)}(o)})),r,(()=>new Yr)).catch((t=>{throw i.has(s)&&i.delete(s),t}))},onNotification:t=>(s.add(t),()=>{s.delete(t)})}}function pi({extensionId:t,defaultTimeout:e,warmupTimeout:n}={}){return"undefined"!=typeof chrome&&chrome.runtime&&"function"==typeof chrome.runtime.connect?hi({extensionId:t,defaultTimeout:e,warmupTimeout:n}):fi({defaultTimeout:e,warmupTimeout:n})}var mi=bi;bi.default=bi,bi.stable=Ci,bi.stableStringify=Ci;var gi="[...]",_i="[Circular]",vi=[],yi=[];function wi(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function bi(t,e,n,r){var i;void 0===r&&(r=wi()),Ei(t,"",0,[],void 0,0,r);try{i=0===yi.length?JSON.stringify(t,e,n):JSON.stringify(t,xi(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==vi.length;){var s=vi.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function ki(t,e,n,r){var i=Object.getOwnPropertyDescriptor(r,n);void 0!==i.get?i.configurable?(Object.defineProperty(r,n,{value:t}),vi.push([r,n,e,i])):yi.push([e,n,t]):(r[n]=t,vi.push([r,n,e]))}function Ei(t,e,n,r,i,s,o){var a;if(s+=1,"object"==typeof t&&null!==t){for(a=0;a<r.length;a++)if(r[a]===t)return void ki(_i,t,e,i);if(void 0!==o.depthLimit&&s>o.depthLimit)return void ki(gi,t,e,i);if(void 0!==o.edgesLimit&&n+1>o.edgesLimit)return void ki(gi,t,e,i);if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Ei(t[a],a,a,r,t,s,o);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var c=u[a];Ei(t[c],c,a,r,t,s,o)}}r.pop()}}function Ai(t,e){return t<e?-1:t>e?1:0}function Ci(t,e,n,r){void 0===r&&(r=wi());var i,s=Si(t,"",0,[],void 0,0,r)||t;try{i=0===yi.length?JSON.stringify(s,e,n):JSON.stringify(s,xi(e),n)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==vi.length;){var o=vi.pop();4===o.length?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return i}function Si(t,e,n,r,i,s,o){var a;if(s+=1,"object"==typeof t&&null!==t){for(a=0;a<r.length;a++)if(r[a]===t)return void ki(_i,t,e,i);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==o.depthLimit&&s>o.depthLimit)return void ki(gi,t,e,i);if(void 0!==o.edgesLimit&&n+1>o.edgesLimit)return void ki(gi,t,e,i);if(r.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Si(t[a],a,a,r,t,s,o);else{var u={},c=Object.keys(t).sort(Ai);for(a=0;a<c.length;a++){var l=c[a];Si(t[l],l,a,r,t,s,o),u[l]=t[l]}if(void 0===i)return u;vi.push([i,e,t]),i[e]=u}r.pop()}}function xi(t){return t=void 0!==t?t:function(t,e){return e},function(e,n){if(yi.length>0)for(var r=0;r<yi.length;r++){var i=yi[r];if(i[1]===e&&i[0]===n){n=i[2],yi.splice(r,1);break}}return t.call(this,e,n)}}const Mi={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},Oi={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},Ii={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},Ri=Mi.internal,Ti="Unspecified error message. This is a bug, please report it.";ji(Ri);const Pi="Unspecified server error.";function ji(t,e=Ti){if(function(t){return Number.isInteger(t)}(t)){const e=t.toString();if($(Ii,e))return Ii[e].message;if(function(t){return t>=-32099&&t<=-32e3}(t))return Pi}return e}function Fi(t){return Object.getOwnPropertyNames(t).reduce(((e,n)=>{const r=t[n];return Ot(r)&&(e[n]=r),e}),{})}const Ni=function(t){return t?.__esModule?t.default:t}(mi);class zi extends Error{constructor(t,e,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a non-empty string.');!function(t){return q(t)&&$(t,"cause")&&q(t.cause)}(n)?super(e):(super(e,{cause:n.cause}),$(this,"cause")||Object.assign(this,{cause:n.cause})),void 0!==n&&(this.data=n),this.code=t}serialize(){const t={code:this.code,message:this.message};var e;return void 0!==this.data&&(t.data=this.data,function(t){if("object"!=typeof t||null===t)return!1;try{let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}catch(t){return!1}}(this.data)&&(t.data.cause=(e=this.data.cause,Array.isArray(e)?e.map((t=>Ot(t)?t:q(t)?Fi(t):null)):q(e)?Fi(e):Ot(e)?e:null))),this.stack&&(t.stack=this.stack),t}toString(){return Ni(this.serialize(),Li,2)}}class Bi extends zi{constructor(t,e,n){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,e,n)}}function Li(t,e){if("[Circular]"!==e)return e}const Ui=t=>$i(Mi.internal,t),Di=t=>Wi(Oi.unauthorized,t),qi=t=>{if(!t||"object"!=typeof t||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:n,data:r}=t;if(!n||"string"!=typeof n)throw new Error('"message" must be a nonempty string');return new Bi(e,n,r)};function $i(t,e){const[n,r]=Zi(e);return new zi(t,n??ji(t),r)}function Wi(t,e){const[n,r]=Zi(e);return new Bi(t,n??ji(t),r)}function Zi(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:e,data:n}=t;if(e&&"string"!=typeof e)throw new Error("Must specify string message.");return[e??void 0,n]}}return[]}const Hi=/\{[^{}]+\}/g;function Gi(t){let{baseUrl:e="",Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:s,headers:o,requestInitExt:a,...u}={...t};a="object"==typeof process&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici?a:void 0,e=ts(e);const c=[];async function l(t,l){const{baseUrl:d,fetch:h=r,Request:f=n,headers:p,params:m={},parseAs:g="json",querySerializer:_,bodySerializer:v=s??Xi,body:y,...w}=l||{};let b=e;d&&(b=ts(d)??e);let k="function"==typeof i?i:Qi(i);_&&(k="function"==typeof _?_:Qi({..."object"==typeof i?i:{},..._}));const E=void 0===y?void 0:v(y,Yi(o,p,m.header)),A=Yi(void 0===E||E instanceof FormData?{}:{"Content-Type":"application/json"},o,p,m.header),C={redirect:"follow",...u,...w,body:E,headers:A};let S,x,M,O=new n(function(t,e){let n=`${e.baseUrl}${t}`;e.params?.path&&(n=function(t,e){let n=t;for(const r of t.match(Hi)??[]){let t=r.substring(1,r.length-1),i=!1,s="simple";if(t.endsWith("*")&&(i=!0,t=t.substring(0,t.length-1)),t.startsWith(".")?(s="label",t=t.substring(1)):t.startsWith(";")&&(s="matrix",t=t.substring(1)),!e||void 0===e[t]||null===e[t])continue;const o=e[t];Array.isArray(o)?n=n.replace(r,Ki(t,o,{style:s,explode:i})):n="object"!=typeof o?"matrix"!==s?n.replace(r,"label"===s?`.${encodeURIComponent(o)}`:encodeURIComponent(o)):n.replace(r,`;${Ji(t,o)}`):n.replace(r,Vi(t,o,{style:s,explode:i}))}return n}(n,e.params.path));let r=e.querySerializer(e.params.query??{});r.startsWith("?")&&(r=r.substring(1));r&&(n+=`?${r}`);return n}(t,{baseUrl:b,params:m,querySerializer:k}),C);for(const t in w)t in O||(O[t]=w[t]);if(c.length){S=Math.random().toString(36).slice(2,11),x=Object.freeze({baseUrl:b,fetch:h,parseAs:g,querySerializer:k,bodySerializer:v});for(const e of c)if(e&&"object"==typeof e&&"function"==typeof e.onRequest){const r=await e.onRequest({request:O,schemaPath:t,params:m,options:x,id:S});if(r){if(!(r instanceof n)){if(r instanceof Response){M=r;break}throw new Error("onRequest: must return new Request() or Response() when modifying the request")}O=r}}}if(!M){try{M=await h(O,a)}catch(I){let e=I;if(c.length)for(let n=c.length-1;n>=0;n--){const r=c[n];if(r&&"object"==typeof r&&"function"==typeof r.onError){const n=await r.onError({request:O,error:e,schemaPath:t,params:m,options:x,id:S});if(n){if(n instanceof Response){e=void 0,M=n;break}if(n instanceof Error){e=n;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(e)throw e}if(c.length)for(let e=c.length-1;e>=0;e--){const n=c[e];if(n&&"object"==typeof n&&"function"==typeof n.onResponse){const e=await n.onResponse({request:O,response:M,schemaPath:t,params:m,options:x,id:S});if(e){if(!(e instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");M=e}}}}if(204===M.status||"HEAD"===O.method||"0"===M.headers.get("Content-Length"))return M.ok?{data:void 0,response:M}:{error:void 0,response:M};if(M.ok)return"stream"===g?{data:M.body,response:M}:{data:await M[g](),response:M};let I=await M.text();try{I=JSON.parse(I)}catch{}return{error:I,response:M}}return{request:(t,e,n)=>l(e,{...n,method:t.toUpperCase()}),GET:(t,e)=>l(t,{...e,method:"GET"}),PUT:(t,e)=>l(t,{...e,method:"PUT"}),POST:(t,e)=>l(t,{...e,method:"POST"}),DELETE:(t,e)=>l(t,{...e,method:"DELETE"}),OPTIONS:(t,e)=>l(t,{...e,method:"OPTIONS"}),HEAD:(t,e)=>l(t,{...e,method:"HEAD"}),PATCH:(t,e)=>l(t,{...e,method:"PATCH"}),TRACE:(t,e)=>l(t,{...e,method:"TRACE"}),use(...t){for(const e of t)if(e){if("object"!=typeof e||!("onRequest"in e||"onResponse"in e||"onError"in e))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");c.push(e)}},eject(...t){for(const e of t){const t=c.indexOf(e);-1!==t&&c.splice(t,1)}}}}function Ji(t,e,n){if(null==e)return"";if("object"==typeof e)throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${!0===n?.allowReserved?e:encodeURIComponent(e)}`}function Vi(t,e,n){if(!e||"object"!=typeof e)return"";const r=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if("deepObject"!==n.style&&!1===n.explode){for(const t in e)r.push(t,!0===n.allowReserved?e[t]:encodeURIComponent(e[t]));const i=r.join(",");switch(n.style){case"form":return`${t}=${i}`;case"label":return`.${i}`;case"matrix":return`;${t}=${i}`;default:return i}}for(const i in e){const s="deepObject"===n.style?`${t}[${i}]`:i;r.push(Ji(s,e[i],n))}const s=r.join(i);return"label"===n.style||"matrix"===n.style?`${i}${s}`:s}function Ki(t,e,n){if(!Array.isArray(e))return"";if(!1===n.explode){const r={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",i=(!0===n.allowReserved?e:e.map((t=>encodeURIComponent(t)))).join(r);switch(n.style){case"simple":return i;case"label":return`.${i}`;case"matrix":return`;${t}=${i}`;default:return`${t}=${i}`}}const r={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const r of e)"simple"===n.style||"label"===n.style?i.push(!0===n.allowReserved?r:encodeURIComponent(r)):i.push(Ji(t,r,n));return"label"===n.style||"matrix"===n.style?`${r}${i.join(r)}`:i.join(r)}function Qi(t){return function(e){const n=[];if(e&&"object"==typeof e)for(const r in e){const i=e[r];if(null!=i)if(Array.isArray(i)){if(0===i.length)continue;n.push(Ki(r,i,{style:"form",explode:!0,...t?.array,allowReserved:t?.allowReserved||!1}))}else"object"!=typeof i?n.push(Ji(r,i,t)):n.push(Vi(r,i,{style:"deepObject",explode:!0,...t?.object,allowReserved:t?.allowReserved||!1}))}return n.join("&")}}function Xi(t,e){if(t instanceof FormData)return t;if(e){if("application/x-www-form-urlencoded"===(e.get instanceof Function?e.get("Content-Type")??e.get("content-type"):e["Content-Type"]??e["content-type"]))return new URLSearchParams(t).toString()}return JSON.stringify(t)}function Yi(...t){const e=new Headers;for(const n of t){if(!n||"object"!=typeof n)continue;const t=n instanceof Headers?n.entries():Object.entries(n);for(const[n,r]of t)if(null===r)e.delete(n);else if(Array.isArray(r))for(const t of r)e.append(n,t);else void 0!==r&&e.set(n,r)}return e}function ts(t){return t.endsWith("/")?t.substring(0,t.length-1):t}var es,ns=class{sendFn;batch=[];batchSize;baseTimeoutMs;currentTimeoutMs;maxTimeoutMs=3e4;timeoutId=null;isSending=!1;constructor(t){this.batchSize=t.batchSize,this.baseTimeoutMs=t.baseTimeoutMs,this.currentTimeoutMs=t.baseTimeoutMs,this.sendFn=t.sendFn}enqueue(t){this.batch.push(t),this.schedule()}clear(){this.batch=[],this.currentTimeoutMs=this.baseTimeoutMs,this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}schedule(){this.batch.length>0&&!this.timeoutId&&(this.timeoutId=setTimeout((()=>{this.timeoutId=null,this.flush()}),this.currentTimeoutMs))}async flush(){if(this.isSending||0===this.batch.length)return;this.isSending=!0;const t=[...this.batch.slice(0,this.batchSize)];this.batch=this.batch.slice(this.batchSize);try{await this.sendFn(t),this.currentTimeoutMs=this.baseTimeoutMs}catch(e){console.error("Sender: Failed to send batch",e),this.batch=[...t,...this.batch],this.currentTimeoutMs=Math.min(2*this.currentTimeoutMs,this.maxTimeoutMs)}finally{this.isSending=!1,this.schedule()}}},rs=class{enabled=!1;sender;properties={};constructor(t){const e=Gi({baseUrl:t});this.sender=new ns({batchSize:100,baseTimeoutMs:200,sendFn:async t=>{const n=await e.POST("/v2/events",{body:t});if(200!==n.response.status)throw new Error(n.error)}})}enable(){this.enabled=!0}disable(){this.enabled=!1,this.sender.clear()}setGlobalProperty(t,e){if("integration_types"!==t)this.properties[t]=e;else{const t=Array.isArray(this.properties.integration_types)?this.properties.integration_types:[],n=Array.isArray(e)?e:[];this.properties.integration_types=[...new Set([...t,...n])]}}track(t,e){if(!this.enabled)return;const n={namespace:"metamask/connect",event_name:t,properties:{...e,...this.properties}};this.sender.enqueue(n)}};"undefined"!=typeof process&&process.env&&(es=process.env.METAMASK_ANALYTICS_ENDPOINT??process.env.NEXT_PUBLIC_METAMASK_ANALYTICS_ENDPOINT);var is=new rs(es??"https://mm-sdk-analytics.api.cx.metamask.io/"),ss={exports:{}};!function(e,n){var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,i=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(e){!function(n){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t||{},i={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function a(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function u(t){return"string"!=typeof t&&(t=String(t)),t}function c(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function d(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function h(t){return new Promise((function(e,n){t.onload=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function f(t){var e=new FileReader,n=h(e);return e.readAsArrayBuffer(t),n}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:i.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():i.arrayBuffer&&i.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||o(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var t=d(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=d(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(f);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,n,r,i,s=d(this);if(s)return s;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,n=h(e),r=/charset=([A-Za-z0-9_-]+)/.exec(t.type),i=r?r[1]:"utf-8",e.readAsText(t,i),n;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),n=new Array(e.length),r=0;r<e.length;r++)n[r]=String.fromCharCode(e[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=a(t),e=u(e);var n=this.map[t];this.map[t]=n?n+", "+e:e},l.prototype.delete=function(t){delete this.map[a(t)]},l.prototype.get=function(t){return t=a(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(a(t))},l.prototype.set=function(t,e){this.map[a(t)]=u(e)},l.prototype.forEach=function(t,e){for(var n in this.map)this.map.hasOwnProperty(n)&&t.call(e,this.map[n],n,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,n){t.push(n)})),c(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),c(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,n){t.push([n,e])})),c(t)},i.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var g=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,i,s=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,s||null==t._bodyInit||(s=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(n=e.method||this.method||"GET",i=n.toUpperCase(),g.indexOf(i)>-1?i:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var n=t.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(r),decodeURIComponent(i))}})),e}function y(t,e){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},m.call(_.prototype),m.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var w=[301,302,303,307,308];y.redirect=function(t,e){if(-1===w.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},n.DOMException=r.DOMException;try{new n.DOMException}catch(t){n.DOMException=function(t,e){this.message=t,this.name=e;var n=Error(t);this.stack=n.stack},n.DOMException.prototype=Object.create(Error.prototype),n.DOMException.prototype.constructor=n.DOMException}function b(t,e){return new Promise((function(s,o){var c=new _(t,e);if(c.signal&&c.signal.aborted)return o(new n.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function h(){d.abort()}if(d.onload=function(){var t,e,n={statusText:d.statusText,headers:(t=d.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var n=t.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();try{e.append(r,i)}catch(t){console.warn("Response "+t.message)}}})),e)};0===c.url.indexOf("file://")&&(d.status<200||d.status>599)?n.status=200:n.status=d.status,n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var r="response"in d?d.response:d.responseText;setTimeout((function(){s(new y(r,n))}),0)},d.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},d.onabort=function(){setTimeout((function(){o(new n.DOMException("Aborted","AbortError"))}),0)},d.open(c.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(c.url),!0),"include"===c.credentials?d.withCredentials=!0:"omit"===c.credentials&&(d.withCredentials=!1),"responseType"in d&&(i.blob?d.responseType="blob":i.arrayBuffer&&(d.responseType="arraybuffer")),e&&"object"==typeof e.headers&&!(e.headers instanceof l||r.Headers&&e.headers instanceof r.Headers)){var f=[];Object.getOwnPropertyNames(e.headers).forEach((function(t){f.push(a(t)),d.setRequestHeader(t,u(e.headers[t]))})),c.headers.forEach((function(t,e){-1===f.indexOf(e)&&d.setRequestHeader(e,t)}))}else c.headers.forEach((function(t,e){d.setRequestHeader(e,t)}));c.signal&&(c.signal.addEventListener("abort",h),d.onreadystatechange=function(){4===d.readyState&&c.signal.removeEventListener("abort",h)}),d.send(void 0===c._bodyInit?null:c._bodyInit)}))}b.polyfill=!0,r.fetch||(r.fetch=b,r.Headers=l,r.Request=_,r.Response=y),n.Headers=l,n.Request=_,n.Response=y,n.fetch=b}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=r.fetch?r:i;(n=s.fetch).default=s.fetch,n.fetch=s.fetch,n.Headers=s.Headers,n.Request=s.Request,n.Response=s.Response,e.exports=n}(ss,ss.exports);var os=ss.exports;const as=[];for(let t=0;t<256;++t)as.push((t+256).toString(16).slice(1));let us;const cs=new Uint8Array(16);var ls={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ds(t,e,n){if(ls.randomUUID&&!e&&!t)return ls.randomUUID();const r=(t=t||{}).random??t.rng?.()??function(){if(!us){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");us=crypto.getRandomValues.bind(crypto)}return us(cs)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){if((n=n||0)<0||n+16>e.length)throw new RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return(as[t[e+0]]+as[t[e+1]]+as[t[e+2]]+as[t[e+3]]+"-"+as[t[e+4]]+as[t[e+5]]+"-"+as[t[e+6]]+as[t[e+7]]+"-"+as[t[e+8]]+as[t[e+9]]+"-"+as[t[e+10]]+as[t[e+11]]+as[t[e+12]]+as[t[e+13]]+as[t[e+14]]+as[t[e+15]]).toLowerCase()}(r)}
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */function hs(t,e,n,r){return new(n||(n=Promise))((function(i,s){function o(t){try{u(r.next(t))}catch(t){s(t)}}function a(t){try{u(r.throw(t))}catch(t){s(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}u((r=r.apply(t,e||[])).next())}))}function fs(t,e){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}var ps,ms,gs,_s,vs,ys,ws,bs,ks,Es,As,Cs,Ss,xs,Ms="INSTALLED",Os="NOT_INSTALLED",Is="REGISTERED",Rs="REGISTERING",Ts="RELOADING",Ps={CHROME:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",FIREFOX:"https://addons.mozilla.org/firefox/addon/ether-metamask/",DEFAULT:"https://metamask.io"},js="REGISTRATION_IN_PROGRESS",Fs="FORWARDER_ID",Ns=function(){function t(e){var n=void 0===e?{}:e,r=n.forwarderOrigin,i=void 0===r?"https://fwd.metamask.io":r,s=n.forwarderMode,o=void 0===s?t.FORWARDER_MODE.INJECT:s;this.forwarderOrigin=i,this.forwarderMode=o,this.state=t.isMetaMaskInstalled()?Ms:Os;var a=t._detectBrowser();this.downloadUrl=a?Ps[a]:Ps.DEFAULT,this._onMessage=this._onMessage.bind(this),this._onMessageFromForwarder=this._onMessageFromForwarder.bind(this),this._openForwarder=this._openForwarder.bind(this),this._openDownloadPage=this._openDownloadPage.bind(this),this.startOnboarding=this.startOnboarding.bind(this),this.stopOnboarding=this.stopOnboarding.bind(this),window.addEventListener("message",this._onMessage),o===t.FORWARDER_MODE.INJECT&&"true"===sessionStorage.getItem(js)&&t._injectForwarder(this.forwarderOrigin)}return t.prototype._onMessage=function(t){if(t.origin===this.forwarderOrigin)return"metamask:reload"===t.data.type?this._onMessageFromForwarder(t):void console.debug("Unknown message from '"+t.origin+"' with data "+JSON.stringify(t.data))},t.prototype._onMessageUnknownStateError=function(t){throw new Error("Unknown state: '"+t+"'")},t.prototype._onMessageFromForwarder=function(e){return hs(this,void 0,void 0,(function(){return fs(this,(function(n){switch(n.label){case 0:switch(this.state){case Ts:return[3,1];case Os:return[3,2];case Ms:return[3,3];case Rs:return[3,5];case Is:return[3,6]}return[3,7];case 1:return console.debug("Ignoring message while reloading"),[3,8];case 2:return console.debug("Reloading now to register with MetaMask"),this.state=Ts,location.reload(),[3,8];case 3:return console.debug("Registering with MetaMask"),this.state=Rs,[4,t._register()];case 4:return n.sent(),this.state=Is,e.source.postMessage({type:"metamask:registrationCompleted"},e.origin),this.stopOnboarding(),[3,8];case 5:return console.debug("Already registering - ignoring reload message"),[3,8];case 6:return console.debug("Already registered - ignoring reload message"),[3,8];case 7:this._onMessageUnknownStateError(this.state),n.label=8;case 8:return[2]}}))}))},t.prototype.startOnboarding=function(){sessionStorage.setItem(js,"true"),this._openDownloadPage(),this._openForwarder()},t.prototype.stopOnboarding=function(){"true"===sessionStorage.getItem(js)&&(this.forwarderMode===t.FORWARDER_MODE.INJECT&&(console.debug("Removing forwarder"),t._removeForwarder()),sessionStorage.setItem(js,"false"))},t.prototype._openForwarder=function(){this.forwarderMode===t.FORWARDER_MODE.OPEN_TAB?window.open(this.forwarderOrigin,"_blank"):t._injectForwarder(this.forwarderOrigin)},t.prototype._openDownloadPage=function(){window.open(this.downloadUrl,"_blank")},t.isMetaMaskInstalled=function(){return Boolean(window.ethereum&&window.ethereum.isMetaMask)},t._register=function(){return window.ethereum.request({method:"wallet_registerOnboarding"})},t._injectForwarder=function(t){var e=document.body,n=document.createElement("iframe");n.setAttribute("height","0"),n.setAttribute("width","0"),n.setAttribute("style","display: none;"),n.setAttribute("src",t),n.setAttribute("id",Fs),e.insertBefore(n,e.children[0])},t._removeForwarder=function(){var t;null===(t=document.getElementById(Fs))||void 0===t||t.remove()},t._detectBrowser=function(){var t=k.parse(window.navigator.userAgent);return"Firefox"===t.browser.name?"FIREFOX":["Chrome","Chromium"].includes(t.browser.name||"")?"CHROME":null},t.FORWARDER_MODE={INJECT:"INJECT",OPEN_TAB:"OPEN_TAB"},t}(),zs=Object.defineProperty,Bs=Object.defineProperties,Ls=Object.getOwnPropertyDescriptors,Us=Object.getOwnPropertyNames,Ds=Object.getOwnPropertySymbols,qs=Object.prototype.hasOwnProperty,$s=Object.prototype.propertyIsEnumerable,Ws=t=>{throw TypeError(t)},Zs=(t,e,n)=>e in t?zs(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Hs=(t,e)=>{for(var n in e||(e={}))qs.call(e,n)&&Zs(t,n,e[n]);if(Ds)for(var n of Ds(e))$s.call(e,n)&&Zs(t,n,e[n]);return t},Gs=(t,e)=>Bs(t,Ls(e)),Js=(t,e)=>function(){return t&&(e=(0,t[Us(t)[0]])(t=0)),e},Vs=(t,e)=>{for(var n in e)zs(t,n,{get:e[n],enumerable:!0})},Ks=(t,e,n)=>e.has(t)||Ws("Cannot "+n),Qs=(t,e,n)=>(Ks(t,e,"read from private field"),n?n.call(t):e.get(t)),Xs=(t,e,n)=>e.has(t)?Ws("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ys=(t,e,n,r)=>(Ks(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),to=(t,e,n)=>(Ks(t,e,"access private method"),n),eo=(t,e,n)=>new Promise(((r,i)=>{var s=t=>{try{a(n.next(t))}catch(t){i(t)}},o=t=>{try{a(n.throw(t))}catch(t){i(t)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(s,o);a((n=n.apply(t,e)).next())})),no=Js({"src/domain/errors/base.ts"(){ps=class extends Error{constructor(t,e){super(t),this.message=t,this.code=e}}}}),ro=Js({"src/domain/errors/rpc.ts"(){no(),(ms=class t extends ps{constructor(e,n,r){super(`RPCErr${t.code}: ${r} on ${e} for method ${n}`,t.code),this.rpcEndpoint=e,this.method=n,this.httpStatus=r}}).code=50,gs=ms,(_s=class t extends ps{constructor(e){super(`RPCErr${t.code}: RPC Client response reason ${e}`,t.code),this.reason=e}}).code=51,vs=_s,(ys=class t extends ps{constructor(e){super(`RPCErr${t.code}: RPC Client fetch reason ${e}`,t.code),this.reason=e}}).code=52,ws=ys,(bs=class t extends ps{constructor(e,n,r){super(`RPCErr${t.code}: RPC Client invoke method reason (${e})`,t.code),this.reason=e,this.rpcCode=n,this.rpcMessage=r}}).code=53,ks=bs}}),io=Js({"src/domain/errors/index.ts"(){ro()}}),so=Js({"src/domain/events/index.ts"(){As=class{constructor(){Xs(this,Es,new h)}emit(t,...e){Qs(this,Es).emit(t,...e)}on(t,e){return Qs(this,Es).on(t,e),()=>{this.off(t,e)}}off(t,e){Qs(this,Es).off(t,e)}removeListener(t,e){Qs(this,Es).off(t,e)}once(t,e){return Qs(this,Es).once(t,e),()=>{this.off(t,e)}}listenerCount(t){return Qs(this,Es).listenerCount(t)}},Es=new WeakMap}});function oo(t,e){return t.includes(e)||t.includes("metamask-sdk:*")||t.includes("*")}var ao,uo,co,lo,ho=Js({"src/domain/logger/index.ts"(){Cs=(t="metamask-sdk",e="214")=>{const n=w(t);return n.color=e,n},Ss=(t="metamask-sdk")=>{w.enable(t)},xs=(t,e)=>eo(null,null,(function*(){var n;if("process"in globalThis&&(null==(n=null==process?void 0:process.env)?void 0:n.DEBUG)){const{DEBUG:e}=process.env;return oo(e,t)}const r=yield e.getDebug();return!!r&&oo(r,t)}))}}),fo=Js({"src/domain/multichain/api/constants.ts"(){ao=new Set(["eth_blockNumber","eth_gasPrice","eth_maxPriorityFeePerGas","eth_blobBaseFee","eth_feeHistory","eth_getBalance","eth_getCode","eth_getStorageAt","eth_call","eth_estimateGas","eth_getLogs","eth_getProof","eth_getTransactionCount","eth_getBlockByNumber","eth_getBlockByHash","eth_getBlockTransactionCountByNumber","eth_getBlockTransactionCountByHash","eth_getUncleCountByBlockNumber","eth_getUncleCountByBlockHash","eth_getTransactionByHash","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByBlockHashAndIndex","eth_getTransactionReceipt","eth_getUncleByBlockNumberAndIndex","eth_getUncleByBlockHashAndIndex","eth_getFilterChanges","eth_getFilterLogs","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter"]),uo=new Set(["eth_accounts","eth_chainId"])}}),po=Js({"src/domain/multichain/api/infura.ts"(){fo()}});var mo,go=Js({"src/domain/multichain/index.ts"(){so(),fo(),po(),co=(t=>(t.Browser="browser",t.MWP="mwp",t.UNKNOWN="unknown",t))(co||{}),lo=class extends As{constructor(t){super(),this.options=t}mergeOptions(t){var e,n,r,i,s,o,a,u,c,l,d,h,f,p,m,g,_;const v=this.options,y=Hs(Hs({},v.analytics),null!=(e=t.analytics)?e:{});!1===(null==(n=v.analytics)?void 0:n.enabled)&&(y.enabled=!1),this.options=Gs(Hs({},v),{api:Gs(Hs({},v.api),{supportedNetworks:Hs(Hs({},v.api.supportedNetworks),null!=(i=null==(r=t.api)?void 0:r.supportedNetworks)?i:{})}),versions:Hs(Hs({},v.versions),null!=(s=t.versions)?s:{}),analytics:Hs({},y),ui:Gs(Hs({},v.ui),{headless:null!=(a=null==(o=t.ui)?void 0:o.headless)?a:v.ui.headless,preferExtension:null!=(c=null==(u=t.ui)?void 0:u.preferExtension)?c:v.ui.preferExtension,showInstallModal:null!=(d=null==(l=t.ui)?void 0:l.showInstallModal)?d:v.ui.showInstallModal}),mobile:Hs(Hs({},v.mobile),null!=(h=t.mobile)?h:{}),transport:Gs(Hs({},null!=(f=v.transport)?f:{}),{extensionId:null!=(g=null==(p=t.transport)?void 0:p.extensionId)?g:null==(m=v.transport)?void 0:m.extensionId}),debug:null!=(_=t.debug)?_:v.debug})}}}});function _o(){var t,e;if("undefined"!=typeof global&&"ReactNative"===(null==(t=null==global?void 0:global.navigator)?void 0:t.product))return!0;return"undefined"!=typeof window&&void 0!==window.navigator&&"ReactNative"===(null==(e=window.navigator)?void 0:e.product)}function vo(){return _o()?"react-native":"undefined"!=typeof window&&(null==window?void 0:window.navigator)&&"ReactNative"!==(null==navigator?void 0:navigator.product)?"undefined"!=typeof window&&Boolean(window.ReactNativeWebView)&&Boolean(window.navigator.userAgent.endsWith("MetaMaskMobile"))?"in-app-browser":function(){var t,e;const n=k.parse(window.navigator.userAgent);return"mobile"===(null==(t=null==n?void 0:n.platform)?void 0:t.type)||"tablet"===(null==(e=null==n?void 0:n.platform)?void 0:e.type)}()?"web-mobile":"web-desktop":"nodejs"}function yo(){const t=vo();return _o()||"web-mobile"===t}function wo(){return eo(this,null,(function*(){return mo}))}var bo,ko,Eo,Ao,Co,So=Js({"src/domain/platform/index.ts"(){mo=eo(null,null,(function*(){const t=vo();return"nodejs"===t||"react-native"===t?Promise.resolve(!1):new Promise((t=>{const e=[],n=t=>{var n,r;(null==(r=null==(n=null==t?void 0:t.detail)?void 0:n.info)?void 0:r.rdns)&&e.push(t.detail)};window.addEventListener("eip6963:announceProvider",n),window.dispatchEvent(new Event("eip6963:requestProvider")),setTimeout((()=>{window.removeEventListener("eip6963:announceProvider",n);const r=e.some((t=>{var e,n;return null==(n=null==(e=null==t?void 0:t.info)?void 0:e.rdns)?void 0:n.startsWith("io.metamask")}));t(r)}),300)}))}))}}),xo=Js({"src/domain/store/adapter.ts"(){bo=class{constructor(t){this.options=t}}}}),Mo=Js({"src/domain/store/client.ts"(){ko=class{}}}),Oo=Js({"src/domain/store/index.ts"(){xo(),Mo()}}),Io=Js({"src/domain/ui/types.ts"(){Eo=class{constructor(t){this.options=t}get isMounted(){return void 0!==this.instance}get data(){if("object"==typeof this.options&&this.options&&"link"in this.options)return this.options.link;if("object"==typeof this.options&&this.options&&"otpCode"in this.options)return this.options.otpCode;throw new Error("Invalid options")}set data(t){"object"==typeof this.options&&this.options&&"link"in this.options&&(this.options.link=t),"object"==typeof this.options&&this.options&&"otpCode"in this.options&&(this.options.otpCode=t)}}}}),Ro=Js({"src/domain/ui/index.ts"(){Io()}});function To(t){var e,n,r,i;if("object"!=typeof t||null===t)return{code:void 0,message:""};if(t instanceof ks)return{code:null!=(e=t.rpcCode)?e:t.code,message:null!=(r=null!=(n=t.rpcMessage)?n:t.message)?r:""};const s=t;return{code:s.code,message:null!=(i=s.message)?i:""}}function Po(t){if("object"!=typeof t||null===t)return!1;const{code:e,message:n}=To(t),r=n.toLowerCase();return 4001===e||r.includes("reject")||r.includes("denied")||r.includes("cancel")||r.includes("user rejected")||r.includes("user denied")||r.includes("user cancelled")||r.includes("user canceled")}function jo(t){const e=function(t){var e,n;if("object"!=typeof t||null===t)return"unknown";const r=t,i=null!=(e=r.name)?e:"",s=null!=(n=r.message)?n:"",o=s.toLowerCase(),{code:a}=To(t);if("number"==typeof a){if(-32601===a)return"wallet_method_unsupported";if(-32602===a)return"wallet_invalid_params";if(-32603===a)return"wallet_internal_error";if(a<=-32e3&&a>=-32099)return"wallet_internal_error";if(4100===a)return"wallet_unauthorized";if(4200===a)return"wallet_method_unsupported";if(4902===a)return"unrecognized_chain"}return"TransportTimeoutError"===i||"Request timeout"===s||o.includes("timed out")||o.includes("timeout")?"transport_timeout":"TransportError"===i||o.includes("not connected")||o.includes("transport disconnect")||o.includes("connection lost")||o.includes("socket closed")?"transport_disconnect":"unknown"}(t),{code:n,message:r}=To(t),i=function(t){if(!t)return;let e=t;for(const{pattern:t,replacement:n}of Co)e=e.replace(t,n);return e.length>Ao&&(e=`${e.slice(0,Ao-1)}…`),e}(r);return Hs(Hs({failure_reason:e},"number"==typeof n?{error_code:n}:{}),i?{error_message_sample:i}:{})}function Fo(t,e){return eo(this,null,(function*(){var n;const r=Ho(t.dapp),i=vo(),s=yield e.getAnonId();return{mmconnect_versions:null!=(n=t.versions)?n:{},dapp_id:r,platform:i,anon_id:s}}))}function No(t,e,n,r,i){return eo(this,null,(function*(){var s;const o=Ho(t.dapp),a=yield e.getAnonId();return Hs(Hs(Hs({mmconnect_versions:null!=(s=t.versions)?s:{},dapp_id:o,method:n.request.method,caip_chain_id:n.scope,anon_id:a,transport_type:r},(null==i?void 0:i.failure_reason)?{failure_reason:i.failure_reason}:{}),"number"==typeof(null==i?void 0:i.error_code)?{error_code:i.error_code}:{}),(null==i?void 0:i.error_message_sample)?{error_message_sample:i.error_message_sample}:{})}))}var zo=Js({"src/multichain/utils/analytics.ts"(){aa(),$o(),Ao=200,Co=[{pattern:/0x[a-fA-F0-9]{40}/gu,replacement:"<addr>"},{pattern:/(?:0x)?[a-fA-F0-9]{16,}/gu,replacement:"<hex>"},{pattern:/https?:\/\/[^\s"')]+/gu,replacement:"<url>"},{pattern:/\b[a-z]{1,10}1[ac-hj-np-z02-9]{38,}\b/gu,replacement:"<addr>"},{pattern:/\b[1-9A-HJ-NP-Za-km-z]{32,}\b/gu,replacement:"<addr>"},{pattern:/\d{10,}/gu,replacement:"<num>"}]}});var Bo,Lo,Uo,Do,qo=Js({"src/domain/utils/index.ts"(){zo()}}),$o=Js({"src/domain/index.ts"(){io(),so(),ho(),go(),So(),Oo(),Ro(),qo()}});function Wo(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof global)return global;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw new Error("Unable to locate global object")}function Zo(t){const e=Hr(t);return function(t){if("undefined"!=typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("No base64 encoding method available")}(String.fromCharCode.apply(null,Array.from(e)))}function Ho(t){var e;return null!=(e=t.url)?e:t.name}function Go(t,e,n){var r;const{mobile:i}=t;if(null==(r=null==i?void 0:i.useDeeplink)||r)"undefined"!=typeof window&&(window.location.href=e);else if("undefined"!=typeof document){const t=document.createElement("a");t.href=n,t.target="_self",t.rel="noreferrer noopener",t.click()}}function Jo(t){return t.reduce(((t,e)=>Gs(Hs({},t),{[e]:{methods:[],notifications:[],accounts:[]}})),{})}function Vo(t,e,n,r){if(!(t.every((t=>e.includes(t)))&&e.every((e=>t.includes(e)))))return!1;const i=Object.values(n.sessionScopes).filter((({accounts:t})=>Boolean(t))).flatMap((({accounts:t})=>null!=t?t:[]));return r.every((t=>i.includes(t)))}function Ko(t){return t.reduce(((t,e)=>{try{return[...t,yt(e)]}catch(n){const r=JSON.stringify(e);return console.error(`Invalid CAIP account ID: ${r}`,n),t}}),[])}function Qo(t,e){var n;if(!t||!(null==e?void 0:e.length))return t;const r=Object.fromEntries(Object.entries(t).map((([t,e])=>{var n,r,i;return[t,{methods:[...null!=(n=null==e?void 0:e.methods)?n:[]],notifications:[...null!=(r=null==e?void 0:e.notifications)?r:[]],accounts:[...null!=(i=null==e?void 0:e.accounts)?i:[]]}]}))),i=new Map;for(const t of e){const e=`${t.chain.namespace}:${t.chain.reference}`,r=`${t.chainId}:${t.address}`;i.has(e)||i.set(e,[]),null==(n=i.get(e))||n.push(r)}for(const[t,e]of Object.entries(r))if(null==e?void 0:e.accounts)try{const n=vt(t),r=`${n.namespace}:${n.reference}`,s=i.get(r);if(s){const t=new Set(e.accounts),n=s.filter((e=>!t.has(e)));e.accounts.push(...n)}}catch(e){console.error(`Invalid scope format: ${t}`,e)}return r}var Xo,Yo,ta,ea,na,ra,ia,sa,oa,aa=Js({"src/multichain/utils/index.ts"(){$o(),Bo=()=>{var t;if("undefined"==typeof document)return;let e;const n=document.getElementsByTagName("link");for(let r=0;r<n.length;r++)"icon"!==n[r].getAttribute("rel")&&"shortcut icon"!==n[r].getAttribute("rel")||(e=null!=(t=n[r].getAttribute("href"))?t:void 0);return e},Lo=4294967295,Uo=Math.floor(Math.random()*Lo),Do=()=>Uo=(Uo+1)%Lo}}),ua=Js({"src/multichain/transports/constants.ts"(){Xo="metamask-multichain-provider"}}),ca={};Vs(ca,{MWPTransport:()=>oa});var la=Js({"src/multichain/transports/mwp/index.ts"(){$o(),aa(),ua(),6e4,6e4,12e4,1e4,Yo="cache_wallet_getSession",ta="cache_eth_accounts",ea="cache_eth_chainId",na="pending_session_request",ra=["wallet_getSession","wallet_createSession","wallet_sessionChanged"],ia=["wallet_revokeSession","wallet_revokePermissions"],sa=Cs("metamask-sdk:transport"),oa=class{constructor(t,e,n={requestTimeout:6e4,connectionTimeout:12e4,resumeTimeout:1e4}){this.dappClient=t,this.kvstore=e,this.options=n,this.__pendingRequests=new Map,this.notificationCallbacks=new Set,this.dappClient.on("message",this.handleMessage.bind(this)),this.dappClient.on("session_request",(t=>{this.currentSessionRequest=t,this.kvstore.set(na,JSON.stringify(t)).catch((t=>{sa("Failed to store pending session request",t)}))})),"undefined"!=typeof window&&void 0!==window.addEventListener&&(this.windowFocusHandler=this.onWindowFocus.bind(this),window.addEventListener("focus",this.windowFocusHandler))}get pendingRequests(){return this.__pendingRequests}set pendingRequests(t){this.__pendingRequests=t}get sessionRequest(){return this.currentSessionRequest}getStoredPendingSessionRequest(){return eo(this,null,(function*(){try{const t=yield this.kvstore.get(na);return t?JSON.parse(t):null}catch(t){return null}}))}removeStoredPendingSessionRequest(){return eo(this,null,(function*(){yield this.kvstore.delete(na)}))}onWindowFocus(){this.isConnected()||this.dappClient.reconnect()}notifyCallbacks(t){this.notificationCallbacks.forEach((e=>e(t)))}rejectRequest(t,e=new Error("Request rejected")){const n=this.pendingRequests.get(t);n&&(this.pendingRequests.delete(t),clearTimeout(n.timeout),n.reject(e))}parseWalletError(t){const e=t;if("number"==typeof e.code&&"string"==typeof e.message){const{code:t,message:n}=e;return t>=1e3&&t<=4999?qi({code:t,message:n}):new zi(t,n)}const n=t instanceof Error?t.message:JSON.stringify(t);return Ui({message:n})}handleMessage(t){if("object"==typeof t&&null!==t&&"data"in t){const e=t.data;if("id"in e&&"string"==typeof e.id){const t=this.pendingRequests.get(e.id);if(t){if(clearTimeout(t.timeout),"error"in e&&e.error)return this.pendingRequests.delete(e.id),void t.reject(this.parseWalletError(e.error));const n=Gs(Hs({},e),{method:"wallet_getSession"===t.method||"wallet_createSession"===t.method?"wallet_sessionChanged":t.method}),r=Gs(Hs({},e),{method:"wallet_getSession"===t.method||"wallet_createSession"===t.method?"wallet_sessionChanged":t.method,params:n.result});this.notifyCallbacks(r),t.resolve(n),this.pendingRequests.delete(e.id)}}else{if("metamask_chainChanged"===t.data.method&&this.kvstore.set(ea,JSON.stringify(t.data.params.chainId)),"metamask_accountsChanged"===t.data.method&&this.kvstore.set(ta,JSON.stringify(t.data.params)),"wallet_sessionChanged"===t.data.method){const e={result:t.data.params};this.kvstore.set(Yo,JSON.stringify(e))}this.notifyCallbacks(t.data)}}}onResumeSuccess(t,e,n){return eo(this,null,(function*(){var r,i,s,o,a,u,c;try{yield this.waitForWalletSessionIfNotCached();const l=yield this.request({method:"wallet_getSession"});if(l.error)return e(new Error(l.error.message));let d=l.result;if(d&&n){const t=Object.keys(null!=(r=null==d?void 0:d.sessionScopes)?r:{}),u=null!=(i=null==n?void 0:n.scopes)?i:[],c=Vo(t,u,d,null!=(s=null==n?void 0:n.caipAccountIds)?s:[]);if(n.forceRequest||!c){const t={optionalScopes:Qo(Jo(null!=(o=null==n?void 0:n.scopes)?o:[]),Ko(null!=(a=null==n?void 0:n.caipAccountIds)?a:[]))},r=yield this.request({method:"wallet_createSession",params:t});if(r.error)return e(new Error(r.error.message));d=r.result}}else if(!d){const t={optionalScopes:Qo(Jo(null!=(u=null==n?void 0:n.scopes)?u:[]),Ko(null!=(c=null==n?void 0:n.caipAccountIds)?c:[]))},r=yield this.request({method:"wallet_createSession",params:t});if(r.error)return e(new Error(r.error.message));d=r.result}return yield this.removeStoredPendingSessionRequest(),this.notifyCallbacks({method:"wallet_sessionChanged",params:d}),t()}catch(t){return e(t)}}))}init(){return eo(this,null,(function*(){}))}sendEip1193Message(t,e){return eo(this,null,(function*(){const n=Hs({jsonrpc:"2.0",id:String(Do())},t),r=yield this.getCachedResponse(n);return r?(this.notifyCallbacks(r),r):new Promise(((t,r)=>{var i;const s=setTimeout((()=>{this.rejectRequest(n.id,new Yr)}),null!=(i=null==e?void 0:e.timeout)?i:this.options.requestTimeout);this.pendingRequests.set(n.id,{request:n,method:n.method,resolve:e=>eo(this,null,(function*(){return yield this.storeWalletSession(n,e),t(e)})),reject:r,timeout:s}),this.dappClient.sendRequest({name:"metamask-provider",data:n}).catch(r)}))}))}connect(t){return eo(this,null,(function*(){const{dappClient:e}=this,n=yield this.getActiveSession();n&&sa("active session found",{id:n.id,channel:n.channel,expiresAt:n.expiresAt});const r=yield this.getStoredPendingSessionRequest();let i,s;const o=new Promise(((o,a)=>eo(this,null,(function*(){let u;u=new Promise(n?(r,i)=>{var s;"CONNECTED"===this.dappClient.state?this.onResumeSuccess(r,i,t):(this.dappClient.once("connected",(()=>eo(this,null,(function*(){this.onResumeSuccess(r,i,t)})))),e.resume(null!=(s=null==n?void 0:n.id)?s:""))}:(n,r)=>{var i,o;const a={optionalScopes:Qo(Jo(null!=(i=null==t?void 0:t.scopes)?i:[]),Ko(null!=(o=null==t?void 0:t.caipAccountIds)?o:[])),sessionProperties:null==t?void 0:t.sessionProperties},u={jsonrpc:"2.0",id:String(Do()),method:"wallet_createSession",params:a};s=t=>eo(this,null,(function*(){if("object"!=typeof t||null===t)return;if(!("data"in t))return;const e=t.data,i=e.id===u.id,s="wallet_createSession"===e.method||"wallet_sessionChanged"===e.method;return i||s?e.error?r(this.parseWalletError(e.error)):(yield this.storeWalletSession(u,e),yield this.removeStoredPendingSessionRequest(),this.notifyCallbacks(e),n()):void 0})),this.dappClient.on("message",s);const c=vo(),l=["web-desktop","nodejs"].includes(c),d={name:Xo,data:u};e.connect({mode:"trusted",initialPayload:l?void 0:d}).then((()=>eo(this,null,(function*(){if(l)return e.sendRequest(d)})))).catch((t=>{s&&this.dappClient.off("message",s),r(t)}))}),i=setTimeout((()=>{a(new Yr)}),r?this.options.resumeTimeout:this.options.connectionTimeout),u.then(o).catch(a)}))));return o.catch((t=>eo(this,null,(function*(){throw yield this.dappClient.disconnect(),t})))).finally((()=>{i&&clearTimeout(i),s&&(this.dappClient.off("message",s),s=void 0),this.removeStoredPendingSessionRequest()}))}))}disconnect(){return eo(this,arguments,(function*(t=[]){var e,n;const r=yield this.getCachedResponse({jsonrpc:"2.0",id:"0",method:"wallet_getSession"}),i=null!=(n=null==(e=null==r?void 0:r.result)?void 0:e.sessionScopes)?n:{},s=0===t.length?[]:Object.keys(i).filter((e=>!t.includes(e))),o=Object.fromEntries(Object.entries(i).filter((([t])=>s.includes(t))));this.request({method:"wallet_revokeSession",params:{scopes:t}}).catch((t=>{console.error("error revoking session",t)}));s.some((t=>t.includes("eip155")))||(this.kvstore.delete(ta),this.kvstore.delete(ea)),s.length>0?this.kvstore.set(Yo,JSON.stringify({result:{sessionScopes:o}})):(this.kvstore.delete(Yo),"undefined"!=typeof window&&void 0!==window.removeEventListener&&this.windowFocusHandler&&(window.removeEventListener("focus",this.windowFocusHandler),this.windowFocusHandler=void 0),yield this.dappClient.disconnect()),this.notifyCallbacks({method:"wallet_sessionChanged",params:{sessionScopes:o}})}))}isConnected(){return"CONNECTED"===this.dappClient.state}attemptResumeSession(){return eo(this,null,(function*(){try{yield this.dappClient.reconnect(),yield new Promise(((t,e)=>{const n=setTimeout((()=>{e(new Error("Resume timeout"))}),2e3);this.isConnected()?(clearTimeout(n),t()):this.dappClient.once("connected",(()=>{clearTimeout(n),t()}))}))}catch(t){return Promise.reject(new Error(`Failed to resume session: ${t.message}`))}}))}getCachedResponse(t){return eo(this,null,(function*(){var e;if("wallet_getSession"===t.method){const n=yield this.kvstore.get(Yo);if(n){const r=JSON.parse(n);return{id:t.id,jsonrpc:"2.0",result:null!=(e=r.params)?e:r.result,method:t.method}}}else if("eth_accounts"===t.method){const e=yield this.kvstore.get(ta);if(e)return{id:t.id,jsonrpc:"2.0",result:JSON.parse(e),method:t.method}}else if("eth_chainId"===t.method){const e=yield this.kvstore.get(ea);if(e)return{id:t.id,jsonrpc:"2.0",result:JSON.parse(e),method:t.method}}}))}storeWalletSession(t,e){return eo(this,null,(function*(){e.error||(ra.includes(t.method)?yield this.kvstore.set(Yo,JSON.stringify(e)):"eth_accounts"===t.method?yield this.kvstore.set(ta,JSON.stringify(e.result)):"eth_chainId"===t.method?yield this.kvstore.set(ea,JSON.stringify(e.result)):ia.includes(t.method)&&(yield this.kvstore.delete(Yo),yield this.kvstore.delete(ta),yield this.kvstore.delete(ea)))}))}request(t,e){return eo(this,null,(function*(){const n=Hs({jsonrpc:"2.0",id:String(Do())},t),r=yield this.getCachedResponse(n);return r?(this.notifyCallbacks(r),r):(this.isConnected()||(yield this.attemptResumeSession()),new Promise(((t,r)=>{var i;const s=setTimeout((()=>{this.rejectRequest(n.id,new Yr)}),null!=(i=null==e?void 0:e.timeout)?i:this.options.requestTimeout);this.pendingRequests.set(n.id,{request:n,method:n.method,resolve:e=>eo(this,null,(function*(){return yield this.storeWalletSession(n,e),t(e)})),reject:r,timeout:s}),this.dappClient.sendRequest({name:Xo,data:n}).catch(r)})))}))}onNotification(t){return this.notificationCallbacks.add(t),()=>{this.notificationCallbacks.delete(t)}}getActiveSession(){return eo(this,null,(function*(){const{kvstore:t}=this,{SessionStore:e}=yield import("./index-6b5aff68.js").then((function(t){return t.i})),n=yield e.create(t);try{const[t]=yield n.list();return t}catch(t){return void sa("error getting active session",t)}}))}waitForWalletSessionIfNotCached(){return eo(this,null,(function*(){if(yield this.kvstore.get(Yo))return;let t;const e=new Promise((e=>{t=this.onNotification((n=>{if("object"==typeof n&&null!==n&&"data"in n){const r=n.data;"wallet_getSession"!==r.method&&"wallet_sessionChanged"!==r.method||(t(),e())}}))})),n=new Promise(((e,n)=>{setTimeout((()=>{t(),this.removeStoredPendingSessionRequest(),n(new Yr)}),this.options.resumeTimeout)}));return Promise.race([e,n])}))}}}}),da={};function ha(){return eo(this,null,(function*(){const{decrypt:t,encrypt:e,PrivateKey:n,PublicKey:r}=yield import("./index-022bd88c.js").then((function(t){return t.i}));return{generateKeyPair(){const t=new n;return{privateKey:new Uint8Array(t.secret),publicKey:t.publicKey.toBytes(!0)}},encrypt(t,n){return eo(this,null,(function*(){const r=Buffer.from(t,"utf8");return e(n,r).toString("base64")}))},decrypt(e,n){return eo(this,null,(function*(){const r=Buffer.from(e,"base64"),i=yield t(n,r);return Buffer.from(i).toString("utf8")}))},validatePeerKey(t){r.fromHex(Buffer.from(t).toString("hex"))}}}))}Vs(da,{createKeyManager:()=>ha});var fa=Js({"src/multichain/transports/mwp/KeyManager.ts"(){}});var pa,ma,ga,_a,va,ya,wa,ba=Js({"src/ui/modals/base/utils.ts"(){}}),ka=Js({"src/ui/modals/base/AbstractInstallModal.ts"(){ba(),$o(),pa=Cs("metamask-sdk:ui"),_a=class extends Eo{constructor(){super(...arguments),Xs(this,ma,null),Xs(this,ga,-1)}get link(){return this.data}set link(t){this.data=t}get connectionRequest(){return this.options.connectionRequest}set connectionRequest(t){this.options.connectionRequest=t}updateLink(t){this.link=t,this.instance&&(this.instance.link=t)}updateExpiresIn(t){t>=0&&this.instance&&(this.instance.expiresIn=t)}startExpirationCheck(t){this.stopExpirationCheck();let e=t;Ys(this,ma,setInterval((()=>eo(this,null,(function*(){const{sessionRequest:t}=e,n=Date.now(),r=t.expiresAt-n,i=Math.floor(r/1e3);if(r>0&&function(t){return t<=10||(t<=30?t%5==0:t<=60?t%10==0:t<=300?t%30==0:t%60==0)}(i)&&Qs(this,ga)!==i){const t=(s=r)<=0?"EXPIRED":`${Math.floor(s/1e3)}s`;pa(`[UI: InstallModal-nodejs()] QR code expires in: ${t} (${i}s)`),Ys(this,ga,i)}var s;if(n>=t.expiresAt){this.stopExpirationCheck(),pa("[UI: InstallModal-nodejs()] ⏰ QR code EXPIRED! Generating new one...");try{e=yield this.options.createConnectionRequest();const t=yield this.options.generateQRCode(e);Ys(this,ga,-1),this.updateLink(t),this.updateExpiresIn(i),this.renderQRCode(t,e)}catch(t){pa(`[UI: InstallModal-nodejs()] ❌ Error generating new QR code: ${t}`)}}}))),1e3))}stopExpirationCheck(){Qs(this,ma)&&(clearInterval(Qs(this,ma)),Ys(this,ma,null),pa("[UI: InstallModal-nodejs()] 🛑 Stopped QR code expiration checking"))}},ma=new WeakMap,ga=new WeakMap}}),Ea=Js({"src/ui/modals/web/install.ts"(){ka(),va=class extends _a{renderQRCode(){}mount(){var t;const{options:e}=this,n=document.createElement("mm-install-modal");n.showInstallModal=e.showInstallModal,n.addEventListener("close",(t=>{const{detail:n}=t;e.onClose(null==n?void 0:n.shouldTerminate)})),n.addEventListener("startDesktopOnboarding",e.startDesktopOnboarding),n.link=e.link,this.instance=n,null==(t=e.parentElement)||t.appendChild(n),this.startExpirationCheck(e.connectionRequest)}unmount(){var t;const{options:e,instance:n}=this;this.stopExpirationCheck(),n&&(null==(t=e.parentElement)?void 0:t.contains(n))&&(e.parentElement.removeChild(n),this.instance=void 0)}}}}),Aa=Js({"src/ui/modals/base/AbstractOTPModal.ts"(){$o(),ya=class extends Eo{get otpCode(){return this.data}set otpCode(t){this.data=t}updateOTPCode(t){this.otpCode=t,this.instance&&(this.instance.otpCode=t)}}}}),Ca=Js({"src/ui/modals/web/otp.ts"(){Aa(),wa=class extends ya{mount(){}unmount(){}}}}),Sa={};Vs(Sa,{InstallModal:()=>va,OTPCodeModal:()=>wa});var xa,Ma,Oa=Js({"src/ui/modals/web/index.ts"(){Ea(),Ca()}}),Ia={};Vs(Ia,{StoreAdapterWeb:()=>Ma});var Ra=Js({"src/store/adapters/web.ts"(){$o(),xa=class t extends bo{constructor(e="-kv-store",n=t.stores[0]){super(),this.storeName=n,this.platform="web";const r=`${t.DB_NAME}${e}`;this.dbPromise=new Promise(((e,n)=>{try{const i=this.internal.open(r,1);i.onerror=()=>n(new Error("Failed to open IndexedDB.")),i.onsuccess=()=>e(i.result),i.onupgradeneeded=()=>{const e=i.result;for(const n of t.stores)e.objectStoreNames.contains(n)||e.createObjectStore(n)}}catch(t){n(t)}}))}get internal(){if("undefined"==typeof window||!window.indexedDB)throw new Error("indexedDB is not available in this environment");return window.indexedDB}get(t){return eo(this,null,(function*(){const{storeName:e}=this,n=yield this.dbPromise;return new Promise(((r,i)=>{try{const s=n.transaction(e,"readonly"),o=s.objectStore(e).get(t);o.onerror=()=>i(new Error("Failed to get value from IndexedDB.")),o.onsuccess=()=>{var t;return r(null!=(t=o.result)?t:null)}}catch(t){i(t)}}))}))}set(t,e){return eo(this,null,(function*(){const{storeName:n}=this,r=yield this.dbPromise;return new Promise(((i,s)=>{try{const o=r.transaction(n,"readwrite"),a=o.objectStore(n).put(e,t);a.onerror=()=>s(new Error("Failed to set value in IndexedDB.")),a.onsuccess=()=>i()}catch(t){s(t)}}))}))}delete(t){return eo(this,null,(function*(){const{storeName:e}=this,n=yield this.dbPromise;return new Promise(((r,i)=>{try{const s=n.transaction(e,"readwrite"),o=s.objectStore(e).delete(t);o.onerror=()=>i(new Error("Failed to delete value from IndexedDB.")),o.onsuccess=()=>r()}catch(t){i(t)}}))}))}},xa.stores=["sdk-kv-store","key-value-pairs"],xa.DB_NAME="mmconnect",Ma=xa}});aa();var Ta=Wo();null!=Ta.Buffer||(Ta.Buffer=p),$o();var Pa="https://metamask.app.link/connect",ja="metamask://connect";$o(),zo(),ho(),go(),So(),$o();var Fa=1;var Na,za,Ba,La,Ua,Da,qa=class extends Error{};function $a(t){var e;if(t instanceof ks)return t;const n=t;return new ks(null!=(e=n.message)?e:"Unknown error",n.code)}$o(),aa(),zo();Na=new WeakSet,za=function(t,e){return eo(this,null,(function*(){var n;if(!1===(null==(n=this.config.analytics)?void 0:n.enabled))try{return yield e()}catch(t){throw $a(t)}yield to(this,Na,Ba).call(this,t);try{const n=yield e();return yield to(this,Na,La).call(this,t),n}catch(e){throw Po(e)?yield to(this,Na,Da).call(this,t):yield to(this,Na,Ua).call(this,t,e),$a(e)}}))},Ba=function(t){return eo(this,null,(function*(){const e=yield No(this.config,this.config.storage,t,this.transportType);is.track("mmconnect_wallet_action_requested",e)}))},La=function(t){return eo(this,null,(function*(){const e=yield No(this.config,this.config.storage,t,this.transportType);is.track("mmconnect_wallet_action_succeeded",e)}))},Ua=function(t,e){return eo(this,null,(function*(){const n=yield No(this.config,this.config.storage,t,this.transportType,jo(e));is.track("mmconnect_wallet_action_failed",n)}))},Da=function(t){return eo(this,null,(function*(){const e=yield No(this.config,this.config.storage,t,this.transportType);is.track("mmconnect_wallet_action_rejected",e)}))},aa();var Wa,Za,Ha,Ga,Ja,Va,Ka,Qa,Xa,Ya,tu,eu,nu,ru,iu,su,ou,au,uu,cu=class{constructor(){Xs(this,Ka),Xs(this,Wa,new Set),Xs(this,Za,pi()),Xs(this,Ha,{timeout:6e4}),Xs(this,Ga,new Map),Xs(this,Ja),Xs(this,Va)}sendEip1193Message(t,e){return eo(this,null,(function*(){to(this,Ka,eu).call(this);const n=String(Do()),r=Hs({jsonrpc:"2.0",id:n},t);return new Promise(((t,i)=>{var s;const o=setTimeout((()=>{Qs(this,Ga).delete(n),i(new Error("Request timeout"))}),null!=(s=null==e?void 0:e.timeout)?s:Qs(this,Ha).timeout);Qs(this,Ga).set(n,{resolve:e=>{t(e)},reject:i,timeout:o}),window.postMessage({target:"metamask-contentscript",data:{name:"metamask-provider",data:r}},location.origin)}))}))}init(){return eo(this,null,(function*(){yield to(this,Ka,nu).call(this);let t={sessionScopes:{}};try{t=(yield this.request({method:"wallet_getSession"},Qs(this,Ha))).result}catch(t){console.error("Failed to get wallet session during DefaultTransport init")}to(this,Ka,Qa).call(this,{method:"wallet_sessionChanged",params:t})}))}connect(t){return eo(this,null,(function*(){var e,n,r,i,s;yield to(this,Ka,nu).call(this);const o=yield this.request({method:"wallet_getSession"},Qs(this,Ha));if(o.error)throw new Error(o.error.message);let a=o.result;const u={optionalScopes:Qo(Jo(null!=(e=null==t?void 0:t.scopes)?e:[]),Ko(null!=(n=null==t?void 0:t.caipAccountIds)?n:[])),sessionProperties:null==t?void 0:t.sessionProperties};if(a&&t&&!t.forceRequest){if(!Vo(Object.keys(null!=(r=null==a?void 0:a.sessionScopes)?r:{}),null!=(i=null==t?void 0:t.scopes)?i:[],a,null!=(s=null==t?void 0:t.caipAccountIds)?s:[])){const t=yield this.request({method:"wallet_createSession",params:u},Qs(this,Ha));if(t.error)throw new Error(t.error.message);a=t.result}}else if(!a||(null==t?void 0:t.forceRequest)){const t=yield this.request({method:"wallet_createSession",params:u},Qs(this,Ha));if(t.error)throw new Error(t.error.message);a=t.result}to(this,Ka,Qa).call(this,{method:"wallet_sessionChanged",params:a})}))}disconnect(){return eo(this,arguments,(function*(t=[]){yield this.request({method:"wallet_revokeSession",params:{scopes:t}})}))}isConnected(){return Qs(this,Za).isConnected()}request(t){return eo(this,arguments,(function*(t,e=Qs(this,Ha)){return Qs(this,Za).request(t,e)}))}onNotification(t){return Qs(this,Za).onNotification(t),Qs(this,Wa).add(t),()=>{Qs(this,Wa).delete(t)}}getActiveSession(){return eo(this,null,(function*(){throw new Error("getActiveSession is purposely not implemented for the DefaultTransport")}))}getStoredPendingSessionRequest(){return eo(this,null,(function*(){throw new Error("getStoredPendingSessionRequest is purposely not implemented for the DefaultTransport")}))}};Wa=new WeakMap,Za=new WeakMap,Ha=new WeakMap,Ga=new WeakMap,Ja=new WeakMap,Va=new WeakMap,Ka=new WeakSet,Qa=function(t){for(const e of Qs(this,Wa))try{e(t)}catch(t){console.log("[WindowPostMessageTransport] notifyCallbacks error:",t)}},Xa=function(t){var e,n;return"metamask-provider"===(null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.name)&&t.origin===location.origin},Ya=function(t){var e,n;if(!to(this,Ka,Xa).call(this,t))return;const r=null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.data;if(("object"!=typeof r||null===r||!("method"in r))&&"object"==typeof r&&null!==r&&"id"in r&&("result"in r||"error"in r)){const t=String(r.id),e=Qs(this,Ga).get(t);if(e){clearTimeout(e.timeout),Qs(this,Ga).delete(t);const n=r;if("error"in n&&n.error){const t=new Error(n.error.message||"Request failed");"number"==typeof n.error.code&&(t.code=n.error.code),e.reject(t)}else e.resolve(n)}}},tu=function(t){var e,n;if(!to(this,Ka,Xa).call(this,t))return;const r=null==(n=null==(e=null==t?void 0:t.data)?void 0:e.data)?void 0:n.data;"object"==typeof r&&null!==r&&"method"in r&&to(this,Ka,Qa).call(this,r)},eu=function(){Qs(this,Ja)||(Ys(this,Ja,to(this,Ka,Ya).bind(this)),Ys(this,Va,to(this,Ka,tu).bind(this)),window.addEventListener("message",Qs(this,Ja)),window.addEventListener("message",Qs(this,Va)))},nu=function(){return eo(this,null,(function*(){to(this,Ka,eu).call(this),Qs(this,Za).isConnected()||(yield Qs(this,Za).connect())}))},aa();ru=new WeakMap,iu=new WeakSet,su=function(t){return eo(this,null,(function*(){const e=t.params,n=Object.keys(Hs(Hs({},e.optionalScopes),e.requiredScopes)),r=[];n.forEach((t=>{var n,i,s,o;const a=null==(n=e.requiredScopes)?void 0:n[t],u=null==(i=e.optionalScopes)?void 0:i[t];a&&r.push(...null!=(s=a.accounts)?s:[]),u&&r.push(...null!=(o=u.accounts)?o:[])}));const i=[...new Set(r)];return yield this.metamaskConnectMultichain.connect(n,i,e.sessionProperties),this.metamaskConnectMultichain.transport.request({method:"wallet_getSession"})}))},ou=function(t){return eo(this,null,(function*(){return this.isTransportConnected()?this.metamaskConnectMultichain.transport.request({method:"wallet_getSession"}):{jsonrpc:"2.0",id:t.id,result:{sessionScopes:{}}}}))},au=function(t){return eo(this,null,(function*(){var e;const n=t.params,r=null!=(e=null==n?void 0:n.scopes)?e:[];try{return yield this.metamaskConnectMultichain.disconnect(r),{jsonrpc:"2.0",id:t.id,result:!0}}catch(e){return{jsonrpc:"2.0",id:t.id,result:!1}}}))},uu=function(t){return eo(this,null,(function*(){if(!this.isTransportConnected())return{error:Di()};return{result:this.metamaskConnectMultichain.invokeMethod(t.params)}}))},aa();var lu,du,hu,fu,pu,mu,gu,_u,vu,yu,wu,bu,ku,Eu,Au,Cu,Su,xu,Mu,Ou,Iu,Ru,Tu,Pu,ju,Fu,Nu,zu,Bu,Lu=Cs("metamask-sdk:core"),Uu="__METAMASK_CONNECT_MULTICHAIN_SINGLETON__";function Du(t){var e;return Gs(Hs({},null!=t?t:{}),{enabled:null==(e=null==t?void 0:t.enabled)||e,integrationType:(null==t?void 0:t.integrationType)||"direct"})}function qu(t){var e;return!1!==(null==(e=t.analytics)?void 0:e.enabled)}function $u(t,e,n){return eo(this,null,(function*(){var r,i;if(!qu(t))return null==n||n(void 0),void is.disable();const s=vo();if(!("in-app-browser"===s||"web-desktop"===s||"web-mobile"===s)&&!("react-native"===s))return;const o=Ho(t.dapp),a=yield e.getAnonId();null==n||n(a);const{integrationType:u}=null!=(r=t.analytics)?r:{integrationType:""};is.setGlobalProperty("mmconnect_versions",null!=(i=t.versions)?i:{}),is.setGlobalProperty("dapp_id",o),is.setGlobalProperty("anon_id",a),is.setGlobalProperty("platform",s),u&&is.setGlobalProperty("integration_types",[u]),is.enable()}))}du=new WeakMap,hu=new WeakMap,fu=new WeakMap,pu=new WeakMap,mu=new WeakMap,gu=new WeakMap,_u=new WeakMap,vu=new WeakMap,yu=new WeakMap,wu=new WeakSet,bu=function(){return eo(this,null,(function*(){yield $u(this.options,this.storage,(t=>{Ys(this,vu,t)}))}))},ku=function(t){return eo(this,null,(function*(){var e,n,r;if("object"==typeof t&&null!==t&&"method"in t){if("wallet_sessionChanged"===t.method){const r=null!=(n=null==(e=t.params)?void 0:e.sessionScopes)?n:{},i=Object.keys(r).length>0;if("loaded"===this.status&&!i)return;this.status=i?"connected":"disconnected"}this.emit(t.method,null!=(r=t.params)?r:t.result)}}))},Eu=function(){return eo(this,null,(function*(){const t=yield this.storage.getTransport(),e=yield wo();if(t){if("browser"===t){if(e){const t=new cu;return Ys(this,fu,t),Ys(this,gu,"browser"),Qs(this,hu).setupTransportNotificationListener(),Ys(this,_u,t.onNotification(to(this,wu,ku).bind(this))),t}}else if("mwp"===t){const{adapter:t}=this.options.storage,e=yield to(this,wu,xu).call(this),{MWPTransport:n}=yield Promise.resolve().then((()=>(la(),ca))),r=new n(e,t);return Ys(this,pu,e),Ys(this,fu,r),Ys(this,gu,"mwp"),Qs(this,hu).setupTransportNotificationListener(),Ys(this,_u,r.onNotification(to(this,wu,ku).bind(this))),r}yield this.storage.removeTransport()}}))},Au=function(){return eo(this,null,(function*(){var t;if(yield to(this,wu,Eu).call(this))this.transport.isConnected()||(this.status="connecting",yield this.transport.connect()),this.status="connected","mwp"===Qs(this,gu)?yield this.storage.setTransport("mwp"):yield this.storage.setTransport("browser");else{this.status="loaded";const e=yield wo(),n=null==(t=this.options.ui.preferExtension)||t;if(e&&n){yield to(this,wu,ju).call(this,{persist:!1});try{yield this.transport.init()}catch(t){console.error("Passive init failed:",t)}}}}))},Cu=function(){const t={dapp:this.options.dapp,sdk:{version:"0.0.0",platform:vo()}};return qu(this.options)&&Qs(this,vu)&&(t.analytics={remote_session_id:Qs(this,vu)}),t},Su=function(){return eo(this,null,(function*(){try{yield to(this,wu,bu).call(this),yield to(this,wu,Au).call(this)}catch(t){yield this.storage.removeTransport(),this.status="pending",Lu("MetaMaskSDK error during initialization",t)}}))},xu=function(){return eo(this,null,(function*(){const[t,{DappClient:e},{createKeyManager:n}]=yield Promise.all([import("./index-6b5aff68.js").then((function(t){return t.i})),import("./index-2dc796bb.js"),Promise.resolve().then((()=>(fa(),da)))]),r=yield n(),{adapter:i}=this.options.storage,s=yield t.SessionStore.create(i),o="undefined"!=typeof window?WebSocket:(yield import("./browser-3f7e560e.js").then((function(t){return t.b}))).WebSocket;return new e({transport:yield t.WebSocketTransport.create({url:"wss://mm-sdk-relay.api.cx.metamask.io/connection/websocket",kvstore:i,websocket:o}),sessionstore:s,keymanager:r})}))},Mu=function(){return eo(this,null,(function*(){if("mwp"===Qs(this,gu))return;const{adapter:t}=this.options.storage,e=yield to(this,wu,xu).call(this);Ys(this,pu,e);const{MWPTransport:n}=yield Promise.resolve().then((()=>(la(),ca))),r=new n(e,t);Ys(this,fu,r),Ys(this,gu,"mwp"),Qs(this,hu).setupTransportNotificationListener(),Ys(this,_u,this.transport.onNotification(to(this,wu,ku).bind(this))),yield this.storage.setTransport("mwp")}))},Ou=function(){return eo(this,null,(function*(){var t;(null==(t=this.options.ui.factory.modal)?void 0:t.isMounted)&&(yield this.storage.removeTransport())}))},Iu=function(){const t=to(this,wu,Ou).bind(this);return"undefined"!=typeof window&&void 0!==window.addEventListener&&window.addEventListener("beforeunload",t),()=>{"undefined"!=typeof window&&void 0!==window.removeEventListener&&window.removeEventListener("beforeunload",t)}},Ru=function(t,e,n,r){return eo(this,null,(function*(){return new Promise(((i,s)=>{this.options.ui.factory.renderInstallModal(t,(()=>eo(this,null,(function*(){return"CONNECTED"!==this.dappClient.state&&"CONNECTING"!==this.dappClient.state||(yield this.dappClient.disconnect()),new Promise((t=>{this.dappClient.on("session_request",(e=>{t({sessionRequest:e,metadata:to(this,wu,Cu).call(this)})})),(()=>eo(this,null,(function*(){var t;try{yield this.transport.connect({scopes:e,caipAccountIds:n,sessionProperties:r}),yield this.options.ui.factory.unload(),null==(t=this.options.ui.factory.modal)||t.unmount(),this.status="connected",yield this.storage.setTransport("mwp")}catch(t){const{ProtocolError:e,ErrorCode:n}=yield import("./index-6b5aff68.js").then((function(t){return t.i}));if(t instanceof e)t.code!==n.REQUEST_EXPIRED&&(this.status="disconnected",yield this.options.ui.factory.unload(t),s(t));else{this.status="disconnected";const e=t instanceof Error?t:new Error(String(t));yield this.options.ui.factory.unload(e),s(e)}}})))().catch((()=>{}))}))}))),(t=>eo(this,null,(function*(){t?(yield this.storage.removeTransport(),s(t)):(yield this.storage.setTransport("mwp"),i())}))),(t=>{this.emit("display_uri",t)})).catch((t=>{s(t instanceof Error?t:new Error(String(t)))}))}))}))},Tu=function(t,e,n,r){return eo(this,null,(function*(){null!=Qs(this,mu)||Ys(this,mu,to(this,wu,Iu).call(this)),this.options.ui.headless?yield to(this,wu,Pu).call(this,e,n,r):yield to(this,wu,Ru).call(this,t,e,n,r)}))},Pu=function(t,e,n){return eo(this,null,(function*(){return new Promise(((r,i)=>{"CONNECTED"!==this.dappClient.state&&"CONNECTING"!==this.dappClient.state||this.dappClient.disconnect().catch((()=>{})),this.dappClient.on("session_request",(t=>{const e={sessionRequest:t,metadata:to(this,wu,Cu).call(this)},n=this.options.ui.factory.createConnectionDeeplink(e);this.emit("display_uri",n)})),this.transport.connect({scopes:t,caipAccountIds:e,sessionProperties:n}).then((()=>eo(this,null,(function*(){this.status="connected",yield this.storage.setTransport("mwp"),r()})))).catch((t=>eo(this,null,(function*(){const{ProtocolError:e}=yield import("./index-6b5aff68.js").then((function(t){return t.i}));t instanceof e?(this.status="disconnected",yield this.storage.removeTransport(),i(t)):(this.status="disconnected",yield this.storage.removeTransport(),i(t instanceof Error?t:new Error(String(t))))}))))}))}))},ju=function(){return eo(this,arguments,(function*(t={persist:!0}){if("browser"===Qs(this,gu))return Qs(this,fu);(null==t?void 0:t.persist)&&(yield this.storage.setTransport("browser"));const e=new cu;return Ys(this,_u,e.onNotification(to(this,wu,ku).bind(this))),Ys(this,fu,e),Ys(this,gu,"browser"),Qs(this,hu).setupTransportNotificationListener(),e}))},Fu=function(t,e,n){return eo(this,null,(function*(){return new Promise(((r,i)=>eo(this,null,(function*(){const s=t=>{var e;if("object"!=typeof t||null===t||!("data"in t))return;const n=t.data;"object"==typeof n&&null!==n&&(n.error&&(this.dappClient.off("message",s),i(n.error)),(null==(e=null==n?void 0:n.result)?void 0:e.sessionScopes)&&this.dappClient.off("message",s))};let o;return this.dappClient.on("message",s),this.transport.isConnected()?o=setTimeout((()=>{this.openSimpleDeeplinkIfNeeded()}),250):this.dappClient.once("session_request",(t=>{var e;const n={sessionRequest:t,metadata:to(this,wu,Cu).call(this)},r=this.options.ui.factory.createConnectionDeeplink(n),i=this.options.ui.factory.createConnectionUniversalLink(n);this.emit("display_uri",r),(null==(e=this.options.mobile)?void 0:e.preferredOpenLink)?this.options.mobile.preferredOpenLink(r,"_self"):Go(this.options,r,i)})),this.transport.connect({scopes:t,caipAccountIds:e,sessionProperties:n}).then(r).catch((t=>eo(this,null,(function*(){yield this.storage.removeTransport(),this.dappClient.off("message",s),i(t instanceof Error?t:new Error(String(t)))})))).finally((()=>{o&&clearTimeout(o)}))}))))}))},Nu=function(t,e,n){return eo(this,null,(function*(){return this.status="connecting",t.then((()=>eo(this,null,(function*(){if(this.status="connected",qu(this.options))try{const t=yield Fo(this.options,this.storage);is.track("mmconnect_connection_established",Gs(Hs({},t),{transport_type:n,user_permissioned_chains:e}))}catch(t){Lu("Error tracking connection_established event",t)}})))).catch((t=>eo(this,null,(function*(){if(this.status="disconnected",qu(this.options))try{const e=yield Fo(this.options,this.storage);Po(t)?is.track("mmconnect_connection_rejected",Gs(Hs({},e),{transport_type:n})):is.track("mmconnect_connection_failed",Hs(Gs(Hs({},e),{transport_type:n}),jo(t)))}catch(e){Lu("Error tracking connection failed/rejected event",t)}throw t}))))}))},zu=function(){return eo(this,null,(function*(){var t;let e={sessionScopes:{},sessionProperties:{}};if(null==(t=Qs(this,fu))?void 0:t.isConnected())try{const t=yield this.transport.request({method:"wallet_getSession"});t.result&&(e=t.result)}catch(t){}return e}))},Bu=function(){return eo(this,null,(function*(){var t,e;const{ui:n}=this.options,{showInstallModal:r=!1}=null!=n?n:{};if(!(yo()&&!r))return;const i=yield null==(t=Qs(this,fu))?void 0:t.getStoredPendingSessionRequest();if(!i)return;const s={sessionRequest:i,metadata:to(this,wu,Cu).call(this)},o=this.options.ui.factory.createConnectionDeeplink(s),a=this.options.ui.factory.createConnectionUniversalLink(s);(null==(e=this.options.mobile)?void 0:e.preferredOpenLink)?this.options.mobile.preferredOpenLink(o,"_self"):Go(this.options,o,a)}))};var Wu=class t extends lo{constructor(t){var e,n,r,i;const s=function(t){var e,n;const r=vo(),i="web-desktop"===r||"web-mobile"===r||"in-app-browser"===r;if(!(null==(e=t.dapp)?void 0:e.name))throw new Error("You must provide dapp name");if(i&&(t.dapp=Gs(Hs({},t.dapp),{url:`${window.location.protocol}//${window.location.host}`})),!(null==(n=t.dapp)?void 0:n.url))throw new Error("You must provide dapp url");if("react-native"===r&&t.dapp.url){const e=function(t){var e;if(/^https?:\/\//u.test(t))return;const n=t.match(/^([^:]*):\/\//u);return{url:`https://${((null!=(e=null==n?void 0:n[1])?e:t).toLowerCase().replace(/[^a-z0-9-]/gu,"-").replace(/^-+|-+$/gu,"")||"unknown").slice(0,63).replace(/-+$/u,"")}.rn.dapp.local`,nativeScheme:t}}(t.dapp.url);e&&(console.info(`Normalizing dapp URL for React Native: "${t.dapp.url}" -> "${e.url}"`),t.dapp=Gs(Hs({},t.dapp),{url:e.url,nativeScheme:e.nativeScheme}))}const s=/^(http|https):\/\/[^\s]*$/u;if(t.dapp){"iconUrl"in t.dapp&&t.dapp.iconUrl&&!s.test(t.dapp.iconUrl)&&(console.warn("Invalid dappMetadata.iconUrl: URL must start with http:// or https://"),t.dapp.iconUrl=void 0),"base64Icon"in t.dapp&&t.dapp.base64Icon&&t.dapp.base64Icon.length>163400&&(console.warn("Invalid dappMetadata.base64Icon: Base64-encoded icon string length must be less than 163400 characters"),t.dapp.base64Icon=void 0),t.dapp.url&&!s.test(t.dapp.url)&&console.warn("Invalid dappMetadata.url: URL must start with http:// or https://");const e=Bo();if(e&&!("iconUrl"in t.dapp)&&!("base64Icon"in t.dapp)){const n=`${window.location.protocol}//${window.location.host}${e}`;t.dapp.iconUrl=n}}return t}(t);super(Gs(Hs({},s),{ui:Gs(Hs({},s.ui),{preferExtension:null==(e=s.ui.preferExtension)||e,showInstallModal:null!=(n=s.ui.showInstallModal)&&n,headless:null!=(r=s.ui.headless)&&r}),analytics:Du(t.analytics),versions:Hs({"connect-multichain":"0.15.0"},null!=(i=t.versions)?i:{})})),Xs(this,wu),Xs(this,du),Xs(this,hu),Xs(this,fu),Xs(this,pu),Xs(this,mu),Xs(this,gu),this._status="pending",Xs(this,_u),Xs(this,vu),Xs(this,yu,`Sdk/Javascript SdkVersion/0.0.0 Platform/${vo()} dApp/${null!=(lu=this.options.dapp.url)?lu:this.options.dapp.name} dAppTitle/${this.options.dapp.name}`),Ys(this,hu,new class{constructor(t){this.metamaskConnectMultichain=t,Xs(this,iu),Xs(this,ru,new Set)}isTransportDefined(){try{return Boolean(this.metamaskConnectMultichain.transport)}catch(t){return!1}}isTransportConnected(){return this.isTransportDefined()&&this.metamaskConnectMultichain.transport.isConnected()}clearNotificationCallbacks(){Qs(this,ru).clear()}notifyCallbacks(t){Qs(this,ru).forEach((e=>{e(t)}))}clearTransportNotificationListener(){var t;null==(t=this.notificationListener)||t.call(this),this.notificationListener=void 0}setupTransportNotificationListener(){this.isTransportDefined()&&!this.notificationListener&&(this.notificationListener=this.metamaskConnectMultichain.transport.onNotification(this.notifyCallbacks.bind(this)))}connect(){return eo(this,null,(function*(){return Promise.resolve()}))}disconnect(){return eo(this,null,(function*(){return Promise.resolve()}))}isConnected(){return!0}request(t){return eo(this,arguments,(function*(t,e={}){const n=Do(),r=Hs({id:n,jsonrpc:"2.0"},t);switch(r.method){case"wallet_createSession":return to(this,iu,su).call(this,r);case"wallet_getSession":return to(this,iu,ou).call(this,r);case"wallet_revokeSession":return to(this,iu,au).call(this,r);case"wallet_invokeMethod":return to(this,iu,uu).call(this,r);default:throw new Error(`Unsupported method: ${r.method}`)}}))}onNotification(t){return this.setupTransportNotificationListener(),Qs(this,ru).add(t),()=>{Qs(this,ru).delete(t)}}}(this)),Ys(this,du,ti({transport:Qs(this,hu)}))}get status(){return this._status}set status(t){this._status!==t&&(this._status=t,this.emit("stateChanged",t))}get provider(){return Qs(this,du)}get transport(){if(!Qs(this,fu))throw new Error("Transport not initialized, establish connection first");return Qs(this,fu)}get dappClient(){if(!Qs(this,pu))throw new Error("DappClient not initialized, establish connection first");return Qs(this,pu)}get transportType(){var t;return null!=(t=Qs(this,gu))?t:"unknown"}get storage(){return this.options.storage}static create(e){return eo(this,null,(function*(){var n;const r=Wo(),i=r[Uu];if(i){const r=yield i;return r.mergeOptions(e),r instanceof t?yield to(n=r,wu,bu).call(n):yield $u(r.options,r.storage),e.debug&&Ss("metamask-sdk:*"),r}const s=eo(null,null,(function*(){var n;const r=new t(e);return(yield xs("metamask-sdk:core",r.options.storage))&&Ss("metamask-sdk:core"),yield to(n=r,wu,Su).call(n),r}));return r[Uu]=s,s.catch((t=>{r[Uu]=void 0,console.error("Error initializing MetaMaskConnectMultichain",t)})),s}))}connect(t,e,n,r){return eo(this,null,(function*(){var i;if("connecting"===this.status&&"mwp"===Qs(this,gu))throw yield to(this,wu,Bu).call(this),new Error("Existing connection is pending. Please check your MetaMask Mobile app to continue.");const{ui:s}=this.options,o=vo(),a="in-app-browser"===o||"web-desktop"===o,{preferExtension:u=!0,showInstallModal:c=!1}=s,l=yo(),d=yield wo();let h;if(h="in-app-browser"===o||a&&d&&u?"browser":"mwp",qu(this.options))try{const e=yield Fo(this.options,this.storage),n=Object.keys(this.options.api.supportedNetworks);is.track("mmconnect_connection_initiated",Gs(Hs({},e),{transport_type:h,dapp_configured_chains:n,dapp_requested_chains:t}))}catch(t){Lu("Error tracking connection_initiated event",t)}const f=yield to(this,wu,zu).call(this),{mergedScopes:p,mergedCaipAccountIds:m,mergedSessionProperties:g}=function(t,e,n,r){const i=Object.keys(t.sessionScopes),s=[];return Object.values(t.sessionScopes).forEach((t=>{(null==t?void 0:t.accounts)&&Array.isArray(t.accounts)&&t.accounts.forEach((t=>{s.push(t)}))})),{mergedScopes:Array.from(new Set([...i,...e])),mergedCaipAccountIds:Array.from(new Set([...s,...n])),mergedSessionProperties:Hs(Hs({},t.sessionProperties),r)}}(f,t,e,n),_=Object.keys(null!=g?g:{}).length>0?g:void 0;if((null==(i=Qs(this,fu))?void 0:i.isConnected())&&!l)return to(this,wu,Nu).call(this,Qs(this,fu).connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}).then((()=>eo(this,null,(function*(){return"mwp"===Qs(this,gu)?this.storage.setTransport("mwp"):this.storage.setTransport("browser")})))),t,h);if("in-app-browser"===o){const e=yield to(this,wu,ju).call(this);return to(this,wu,Nu).call(this,e.connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}),t,h)}if(a&&d&&u){const e=yield to(this,wu,ju).call(this);return to(this,wu,Nu).call(this,e.connect({scopes:p,caipAccountIds:m,sessionProperties:_,forceRequest:r}),t,h)}yield to(this,wu,Mu).call(this);const v=d?c:!u||c;return l&&!v?to(this,wu,Nu).call(this,to(this,wu,Fu).call(this,p,m,_),t,h):to(this,wu,Nu).call(this,to(this,wu,Tu).call(this,v,p,m,_),t,h)}))}emit(t,e){var n,r;null==(r=null==(n=this.options.transport)?void 0:n.onNotification)||r.call(n,{method:t,params:e}),super.emit(t,e)}disconnect(){return eo(this,arguments,(function*(t=[]){var e,n,r;const i=yield to(this,wu,zu).call(this),s=0===t.length?[]:Object.keys(i.sessionScopes).filter((e=>!t.includes(e)));yield null==(e=Qs(this,fu))?void 0:e.disconnect(t),0===s.length&&(yield this.storage.removeTransport(),"browser"!==Qs(this,gu)&&(yield null==(n=Qs(this,_u))?void 0:n.call(this),null==(r=Qs(this,mu))||r.call(this),Ys(this,_u,void 0),Ys(this,mu,void 0),Ys(this,fu,void 0),Ys(this,gu,void 0),Qs(this,hu).clearTransportNotificationListener(),Ys(this,pu,void 0)),this.status="disconnected")}))}invokeMethod(t){return eo(this,null,(function*(){var e;const{transport:n,options:r}=this,i=new class{constructor(t,e){this.config=t,this.sdkInfo=e}request(t){return eo(this,null,(function*(){const{request:e}=t,n=JSON.stringify({jsonrpc:"2.0",method:e.method,params:e.params,id:Fa+=1}),r=this.getRpcEndpoint(t.scope),i=yield this.fetchWithTimeout(r,n,"POST",this.getHeaders(r),3e4);return yield this.parseResponse(i)}))}getRpcEndpoint(t){var e,n,r;const i=(null!=(r=null==(n=null==(e=this.config)?void 0:e.api)?void 0:n.supportedNetworks)?r:{})[t];if(!i)throw new qa(`No RPC endpoint found for scope ${t}`);return i}fetchWithTimeout(t,e,n,r,i){return eo(this,null,(function*(){const s=new AbortController,o=setTimeout((()=>s.abort()),i);try{const i=yield os(t,{method:n,headers:r,body:e,signal:s.signal});if(clearTimeout(o),!i.ok)throw new gs(t,n,i.status);return i}catch(t){if(clearTimeout(o),t instanceof gs)throw t;if(t instanceof Error&&"AbortError"===t.name)throw new ws(`Request timeout after ${i}ms`);throw new ws(t.message)}}))}parseResponse(t){return eo(this,null,(function*(){try{return(yield t.json()).result}catch(t){throw new vs(t.message)}}))}getHeaders(t){const e={Accept:"application/json","Content-Type":"application/json"};return t.includes("infura")?Gs(Hs({},e),{"Metamask-Sdk-Info":this.sdkInfo}):e}}(r,Qs(this,yu)),s=new class{constructor(t,e,n,r){this.transport=t,this.rpcClient=e,this.config=n,this.transportType=r,Xs(this,Na)}invokeMethod(t){return eo(this,null,(function*(){const{method:e}=t.request;return ao.has(e)?this.handleWithRpcNode(t):uo.has(e)?this.handleWithSdkState(t):this.handleWithWallet(t)}))}handleWithWallet(t){return eo(this,null,(function*(){return to(this,Na,za).call(this,t,(()=>eo(this,null,(function*(){const e=this.transport.request({method:"wallet_invokeMethod",params:t}),{ui:n,mobile:r}=this.config,{showInstallModal:i=!1}=null!=n?n:{};yo()&&!i&&setTimeout((()=>eo(this,null,(function*(){const t=yield this.transport.getActiveSession();if(!t)throw new Error("No active session found");const e=`${ja}/mwp?id=${encodeURIComponent(t.id)}`;(null==r?void 0:r.preferredOpenLink)?r.preferredOpenLink(e,"_self"):Go(this.config,e,Pa)}))),10);const s=yield e;if(s.error){const{error:t}=s;throw new ks(`RPC Request failed with code ${t.code}: ${t.message}`,t.code,t.message)}return s.result}))))}))}handleWithRpcNode(t){return eo(this,null,(function*(){try{return yield this.rpcClient.request(t)}catch(e){if(e instanceof qa)return this.handleWithWallet(t);throw e}}))}handleWithSdkState(t){return eo(this,null,(function*(){return console.warn(`Method "${t.request.method}" is configured for SDK state handling, but this is not yet implemented. Falling back to wallet passthrough.`),this.handleWithWallet(t)}))}}(n,i,r,null!=(e=Qs(this,gu))?e:"unknown");return s.invokeMethod(t)}))}openSimpleDeeplinkIfNeeded(){const{ui:t,mobile:e}=this.options,{showInstallModal:n=!1}=null!=t?t:{};yo()&&!n&&setTimeout((()=>eo(this,null,(function*(){const t=yield this.transport.getActiveSession();if(!t)throw new Error("No active session found");const n=`${ja}/mwp?id=${encodeURIComponent(t.id)}`;(null==e?void 0:e.preferredOpenLink)?e.preferredOpenLink(n,"_self"):Go(this.options,n,Pa)}))),10)}emitSessionChanged(){return eo(this,null,(function*(){var t,e;const n={sessionScopes:{}};if(!(null==(t=Qs(this,fu))?void 0:t.isConnected()))return void this.emit("wallet_sessionChanged",n);const r=yield this.transport.request({method:"wallet_getSession"});this.emit("wallet_sessionChanged",null!=(e=r.result)?e:n)}))}};no();var Zu=class t extends ps{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage get error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};Zu.code=60;var Hu=Zu,Gu=class t extends ps{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage set error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};Gu.code=61;var Ju=Gu,Vu=class t extends ps{constructor(e,n,r){super(`StorageErr${t.code}: ${e} storage delete error in key: ${n} - ${r}`,t.code),this.platform=e,this.key=n,this.reason=r}};Vu.code=62;var Ku=Vu;go(),Mo();var Qu=class extends ko{constructor(t){super(),this.adapter=t}getTransport(){return eo(this,null,(function*(){try{const t=yield this.adapter.get("multichain-transport");return t?function(t){switch(t){case"browser":return"browser";case"mwp":return"mwp";default:return"unknown"}}(t):null}catch(t){throw new Hu(this.adapter.platform,"multichain-transport",t.message)}}))}setTransport(t){return eo(this,null,(function*(){try{yield this.adapter.set("multichain-transport",t)}catch(t){throw new Ju(this.adapter.platform,"multichain-transport",t.message)}}))}removeTransport(){return eo(this,null,(function*(){try{yield this.adapter.delete("multichain-transport")}catch(t){throw new Ku(this.adapter.platform,"multichain-transport",t.message)}}))}getAnonId(){return eo(this,null,(function*(){try{const t=yield this.adapter.get("anonId");if(t)return t;const e=ds();return yield this.adapter.set("anonId",e),e}catch(t){throw new Hu(this.adapter.platform,"anonId",t.message)}}))}getExtensionId(){return eo(this,null,(function*(){try{return yield this.adapter.get("extensionId")}catch(t){throw new Hu(this.adapter.platform,"extensionId",t.message)}}))}setAnonId(t){return eo(this,null,(function*(){try{return yield this.adapter.set("anonId",t)}catch(t){throw new Ju(this.adapter.platform,"anonId",t.message)}}))}setExtensionId(t){return eo(this,null,(function*(){try{return yield this.adapter.set("extensionId",t)}catch(t){throw new Ju(this.adapter.platform,"extensionId",t.message)}}))}removeExtensionId(){return eo(this,null,(function*(){try{return yield this.adapter.delete("extensionId")}catch(t){throw new Ku(this.adapter.platform,"extensionId",t.message)}}))}removeAnonId(){return eo(this,null,(function*(){try{return yield this.adapter.delete("anonId")}catch(t){throw new Ku(this.adapter.platform,"anonId",t.message)}}))}getDebug(){return eo(this,null,(function*(){try{return yield this.adapter.get("DEBUG")}catch(t){throw new Hu(this.adapter.platform,"DEBUG",t.message)}}))}};$o(),aa();var Xu=class{constructor(t){this.options=t,this.platform=vo(),this.validateModals()}validateModals(){const t=["InstallModal","OTPCodeModal"].filter((t=>!this.options[t]));if(t.length>0)throw new Error(`Missing required modals: ${t.join(", ")}`)}unload(t){return eo(this,null,(function*(){var e,n;null==(e=this.modal)||e.unmount(),yield null==(n=this.successCallback)?void 0:n.call(this,t)}))}get isMobile(){return"react-native"===this.platform}get isNode(){return"nodejs"===this.platform}get isWeb(){return"web-desktop"===this.platform||"in-app-browser"===this.platform||"web-mobile"===this.platform}getContainer(){return"undefined"==typeof document?void 0:document.createElement("div")}getMountedContainer(){if("undefined"==typeof document)return;const t=this.getContainer();return t&&document.body.appendChild(t),t}createConnectionDeeplink(t){if(!t)throw new Error("createConnectionDeeplink can only be called with a connection request");const e=Zo(JSON.stringify(t)),n=encodeURIComponent(e);return`${ja}/mwp?p=${n}&c=1`}createConnectionUniversalLink(t){if(!t)return`${Pa}`;const e=Zo(JSON.stringify(t)),n=encodeURIComponent(e);return`${Pa}/mwp?p=${n}&c=1`}onCloseModal(t=!0){return eo(this,null,(function*(){return this.unload(t?new Error("User closed modal"):void 0)}))}onStartDesktopOnboarding(){(new Ns).startOnboarding()}renderInstallModal(t,e,n,r){return eo(this,null,(function*(){var i,s;null==(i=this.modal)||i.unmount(),yield this.preload(),this.successCallback=n,this.displayUriCallback=r;const o=this.getMountedContainer(),a=yield e(),u=this.createConnectionDeeplink(a);null==(s=this.displayUriCallback)||s.call(this,u);const c=new this.options.InstallModal({expiresIn:(a.sessionRequest.expiresAt-Date.now())/1e3,connectionRequest:a,parentElement:o,showInstallModal:t,link:u,generateQRCode:t=>eo(this,null,(function*(){var e;const n=this.createConnectionDeeplink(t);return null==(e=this.displayUriCallback)||e.call(this,n),n})),onClose:this.onCloseModal.bind(this),startDesktopOnboarding:this.onStartDesktopOnboarding.bind(this),createConnectionRequest:e,onDisplayUri:this.displayUriCallback});this.modal=c,c.mount()}))}renderOTPCodeModal(t,e,n){return eo(this,null,(function*(){var r;null==(r=this.modal)||r.unmount(),yield this.preload(),this.successCallback=e;const i=this.getMountedContainer(),s=yield t(),o=new this.options.OTPCodeModal({parentElement:i,otpCode:s,onClose:this.onCloseModal.bind(this),createOTPCode:t,updateOTPCode:t=>n(t,o)});this.modal=o,o.mount()}))}};var Yu=class extends Xu{preload(){return eo(this,null,(function*(){return function(){return eo(this,null,(function*(){if("undefined"!=typeof document)try{const{defineCustomElements:t}=yield import("./index-7b0eeb5c.js").then((function(t){return t.i}));yield t()}catch(t){console.error("Failed to load customElements:",t)}}))}()}))}};$o();var tc=t=>eo(null,null,(function*(){t.debug&&Ss("metamask-sdk:*");const e=yield Promise.resolve().then((()=>(Oa(),Sa)));let n;if(t.storage)n=t.storage;else{const{StoreAdapterWeb:t}=yield Promise.resolve().then((()=>(Ra(),Ia))),e=new t;n=new Qu(e)}const r=new Yu(e);return Wu.create(Gs(Hs({},t),{storage:n,ui:Gs(Hs({},t.ui),{factory:r})}))}));function ec(t,e){return n=t,Boolean("string"==typeof n?.prototype?.constructor?.name)?new t({message:e}):t({message:e});var n}class nc extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}function rc(t,e="Assertion failed.",n=nc){if(!t){if(e instanceof Error)throw e;throw ec(n,e)}}const{memoize:ic}=ft,sc=/^(?:0x)?[0-9a-f]+$/iu,oc=/^0x[0-9a-f]{40}$/u,ac=/^0x[0-9a-fA-F]{40}$/u;U(B(),sc),U(B(),/^0x[0-9a-f]+$/iu),U(B(),oc),U(B(),ac);const uc=t=>"string"==typeof t;function cc(t){return uc(t)&&ac.test(t)}function lc(t){rc(function(t){return uc(t)&&sc.test(t)}(t),"Value must be a hexadecimal string.")}const dc=ic((function(t){rc(cc(t),"Invalid hex address.");const e=function(t){if(t.startsWith("0x")||t.startsWith("0X"))return t.substring(2);return t}(t).toLowerCase(),n=ct(e),{length:r}=e,i=new Array(r);for(let t=0;t<r;t++){const r=1&t,s=n[t>>1],o=0===r?s>>4:15&s;i[t]=o>=8?e[t].toUpperCase():e[t]}return`0x${i.join("")}`}));const hc=ic((function(t){return!!cc(t)&&dc(t)===t}));function fc(t,e){return F(t,(t=>"string"==typeof t&&e.test(t)))}ic((function(t){return uc(e=t)&&oc.test(e)||hc(t);var e}));const pc=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,mc=/^[-a-z0-9]{3,8}$/u,gc=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u;var _c;function vc(t){const e=gc.exec(t);if(!e?.groups)throw new Error("Invalid CAIP account ID.");return{address:e.groups.accountAddress,chainId:e.groups.chainId,chain:{namespace:e.groups.namespace,reference:e.groups.reference}}}fc("CaipChainId",pc),fc("CaipNamespace",mc),fc("CaipReference",/^[-_a-zA-Z0-9]{1,32}$/u),fc("CaipAccountId",gc),fc("CaipAccountAddress",/^[-.%a-zA-Z0-9]{1,128}$/u),fc("CaipAssetNamespace",/^[-a-z0-9]{3,8}$/u),fc("CaipAssetReference",/^[-.%a-zA-Z0-9]{1,128}$/u),fc("CaipTokenId",/^[-.%a-zA-Z0-9]{1,78}$/u),fc("CaipAssetType",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u),fc("CaipAssetId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u),fc("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u),function(t){t.Bip122="bip122",t.Solana="solana",t.Stellar="stellar",t.Tron="tron",t.Eip155="eip155",t.Wallet="wallet"}(_c=_c||(_c={}));const yc=t=>{lc(t);const e=parseInt(t,16);return rc(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};var wc,bc,kc,Ec,Ac=Object.defineProperty,Cc=Object.defineProperties,Sc=Object.getOwnPropertyDescriptors,xc=Object.getOwnPropertySymbols,Mc=Object.prototype.hasOwnProperty,Oc=Object.prototype.propertyIsEnumerable,Ic=t=>{throw TypeError(t)},Rc=(t,e,n)=>e in t?Ac(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Tc=(t,e)=>{for(var n in e||(e={}))Mc.call(e,n)&&Rc(t,n,e[n]);if(xc)for(var n of xc(e))Oc.call(e,n)&&Rc(t,n,e[n]);return t},Pc=(t,e)=>Cc(t,Sc(e)),jc=(t,e,n)=>e.has(t)||Ic("Cannot "+n),Fc=(t,e,n)=>(jc(t,e,"read from private field"),n?n.call(t):e.get(t)),Nc=(t,e,n)=>e.has(t)?Ic("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),zc=(t,e,n,r)=>(jc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Bc=(t,e,n)=>(jc(t,e,"access private method"),n),Lc=(t,e,n)=>new Promise(((r,i)=>{var s=t=>{try{a(n.next(t))}catch(t){i(t)}},o=t=>{try{a(n.throw(t))}catch(t){i(t)}},a=t=>t.done?r(t.value):Promise.resolve(t.value).then(s,o);a((n=n.apply(t,e)).next())})),Uc=["metamask_getProviderState","metamask_sendDomainMetadata","metamask_logWeb3ShimUsage","wallet_registerOnboarding","net_version","wallet_getPermissions"],Dc=["eth_accounts","eth_coinbase",...Uc,"wallet_requestPermissions","eth_requestAccounts","eth_chainId","wallet_revokePermissions","wallet_switchEthereumChain","wallet_addEthereumChain"],qc={"eip1193-compatible":!0},$c="metamask-connect:evm",Wc=Cs($c,"63"),Zc=()=>{Ss($c)},Hc=class extends As{constructor(t,e){super(),Nc(this,wc),Nc(this,bc),Nc(this,kc,[]),Nc(this,Ec),zc(this,wc,t),zc(this,bc,e),this.request=this.request.bind(this),this.sendAsync=this.sendAsync.bind(this),this.send=this.send.bind(this),this.on=this.on.bind(this),this.off=this.off.bind(this),this.emit=this.emit.bind(this),this.once=this.once.bind(this),this.removeListener=this.removeListener.bind(this),this.listenerCount=this.listenerCount.bind(this)}request(t){return Lc(this,null,(function*(){var e,n,r,i;if(Wc(`request: ${t.method} - chainId: ${this.selectedChainId}`,t.params),Dc.includes(t.method))return null==(e=Fc(this,bc))?void 0:e.call(this,t);if(!Fc(this,Ec))throw new Error("No chain ID selected");const s=`eip155:${yc(Fc(this,Ec))}`,o=Fc(this,wc).options;if(!(null!=(r=null==(n=null==o?void 0:o.api)?void 0:n.supportedNetworks)?r:{})[s])throw new Error(`Chain ${s} is not configured in supportedNetworks. Requests cannot be made to chains not explicitly configured in supportedNetworks.`);try{return yield Fc(this,wc).invokeMethod({scope:s,request:{method:t.method,params:t.params}})}catch(t){if(t instanceof ks&&void 0!==t.rpcCode){const e=new Error(null!=(i=t.rpcMessage)?i:t.reason);throw e.code=t.rpcCode,e}throw t}}))}get selectedAccount(){return this.accounts[0]}set accounts(t){zc(this,kc,t)}get accounts(){return Fc(this,kc)}get selectedChainId(){return Fc(this,Ec)}set selectedChainId(t){zc(this,Ec,t)}get chainId(){return this.selectedChainId}sendAsync(t,e){return Lc(this,null,(function*(){var n;const r=null!=(n=t.id)?n:1,i=this.request({method:t.method,params:t.params}).then((t=>({id:r,jsonrpc:"2.0",result:t}))).catch((t=>{var e,n;return{id:r,jsonrpc:"2.0",error:{code:null!=(e=t.code)?e:-32603,message:null!=(n=t.message)?n:"Internal error",data:t.data}}}));if(!e)return i;i.then((t=>{t.error?e(new Error(t.error.message),t):e(null,t)})).catch((t=>{e(t,null)}))}))}send(t,e){this.sendAsync(t,e)}};wc=new WeakMap,bc=new WeakMap,kc=new WeakMap,Ec=new WeakMap;var Gc=t=>{return"string"==typeof(e=t)&&mc.test(e)?{namespace:t}:function(t){return"string"==typeof t&&pc.test(t)}(t)?function(t){const e=pc.exec(t);if(!e?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:e.groups.namespace,reference:e.groups.reference}}(t):{};var e},Jc=t=>{const{namespace:e}=Gc(t);return e===_c.Eip155||t===`${_c.Wallet}:${_c.Eip155}`},Vc=t=>/^0x[0-9a-fA-F]+$/u.test(t),Kc=t=>Vc(t)?t:`0x${BigInt(t).toString(16)}`,Qc=t=>{if(!t)return[];const e=[];for(const n of Object.keys(t)){const{namespace:t,reference:r}=Gc(n);t===_c.Eip155&&r&&e.push(Kc(r))}return Array.from(new Set(e))};var Xc,Yc,tl,el,nl,rl,il,sl,ol,al,ul,cl,ll,dl,hl,fl,pl,ml,gl,_l,vl,yl,wl,bl,kl,El,Al,Cl="0x1",Sl="cache_eth_chainId";function xl(t){var e;return!1!==(null==(e=null==t?void 0:t.analytics)?void 0:e.enabled)}Xc=new WeakMap,Yc=new WeakMap,tl=new WeakMap,el=new WeakMap,nl=new WeakMap,rl=new WeakMap,il=new WeakMap,sl=new WeakMap,ol=new WeakMap,al=new WeakSet,ul=function(){return Fc(this,Xc).options},cl=function(t,e,n){return{scope:e,request:{method:t,params:n}}},ll=function(t,e,n){return Lc(this,null,(function*(){const r=Bc(this,al,ul).call(this);if(xl(r))try{const i=Bc(this,al,cl).call(this,t,e,n),s=yield No(r,Fc(this,Xc).storage,i,Fc(this,Xc).transportType);is.track("mmconnect_wallet_action_requested",s)}catch(t){Wc("Error tracking mmconnect_wallet_action_requested event",t)}}))},dl=function(t,e,n){return Lc(this,null,(function*(){const r=Bc(this,al,ul).call(this);if(xl(r))try{const i=Bc(this,al,cl).call(this,t,e,n),s=yield No(r,Fc(this,Xc).storage,i,Fc(this,Xc).transportType);is.track("mmconnect_wallet_action_succeeded",s)}catch(t){Wc("Error tracking mmconnect_wallet_action_succeeded event",t)}}))},hl=function(t,e,n,r){return Lc(this,null,(function*(){const i=Bc(this,al,ul).call(this);if(xl(i))try{const s=Bc(this,al,cl).call(this,t,e,n),o=yield No(i,Fc(this,Xc).storage,s,Fc(this,Xc).transportType);Po(r)?is.track("mmconnect_wallet_action_rejected",o):is.track("mmconnect_wallet_action_failed",o)}catch(t){Wc("Error tracking wallet action rejected or failed event",r)}}))},fl=function(t){return Lc(this,null,(function*(){if(Fc(this,ol)&&t.includes(Fc(this,ol)))return Fc(this,ol);try{const e=yield Fc(this,Xc).storage.adapter.get(Sl);if(e){const n=JSON.parse(e);if(t.includes(n))return n}}catch(t){Wc("Error retrieving cached chainId",t)}return t[0]}))},pl=function(t){return Lc(this,null,(function*(){var e,n;if(Wc(`Intercepting request for method: ${t.method}`),Uc.includes(t.method))return Promise.reject(new Error(`Method: ${t.method} is not supported by Metamask Connect/EVM`));if("wallet_revokePermissions"===t.method)return this.disconnect();if("wallet_requestPermissions"===(n=t).method||"eth_requestAccounts"===n.method){const e="wallet_requestPermissions"===t.method,{method:n,params:r}=t,i=Qc(Fc(this,tl));0===i.length&&i.push(Cl);const s=Fc(this,Yc).selectedChainId,o=s&&i.includes(s)?s:i[0],a=[o,...i.filter((t=>t!==o))],u=`eip155:${yc(o)}`;yield Bc(this,al,ll).call(this,n,u,r);try{const i=yield this.connect({chainIds:a,forceRequest:e});return yield Bc(this,al,dl).call(this,n,u,r),"eth_requestAccounts"===t.method?i.accounts:i}catch(t){throw yield Bc(this,al,hl).call(this,n,u,r,t),t}}return function(t){return"wallet_switchEthereumChain"===t.method}(t)?this.switchChain({chainId:t.params[0].chainId}):function(t){return"wallet_addEthereumChain"===t.method}(t)?Bc(this,al,gl).call(this,t.params[0]):function(t){return"eth_accounts"===t.method||"eth_coinbase"===t.method}(t)?"eth_coinbase"===t.method?null!=(e=Fc(this,Yc).selectedAccount)?e:null:Fc(this,Yc).accounts:function(t){return"eth_chainId"===t.method}(t)?Fc(this,Yc).selectedChainId:(Wc("Request not intercepted, forwarding to default handler",t),Promise.resolve())}))},ml=function(){Fc(this,Yc).accounts=[],Fc(this,Yc).selectedChainId=void 0},gl=function(t){return Lc(this,null,(function*(){Wc("addEthereumChain called",{chainConfiguration:t});const e="wallet_addEthereumChain";if(!t)throw new Error("No chain configuration found.");const n=t.chainId||Fc(this,Yc).selectedChainId||"0x1",r=`eip155:${yc(n)}`,i=[t];yield Bc(this,al,ll).call(this,e,r,i);try{null===(yield Bc(this,al,_l).call(this,{method:"wallet_addEthereumChain",params:i})).result&&(yield Bc(this,al,vl).call(this,n),Bc(this,al,wl).call(this,n)),yield Bc(this,al,dl).call(this,e,r,i)}catch(t){throw yield Bc(this,al,hl).call(this,e,r,i,t),t}}))},_l=function(t){return Lc(this,null,(function*(){Wc("direct request to metamask-provider called",t);const e=Fc(this,Xc).transport.sendEip1193Message(t);return"wallet_addEthereumChain"!==t.method&&"wallet_switchEthereumChain"!==t.method||Fc(this,Xc).openSimpleDeeplinkIfNeeded(),e}))},vl=function(t){return Lc(this,null,(function*(){try{yield Fc(this,Xc).storage.adapter.set(Sl,JSON.stringify(t))}catch(t){Wc("Error caching chainId",t)}}))},yl=function(t){return Lc(this,null,(function*(){var e;Wc("event: wallet_sessionChanged",t),zc(this,tl,null!=(e=null==t?void 0:t.sessionScopes)?e:{});const n=Qc(Fc(this,tl));if(0===n.length)Bc(this,al,El).call(this);else{let t=[];if("connected"===Fc(this,Xc).status){t=(yield Fc(this,Xc).transport.sendEip1193Message({method:"eth_accounts",params:[]})).result}else t=(t=>{if(!t)return[];const e=[];for(const{accounts:n}of Object.values(t))if(n)for(const t of n){const{address:n,chainId:r}=vc(t);Jc(r)&&Vc(n)&&e.push(n)}return Array.from(new Set(e))})(Fc(this,tl));const e=yield Bc(this,al,fl).call(this,n);Bc(this,al,kl).call(this,{chainId:e,accounts:t})}}))},wl=function(t){var e,n;t!==Fc(this,Yc).selectedChainId&&(Wc("handler: chainChanged",{chainId:t}),Fc(this,Yc).selectedChainId=t,Fc(this,Yc).emit("chainChanged",t),null==(n=null==(e=Fc(this,el))?void 0:e.chainChanged)||n.call(e,t))},bl=function(t){var e,n;t.length===Fc(this,Yc).accounts.length&&t.every(((t,e)=>t===Fc(this,Yc).accounts[e]))||(Wc("handler: accountsChanged",t),Fc(this,Yc).accounts=t,Fc(this,Yc).emit("accountsChanged",t),null==(n=null==(e=Fc(this,el))?void 0:e.accountsChanged)||n.call(e,t))},kl=function({chainId:t,accounts:e}){var n,r,i,s,o,a,u;Wc("handler: connect",{chainId:t,accounts:e});const c={chainId:t,accounts:e};if("connected"===Fc(this,sl))return Bc(this,al,wl).call(this,t),void Bc(this,al,bl).call(this,e);Fc(this,Yc).selectedChainId=t,Fc(this,Yc).accounts=e,zc(this,sl,"connected"),Fc(this,Yc).emit("connect",c),null==(r=null==(n=Fc(this,el))?void 0:n.connect)||r.call(n,c),Fc(this,Yc).emit("chainChanged",t),null==(s=null==(i=Fc(this,el))?void 0:i.chainChanged)||s.call(i,t),Fc(this,Yc).emit("accountsChanged",e),null==(a=null==(o=Fc(this,el))?void 0:o.accountsChanged)||a.call(o,e),null==(u=Fc(this,il))||u.call(this);const l=t=>{Wc("core-event: accountsChanged",t),Bc(this,al,bl).call(this,t)},d=t=>{Wc("core-event: chainChanged",t.chainId),Bc(this,al,vl).call(this,t.chainId).catch((t=>{Wc("Error caching chainId in notification handler",t)})),Bc(this,al,wl).call(this,t.chainId)};Fc(this,Xc).on("metamask_accountsChanged",l),Fc(this,Xc).on("metamask_chainChanged",d),zc(this,il,(()=>{Fc(this,Xc).off("metamask_accountsChanged",l),Fc(this,Xc).off("metamask_chainChanged",d)}))},El=function(){var t,e;"disconnected"!==Fc(this,sl)&&(zc(this,sl,"disconnected"),Wc("handler: disconnect"),Fc(this,Yc).emit("disconnect"),null==(e=null==(t=Fc(this,el))?void 0:t.disconnect)||e.call(t),Bc(this,al,bl).call(this,[]))},Al=function(t){var e,n;"connecting"===Fc(this,sl)&&(Wc("handler: display_uri",t),Fc(this,Yc).emit("display_uri",t),null==(n=null==(e=Fc(this,el))?void 0:e.displayUri)||n.call(e,t))};var Ml=class t{constructor({core:t,eventHandlers:e}){Nc(this,al),Nc(this,Xc),Nc(this,Yc),Nc(this,tl,{}),Nc(this,el),Nc(this,nl),Nc(this,rl),Nc(this,il),Nc(this,sl,"disconnected"),Nc(this,ol),zc(this,Xc,t),zc(this,Yc,new Hc(t,Bc(this,al,pl).bind(this))),zc(this,el,e),zc(this,nl,Bc(this,al,yl).bind(this)),Fc(this,Xc).on("wallet_sessionChanged",Fc(this,nl)),zc(this,rl,Bc(this,al,Al).bind(this)),Fc(this,Xc).on("display_uri",Fc(this,rl)),Wc("Connect/EVM constructor completed")}static create(e){return Lc(this,null,(function*(){var n;const r=new t(e);let i;try{i=yield Fc(r,Xc).provider.getSession()}catch(t){i={sessionScopes:{}}}return yield Bc(n=r,al,yl).call(n,i),r}))}connect(){return Lc(this,arguments,(function*({account:t,forceRequest:e,chainIds:n=[Cl]}={}){var r;if(Wc("request: connect",{account:t}),!n||0===n.length)throw new Error("chainIds must be an array of at least one chain ID");zc(this,ol,n[0]);const i=Array.from(new Set(null!=(r=n.concat(Cl))?r:[Cl])).map((t=>`eip155:${yc(t)}`)),s=t?i.map((e=>`${e}:${t}`)):[];zc(this,sl,"connecting");try{const t=new Promise((t=>{Fc(this,Yc).once("connect",(({chainId:e,accounts:n})=>{Wc("fulfilled-request: connect",{chainId:e,accounts:n}),t({accounts:n,chainId:e})}))}));return yield Fc(this,Xc).connect(i,s,qc,e),yield t}catch(t){throw zc(this,sl,"disconnected"),Wc("Error connecting to wallet",t),t}finally{zc(this,ol,void 0)}}))}connectAndSign(t){return Lc(this,arguments,(function*({message:t,chainIds:e}){var n,r;const{accounts:i,chainId:s}=yield this.connect({chainIds:null!=e?e:[Cl]}),o=yield Fc(this,Yc).request({method:"personal_sign",params:[i[0],t]});return null==(r=null==(n=Fc(this,el))?void 0:n.connectAndSign)||r.call(n,{accounts:i,chainId:s,signature:o}),{accounts:i,chainId:s,signature:o}}))}connectWith(t){return Lc(this,arguments,(function*({method:t,params:e,chainIds:n,account:r,forceRequest:i}){var s,o;const{accounts:a,chainId:u}=yield this.connect({chainIds:null!=n?n:[Cl],account:r,forceRequest:i}),c="function"==typeof e?e(a[0]):e,l=yield Fc(this,Yc).request({method:t,params:c});return null==(o=null==(s=Fc(this,el))?void 0:s.connectWith)||o.call(s,{accounts:a,chainId:u,result:l}),{accounts:a,chainId:u,result:l}}))}disconnect(){return Lc(this,null,(function*(){var t;Wc("request: disconnect");const e=Fc(this,tl),n=Object.keys(e).filter((t=>{const{namespace:e}=Gc(t);return"eip155"===e}));yield Fc(this,Xc).disconnect(n),Bc(this,al,El).call(this),Bc(this,al,ml).call(this),null==(t=Fc(this,il))||t.call(this),zc(this,il,void 0),Wc("fulfilled-request: disconnect")}))}switchChain(t){return Lc(this,arguments,(function*({chainId:t,chainConfiguration:e}){const n="wallet_switchEthereumChain",r=`eip155:${yc(t)}`,i=[{chainId:t}];if(this.selectedChainId===t)return Promise.resolve();if(Qc(Fc(this,tl)).includes(t)&&Fc(this,Xc).transportType===co.MWP)return yield Bc(this,al,vl).call(this,t),Bc(this,al,wl).call(this,t),Promise.resolve();yield Bc(this,al,ll).call(this,n,r,i);try{const e=yield Bc(this,al,_l).call(this,{method:"wallet_switchEthereumChain",params:i}),s=e;if(null==s?void 0:s.error)throw new Error(s.error.message);return yield Bc(this,al,dl).call(this,n,r,i),null===e.result&&(yield Bc(this,al,vl).call(this,t),Bc(this,al,wl).call(this,t)),Promise.resolve()}catch(t){yield Bc(this,al,hl).call(this,n,r,i,t);if(t.message.includes("Unrecognized chain ID")&&e)return Bc(this,al,gl).call(this,e);throw t}}))}getProvider(){return Fc(this,Yc)}getChainId(){return this.selectedChainId}getAccount(){return Fc(this,Yc).selectedAccount}get accounts(){return Fc(this,Yc).accounts}get selectedAccount(){return Fc(this,Yc).selectedAccount}get selectedChainId(){return Fc(this,Yc).selectedChainId}get status(){return Fc(this,sl)}};function Ol(t){return Lc(this,null,(function*(){var e,n,r;if(t.debug&&Zc(),Wc("Creating Metamask Connect/EVM with options:",t),!(null==(e=t.api)?void 0:e.supportedNetworks)||0===Object.keys(t.api.supportedNetworks).length)throw new Error("supportedNetworks is required and must contain at least one chain configuration");!function(t,e){const n=[];for(const[e,r]of Object.entries(t))try{new URL(r)}catch(t){n.push(`${e}: ${r}`)}if(n.length>0)throw new Error(`${e} contains invalid URLs:\n${n.join("\n")}`)}(t.api.supportedNetworks,"supportedNetworks");const i=Object.entries(t.api.supportedNetworks).reduce(((t,[e,n])=>(t[`eip155:${parseInt(e,16)}`]=n,t)),{});try{const e=yield tc(Pc(Tc({},t),{api:{supportedNetworks:i},analytics:Pc(Tc({},null!=(n=t.analytics)?n:{}),{integrationType:(null==(r=t.analytics)?void 0:r.integrationType)||"direct"}),versions:{"connect-evm":"1.4.0"}}));return Ml.create({core:e,eventHandlers:t.eventHandlers,supportedNetworks:t.api.supportedNetworks})}catch(t){throw console.error("Error creating Metamask Connect/EVM",t),t}}))}async function Il(t,e){const n={};t.rpc&&Object.entries(t.rpc).forEach((([t,e])=>{const r=`0x${Number(t).toString(16)}`;n[r]=e}));const r=await Ol({dapp:{name:t.appName??"DODO",iconUrl:t.appLogoUrl},api:{supportedNetworks:n},mobile:{useDeeplink:!0}}),i=r.getProvider(),s=()=>e.disconnect(void 0),o=t=>e.message(t.type,t.data);i.removeListener("connect",e.connect),i.removeListener("disconnect",s),i.removeListener("accountsChanged",e.accountsChanged),i.removeListener("chainChanged",e.chainChanged),i.removeListener("message",o);try{i.on("connect",e.connect),i.on("disconnect",s),i.on("accountsChanged",e.accountsChanged),i.on("chainChanged",e.chainChanged),i.on("message",o)}catch(t){}const{accounts:a}=await r.connect();if(!a||0===a.length)throw new Error("MetaMask Connect: no accounts returned");return await f(i)}export{Il as default};
|