@ledgerhq/connect-kit 1.1.11 → 1.1.12

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/umd/index.js CHANGED
@@ -311,4 +311,4 @@ PERFORMANCE OF THIS SOFTWARE.
311
311
  * Released under MIT license <https://lodash.com/license>
312
312
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
313
313
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
314
- */Bg=Hg,Fg=Hg.exports,function(){var e,n="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",l=1,f=2,h=4,d=1,p=2,g=1,y=2,m=4,v=8,_=16,b=32,w=64,E=128,S=256,O=512,R=30,I="...",x=800,C=16,P=1,k=2,N=3,A=1/0,T=9007199254740991,M=17976931348623157e292,L=NaN,U=4294967295,D=U-1,j=U>>>1,z=[["ary",E],["bind",g],["bindKey",y],["curry",v],["curryRight",_],["flip",O],["partial",b],["partialRight",w],["rearg",S]],B="[object Arguments]",F="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",$="[object Date]",V="[object DOMException]",W="[object Error]",K="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Q="[object Number]",J="[object Null]",X="[object Object]",Z="[object Promise]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",se="[object WeakMap]",ae="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",he="[object Int8Array]",de="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",ye="[object Uint8ClampedArray]",me="[object Uint16Array]",ve="[object Uint32Array]",_e=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ee=/&(?:amp|lt|gt|quot|#39);/g,Se=/[&<>"']/g,Oe=RegExp(Ee.source),Re=RegExp(Se.source),Ie=/<%-([\s\S]+?)%>/g,xe=/<%([\s\S]+?)%>/g,Ce=/<%=([\s\S]+?)%>/g,Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ke=/^\w*$/,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(Ae.source),Me=/^\s+/,Le=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,je=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/[()=,{}\[\]\/\s]/,Fe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,Ke=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Xe="\\ud800-\\udfff",Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\u2700-\\u27bf",tt="a-z\\xdf-\\xf6\\xf8-\\xff",nt="A-Z\\xc0-\\xd6\\xd8-\\xde",rt="\\ufe0e\\ufe0f",it="\\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",ot="['’]",st="["+Xe+"]",at="["+it+"]",ct="["+Ze+"]",ut="\\d+",lt="["+et+"]",ft="["+tt+"]",ht="[^"+Xe+it+ut+et+tt+nt+"]",dt="\\ud83c[\\udffb-\\udfff]",pt="[^"+Xe+"]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",mt="["+nt+"]",vt="\\u200d",_t="(?:"+ft+"|"+ht+")",bt="(?:"+mt+"|"+ht+")",wt="(?:"+ot+"(?:d|ll|m|re|s|t|ve))?",Et="(?:"+ot+"(?:D|LL|M|RE|S|T|VE))?",St="(?:"+ct+"|"+dt+")?",Ot="["+rt+"]?",Rt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xt=Ot+St+"(?:"+vt+"(?:"+[pt,gt,yt].join("|")+")"+Ot+St+")*",Ct="(?:"+[lt,gt,yt].join("|")+")"+xt,Pt="(?:"+[pt+ct+"?",ct,gt,yt,st].join("|")+")",kt=RegExp(ot,"g"),Nt=RegExp(ct,"g"),At=RegExp(dt+"(?="+dt+")|"+Pt+xt,"g"),Tt=RegExp([mt+"?"+ft+"+"+wt+"(?="+[at,mt,"$"].join("|")+")",bt+"+"+Et+"(?="+[at,mt+_t,"$"].join("|")+")",mt+"?"+_t+"+"+wt,mt+"+"+Et,It,Rt,ut,Ct].join("|"),"g"),Mt=RegExp("["+vt+Xe+Ze+rt+"]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ut=["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"],Dt=-1,jt={};jt[le]=jt[fe]=jt[he]=jt[de]=jt[pe]=jt[ge]=jt[ye]=jt[me]=jt[ve]=!0,jt[B]=jt[F]=jt[ce]=jt[q]=jt[ue]=jt[$]=jt[W]=jt[K]=jt[Y]=jt[Q]=jt[X]=jt[te]=jt[ne]=jt[re]=jt[se]=!1;var zt={};zt[B]=zt[F]=zt[ce]=zt[ue]=zt[q]=zt[$]=zt[le]=zt[fe]=zt[he]=zt[de]=zt[pe]=zt[Y]=zt[Q]=zt[X]=zt[te]=zt[ne]=zt[re]=zt[ie]=zt[ge]=zt[ye]=zt[me]=zt[ve]=!0,zt[W]=zt[K]=zt[se]=!1;var Bt={"À":"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"},Ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ht={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},qt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=parseFloat,Vt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Wt||Kt||Function("return this")(),Yt=Fg&&!Fg.nodeType&&Fg,Qt=Yt&&Bg&&!Bg.nodeType&&Bg,Jt=Qt&&Qt.exports===Yt,Xt=Jt&&Wt.process,Zt=function(){try{return Qt&&Qt.require&&Qt.require("util").types||Xt&&Xt.binding&&Xt.binding("util")}catch{}}(),en=Zt&&Zt.isArrayBuffer,tn=Zt&&Zt.isDate,nn=Zt&&Zt.isMap,rn=Zt&&Zt.isRegExp,on=Zt&&Zt.isSet,sn=Zt&&Zt.isTypedArray;function an(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ln(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function fn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function hn(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function dn(e,t){return!(null==e||!e.length)&&Rn(e,t,0)>-1}function pn(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function gn(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function yn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function mn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function _n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var bn=Pn("length");function wn(e){return e.split("")}function En(e){return e.match(ze)||[]}function Sn(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function On(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Rn(e,t,n){return t==t?tr(e,t,n):On(e,xn,n)}function In(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function xn(e){return e!=e}function Cn(e,t){var n=null==e?0:e.length;return n?Tn(e,t)/n:L}function Pn(t){return function(n){return null==n?e:n[t]}}function kn(t){return function(n){return null==t?e:t[n]}}function Nn(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function An(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Tn(t,n){for(var r,i=-1,o=t.length;++i<o;){var s=n(t[i]);s!==e&&(r=r===e?s:r+s)}return r}function Mn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ln(e,t){return gn(t,(function(t){return[t,e[t]]}))}function Un(e){return e&&e.slice(0,or(e)+1).replace(Me,"")}function Dn(e){return function(t){return e(t)}}function jn(e,t){return gn(t,(function(t){return e[t]}))}function zn(e,t){return e.has(t)}function Bn(e,t){for(var n=-1,r=e.length;++n<r&&Rn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length;n--&&Rn(t,e[n],0)>-1;);return n}function Hn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var qn=kn(Bt),$n=kn(Ft);function Vn(e){return"\\"+qt[e]}function Wn(t,n){return null==t?e:t[n]}function Kn(e){return Mt.test(e)}function Gn(e){return Lt.test(e)}function Yn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Jn(e,t){return function(n){return e(t(n))}}function Xn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===u)&&(e[n]=u,o[i++]=n)}return o}function Zn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function er(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function tr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function nr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function rr(e){return Kn(e)?ar(e):bn(e)}function ir(e){return Kn(e)?cr(e):wn(e)}function or(e){for(var t=e.length;t--&&Le.test(e.charAt(t)););return t}var sr=kn(Ht);function ar(e){for(var t=At.lastIndex=0;At.test(e);)++t;return t}function cr(e){return e.match(At)||[]}function ur(e){return e.match(Tt)||[]}var lr=function t(Le){var ze,Xe=(Le=null==Le?Gt:fr.defaults(Gt.Object(),Le,fr.pick(Gt,Ut))).Array,Ze=Le.Date,et=Le.Error,tt=Le.Function,nt=Le.Math,rt=Le.Object,it=Le.RegExp,ot=Le.String,st=Le.TypeError,at=Xe.prototype,ct=tt.prototype,ut=rt.prototype,lt=Le["__core-js_shared__"],ft=ct.toString,ht=ut.hasOwnProperty,dt=0,pt=(ze=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||""))?"Symbol(src)_1."+ze:"",gt=ut.toString,yt=ft.call(rt),mt=Gt._,vt=it("^"+ft.call(ht).replace(Ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Jt?Le.Buffer:e,bt=Le.Symbol,wt=Le.Uint8Array,Et=_t?_t.allocUnsafe:e,St=Jn(rt.getPrototypeOf,rt),Ot=rt.create,Rt=ut.propertyIsEnumerable,It=at.splice,xt=bt?bt.isConcatSpreadable:e,Ct=bt?bt.iterator:e,Pt=bt?bt.toStringTag:e,At=function(){try{var e=Gs(rt,"defineProperty");return e({},"",{}),e}catch{}}(),Tt=Le.clearTimeout!==Gt.clearTimeout&&Le.clearTimeout,Mt=Ze&&Ze.now!==Gt.Date.now&&Ze.now,Lt=Le.setTimeout!==Gt.setTimeout&&Le.setTimeout,Bt=nt.ceil,Ft=nt.floor,Ht=rt.getOwnPropertySymbols,qt=_t?_t.isBuffer:e,Wt=Le.isFinite,Kt=at.join,Yt=Jn(rt.keys,rt),Qt=nt.max,Xt=nt.min,Zt=Ze.now,bn=Le.parseInt,wn=nt.random,kn=at.reverse,tr=Gs(Le,"DataView"),ar=Gs(Le,"Map"),cr=Gs(Le,"Promise"),lr=Gs(Le,"Set"),hr=Gs(Le,"WeakMap"),dr=Gs(rt,"create"),pr=hr&&new hr,gr={},yr=Ta(tr),mr=Ta(ar),vr=Ta(cr),_r=Ta(lr),br=Ta(hr),wr=bt?bt.prototype:e,Er=wr?wr.valueOf:e,Sr=wr?wr.toString:e;function Or(e){if(Il(e)&&!ul(e)&&!(e instanceof Cr)){if(e instanceof xr)return e;if(ht.call(e,"__wrapped__"))return La(e)}return new xr(e)}var Rr=function(){function t(){}return function(n){if(!Rl(n))return{};if(Ot)return Ot(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function Ir(){}function xr(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Cr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}function Pr(){var e=new Cr(this.__wrapped__);return e.__actions__=os(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=os(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=os(this.__views__),e}function kr(){if(this.__filtered__){var e=new Cr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e}function Nr(){var e=this.__wrapped__.value(),t=this.__dir__,n=ul(e),r=t<0,i=n?e.length:0,o=Zs(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=Xt(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return Bo(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var g=-1,y=e[u+=t];++g<f;){var m=l[g],v=m.iteratee,_=m.type,b=v(y);if(_==k)y=b;else if(!b){if(_==P)continue e;break e}}p[h++]=y}return p}function Ar(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Tr(){this.__data__=dr?dr(null):{},this.size=0}function Mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Lr(t){var n=this.__data__;if(dr){var r=n[t];return r===a?e:r}return ht.call(n,t)?n[t]:e}function Ur(t){var n=this.__data__;return dr?n[t]!==e:ht.call(n,t)}function Dr(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dr&&n===e?a:n,this}function jr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zr(){this.__data__=[],this.size=0}function Br(e){var t=this.__data__,n=fi(t,e);return!(n<0||(n==t.length-1?t.pop():It.call(t,n,1),--this.size,0))}function Fr(t){var n=this.__data__,r=fi(n,t);return r<0?e:n[r][1]}function Hr(e){return fi(this.__data__,e)>-1}function qr(e,t){var n=this.__data__,r=fi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vr(){this.size=0,this.__data__={hash:new Ar,map:new(ar||jr),string:new Ar}}function Wr(e){var t=Ws(this,e).delete(e);return this.size-=t?1:0,t}function Kr(e){return Ws(this,e).get(e)}function Gr(e){return Ws(this,e).has(e)}function Yr(e,t){var n=Ws(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Qr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new $r;++t<n;)this.add(e[t])}function Jr(e){return this.__data__.set(e,a),this}function Xr(e){return this.__data__.has(e)}function Zr(e){var t=this.__data__=new jr(e);this.size=t.size}function ei(){this.__data__=new jr,this.size=0}function ti(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ni(e){return this.__data__.get(e)}function ri(e){return this.__data__.has(e)}function ii(e,t){var n=this.__data__;if(n instanceof jr){var i=n.__data__;if(!ar||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new $r(i)}return n.set(e,t),this.size=n.size,this}function oi(e,t){var n=ul(e),r=!n&&cl(e),i=!n&&!r&&pl(e),o=!n&&!r&&!i&&Fl(e),s=n||r||i||o,a=s?Mn(e.length,ot):[],c=a.length;for(var u in e)(t||ht.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||aa(u,c)))&&a.push(u);return a}function si(t){var n=t.length;return n?t[_o(0,n-1)]:e}function ai(e,t){return ka(os(e),mi(t,0,e.length))}function ci(e){return ka(os(e))}function ui(t,n,r){(r!==e&&!ol(t[n],r)||r===e&&!(n in t))&&gi(t,n,r)}function li(t,n,r){var i=t[n];(!ht.call(t,n)||!ol(i,r)||r===e&&!(n in t))&&gi(t,n,r)}function fi(e,t){for(var n=e.length;n--;)if(ol(e[n][0],t))return n;return-1}function hi(e,t,n,r){return Si(e,(function(e,i,o){t(r,e,n(e),o)})),r}function di(e,t){return e&&ss(t,Of(t),e)}function pi(e,t){return e&&ss(t,Rf(t),e)}function gi(e,t,n){"__proto__"==t&&At?At(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function yi(t,n){for(var r=-1,i=n.length,o=Xe(i),s=null==t;++r<i;)o[r]=s?e:vf(t,n[r]);return o}function mi(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function vi(t,n,r,i,o,s){var a,c=n&l,u=n&f,d=n&h;if(r&&(a=o?r(t,i,o,s):r(t)),a!==e)return a;if(!Rl(t))return t;var p=ul(t);if(p){if(a=na(t),!c)return os(t,a)}else{var g=Xs(t),y=g==K||g==G;if(pl(t))return Yo(t,c);if(g==X||g==B||y&&!o){if(a=u||y?{}:ra(t),!c)return u?cs(t,pi(a,t)):as(t,di(a,t))}else{if(!zt[g])return o?t:{};a=ia(t,g,c)}}s||(s=new Zr);var m=s.get(t);if(m)return m;s.set(t,a),jl(t)?t.forEach((function(e){a.add(vi(e,n,r,e,t,s))})):xl(t)&&t.forEach((function(e,i){a.set(i,vi(e,n,r,i,t,s))}));var v=p?e:(d?u?Fs:Bs:u?Rf:Of)(t);return un(v||t,(function(e,i){v&&(e=t[i=e]),li(a,i,vi(e,n,r,i,t,s))})),a}function _i(e){var t=Of(e);return function(n){return bi(n,e,t)}}function bi(t,n,r){var i=r.length;if(null==t)return!i;for(t=rt(t);i--;){var o=r[i],s=n[o],a=t[o];if(a===e&&!(o in t)||!s(a))return!1}return!0}function wi(t,n,r){if("function"!=typeof t)throw new st(o);return Ia((function(){t.apply(e,r)}),n)}function Ei(e,t,n,i){var o=-1,s=dn,a=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=gn(t,Dn(n))),i?(s=pn,a=!1):t.length>=r&&(s=zn,a=!1,t=new Qr(t));e:for(;++o<c;){var f=e[o],h=null==n?f:n(f);if(f=i||0!==f?f:0,a&&h==h){for(var d=l;d--;)if(t[d]===h)continue e;u.push(f)}else s(t,h,i)||u.push(f)}return u}Or.templateSettings={escape:Ie,evaluate:xe,interpolate:Ce,variable:"",imports:{_:Or}},Or.prototype=Ir.prototype,Or.prototype.constructor=Or,xr.prototype=Rr(Ir.prototype),xr.prototype.constructor=xr,Cr.prototype=Rr(Ir.prototype),Cr.prototype.constructor=Cr,Ar.prototype.clear=Tr,Ar.prototype.delete=Mr,Ar.prototype.get=Lr,Ar.prototype.has=Ur,Ar.prototype.set=Dr,jr.prototype.clear=zr,jr.prototype.delete=Br,jr.prototype.get=Fr,jr.prototype.has=Hr,jr.prototype.set=qr,$r.prototype.clear=Vr,$r.prototype.delete=Wr,$r.prototype.get=Kr,$r.prototype.has=Gr,$r.prototype.set=Yr,Qr.prototype.add=Qr.prototype.push=Jr,Qr.prototype.has=Xr,Zr.prototype.clear=ei,Zr.prototype.delete=ti,Zr.prototype.get=ni,Zr.prototype.has=ri,Zr.prototype.set=ii;var Si=fs(Ai),Oi=fs(Ti,!0);function Ri(e,t){var n=!0;return Si(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function Ii(t,n,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=n(s);if(null!=a&&(c===e?a==a&&!Bl(a):r(a,c)))var c=a,u=s}return u}function xi(t,n,r,i){var o=t.length;for((r=Yl(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:Yl(i))<0&&(i+=o),i=r>i?0:Ql(i);r<i;)t[r++]=n;return t}function Ci(e,t){var n=[];return Si(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Pi(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=sa),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Pi(a,t-1,n,r,i):yn(i,a):r||(i[i.length]=a)}return i}var ki=hs(),Ni=hs(!0);function Ai(e,t){return e&&ki(e,t,Of)}function Ti(e,t){return e&&Ni(e,t,Of)}function Mi(e,t){return hn(t,(function(t){return El(e[t])}))}function Li(t,n){for(var r=0,i=(n=Vo(n,t)).length;null!=t&&r<i;)t=t[Aa(n[r++])];return r&&r==i?t:e}function Ui(e,t,n){var r=t(e);return ul(e)?r:yn(r,n(e))}function Di(t){return null==t?t===e?oe:J:Pt&&Pt in rt(t)?Ys(t):ba(t)}function ji(e,t){return e>t}function zi(e,t){return null!=e&&ht.call(e,t)}function Bi(e,t){return null!=e&&t in rt(e)}function Fi(e,t,n){return e>=Xt(t,n)&&e<Qt(t,n)}function Hi(t,n,r){for(var i=r?pn:dn,o=t[0].length,s=t.length,a=s,c=Xe(s),u=1/0,l=[];a--;){var f=t[a];a&&n&&(f=gn(f,Dn(n))),u=Xt(f.length,u),c[a]=!r&&(n||o>=120&&f.length>=120)?new Qr(a&&f):e}f=t[0];var h=-1,d=c[0];e:for(;++h<o&&l.length<u;){var p=f[h],g=n?n(p):p;if(p=r||0!==p?p:0,!(d?zn(d,g):i(l,g,r))){for(a=s;--a;){var y=c[a];if(!(y?zn(y,g):i(t[a],g,r)))continue e}d&&d.push(g),l.push(p)}}return l}function qi(e,t,n,r){return Ai(e,(function(e,i,o){t(r,n(e),i,o)})),r}function $i(t,n,r){var i=null==(t=Ea(t,n=Vo(n,t)))?t:t[Aa(sc(n))];return null==i?e:an(i,t,r)}function Vi(e){return Il(e)&&Di(e)==B}function Wi(e){return Il(e)&&Di(e)==ce}function Ki(e){return Il(e)&&Di(e)==$}function Gi(e,t,n,r,i){return e===t||(null==e||null==t||!Il(e)&&!Il(t)?e!=e&&t!=t:Yi(e,t,n,r,Gi,i))}function Yi(e,t,n,r,i,o){var s=ul(e),a=ul(t),c=s?F:Xs(e),u=a?F:Xs(t),l=(c=c==B?X:c)==X,f=(u=u==B?X:u)==X,h=c==u;if(h&&pl(e)){if(!pl(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new Zr),s||Fl(e)?Us(e,t,n,r,i,o):Ds(e,t,c,n,r,i,o);if(!(n&d)){var p=l&&ht.call(e,"__wrapped__"),g=f&&ht.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,m=g?t.value():t;return o||(o=new Zr),i(y,m,n,r,o)}}return!!h&&(o||(o=new Zr),js(e,t,n,r,i,o))}function Qi(e){return Il(e)&&Xs(e)==Y}function Ji(t,n,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=rt(t);o--;){var c=r[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=r[o])[0],l=t[u],f=c[1];if(a&&c[2]){if(l===e&&!(u in t))return!1}else{var h=new Zr;if(i)var g=i(l,f,u,t,n,h);if(!(g===e?Gi(f,l,d|p,i,h):g))return!1}}return!0}function Xi(e){return!(!Rl(e)||ha(e))&&(El(e)?vt:We).test(Ta(e))}function Zi(e){return Il(e)&&Di(e)==te}function eo(e){return Il(e)&&Xs(e)==ne}function to(e){return Il(e)&&Ol(e.length)&&!!jt[Di(e)]}function no(e){return"function"==typeof e?e:null==e?Ah:"object"==typeof e?ul(e)?co(e[0],e[1]):ao(e):Vh(e)}function ro(e){if(!pa(e))return Yt(e);var t=[];for(var n in rt(e))ht.call(e,n)&&"constructor"!=n&&t.push(n);return t}function io(e){if(!Rl(e))return _a(e);var t=pa(e),n=[];for(var r in e)"constructor"==r&&(t||!ht.call(e,r))||n.push(r);return n}function oo(e,t){return e<t}function so(e,t){var n=-1,r=fl(e)?Xe(e.length):[];return Si(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function ao(e){var t=Ks(e);return 1==t.length&&t[0][2]?ya(t[0][0],t[0][1]):function(n){return n===e||Ji(n,e,t)}}function co(t,n){return ua(t)&&ga(n)?ya(Aa(t),n):function(r){var i=vf(r,t);return i===e&&i===n?bf(r,t):Gi(n,i,d|p)}}function uo(t,n,r,i,o){t!==n&&ki(n,(function(s,a){if(o||(o=new Zr),Rl(s))lo(t,n,a,r,uo,i,o);else{var c=i?i(Oa(t,a),s,a+"",t,n,o):e;c===e&&(c=s),ui(t,a,c)}}),Rf)}function lo(t,n,r,i,o,s,a){var c=Oa(t,r),u=Oa(n,r),l=a.get(u);if(l)ui(t,r,l);else{var f=s?s(c,u,r+"",t,n,a):e,h=f===e;if(h){var d=ul(u),p=!d&&pl(u),g=!d&&!p&&Fl(u);f=u,d||p||g?ul(c)?f=c:hl(c)?f=os(c):p?(h=!1,f=Yo(u,!0)):g?(h=!1,f=es(u,!0)):f=[]:Ll(u)||cl(u)?(f=c,cl(c)?f=Xl(c):(!Rl(c)||El(c))&&(f=ra(u))):h=!1}h&&(a.set(u,f),o(f,u,i,s,a),a.delete(u)),ui(t,r,f)}}function fo(t,n){var r=t.length;if(r)return aa(n+=n<0?r:0,r)?t[n]:e}function ho(e,t,n){t=t.length?gn(t,(function(e){return ul(e)?function(t){return Li(t,1===e.length?e[0]:e)}:e})):[Ah];var r=-1;t=gn(t,Dn(Vs()));var i=so(e,(function(e,n,i){var o=gn(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return An(i,(function(e,t){return ns(e,t,n)}))}function po(e,t){return go(e,t,(function(t,n){return bf(e,n)}))}function go(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=Li(e,s);n(a,s)&&Ro(o,Vo(s,e),a)}return o}function yo(e){return function(t){return Li(t,e)}}function mo(e,t,n,r){var i=r?In:Rn,o=-1,s=t.length,a=e;for(e===t&&(t=os(t)),n&&(a=gn(e,Dn(n)));++o<s;)for(var c=0,u=t[o],l=n?n(u):u;(c=i(a,l,c,r))>-1;)a!==e&&It.call(a,c,1),It.call(e,c,1);return e}function vo(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;aa(i)?It.call(e,i,1):Do(e,i)}}return e}function _o(e,t){return e+Ft(wn()*(t-e+1))}function bo(e,t,n,r){for(var i=-1,o=Qt(Bt((t-e)/(n||1)),0),s=Xe(o);o--;)s[r?o:++i]=e,e+=n;return s}function wo(e,t){var n="";if(!e||t<1||t>T)return n;do{t%2&&(n+=e),(t=Ft(t/2))&&(e+=e)}while(t);return n}function Eo(e,t){return xa(wa(e,t,Ah),e+"")}function So(e){return si(qf(e))}function Oo(e,t){var n=qf(e);return ka(n,mi(t,0,n.length))}function Ro(t,n,r,i){if(!Rl(t))return t;for(var o=-1,s=(n=Vo(n,t)).length,a=s-1,c=t;null!=c&&++o<s;){var u=Aa(n[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var f=c[u];(l=i?i(f,u,c):e)===e&&(l=Rl(f)?f:aa(n[o+1])?[]:{})}li(c,u,l),c=c[u]}return t}var Io=pr?function(e,t){return pr.set(e,t),e}:Ah,xo=At?function(e,t){return At(e,"toString",{configurable:!0,enumerable:!1,value:Ch(t),writable:!0})}:Ah;function Co(e){return ka(qf(e))}function Po(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Xe(i);++r<i;)o[r]=e[r+t];return o}function ko(e,t){var n;return Si(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function No(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=j){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!Bl(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return Ao(e,t,Ah,n)}function Ao(t,n,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(n=r(n))!=n,c=null===n,u=Bl(n),l=n===e;o<s;){var f=Ft((o+s)/2),h=r(t[f]),d=h!==e,p=null===h,g=h==h,y=Bl(h);if(a)var m=i||g;else m=l?g&&(i||d):c?g&&d&&(i||!p):u?g&&d&&!p&&(i||!y):!p&&!y&&(i?h<=n:h<n);m?o=f+1:s=f}return Xt(s,D)}function To(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!ol(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function Mo(e){return"number"==typeof e?e:Bl(e)?L:+e}function Lo(e){if("string"==typeof e)return e;if(ul(e))return gn(e,Lo)+"";if(Bl(e))return Sr?Sr.call(e):"";var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Uo(e,t,n){var i=-1,o=dn,s=e.length,a=!0,c=[],u=c;if(n)a=!1,o=pn;else if(s>=r){var l=t?null:ks(e);if(l)return Zn(l);a=!1,o=zn,u=new Qr}else u=t?[]:c;e:for(;++i<s;){var f=e[i],h=t?t(f):f;if(f=n||0!==f?f:0,a&&h==h){for(var d=u.length;d--;)if(u[d]===h)continue e;t&&u.push(h),c.push(f)}else o(u,h,n)||(u!==c&&u.push(h),c.push(f))}return c}function Do(e,t){return null==(e=Ea(e,t=Vo(t,e)))||delete e[Aa(sc(t))]}function jo(e,t,n,r){return Ro(e,t,n(Li(e,t)),r)}function zo(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Po(e,r?0:o,r?o+1:i):Po(e,r?o+1:0,r?i:o)}function Bo(e,t){var n=e;return n instanceof Cr&&(n=n.value()),mn(t,(function(e,t){return t.func.apply(t.thisArg,yn([e],t.args))}),n)}function Fo(e,t,n){var r=e.length;if(r<2)return r?Uo(e[0]):[];for(var i=-1,o=Xe(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=Ei(o[i]||s,e[a],t,n));return Uo(Pi(o,1),t,n)}function Ho(t,n,r){for(var i=-1,o=t.length,s=n.length,a={};++i<o;){var c=i<s?n[i]:e;r(a,t[i],c)}return a}function qo(e){return hl(e)?e:[]}function $o(e){return"function"==typeof e?e:Ah}function Vo(e,t){return ul(e)?e:ua(e,t)?[e]:Na(ef(e))}var Wo=Eo;function Ko(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:Po(t,n,r)}var Go=Tt||function(e){return Gt.clearTimeout(e)};function Yo(e,t){if(t)return e.slice();var n=e.length,r=Et?Et(n):new e.constructor(n);return e.copy(r),r}function Qo(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Jo(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Xo(e){var t=new e.constructor(e.source,qe.exec(e));return t.lastIndex=e.lastIndex,t}function Zo(e){return Er?rt(Er.call(e)):{}}function es(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ts(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,s=Bl(t),a=n!==e,c=null===n,u=n==n,l=Bl(n);if(!c&&!l&&!s&&t>n||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t<n||l&&r&&o&&!i&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function ns(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var c=ts(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}function rs(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,c=t.length,u=Qt(o-s,0),l=Xe(c+u),f=!r;++a<c;)l[a]=t[a];for(;++i<s;)(f||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[a++]=e[i++];return l}function is(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,c=-1,u=t.length,l=Qt(o-a,0),f=Xe(l+u),h=!r;++i<l;)f[i]=e[i];for(var d=i;++c<u;)f[d+c]=t[c];for(;++s<a;)(h||i<o)&&(f[d+n[s]]=e[i++]);return f}function os(e,t){var n=-1,r=e.length;for(t||(t=Xe(r));++n<r;)t[n]=e[n];return t}function ss(t,n,r,i){var o=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var c=n[s],u=i?i(r[c],t[c],c,r,t):e;u===e&&(u=t[c]),o?gi(r,c,u):li(r,c,u)}return r}function as(e,t){return ss(e,Qs(e),t)}function cs(e,t){return ss(e,Js(e),t)}function us(e,t){return function(n,r){var i=ul(n)?cn:hi,o=t?t():{};return i(n,e,Vs(r,2),o)}}function ls(t){return Eo((function(n,r){var i=-1,o=r.length,s=o>1?r[o-1]:e,a=o>2?r[2]:e;for(s=t.length>3&&"function"==typeof s?(o--,s):e,a&&ca(r[0],r[1],a)&&(s=o<3?e:s,o=1),n=rt(n);++i<o;){var c=r[i];c&&t(n,c,i,s)}return n}))}function fs(e,t){return function(n,r){if(null==n)return n;if(!fl(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=rt(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function hs(e){return function(t,n,r){for(var i=-1,o=rt(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}function ds(e,t,n){var r=t&g,i=ys(e);function o(){return(this&&this!==Gt&&this instanceof o?i:e).apply(r?n:this,arguments)}return o}function ps(t){return function(n){var r=Kn(n=ef(n))?ir(n):e,i=r?r[0]:n.charAt(0),o=r?Ko(r,1).join(""):n.slice(1);return i[t]()+o}}function gs(e){return function(t){return mn(Sh(Qf(t).replace(kt,"")),e,"")}}function ys(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Rr(e.prototype),r=e.apply(n,t);return Rl(r)?r:n}}function ms(t,n,r){var i=ys(t);function o(){for(var s=arguments.length,a=Xe(s),c=s,u=$s(o);c--;)a[c]=arguments[c];var l=s<3&&a[0]!==u&&a[s-1]!==u?[]:Xn(a,u);return(s-=l.length)<r?Cs(t,n,bs,o.placeholder,e,a,l,e,e,r-s):an(this&&this!==Gt&&this instanceof o?i:t,this,a)}return o}function vs(t){return function(n,r,i){var o=rt(n);if(!fl(n)){var s=Vs(r,3);n=Of(n),r=function(e){return s(o[e],e,o)}}var a=t(n,r,i);return a>-1?o[s?n[a]:a]:e}}function _s(t){return zs((function(n){var r=n.length,i=r,s=xr.prototype.thru;for(t&&n.reverse();i--;){var a=n[i];if("function"!=typeof a)throw new st(o);if(s&&!c&&"wrapper"==qs(a))var c=new xr([],!0)}for(i=c?i:r;++i<r;){var u=qs(a=n[i]),l="wrapper"==u?Hs(a):e;c=l&&fa(l[0])&&l[1]==(E|v|b|S)&&!l[4].length&&1==l[9]?c[qs(l[0])].apply(c,l[3]):1==a.length&&fa(a)?c[u]():c.thru(a)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&ul(t))return c.plant(t).value();for(var i=0,o=r?n[i].apply(this,e):t;++i<r;)o=n[i].call(this,o);return o}}))}function bs(t,n,r,i,o,s,a,c,u,l){var f=n&E,h=n&g,d=n&y,p=n&(v|_),m=n&O,b=d?e:ys(t);function w(){for(var e=arguments.length,g=Xe(e),y=e;y--;)g[y]=arguments[y];if(p)var v=$s(w),_=Hn(g,v);if(i&&(g=rs(g,i,o,p)),s&&(g=is(g,s,a,p)),e-=_,p&&e<l){var E=Xn(g,v);return Cs(t,n,bs,w.placeholder,r,g,E,c,u,l-e)}var S=h?r:this,O=d?S[t]:t;return e=g.length,c?g=Sa(g,c):m&&e>1&&g.reverse(),f&&u<e&&(g.length=u),this&&this!==Gt&&this instanceof w&&(O=b||ys(O)),O.apply(S,g)}return w}function ws(e,t){return function(n,r){return qi(n,e,t(r),{})}}function Es(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=Lo(r),i=Lo(i)):(r=Mo(r),i=Mo(i)),o=t(r,i)}return o}}function Ss(e){return zs((function(t){return t=gn(t,Dn(Vs())),Eo((function(n){var r=this;return e(t,(function(e){return an(e,r,n)}))}))}))}function Os(t,n){var r=(n=n===e?" ":Lo(n)).length;if(r<2)return r?wo(n,t):n;var i=wo(n,Bt(t/rr(n)));return Kn(n)?Ko(ir(i),0,t).join(""):i.slice(0,t)}function Rs(e,t,n,r){var i=t&g,o=ys(e);function s(){for(var t=-1,a=arguments.length,c=-1,u=r.length,l=Xe(u+a),f=this&&this!==Gt&&this instanceof s?o:e;++c<u;)l[c]=r[c];for(;a--;)l[c++]=arguments[++t];return an(f,i?n:this,l)}return s}function Is(t){return function(n,r,i){return i&&"number"!=typeof i&&ca(n,r,i)&&(r=i=e),n=Gl(n),r===e?(r=n,n=0):r=Gl(r),bo(n,r,i=i===e?n<r?1:-1:Gl(i),t)}}function xs(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Jl(t),n=Jl(n)),e(t,n)}}function Cs(t,n,r,i,o,s,a,c,u,l){var f=n&v;n|=f?b:w,(n&=~(f?w:b))&m||(n&=~(g|y));var h=[t,n,o,f?s:e,f?a:e,f?e:s,f?e:a,c,u,l],d=r.apply(e,h);return fa(t)&&Ra(d,h),d.placeholder=i,Ca(d,t,n)}function Ps(e){var t=nt[e];return function(e,n){if(e=Jl(e),(n=null==n?0:Xt(Yl(n),292))&&Wt(e)){var r=(ef(e)+"e").split("e");return+((r=(ef(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ks=lr&&1/Zn(new lr([,-0]))[1]==A?function(e){return new lr(e)}:Bh;function Ns(e){return function(t){var n=Xs(t);return n==Y?Qn(t):n==ne?er(t):Ln(t,e(t))}}function As(t,n,r,i,s,a,c,u){var l=n&y;if(!l&&"function"!=typeof t)throw new st(o);var f=i?i.length:0;if(f||(n&=~(b|w),i=s=e),c=c===e?c:Qt(Yl(c),0),u=u===e?u:Yl(u),f-=s?s.length:0,n&w){var h=i,d=s;i=s=e}var p=l?e:Hs(t),m=[t,n,r,i,s,h,d,a,c,u];if(p&&va(m,p),t=m[0],n=m[1],r=m[2],i=m[3],s=m[4],!(u=m[9]=m[9]===e?l?0:t.length:Qt(m[9]-f,0))&&n&(v|_)&&(n&=~(v|_)),n&&n!=g)E=n==v||n==_?ms(t,n,u):n!=b&&n!=(g|b)||s.length?bs.apply(e,m):Rs(t,n,r,i);else var E=ds(t,n,r);return Ca((p?Io:Ra)(E,m),t,n)}function Ts(t,n,r,i){return t===e||ol(t,ut[r])&&!ht.call(i,r)?n:t}function Ms(t,n,r,i,o,s){return Rl(t)&&Rl(n)&&(s.set(n,t),uo(t,n,e,Ms,s),s.delete(n)),t}function Ls(t){return Ll(t)?e:t}function Us(t,n,r,i,o,s){var a=r&d,c=t.length,u=n.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(t),f=s.get(n);if(l&&f)return l==n&&f==t;var h=-1,g=!0,y=r&p?new Qr:e;for(s.set(t,n),s.set(n,t);++h<c;){var m=t[h],v=n[h];if(i)var _=a?i(v,m,h,n,t,s):i(m,v,h,t,n,s);if(_!==e){if(_)continue;g=!1;break}if(y){if(!_n(n,(function(e,t){if(!zn(y,t)&&(m===e||o(m,e,r,i,s)))return y.push(t)}))){g=!1;break}}else if(m!==v&&!o(m,v,r,i,s)){g=!1;break}}return s.delete(t),s.delete(n),g}function Ds(e,t,n,r,i,o,s){switch(n){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ce:return!(e.byteLength!=t.byteLength||!o(new wt(e),new wt(t)));case q:case $:case Q:return ol(+e,+t);case W:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var a=Qn;case ne:var c=r&d;if(a||(a=Zn),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=p,s.set(e,t);var l=Us(a(e),a(t),r,i,o,s);return s.delete(e),l;case ie:if(Er)return Er.call(e)==Er.call(t)}return!1}function js(t,n,r,i,o,s){var a=r&d,c=Bs(t),u=c.length;if(u!=Bs(n).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in n:ht.call(n,f)))return!1}var h=s.get(t),p=s.get(n);if(h&&p)return h==n&&p==t;var g=!0;s.set(t,n),s.set(n,t);for(var y=a;++l<u;){var m=t[f=c[l]],v=n[f];if(i)var _=a?i(v,m,f,n,t,s):i(m,v,f,t,n,s);if(!(_===e?m===v||o(m,v,r,i,s):_)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=t.constructor,w=n.constructor;b!=w&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(n),g}function zs(t){return xa(wa(t,e,Ya),t+"")}function Bs(e){return Ui(e,Of,Qs)}function Fs(e){return Ui(e,Rf,Js)}var Hs=pr?function(e){return pr.get(e)}:Bh;function qs(e){for(var t=e.name+"",n=gr[t],r=ht.call(gr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function $s(e){return(ht.call(Or,"placeholder")?Or:e).placeholder}function Vs(){var e=Or.iteratee||Th;return e=e===Th?no:e,arguments.length?e(arguments[0],arguments[1]):e}function Ws(e,t){var n=e.__data__;return la(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ks(e){for(var t=Of(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ga(i)]}return t}function Gs(t,n){var r=Wn(t,n);return Xi(r)?r:e}function Ys(t){var n=ht.call(t,Pt),r=t[Pt];try{t[Pt]=e;var i=!0}catch{}var o=gt.call(t);return i&&(n?t[Pt]=r:delete t[Pt]),o}var Qs=Ht?function(e){return null==e?[]:(e=rt(e),hn(Ht(e),(function(t){return Rt.call(e,t)})))}:Yh,Js=Ht?function(e){for(var t=[];e;)yn(t,Qs(e)),e=St(e);return t}:Yh,Xs=Di;function Zs(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Xt(t,e+s);break;case"takeRight":e=Qt(e,t-s)}}return{start:e,end:t}}function ea(e){var t=e.match(De);return t?t[1].split(je):[]}function ta(e,t,n){for(var r=-1,i=(t=Vo(t,e)).length,o=!1;++r<i;){var s=Aa(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ol(i)&&aa(s,i)&&(ul(e)||cl(e))}function na(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ht.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ra(e){return"function"!=typeof e.constructor||pa(e)?{}:Rr(St(e))}function ia(e,t,n){var r=e.constructor;switch(t){case ce:return Qo(e);case q:case $:return new r(+e);case ue:return Jo(e,n);case le:case fe:case he:case de:case pe:case ge:case ye:case me:case ve:return es(e,n);case Y:return new r;case Q:case re:return new r(e);case te:return Xo(e);case ne:return new r;case ie:return Zo(e)}}function oa(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ue,"{\n/* [wrapped with "+t+"] */\n")}function sa(e){return ul(e)||cl(e)||!!(xt&&e&&e[xt])}function aa(e,t){var n=typeof e;return!!(t=t??T)&&("number"==n||"symbol"!=n&&Ge.test(e))&&e>-1&&e%1==0&&e<t}function ca(e,t,n){if(!Rl(n))return!1;var r=typeof t;return!!("number"==r?fl(n)&&aa(t,n.length):"string"==r&&t in n)&&ol(n[t],e)}function ua(e,t){if(ul(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Bl(e))||ke.test(e)||!Pe.test(e)||null!=t&&e in rt(t)}function la(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function fa(e){var t=qs(e),n=Or[t];if("function"!=typeof n||!(t in Cr.prototype))return!1;if(e===n)return!0;var r=Hs(n);return!!r&&e===r[0]}function ha(e){return!!pt&&pt in e}(tr&&Xs(new tr(new ArrayBuffer(1)))!=ue||ar&&Xs(new ar)!=Y||cr&&Xs(cr.resolve())!=Z||lr&&Xs(new lr)!=ne||hr&&Xs(new hr)!=se)&&(Xs=function(t){var n=Di(t),r=n==X?t.constructor:e,i=r?Ta(r):"";if(i)switch(i){case yr:return ue;case mr:return Y;case vr:return Z;case _r:return ne;case br:return se}return n});var da=lt?El:Qh;function pa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ut)}function ga(e){return e==e&&!Rl(e)}function ya(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in rt(r))}}function ma(e){var t=Fu(e,(function(e){return n.size===c&&n.clear(),e})),n=t.cache;return t}function va(e,t){var n=e[1],r=t[1],i=n|r,o=i<(g|y|E),s=r==E&&n==v||r==E&&n==S&&e[7].length<=t[8]||r==(E|S)&&t[7].length<=t[8]&&n==v;if(!o&&!s)return e;r&g&&(e[2]=t[2],i|=n&g?0:m);var a=t[3];if(a){var c=e[3];e[3]=c?rs(c,a,t[4]):a,e[4]=c?Xn(e[3],u):t[4]}return(a=t[5])&&(c=e[5],e[5]=c?is(c,a,t[6]):a,e[6]=c?Xn(e[5],u):t[6]),(a=t[7])&&(e[7]=a),r&E&&(e[8]=null==e[8]?t[8]:Xt(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function _a(e){var t=[];if(null!=e)for(var n in rt(e))t.push(n);return t}function ba(e){return gt.call(e)}function wa(t,n,r){return n=Qt(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=Qt(e.length-n,0),s=Xe(o);++i<o;)s[i]=e[n+i];i=-1;for(var a=Xe(n+1);++i<n;)a[i]=e[i];return a[n]=r(s),an(t,this,a)}}function Ea(e,t){return t.length<2?e:Li(e,Po(t,0,-1))}function Sa(t,n){for(var r=t.length,i=Xt(n.length,r),o=os(t);i--;){var s=n[i];t[i]=aa(s,r)?o[s]:e}return t}function Oa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ra=Pa(Io),Ia=Lt||function(e,t){return Gt.setTimeout(e,t)},xa=Pa(xo);function Ca(e,t,n){var r=t+"";return xa(e,oa(r,Ma(ea(r),n)))}function Pa(t){var n=0,r=0;return function(){var i=Zt(),o=C-(i-r);if(r=i,o>0){if(++n>=x)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ka(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var s=_o(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=n,t}var Na=ma((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ne,(function(e,n,r,i){t.push(r?i.replace(Fe,"$1"):n||e)})),t}));function Aa(e){if("string"==typeof e||Bl(e))return e;var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Ta(e){if(null!=e){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ma(e,t){return un(z,(function(n){var r="_."+n[0];t&n[1]&&!dn(e,r)&&e.push(r)})),e.sort()}function La(e){if(e instanceof Cr)return e.clone();var t=new xr(e.__wrapped__,e.__chain__);return t.__actions__=os(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Ua(t,n,r){n=(r?ca(t,n,r):n===e)?1:Qt(Yl(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,s=0,a=Xe(Bt(i/n));o<i;)a[s++]=Po(t,o,o+=n);return a}function Da(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function ja(){var e=arguments.length;if(!e)return[];for(var t=Xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return yn(ul(n)?os(n):[n],Pi(t,1))}var za=Eo((function(e,t){return hl(e)?Ei(e,Pi(t,1,hl,!0)):[]})),Ba=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),Vs(r,2)):[]})),Fa=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),e,r):[]}));function Ha(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=r||n===e?1:Yl(n))<0?0:n,i):[]}function qa(t,n,r){var i=null==t?0:t.length;return i?Po(t,0,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n):[]}function $a(e,t){return e&&e.length?zo(e,Vs(t,3),!0,!0):[]}function Va(e,t){return e&&e.length?zo(e,Vs(t,3),!0):[]}function Wa(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ca(e,t,n)&&(n=0,r=i),xi(e,t,n,r)):[]}function Ka(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),On(e,Vs(t,3),i)}function Ga(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=Yl(r),o=r<0?Qt(i+o,0):Xt(o,i-1)),On(t,Vs(n,3),o,!0)}function Ya(e){return null!=e&&e.length?Pi(e,1):[]}function Qa(e){return null!=e&&e.length?Pi(e,A):[]}function Ja(t,n){return null!=t&&t.length?Pi(t,n=n===e?1:Yl(n)):[]}function Xa(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}function Za(t){return t&&t.length?t[0]:e}function ec(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),Rn(e,t,i)}function tc(e){return null!=e&&e.length?Po(e,0,-1):[]}var nc=Eo((function(e){var t=gn(e,qo);return t.length&&t[0]===e[0]?Hi(t):[]})),rc=Eo((function(t){var n=sc(t),r=gn(t,qo);return n===sc(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Hi(r,Vs(n,2)):[]})),ic=Eo((function(t){var n=sc(t),r=gn(t,qo);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Hi(r,e,n):[]}));function oc(e,t){return null==e?"":Kt.call(e,t)}function sc(t){var n=null==t?0:t.length;return n?t[n-1]:e}function ac(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=Yl(r))<0?Qt(i+o,0):Xt(o,i-1)),n==n?nr(t,n,o):On(t,xn,o,!0)}function cc(t,n){return t&&t.length?fo(t,Yl(n)):e}var uc=Eo(lc);function lc(e,t){return e&&e.length&&t&&t.length?mo(e,t):e}function fc(e,t,n){return e&&e.length&&t&&t.length?mo(e,t,Vs(n,2)):e}function hc(t,n,r){return t&&t.length&&n&&n.length?mo(t,n,e,r):t}var dc=zs((function(e,t){var n=null==e?0:e.length,r=yi(e,t);return vo(e,gn(t,(function(e){return aa(e,n)?+e:e})).sort(ts)),r}));function pc(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Vs(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return vo(e,i),n}function gc(e){return null==e?e:kn.call(e)}function yc(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&ca(t,n,r)?(n=0,r=i):(n=null==n?0:Yl(n),r=r===e?i:Yl(r)),Po(t,n,r)):[]}function mc(e,t){return No(e,t)}function vc(e,t,n){return Ao(e,t,Vs(n,2))}function _c(e,t){var n=null==e?0:e.length;if(n){var r=No(e,t);if(r<n&&ol(e[r],t))return r}return-1}function bc(e,t){return No(e,t,!0)}function wc(e,t,n){return Ao(e,t,Vs(n,2),!0)}function Ec(e,t){if(null!=e&&e.length){var n=No(e,t,!0)-1;if(ol(e[n],t))return n}return-1}function Sc(e){return e&&e.length?To(e):[]}function Oc(e,t){return e&&e.length?To(e,Vs(t,2)):[]}function Rc(e){var t=null==e?0:e.length;return t?Po(e,1,t):[]}function Ic(t,n,r){return t&&t.length?Po(t,0,(n=r||n===e?1:Yl(n))<0?0:n):[]}function xc(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n,i):[]}function Cc(e,t){return e&&e.length?zo(e,Vs(t,3),!1,!0):[]}function Pc(e,t){return e&&e.length?zo(e,Vs(t,3)):[]}var kc=Eo((function(e){return Uo(Pi(e,1,hl,!0))})),Nc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Uo(Pi(t,1,hl,!0),Vs(n,2))})),Ac=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Uo(Pi(t,1,hl,!0),e,n)}));function Tc(e){return e&&e.length?Uo(e):[]}function Mc(e,t){return e&&e.length?Uo(e,Vs(t,2)):[]}function Lc(t,n){return n="function"==typeof n?n:e,t&&t.length?Uo(t,e,n):[]}function Uc(e){if(!e||!e.length)return[];var t=0;return e=hn(e,(function(e){if(hl(e))return t=Qt(e.length,t),!0})),Mn(t,(function(t){return gn(e,Pn(t))}))}function Dc(t,n){if(!t||!t.length)return[];var r=Uc(t);return null==n?r:gn(r,(function(t){return an(n,e,t)}))}var jc=Eo((function(e,t){return hl(e)?Ei(e,t):[]})),zc=Eo((function(e){return Fo(hn(e,hl))})),Bc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Fo(hn(t,hl),Vs(n,2))})),Fc=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Fo(hn(t,hl),e,n)})),Hc=Eo(Uc);function qc(e,t){return Ho(e||[],t||[],li)}function $c(e,t){return Ho(e||[],t||[],Ro)}var Vc=Eo((function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,Dc(t,r)}));function Wc(e){var t=Or(e);return t.__chain__=!0,t}function Kc(e,t){return t(e),e}function Gc(e,t){return t(e)}var Yc=zs((function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return yi(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Cr&&aa(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:Gc,args:[o],thisArg:e}),new xr(i,this.__chain__).thru((function(t){return n&&!t.length&&t.push(e),t}))):this.thru(o)}));function Qc(){return Wc(this)}function Jc(){return new xr(this.value(),this.__chain__)}function Xc(){this.__values__===e&&(this.__values__=Kl(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}}function Zc(){return this}function eu(t){for(var n,r=this;r instanceof Ir;){var i=La(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n}function tu(){var t=this.__wrapped__;if(t instanceof Cr){var n=t;return this.__actions__.length&&(n=new Cr(this)),(n=n.reverse()).__actions__.push({func:Gc,args:[gc],thisArg:e}),new xr(n,this.__chain__)}return this.thru(gc)}function nu(){return Bo(this.__wrapped__,this.__actions__)}var ru=us((function(e,t,n){ht.call(e,n)?++e[n]:gi(e,n,1)}));function iu(t,n,r){var i=ul(t)?fn:Ri;return r&&ca(t,n,r)&&(n=e),i(t,Vs(n,3))}function ou(e,t){return(ul(e)?hn:Ci)(e,Vs(t,3))}var su=vs(Ka),au=vs(Ga);function cu(e,t){return Pi(mu(e,t),1)}function uu(e,t){return Pi(mu(e,t),A)}function lu(t,n,r){return r=r===e?1:Yl(r),Pi(mu(t,n),r)}function fu(e,t){return(ul(e)?un:Si)(e,Vs(t,3))}function hu(e,t){return(ul(e)?ln:Oi)(e,Vs(t,3))}var du=us((function(e,t,n){ht.call(e,n)?e[n].push(t):gi(e,n,[t])}));function pu(e,t,n,r){e=fl(e)?e:qf(e),n=n&&!r?Yl(n):0;var i=e.length;return n<0&&(n=Qt(i+n,0)),zl(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Rn(e,t,n)>-1}var gu=Eo((function(e,t,n){var r=-1,i="function"==typeof t,o=fl(e)?Xe(e.length):[];return Si(e,(function(e){o[++r]=i?an(t,e,n):$i(e,t,n)})),o})),yu=us((function(e,t,n){gi(e,n,t)}));function mu(e,t){return(ul(e)?gn:so)(e,Vs(t,3))}function vu(t,n,r,i){return null==t?[]:(ul(n)||(n=null==n?[]:[n]),ul(r=i?e:r)||(r=null==r?[]:[r]),ho(t,n,r))}var _u=us((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function bu(e,t,n){var r=ul(e)?mn:Nn,i=arguments.length<3;return r(e,Vs(t,4),n,i,Si)}function wu(e,t,n){var r=ul(e)?vn:Nn,i=arguments.length<3;return r(e,Vs(t,4),n,i,Oi)}function Eu(e,t){return(ul(e)?hn:Ci)(e,Hu(Vs(t,3)))}function Su(e){return(ul(e)?si:So)(e)}function Ou(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),(ul(t)?ai:Oo)(t,n)}function Ru(e){return(ul(e)?ci:Co)(e)}function Iu(e){if(null==e)return 0;if(fl(e))return zl(e)?rr(e):e.length;var t=Xs(e);return t==Y||t==ne?e.size:ro(e).length}function xu(t,n,r){var i=ul(t)?_n:ko;return r&&ca(t,n,r)&&(n=e),i(t,Vs(n,3))}var Cu=Eo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ca(e,t[0],t[1])?t=[]:n>2&&ca(t[0],t[1],t[2])&&(t=[t[0]]),ho(e,Pi(t,1),[])})),Pu=Mt||function(){return Gt.Date.now()};function ku(e,t){if("function"!=typeof t)throw new st(o);return e=Yl(e),function(){if(--e<1)return t.apply(this,arguments)}}function Nu(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,As(t,E,e,e,e,e,n)}function Au(t,n){var r;if("function"!=typeof n)throw new st(o);return t=Yl(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=e),r}}var Tu=Eo((function(e,t,n){var r=g;if(n.length){var i=Xn(n,$s(Tu));r|=b}return As(e,r,t,n,i)})),Mu=Eo((function(e,t,n){var r=g|y;if(n.length){var i=Xn(n,$s(Mu));r|=b}return As(t,r,e,n,i)}));function Lu(t,n,r){var i=As(t,v,e,e,e,e,e,n=r?e:n);return i.placeholder=Lu.placeholder,i}function Uu(t,n,r){var i=As(t,_,e,e,e,e,e,n=r?e:n);return i.placeholder=Uu.placeholder,i}function Du(t,n,r){var i,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new st(o);function g(n){var r=i,o=s;return i=s=e,f=n,c=t.apply(o,r)}function y(e){return f=e,u=Ia(_,n),h?g(e):c}function m(e){var t=n-(e-l);return d?Xt(t,a-(e-f)):t}function v(t){var r=t-l;return l===e||r>=n||r<0||d&&t-f>=a}function _(){var e=Pu();if(v(e))return b(e);u=Ia(_,m(e))}function b(t){return u=e,p&&i?g(t):(i=s=e,c)}function w(){u!==e&&Go(u),f=0,i=l=s=u=e}function E(){return u===e?c:b(Pu())}function S(){var t=Pu(),r=v(t);if(i=arguments,s=this,l=t,r){if(u===e)return y(l);if(d)return Go(u),u=Ia(_,n),g(l)}return u===e&&(u=Ia(_,n)),c}return n=Jl(n)||0,Rl(r)&&(h=!!r.leading,a=(d="maxWait"in r)?Qt(Jl(r.maxWait)||0,n):a,p="trailing"in r?!!r.trailing:p),S.cancel=w,S.flush=E,S}var ju=Eo((function(e,t){return wi(e,1,t)})),zu=Eo((function(e,t,n){return wi(e,Jl(t)||0,n)}));function Bu(e){return As(e,O)}function Fu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new st(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Fu.Cache||$r),n}function Hu(e){if("function"!=typeof e)throw new st(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qu(e){return Au(2,e)}Fu.Cache=$r;var $u=Wo((function(e,t){var n=(t=1==t.length&&ul(t[0])?gn(t[0],Dn(Vs())):gn(Pi(t,1),Dn(Vs()))).length;return Eo((function(r){for(var i=-1,o=Xt(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return an(e,this,r)}))})),Vu=Eo((function(t,n){var r=Xn(n,$s(Vu));return As(t,b,e,n,r)})),Wu=Eo((function(t,n){var r=Xn(n,$s(Wu));return As(t,w,e,n,r)})),Ku=zs((function(t,n){return As(t,S,e,e,e,n)}));function Gu(t,n){if("function"!=typeof t)throw new st(o);return Eo(t,n=n===e?n:Yl(n))}function Yu(e,t){if("function"!=typeof e)throw new st(o);return t=null==t?0:Qt(Yl(t),0),Eo((function(n){var r=n[t],i=Ko(n,0,t);return r&&yn(i,r),an(e,this,i)}))}function Qu(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new st(o);return Rl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Du(e,t,{leading:r,maxWait:t,trailing:i})}function Ju(e){return Nu(e,1)}function Xu(e,t){return Vu($o(t),e)}function Zu(){if(!arguments.length)return[];var e=arguments[0];return ul(e)?e:[e]}function el(e){return vi(e,h)}function tl(t,n){return vi(t,h,n="function"==typeof n?n:e)}function nl(e){return vi(e,l|h)}function rl(t,n){return vi(t,l|h,n="function"==typeof n?n:e)}function il(e,t){return null==t||bi(e,t,Of(t))}function ol(e,t){return e===t||e!=e&&t!=t}var sl=xs(ji),al=xs((function(e,t){return e>=t})),cl=Vi(function(){return arguments}())?Vi:function(e){return Il(e)&&ht.call(e,"callee")&&!Rt.call(e,"callee")},ul=Xe.isArray,ll=en?Dn(en):Wi;function fl(e){return null!=e&&Ol(e.length)&&!El(e)}function hl(e){return Il(e)&&fl(e)}function dl(e){return!0===e||!1===e||Il(e)&&Di(e)==q}var pl=qt||Qh,gl=tn?Dn(tn):Ki;function yl(e){return Il(e)&&1===e.nodeType&&!Ll(e)}function ml(e){if(null==e)return!0;if(fl(e)&&(ul(e)||"string"==typeof e||"function"==typeof e.splice||pl(e)||Fl(e)||cl(e)))return!e.length;var t=Xs(e);if(t==Y||t==ne)return!e.size;if(pa(e))return!ro(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function vl(e,t){return Gi(e,t)}function _l(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Gi(t,n,e,r):!!i}function bl(e){if(!Il(e))return!1;var t=Di(e);return t==W||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!Ll(e)}function wl(e){return"number"==typeof e&&Wt(e)}function El(e){if(!Rl(e))return!1;var t=Di(e);return t==K||t==G||t==H||t==ee}function Sl(e){return"number"==typeof e&&e==Yl(e)}function Ol(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T}function Rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Il(e){return null!=e&&"object"==typeof e}var xl=nn?Dn(nn):Qi;function Cl(e,t){return e===t||Ji(e,t,Ks(t))}function Pl(t,n,r){return r="function"==typeof r?r:e,Ji(t,n,Ks(n),r)}function kl(e){return Ml(e)&&e!=+e}function Nl(e){if(da(e))throw new et(i);return Xi(e)}function Al(e){return null===e}function Tl(e){return null==e}function Ml(e){return"number"==typeof e||Il(e)&&Di(e)==Q}function Ll(e){if(!Il(e)||Di(e)!=X)return!1;var t=St(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ft.call(n)==yt}var Ul=rn?Dn(rn):Zi;function Dl(e){return Sl(e)&&e>=-T&&e<=T}var jl=on?Dn(on):eo;function zl(e){return"string"==typeof e||!ul(e)&&Il(e)&&Di(e)==re}function Bl(e){return"symbol"==typeof e||Il(e)&&Di(e)==ie}var Fl=sn?Dn(sn):to;function Hl(t){return t===e}function ql(e){return Il(e)&&Xs(e)==se}function $l(e){return Il(e)&&Di(e)==ae}var Vl=xs(oo),Wl=xs((function(e,t){return e<=t}));function Kl(e){if(!e)return[];if(fl(e))return zl(e)?ir(e):os(e);if(Ct&&e[Ct])return Yn(e[Ct]());var t=Xs(e);return(t==Y?Qn:t==ne?Zn:qf)(e)}function Gl(e){return e?(e=Jl(e))===A||e===-A?(e<0?-1:1)*M:e==e?e:0:0===e?e:0}function Yl(e){var t=Gl(e),n=t%1;return t==t?n?t-n:t:0}function Ql(e){return e?mi(Yl(e),0,U):0}function Jl(e){if("number"==typeof e)return e;if(Bl(e))return L;if(Rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Un(e);var n=Ve.test(e);return n||Ke.test(e)?Vt(e.slice(2),n?2:8):$e.test(e)?L:+e}function Xl(e){return ss(e,Rf(e))}function Zl(e){return e?mi(Yl(e),-T,T):0===e?e:0}function ef(e){return null==e?"":Lo(e)}var tf=ls((function(e,t){if(pa(t)||fl(t))ss(t,Of(t),e);else for(var n in t)ht.call(t,n)&&li(e,n,t[n])})),nf=ls((function(e,t){ss(t,Rf(t),e)})),rf=ls((function(e,t,n,r){ss(t,Rf(t),e,r)})),of=ls((function(e,t,n,r){ss(t,Of(t),e,r)})),sf=zs(yi);function af(e,t){var n=Rr(e);return null==t?n:di(n,t)}var cf=Eo((function(t,n){t=rt(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&ca(n[0],n[1],o)&&(i=1);++r<i;)for(var s=n[r],a=Rf(s),c=-1,u=a.length;++c<u;){var l=a[c],f=t[l];(f===e||ol(f,ut[l])&&!ht.call(t,l))&&(t[l]=s[l])}return t})),uf=Eo((function(t){return t.push(e,Ms),an(Pf,e,t)}));function lf(e,t){return Sn(e,Vs(t,3),Ai)}function ff(e,t){return Sn(e,Vs(t,3),Ti)}function hf(e,t){return null==e?e:ki(e,Vs(t,3),Rf)}function df(e,t){return null==e?e:Ni(e,Vs(t,3),Rf)}function pf(e,t){return e&&Ai(e,Vs(t,3))}function gf(e,t){return e&&Ti(e,Vs(t,3))}function yf(e){return null==e?[]:Mi(e,Of(e))}function mf(e){return null==e?[]:Mi(e,Rf(e))}function vf(t,n,r){var i=null==t?e:Li(t,n);return i===e?r:i}function _f(e,t){return null!=e&&ta(e,t,zi)}function bf(e,t){return null!=e&&ta(e,t,Bi)}var wf=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),e[t]=n}),Ch(Ah)),Ef=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),ht.call(e,t)?e[t].push(n):e[t]=[n]}),Vs),Sf=Eo($i);function Of(e){return fl(e)?oi(e):ro(e)}function Rf(e){return fl(e)?oi(e,!0):io(e)}function If(e,t){var n={};return t=Vs(t,3),Ai(e,(function(e,r,i){gi(n,t(e,r,i),e)})),n}function xf(e,t){var n={};return t=Vs(t,3),Ai(e,(function(e,r,i){gi(n,r,t(e,r,i))})),n}var Cf=ls((function(e,t,n){uo(e,t,n)})),Pf=ls((function(e,t,n,r){uo(e,t,n,r)})),kf=zs((function(e,t){var n={};if(null==e)return n;var r=!1;t=gn(t,(function(t){return t=Vo(t,e),r||(r=t.length>1),t})),ss(e,Fs(e),n),r&&(n=vi(n,l|f|h,Ls));for(var i=t.length;i--;)Do(n,t[i]);return n}));function Nf(e,t){return Tf(e,Hu(Vs(t)))}var Af=zs((function(e,t){return null==e?{}:po(e,t)}));function Tf(e,t){if(null==e)return{};var n=gn(Fs(e),(function(e){return[e]}));return t=Vs(t),go(e,n,(function(e,n){return t(e,n[0])}))}function Mf(t,n,r){var i=-1,o=(n=Vo(n,t)).length;for(o||(o=1,t=e);++i<o;){var s=null==t?e:t[Aa(n[i])];s===e&&(i=o,s=r),t=El(s)?s.call(t):s}return t}function Lf(e,t,n){return null==e?e:Ro(e,t,n)}function Uf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Ro(t,n,r,i)}var Df=Ns(Of),jf=Ns(Rf);function zf(e,t,n){var r=ul(e),i=r||pl(e)||Fl(e);if(t=Vs(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Rl(e)&&El(o)?Rr(St(e)):{}}return(i?un:Ai)(e,(function(e,r,i){return t(n,e,r,i)})),n}function Bf(e,t){return null==e||Do(e,t)}function Ff(e,t,n){return null==e?e:jo(e,t,$o(n))}function Hf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:jo(t,n,$o(r),i)}function qf(e){return null==e?[]:jn(e,Of(e))}function $f(e){return null==e?[]:jn(e,Rf(e))}function Vf(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=Jl(r))==r?r:0),n!==e&&(n=(n=Jl(n))==n?n:0),mi(Jl(t),n,r)}function Wf(t,n,r){return n=Gl(n),r===e?(r=n,n=0):r=Gl(r),Fi(t=Jl(t),n,r)}function Kf(t,n,r){if(r&&"boolean"!=typeof r&&ca(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=Gl(t),n===e?(n=t,t=0):n=Gl(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=wn();return Xt(t+o*(n-t+$t("1e-"+((o+"").length-1))),n)}return _o(t,n)}var Gf=gs((function(e,t,n){return t=t.toLowerCase(),e+(n?Yf(t):t)}));function Yf(e){return Eh(ef(e).toLowerCase())}function Qf(e){return(e=ef(e))&&e.replace(Ye,qn).replace(Nt,"")}function Jf(t,n,r){t=ef(t),n=Lo(n);var i=t.length,o=r=r===e?i:mi(Yl(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n}function Xf(e){return(e=ef(e))&&Re.test(e)?e.replace(Se,$n):e}function Zf(e){return(e=ef(e))&&Te.test(e)?e.replace(Ae,"\\$&"):e}var eh=gs((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),th=gs((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),nh=ps("toLowerCase");function rh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Os(Ft(i),n)+e+Os(Bt(i),n)}function ih(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?e+Os(t-r,n):e}function oh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?Os(t-r,n)+e:e}function sh(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(ef(e).replace(Me,""),t||0)}function ah(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),wo(ef(t),n)}function ch(){var e=arguments,t=ef(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var uh=gs((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));function lh(t,n,r){return r&&"number"!=typeof r&&ca(t,n,r)&&(n=r=e),(r=r===e?U:r>>>0)?(t=ef(t))&&("string"==typeof n||null!=n&&!Ul(n))&&!(n=Lo(n))&&Kn(t)?Ko(ir(t),0,r):t.split(n,r):[]}var fh=gs((function(e,t,n){return e+(n?" ":"")+Eh(t)}));function hh(e,t,n){return e=ef(e),n=null==n?0:mi(Yl(n),0,e.length),t=Lo(t),e.slice(n,n+t.length)==t}function dh(t,n,r){var i=Or.templateSettings;r&&ca(t,n,r)&&(n=e),t=ef(t),n=rf({},n,i,Ts);var o,a,c=rf({},n.imports,i.imports,Ts),u=Of(c),l=jn(c,u),f=0,h=n.interpolate||Qe,d="__p += '",p=it((n.escape||Qe).source+"|"+h.source+"|"+(h===Ce?He:Qe).source+"|"+(n.evaluate||Qe).source+"|$","g"),g="//# sourceURL="+(ht.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Dt+"]")+"\n";t.replace(p,(function(e,n,r,i,s,c){return r||(r=i),d+=t.slice(f,c).replace(Je,Vn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=c+e.length,e})),d+="';\n";var y=ht.call(n,"variable")&&n.variable;if(y){if(Be.test(y))throw new et(s)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(_e,""):d).replace(be,"$1").replace(we,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Oh((function(){return tt(u,g+"return "+d).apply(e,l)}));if(m.source=d,bl(m))throw m;return m}function ph(e){return ef(e).toLowerCase()}function gh(e){return ef(e).toUpperCase()}function yh(t,n,r){if((t=ef(t))&&(r||n===e))return Un(t);if(!t||!(n=Lo(n)))return t;var i=ir(t),o=ir(n);return Ko(i,Bn(i,o),Fn(i,o)+1).join("")}function mh(t,n,r){if((t=ef(t))&&(r||n===e))return t.slice(0,or(t)+1);if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,0,Fn(i,ir(n))+1).join("")}function vh(t,n,r){if((t=ef(t))&&(r||n===e))return t.replace(Me,"");if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,Bn(i,ir(n))).join("")}function _h(t,n){var r=R,i=I;if(Rl(n)){var o="separator"in n?n.separator:o;r="length"in n?Yl(n.length):r,i="omission"in n?Lo(n.omission):i}var s=(t=ef(t)).length;if(Kn(t)){var a=ir(t);s=a.length}if(r>=s)return t;var c=r-rr(i);if(c<1)return i;var u=a?Ko(a,0,c).join(""):t.slice(0,c);if(o===e)return u+i;if(a&&(c+=u.length-c),Ul(o)){if(t.slice(c).search(o)){var l,f=u;for(o.global||(o=it(o.source,ef(qe.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===e?c:h)}}else if(t.indexOf(Lo(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+i}function bh(e){return(e=ef(e))&&Oe.test(e)?e.replace(Ee,sr):e}var wh=gs((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Eh=ps("toUpperCase");function Sh(t,n,r){return t=ef(t),(n=r?e:n)===e?Gn(t)?ur(t):En(t):t.match(n)||[]}var Oh=Eo((function(t,n){try{return an(t,e,n)}catch(e){return bl(e)?e:new et(e)}})),Rh=zs((function(e,t){return un(t,(function(t){t=Aa(t),gi(e,t,Tu(e[t],e))})),e}));function Ih(e){var t=null==e?0:e.length,n=Vs();return e=t?gn(e,(function(e){if("function"!=typeof e[1])throw new st(o);return[n(e[0]),e[1]]})):[],Eo((function(n){for(var r=-1;++r<t;){var i=e[r];if(an(i[0],this,n))return an(i[1],this,n)}}))}function xh(e){return _i(vi(e,l))}function Ch(e){return function(){return e}}function Ph(e,t){return null==e||e!=e?t:e}var kh=_s(),Nh=_s(!0);function Ah(e){return e}function Th(e){return no("function"==typeof e?e:vi(e,l))}function Mh(e){return ao(vi(e,l))}function Lh(e,t){return co(e,vi(t,l))}var Uh=Eo((function(e,t){return function(n){return $i(n,e,t)}})),Dh=Eo((function(e,t){return function(n){return $i(e,n,t)}}));function jh(e,t,n){var r=Of(t),i=Mi(t,r);null==n&&(!Rl(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=Mi(t,Of(t)));var o=!(Rl(n)&&"chain"in n&&!n.chain),s=El(e);return un(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=os(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})})),e}function zh(){return Gt._===this&&(Gt._=mt),this}function Bh(){}function Fh(e){return e=Yl(e),Eo((function(t){return fo(t,e)}))}var Hh=Ss(gn),qh=Ss(fn),$h=Ss(_n);function Vh(e){return ua(e)?Pn(Aa(e)):yo(e)}function Wh(t){return function(n){return null==t?e:Li(t,n)}}var Kh=Is(),Gh=Is(!0);function Yh(){return[]}function Qh(){return!1}function Jh(){return{}}function Xh(){return""}function Zh(){return!0}function ed(e,t){if((e=Yl(e))<1||e>T)return[];var n=U,r=Xt(e,U);t=Vs(t),e-=U;for(var i=Mn(r,t);++n<e;)t(n);return i}function td(e){return ul(e)?gn(e,Aa):Bl(e)?[e]:os(Na(ef(e)))}function nd(e){var t=++dt;return ef(e)+t}var rd=Es((function(e,t){return e+t}),0),id=Ps("ceil"),od=Es((function(e,t){return e/t}),1),sd=Ps("floor");function ad(t){return t&&t.length?Ii(t,Ah,ji):e}function cd(t,n){return t&&t.length?Ii(t,Vs(n,2),ji):e}function ud(e){return Cn(e,Ah)}function ld(e,t){return Cn(e,Vs(t,2))}function fd(t){return t&&t.length?Ii(t,Ah,oo):e}function hd(t,n){return t&&t.length?Ii(t,Vs(n,2),oo):e}var dd=Es((function(e,t){return e*t}),1),pd=Ps("round"),gd=Es((function(e,t){return e-t}),0);function yd(e){return e&&e.length?Tn(e,Ah):0}function md(e,t){return e&&e.length?Tn(e,Vs(t,2)):0}return Or.after=ku,Or.ary=Nu,Or.assign=tf,Or.assignIn=nf,Or.assignInWith=rf,Or.assignWith=of,Or.at=sf,Or.before=Au,Or.bind=Tu,Or.bindAll=Rh,Or.bindKey=Mu,Or.castArray=Zu,Or.chain=Wc,Or.chunk=Ua,Or.compact=Da,Or.concat=ja,Or.cond=Ih,Or.conforms=xh,Or.constant=Ch,Or.countBy=ru,Or.create=af,Or.curry=Lu,Or.curryRight=Uu,Or.debounce=Du,Or.defaults=cf,Or.defaultsDeep=uf,Or.defer=ju,Or.delay=zu,Or.difference=za,Or.differenceBy=Ba,Or.differenceWith=Fa,Or.drop=Ha,Or.dropRight=qa,Or.dropRightWhile=$a,Or.dropWhile=Va,Or.fill=Wa,Or.filter=ou,Or.flatMap=cu,Or.flatMapDeep=uu,Or.flatMapDepth=lu,Or.flatten=Ya,Or.flattenDeep=Qa,Or.flattenDepth=Ja,Or.flip=Bu,Or.flow=kh,Or.flowRight=Nh,Or.fromPairs=Xa,Or.functions=yf,Or.functionsIn=mf,Or.groupBy=du,Or.initial=tc,Or.intersection=nc,Or.intersectionBy=rc,Or.intersectionWith=ic,Or.invert=wf,Or.invertBy=Ef,Or.invokeMap=gu,Or.iteratee=Th,Or.keyBy=yu,Or.keys=Of,Or.keysIn=Rf,Or.map=mu,Or.mapKeys=If,Or.mapValues=xf,Or.matches=Mh,Or.matchesProperty=Lh,Or.memoize=Fu,Or.merge=Cf,Or.mergeWith=Pf,Or.method=Uh,Or.methodOf=Dh,Or.mixin=jh,Or.negate=Hu,Or.nthArg=Fh,Or.omit=kf,Or.omitBy=Nf,Or.once=qu,Or.orderBy=vu,Or.over=Hh,Or.overArgs=$u,Or.overEvery=qh,Or.overSome=$h,Or.partial=Vu,Or.partialRight=Wu,Or.partition=_u,Or.pick=Af,Or.pickBy=Tf,Or.property=Vh,Or.propertyOf=Wh,Or.pull=uc,Or.pullAll=lc,Or.pullAllBy=fc,Or.pullAllWith=hc,Or.pullAt=dc,Or.range=Kh,Or.rangeRight=Gh,Or.rearg=Ku,Or.reject=Eu,Or.remove=pc,Or.rest=Gu,Or.reverse=gc,Or.sampleSize=Ou,Or.set=Lf,Or.setWith=Uf,Or.shuffle=Ru,Or.slice=yc,Or.sortBy=Cu,Or.sortedUniq=Sc,Or.sortedUniqBy=Oc,Or.split=lh,Or.spread=Yu,Or.tail=Rc,Or.take=Ic,Or.takeRight=xc,Or.takeRightWhile=Cc,Or.takeWhile=Pc,Or.tap=Kc,Or.throttle=Qu,Or.thru=Gc,Or.toArray=Kl,Or.toPairs=Df,Or.toPairsIn=jf,Or.toPath=td,Or.toPlainObject=Xl,Or.transform=zf,Or.unary=Ju,Or.union=kc,Or.unionBy=Nc,Or.unionWith=Ac,Or.uniq=Tc,Or.uniqBy=Mc,Or.uniqWith=Lc,Or.unset=Bf,Or.unzip=Uc,Or.unzipWith=Dc,Or.update=Ff,Or.updateWith=Hf,Or.values=qf,Or.valuesIn=$f,Or.without=jc,Or.words=Sh,Or.wrap=Xu,Or.xor=zc,Or.xorBy=Bc,Or.xorWith=Fc,Or.zip=Hc,Or.zipObject=qc,Or.zipObjectDeep=$c,Or.zipWith=Vc,Or.entries=Df,Or.entriesIn=jf,Or.extend=nf,Or.extendWith=rf,jh(Or,Or),Or.add=rd,Or.attempt=Oh,Or.camelCase=Gf,Or.capitalize=Yf,Or.ceil=id,Or.clamp=Vf,Or.clone=el,Or.cloneDeep=nl,Or.cloneDeepWith=rl,Or.cloneWith=tl,Or.conformsTo=il,Or.deburr=Qf,Or.defaultTo=Ph,Or.divide=od,Or.endsWith=Jf,Or.eq=ol,Or.escape=Xf,Or.escapeRegExp=Zf,Or.every=iu,Or.find=su,Or.findIndex=Ka,Or.findKey=lf,Or.findLast=au,Or.findLastIndex=Ga,Or.findLastKey=ff,Or.floor=sd,Or.forEach=fu,Or.forEachRight=hu,Or.forIn=hf,Or.forInRight=df,Or.forOwn=pf,Or.forOwnRight=gf,Or.get=vf,Or.gt=sl,Or.gte=al,Or.has=_f,Or.hasIn=bf,Or.head=Za,Or.identity=Ah,Or.includes=pu,Or.indexOf=ec,Or.inRange=Wf,Or.invoke=Sf,Or.isArguments=cl,Or.isArray=ul,Or.isArrayBuffer=ll,Or.isArrayLike=fl,Or.isArrayLikeObject=hl,Or.isBoolean=dl,Or.isBuffer=pl,Or.isDate=gl,Or.isElement=yl,Or.isEmpty=ml,Or.isEqual=vl,Or.isEqualWith=_l,Or.isError=bl,Or.isFinite=wl,Or.isFunction=El,Or.isInteger=Sl,Or.isLength=Ol,Or.isMap=xl,Or.isMatch=Cl,Or.isMatchWith=Pl,Or.isNaN=kl,Or.isNative=Nl,Or.isNil=Tl,Or.isNull=Al,Or.isNumber=Ml,Or.isObject=Rl,Or.isObjectLike=Il,Or.isPlainObject=Ll,Or.isRegExp=Ul,Or.isSafeInteger=Dl,Or.isSet=jl,Or.isString=zl,Or.isSymbol=Bl,Or.isTypedArray=Fl,Or.isUndefined=Hl,Or.isWeakMap=ql,Or.isWeakSet=$l,Or.join=oc,Or.kebabCase=eh,Or.last=sc,Or.lastIndexOf=ac,Or.lowerCase=th,Or.lowerFirst=nh,Or.lt=Vl,Or.lte=Wl,Or.max=ad,Or.maxBy=cd,Or.mean=ud,Or.meanBy=ld,Or.min=fd,Or.minBy=hd,Or.stubArray=Yh,Or.stubFalse=Qh,Or.stubObject=Jh,Or.stubString=Xh,Or.stubTrue=Zh,Or.multiply=dd,Or.nth=cc,Or.noConflict=zh,Or.noop=Bh,Or.now=Pu,Or.pad=rh,Or.padEnd=ih,Or.padStart=oh,Or.parseInt=sh,Or.random=Kf,Or.reduce=bu,Or.reduceRight=wu,Or.repeat=ah,Or.replace=ch,Or.result=Mf,Or.round=pd,Or.runInContext=t,Or.sample=Su,Or.size=Iu,Or.snakeCase=uh,Or.some=xu,Or.sortedIndex=mc,Or.sortedIndexBy=vc,Or.sortedIndexOf=_c,Or.sortedLastIndex=bc,Or.sortedLastIndexBy=wc,Or.sortedLastIndexOf=Ec,Or.startCase=fh,Or.startsWith=hh,Or.subtract=gd,Or.sum=yd,Or.sumBy=md,Or.template=dh,Or.times=ed,Or.toFinite=Gl,Or.toInteger=Yl,Or.toLength=Ql,Or.toLower=ph,Or.toNumber=Jl,Or.toSafeInteger=Zl,Or.toString=ef,Or.toUpper=gh,Or.trim=yh,Or.trimEnd=mh,Or.trimStart=vh,Or.truncate=_h,Or.unescape=bh,Or.uniqueId=nd,Or.upperCase=wh,Or.upperFirst=Eh,Or.each=fu,Or.eachRight=hu,Or.first=Za,jh(Or,function(){var e={};return Ai(Or,(function(t,n){ht.call(Or.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Or.VERSION=n,un(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Or[e].placeholder=Or})),un(["drop","take"],(function(t,n){Cr.prototype[t]=function(r){r=r===e?1:Qt(Yl(r),0);var i=this.__filtered__&&!n?new Cr(this):this.clone();return i.__filtered__?i.__takeCount__=Xt(r,i.__takeCount__):i.__views__.push({size:Xt(r,U),type:t+(i.__dir__<0?"Right":"")}),i},Cr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),un(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==P||n==N;Cr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),un(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Cr.prototype[e]=function(){return this[n](1).value()[0]}})),un(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Cr.prototype[e]=function(){return this.__filtered__?new Cr(this):this[n](1)}})),Cr.prototype.compact=function(){return this.filter(Ah)},Cr.prototype.find=function(e){return this.filter(e).head()},Cr.prototype.findLast=function(e){return this.reverse().find(e)},Cr.prototype.invokeMap=Eo((function(e,t){return"function"==typeof e?new Cr(this):this.map((function(n){return $i(n,e,t)}))})),Cr.prototype.reject=function(e){return this.filter(Hu(Vs(e)))},Cr.prototype.slice=function(t,n){t=Yl(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Cr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=Yl(n))<0?r.dropRight(-n):r.take(n-t)),r)},Cr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Cr.prototype.toArray=function(){return this.take(U)},Ai(Cr.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Or[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);o&&(Or.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,c=n instanceof Cr,u=a[0],l=c||ul(n),f=function(e){var t=o.apply(Or,yn([e],a));return i&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=c&&!d;if(!s&&l){n=g?n:new Cr(this);var y=t.apply(n,a);return y.__actions__.push({func:Gc,args:[f],thisArg:e}),new xr(y,h)}return p&&g?t.apply(this,a):(y=this.thru(f),p?i?y.value()[0]:y.value():y)})})),un(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Or.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ul(i)?i:[],e)}return this[n]((function(n){return t.apply(ul(n)?n:[],e)}))}})),Ai(Cr.prototype,(function(e,t){var n=Or[t];if(n){var r=n.name+"";ht.call(gr,r)||(gr[r]=[]),gr[r].push({name:t,func:n})}})),gr[bs(e,y).name]=[{name:"wrapper",func:e}],Cr.prototype.clone=Pr,Cr.prototype.reverse=kr,Cr.prototype.value=Nr,Or.prototype.at=Yc,Or.prototype.chain=Qc,Or.prototype.commit=Jc,Or.prototype.next=Xc,Or.prototype.plant=eu,Or.prototype.reverse=tu,Or.prototype.toJSON=Or.prototype.valueOf=Or.prototype.value=nu,Or.prototype.first=Or.prototype.head,Ct&&(Or.prototype[Ct]=Zc),Or},fr=lr();Qt?((Qt.exports=fr)._=fr,Yt._=fr):Gt._=fr}.call(t);var qg=Object.defineProperty,$g=Object.defineProperties,Vg=Object.getOwnPropertyDescriptors,Wg=Object.getOwnPropertySymbols,Kg=Object.prototype.hasOwnProperty,Gg=Object.prototype.propertyIsEnumerable,Yg=(e,t,n)=>t in e?qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qg=(e,t)=>{for(var n in t||(t={}))Kg.call(t,n)&&Yg(e,n,t[n]);if(Wg)for(var n of Wg(t))Gg.call(t,n)&&Yg(e,n,t[n]);return e},Jg=(e,t)=>$g(e,Vg(t));function Xg(e,t,n){var r;const i=Ba(e);return(null==(r=t.rpcMap)?void 0:r[i.reference])||`${jg}?chainId=${i.namespace}:${i.reference}&projectId=${n}`}function Zg(e){return e.includes(":")?e.split(":")[1]:e}function ey(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}function ty(e,t){const n=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!n.length)return[];const r=[];return n.forEach((e=>{const n=t.namespaces[e].accounts;r.push(...n)})),r}function ny(e={},t={}){const n=ry(e),r=ry(t);return Hg.exports.merge(n,r)}function ry(e){var t,n,r,i;const o={};if(!_u(e))return o;for(const[s,a]of Object.entries(e)){const e=hu(s)?[s]:a.chains,c=a.methods||[],u=a.events||[],l=a.rpcMap||{},f=du(s);o[f]=Jg(Qg(Qg({},o[f]),a),{chains:$c(e,null==(t=o[f])?void 0:t.chains),methods:$c(c,null==(n=o[f])?void 0:n.methods),events:$c(u,null==(r=o[f])?void 0:r.events),rpcMap:Qg(Qg({},l),null==(i=o[f])?void 0:i.rpcMap)})}return o}function iy(e){return e.includes(":")?e.split(":")[2]:e}function oy(e){const t={};for(const[n,r]of Object.entries(e)){const e=r.methods||[],i=r.events||[],o=r.accounts||[],s=hu(n)?[n]:r.chains?r.chains:ey(r.accounts);t[n]={chains:s,methods:e,events:i,accounts:o}}return t}function sy(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):e.includes(":")?Number(e.split(":")[1]):Number(e)}const ay={},cy=e=>ay[e],uy=(e,t)=>{ay[e]=t};var ly={exports:{}};!function(e,n){var r,i=typeof self<"u"?self:t,o=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();r=o,function(e){var t={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{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function n(e){return e&&DataView.prototype.isPrototypeOf(e)}if(t.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function p(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:t.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:t.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():t.arrayBuffer&&t.blob&&n(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;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(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=a(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e){var t=e.toUpperCase();return m.indexOf(t)>-1?t:e}function _(e,t){var n=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&null!=e._bodyInit&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=v(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},y.call(_.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];E.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch{e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function O(n,r){return new Promise((function(i,o){var s=new _(n,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:w(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;i(new E(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(typeof s._bodyInit>"u"?null:s._bodyInit)}))}O.polyfill=!0,r.fetch||(r.fetch=O,r.Headers=u,r.Request=_,r.Response=E),e.Headers=u,e.Request=_,e.Response=E,e.fetch=O,Object.defineProperty(e,"__esModule",{value:!0})}({}),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=o;(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}(ly,ly.exports);var fy=n(ly.exports);const hy={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},dy=10;class py{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new o.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!ff(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const t=ce(e),n=await(await fy(this.url,Object.assign(Object.assign({},hy),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ff(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ce({id:1,jsonrpc:"2.0",method:"test",params:[]});await fy(e,Object.assign(Object.assign({},hy),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?ae(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=tf(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return vl(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>dy&&this.events.setMaxListeners(dy)}}class gy{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class yy{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||Xg(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=parseInt(Zg(t));e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;const i=parseInt(r,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:null==(n=this.namespace.chains)?void 0:n[0]}),this.setDefaultChain(`${i}`)}return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class my{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class vy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class _y{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const n=this.getCardanoRPCUrl(t),r=Zg(t);e[r]=this.createHttpProvider(r,n)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class by{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class wy{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class Ey{constructor(e){this.name="near",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Xg(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace);return typeof n>"u"?void 0:new _f(new py(n,cy("disableProviderPing")))}}var Sy=Object.defineProperty,Oy=Object.defineProperties,Ry=Object.getOwnPropertyDescriptors,Iy=Object.getOwnPropertySymbols,xy=Object.prototype.hasOwnProperty,Cy=Object.prototype.propertyIsEnumerable,Py=(e,t,n)=>t in e?Sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ky=(e,t)=>{for(var n in t||(t={}))xy.call(t,n)&&Py(e,n,t[n]);if(Iy)for(var n of Iy(t))Cy.call(t,n)&&Py(e,n,t[n]);return e},Ny=(e,t)=>Oy(e,Ry(t));class Ay{constructor(e){this.events=new o.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:hn.pino(hn.getDefaultLoggerOptions({level:e?.logger||Lg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Ay(e);return await t.initialize(),t}async request(e,t){const[n,r]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ky({},e),chainId:`${n}:${r}`,topic:this.session.topic})}sendAsync(e,t,n){const r=(new Date).getTime();this.request(e,n).then((e=>t(null,ef(r,e)))).catch((e=>t(e,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:mu("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await r().then((e=>{this.session=e,this.namespaces||(this.namespaces=oy(e.namespaces),this.persist("namespaces",this.namespaces))})).catch((e=>{if(e.message!==hg)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(vu(t)){for(const n of t)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Mg.init({logger:this.providerOpts.logger||Lg,relayUrl:this.providerOpts.relayUrl||Ug,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map((e=>du(e))))];uy("client",this.client),uy("events",this.events),uy("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=ty(e,this.session),n=ey(t),r=ny(this.namespaces,this.optionalNamespaces),i=Ny(ky({},r[e]),{accounts:t,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new yy({namespace:i});break;case"solana":this.rpcProviders[e]=new my({namespace:i});break;case"cosmos":this.rpcProviders[e]=new vy({namespace:i});break;case"polkadot":this.rpcProviders[e]=new gy({namespace:i});break;case"cip34":this.rpcProviders[e]=new _y({namespace:i});break;case"elrond":this.rpcProviders[e]=new by({namespace:i});break;case"multiversx":this.rpcProviders[e]=new wy({namespace:i});break;case"near":this.rpcProviders[e]=new Ey({namespace:i})}}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(e=>{this.events.emit("session_ping",e)})),this.client.on("session_event",(e=>{const{params:t}=e,{event:n}=t;if("accountsChanged"===n.name){const e=n.data;e&&vu(e)&&this.events.emit("accountsChanged",e.map(iy))}else if("chainChanged"===n.name){const e=t.chainId,n=t.event.data,r=du(e),i=sy(e)!==sy(n)?`${r}:${sy(n)}`:e;this.onChainChanged(i)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var n;const{namespaces:r}=t,i=null==(n=this.client)?void 0:n.session.get(e);this.session=Ny(ky({},i),{namespaces:r}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ny(ky({},mu("USER_DISCONNECTED")),{data:e.topic}))})),this.on(zg.DEFAULT_CHAIN_CHANGED,(e=>{this.onChainChanged(e,!0)}))}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:r}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map((e=>du(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const r=du(Object.keys(this.namespaces)[0]);return[r,this.rpcProviders[r].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var n;if(!this.namespaces)return;const[r,i]=this.validateChain(e);t||this.getProvider(r).setDefaultChain(i),(null!=(n=this.namespaces[r])?n:this.namespaces[`${r}:${i}`]).defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Dg}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Dg}/${e}`)}}const Ty=Ay;e.UniversalProvider=Ty,e.default=Ay,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,Ki.exports);const Gi=["eth_sendTransaction","personal_sign"],Yi=["chainChanged","accountsChanged"];function Qi(e){return Number(e[0].split(":")[1])}function Ji(e){return`0x${e.toString(16)}`}class Xi{constructor(){this.events=new dn.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static init(e){return c(this,void 0,void 0,(function*(){const t=new Xi;return yield t.initialize(e),t}))}request(e){return c(this,void 0,void 0,(function*(){return yield this.signer.request(e,this.formatChainId(this.chainId))}))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}enable(){return c(this,void 0,void 0,(function*(){this.session||(yield this.connect());return yield this.request({method:"eth_requestAccounts"})}))}connect(e){return c(this,void 0,void 0,(function*(){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=function(e){const{chains:t,optionalChains:n,methods:r,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!$i(t))throw new Error("Invalid chains");const c=t,u=r||Gi,l=o||Yi,f={chains:c,methods:u,events:l,rpcMap:{[Qi(c)]:a[Qi(c)]}},h=null==o?void 0:o.filter((e=>!Yi.includes(e))),d=null==r?void 0:r.filter((e=>!Gi.includes(e)));if(!(n||s||i||(null==h?void 0:h.length)||(null==d?void 0:d.length)))return{required:f};const p=(null==h?void 0:h.length)&&(null==d?void 0:d.length)||!n;return{required:f,optional:{chains:[...new Set(p?c.concat(n||[]):n)],methods:[...new Set(u.concat(i||[]))],events:[...new Set(l.concat(s||[]))],rpcMap:a}}}(this.rpc);try{const r=yield new Promise(((r,i)=>c(this,void 0,void 0,(function*(){yield this.signer.connect(Object.assign(Object.assign({namespaces:{[this.namespace]:t}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:null==e?void 0:e.pairingTopic,skipPairing:!1})).then((e=>{r(e)})).catch((e=>{i(new Error(e.message))}))}))));if(!r)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const n=[];return Object.keys(e).forEach((r=>{if(t.length&&!t.includes(r))return;const i=e[r];n.push(...i.accounts)})),n}(r.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:Ji(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}}))}disconnect(){return c(this,void 0,void 0,(function*(){this.session&&(yield this.signer.disconnect()),this.reset()}))}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:n}=t;"accountsChanged"===n.name?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===n.name?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)})),this.signer.on("chainChanged",(e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Ji(this.chainId)),this.persist()})),this.signer.on("session_update",(e=>{this.events.emit("session_update",e)})),this.signer.on("session_delete",(e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Object.assign(Object.assign({},function(e,t){const{message:n,code:r}=qi[e];return{message:t?`${n} ${t}`:n,code:r}}("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{this.events.emit("display_uri",e)}))}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))),n=t.map((e=>this.parseChainId(e)));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",Ji(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,r]=e.split(":");return{chainId:`${t}:${n}`,address:r}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t;return{chains:(null===(t=e.chains)||void 0===t?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:(null==e?void 0:e.methods)||Gi,events:(null==e?void 0:e.events)||Yi,optionalMethods:(null==e?void 0:e.optionalMethods)||[],optionalEvents:(null==e?void 0:e.optionalEvents)||[],rpcMap:(null==e?void 0:e.rpcMap)||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach((e=>{n[e]=this.getRpcUrl(e,t)})),n}initialize(e){return c(this,void 0,void 0,(function*(){this.rpc=this.getRpcConfig(e),this.chainId=Qi(this.rpc.chains),this.signer=yield Ki.exports.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),yield this.loadPersistedSession()}))}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:r}=e;t&&$i(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)}))),n&&$i(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null==n?void 0:n.map((e=>this.formatChainId(e))),n.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)})))}getRpcUrl(e,t){var n;return(null===(n=this.rpc.rpcMap)||void 0===n?void 0:n[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}loadPersistedSession(){return c(this,void 0,void 0,(function*(){if(!this.session)return;const e=yield this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:null==t?void 0:t.accounts),this.setAccounts(null==t?void 0:t.accounts)}))}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}const Zi=n("WalletConnectEvm"),eo=r("WalletConnectEvm");function to(){return c(this,void 0,void 0,(function*(){Zi("getWalletConnectProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){Zi("initWalletConnectProvider");const e=lo();Zi("walletConnectProviderOptions is",e);const t={projectId:e.projectId,chains:e.chains,optionalChains:e.optionalChains,methods:e.methods,optionalMethods:e.optionalMethods||[],events:e.events,optionalEvents:e.optionalEvents||[],rpcMap:e.rpcMap,relayUrl:e.relayUrl,showQrModal:!1};Zi("ethereum init options are",t),Zi("creating a new provider instance");try{return Xi.init(t)}catch(e){throw eo("Error while initializing ethereum provider"),e}}))}();return function(e){if(Zi("assignWalletConnectProviderEvents"),!e)return;function t(e){e&&(e.removeListener("connect",n),e.removeListener("session_delete",r))}function n(e){Zi("connectHandler",e),pt(!1)}function r(n){Zi("disconnectHandler",n),e.disconnect(),t(e)}t(e),e.on("connect",n),e.on("session_delete",r),Zi("provider is",e)}(e),e.request=function(e){Zi("patchWalletConnectProviderRequest");const t=e.request.bind(e),n=lo();return Zi("walletConnectProviderOptions is",n),function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(Zi("calling patched",r,i),Zi("handling display_uri once"),e.once("display_uri",no),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){var c,u;try{(null===(c=null==e?void 0:e.session)||void 0===c?void 0:c.connected)?(Zi("reusing existing session"),o(yield t({method:r,params:i}))):(u={uri:"",onClose:()=>{eo("user rejected"),a(new s)}},an("UseLedgerLiveModal",{isDesktop:"desktop"===on().type,uri:u.uri,onClose:u.onClose}),Zi("creating a new session"),yield e.connect({chains:n.chains,optionalChains:n.optionalChains}),o(yield t({method:r,params:i})))}catch(e){return eo("error",e),a(e)}}))))):(Zi("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw eo("error",t),t}}))}function no(e){Zi("displayUriHandler",e),Qt(e)}const ro=n("getProvider"),io=[1];var oo;let so;e.SupportedProviders=void 0,(e.SupportedProviders||(e.SupportedProviders={})).Ethereum="Ethereum",function(e){e.LedgerConnect="LedgerConnect",e.WalletConnect="WalletConnect"}(oo||(oo={}));const ao=e=>(ro("getHexChainId",e),"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)?e:`0x${e.toString(16)}`),co=n("supportOptions");let uo;const lo=()=>(co("getSupportOptions"),uo),fo=n("ExtensionEvm"),ho="ethereum",po="isLedgerConnect";var go;function yo(e){return("iOS"===e.os.name||"macOS"===e.os.name)&&"Safari"===e.browser.name}function mo(e){return!!go[e]}function vo(e){return e.every(mo)}function _o(){if(fo("getEthereumProvider"),"undefined"==typeof window)throw new a;let e=window[ho];if(fo("provider is",e),void 0===e||void 0===e[po])throw new i;const t=lo(),n=ao(t.chainId||0);return ao(e.chainId)!=n&&(fo("chainIds are different, changing to",n),e.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})),e}!function(e){e[e.EthereumMainnet=1]="EthereumMainnet",e[e.Polygon=137]="Polygon"}(go||(go={}));const bo=n("support");let wo;e.checkSupport=function(t){bo("checkSupport",t),(e=>{var t;co("setSupportOptions",e);const n=e.walletConnectVersion||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||io,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{walletConnectVersion:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");uo=s})(t);const n=lo();let r;return n.providerType,e.SupportedProviders.Ethereum,r=function(e){bo("checkEthereumSupport",e);const t=on();let n=!1;try{n=!!_o()}catch(e){}const r={isLedgerConnectSupported:yo(t),isLedgerConnectEnabled:!!n,isChainIdSupported:vo(e.chains),providerImplementation:oo.LedgerConnect};r.isLedgerConnectSupported&&r.isLedgerConnectEnabled&&r.isChainIdSupported||(r.providerImplementation=oo.WalletConnect);return function(e){ro("setProviderImplementation",e),so=e}(r.providerImplementation),r}(n),bo("checkSupportResult is",r),wo=r,r},e.enableDebugLogs=()=>{t=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){ro("getProvider",so);const t=lo();if(t.providerType===e.SupportedProviders.Ethereum)return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||so!==oo.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==t.walletConnectVersion&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield to():yield fn():_o();throw new o}))},Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map
314
+ */Bg=Hg,Fg=Hg.exports,function(){var e,n="4.17.21",r=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",s="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",l=1,f=2,h=4,d=1,p=2,g=1,y=2,m=4,v=8,_=16,b=32,w=64,E=128,S=256,O=512,R=30,I="...",x=800,C=16,P=1,k=2,N=3,A=1/0,T=9007199254740991,M=17976931348623157e292,L=NaN,U=4294967295,D=U-1,j=U>>>1,z=[["ary",E],["bind",g],["bindKey",y],["curry",v],["curryRight",_],["flip",O],["partial",b],["partialRight",w],["rearg",S]],B="[object Arguments]",F="[object Array]",H="[object AsyncFunction]",q="[object Boolean]",$="[object Date]",V="[object DOMException]",W="[object Error]",K="[object Function]",G="[object GeneratorFunction]",Y="[object Map]",Q="[object Number]",J="[object Null]",X="[object Object]",Z="[object Promise]",ee="[object Proxy]",te="[object RegExp]",ne="[object Set]",re="[object String]",ie="[object Symbol]",oe="[object Undefined]",se="[object WeakMap]",ae="[object WeakSet]",ce="[object ArrayBuffer]",ue="[object DataView]",le="[object Float32Array]",fe="[object Float64Array]",he="[object Int8Array]",de="[object Int16Array]",pe="[object Int32Array]",ge="[object Uint8Array]",ye="[object Uint8ClampedArray]",me="[object Uint16Array]",ve="[object Uint32Array]",_e=/\b__p \+= '';/g,be=/\b(__p \+=) '' \+/g,we=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ee=/&(?:amp|lt|gt|quot|#39);/g,Se=/[&<>"']/g,Oe=RegExp(Ee.source),Re=RegExp(Se.source),Ie=/<%-([\s\S]+?)%>/g,xe=/<%([\s\S]+?)%>/g,Ce=/<%=([\s\S]+?)%>/g,Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ke=/^\w*$/,Ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ae=/[\\^$.*+?()[\]{}|]/g,Te=RegExp(Ae.source),Me=/^\s+/,Le=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,De=/\{\n\/\* \[wrapped with (.+)\] \*/,je=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Be=/[()=,{}\[\]\/\s]/,Fe=/\\(\\)?/g,He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,qe=/\w*$/,$e=/^[-+]0x[0-9a-f]+$/i,Ve=/^0b[01]+$/i,We=/^\[object .+?Constructor\]$/,Ke=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qe=/($^)/,Je=/['\n\r\u2028\u2029\\]/g,Xe="\\ud800-\\udfff",Ze="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",et="\\u2700-\\u27bf",tt="a-z\\xdf-\\xf6\\xf8-\\xff",nt="A-Z\\xc0-\\xd6\\xd8-\\xde",rt="\\ufe0e\\ufe0f",it="\\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",ot="['’]",st="["+Xe+"]",at="["+it+"]",ct="["+Ze+"]",ut="\\d+",lt="["+et+"]",ft="["+tt+"]",ht="[^"+Xe+it+ut+et+tt+nt+"]",dt="\\ud83c[\\udffb-\\udfff]",pt="[^"+Xe+"]",gt="(?:\\ud83c[\\udde6-\\uddff]){2}",yt="[\\ud800-\\udbff][\\udc00-\\udfff]",mt="["+nt+"]",vt="\\u200d",_t="(?:"+ft+"|"+ht+")",bt="(?:"+mt+"|"+ht+")",wt="(?:"+ot+"(?:d|ll|m|re|s|t|ve))?",Et="(?:"+ot+"(?:D|LL|M|RE|S|T|VE))?",St="(?:"+ct+"|"+dt+")?",Ot="["+rt+"]?",Rt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",It="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xt=Ot+St+"(?:"+vt+"(?:"+[pt,gt,yt].join("|")+")"+Ot+St+")*",Ct="(?:"+[lt,gt,yt].join("|")+")"+xt,Pt="(?:"+[pt+ct+"?",ct,gt,yt,st].join("|")+")",kt=RegExp(ot,"g"),Nt=RegExp(ct,"g"),At=RegExp(dt+"(?="+dt+")|"+Pt+xt,"g"),Tt=RegExp([mt+"?"+ft+"+"+wt+"(?="+[at,mt,"$"].join("|")+")",bt+"+"+Et+"(?="+[at,mt+_t,"$"].join("|")+")",mt+"?"+_t+"+"+wt,mt+"+"+Et,It,Rt,ut,Ct].join("|"),"g"),Mt=RegExp("["+vt+Xe+Ze+rt+"]"),Lt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Ut=["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"],Dt=-1,jt={};jt[le]=jt[fe]=jt[he]=jt[de]=jt[pe]=jt[ge]=jt[ye]=jt[me]=jt[ve]=!0,jt[B]=jt[F]=jt[ce]=jt[q]=jt[ue]=jt[$]=jt[W]=jt[K]=jt[Y]=jt[Q]=jt[X]=jt[te]=jt[ne]=jt[re]=jt[se]=!1;var zt={};zt[B]=zt[F]=zt[ce]=zt[ue]=zt[q]=zt[$]=zt[le]=zt[fe]=zt[he]=zt[de]=zt[pe]=zt[Y]=zt[Q]=zt[X]=zt[te]=zt[ne]=zt[re]=zt[ie]=zt[ge]=zt[ye]=zt[me]=zt[ve]=!0,zt[W]=zt[K]=zt[se]=!1;var Bt={"À":"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"},Ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ht={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},qt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$t=parseFloat,Vt=parseInt,Wt="object"==typeof t&&t&&t.Object===Object&&t,Kt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Wt||Kt||Function("return this")(),Yt=Fg&&!Fg.nodeType&&Fg,Qt=Yt&&Bg&&!Bg.nodeType&&Bg,Jt=Qt&&Qt.exports===Yt,Xt=Jt&&Wt.process,Zt=function(){try{return Qt&&Qt.require&&Qt.require("util").types||Xt&&Xt.binding&&Xt.binding("util")}catch{}}(),en=Zt&&Zt.isArrayBuffer,tn=Zt&&Zt.isDate,nn=Zt&&Zt.isMap,rn=Zt&&Zt.isRegExp,on=Zt&&Zt.isSet,sn=Zt&&Zt.isTypedArray;function an(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function cn(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var s=e[i];t(r,s,n(s),e)}return r}function un(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ln(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function fn(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function hn(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[i++]=s)}return o}function dn(e,t){return!(null==e||!e.length)&&Rn(e,t,0)>-1}function pn(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function gn(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function yn(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function mn(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function vn(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function _n(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var bn=Pn("length");function wn(e){return e.split("")}function En(e){return e.match(ze)||[]}function Sn(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function On(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function Rn(e,t,n){return t==t?tr(e,t,n):On(e,xn,n)}function In(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function xn(e){return e!=e}function Cn(e,t){var n=null==e?0:e.length;return n?Tn(e,t)/n:L}function Pn(t){return function(n){return null==n?e:n[t]}}function kn(t){return function(n){return null==t?e:t[n]}}function Nn(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function An(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Tn(t,n){for(var r,i=-1,o=t.length;++i<o;){var s=n(t[i]);s!==e&&(r=r===e?s:r+s)}return r}function Mn(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function Ln(e,t){return gn(t,(function(t){return[t,e[t]]}))}function Un(e){return e&&e.slice(0,or(e)+1).replace(Me,"")}function Dn(e){return function(t){return e(t)}}function jn(e,t){return gn(t,(function(t){return e[t]}))}function zn(e,t){return e.has(t)}function Bn(e,t){for(var n=-1,r=e.length;++n<r&&Rn(t,e[n],0)>-1;);return n}function Fn(e,t){for(var n=e.length;n--&&Rn(t,e[n],0)>-1;);return n}function Hn(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var qn=kn(Bt),$n=kn(Ft);function Vn(e){return"\\"+qt[e]}function Wn(t,n){return null==t?e:t[n]}function Kn(e){return Mt.test(e)}function Gn(e){return Lt.test(e)}function Yn(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function Qn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Jn(e,t){return function(n){return e(t(n))}}function Xn(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];(s===t||s===u)&&(e[n]=u,o[i++]=n)}return o}function Zn(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function er(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function tr(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function nr(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}function rr(e){return Kn(e)?ar(e):bn(e)}function ir(e){return Kn(e)?cr(e):wn(e)}function or(e){for(var t=e.length;t--&&Le.test(e.charAt(t)););return t}var sr=kn(Ht);function ar(e){for(var t=At.lastIndex=0;At.test(e);)++t;return t}function cr(e){return e.match(At)||[]}function ur(e){return e.match(Tt)||[]}var lr=function t(Le){var ze,Xe=(Le=null==Le?Gt:fr.defaults(Gt.Object(),Le,fr.pick(Gt,Ut))).Array,Ze=Le.Date,et=Le.Error,tt=Le.Function,nt=Le.Math,rt=Le.Object,it=Le.RegExp,ot=Le.String,st=Le.TypeError,at=Xe.prototype,ct=tt.prototype,ut=rt.prototype,lt=Le["__core-js_shared__"],ft=ct.toString,ht=ut.hasOwnProperty,dt=0,pt=(ze=/[^.]+$/.exec(lt&&lt.keys&&lt.keys.IE_PROTO||""))?"Symbol(src)_1."+ze:"",gt=ut.toString,yt=ft.call(rt),mt=Gt._,vt=it("^"+ft.call(ht).replace(Ae,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_t=Jt?Le.Buffer:e,bt=Le.Symbol,wt=Le.Uint8Array,Et=_t?_t.allocUnsafe:e,St=Jn(rt.getPrototypeOf,rt),Ot=rt.create,Rt=ut.propertyIsEnumerable,It=at.splice,xt=bt?bt.isConcatSpreadable:e,Ct=bt?bt.iterator:e,Pt=bt?bt.toStringTag:e,At=function(){try{var e=Gs(rt,"defineProperty");return e({},"",{}),e}catch{}}(),Tt=Le.clearTimeout!==Gt.clearTimeout&&Le.clearTimeout,Mt=Ze&&Ze.now!==Gt.Date.now&&Ze.now,Lt=Le.setTimeout!==Gt.setTimeout&&Le.setTimeout,Bt=nt.ceil,Ft=nt.floor,Ht=rt.getOwnPropertySymbols,qt=_t?_t.isBuffer:e,Wt=Le.isFinite,Kt=at.join,Yt=Jn(rt.keys,rt),Qt=nt.max,Xt=nt.min,Zt=Ze.now,bn=Le.parseInt,wn=nt.random,kn=at.reverse,tr=Gs(Le,"DataView"),ar=Gs(Le,"Map"),cr=Gs(Le,"Promise"),lr=Gs(Le,"Set"),hr=Gs(Le,"WeakMap"),dr=Gs(rt,"create"),pr=hr&&new hr,gr={},yr=Ta(tr),mr=Ta(ar),vr=Ta(cr),_r=Ta(lr),br=Ta(hr),wr=bt?bt.prototype:e,Er=wr?wr.valueOf:e,Sr=wr?wr.toString:e;function Or(e){if(Il(e)&&!ul(e)&&!(e instanceof Cr)){if(e instanceof xr)return e;if(ht.call(e,"__wrapped__"))return La(e)}return new xr(e)}var Rr=function(){function t(){}return function(n){if(!Rl(n))return{};if(Ot)return Ot(n);t.prototype=n;var r=new t;return t.prototype=e,r}}();function Ir(){}function xr(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=e}function Cr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=U,this.__views__=[]}function Pr(){var e=new Cr(this.__wrapped__);return e.__actions__=os(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=os(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=os(this.__views__),e}function kr(){if(this.__filtered__){var e=new Cr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e}function Nr(){var e=this.__wrapped__.value(),t=this.__dir__,n=ul(e),r=t<0,i=n?e.length:0,o=Zs(0,i,this.__views__),s=o.start,a=o.end,c=a-s,u=r?a:s-1,l=this.__iteratees__,f=l.length,h=0,d=Xt(c,this.__takeCount__);if(!n||!r&&i==c&&d==c)return Bo(e,this.__actions__);var p=[];e:for(;c--&&h<d;){for(var g=-1,y=e[u+=t];++g<f;){var m=l[g],v=m.iteratee,_=m.type,b=v(y);if(_==k)y=b;else if(!b){if(_==P)continue e;break e}}p[h++]=y}return p}function Ar(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Tr(){this.__data__=dr?dr(null):{},this.size=0}function Mr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}function Lr(t){var n=this.__data__;if(dr){var r=n[t];return r===a?e:r}return ht.call(n,t)?n[t]:e}function Ur(t){var n=this.__data__;return dr?n[t]!==e:ht.call(n,t)}function Dr(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=dr&&n===e?a:n,this}function jr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function zr(){this.__data__=[],this.size=0}function Br(e){var t=this.__data__,n=fi(t,e);return!(n<0||(n==t.length-1?t.pop():It.call(t,n,1),--this.size,0))}function Fr(t){var n=this.__data__,r=fi(n,t);return r<0?e:n[r][1]}function Hr(e){return fi(this.__data__,e)>-1}function qr(e,t){var n=this.__data__,r=fi(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function $r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Vr(){this.size=0,this.__data__={hash:new Ar,map:new(ar||jr),string:new Ar}}function Wr(e){var t=Ws(this,e).delete(e);return this.size-=t?1:0,t}function Kr(e){return Ws(this,e).get(e)}function Gr(e){return Ws(this,e).has(e)}function Yr(e,t){var n=Ws(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Qr(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new $r;++t<n;)this.add(e[t])}function Jr(e){return this.__data__.set(e,a),this}function Xr(e){return this.__data__.has(e)}function Zr(e){var t=this.__data__=new jr(e);this.size=t.size}function ei(){this.__data__=new jr,this.size=0}function ti(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function ni(e){return this.__data__.get(e)}function ri(e){return this.__data__.has(e)}function ii(e,t){var n=this.__data__;if(n instanceof jr){var i=n.__data__;if(!ar||i.length<r-1)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new $r(i)}return n.set(e,t),this.size=n.size,this}function oi(e,t){var n=ul(e),r=!n&&cl(e),i=!n&&!r&&pl(e),o=!n&&!r&&!i&&Fl(e),s=n||r||i||o,a=s?Mn(e.length,ot):[],c=a.length;for(var u in e)(t||ht.call(e,u))&&(!s||!("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||aa(u,c)))&&a.push(u);return a}function si(t){var n=t.length;return n?t[_o(0,n-1)]:e}function ai(e,t){return ka(os(e),mi(t,0,e.length))}function ci(e){return ka(os(e))}function ui(t,n,r){(r!==e&&!ol(t[n],r)||r===e&&!(n in t))&&gi(t,n,r)}function li(t,n,r){var i=t[n];(!ht.call(t,n)||!ol(i,r)||r===e&&!(n in t))&&gi(t,n,r)}function fi(e,t){for(var n=e.length;n--;)if(ol(e[n][0],t))return n;return-1}function hi(e,t,n,r){return Si(e,(function(e,i,o){t(r,e,n(e),o)})),r}function di(e,t){return e&&ss(t,Of(t),e)}function pi(e,t){return e&&ss(t,Rf(t),e)}function gi(e,t,n){"__proto__"==t&&At?At(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function yi(t,n){for(var r=-1,i=n.length,o=Xe(i),s=null==t;++r<i;)o[r]=s?e:vf(t,n[r]);return o}function mi(t,n,r){return t==t&&(r!==e&&(t=t<=r?t:r),n!==e&&(t=t>=n?t:n)),t}function vi(t,n,r,i,o,s){var a,c=n&l,u=n&f,d=n&h;if(r&&(a=o?r(t,i,o,s):r(t)),a!==e)return a;if(!Rl(t))return t;var p=ul(t);if(p){if(a=na(t),!c)return os(t,a)}else{var g=Xs(t),y=g==K||g==G;if(pl(t))return Yo(t,c);if(g==X||g==B||y&&!o){if(a=u||y?{}:ra(t),!c)return u?cs(t,pi(a,t)):as(t,di(a,t))}else{if(!zt[g])return o?t:{};a=ia(t,g,c)}}s||(s=new Zr);var m=s.get(t);if(m)return m;s.set(t,a),jl(t)?t.forEach((function(e){a.add(vi(e,n,r,e,t,s))})):xl(t)&&t.forEach((function(e,i){a.set(i,vi(e,n,r,i,t,s))}));var v=p?e:(d?u?Fs:Bs:u?Rf:Of)(t);return un(v||t,(function(e,i){v&&(e=t[i=e]),li(a,i,vi(e,n,r,i,t,s))})),a}function _i(e){var t=Of(e);return function(n){return bi(n,e,t)}}function bi(t,n,r){var i=r.length;if(null==t)return!i;for(t=rt(t);i--;){var o=r[i],s=n[o],a=t[o];if(a===e&&!(o in t)||!s(a))return!1}return!0}function wi(t,n,r){if("function"!=typeof t)throw new st(o);return Ia((function(){t.apply(e,r)}),n)}function Ei(e,t,n,i){var o=-1,s=dn,a=!0,c=e.length,u=[],l=t.length;if(!c)return u;n&&(t=gn(t,Dn(n))),i?(s=pn,a=!1):t.length>=r&&(s=zn,a=!1,t=new Qr(t));e:for(;++o<c;){var f=e[o],h=null==n?f:n(f);if(f=i||0!==f?f:0,a&&h==h){for(var d=l;d--;)if(t[d]===h)continue e;u.push(f)}else s(t,h,i)||u.push(f)}return u}Or.templateSettings={escape:Ie,evaluate:xe,interpolate:Ce,variable:"",imports:{_:Or}},Or.prototype=Ir.prototype,Or.prototype.constructor=Or,xr.prototype=Rr(Ir.prototype),xr.prototype.constructor=xr,Cr.prototype=Rr(Ir.prototype),Cr.prototype.constructor=Cr,Ar.prototype.clear=Tr,Ar.prototype.delete=Mr,Ar.prototype.get=Lr,Ar.prototype.has=Ur,Ar.prototype.set=Dr,jr.prototype.clear=zr,jr.prototype.delete=Br,jr.prototype.get=Fr,jr.prototype.has=Hr,jr.prototype.set=qr,$r.prototype.clear=Vr,$r.prototype.delete=Wr,$r.prototype.get=Kr,$r.prototype.has=Gr,$r.prototype.set=Yr,Qr.prototype.add=Qr.prototype.push=Jr,Qr.prototype.has=Xr,Zr.prototype.clear=ei,Zr.prototype.delete=ti,Zr.prototype.get=ni,Zr.prototype.has=ri,Zr.prototype.set=ii;var Si=fs(Ai),Oi=fs(Ti,!0);function Ri(e,t){var n=!0;return Si(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function Ii(t,n,r){for(var i=-1,o=t.length;++i<o;){var s=t[i],a=n(s);if(null!=a&&(c===e?a==a&&!Bl(a):r(a,c)))var c=a,u=s}return u}function xi(t,n,r,i){var o=t.length;for((r=Yl(r))<0&&(r=-r>o?0:o+r),(i=i===e||i>o?o:Yl(i))<0&&(i+=o),i=r>i?0:Ql(i);r<i;)t[r++]=n;return t}function Ci(e,t){var n=[];return Si(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function Pi(e,t,n,r,i){var o=-1,s=e.length;for(n||(n=sa),i||(i=[]);++o<s;){var a=e[o];t>0&&n(a)?t>1?Pi(a,t-1,n,r,i):yn(i,a):r||(i[i.length]=a)}return i}var ki=hs(),Ni=hs(!0);function Ai(e,t){return e&&ki(e,t,Of)}function Ti(e,t){return e&&Ni(e,t,Of)}function Mi(e,t){return hn(t,(function(t){return El(e[t])}))}function Li(t,n){for(var r=0,i=(n=Vo(n,t)).length;null!=t&&r<i;)t=t[Aa(n[r++])];return r&&r==i?t:e}function Ui(e,t,n){var r=t(e);return ul(e)?r:yn(r,n(e))}function Di(t){return null==t?t===e?oe:J:Pt&&Pt in rt(t)?Ys(t):ba(t)}function ji(e,t){return e>t}function zi(e,t){return null!=e&&ht.call(e,t)}function Bi(e,t){return null!=e&&t in rt(e)}function Fi(e,t,n){return e>=Xt(t,n)&&e<Qt(t,n)}function Hi(t,n,r){for(var i=r?pn:dn,o=t[0].length,s=t.length,a=s,c=Xe(s),u=1/0,l=[];a--;){var f=t[a];a&&n&&(f=gn(f,Dn(n))),u=Xt(f.length,u),c[a]=!r&&(n||o>=120&&f.length>=120)?new Qr(a&&f):e}f=t[0];var h=-1,d=c[0];e:for(;++h<o&&l.length<u;){var p=f[h],g=n?n(p):p;if(p=r||0!==p?p:0,!(d?zn(d,g):i(l,g,r))){for(a=s;--a;){var y=c[a];if(!(y?zn(y,g):i(t[a],g,r)))continue e}d&&d.push(g),l.push(p)}}return l}function qi(e,t,n,r){return Ai(e,(function(e,i,o){t(r,n(e),i,o)})),r}function $i(t,n,r){var i=null==(t=Ea(t,n=Vo(n,t)))?t:t[Aa(sc(n))];return null==i?e:an(i,t,r)}function Vi(e){return Il(e)&&Di(e)==B}function Wi(e){return Il(e)&&Di(e)==ce}function Ki(e){return Il(e)&&Di(e)==$}function Gi(e,t,n,r,i){return e===t||(null==e||null==t||!Il(e)&&!Il(t)?e!=e&&t!=t:Yi(e,t,n,r,Gi,i))}function Yi(e,t,n,r,i,o){var s=ul(e),a=ul(t),c=s?F:Xs(e),u=a?F:Xs(t),l=(c=c==B?X:c)==X,f=(u=u==B?X:u)==X,h=c==u;if(h&&pl(e)){if(!pl(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new Zr),s||Fl(e)?Us(e,t,n,r,i,o):Ds(e,t,c,n,r,i,o);if(!(n&d)){var p=l&&ht.call(e,"__wrapped__"),g=f&&ht.call(t,"__wrapped__");if(p||g){var y=p?e.value():e,m=g?t.value():t;return o||(o=new Zr),i(y,m,n,r,o)}}return!!h&&(o||(o=new Zr),js(e,t,n,r,i,o))}function Qi(e){return Il(e)&&Xs(e)==Y}function Ji(t,n,r,i){var o=r.length,s=o,a=!i;if(null==t)return!s;for(t=rt(t);o--;){var c=r[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<s;){var u=(c=r[o])[0],l=t[u],f=c[1];if(a&&c[2]){if(l===e&&!(u in t))return!1}else{var h=new Zr;if(i)var g=i(l,f,u,t,n,h);if(!(g===e?Gi(f,l,d|p,i,h):g))return!1}}return!0}function Xi(e){return!(!Rl(e)||ha(e))&&(El(e)?vt:We).test(Ta(e))}function Zi(e){return Il(e)&&Di(e)==te}function eo(e){return Il(e)&&Xs(e)==ne}function to(e){return Il(e)&&Ol(e.length)&&!!jt[Di(e)]}function no(e){return"function"==typeof e?e:null==e?Ah:"object"==typeof e?ul(e)?co(e[0],e[1]):ao(e):Vh(e)}function ro(e){if(!pa(e))return Yt(e);var t=[];for(var n in rt(e))ht.call(e,n)&&"constructor"!=n&&t.push(n);return t}function io(e){if(!Rl(e))return _a(e);var t=pa(e),n=[];for(var r in e)"constructor"==r&&(t||!ht.call(e,r))||n.push(r);return n}function oo(e,t){return e<t}function so(e,t){var n=-1,r=fl(e)?Xe(e.length):[];return Si(e,(function(e,i,o){r[++n]=t(e,i,o)})),r}function ao(e){var t=Ks(e);return 1==t.length&&t[0][2]?ya(t[0][0],t[0][1]):function(n){return n===e||Ji(n,e,t)}}function co(t,n){return ua(t)&&ga(n)?ya(Aa(t),n):function(r){var i=vf(r,t);return i===e&&i===n?bf(r,t):Gi(n,i,d|p)}}function uo(t,n,r,i,o){t!==n&&ki(n,(function(s,a){if(o||(o=new Zr),Rl(s))lo(t,n,a,r,uo,i,o);else{var c=i?i(Oa(t,a),s,a+"",t,n,o):e;c===e&&(c=s),ui(t,a,c)}}),Rf)}function lo(t,n,r,i,o,s,a){var c=Oa(t,r),u=Oa(n,r),l=a.get(u);if(l)ui(t,r,l);else{var f=s?s(c,u,r+"",t,n,a):e,h=f===e;if(h){var d=ul(u),p=!d&&pl(u),g=!d&&!p&&Fl(u);f=u,d||p||g?ul(c)?f=c:hl(c)?f=os(c):p?(h=!1,f=Yo(u,!0)):g?(h=!1,f=es(u,!0)):f=[]:Ll(u)||cl(u)?(f=c,cl(c)?f=Xl(c):(!Rl(c)||El(c))&&(f=ra(u))):h=!1}h&&(a.set(u,f),o(f,u,i,s,a),a.delete(u)),ui(t,r,f)}}function fo(t,n){var r=t.length;if(r)return aa(n+=n<0?r:0,r)?t[n]:e}function ho(e,t,n){t=t.length?gn(t,(function(e){return ul(e)?function(t){return Li(t,1===e.length?e[0]:e)}:e})):[Ah];var r=-1;t=gn(t,Dn(Vs()));var i=so(e,(function(e,n,i){var o=gn(t,(function(t){return t(e)}));return{criteria:o,index:++r,value:e}}));return An(i,(function(e,t){return ns(e,t,n)}))}function po(e,t){return go(e,t,(function(t,n){return bf(e,n)}))}function go(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var s=t[r],a=Li(e,s);n(a,s)&&Ro(o,Vo(s,e),a)}return o}function yo(e){return function(t){return Li(t,e)}}function mo(e,t,n,r){var i=r?In:Rn,o=-1,s=t.length,a=e;for(e===t&&(t=os(t)),n&&(a=gn(e,Dn(n)));++o<s;)for(var c=0,u=t[o],l=n?n(u):u;(c=i(a,l,c,r))>-1;)a!==e&&It.call(a,c,1),It.call(e,c,1);return e}function vo(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;aa(i)?It.call(e,i,1):Do(e,i)}}return e}function _o(e,t){return e+Ft(wn()*(t-e+1))}function bo(e,t,n,r){for(var i=-1,o=Qt(Bt((t-e)/(n||1)),0),s=Xe(o);o--;)s[r?o:++i]=e,e+=n;return s}function wo(e,t){var n="";if(!e||t<1||t>T)return n;do{t%2&&(n+=e),(t=Ft(t/2))&&(e+=e)}while(t);return n}function Eo(e,t){return xa(wa(e,t,Ah),e+"")}function So(e){return si(qf(e))}function Oo(e,t){var n=qf(e);return ka(n,mi(t,0,n.length))}function Ro(t,n,r,i){if(!Rl(t))return t;for(var o=-1,s=(n=Vo(n,t)).length,a=s-1,c=t;null!=c&&++o<s;){var u=Aa(n[o]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(o!=a){var f=c[u];(l=i?i(f,u,c):e)===e&&(l=Rl(f)?f:aa(n[o+1])?[]:{})}li(c,u,l),c=c[u]}return t}var Io=pr?function(e,t){return pr.set(e,t),e}:Ah,xo=At?function(e,t){return At(e,"toString",{configurable:!0,enumerable:!1,value:Ch(t),writable:!0})}:Ah;function Co(e){return ka(qf(e))}function Po(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(n=n>i?i:n)<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Xe(i);++r<i;)o[r]=e[r+t];return o}function ko(e,t){var n;return Si(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function No(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=j){for(;r<i;){var o=r+i>>>1,s=e[o];null!==s&&!Bl(s)&&(n?s<=t:s<t)?r=o+1:i=o}return i}return Ao(e,t,Ah,n)}function Ao(t,n,r,i){var o=0,s=null==t?0:t.length;if(0===s)return 0;for(var a=(n=r(n))!=n,c=null===n,u=Bl(n),l=n===e;o<s;){var f=Ft((o+s)/2),h=r(t[f]),d=h!==e,p=null===h,g=h==h,y=Bl(h);if(a)var m=i||g;else m=l?g&&(i||d):c?g&&d&&(i||!p):u?g&&d&&!p&&(i||!y):!p&&!y&&(i?h<=n:h<n);m?o=f+1:s=f}return Xt(s,D)}function To(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n],a=t?t(s):s;if(!n||!ol(a,c)){var c=a;o[i++]=0===s?0:s}}return o}function Mo(e){return"number"==typeof e?e:Bl(e)?L:+e}function Lo(e){if("string"==typeof e)return e;if(ul(e))return gn(e,Lo)+"";if(Bl(e))return Sr?Sr.call(e):"";var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Uo(e,t,n){var i=-1,o=dn,s=e.length,a=!0,c=[],u=c;if(n)a=!1,o=pn;else if(s>=r){var l=t?null:ks(e);if(l)return Zn(l);a=!1,o=zn,u=new Qr}else u=t?[]:c;e:for(;++i<s;){var f=e[i],h=t?t(f):f;if(f=n||0!==f?f:0,a&&h==h){for(var d=u.length;d--;)if(u[d]===h)continue e;t&&u.push(h),c.push(f)}else o(u,h,n)||(u!==c&&u.push(h),c.push(f))}return c}function Do(e,t){return null==(e=Ea(e,t=Vo(t,e)))||delete e[Aa(sc(t))]}function jo(e,t,n,r){return Ro(e,t,n(Li(e,t)),r)}function zo(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?Po(e,r?0:o,r?o+1:i):Po(e,r?o+1:0,r?i:o)}function Bo(e,t){var n=e;return n instanceof Cr&&(n=n.value()),mn(t,(function(e,t){return t.func.apply(t.thisArg,yn([e],t.args))}),n)}function Fo(e,t,n){var r=e.length;if(r<2)return r?Uo(e[0]):[];for(var i=-1,o=Xe(r);++i<r;)for(var s=e[i],a=-1;++a<r;)a!=i&&(o[i]=Ei(o[i]||s,e[a],t,n));return Uo(Pi(o,1),t,n)}function Ho(t,n,r){for(var i=-1,o=t.length,s=n.length,a={};++i<o;){var c=i<s?n[i]:e;r(a,t[i],c)}return a}function qo(e){return hl(e)?e:[]}function $o(e){return"function"==typeof e?e:Ah}function Vo(e,t){return ul(e)?e:ua(e,t)?[e]:Na(ef(e))}var Wo=Eo;function Ko(t,n,r){var i=t.length;return r=r===e?i:r,!n&&r>=i?t:Po(t,n,r)}var Go=Tt||function(e){return Gt.clearTimeout(e)};function Yo(e,t){if(t)return e.slice();var n=e.length,r=Et?Et(n):new e.constructor(n);return e.copy(r),r}function Qo(e){var t=new e.constructor(e.byteLength);return new wt(t).set(new wt(e)),t}function Jo(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Xo(e){var t=new e.constructor(e.source,qe.exec(e));return t.lastIndex=e.lastIndex,t}function Zo(e){return Er?rt(Er.call(e)):{}}function es(e,t){var n=t?Qo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function ts(t,n){if(t!==n){var r=t!==e,i=null===t,o=t==t,s=Bl(t),a=n!==e,c=null===n,u=n==n,l=Bl(n);if(!c&&!l&&!s&&t>n||s&&a&&u&&!c&&!l||i&&a&&u||!r&&u||!o)return 1;if(!i&&!s&&!l&&t<n||l&&r&&o&&!i&&!s||c&&r&&o||!a&&o||!u)return-1}return 0}function ns(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,s=i.length,a=n.length;++r<s;){var c=ts(i[r],o[r]);if(c)return r>=a?c:c*("desc"==n[r]?-1:1)}return e.index-t.index}function rs(e,t,n,r){for(var i=-1,o=e.length,s=n.length,a=-1,c=t.length,u=Qt(o-s,0),l=Xe(c+u),f=!r;++a<c;)l[a]=t[a];for(;++i<s;)(f||i<o)&&(l[n[i]]=e[i]);for(;u--;)l[a++]=e[i++];return l}function is(e,t,n,r){for(var i=-1,o=e.length,s=-1,a=n.length,c=-1,u=t.length,l=Qt(o-a,0),f=Xe(l+u),h=!r;++i<l;)f[i]=e[i];for(var d=i;++c<u;)f[d+c]=t[c];for(;++s<a;)(h||i<o)&&(f[d+n[s]]=e[i++]);return f}function os(e,t){var n=-1,r=e.length;for(t||(t=Xe(r));++n<r;)t[n]=e[n];return t}function ss(t,n,r,i){var o=!r;r||(r={});for(var s=-1,a=n.length;++s<a;){var c=n[s],u=i?i(r[c],t[c],c,r,t):e;u===e&&(u=t[c]),o?gi(r,c,u):li(r,c,u)}return r}function as(e,t){return ss(e,Qs(e),t)}function cs(e,t){return ss(e,Js(e),t)}function us(e,t){return function(n,r){var i=ul(n)?cn:hi,o=t?t():{};return i(n,e,Vs(r,2),o)}}function ls(t){return Eo((function(n,r){var i=-1,o=r.length,s=o>1?r[o-1]:e,a=o>2?r[2]:e;for(s=t.length>3&&"function"==typeof s?(o--,s):e,a&&ca(r[0],r[1],a)&&(s=o<3?e:s,o=1),n=rt(n);++i<o;){var c=r[i];c&&t(n,c,i,s)}return n}))}function fs(e,t){return function(n,r){if(null==n)return n;if(!fl(n))return e(n,r);for(var i=n.length,o=t?i:-1,s=rt(n);(t?o--:++o<i)&&!1!==r(s[o],o,s););return n}}function hs(e){return function(t,n,r){for(var i=-1,o=rt(t),s=r(t),a=s.length;a--;){var c=s[e?a:++i];if(!1===n(o[c],c,o))break}return t}}function ds(e,t,n){var r=t&g,i=ys(e);function o(){return(this&&this!==Gt&&this instanceof o?i:e).apply(r?n:this,arguments)}return o}function ps(t){return function(n){var r=Kn(n=ef(n))?ir(n):e,i=r?r[0]:n.charAt(0),o=r?Ko(r,1).join(""):n.slice(1);return i[t]()+o}}function gs(e){return function(t){return mn(Sh(Qf(t).replace(kt,"")),e,"")}}function ys(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=Rr(e.prototype),r=e.apply(n,t);return Rl(r)?r:n}}function ms(t,n,r){var i=ys(t);function o(){for(var s=arguments.length,a=Xe(s),c=s,u=$s(o);c--;)a[c]=arguments[c];var l=s<3&&a[0]!==u&&a[s-1]!==u?[]:Xn(a,u);return(s-=l.length)<r?Cs(t,n,bs,o.placeholder,e,a,l,e,e,r-s):an(this&&this!==Gt&&this instanceof o?i:t,this,a)}return o}function vs(t){return function(n,r,i){var o=rt(n);if(!fl(n)){var s=Vs(r,3);n=Of(n),r=function(e){return s(o[e],e,o)}}var a=t(n,r,i);return a>-1?o[s?n[a]:a]:e}}function _s(t){return zs((function(n){var r=n.length,i=r,s=xr.prototype.thru;for(t&&n.reverse();i--;){var a=n[i];if("function"!=typeof a)throw new st(o);if(s&&!c&&"wrapper"==qs(a))var c=new xr([],!0)}for(i=c?i:r;++i<r;){var u=qs(a=n[i]),l="wrapper"==u?Hs(a):e;c=l&&fa(l[0])&&l[1]==(E|v|b|S)&&!l[4].length&&1==l[9]?c[qs(l[0])].apply(c,l[3]):1==a.length&&fa(a)?c[u]():c.thru(a)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&ul(t))return c.plant(t).value();for(var i=0,o=r?n[i].apply(this,e):t;++i<r;)o=n[i].call(this,o);return o}}))}function bs(t,n,r,i,o,s,a,c,u,l){var f=n&E,h=n&g,d=n&y,p=n&(v|_),m=n&O,b=d?e:ys(t);function w(){for(var e=arguments.length,g=Xe(e),y=e;y--;)g[y]=arguments[y];if(p)var v=$s(w),_=Hn(g,v);if(i&&(g=rs(g,i,o,p)),s&&(g=is(g,s,a,p)),e-=_,p&&e<l){var E=Xn(g,v);return Cs(t,n,bs,w.placeholder,r,g,E,c,u,l-e)}var S=h?r:this,O=d?S[t]:t;return e=g.length,c?g=Sa(g,c):m&&e>1&&g.reverse(),f&&u<e&&(g.length=u),this&&this!==Gt&&this instanceof w&&(O=b||ys(O)),O.apply(S,g)}return w}function ws(e,t){return function(n,r){return qi(n,e,t(r),{})}}function Es(t,n){return function(r,i){var o;if(r===e&&i===e)return n;if(r!==e&&(o=r),i!==e){if(o===e)return i;"string"==typeof r||"string"==typeof i?(r=Lo(r),i=Lo(i)):(r=Mo(r),i=Mo(i)),o=t(r,i)}return o}}function Ss(e){return zs((function(t){return t=gn(t,Dn(Vs())),Eo((function(n){var r=this;return e(t,(function(e){return an(e,r,n)}))}))}))}function Os(t,n){var r=(n=n===e?" ":Lo(n)).length;if(r<2)return r?wo(n,t):n;var i=wo(n,Bt(t/rr(n)));return Kn(n)?Ko(ir(i),0,t).join(""):i.slice(0,t)}function Rs(e,t,n,r){var i=t&g,o=ys(e);function s(){for(var t=-1,a=arguments.length,c=-1,u=r.length,l=Xe(u+a),f=this&&this!==Gt&&this instanceof s?o:e;++c<u;)l[c]=r[c];for(;a--;)l[c++]=arguments[++t];return an(f,i?n:this,l)}return s}function Is(t){return function(n,r,i){return i&&"number"!=typeof i&&ca(n,r,i)&&(r=i=e),n=Gl(n),r===e?(r=n,n=0):r=Gl(r),bo(n,r,i=i===e?n<r?1:-1:Gl(i),t)}}function xs(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=Jl(t),n=Jl(n)),e(t,n)}}function Cs(t,n,r,i,o,s,a,c,u,l){var f=n&v;n|=f?b:w,(n&=~(f?w:b))&m||(n&=~(g|y));var h=[t,n,o,f?s:e,f?a:e,f?e:s,f?e:a,c,u,l],d=r.apply(e,h);return fa(t)&&Ra(d,h),d.placeholder=i,Ca(d,t,n)}function Ps(e){var t=nt[e];return function(e,n){if(e=Jl(e),(n=null==n?0:Xt(Yl(n),292))&&Wt(e)){var r=(ef(e)+"e").split("e");return+((r=(ef(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var ks=lr&&1/Zn(new lr([,-0]))[1]==A?function(e){return new lr(e)}:Bh;function Ns(e){return function(t){var n=Xs(t);return n==Y?Qn(t):n==ne?er(t):Ln(t,e(t))}}function As(t,n,r,i,s,a,c,u){var l=n&y;if(!l&&"function"!=typeof t)throw new st(o);var f=i?i.length:0;if(f||(n&=~(b|w),i=s=e),c=c===e?c:Qt(Yl(c),0),u=u===e?u:Yl(u),f-=s?s.length:0,n&w){var h=i,d=s;i=s=e}var p=l?e:Hs(t),m=[t,n,r,i,s,h,d,a,c,u];if(p&&va(m,p),t=m[0],n=m[1],r=m[2],i=m[3],s=m[4],!(u=m[9]=m[9]===e?l?0:t.length:Qt(m[9]-f,0))&&n&(v|_)&&(n&=~(v|_)),n&&n!=g)E=n==v||n==_?ms(t,n,u):n!=b&&n!=(g|b)||s.length?bs.apply(e,m):Rs(t,n,r,i);else var E=ds(t,n,r);return Ca((p?Io:Ra)(E,m),t,n)}function Ts(t,n,r,i){return t===e||ol(t,ut[r])&&!ht.call(i,r)?n:t}function Ms(t,n,r,i,o,s){return Rl(t)&&Rl(n)&&(s.set(n,t),uo(t,n,e,Ms,s),s.delete(n)),t}function Ls(t){return Ll(t)?e:t}function Us(t,n,r,i,o,s){var a=r&d,c=t.length,u=n.length;if(c!=u&&!(a&&u>c))return!1;var l=s.get(t),f=s.get(n);if(l&&f)return l==n&&f==t;var h=-1,g=!0,y=r&p?new Qr:e;for(s.set(t,n),s.set(n,t);++h<c;){var m=t[h],v=n[h];if(i)var _=a?i(v,m,h,n,t,s):i(m,v,h,t,n,s);if(_!==e){if(_)continue;g=!1;break}if(y){if(!_n(n,(function(e,t){if(!zn(y,t)&&(m===e||o(m,e,r,i,s)))return y.push(t)}))){g=!1;break}}else if(m!==v&&!o(m,v,r,i,s)){g=!1;break}}return s.delete(t),s.delete(n),g}function Ds(e,t,n,r,i,o,s){switch(n){case ue:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ce:return!(e.byteLength!=t.byteLength||!o(new wt(e),new wt(t)));case q:case $:case Q:return ol(+e,+t);case W:return e.name==t.name&&e.message==t.message;case te:case re:return e==t+"";case Y:var a=Qn;case ne:var c=r&d;if(a||(a=Zn),e.size!=t.size&&!c)return!1;var u=s.get(e);if(u)return u==t;r|=p,s.set(e,t);var l=Us(a(e),a(t),r,i,o,s);return s.delete(e),l;case ie:if(Er)return Er.call(e)==Er.call(t)}return!1}function js(t,n,r,i,o,s){var a=r&d,c=Bs(t),u=c.length;if(u!=Bs(n).length&&!a)return!1;for(var l=u;l--;){var f=c[l];if(!(a?f in n:ht.call(n,f)))return!1}var h=s.get(t),p=s.get(n);if(h&&p)return h==n&&p==t;var g=!0;s.set(t,n),s.set(n,t);for(var y=a;++l<u;){var m=t[f=c[l]],v=n[f];if(i)var _=a?i(v,m,f,n,t,s):i(m,v,f,t,n,s);if(!(_===e?m===v||o(m,v,r,i,s):_)){g=!1;break}y||(y="constructor"==f)}if(g&&!y){var b=t.constructor,w=n.constructor;b!=w&&"constructor"in t&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(g=!1)}return s.delete(t),s.delete(n),g}function zs(t){return xa(wa(t,e,Ya),t+"")}function Bs(e){return Ui(e,Of,Qs)}function Fs(e){return Ui(e,Rf,Js)}var Hs=pr?function(e){return pr.get(e)}:Bh;function qs(e){for(var t=e.name+"",n=gr[t],r=ht.call(gr,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function $s(e){return(ht.call(Or,"placeholder")?Or:e).placeholder}function Vs(){var e=Or.iteratee||Th;return e=e===Th?no:e,arguments.length?e(arguments[0],arguments[1]):e}function Ws(e,t){var n=e.__data__;return la(t)?n["string"==typeof t?"string":"hash"]:n.map}function Ks(e){for(var t=Of(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ga(i)]}return t}function Gs(t,n){var r=Wn(t,n);return Xi(r)?r:e}function Ys(t){var n=ht.call(t,Pt),r=t[Pt];try{t[Pt]=e;var i=!0}catch{}var o=gt.call(t);return i&&(n?t[Pt]=r:delete t[Pt]),o}var Qs=Ht?function(e){return null==e?[]:(e=rt(e),hn(Ht(e),(function(t){return Rt.call(e,t)})))}:Yh,Js=Ht?function(e){for(var t=[];e;)yn(t,Qs(e)),e=St(e);return t}:Yh,Xs=Di;function Zs(e,t,n){for(var r=-1,i=n.length;++r<i;){var o=n[r],s=o.size;switch(o.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=Xt(t,e+s);break;case"takeRight":e=Qt(e,t-s)}}return{start:e,end:t}}function ea(e){var t=e.match(De);return t?t[1].split(je):[]}function ta(e,t,n){for(var r=-1,i=(t=Vo(t,e)).length,o=!1;++r<i;){var s=Aa(t[r]);if(!(o=null!=e&&n(e,s)))break;e=e[s]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Ol(i)&&aa(s,i)&&(ul(e)||cl(e))}function na(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&ht.call(e,"index")&&(n.index=e.index,n.input=e.input),n}function ra(e){return"function"!=typeof e.constructor||pa(e)?{}:Rr(St(e))}function ia(e,t,n){var r=e.constructor;switch(t){case ce:return Qo(e);case q:case $:return new r(+e);case ue:return Jo(e,n);case le:case fe:case he:case de:case pe:case ge:case ye:case me:case ve:return es(e,n);case Y:return new r;case Q:case re:return new r(e);case te:return Xo(e);case ne:return new r;case ie:return Zo(e)}}function oa(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(Ue,"{\n/* [wrapped with "+t+"] */\n")}function sa(e){return ul(e)||cl(e)||!!(xt&&e&&e[xt])}function aa(e,t){var n=typeof e;return!!(t=t??T)&&("number"==n||"symbol"!=n&&Ge.test(e))&&e>-1&&e%1==0&&e<t}function ca(e,t,n){if(!Rl(n))return!1;var r=typeof t;return!!("number"==r?fl(n)&&aa(t,n.length):"string"==r&&t in n)&&ol(n[t],e)}function ua(e,t){if(ul(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Bl(e))||ke.test(e)||!Pe.test(e)||null!=t&&e in rt(t)}function la(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function fa(e){var t=qs(e),n=Or[t];if("function"!=typeof n||!(t in Cr.prototype))return!1;if(e===n)return!0;var r=Hs(n);return!!r&&e===r[0]}function ha(e){return!!pt&&pt in e}(tr&&Xs(new tr(new ArrayBuffer(1)))!=ue||ar&&Xs(new ar)!=Y||cr&&Xs(cr.resolve())!=Z||lr&&Xs(new lr)!=ne||hr&&Xs(new hr)!=se)&&(Xs=function(t){var n=Di(t),r=n==X?t.constructor:e,i=r?Ta(r):"";if(i)switch(i){case yr:return ue;case mr:return Y;case vr:return Z;case _r:return ne;case br:return se}return n});var da=lt?El:Qh;function pa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ut)}function ga(e){return e==e&&!Rl(e)}function ya(t,n){return function(r){return null!=r&&r[t]===n&&(n!==e||t in rt(r))}}function ma(e){var t=Fu(e,(function(e){return n.size===c&&n.clear(),e})),n=t.cache;return t}function va(e,t){var n=e[1],r=t[1],i=n|r,o=i<(g|y|E),s=r==E&&n==v||r==E&&n==S&&e[7].length<=t[8]||r==(E|S)&&t[7].length<=t[8]&&n==v;if(!o&&!s)return e;r&g&&(e[2]=t[2],i|=n&g?0:m);var a=t[3];if(a){var c=e[3];e[3]=c?rs(c,a,t[4]):a,e[4]=c?Xn(e[3],u):t[4]}return(a=t[5])&&(c=e[5],e[5]=c?is(c,a,t[6]):a,e[6]=c?Xn(e[5],u):t[6]),(a=t[7])&&(e[7]=a),r&E&&(e[8]=null==e[8]?t[8]:Xt(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function _a(e){var t=[];if(null!=e)for(var n in rt(e))t.push(n);return t}function ba(e){return gt.call(e)}function wa(t,n,r){return n=Qt(n===e?t.length-1:n,0),function(){for(var e=arguments,i=-1,o=Qt(e.length-n,0),s=Xe(o);++i<o;)s[i]=e[n+i];i=-1;for(var a=Xe(n+1);++i<n;)a[i]=e[i];return a[n]=r(s),an(t,this,a)}}function Ea(e,t){return t.length<2?e:Li(e,Po(t,0,-1))}function Sa(t,n){for(var r=t.length,i=Xt(n.length,r),o=os(t);i--;){var s=n[i];t[i]=aa(s,r)?o[s]:e}return t}function Oa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ra=Pa(Io),Ia=Lt||function(e,t){return Gt.setTimeout(e,t)},xa=Pa(xo);function Ca(e,t,n){var r=t+"";return xa(e,oa(r,Ma(ea(r),n)))}function Pa(t){var n=0,r=0;return function(){var i=Zt(),o=C-(i-r);if(r=i,o>0){if(++n>=x)return arguments[0]}else n=0;return t.apply(e,arguments)}}function ka(t,n){var r=-1,i=t.length,o=i-1;for(n=n===e?i:n;++r<n;){var s=_o(r,o),a=t[s];t[s]=t[r],t[r]=a}return t.length=n,t}var Na=ma((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ne,(function(e,n,r,i){t.push(r?i.replace(Fe,"$1"):n||e)})),t}));function Aa(e){if("string"==typeof e||Bl(e))return e;var t=e+"";return"0"==t&&1/e==-A?"-0":t}function Ta(e){if(null!=e){try{return ft.call(e)}catch{}try{return e+""}catch{}}return""}function Ma(e,t){return un(z,(function(n){var r="_."+n[0];t&n[1]&&!dn(e,r)&&e.push(r)})),e.sort()}function La(e){if(e instanceof Cr)return e.clone();var t=new xr(e.__wrapped__,e.__chain__);return t.__actions__=os(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Ua(t,n,r){n=(r?ca(t,n,r):n===e)?1:Qt(Yl(n),0);var i=null==t?0:t.length;if(!i||n<1)return[];for(var o=0,s=0,a=Xe(Bt(i/n));o<i;)a[s++]=Po(t,o,o+=n);return a}function Da(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}function ja(){var e=arguments.length;if(!e)return[];for(var t=Xe(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return yn(ul(n)?os(n):[n],Pi(t,1))}var za=Eo((function(e,t){return hl(e)?Ei(e,Pi(t,1,hl,!0)):[]})),Ba=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),Vs(r,2)):[]})),Fa=Eo((function(t,n){var r=sc(n);return hl(r)&&(r=e),hl(t)?Ei(t,Pi(n,1,hl,!0),e,r):[]}));function Ha(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=r||n===e?1:Yl(n))<0?0:n,i):[]}function qa(t,n,r){var i=null==t?0:t.length;return i?Po(t,0,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n):[]}function $a(e,t){return e&&e.length?zo(e,Vs(t,3),!0,!0):[]}function Va(e,t){return e&&e.length?zo(e,Vs(t,3),!0):[]}function Wa(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&ca(e,t,n)&&(n=0,r=i),xi(e,t,n,r)):[]}function Ka(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),On(e,Vs(t,3),i)}function Ga(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i-1;return r!==e&&(o=Yl(r),o=r<0?Qt(i+o,0):Xt(o,i-1)),On(t,Vs(n,3),o,!0)}function Ya(e){return null!=e&&e.length?Pi(e,1):[]}function Qa(e){return null!=e&&e.length?Pi(e,A):[]}function Ja(t,n){return null!=t&&t.length?Pi(t,n=n===e?1:Yl(n)):[]}function Xa(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r}function Za(t){return t&&t.length?t[0]:e}function ec(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:Yl(n);return i<0&&(i=Qt(r+i,0)),Rn(e,t,i)}function tc(e){return null!=e&&e.length?Po(e,0,-1):[]}var nc=Eo((function(e){var t=gn(e,qo);return t.length&&t[0]===e[0]?Hi(t):[]})),rc=Eo((function(t){var n=sc(t),r=gn(t,qo);return n===sc(r)?n=e:r.pop(),r.length&&r[0]===t[0]?Hi(r,Vs(n,2)):[]})),ic=Eo((function(t){var n=sc(t),r=gn(t,qo);return(n="function"==typeof n?n:e)&&r.pop(),r.length&&r[0]===t[0]?Hi(r,e,n):[]}));function oc(e,t){return null==e?"":Kt.call(e,t)}function sc(t){var n=null==t?0:t.length;return n?t[n-1]:e}function ac(t,n,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==e&&(o=(o=Yl(r))<0?Qt(i+o,0):Xt(o,i-1)),n==n?nr(t,n,o):On(t,xn,o,!0)}function cc(t,n){return t&&t.length?fo(t,Yl(n)):e}var uc=Eo(lc);function lc(e,t){return e&&e.length&&t&&t.length?mo(e,t):e}function fc(e,t,n){return e&&e.length&&t&&t.length?mo(e,t,Vs(n,2)):e}function hc(t,n,r){return t&&t.length&&n&&n.length?mo(t,n,e,r):t}var dc=zs((function(e,t){var n=null==e?0:e.length,r=yi(e,t);return vo(e,gn(t,(function(e){return aa(e,n)?+e:e})).sort(ts)),r}));function pc(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Vs(t,3);++r<o;){var s=e[r];t(s,r,e)&&(n.push(s),i.push(r))}return vo(e,i),n}function gc(e){return null==e?e:kn.call(e)}function yc(t,n,r){var i=null==t?0:t.length;return i?(r&&"number"!=typeof r&&ca(t,n,r)?(n=0,r=i):(n=null==n?0:Yl(n),r=r===e?i:Yl(r)),Po(t,n,r)):[]}function mc(e,t){return No(e,t)}function vc(e,t,n){return Ao(e,t,Vs(n,2))}function _c(e,t){var n=null==e?0:e.length;if(n){var r=No(e,t);if(r<n&&ol(e[r],t))return r}return-1}function bc(e,t){return No(e,t,!0)}function wc(e,t,n){return Ao(e,t,Vs(n,2),!0)}function Ec(e,t){if(null!=e&&e.length){var n=No(e,t,!0)-1;if(ol(e[n],t))return n}return-1}function Sc(e){return e&&e.length?To(e):[]}function Oc(e,t){return e&&e.length?To(e,Vs(t,2)):[]}function Rc(e){var t=null==e?0:e.length;return t?Po(e,1,t):[]}function Ic(t,n,r){return t&&t.length?Po(t,0,(n=r||n===e?1:Yl(n))<0?0:n):[]}function xc(t,n,r){var i=null==t?0:t.length;return i?Po(t,(n=i-(n=r||n===e?1:Yl(n)))<0?0:n,i):[]}function Cc(e,t){return e&&e.length?zo(e,Vs(t,3),!1,!0):[]}function Pc(e,t){return e&&e.length?zo(e,Vs(t,3)):[]}var kc=Eo((function(e){return Uo(Pi(e,1,hl,!0))})),Nc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Uo(Pi(t,1,hl,!0),Vs(n,2))})),Ac=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Uo(Pi(t,1,hl,!0),e,n)}));function Tc(e){return e&&e.length?Uo(e):[]}function Mc(e,t){return e&&e.length?Uo(e,Vs(t,2)):[]}function Lc(t,n){return n="function"==typeof n?n:e,t&&t.length?Uo(t,e,n):[]}function Uc(e){if(!e||!e.length)return[];var t=0;return e=hn(e,(function(e){if(hl(e))return t=Qt(e.length,t),!0})),Mn(t,(function(t){return gn(e,Pn(t))}))}function Dc(t,n){if(!t||!t.length)return[];var r=Uc(t);return null==n?r:gn(r,(function(t){return an(n,e,t)}))}var jc=Eo((function(e,t){return hl(e)?Ei(e,t):[]})),zc=Eo((function(e){return Fo(hn(e,hl))})),Bc=Eo((function(t){var n=sc(t);return hl(n)&&(n=e),Fo(hn(t,hl),Vs(n,2))})),Fc=Eo((function(t){var n=sc(t);return n="function"==typeof n?n:e,Fo(hn(t,hl),e,n)})),Hc=Eo(Uc);function qc(e,t){return Ho(e||[],t||[],li)}function $c(e,t){return Ho(e||[],t||[],Ro)}var Vc=Eo((function(t){var n=t.length,r=n>1?t[n-1]:e;return r="function"==typeof r?(t.pop(),r):e,Dc(t,r)}));function Wc(e){var t=Or(e);return t.__chain__=!0,t}function Kc(e,t){return t(e),e}function Gc(e,t){return t(e)}var Yc=zs((function(t){var n=t.length,r=n?t[0]:0,i=this.__wrapped__,o=function(e){return yi(e,t)};return!(n>1||this.__actions__.length)&&i instanceof Cr&&aa(r)?((i=i.slice(r,+r+(n?1:0))).__actions__.push({func:Gc,args:[o],thisArg:e}),new xr(i,this.__chain__).thru((function(t){return n&&!t.length&&t.push(e),t}))):this.thru(o)}));function Qc(){return Wc(this)}function Jc(){return new xr(this.value(),this.__chain__)}function Xc(){this.__values__===e&&(this.__values__=Kl(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}}function Zc(){return this}function eu(t){for(var n,r=this;r instanceof Ir;){var i=La(r);i.__index__=0,i.__values__=e,n?o.__wrapped__=i:n=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,n}function tu(){var t=this.__wrapped__;if(t instanceof Cr){var n=t;return this.__actions__.length&&(n=new Cr(this)),(n=n.reverse()).__actions__.push({func:Gc,args:[gc],thisArg:e}),new xr(n,this.__chain__)}return this.thru(gc)}function nu(){return Bo(this.__wrapped__,this.__actions__)}var ru=us((function(e,t,n){ht.call(e,n)?++e[n]:gi(e,n,1)}));function iu(t,n,r){var i=ul(t)?fn:Ri;return r&&ca(t,n,r)&&(n=e),i(t,Vs(n,3))}function ou(e,t){return(ul(e)?hn:Ci)(e,Vs(t,3))}var su=vs(Ka),au=vs(Ga);function cu(e,t){return Pi(mu(e,t),1)}function uu(e,t){return Pi(mu(e,t),A)}function lu(t,n,r){return r=r===e?1:Yl(r),Pi(mu(t,n),r)}function fu(e,t){return(ul(e)?un:Si)(e,Vs(t,3))}function hu(e,t){return(ul(e)?ln:Oi)(e,Vs(t,3))}var du=us((function(e,t,n){ht.call(e,n)?e[n].push(t):gi(e,n,[t])}));function pu(e,t,n,r){e=fl(e)?e:qf(e),n=n&&!r?Yl(n):0;var i=e.length;return n<0&&(n=Qt(i+n,0)),zl(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&Rn(e,t,n)>-1}var gu=Eo((function(e,t,n){var r=-1,i="function"==typeof t,o=fl(e)?Xe(e.length):[];return Si(e,(function(e){o[++r]=i?an(t,e,n):$i(e,t,n)})),o})),yu=us((function(e,t,n){gi(e,n,t)}));function mu(e,t){return(ul(e)?gn:so)(e,Vs(t,3))}function vu(t,n,r,i){return null==t?[]:(ul(n)||(n=null==n?[]:[n]),ul(r=i?e:r)||(r=null==r?[]:[r]),ho(t,n,r))}var _u=us((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));function bu(e,t,n){var r=ul(e)?mn:Nn,i=arguments.length<3;return r(e,Vs(t,4),n,i,Si)}function wu(e,t,n){var r=ul(e)?vn:Nn,i=arguments.length<3;return r(e,Vs(t,4),n,i,Oi)}function Eu(e,t){return(ul(e)?hn:Ci)(e,Hu(Vs(t,3)))}function Su(e){return(ul(e)?si:So)(e)}function Ou(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),(ul(t)?ai:Oo)(t,n)}function Ru(e){return(ul(e)?ci:Co)(e)}function Iu(e){if(null==e)return 0;if(fl(e))return zl(e)?rr(e):e.length;var t=Xs(e);return t==Y||t==ne?e.size:ro(e).length}function xu(t,n,r){var i=ul(t)?_n:ko;return r&&ca(t,n,r)&&(n=e),i(t,Vs(n,3))}var Cu=Eo((function(e,t){if(null==e)return[];var n=t.length;return n>1&&ca(e,t[0],t[1])?t=[]:n>2&&ca(t[0],t[1],t[2])&&(t=[t[0]]),ho(e,Pi(t,1),[])})),Pu=Mt||function(){return Gt.Date.now()};function ku(e,t){if("function"!=typeof t)throw new st(o);return e=Yl(e),function(){if(--e<1)return t.apply(this,arguments)}}function Nu(t,n,r){return n=r?e:n,n=t&&null==n?t.length:n,As(t,E,e,e,e,e,n)}function Au(t,n){var r;if("function"!=typeof n)throw new st(o);return t=Yl(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=e),r}}var Tu=Eo((function(e,t,n){var r=g;if(n.length){var i=Xn(n,$s(Tu));r|=b}return As(e,r,t,n,i)})),Mu=Eo((function(e,t,n){var r=g|y;if(n.length){var i=Xn(n,$s(Mu));r|=b}return As(t,r,e,n,i)}));function Lu(t,n,r){var i=As(t,v,e,e,e,e,e,n=r?e:n);return i.placeholder=Lu.placeholder,i}function Uu(t,n,r){var i=As(t,_,e,e,e,e,e,n=r?e:n);return i.placeholder=Uu.placeholder,i}function Du(t,n,r){var i,s,a,c,u,l,f=0,h=!1,d=!1,p=!0;if("function"!=typeof t)throw new st(o);function g(n){var r=i,o=s;return i=s=e,f=n,c=t.apply(o,r)}function y(e){return f=e,u=Ia(_,n),h?g(e):c}function m(e){var t=n-(e-l);return d?Xt(t,a-(e-f)):t}function v(t){var r=t-l;return l===e||r>=n||r<0||d&&t-f>=a}function _(){var e=Pu();if(v(e))return b(e);u=Ia(_,m(e))}function b(t){return u=e,p&&i?g(t):(i=s=e,c)}function w(){u!==e&&Go(u),f=0,i=l=s=u=e}function E(){return u===e?c:b(Pu())}function S(){var t=Pu(),r=v(t);if(i=arguments,s=this,l=t,r){if(u===e)return y(l);if(d)return Go(u),u=Ia(_,n),g(l)}return u===e&&(u=Ia(_,n)),c}return n=Jl(n)||0,Rl(r)&&(h=!!r.leading,a=(d="maxWait"in r)?Qt(Jl(r.maxWait)||0,n):a,p="trailing"in r?!!r.trailing:p),S.cancel=w,S.flush=E,S}var ju=Eo((function(e,t){return wi(e,1,t)})),zu=Eo((function(e,t,n){return wi(e,Jl(t)||0,n)}));function Bu(e){return As(e,O)}function Fu(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new st(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=e.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Fu.Cache||$r),n}function Hu(e){if("function"!=typeof e)throw new st(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function qu(e){return Au(2,e)}Fu.Cache=$r;var $u=Wo((function(e,t){var n=(t=1==t.length&&ul(t[0])?gn(t[0],Dn(Vs())):gn(Pi(t,1),Dn(Vs()))).length;return Eo((function(r){for(var i=-1,o=Xt(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return an(e,this,r)}))})),Vu=Eo((function(t,n){var r=Xn(n,$s(Vu));return As(t,b,e,n,r)})),Wu=Eo((function(t,n){var r=Xn(n,$s(Wu));return As(t,w,e,n,r)})),Ku=zs((function(t,n){return As(t,S,e,e,e,n)}));function Gu(t,n){if("function"!=typeof t)throw new st(o);return Eo(t,n=n===e?n:Yl(n))}function Yu(e,t){if("function"!=typeof e)throw new st(o);return t=null==t?0:Qt(Yl(t),0),Eo((function(n){var r=n[t],i=Ko(n,0,t);return r&&yn(i,r),an(e,this,i)}))}function Qu(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new st(o);return Rl(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Du(e,t,{leading:r,maxWait:t,trailing:i})}function Ju(e){return Nu(e,1)}function Xu(e,t){return Vu($o(t),e)}function Zu(){if(!arguments.length)return[];var e=arguments[0];return ul(e)?e:[e]}function el(e){return vi(e,h)}function tl(t,n){return vi(t,h,n="function"==typeof n?n:e)}function nl(e){return vi(e,l|h)}function rl(t,n){return vi(t,l|h,n="function"==typeof n?n:e)}function il(e,t){return null==t||bi(e,t,Of(t))}function ol(e,t){return e===t||e!=e&&t!=t}var sl=xs(ji),al=xs((function(e,t){return e>=t})),cl=Vi(function(){return arguments}())?Vi:function(e){return Il(e)&&ht.call(e,"callee")&&!Rt.call(e,"callee")},ul=Xe.isArray,ll=en?Dn(en):Wi;function fl(e){return null!=e&&Ol(e.length)&&!El(e)}function hl(e){return Il(e)&&fl(e)}function dl(e){return!0===e||!1===e||Il(e)&&Di(e)==q}var pl=qt||Qh,gl=tn?Dn(tn):Ki;function yl(e){return Il(e)&&1===e.nodeType&&!Ll(e)}function ml(e){if(null==e)return!0;if(fl(e)&&(ul(e)||"string"==typeof e||"function"==typeof e.splice||pl(e)||Fl(e)||cl(e)))return!e.length;var t=Xs(e);if(t==Y||t==ne)return!e.size;if(pa(e))return!ro(e).length;for(var n in e)if(ht.call(e,n))return!1;return!0}function vl(e,t){return Gi(e,t)}function _l(t,n,r){var i=(r="function"==typeof r?r:e)?r(t,n):e;return i===e?Gi(t,n,e,r):!!i}function bl(e){if(!Il(e))return!1;var t=Di(e);return t==W||t==V||"string"==typeof e.message&&"string"==typeof e.name&&!Ll(e)}function wl(e){return"number"==typeof e&&Wt(e)}function El(e){if(!Rl(e))return!1;var t=Di(e);return t==K||t==G||t==H||t==ee}function Sl(e){return"number"==typeof e&&e==Yl(e)}function Ol(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=T}function Rl(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Il(e){return null!=e&&"object"==typeof e}var xl=nn?Dn(nn):Qi;function Cl(e,t){return e===t||Ji(e,t,Ks(t))}function Pl(t,n,r){return r="function"==typeof r?r:e,Ji(t,n,Ks(n),r)}function kl(e){return Ml(e)&&e!=+e}function Nl(e){if(da(e))throw new et(i);return Xi(e)}function Al(e){return null===e}function Tl(e){return null==e}function Ml(e){return"number"==typeof e||Il(e)&&Di(e)==Q}function Ll(e){if(!Il(e)||Di(e)!=X)return!1;var t=St(e);if(null===t)return!0;var n=ht.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&ft.call(n)==yt}var Ul=rn?Dn(rn):Zi;function Dl(e){return Sl(e)&&e>=-T&&e<=T}var jl=on?Dn(on):eo;function zl(e){return"string"==typeof e||!ul(e)&&Il(e)&&Di(e)==re}function Bl(e){return"symbol"==typeof e||Il(e)&&Di(e)==ie}var Fl=sn?Dn(sn):to;function Hl(t){return t===e}function ql(e){return Il(e)&&Xs(e)==se}function $l(e){return Il(e)&&Di(e)==ae}var Vl=xs(oo),Wl=xs((function(e,t){return e<=t}));function Kl(e){if(!e)return[];if(fl(e))return zl(e)?ir(e):os(e);if(Ct&&e[Ct])return Yn(e[Ct]());var t=Xs(e);return(t==Y?Qn:t==ne?Zn:qf)(e)}function Gl(e){return e?(e=Jl(e))===A||e===-A?(e<0?-1:1)*M:e==e?e:0:0===e?e:0}function Yl(e){var t=Gl(e),n=t%1;return t==t?n?t-n:t:0}function Ql(e){return e?mi(Yl(e),0,U):0}function Jl(e){if("number"==typeof e)return e;if(Bl(e))return L;if(Rl(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Rl(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Un(e);var n=Ve.test(e);return n||Ke.test(e)?Vt(e.slice(2),n?2:8):$e.test(e)?L:+e}function Xl(e){return ss(e,Rf(e))}function Zl(e){return e?mi(Yl(e),-T,T):0===e?e:0}function ef(e){return null==e?"":Lo(e)}var tf=ls((function(e,t){if(pa(t)||fl(t))ss(t,Of(t),e);else for(var n in t)ht.call(t,n)&&li(e,n,t[n])})),nf=ls((function(e,t){ss(t,Rf(t),e)})),rf=ls((function(e,t,n,r){ss(t,Rf(t),e,r)})),of=ls((function(e,t,n,r){ss(t,Of(t),e,r)})),sf=zs(yi);function af(e,t){var n=Rr(e);return null==t?n:di(n,t)}var cf=Eo((function(t,n){t=rt(t);var r=-1,i=n.length,o=i>2?n[2]:e;for(o&&ca(n[0],n[1],o)&&(i=1);++r<i;)for(var s=n[r],a=Rf(s),c=-1,u=a.length;++c<u;){var l=a[c],f=t[l];(f===e||ol(f,ut[l])&&!ht.call(t,l))&&(t[l]=s[l])}return t})),uf=Eo((function(t){return t.push(e,Ms),an(Pf,e,t)}));function lf(e,t){return Sn(e,Vs(t,3),Ai)}function ff(e,t){return Sn(e,Vs(t,3),Ti)}function hf(e,t){return null==e?e:ki(e,Vs(t,3),Rf)}function df(e,t){return null==e?e:Ni(e,Vs(t,3),Rf)}function pf(e,t){return e&&Ai(e,Vs(t,3))}function gf(e,t){return e&&Ti(e,Vs(t,3))}function yf(e){return null==e?[]:Mi(e,Of(e))}function mf(e){return null==e?[]:Mi(e,Rf(e))}function vf(t,n,r){var i=null==t?e:Li(t,n);return i===e?r:i}function _f(e,t){return null!=e&&ta(e,t,zi)}function bf(e,t){return null!=e&&ta(e,t,Bi)}var wf=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),e[t]=n}),Ch(Ah)),Ef=ws((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=gt.call(t)),ht.call(e,t)?e[t].push(n):e[t]=[n]}),Vs),Sf=Eo($i);function Of(e){return fl(e)?oi(e):ro(e)}function Rf(e){return fl(e)?oi(e,!0):io(e)}function If(e,t){var n={};return t=Vs(t,3),Ai(e,(function(e,r,i){gi(n,t(e,r,i),e)})),n}function xf(e,t){var n={};return t=Vs(t,3),Ai(e,(function(e,r,i){gi(n,r,t(e,r,i))})),n}var Cf=ls((function(e,t,n){uo(e,t,n)})),Pf=ls((function(e,t,n,r){uo(e,t,n,r)})),kf=zs((function(e,t){var n={};if(null==e)return n;var r=!1;t=gn(t,(function(t){return t=Vo(t,e),r||(r=t.length>1),t})),ss(e,Fs(e),n),r&&(n=vi(n,l|f|h,Ls));for(var i=t.length;i--;)Do(n,t[i]);return n}));function Nf(e,t){return Tf(e,Hu(Vs(t)))}var Af=zs((function(e,t){return null==e?{}:po(e,t)}));function Tf(e,t){if(null==e)return{};var n=gn(Fs(e),(function(e){return[e]}));return t=Vs(t),go(e,n,(function(e,n){return t(e,n[0])}))}function Mf(t,n,r){var i=-1,o=(n=Vo(n,t)).length;for(o||(o=1,t=e);++i<o;){var s=null==t?e:t[Aa(n[i])];s===e&&(i=o,s=r),t=El(s)?s.call(t):s}return t}function Lf(e,t,n){return null==e?e:Ro(e,t,n)}function Uf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:Ro(t,n,r,i)}var Df=Ns(Of),jf=Ns(Rf);function zf(e,t,n){var r=ul(e),i=r||pl(e)||Fl(e);if(t=Vs(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:Rl(e)&&El(o)?Rr(St(e)):{}}return(i?un:Ai)(e,(function(e,r,i){return t(n,e,r,i)})),n}function Bf(e,t){return null==e||Do(e,t)}function Ff(e,t,n){return null==e?e:jo(e,t,$o(n))}function Hf(t,n,r,i){return i="function"==typeof i?i:e,null==t?t:jo(t,n,$o(r),i)}function qf(e){return null==e?[]:jn(e,Of(e))}function $f(e){return null==e?[]:jn(e,Rf(e))}function Vf(t,n,r){return r===e&&(r=n,n=e),r!==e&&(r=(r=Jl(r))==r?r:0),n!==e&&(n=(n=Jl(n))==n?n:0),mi(Jl(t),n,r)}function Wf(t,n,r){return n=Gl(n),r===e?(r=n,n=0):r=Gl(r),Fi(t=Jl(t),n,r)}function Kf(t,n,r){if(r&&"boolean"!=typeof r&&ca(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=Gl(t),n===e?(n=t,t=0):n=Gl(n)),t>n){var i=t;t=n,n=i}if(r||t%1||n%1){var o=wn();return Xt(t+o*(n-t+$t("1e-"+((o+"").length-1))),n)}return _o(t,n)}var Gf=gs((function(e,t,n){return t=t.toLowerCase(),e+(n?Yf(t):t)}));function Yf(e){return Eh(ef(e).toLowerCase())}function Qf(e){return(e=ef(e))&&e.replace(Ye,qn).replace(Nt,"")}function Jf(t,n,r){t=ef(t),n=Lo(n);var i=t.length,o=r=r===e?i:mi(Yl(r),0,i);return(r-=n.length)>=0&&t.slice(r,o)==n}function Xf(e){return(e=ef(e))&&Re.test(e)?e.replace(Se,$n):e}function Zf(e){return(e=ef(e))&&Te.test(e)?e.replace(Ae,"\\$&"):e}var eh=gs((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),th=gs((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),nh=ps("toLowerCase");function rh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Os(Ft(i),n)+e+Os(Bt(i),n)}function ih(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?e+Os(t-r,n):e}function oh(e,t,n){e=ef(e);var r=(t=Yl(t))?rr(e):0;return t&&r<t?Os(t-r,n)+e:e}function sh(e,t,n){return n||null==t?t=0:t&&(t=+t),bn(ef(e).replace(Me,""),t||0)}function ah(t,n,r){return n=(r?ca(t,n,r):n===e)?1:Yl(n),wo(ef(t),n)}function ch(){var e=arguments,t=ef(e[0]);return e.length<3?t:t.replace(e[1],e[2])}var uh=gs((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));function lh(t,n,r){return r&&"number"!=typeof r&&ca(t,n,r)&&(n=r=e),(r=r===e?U:r>>>0)?(t=ef(t))&&("string"==typeof n||null!=n&&!Ul(n))&&!(n=Lo(n))&&Kn(t)?Ko(ir(t),0,r):t.split(n,r):[]}var fh=gs((function(e,t,n){return e+(n?" ":"")+Eh(t)}));function hh(e,t,n){return e=ef(e),n=null==n?0:mi(Yl(n),0,e.length),t=Lo(t),e.slice(n,n+t.length)==t}function dh(t,n,r){var i=Or.templateSettings;r&&ca(t,n,r)&&(n=e),t=ef(t),n=rf({},n,i,Ts);var o,a,c=rf({},n.imports,i.imports,Ts),u=Of(c),l=jn(c,u),f=0,h=n.interpolate||Qe,d="__p += '",p=it((n.escape||Qe).source+"|"+h.source+"|"+(h===Ce?He:Qe).source+"|"+(n.evaluate||Qe).source+"|$","g"),g="//# sourceURL="+(ht.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Dt+"]")+"\n";t.replace(p,(function(e,n,r,i,s,c){return r||(r=i),d+=t.slice(f,c).replace(Je,Vn),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),f=c+e.length,e})),d+="';\n";var y=ht.call(n,"variable")&&n.variable;if(y){if(Be.test(y))throw new et(s)}else d="with (obj) {\n"+d+"\n}\n";d=(a?d.replace(_e,""):d).replace(be,"$1").replace(we,"$1;"),d="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=Oh((function(){return tt(u,g+"return "+d).apply(e,l)}));if(m.source=d,bl(m))throw m;return m}function ph(e){return ef(e).toLowerCase()}function gh(e){return ef(e).toUpperCase()}function yh(t,n,r){if((t=ef(t))&&(r||n===e))return Un(t);if(!t||!(n=Lo(n)))return t;var i=ir(t),o=ir(n);return Ko(i,Bn(i,o),Fn(i,o)+1).join("")}function mh(t,n,r){if((t=ef(t))&&(r||n===e))return t.slice(0,or(t)+1);if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,0,Fn(i,ir(n))+1).join("")}function vh(t,n,r){if((t=ef(t))&&(r||n===e))return t.replace(Me,"");if(!t||!(n=Lo(n)))return t;var i=ir(t);return Ko(i,Bn(i,ir(n))).join("")}function _h(t,n){var r=R,i=I;if(Rl(n)){var o="separator"in n?n.separator:o;r="length"in n?Yl(n.length):r,i="omission"in n?Lo(n.omission):i}var s=(t=ef(t)).length;if(Kn(t)){var a=ir(t);s=a.length}if(r>=s)return t;var c=r-rr(i);if(c<1)return i;var u=a?Ko(a,0,c).join(""):t.slice(0,c);if(o===e)return u+i;if(a&&(c+=u.length-c),Ul(o)){if(t.slice(c).search(o)){var l,f=u;for(o.global||(o=it(o.source,ef(qe.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var h=l.index;u=u.slice(0,h===e?c:h)}}else if(t.indexOf(Lo(o),c)!=c){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+i}function bh(e){return(e=ef(e))&&Oe.test(e)?e.replace(Ee,sr):e}var wh=gs((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Eh=ps("toUpperCase");function Sh(t,n,r){return t=ef(t),(n=r?e:n)===e?Gn(t)?ur(t):En(t):t.match(n)||[]}var Oh=Eo((function(t,n){try{return an(t,e,n)}catch(e){return bl(e)?e:new et(e)}})),Rh=zs((function(e,t){return un(t,(function(t){t=Aa(t),gi(e,t,Tu(e[t],e))})),e}));function Ih(e){var t=null==e?0:e.length,n=Vs();return e=t?gn(e,(function(e){if("function"!=typeof e[1])throw new st(o);return[n(e[0]),e[1]]})):[],Eo((function(n){for(var r=-1;++r<t;){var i=e[r];if(an(i[0],this,n))return an(i[1],this,n)}}))}function xh(e){return _i(vi(e,l))}function Ch(e){return function(){return e}}function Ph(e,t){return null==e||e!=e?t:e}var kh=_s(),Nh=_s(!0);function Ah(e){return e}function Th(e){return no("function"==typeof e?e:vi(e,l))}function Mh(e){return ao(vi(e,l))}function Lh(e,t){return co(e,vi(t,l))}var Uh=Eo((function(e,t){return function(n){return $i(n,e,t)}})),Dh=Eo((function(e,t){return function(n){return $i(e,n,t)}}));function jh(e,t,n){var r=Of(t),i=Mi(t,r);null==n&&(!Rl(t)||!i.length&&r.length)&&(n=t,t=e,e=this,i=Mi(t,Of(t)));var o=!(Rl(n)&&"chain"in n&&!n.chain),s=El(e);return un(i,(function(n){var r=t[n];e[n]=r,s&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__);return(n.__actions__=os(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,yn([this.value()],arguments))})})),e}function zh(){return Gt._===this&&(Gt._=mt),this}function Bh(){}function Fh(e){return e=Yl(e),Eo((function(t){return fo(t,e)}))}var Hh=Ss(gn),qh=Ss(fn),$h=Ss(_n);function Vh(e){return ua(e)?Pn(Aa(e)):yo(e)}function Wh(t){return function(n){return null==t?e:Li(t,n)}}var Kh=Is(),Gh=Is(!0);function Yh(){return[]}function Qh(){return!1}function Jh(){return{}}function Xh(){return""}function Zh(){return!0}function ed(e,t){if((e=Yl(e))<1||e>T)return[];var n=U,r=Xt(e,U);t=Vs(t),e-=U;for(var i=Mn(r,t);++n<e;)t(n);return i}function td(e){return ul(e)?gn(e,Aa):Bl(e)?[e]:os(Na(ef(e)))}function nd(e){var t=++dt;return ef(e)+t}var rd=Es((function(e,t){return e+t}),0),id=Ps("ceil"),od=Es((function(e,t){return e/t}),1),sd=Ps("floor");function ad(t){return t&&t.length?Ii(t,Ah,ji):e}function cd(t,n){return t&&t.length?Ii(t,Vs(n,2),ji):e}function ud(e){return Cn(e,Ah)}function ld(e,t){return Cn(e,Vs(t,2))}function fd(t){return t&&t.length?Ii(t,Ah,oo):e}function hd(t,n){return t&&t.length?Ii(t,Vs(n,2),oo):e}var dd=Es((function(e,t){return e*t}),1),pd=Ps("round"),gd=Es((function(e,t){return e-t}),0);function yd(e){return e&&e.length?Tn(e,Ah):0}function md(e,t){return e&&e.length?Tn(e,Vs(t,2)):0}return Or.after=ku,Or.ary=Nu,Or.assign=tf,Or.assignIn=nf,Or.assignInWith=rf,Or.assignWith=of,Or.at=sf,Or.before=Au,Or.bind=Tu,Or.bindAll=Rh,Or.bindKey=Mu,Or.castArray=Zu,Or.chain=Wc,Or.chunk=Ua,Or.compact=Da,Or.concat=ja,Or.cond=Ih,Or.conforms=xh,Or.constant=Ch,Or.countBy=ru,Or.create=af,Or.curry=Lu,Or.curryRight=Uu,Or.debounce=Du,Or.defaults=cf,Or.defaultsDeep=uf,Or.defer=ju,Or.delay=zu,Or.difference=za,Or.differenceBy=Ba,Or.differenceWith=Fa,Or.drop=Ha,Or.dropRight=qa,Or.dropRightWhile=$a,Or.dropWhile=Va,Or.fill=Wa,Or.filter=ou,Or.flatMap=cu,Or.flatMapDeep=uu,Or.flatMapDepth=lu,Or.flatten=Ya,Or.flattenDeep=Qa,Or.flattenDepth=Ja,Or.flip=Bu,Or.flow=kh,Or.flowRight=Nh,Or.fromPairs=Xa,Or.functions=yf,Or.functionsIn=mf,Or.groupBy=du,Or.initial=tc,Or.intersection=nc,Or.intersectionBy=rc,Or.intersectionWith=ic,Or.invert=wf,Or.invertBy=Ef,Or.invokeMap=gu,Or.iteratee=Th,Or.keyBy=yu,Or.keys=Of,Or.keysIn=Rf,Or.map=mu,Or.mapKeys=If,Or.mapValues=xf,Or.matches=Mh,Or.matchesProperty=Lh,Or.memoize=Fu,Or.merge=Cf,Or.mergeWith=Pf,Or.method=Uh,Or.methodOf=Dh,Or.mixin=jh,Or.negate=Hu,Or.nthArg=Fh,Or.omit=kf,Or.omitBy=Nf,Or.once=qu,Or.orderBy=vu,Or.over=Hh,Or.overArgs=$u,Or.overEvery=qh,Or.overSome=$h,Or.partial=Vu,Or.partialRight=Wu,Or.partition=_u,Or.pick=Af,Or.pickBy=Tf,Or.property=Vh,Or.propertyOf=Wh,Or.pull=uc,Or.pullAll=lc,Or.pullAllBy=fc,Or.pullAllWith=hc,Or.pullAt=dc,Or.range=Kh,Or.rangeRight=Gh,Or.rearg=Ku,Or.reject=Eu,Or.remove=pc,Or.rest=Gu,Or.reverse=gc,Or.sampleSize=Ou,Or.set=Lf,Or.setWith=Uf,Or.shuffle=Ru,Or.slice=yc,Or.sortBy=Cu,Or.sortedUniq=Sc,Or.sortedUniqBy=Oc,Or.split=lh,Or.spread=Yu,Or.tail=Rc,Or.take=Ic,Or.takeRight=xc,Or.takeRightWhile=Cc,Or.takeWhile=Pc,Or.tap=Kc,Or.throttle=Qu,Or.thru=Gc,Or.toArray=Kl,Or.toPairs=Df,Or.toPairsIn=jf,Or.toPath=td,Or.toPlainObject=Xl,Or.transform=zf,Or.unary=Ju,Or.union=kc,Or.unionBy=Nc,Or.unionWith=Ac,Or.uniq=Tc,Or.uniqBy=Mc,Or.uniqWith=Lc,Or.unset=Bf,Or.unzip=Uc,Or.unzipWith=Dc,Or.update=Ff,Or.updateWith=Hf,Or.values=qf,Or.valuesIn=$f,Or.without=jc,Or.words=Sh,Or.wrap=Xu,Or.xor=zc,Or.xorBy=Bc,Or.xorWith=Fc,Or.zip=Hc,Or.zipObject=qc,Or.zipObjectDeep=$c,Or.zipWith=Vc,Or.entries=Df,Or.entriesIn=jf,Or.extend=nf,Or.extendWith=rf,jh(Or,Or),Or.add=rd,Or.attempt=Oh,Or.camelCase=Gf,Or.capitalize=Yf,Or.ceil=id,Or.clamp=Vf,Or.clone=el,Or.cloneDeep=nl,Or.cloneDeepWith=rl,Or.cloneWith=tl,Or.conformsTo=il,Or.deburr=Qf,Or.defaultTo=Ph,Or.divide=od,Or.endsWith=Jf,Or.eq=ol,Or.escape=Xf,Or.escapeRegExp=Zf,Or.every=iu,Or.find=su,Or.findIndex=Ka,Or.findKey=lf,Or.findLast=au,Or.findLastIndex=Ga,Or.findLastKey=ff,Or.floor=sd,Or.forEach=fu,Or.forEachRight=hu,Or.forIn=hf,Or.forInRight=df,Or.forOwn=pf,Or.forOwnRight=gf,Or.get=vf,Or.gt=sl,Or.gte=al,Or.has=_f,Or.hasIn=bf,Or.head=Za,Or.identity=Ah,Or.includes=pu,Or.indexOf=ec,Or.inRange=Wf,Or.invoke=Sf,Or.isArguments=cl,Or.isArray=ul,Or.isArrayBuffer=ll,Or.isArrayLike=fl,Or.isArrayLikeObject=hl,Or.isBoolean=dl,Or.isBuffer=pl,Or.isDate=gl,Or.isElement=yl,Or.isEmpty=ml,Or.isEqual=vl,Or.isEqualWith=_l,Or.isError=bl,Or.isFinite=wl,Or.isFunction=El,Or.isInteger=Sl,Or.isLength=Ol,Or.isMap=xl,Or.isMatch=Cl,Or.isMatchWith=Pl,Or.isNaN=kl,Or.isNative=Nl,Or.isNil=Tl,Or.isNull=Al,Or.isNumber=Ml,Or.isObject=Rl,Or.isObjectLike=Il,Or.isPlainObject=Ll,Or.isRegExp=Ul,Or.isSafeInteger=Dl,Or.isSet=jl,Or.isString=zl,Or.isSymbol=Bl,Or.isTypedArray=Fl,Or.isUndefined=Hl,Or.isWeakMap=ql,Or.isWeakSet=$l,Or.join=oc,Or.kebabCase=eh,Or.last=sc,Or.lastIndexOf=ac,Or.lowerCase=th,Or.lowerFirst=nh,Or.lt=Vl,Or.lte=Wl,Or.max=ad,Or.maxBy=cd,Or.mean=ud,Or.meanBy=ld,Or.min=fd,Or.minBy=hd,Or.stubArray=Yh,Or.stubFalse=Qh,Or.stubObject=Jh,Or.stubString=Xh,Or.stubTrue=Zh,Or.multiply=dd,Or.nth=cc,Or.noConflict=zh,Or.noop=Bh,Or.now=Pu,Or.pad=rh,Or.padEnd=ih,Or.padStart=oh,Or.parseInt=sh,Or.random=Kf,Or.reduce=bu,Or.reduceRight=wu,Or.repeat=ah,Or.replace=ch,Or.result=Mf,Or.round=pd,Or.runInContext=t,Or.sample=Su,Or.size=Iu,Or.snakeCase=uh,Or.some=xu,Or.sortedIndex=mc,Or.sortedIndexBy=vc,Or.sortedIndexOf=_c,Or.sortedLastIndex=bc,Or.sortedLastIndexBy=wc,Or.sortedLastIndexOf=Ec,Or.startCase=fh,Or.startsWith=hh,Or.subtract=gd,Or.sum=yd,Or.sumBy=md,Or.template=dh,Or.times=ed,Or.toFinite=Gl,Or.toInteger=Yl,Or.toLength=Ql,Or.toLower=ph,Or.toNumber=Jl,Or.toSafeInteger=Zl,Or.toString=ef,Or.toUpper=gh,Or.trim=yh,Or.trimEnd=mh,Or.trimStart=vh,Or.truncate=_h,Or.unescape=bh,Or.uniqueId=nd,Or.upperCase=wh,Or.upperFirst=Eh,Or.each=fu,Or.eachRight=hu,Or.first=Za,jh(Or,function(){var e={};return Ai(Or,(function(t,n){ht.call(Or.prototype,n)||(e[n]=t)})),e}(),{chain:!1}),Or.VERSION=n,un(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Or[e].placeholder=Or})),un(["drop","take"],(function(t,n){Cr.prototype[t]=function(r){r=r===e?1:Qt(Yl(r),0);var i=this.__filtered__&&!n?new Cr(this):this.clone();return i.__filtered__?i.__takeCount__=Xt(r,i.__takeCount__):i.__views__.push({size:Xt(r,U),type:t+(i.__dir__<0?"Right":"")}),i},Cr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),un(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=n==P||n==N;Cr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Vs(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),un(["head","last"],(function(e,t){var n="take"+(t?"Right":"");Cr.prototype[e]=function(){return this[n](1).value()[0]}})),un(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");Cr.prototype[e]=function(){return this.__filtered__?new Cr(this):this[n](1)}})),Cr.prototype.compact=function(){return this.filter(Ah)},Cr.prototype.find=function(e){return this.filter(e).head()},Cr.prototype.findLast=function(e){return this.reverse().find(e)},Cr.prototype.invokeMap=Eo((function(e,t){return"function"==typeof e?new Cr(this):this.map((function(n){return $i(n,e,t)}))})),Cr.prototype.reject=function(e){return this.filter(Hu(Vs(e)))},Cr.prototype.slice=function(t,n){t=Yl(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Cr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==e&&(r=(n=Yl(n))<0?r.dropRight(-n):r.take(n-t)),r)},Cr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Cr.prototype.toArray=function(){return this.take(U)},Ai(Cr.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),i=/^(?:head|last)$/.test(n),o=Or[i?"take"+("last"==n?"Right":""):n],s=i||/^find/.test(n);o&&(Or.prototype[n]=function(){var n=this.__wrapped__,a=i?[1]:arguments,c=n instanceof Cr,u=a[0],l=c||ul(n),f=function(e){var t=o.apply(Or,yn([e],a));return i&&h?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(c=l=!1);var h=this.__chain__,d=!!this.__actions__.length,p=s&&!h,g=c&&!d;if(!s&&l){n=g?n:new Cr(this);var y=t.apply(n,a);return y.__actions__.push({func:Gc,args:[f],thisArg:e}),new xr(y,h)}return p&&g?t.apply(this,a):(y=this.thru(f),p?i?y.value()[0]:y.value():y)})})),un(["pop","push","shift","sort","splice","unshift"],(function(e){var t=at[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Or.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ul(i)?i:[],e)}return this[n]((function(n){return t.apply(ul(n)?n:[],e)}))}})),Ai(Cr.prototype,(function(e,t){var n=Or[t];if(n){var r=n.name+"";ht.call(gr,r)||(gr[r]=[]),gr[r].push({name:t,func:n})}})),gr[bs(e,y).name]=[{name:"wrapper",func:e}],Cr.prototype.clone=Pr,Cr.prototype.reverse=kr,Cr.prototype.value=Nr,Or.prototype.at=Yc,Or.prototype.chain=Qc,Or.prototype.commit=Jc,Or.prototype.next=Xc,Or.prototype.plant=eu,Or.prototype.reverse=tu,Or.prototype.toJSON=Or.prototype.valueOf=Or.prototype.value=nu,Or.prototype.first=Or.prototype.head,Ct&&(Or.prototype[Ct]=Zc),Or},fr=lr();Qt?((Qt.exports=fr)._=fr,Yt._=fr):Gt._=fr}.call(t);var qg=Object.defineProperty,$g=Object.defineProperties,Vg=Object.getOwnPropertyDescriptors,Wg=Object.getOwnPropertySymbols,Kg=Object.prototype.hasOwnProperty,Gg=Object.prototype.propertyIsEnumerable,Yg=(e,t,n)=>t in e?qg(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Qg=(e,t)=>{for(var n in t||(t={}))Kg.call(t,n)&&Yg(e,n,t[n]);if(Wg)for(var n of Wg(t))Gg.call(t,n)&&Yg(e,n,t[n]);return e},Jg=(e,t)=>$g(e,Vg(t));function Xg(e,t,n){var r;const i=Ba(e);return(null==(r=t.rpcMap)?void 0:r[i.reference])||`${jg}?chainId=${i.namespace}:${i.reference}&projectId=${n}`}function Zg(e){return e.includes(":")?e.split(":")[1]:e}function ey(e){return e.map((e=>`${e.split(":")[0]}:${e.split(":")[1]}`))}function ty(e,t){const n=Object.keys(t.namespaces).filter((t=>t.includes(e)));if(!n.length)return[];const r=[];return n.forEach((e=>{const n=t.namespaces[e].accounts;r.push(...n)})),r}function ny(e={},t={}){const n=ry(e),r=ry(t);return Hg.exports.merge(n,r)}function ry(e){var t,n,r,i;const o={};if(!_u(e))return o;for(const[s,a]of Object.entries(e)){const e=hu(s)?[s]:a.chains,c=a.methods||[],u=a.events||[],l=a.rpcMap||{},f=du(s);o[f]=Jg(Qg(Qg({},o[f]),a),{chains:$c(e,null==(t=o[f])?void 0:t.chains),methods:$c(c,null==(n=o[f])?void 0:n.methods),events:$c(u,null==(r=o[f])?void 0:r.events),rpcMap:Qg(Qg({},l),null==(i=o[f])?void 0:i.rpcMap)})}return o}function iy(e){return e.includes(":")?e.split(":")[2]:e}function oy(e){const t={};for(const[n,r]of Object.entries(e)){const e=r.methods||[],i=r.events||[],o=r.accounts||[],s=hu(n)?[n]:r.chains?r.chains:ey(r.accounts);t[n]={chains:s,methods:e,events:i,accounts:o}}return t}function sy(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):e.includes(":")?Number(e.split(":")[1]):Number(e)}const ay={},cy=e=>ay[e],uy=(e,t)=>{ay[e]=t};var ly={exports:{}};!function(e,n){var r,i=typeof self<"u"?self:t,o=function(){function e(){this.fetch=!1,this.DOMException=i.DOMException}return e.prototype=i,new e}();r=o,function(e){var t={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{return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};function n(e){return e&&DataView.prototype.isPrototypeOf(e)}if(t.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function c(e){var n={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(n[Symbol.iterator]=function(){return n}),n}function u(e){this.map={},e instanceof u?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function l(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function h(e){var t=new FileReader,n=f(t);return t.readAsArrayBuffer(e),n}function d(e){var t=new FileReader,n=f(t);return t.readAsText(e),n}function p(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:t.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:t.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():t.arrayBuffer&&t.blob&&n(e)?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||o(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=l(this);if(e)return e;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(){return this._bodyArrayBuffer?l(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e=l(this);if(e)return e;if(this._bodyBlob)return d(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(p(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},t.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(e,t){e=s(e),t=a(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},u.prototype.delete=function(e){delete this.map[s(e)]},u.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},u.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},u.prototype.set=function(e,t){this.map[s(e)]=a(t)},u.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},u.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),c(e)},u.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),c(e)},u.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),c(e)},t.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e){var t=e.toUpperCase();return m.indexOf(t)>-1?t:e}function _(e,t){var n=(t=t||{}).body;if(e instanceof _){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new u(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&null!=e._bodyInit&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new u(t.headers)),this.method=v(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function b(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function w(e){var t=new u;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t}function E(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new u(t.headers),this.url=t.url||"",this._initBody(e)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},y.call(_.prototype),y.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];E.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch{e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function O(n,r){return new Promise((function(i,o){var s=new _(n,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:w(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;i(new E(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(typeof s._bodyInit>"u"?null:s._bodyInit)}))}O.polyfill=!0,r.fetch||(r.fetch=O,r.Headers=u,r.Request=_,r.Response=E),e.Headers=u,e.Request=_,e.Response=E,e.fetch=O,Object.defineProperty(e,"__esModule",{value:!0})}({}),o.fetch.ponyfill=!0,delete o.fetch.polyfill;var s=o;(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}(ly,ly.exports);var fy=n(ly.exports);const hy={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"},dy=10;class py{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new o.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!ff(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e,t){this.isAvailable||await this.register();try{const t=ce(e),n=await(await fy(this.url,Object.assign(Object.assign({},hy),{body:t}))).json();this.onPayload({data:n})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ff(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise(((e,t)=>{this.events.once("register_error",(e=>{this.resetMaxListeners(),t(e)})),this.events.once("open",(()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(new Error("HTTP connection is missing or invalid"));e()}))}))}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ce({id:1,jsonrpc:"2.0",method:"test",params:[]});await fy(e,Object.assign(Object.assign({},hy),{body:t}))}this.onOpen()}catch(e){const t=this.parseError(e);throw this.events.emit("register_error",t),this.onClose(),t}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const t="string"==typeof e.data?ae(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const n=this.parseError(t),r=tf(e,n.message||n.toString());this.events.emit("payload",r)}parseError(e,t=this.url){return vl(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>dy&&this.events.setMaxListeners(dy)}}class gy{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class yy{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain())}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const n=t||Xg(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=parseInt(Zg(t));e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,n;let r=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;const i=parseInt(r,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else{if(!this.namespace.methods.includes("wallet_switchEthereumChain"))throw new Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:r}]},chainId:null==(n=this.namespace.chains)?void 0:n[0]}),this.setDefaultChain(`${i}`)}return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}}class my{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class vy{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class _y{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{const n=this.getCardanoRPCUrl(t),r=Zg(t);e[r]=this.createHttpProvider(r,n)})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class by{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class wy{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2])))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;const r=Zg(t);e[r]=this.createHttpProvider(r,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new _f(new py(n,cy("disableProviderPing")))}}class Ey{constructor(e){this.name="near",this.namespace=e.namespace,this.events=cy("events"),this.client=cy("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const n=t||Xg(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(zg.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e&&e.filter((e=>e.split(":")[1]===this.chainId.toString())).map((e=>e.split(":")[2]))||[]}createHttpProviders(){const e={};return this.namespace.chains.forEach((t=>{var n;e[t]=this.createHttpProvider(t,null==(n=this.namespace.rpcMap)?void 0:n[t])})),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const n=this.createHttpProvider(e,t);n&&(this.httpProviders[e]=n)}createHttpProvider(e,t){const n=t||Xg(e,this.namespace);return typeof n>"u"?void 0:new _f(new py(n,cy("disableProviderPing")))}}var Sy=Object.defineProperty,Oy=Object.defineProperties,Ry=Object.getOwnPropertyDescriptors,Iy=Object.getOwnPropertySymbols,xy=Object.prototype.hasOwnProperty,Cy=Object.prototype.propertyIsEnumerable,Py=(e,t,n)=>t in e?Sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ky=(e,t)=>{for(var n in t||(t={}))xy.call(t,n)&&Py(e,n,t[n]);if(Iy)for(var n of Iy(t))Cy.call(t,n)&&Py(e,n,t[n]);return e},Ny=(e,t)=>Oy(e,Ry(t));class Ay{constructor(e){this.events=new o.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&"string"!=typeof e?.logger?e.logger:hn.pino(hn.getDefaultLoggerOptions({level:e?.logger||Lg})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const t=new Ay(e);return await t.initialize(),t}async request(e,t){const[n,r]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ky({},e),chainId:`${n}:${r}`,topic:this.session.topic})}sendAsync(e,t,n){const r=(new Date).getTime();this.request(e,n).then((e=>t(null,ef(r,e)))).catch((e=>t(e,void 0)))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:mu("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:r}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await r().then((e=>{this.session=e,this.namespaces||(this.namespaces=oy(e.namespaces),this.persist("namespaces",this.namespaces))})).catch((e=>{if(e.message!==hg)throw e;t++}))}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[n,r]=this.validateChain(e);this.getProvider(n).setDefaultChain(r,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(vu(t)){for(const n of t)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await Mg.init({logger:this.providerOpts.logger||Lg,relayUrl:this.providerOpts.relayUrl||Ug,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map((e=>du(e))))];uy("client",this.client),uy("events",this.events),uy("disableProviderPing",this.disableProviderPing),e.forEach((e=>{if(!this.session)return;const t=ty(e,this.session),n=ey(t),r=ny(this.namespaces,this.optionalNamespaces),i=Ny(ky({},r[e]),{accounts:t,chains:n});switch(e){case"eip155":this.rpcProviders[e]=new yy({namespace:i});break;case"solana":this.rpcProviders[e]=new my({namespace:i});break;case"cosmos":this.rpcProviders[e]=new vy({namespace:i});break;case"polkadot":this.rpcProviders[e]=new gy({namespace:i});break;case"cip34":this.rpcProviders[e]=new _y({namespace:i});break;case"elrond":this.rpcProviders[e]=new by({namespace:i});break;case"multiversx":this.rpcProviders[e]=new wy({namespace:i});break;case"near":this.rpcProviders[e]=new Ey({namespace:i})}}))}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",(e=>{this.events.emit("session_ping",e)})),this.client.on("session_event",(e=>{const{params:t}=e,{event:n}=t;if("accountsChanged"===n.name){const e=n.data;e&&vu(e)&&this.events.emit("accountsChanged",e.map(iy))}else if("chainChanged"===n.name){const e=t.chainId,n=t.event.data,r=du(e),i=sy(e)!==sy(n)?`${r}:${sy(n)}`:e;this.onChainChanged(i)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)})),this.client.on("session_update",(({topic:e,params:t})=>{var n;const{namespaces:r}=t,i=null==(n=this.client)?void 0:n.session.get(e);this.session=Ny(ky({},i),{namespaces:r}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})})),this.client.on("session_delete",(async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Ny(ky({},mu("USER_DISCONNECTED")),{data:e.topic}))})),this.on(zg.DEFAULT_CHAIN_CHANGED,(e=>{this.onChainChanged(e,!0)}))}getProvider(e){if(!this.rpcProviders[e])throw new Error(`Provider not found: ${e}`);return this.rpcProviders[e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach((e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])}))}setNamespaces(e){const{namespaces:t,optionalNamespaces:n,sessionProperties:r}=e;t&&Object.keys(t).length&&(this.namespaces=t),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=r,this.persist("namespaces",t),this.persist("optionalNamespaces",n)}validateChain(e){const[t,n]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,n];if(t&&!Object.keys(this.namespaces||{}).map((e=>du(e))).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&n)return[t,n];const r=du(Object.keys(this.namespaces)[0]);return[r,this.rpcProviders[r].getDefaultChain()]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){var n;if(!this.namespaces)return;const[r,i]=this.validateChain(e);t||this.getProvider(r).setDefaultChain(i),(null!=(n=this.namespaces[r])?n:this.namespaces[`${r}:${i}`]).defaultChain=i,this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i)}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${Dg}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${Dg}/${e}`)}}const Ty=Ay;e.UniversalProvider=Ty,e.default=Ay,Object.defineProperty(e,"__esModule",{value:!0})}(t)}(0,Ki.exports);const Gi=["eth_sendTransaction","personal_sign"],Yi=["chainChanged","accountsChanged"];function Qi(e){return Number(e[0].split(":")[1])}function Ji(e){return`0x${e.toString(16)}`}class Xi{constructor(){this.events=new dn.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static init(e){return c(this,void 0,void 0,(function*(){const t=new Xi;return yield t.initialize(e),t}))}request(e){return c(this,void 0,void 0,(function*(){return yield this.signer.request(e,this.formatChainId(this.chainId))}))}sendAsync(e,t){this.signer.sendAsync(e,t,this.formatChainId(this.chainId))}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}enable(){return c(this,void 0,void 0,(function*(){this.session||(yield this.connect());return yield this.request({method:"eth_requestAccounts"})}))}connect(e){return c(this,void 0,void 0,(function*(){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:n}=function(e){const{chains:t,optionalChains:n,methods:r,optionalMethods:i,events:o,optionalEvents:s,rpcMap:a}=e;if(!$i(t))throw new Error("Invalid chains");const c=t,u=r||Gi,l=o||Yi,f={chains:c,methods:u,events:l,rpcMap:{[Qi(c)]:a[Qi(c)]}},h=null==o?void 0:o.filter((e=>!Yi.includes(e))),d=null==r?void 0:r.filter((e=>!Gi.includes(e)));if(!(n||s||i||(null==h?void 0:h.length)||(null==d?void 0:d.length)))return{required:f};const p=(null==h?void 0:h.length)&&(null==d?void 0:d.length)||!n;return{required:f,optional:{chains:[...new Set(p?c.concat(n||[]):n)],methods:[...new Set(u.concat(i||[]))],events:[...new Set(l.concat(s||[]))],rpcMap:a}}}(this.rpc);try{const r=yield new Promise(((r,i)=>c(this,void 0,void 0,(function*(){yield this.signer.connect(Object.assign(Object.assign({namespaces:{[this.namespace]:t}},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:null==e?void 0:e.pairingTopic,skipPairing:!1})).then((e=>{r(e)})).catch((e=>{i(new Error(e.message))}))}))));if(!r)return;this.setChainIds(this.rpc.chains);const i=function(e,t=[]){const n=[];return Object.keys(e).forEach((r=>{if(t.length&&!t.includes(r))return;const i=e[r];n.push(...i.accounts)})),n}(r.namespaces,[this.namespace]);this.setAccounts(i),this.events.emit("connect",{chainId:Ji(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}}))}disconnect(){return c(this,void 0,void 0,(function*(){this.session&&(yield this.signer.disconnect()),this.reset()}))}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",(e=>{const{params:t}=e,{event:n}=t;"accountsChanged"===n.name?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===n.name?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)})),this.signer.on("chainChanged",(e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Ji(this.chainId)),this.persist()})),this.signer.on("session_update",(e=>{this.events.emit("session_update",e)})),this.signer.on("session_delete",(e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Object.assign(Object.assign({},function(e,t){const{message:n,code:r}=qi[e];return{message:t?`${n} ${t}`:n,code:r}}("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))})),this.signer.on("display_uri",(e=>{this.events.emit("display_uri",e)}))}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter((e=>this.isCompatibleChainId(e))),n=t.map((e=>this.parseChainId(e)));n.length&&(this.chainId=n[0],this.events.emit("chainChanged",Ji(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,n,r]=e.split(":");return{chainId:`${t}:${n}`,address:r}}setAccounts(e){this.accounts=e.filter((e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId)).map((e=>this.parseAccountId(e).address)),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t;return{chains:(null===(t=e.chains)||void 0===t?void 0:t.map((e=>this.formatChainId(e))))||[`${this.namespace}:1`],optionalChains:e.optionalChains?e.optionalChains.map((e=>this.formatChainId(e))):void 0,methods:(null==e?void 0:e.methods)||Gi,events:(null==e?void 0:e.events)||Yi,optionalMethods:(null==e?void 0:e.optionalMethods)||[],optionalEvents:(null==e?void 0:e.optionalEvents)||[],rpcMap:(null==e?void 0:e.rpcMap)||this.buildRpcMap(e.chains.concat(e.optionalChains||[]),e.projectId),projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const n={};return e.forEach((e=>{n[e]=this.getRpcUrl(e,t)})),n}initialize(e){return c(this,void 0,void 0,(function*(){this.rpc=this.getRpcConfig(e),this.chainId=Qi(this.rpc.chains),this.signer=yield Ki.exports.UniversalProvider.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),yield this.loadPersistedSession()}))}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:n,rpcMap:r}=e;t&&$i(t)&&(this.rpc.chains=t.map((e=>this.formatChainId(e))),t.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)}))),n&&$i(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=null==n?void 0:n.map((e=>this.formatChainId(e))),n.forEach((e=>{this.rpc.rpcMap[e]=(null==r?void 0:r[e])||this.getRpcUrl(e)})))}getRpcUrl(e,t){var n;return(null===(n=this.rpc.rpcMap)||void 0===n?void 0:n[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}loadPersistedSession(){return c(this,void 0,void 0,(function*(){if(!this.session)return;const e=yield this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:null==t?void 0:t.accounts),this.setAccounts(null==t?void 0:t.accounts)}))}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map((e=>this.parseAccount(e)))}}const Zi=n("WalletConnectEvm"),eo=r("WalletConnectEvm");function to(){return c(this,void 0,void 0,(function*(){Zi("getWalletConnectProvider");try{const e=yield function(){return c(this,void 0,void 0,(function*(){Zi("initWalletConnectProvider");const e=lo();Zi("walletConnectProviderOptions is",e);const t={projectId:e.projectId,chains:e.chains,optionalChains:e.optionalChains,methods:e.methods,optionalMethods:e.optionalMethods||[],events:e.events,optionalEvents:e.optionalEvents||[],rpcMap:e.rpcMap,relayUrl:e.relayUrl,showQrModal:!1};Zi("ethereum init options are",t),Zi("creating a new provider instance");try{return Xi.init(t)}catch(e){throw eo("Error while initializing ethereum provider"),e}}))}();return function(e){if(Zi("assignWalletConnectProviderEvents"),!e)return;function t(e){e&&(e.removeListener("connect",n),e.removeListener("session_delete",r))}function n(e){Zi("connectHandler",e),pt(!1)}function r(n){Zi("disconnectHandler",n),e.disconnect(),t(e)}t(e),e.on("connect",n),e.on("session_delete",r),Zi("provider is",e)}(e),e.request=function(e){Zi("patchWalletConnectProviderRequest");const t=e.request.bind(e),n=lo();return Zi("walletConnectProviderOptions is",n),function({method:r,params:i}){return c(this,void 0,void 0,(function*(){return"eth_requestAccounts"===r?(Zi("calling patched",r,i),Zi("handling display_uri once"),e.once("display_uri",no),new Promise(((o,a)=>c(this,void 0,void 0,(function*(){var c,u;try{(null===(c=null==e?void 0:e.session)||void 0===c?void 0:c.connected)?(Zi("reusing existing session"),o(yield t({method:r,params:i}))):(u={uri:"",onClose:()=>{eo("user rejected"),a(new s)}},an("UseLedgerLiveModal",{isDesktop:"desktop"===on().type,uri:u.uri,onClose:u.onClose}),Zi("creating a new session"),yield e.connect({chains:n.chains,optionalChains:n.optionalChains}),o(yield t({method:r,params:i})))}catch(e){return eo("error",e),a(e)}}))))):(Zi("calling provider",r,i),yield t({method:r,params:i}))}))}}(e),e}catch(e){const t=e instanceof Error?e:new Error(String(e));throw eo("error",t),t}}))}function no(e){Zi("displayUriHandler",e),Qt(e)}const ro=n("getProvider"),io=[1];var oo;let so;e.SupportedProviders=void 0,(e.SupportedProviders||(e.SupportedProviders={})).Ethereum="Ethereum",e.SupportedProviderImplementations=void 0,(oo=e.SupportedProviderImplementations||(e.SupportedProviderImplementations={})).LedgerConnect="LedgerConnect",oo.WalletConnect="WalletConnect";const ao=e=>(ro("getHexChainId",e),"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)?e:`0x${e.toString(16)}`),co=n("supportOptions");let uo;const lo=()=>(co("getSupportOptions"),uo),fo=n("ExtensionEvm"),ho="ethereum",po="isLedgerConnect";var go;function yo(e){return("iOS"===e.os.name||"macOS"===e.os.name)&&"Safari"===e.browser.name}function mo(e){return!!go[e]}function vo(e){return e.every(mo)}function _o(){if(fo("getEthereumProvider"),"undefined"==typeof window)throw new a;let e=window[ho];if(fo("provider is",e),void 0===e||void 0===e[po])throw new i;const t=lo(),n=ao(t.chainId||0);return ao(e.chainId)!=n&&(fo("chainIds are different, changing to",n),e.request({method:"wallet_switchEthereumChain",params:[{chainId:n}]})),e}!function(e){e[e.EthereumMainnet=1]="EthereumMainnet",e[e.Polygon=137]="Polygon"}(go||(go={}));const bo=n("support");let wo;e.checkSupport=function(t){bo("checkSupport",t),(e=>{var t;co("setSupportOptions",e);const n=e.walletConnectVersion||1;let r,i,o=[];1===n?(i=e.chainId||1,r=[i]):(r=e.chains||io,i=r[0],o.push(...r),(null===(t=e.optionalChains)||void 0===t?void 0:t.length)&&o.push(...e.optionalChains.filter((e=>o.indexOf(e)<0))));const s=Object.assign(Object.assign({},e),{walletConnectVersion:n,chains:r,chainId:i,optionalChains:o,projectId:e.projectId||""});if(2===n&&(!e.projectId||""===e.projectId))throw new Error("WalletConnect requires a projectId. Please visit https://cloud.walletconnect.com to get one.");uo=s})(t);const n=lo();let r;return n.providerType,e.SupportedProviders.Ethereum,r=function(t){bo("checkEthereumSupport",t);const n=on();let r=!1;try{r=!!_o()}catch(e){}const i={isLedgerConnectSupported:yo(n),isLedgerConnectEnabled:!!r,isChainIdSupported:vo(t.chains),providerImplementation:e.SupportedProviderImplementations.LedgerConnect};i.isLedgerConnectSupported&&i.isLedgerConnectEnabled&&i.isChainIdSupported||(i.providerImplementation=e.SupportedProviderImplementations.WalletConnect);return function(e){ro("setProviderImplementation",e),so=e}(i.providerImplementation),i}(n),bo("checkSupportResult is",r),wo=r,r},e.enableDebugLogs=()=>{t=!0},e.getProvider=function(){return c(this,void 0,void 0,(function*(){ro("getProvider",so);const t=lo();if(t.providerType===e.SupportedProviders.Ethereum)return(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))||so!==e.SupportedProviderImplementations.LedgerConnect?(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV2"))||1!==t.walletConnectVersion&&!(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("connectKit_forceWcV1"))?yield to():yield fn():_o();throw new o}))},Object.defineProperty(e,"__esModule",{value:!0})}));//# sourceMappingURL=index.js.map