@metamask/multichain-provider-example-snap 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,17 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [1.0.0]
11
+
12
+ ### Added
13
+
14
+ - Initial release ([#3813](https://github.com/MetaMask/snaps/pull/3813))
15
+
16
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/multichain-provider-example-snap@1.0.0...HEAD
17
+ [1.0.0]: https://github.com/MetaMask/snaps/releases/tag/@metamask/multichain-provider-example-snap@1.0.0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Consensys Software Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/LICENSE.MIT0 ADDED
@@ -0,0 +1,16 @@
1
+ MIT No Attribution
2
+
3
+ Copyright 2026 Consensys Software Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this
6
+ software and associated documentation files (the "Software"), to deal in the Software
7
+ without restriction, including without limitation the rights to use, copy, modify,
8
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
12
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
13
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
14
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
15
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
16
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # `@metamask/multichain-provider-example-snap`
2
+
3
+ This Snap demonstrates the use of the `endowment:multichain-provider` permission.
4
+
5
+ The permission grants the Snap access to CAIP-25 provider methods via `snap.request`.
6
+
7
+ ## Snap manifest
8
+
9
+ Along with other permissions, the manifest of this snap includes the
10
+ `endowment:multichain-provider` permission:
11
+
12
+ ```json
13
+ {
14
+ "initialPermissions": {
15
+ "endowment:mulitchain-provider": {}
16
+ }
17
+ }
18
+ ```
19
+
20
+ This permission does not require any additional configuration.
21
+
22
+ ## Snap usage
23
+
24
+ This snap exposes an `onRpcRequest` handler, which supports the following
25
+ JSON-RPC methods:
26
+
27
+ - `createSession`: Create the multichain API session.
28
+ - `revokeSession`: Revoke the current multichain API session.
29
+ - `getChainId`: Get the current Ethereum chain ID as a string.
30
+ - `getAccounts`: Get the accounts for the selected scope.
31
+ - `signMessage`: Sign a message using an Ethereum or Solana account.
32
+ - `signTypedData`: Sign a struct using an Ethereum account.
33
+ - `getGenesisHash`: Get the genesis hash for the selected scope.
34
+
35
+ For more information, you can refer to
36
+ [the end-to-end tests](./src/index.test.ts).
package/dist/bundle.js ADDED
@@ -0,0 +1 @@
1
+ (()=>{var t={76:function(t,n,r){var e;t=r.nmd(t),function(){var i,o="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,f=32,s=64,l=128,h=256,p=1/0,d=9007199254740991,v=NaN,g=4294967295,y=[["ary",l],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",f],["partialRight",s],["rearg",h]],_="[object Arguments]",m="[object Array]",w="[object Boolean]",b="[object Date]",x="[object Error]",A="[object Function]",E="[object GeneratorFunction]",j="[object Map]",I="[object Number]",O="[object Object]",k="[object Promise]",S="[object RegExp]",R="[object Set]",C="[object String]",z="[object Symbol]",N="[object WeakMap]",$="[object ArrayBuffer]",B="[object DataView]",T="[object Float32Array]",L="[object Float64Array]",U="[object Int8Array]",P="[object Int16Array]",M="[object Int32Array]",W="[object Uint8Array]",D="[object Uint8ClampedArray]",F="[object Uint16Array]",q="[object Uint32Array]",J=/\b__p \+= '';/g,Z=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,H=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,V=RegExp(H.source),X=RegExp(K.source),Q=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,tt=/<%=([\s\S]+?)%>/g,nt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,et=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,it=/[\\^$.*+?()[\]{}|]/g,ot=RegExp(it.source),ut=/^\s+/,at=/\s/,ct=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ft=/\{\n\/\* \[wrapped with (.+)\] \*/,st=/,? & /,lt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ht=/[()=,{}\[\]\/\s]/,pt=/\\(\\)?/g,dt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,gt=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,_t=/^\[object .+?Constructor\]$/,mt=/^0o[0-7]+$/i,wt=/^(?:0|[1-9]\d*)$/,bt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xt=/($^)/,At=/['\n\r\u2028\u2029\\]/g,Et="\\ud800-\\udfff",jt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",It="\\u2700-\\u27bf",Ot="a-z\\xdf-\\xf6\\xf8-\\xff",kt="A-Z\\xc0-\\xd6\\xd8-\\xde",St="\\ufe0e\\ufe0f",Rt="\\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",Ct="['’]",zt="["+Et+"]",Nt="["+Rt+"]",$t="["+jt+"]",Bt="\\d+",Tt="["+It+"]",Lt="["+Ot+"]",Ut="[^"+Et+Rt+Bt+It+Ot+kt+"]",Pt="\\ud83c[\\udffb-\\udfff]",Mt="[^"+Et+"]",Wt="(?:\\ud83c[\\udde6-\\uddff]){2}",Dt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+kt+"]",qt="\\u200d",Jt="(?:"+Lt+"|"+Ut+")",Zt="(?:"+Ft+"|"+Ut+")",Gt="(?:['’](?:d|ll|m|re|s|t|ve))?",Ht="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+$t+"|"+Pt+")"+"?",Vt="["+St+"]?",Xt=Vt+Kt+("(?:"+qt+"(?:"+[Mt,Wt,Dt].join("|")+")"+Vt+Kt+")*"),Qt="(?:"+[Tt,Wt,Dt].join("|")+")"+Xt,Yt="(?:"+[Mt+$t+"?",$t,Wt,Dt,zt].join("|")+")",tn=RegExp(Ct,"g"),nn=RegExp($t,"g"),rn=RegExp(Pt+"(?="+Pt+")|"+Yt+Xt,"g"),en=RegExp([Ft+"?"+Lt+"+"+Gt+"(?="+[Nt,Ft,"$"].join("|")+")",Zt+"+"+Ht+"(?="+[Nt,Ft+Jt,"$"].join("|")+")",Ft+"?"+Jt+"+"+Gt,Ft+"+"+Ht,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bt,Qt].join("|"),"g"),on=RegExp("["+qt+Et+jt+St+"]"),un=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,an=["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"],cn=-1,fn={};fn[T]=fn[L]=fn[U]=fn[P]=fn[M]=fn[W]=fn[D]=fn[F]=fn[q]=!0,fn[_]=fn[m]=fn[$]=fn[w]=fn[B]=fn[b]=fn[x]=fn[A]=fn[j]=fn[I]=fn[O]=fn[S]=fn[R]=fn[C]=fn[N]=!1;var sn={};sn[_]=sn[m]=sn[$]=sn[B]=sn[w]=sn[b]=sn[T]=sn[L]=sn[U]=sn[P]=sn[M]=sn[j]=sn[I]=sn[O]=sn[S]=sn[R]=sn[C]=sn[z]=sn[W]=sn[D]=sn[F]=sn[q]=!0,sn[x]=sn[A]=sn[N]=!1;var ln={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hn=parseFloat,pn=parseInt,dn="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,vn="object"==typeof self&&self&&self.Object===Object&&self,gn=dn||vn||Function("return this")(),yn=n&&!n.nodeType&&n,_n=yn&&t&&!t.nodeType&&t,mn=_n&&_n.exports===yn,wn=mn&&dn.process,bn=function(){try{var t=_n&&_n.require&&_n.require("util").types;return t||wn&&wn.binding&&wn.binding("util")}catch(t){}}(),xn=bn&&bn.isArrayBuffer,An=bn&&bn.isDate,En=bn&&bn.isMap,jn=bn&&bn.isRegExp,In=bn&&bn.isSet,On=bn&&bn.isTypedArray;function kn(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function Sn(t,n,r,e){for(var i=-1,o=null==t?0:t.length;++i<o;){var u=t[i];n(e,u,r(u),t)}return e}function Rn(t,n){for(var r=-1,e=null==t?0:t.length;++r<e&&!1!==n(t[r],r,t););return t}function Cn(t,n){for(var r=null==t?0:t.length;r--&&!1!==n(t[r],r,t););return t}function zn(t,n){for(var r=-1,e=null==t?0:t.length;++r<e;)if(!n(t[r],r,t))return!1;return!0}function Nn(t,n){for(var r=-1,e=null==t?0:t.length,i=0,o=[];++r<e;){var u=t[r];n(u,r,t)&&(o[i++]=u)}return o}function $n(t,n){return!!(null==t?0:t.length)&&qn(t,n,0)>-1}function Bn(t,n,r){for(var e=-1,i=null==t?0:t.length;++e<i;)if(r(n,t[e]))return!0;return!1}function Tn(t,n){for(var r=-1,e=null==t?0:t.length,i=Array(e);++r<e;)i[r]=n(t[r],r,t);return i}function Ln(t,n){for(var r=-1,e=n.length,i=t.length;++r<e;)t[i+r]=n[r];return t}function Un(t,n,r,e){var i=-1,o=null==t?0:t.length;for(e&&o&&(r=t[++i]);++i<o;)r=n(r,t[i],i,t);return r}function Pn(t,n,r,e){var i=null==t?0:t.length;for(e&&i&&(r=t[--i]);i--;)r=n(r,t[i],i,t);return r}function Mn(t,n){for(var r=-1,e=null==t?0:t.length;++r<e;)if(n(t[r],r,t))return!0;return!1}var Wn=Hn("length");function Dn(t,n,r){var e;return r(t,(function(t,r,i){if(n(t,r,i))return e=r,!1})),e}function Fn(t,n,r,e){for(var i=t.length,o=r+(e?1:-1);e?o--:++o<i;)if(n(t[o],o,t))return o;return-1}function qn(t,n,r){return n==n?function(t,n,r){var e=r-1,i=t.length;for(;++e<i;)if(t[e]===n)return e;return-1}(t,n,r):Fn(t,Zn,r)}function Jn(t,n,r,e){for(var i=r-1,o=t.length;++i<o;)if(e(t[i],n))return i;return-1}function Zn(t){return t!=t}function Gn(t,n){var r=null==t?0:t.length;return r?Xn(t,n)/r:v}function Hn(t){return function(n){return null==n?i:n[t]}}function Kn(t){return function(n){return null==t?i:t[n]}}function Vn(t,n,r,e,i){return i(t,(function(t,i,o){r=e?(e=!1,t):n(r,t,i,o)})),r}function Xn(t,n){for(var r,e=-1,o=t.length;++e<o;){var u=n(t[e]);u!==i&&(r=r===i?u:r+u)}return r}function Qn(t,n){for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);return e}function Yn(t){return t?t.slice(0,gr(t)+1).replace(ut,""):t}function tr(t){return function(n){return t(n)}}function nr(t,n){return Tn(n,(function(n){return t[n]}))}function rr(t,n){return t.has(n)}function er(t,n){for(var r=-1,e=t.length;++r<e&&qn(n,t[r],0)>-1;);return r}function ir(t,n){for(var r=t.length;r--&&qn(n,t[r],0)>-1;);return r}var or=Kn({À:"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"}),ur=Kn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function ar(t){return"\\"+ln[t]}function cr(t){return on.test(t)}function fr(t){var n=-1,r=Array(t.size);return t.forEach((function(t,e){r[++n]=[e,t]})),r}function sr(t,n){return function(r){return t(n(r))}}function lr(t,n){for(var r=-1,e=t.length,i=0,o=[];++r<e;){var u=t[r];u!==n&&u!==a||(t[r]=a,o[i++]=r)}return o}function hr(t){var n=-1,r=Array(t.size);return t.forEach((function(t){r[++n]=t})),r}function pr(t){var n=-1,r=Array(t.size);return t.forEach((function(t){r[++n]=[t,t]})),r}function dr(t){return cr(t)?function(t){var n=rn.lastIndex=0;for(;rn.test(t);)++n;return n}(t):Wn(t)}function vr(t){return cr(t)?function(t){return t.match(rn)||[]}(t):function(t){return t.split("")}(t)}function gr(t){for(var n=t.length;n--&&at.test(t.charAt(n)););return n}var yr=Kn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var _r=function t(n){var r,e=(n=null==n?gn:_r.defaults(gn.Object(),n,_r.pick(gn,an))).Array,at=n.Date,Et=n.Error,jt=n.Function,It=n.Math,Ot=n.Object,kt=n.RegExp,St=n.String,Rt=n.TypeError,Ct=e.prototype,zt=jt.prototype,Nt=Ot.prototype,$t=n["__core-js_shared__"],Bt=zt.toString,Tt=Nt.hasOwnProperty,Lt=0,Ut=(r=/[^.]+$/.exec($t&&$t.keys&&$t.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Pt=Nt.toString,Mt=Bt.call(Ot),Wt=gn._,Dt=kt("^"+Bt.call(Tt).replace(it,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=mn?n.Buffer:i,qt=n.Symbol,Jt=n.Uint8Array,Zt=Ft?Ft.allocUnsafe:i,Gt=sr(Ot.getPrototypeOf,Ot),Ht=Ot.create,Kt=Nt.propertyIsEnumerable,Vt=Ct.splice,Xt=qt?qt.isConcatSpreadable:i,Qt=qt?qt.iterator:i,Yt=qt?qt.toStringTag:i,rn=function(){try{var t=ho(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),on=n.clearTimeout!==gn.clearTimeout&&n.clearTimeout,ln=at&&at.now!==gn.Date.now&&at.now,dn=n.setTimeout!==gn.setTimeout&&n.setTimeout,vn=It.ceil,yn=It.floor,_n=Ot.getOwnPropertySymbols,wn=Ft?Ft.isBuffer:i,bn=n.isFinite,Wn=Ct.join,Kn=sr(Ot.keys,Ot),mr=It.max,wr=It.min,br=at.now,xr=n.parseInt,Ar=It.random,Er=Ct.reverse,jr=ho(n,"DataView"),Ir=ho(n,"Map"),Or=ho(n,"Promise"),kr=ho(n,"Set"),Sr=ho(n,"WeakMap"),Rr=ho(Ot,"create"),Cr=Sr&&new Sr,zr={},Nr=Po(jr),$r=Po(Ir),Br=Po(Or),Tr=Po(kr),Lr=Po(Sr),Ur=qt?qt.prototype:i,Pr=Ur?Ur.valueOf:i,Mr=Ur?Ur.toString:i;function Wr(t){if(ra(t)&&!Ju(t)&&!(t instanceof Jr)){if(t instanceof qr)return t;if(Tt.call(t,"__wrapped__"))return Mo(t)}return new qr(t)}var Dr=function(){function t(){}return function(n){if(!na(n))return{};if(Ht)return Ht(n);t.prototype=n;var r=new t;return t.prototype=i,r}}();function Fr(){}function qr(t,n){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=i}function Jr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Zr(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Gr(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Hr(t){var n=-1,r=null==t?0:t.length;for(this.clear();++n<r;){var e=t[n];this.set(e[0],e[1])}}function Kr(t){var n=-1,r=null==t?0:t.length;for(this.__data__=new Hr;++n<r;)this.add(t[n])}function Vr(t){var n=this.__data__=new Gr(t);this.size=n.size}function Xr(t,n){var r=Ju(t),e=!r&&qu(t),i=!r&&!e&&Ku(t),o=!r&&!e&&!i&&sa(t),u=r||e||i||o,a=u?Qn(t.length,St):[],c=a.length;for(var f in t)!n&&!Tt.call(t,f)||u&&("length"==f||i&&("offset"==f||"parent"==f)||o&&("buffer"==f||"byteLength"==f||"byteOffset"==f)||wo(f,c))||a.push(f);return a}function Qr(t){var n=t.length;return n?t[Ke(0,n-1)]:i}function Yr(t,n){return To(Ri(t),ce(n,0,t.length))}function te(t){return To(Ri(t))}function ne(t,n,r){(r!==i&&!Wu(t[n],r)||r===i&&!(n in t))&&ue(t,n,r)}function re(t,n,r){var e=t[n];Tt.call(t,n)&&Wu(e,r)&&(r!==i||n in t)||ue(t,n,r)}function ee(t,n){for(var r=t.length;r--;)if(Wu(t[r][0],n))return r;return-1}function ie(t,n,r,e){return pe(t,(function(t,i,o){n(e,t,r(t),o)})),e}function oe(t,n){return t&&Ci(n,za(n),t)}function ue(t,n,r){"__proto__"==n&&rn?rn(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}function ae(t,n){for(var r=-1,o=n.length,u=e(o),a=null==t;++r<o;)u[r]=a?i:Oa(t,n[r]);return u}function ce(t,n,r){return t==t&&(r!==i&&(t=t<=r?t:r),n!==i&&(t=t>=n?t:n)),t}function fe(t,n,r,e,o,u){var a,c=1&n,f=2&n,s=4&n;if(r&&(a=o?r(t,e,o,u):r(t)),a!==i)return a;if(!na(t))return t;var l=Ju(t);if(l){if(a=function(t){var n=t.length,r=new t.constructor(n);n&&"string"==typeof t[0]&&Tt.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!c)return Ri(t,a)}else{var h=go(t),p=h==A||h==E;if(Ku(t))return Ei(t,c);if(h==O||h==_||p&&!o){if(a=f||p?{}:_o(t),!c)return f?function(t,n){return Ci(t,vo(t),n)}(t,function(t,n){return t&&Ci(n,Na(n),t)}(a,t)):function(t,n){return Ci(t,po(t),n)}(t,oe(a,t))}else{if(!sn[h])return o?t:{};a=function(t,n,r){var e=t.constructor;switch(n){case $:return ji(t);case w:case b:return new e(+t);case B:return function(t,n){var r=n?ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case T:case L:case U:case P:case M:case W:case D:case F:case q:return Ii(t,r);case j:return new e;case I:case C:return new e(t);case S:return function(t){var n=new t.constructor(t.source,vt.exec(t));return n.lastIndex=t.lastIndex,n}(t);case R:return new e;case z:return i=t,Pr?Ot(Pr.call(i)):{}}var i}(t,h,c)}}u||(u=new Vr);var d=u.get(t);if(d)return d;u.set(t,a),aa(t)?t.forEach((function(e){a.add(fe(e,n,r,e,t,u))})):ea(t)&&t.forEach((function(e,i){a.set(i,fe(e,n,r,i,t,u))}));var v=l?i:(s?f?oo:io:f?Na:za)(t);return Rn(v||t,(function(e,i){v&&(e=t[i=e]),re(a,i,fe(e,n,r,i,t,u))})),a}function se(t,n,r){var e=r.length;if(null==t)return!e;for(t=Ot(t);e--;){var o=r[e],u=n[o],a=t[o];if(a===i&&!(o in t)||!u(a))return!1}return!0}function le(t,n,r){if("function"!=typeof t)throw new Rt(o);return zo((function(){t.apply(i,r)}),n)}function he(t,n,r,e){var i=-1,o=$n,u=!0,a=t.length,c=[],f=n.length;if(!a)return c;r&&(n=Tn(n,tr(r))),e?(o=Bn,u=!1):n.length>=200&&(o=rr,u=!1,n=new Kr(n));t:for(;++i<a;){var s=t[i],l=null==r?s:r(s);if(s=e||0!==s?s:0,u&&l==l){for(var h=f;h--;)if(n[h]===l)continue t;c.push(s)}else o(n,l,e)||c.push(s)}return c}Wr.templateSettings={escape:Q,evaluate:Y,interpolate:tt,variable:"",imports:{_:Wr}},Wr.prototype=Fr.prototype,Wr.prototype.constructor=Wr,qr.prototype=Dr(Fr.prototype),qr.prototype.constructor=qr,Jr.prototype=Dr(Fr.prototype),Jr.prototype.constructor=Jr,Zr.prototype.clear=function(){this.__data__=Rr?Rr(null):{},this.size=0},Zr.prototype.delete=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},Zr.prototype.get=function(t){var n=this.__data__;if(Rr){var r=n[t];return r===u?i:r}return Tt.call(n,t)?n[t]:i},Zr.prototype.has=function(t){var n=this.__data__;return Rr?n[t]!==i:Tt.call(n,t)},Zr.prototype.set=function(t,n){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Rr&&n===i?u:n,this},Gr.prototype.clear=function(){this.__data__=[],this.size=0},Gr.prototype.delete=function(t){var n=this.__data__,r=ee(n,t);return!(r<0)&&(r==n.length-1?n.pop():Vt.call(n,r,1),--this.size,!0)},Gr.prototype.get=function(t){var n=this.__data__,r=ee(n,t);return r<0?i:n[r][1]},Gr.prototype.has=function(t){return ee(this.__data__,t)>-1},Gr.prototype.set=function(t,n){var r=this.__data__,e=ee(r,t);return e<0?(++this.size,r.push([t,n])):r[e][1]=n,this},Hr.prototype.clear=function(){this.size=0,this.__data__={hash:new Zr,map:new(Ir||Gr),string:new Zr}},Hr.prototype.delete=function(t){var n=so(this,t).delete(t);return this.size-=n?1:0,n},Hr.prototype.get=function(t){return so(this,t).get(t)},Hr.prototype.has=function(t){return so(this,t).has(t)},Hr.prototype.set=function(t,n){var r=so(this,t),e=r.size;return r.set(t,n),this.size+=r.size==e?0:1,this},Kr.prototype.add=Kr.prototype.push=function(t){return this.__data__.set(t,u),this},Kr.prototype.has=function(t){return this.__data__.has(t)},Vr.prototype.clear=function(){this.__data__=new Gr,this.size=0},Vr.prototype.delete=function(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r},Vr.prototype.get=function(t){return this.__data__.get(t)},Vr.prototype.has=function(t){return this.__data__.has(t)},Vr.prototype.set=function(t,n){var r=this.__data__;if(r instanceof Gr){var e=r.__data__;if(!Ir||e.length<199)return e.push([t,n]),this.size=++r.size,this;r=this.__data__=new Hr(e)}return r.set(t,n),this.size=r.size,this};var pe=$i(be),de=$i(xe,!0);function ve(t,n){var r=!0;return pe(t,(function(t,e,i){return r=!!n(t,e,i)})),r}function ge(t,n,r){for(var e=-1,o=t.length;++e<o;){var u=t[e],a=n(u);if(null!=a&&(c===i?a==a&&!fa(a):r(a,c)))var c=a,f=u}return f}function ye(t,n){var r=[];return pe(t,(function(t,e,i){n(t,e,i)&&r.push(t)})),r}function _e(t,n,r,e,i){var o=-1,u=t.length;for(r||(r=mo),i||(i=[]);++o<u;){var a=t[o];n>0&&r(a)?n>1?_e(a,n-1,r,e,i):Ln(i,a):e||(i[i.length]=a)}return i}var me=Bi(),we=Bi(!0);function be(t,n){return t&&me(t,n,za)}function xe(t,n){return t&&we(t,n,za)}function Ae(t,n){return Nn(n,(function(n){return Qu(t[n])}))}function Ee(t,n){for(var r=0,e=(n=wi(n,t)).length;null!=t&&r<e;)t=t[Uo(n[r++])];return r&&r==e?t:i}function je(t,n,r){var e=n(t);return Ju(t)?e:Ln(e,r(t))}function Ie(t){return null==t?t===i?"[object Undefined]":"[object Null]":Yt&&Yt in Ot(t)?function(t){var n=Tt.call(t,Yt),r=t[Yt];try{t[Yt]=i;var e=!0}catch(t){}var o=Pt.call(t);e&&(n?t[Yt]=r:delete t[Yt]);return o}(t):function(t){return Pt.call(t)}(t)}function Oe(t,n){return t>n}function ke(t,n){return null!=t&&Tt.call(t,n)}function Se(t,n){return null!=t&&n in Ot(t)}function Re(t,n,r){for(var o=r?Bn:$n,u=t[0].length,a=t.length,c=a,f=e(a),s=1/0,l=[];c--;){var h=t[c];c&&n&&(h=Tn(h,tr(n))),s=wr(h.length,s),f[c]=!r&&(n||u>=120&&h.length>=120)?new Kr(c&&h):i}h=t[0];var p=-1,d=f[0];t:for(;++p<u&&l.length<s;){var v=h[p],g=n?n(v):v;if(v=r||0!==v?v:0,!(d?rr(d,g):o(l,g,r))){for(c=a;--c;){var y=f[c];if(!(y?rr(y,g):o(t[c],g,r)))continue t}d&&d.push(g),l.push(v)}}return l}function Ce(t,n,r){var e=null==(t=So(t,n=wi(n,t)))?t:t[Uo(Xo(n))];return null==e?i:kn(e,t,r)}function ze(t){return ra(t)&&Ie(t)==_}function Ne(t,n,r,e,o){return t===n||(null==t||null==n||!ra(t)&&!ra(n)?t!=t&&n!=n:function(t,n,r,e,o,u){var a=Ju(t),c=Ju(n),f=a?m:go(t),s=c?m:go(n),l=(f=f==_?O:f)==O,h=(s=s==_?O:s)==O,p=f==s;if(p&&Ku(t)){if(!Ku(n))return!1;a=!0,l=!1}if(p&&!l)return u||(u=new Vr),a||sa(t)?ro(t,n,r,e,o,u):function(t,n,r,e,i,o,u){switch(r){case B:if(t.byteLength!=n.byteLength||t.byteOffset!=n.byteOffset)return!1;t=t.buffer,n=n.buffer;case $:return!(t.byteLength!=n.byteLength||!o(new Jt(t),new Jt(n)));case w:case b:case I:return Wu(+t,+n);case x:return t.name==n.name&&t.message==n.message;case S:case C:return t==n+"";case j:var a=fr;case R:var c=1&e;if(a||(a=hr),t.size!=n.size&&!c)return!1;var f=u.get(t);if(f)return f==n;e|=2,u.set(t,n);var s=ro(a(t),a(n),e,i,o,u);return u.delete(t),s;case z:if(Pr)return Pr.call(t)==Pr.call(n)}return!1}(t,n,f,r,e,o,u);if(!(1&r)){var d=l&&Tt.call(t,"__wrapped__"),v=h&&Tt.call(n,"__wrapped__");if(d||v){var g=d?t.value():t,y=v?n.value():n;return u||(u=new Vr),o(g,y,r,e,u)}}if(!p)return!1;return u||(u=new Vr),function(t,n,r,e,o,u){var a=1&r,c=io(t),f=c.length,s=io(n),l=s.length;if(f!=l&&!a)return!1;var h=f;for(;h--;){var p=c[h];if(!(a?p in n:Tt.call(n,p)))return!1}var d=u.get(t),v=u.get(n);if(d&&v)return d==n&&v==t;var g=!0;u.set(t,n),u.set(n,t);var y=a;for(;++h<f;){var _=t[p=c[h]],m=n[p];if(e)var w=a?e(m,_,p,n,t,u):e(_,m,p,t,n,u);if(!(w===i?_===m||o(_,m,r,e,u):w)){g=!1;break}y||(y="constructor"==p)}if(g&&!y){var b=t.constructor,x=n.constructor;b==x||!("constructor"in t)||!("constructor"in n)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(g=!1)}return u.delete(t),u.delete(n),g}(t,n,r,e,o,u)}(t,n,r,e,Ne,o))}function $e(t,n,r,e){var o=r.length,u=o,a=!e;if(null==t)return!u;for(t=Ot(t);o--;){var c=r[o];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++o<u;){var f=(c=r[o])[0],s=t[f],l=c[1];if(a&&c[2]){if(s===i&&!(f in t))return!1}else{var h=new Vr;if(e)var p=e(s,l,f,t,n,h);if(!(p===i?Ne(l,s,3,e,h):p))return!1}}return!0}function Be(t){return!(!na(t)||(n=t,Ut&&Ut in n))&&(Qu(t)?Dt:_t).test(Po(t));var n}function Te(t){return"function"==typeof t?t:null==t?ic:"object"==typeof t?Ju(t)?De(t[0],t[1]):We(t):pc(t)}function Le(t){if(!jo(t))return Kn(t);var n=[];for(var r in Ot(t))Tt.call(t,r)&&"constructor"!=r&&n.push(r);return n}function Ue(t){if(!na(t))return function(t){var n=[];if(null!=t)for(var r in Ot(t))n.push(r);return n}(t);var n=jo(t),r=[];for(var e in t)("constructor"!=e||!n&&Tt.call(t,e))&&r.push(e);return r}function Pe(t,n){return t<n}function Me(t,n){var r=-1,i=Gu(t)?e(t.length):[];return pe(t,(function(t,e,o){i[++r]=n(t,e,o)})),i}function We(t){var n=lo(t);return 1==n.length&&n[0][2]?Oo(n[0][0],n[0][1]):function(r){return r===t||$e(r,t,n)}}function De(t,n){return xo(t)&&Io(n)?Oo(Uo(t),n):function(r){var e=Oa(r,t);return e===i&&e===n?ka(r,t):Ne(n,e,3)}}function Fe(t,n,r,e,o){t!==n&&me(n,(function(u,a){if(o||(o=new Vr),na(u))!function(t,n,r,e,o,u,a){var c=Ro(t,r),f=Ro(n,r),s=a.get(f);if(s)return void ne(t,r,s);var l=u?u(c,f,r+"",t,n,a):i,h=l===i;if(h){var p=Ju(f),d=!p&&Ku(f),v=!p&&!d&&sa(f);l=f,p||d||v?Ju(c)?l=c:Hu(c)?l=Ri(c):d?(h=!1,l=Ei(f,!0)):v?(h=!1,l=Ii(f,!0)):l=[]:oa(f)||qu(f)?(l=c,qu(c)?l=_a(c):na(c)&&!Qu(c)||(l=_o(f))):h=!1}h&&(a.set(f,l),o(l,f,e,u,a),a.delete(f));ne(t,r,l)}(t,n,a,r,Fe,e,o);else{var c=e?e(Ro(t,a),u,a+"",t,n,o):i;c===i&&(c=u),ne(t,a,c)}}),Na)}function qe(t,n){var r=t.length;if(r)return wo(n+=n<0?r:0,r)?t[n]:i}function Je(t,n,r){n=n.length?Tn(n,(function(t){return Ju(t)?function(n){return Ee(n,1===t.length?t[0]:t)}:t})):[ic];var e=-1;n=Tn(n,tr(fo()));var i=Me(t,(function(t,r,i){var o=Tn(n,(function(n){return n(t)}));return{criteria:o,index:++e,value:t}}));return function(t,n){var r=t.length;for(t.sort(n);r--;)t[r]=t[r].value;return t}(i,(function(t,n){return function(t,n,r){var e=-1,i=t.criteria,o=n.criteria,u=i.length,a=r.length;for(;++e<u;){var c=Oi(i[e],o[e]);if(c)return e>=a?c:c*("desc"==r[e]?-1:1)}return t.index-n.index}(t,n,r)}))}function Ze(t,n,r){for(var e=-1,i=n.length,o={};++e<i;){var u=n[e],a=Ee(t,u);r(a,u)&&ti(o,wi(u,t),a)}return o}function Ge(t,n,r,e){var i=e?Jn:qn,o=-1,u=n.length,a=t;for(t===n&&(n=Ri(n)),r&&(a=Tn(t,tr(r)));++o<u;)for(var c=0,f=n[o],s=r?r(f):f;(c=i(a,s,c,e))>-1;)a!==t&&Vt.call(a,c,1),Vt.call(t,c,1);return t}function He(t,n){for(var r=t?n.length:0,e=r-1;r--;){var i=n[r];if(r==e||i!==o){var o=i;wo(i)?Vt.call(t,i,1):hi(t,i)}}return t}function Ke(t,n){return t+yn(Ar()*(n-t+1))}function Ve(t,n){var r="";if(!t||n<1||n>d)return r;do{n%2&&(r+=t),(n=yn(n/2))&&(t+=t)}while(n);return r}function Xe(t,n){return No(ko(t,n,ic),t+"")}function Qe(t){return Qr(Wa(t))}function Ye(t,n){var r=Wa(t);return To(r,ce(n,0,r.length))}function ti(t,n,r,e){if(!na(t))return t;for(var o=-1,u=(n=wi(n,t)).length,a=u-1,c=t;null!=c&&++o<u;){var f=Uo(n[o]),s=r;if("__proto__"===f||"constructor"===f||"prototype"===f)return t;if(o!=a){var l=c[f];(s=e?e(l,f,c):i)===i&&(s=na(l)?l:wo(n[o+1])?[]:{})}re(c,f,s),c=c[f]}return t}var ni=Cr?function(t,n){return Cr.set(t,n),t}:ic,ri=rn?function(t,n){return rn(t,"toString",{configurable:!0,enumerable:!1,value:nc(n),writable:!0})}:ic;function ei(t){return To(Wa(t))}function ii(t,n,r){var i=-1,o=t.length;n<0&&(n=-n>o?0:o+n),(r=r>o?o:r)<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var u=e(o);++i<o;)u[i]=t[i+n];return u}function oi(t,n){var r;return pe(t,(function(t,e,i){return!(r=n(t,e,i))})),!!r}function ui(t,n,r){var e=0,i=null==t?e:t.length;if("number"==typeof n&&n==n&&i<=2147483647){for(;e<i;){var o=e+i>>>1,u=t[o];null!==u&&!fa(u)&&(r?u<=n:u<n)?e=o+1:i=o}return i}return ai(t,n,ic,r)}function ai(t,n,r,e){var o=0,u=null==t?0:t.length;if(0===u)return 0;for(var a=(n=r(n))!=n,c=null===n,f=fa(n),s=n===i;o<u;){var l=yn((o+u)/2),h=r(t[l]),p=h!==i,d=null===h,v=h==h,g=fa(h);if(a)var y=e||v;else y=s?v&&(e||p):c?v&&p&&(e||!d):f?v&&p&&!d&&(e||!g):!d&&!g&&(e?h<=n:h<n);y?o=l+1:u=l}return wr(u,4294967294)}function ci(t,n){for(var r=-1,e=t.length,i=0,o=[];++r<e;){var u=t[r],a=n?n(u):u;if(!r||!Wu(a,c)){var c=a;o[i++]=0===u?0:u}}return o}function fi(t){return"number"==typeof t?t:fa(t)?v:+t}function si(t){if("string"==typeof t)return t;if(Ju(t))return Tn(t,si)+"";if(fa(t))return Mr?Mr.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function li(t,n,r){var e=-1,i=$n,o=t.length,u=!0,a=[],c=a;if(r)u=!1,i=Bn;else if(o>=200){var f=n?null:Vi(t);if(f)return hr(f);u=!1,i=rr,c=new Kr}else c=n?[]:a;t:for(;++e<o;){var s=t[e],l=n?n(s):s;if(s=r||0!==s?s:0,u&&l==l){for(var h=c.length;h--;)if(c[h]===l)continue t;n&&c.push(l),a.push(s)}else i(c,l,r)||(c!==a&&c.push(l),a.push(s))}return a}function hi(t,n){return null==(t=So(t,n=wi(n,t)))||delete t[Uo(Xo(n))]}function pi(t,n,r,e){return ti(t,n,r(Ee(t,n)),e)}function di(t,n,r,e){for(var i=t.length,o=e?i:-1;(e?o--:++o<i)&&n(t[o],o,t););return r?ii(t,e?0:o,e?o+1:i):ii(t,e?o+1:0,e?i:o)}function vi(t,n){var r=t;return r instanceof Jr&&(r=r.value()),Un(n,(function(t,n){return n.func.apply(n.thisArg,Ln([t],n.args))}),r)}function gi(t,n,r){var i=t.length;if(i<2)return i?li(t[0]):[];for(var o=-1,u=e(i);++o<i;)for(var a=t[o],c=-1;++c<i;)c!=o&&(u[o]=he(u[o]||a,t[c],n,r));return li(_e(u,1),n,r)}function yi(t,n,r){for(var e=-1,o=t.length,u=n.length,a={};++e<o;){var c=e<u?n[e]:i;r(a,t[e],c)}return a}function _i(t){return Hu(t)?t:[]}function mi(t){return"function"==typeof t?t:ic}function wi(t,n){return Ju(t)?t:xo(t,n)?[t]:Lo(ma(t))}var bi=Xe;function xi(t,n,r){var e=t.length;return r=r===i?e:r,!n&&r>=e?t:ii(t,n,r)}var Ai=on||function(t){return gn.clearTimeout(t)};function Ei(t,n){if(n)return t.slice();var r=t.length,e=Zt?Zt(r):new t.constructor(r);return t.copy(e),e}function ji(t){var n=new t.constructor(t.byteLength);return new Jt(n).set(new Jt(t)),n}function Ii(t,n){var r=n?ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Oi(t,n){if(t!==n){var r=t!==i,e=null===t,o=t==t,u=fa(t),a=n!==i,c=null===n,f=n==n,s=fa(n);if(!c&&!s&&!u&&t>n||u&&a&&f&&!c&&!s||e&&a&&f||!r&&f||!o)return 1;if(!e&&!u&&!s&&t<n||s&&r&&o&&!e&&!u||c&&r&&o||!a&&o||!f)return-1}return 0}function ki(t,n,r,i){for(var o=-1,u=t.length,a=r.length,c=-1,f=n.length,s=mr(u-a,0),l=e(f+s),h=!i;++c<f;)l[c]=n[c];for(;++o<a;)(h||o<u)&&(l[r[o]]=t[o]);for(;s--;)l[c++]=t[o++];return l}function Si(t,n,r,i){for(var o=-1,u=t.length,a=-1,c=r.length,f=-1,s=n.length,l=mr(u-c,0),h=e(l+s),p=!i;++o<l;)h[o]=t[o];for(var d=o;++f<s;)h[d+f]=n[f];for(;++a<c;)(p||o<u)&&(h[d+r[a]]=t[o++]);return h}function Ri(t,n){var r=-1,i=t.length;for(n||(n=e(i));++r<i;)n[r]=t[r];return n}function Ci(t,n,r,e){var o=!r;r||(r={});for(var u=-1,a=n.length;++u<a;){var c=n[u],f=e?e(r[c],t[c],c,r,t):i;f===i&&(f=t[c]),o?ue(r,c,f):re(r,c,f)}return r}function zi(t,n){return function(r,e){var i=Ju(r)?Sn:ie,o=n?n():{};return i(r,t,fo(e,2),o)}}function Ni(t){return Xe((function(n,r){var e=-1,o=r.length,u=o>1?r[o-1]:i,a=o>2?r[2]:i;for(u=t.length>3&&"function"==typeof u?(o--,u):i,a&&bo(r[0],r[1],a)&&(u=o<3?i:u,o=1),n=Ot(n);++e<o;){var c=r[e];c&&t(n,c,e,u)}return n}))}function $i(t,n){return function(r,e){if(null==r)return r;if(!Gu(r))return t(r,e);for(var i=r.length,o=n?i:-1,u=Ot(r);(n?o--:++o<i)&&!1!==e(u[o],o,u););return r}}function Bi(t){return function(n,r,e){for(var i=-1,o=Ot(n),u=e(n),a=u.length;a--;){var c=u[t?a:++i];if(!1===r(o[c],c,o))break}return n}}function Ti(t){return function(n){var r=cr(n=ma(n))?vr(n):i,e=r?r[0]:n.charAt(0),o=r?xi(r,1).join(""):n.slice(1);return e[t]()+o}}function Li(t){return function(n){return Un(Qa(qa(n).replace(tn,"")),t,"")}}function Ui(t){return function(){var n=arguments;switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3]);case 5:return new t(n[0],n[1],n[2],n[3],n[4]);case 6:return new t(n[0],n[1],n[2],n[3],n[4],n[5]);case 7:return new t(n[0],n[1],n[2],n[3],n[4],n[5],n[6])}var r=Dr(t.prototype),e=t.apply(r,n);return na(e)?e:r}}function Pi(t){return function(n,r,e){var o=Ot(n);if(!Gu(n)){var u=fo(r,3);n=za(n),r=function(t){return u(o[t],t,o)}}var a=t(n,r,e);return a>-1?o[u?n[a]:a]:i}}function Mi(t){return eo((function(n){var r=n.length,e=r,u=qr.prototype.thru;for(t&&n.reverse();e--;){var a=n[e];if("function"!=typeof a)throw new Rt(o);if(u&&!c&&"wrapper"==ao(a))var c=new qr([],!0)}for(e=c?e:r;++e<r;){var f=ao(a=n[e]),s="wrapper"==f?uo(a):i;c=s&&Ao(s[0])&&424==s[1]&&!s[4].length&&1==s[9]?c[ao(s[0])].apply(c,s[3]):1==a.length&&Ao(a)?c[f]():c.thru(a)}return function(){var t=arguments,e=t[0];if(c&&1==t.length&&Ju(e))return c.plant(e).value();for(var i=0,o=r?n[i].apply(this,t):e;++i<r;)o=n[i].call(this,o);return o}}))}function Wi(t,n,r,o,u,a,c,f,s,h){var p=n&l,d=1&n,v=2&n,g=24&n,y=512&n,_=v?i:Ui(t);return function l(){for(var m=arguments.length,w=e(m),b=m;b--;)w[b]=arguments[b];if(g)var x=co(l),A=function(t,n){for(var r=t.length,e=0;r--;)t[r]===n&&++e;return e}(w,x);if(o&&(w=ki(w,o,u,g)),a&&(w=Si(w,a,c,g)),m-=A,g&&m<h){var E=lr(w,x);return Hi(t,n,Wi,l.placeholder,r,w,E,f,s,h-m)}var j=d?r:this,I=v?j[t]:t;return m=w.length,f?w=function(t,n){var r=t.length,e=wr(n.length,r),o=Ri(t);for(;e--;){var u=n[e];t[e]=wo(u,r)?o[u]:i}return t}(w,f):y&&m>1&&w.reverse(),p&&s<m&&(w.length=s),this&&this!==gn&&this instanceof l&&(I=_||Ui(I)),I.apply(j,w)}}function Di(t,n){return function(r,e){return function(t,n,r,e){return be(t,(function(t,i,o){n(e,r(t),i,o)})),e}(r,t,n(e),{})}}function Fi(t,n){return function(r,e){var o;if(r===i&&e===i)return n;if(r!==i&&(o=r),e!==i){if(o===i)return e;"string"==typeof r||"string"==typeof e?(r=si(r),e=si(e)):(r=fi(r),e=fi(e)),o=t(r,e)}return o}}function qi(t){return eo((function(n){return n=Tn(n,tr(fo())),Xe((function(r){var e=this;return t(n,(function(t){return kn(t,e,r)}))}))}))}function Ji(t,n){var r=(n=n===i?" ":si(n)).length;if(r<2)return r?Ve(n,t):n;var e=Ve(n,vn(t/dr(n)));return cr(n)?xi(vr(e),0,t).join(""):e.slice(0,t)}function Zi(t){return function(n,r,o){return o&&"number"!=typeof o&&bo(n,r,o)&&(r=o=i),n=da(n),r===i?(r=n,n=0):r=da(r),function(t,n,r,i){for(var o=-1,u=mr(vn((n-t)/(r||1)),0),a=e(u);u--;)a[i?u:++o]=t,t+=r;return a}(n,r,o=o===i?n<r?1:-1:da(o),t)}}function Gi(t){return function(n,r){return"string"==typeof n&&"string"==typeof r||(n=ya(n),r=ya(r)),t(n,r)}}function Hi(t,n,r,e,o,u,a,c,l,h){var p=8&n;n|=p?f:s,4&(n&=~(p?s:f))||(n&=-4);var d=[t,n,o,p?u:i,p?a:i,p?i:u,p?i:a,c,l,h],v=r.apply(i,d);return Ao(t)&&Co(v,d),v.placeholder=e,$o(v,t,n)}function Ki(t){var n=It[t];return function(t,r){if(t=ya(t),(r=null==r?0:wr(va(r),292))&&bn(t)){var e=(ma(t)+"e").split("e");return+((e=(ma(n(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return n(t)}}var Vi=kr&&1/hr(new kr([,-0]))[1]==p?function(t){return new kr(t)}:fc;function Xi(t){return function(n){var r=go(n);return r==j?fr(n):r==R?pr(n):function(t,n){return Tn(n,(function(n){return[n,t[n]]}))}(n,t(n))}}function Qi(t,n,r,u,p,d,v,g){var y=2&n;if(!y&&"function"!=typeof t)throw new Rt(o);var _=u?u.length:0;if(_||(n&=-97,u=p=i),v=v===i?v:mr(va(v),0),g=g===i?g:va(g),_-=p?p.length:0,n&s){var m=u,w=p;u=p=i}var b=y?i:uo(t),x=[t,n,r,u,p,m,w,d,v,g];if(b&&function(t,n){var r=t[1],e=n[1],i=r|e,o=i<131,u=e==l&&8==r||e==l&&r==h&&t[7].length<=n[8]||384==e&&n[7].length<=n[8]&&8==r;if(!o&&!u)return t;1&e&&(t[2]=n[2],i|=1&r?0:4);var c=n[3];if(c){var f=t[3];t[3]=f?ki(f,c,n[4]):c,t[4]=f?lr(t[3],a):n[4]}(c=n[5])&&(f=t[5],t[5]=f?Si(f,c,n[6]):c,t[6]=f?lr(t[5],a):n[6]);(c=n[7])&&(t[7]=c);e&l&&(t[8]=null==t[8]?n[8]:wr(t[8],n[8]));null==t[9]&&(t[9]=n[9]);t[0]=n[0],t[1]=i}(x,b),t=x[0],n=x[1],r=x[2],u=x[3],p=x[4],!(g=x[9]=x[9]===i?y?0:t.length:mr(x[9]-_,0))&&24&n&&(n&=-25),n&&1!=n)A=8==n||n==c?function(t,n,r){var o=Ui(t);return function u(){for(var a=arguments.length,c=e(a),f=a,s=co(u);f--;)c[f]=arguments[f];var l=a<3&&c[0]!==s&&c[a-1]!==s?[]:lr(c,s);return(a-=l.length)<r?Hi(t,n,Wi,u.placeholder,i,c,l,i,i,r-a):kn(this&&this!==gn&&this instanceof u?o:t,this,c)}}(t,n,g):n!=f&&33!=n||p.length?Wi.apply(i,x):function(t,n,r,i){var o=1&n,u=Ui(t);return function n(){for(var a=-1,c=arguments.length,f=-1,s=i.length,l=e(s+c),h=this&&this!==gn&&this instanceof n?u:t;++f<s;)l[f]=i[f];for(;c--;)l[f++]=arguments[++a];return kn(h,o?r:this,l)}}(t,n,r,u);else var A=function(t,n,r){var e=1&n,i=Ui(t);return function n(){return(this&&this!==gn&&this instanceof n?i:t).apply(e?r:this,arguments)}}(t,n,r);return $o((b?ni:Co)(A,x),t,n)}function Yi(t,n,r,e){return t===i||Wu(t,Nt[r])&&!Tt.call(e,r)?n:t}function to(t,n,r,e,o,u){return na(t)&&na(n)&&(u.set(n,t),Fe(t,n,i,to,u),u.delete(n)),t}function no(t){return oa(t)?i:t}function ro(t,n,r,e,o,u){var a=1&r,c=t.length,f=n.length;if(c!=f&&!(a&&f>c))return!1;var s=u.get(t),l=u.get(n);if(s&&l)return s==n&&l==t;var h=-1,p=!0,d=2&r?new Kr:i;for(u.set(t,n),u.set(n,t);++h<c;){var v=t[h],g=n[h];if(e)var y=a?e(g,v,h,n,t,u):e(v,g,h,t,n,u);if(y!==i){if(y)continue;p=!1;break}if(d){if(!Mn(n,(function(t,n){if(!rr(d,n)&&(v===t||o(v,t,r,e,u)))return d.push(n)}))){p=!1;break}}else if(v!==g&&!o(v,g,r,e,u)){p=!1;break}}return u.delete(t),u.delete(n),p}function eo(t){return No(ko(t,i,Zo),t+"")}function io(t){return je(t,za,po)}function oo(t){return je(t,Na,vo)}var uo=Cr?function(t){return Cr.get(t)}:fc;function ao(t){for(var n=t.name+"",r=zr[n],e=Tt.call(zr,n)?r.length:0;e--;){var i=r[e],o=i.func;if(null==o||o==t)return i.name}return n}function co(t){return(Tt.call(Wr,"placeholder")?Wr:t).placeholder}function fo(){var t=Wr.iteratee||oc;return t=t===oc?Te:t,arguments.length?t(arguments[0],arguments[1]):t}function so(t,n){var r=t.__data__;return function(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}(n)?r["string"==typeof n?"string":"hash"]:r.map}function lo(t){for(var n=za(t),r=n.length;r--;){var e=n[r],i=t[e];n[r]=[e,i,Io(i)]}return n}function ho(t,n){var r=function(t,n){return null==t?i:t[n]}(t,n);return Be(r)?r:i}var po=_n?function(t){return null==t?[]:(t=Ot(t),Nn(_n(t),(function(n){return Kt.call(t,n)})))}:gc,vo=_n?function(t){for(var n=[];t;)Ln(n,po(t)),t=Gt(t);return n}:gc,go=Ie;function yo(t,n,r){for(var e=-1,i=(n=wi(n,t)).length,o=!1;++e<i;){var u=Uo(n[e]);if(!(o=null!=t&&r(t,u)))break;t=t[u]}return o||++e!=i?o:!!(i=null==t?0:t.length)&&ta(i)&&wo(u,i)&&(Ju(t)||qu(t))}function _o(t){return"function"!=typeof t.constructor||jo(t)?{}:Dr(Gt(t))}function mo(t){return Ju(t)||qu(t)||!!(Xt&&t&&t[Xt])}function wo(t,n){var r=typeof t;return!!(n=null==n?d:n)&&("number"==r||"symbol"!=r&&wt.test(t))&&t>-1&&t%1==0&&t<n}function bo(t,n,r){if(!na(r))return!1;var e=typeof n;return!!("number"==e?Gu(r)&&wo(n,r.length):"string"==e&&n in r)&&Wu(r[n],t)}function xo(t,n){if(Ju(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!fa(t))||(rt.test(t)||!nt.test(t)||null!=n&&t in Ot(n))}function Ao(t){var n=ao(t),r=Wr[n];if("function"!=typeof r||!(n in Jr.prototype))return!1;if(t===r)return!0;var e=uo(r);return!!e&&t===e[0]}(jr&&go(new jr(new ArrayBuffer(1)))!=B||Ir&&go(new Ir)!=j||Or&&go(Or.resolve())!=k||kr&&go(new kr)!=R||Sr&&go(new Sr)!=N)&&(go=function(t){var n=Ie(t),r=n==O?t.constructor:i,e=r?Po(r):"";if(e)switch(e){case Nr:return B;case $r:return j;case Br:return k;case Tr:return R;case Lr:return N}return n});var Eo=$t?Qu:yc;function jo(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Nt)}function Io(t){return t==t&&!na(t)}function Oo(t,n){return function(r){return null!=r&&(r[t]===n&&(n!==i||t in Ot(r)))}}function ko(t,n,r){return n=mr(n===i?t.length-1:n,0),function(){for(var i=arguments,o=-1,u=mr(i.length-n,0),a=e(u);++o<u;)a[o]=i[n+o];o=-1;for(var c=e(n+1);++o<n;)c[o]=i[o];return c[n]=r(a),kn(t,this,c)}}function So(t,n){return n.length<2?t:Ee(t,ii(n,0,-1))}function Ro(t,n){if(("constructor"!==n||"function"!=typeof t[n])&&"__proto__"!=n)return t[n]}var Co=Bo(ni),zo=dn||function(t,n){return gn.setTimeout(t,n)},No=Bo(ri);function $o(t,n,r){var e=n+"";return No(t,function(t,n){var r=n.length;if(!r)return t;var e=r-1;return n[e]=(r>1?"& ":"")+n[e],n=n.join(r>2?", ":" "),t.replace(ct,"{\n/* [wrapped with "+n+"] */\n")}(e,function(t,n){return Rn(y,(function(r){var e="_."+r[0];n&r[1]&&!$n(t,e)&&t.push(e)})),t.sort()}(function(t){var n=t.match(ft);return n?n[1].split(st):[]}(e),r)))}function Bo(t){var n=0,r=0;return function(){var e=br(),o=16-(e-r);if(r=e,o>0){if(++n>=800)return arguments[0]}else n=0;return t.apply(i,arguments)}}function To(t,n){var r=-1,e=t.length,o=e-1;for(n=n===i?e:n;++r<n;){var u=Ke(r,o),a=t[u];t[u]=t[r],t[r]=a}return t.length=n,t}var Lo=function(t){var n=Bu(t,(function(t){return 500===r.size&&r.clear(),t})),r=n.cache;return n}((function(t){var n=[];return 46===t.charCodeAt(0)&&n.push(""),t.replace(et,(function(t,r,e,i){n.push(e?i.replace(pt,"$1"):r||t)})),n}));function Uo(t){if("string"==typeof t||fa(t))return t;var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}function Po(t){if(null!=t){try{return Bt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Mo(t){if(t instanceof Jr)return t.clone();var n=new qr(t.__wrapped__,t.__chain__);return n.__actions__=Ri(t.__actions__),n.__index__=t.__index__,n.__values__=t.__values__,n}var Wo=Xe((function(t,n){return Hu(t)?he(t,_e(n,1,Hu,!0)):[]})),Do=Xe((function(t,n){var r=Xo(n);return Hu(r)&&(r=i),Hu(t)?he(t,_e(n,1,Hu,!0),fo(r,2)):[]})),Fo=Xe((function(t,n){var r=Xo(n);return Hu(r)&&(r=i),Hu(t)?he(t,_e(n,1,Hu,!0),i,r):[]}));function qo(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var i=null==r?0:va(r);return i<0&&(i=mr(e+i,0)),Fn(t,fo(n,3),i)}function Jo(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var o=e-1;return r!==i&&(o=va(r),o=r<0?mr(e+o,0):wr(o,e-1)),Fn(t,fo(n,3),o,!0)}function Zo(t){return(null==t?0:t.length)?_e(t,1):[]}function Go(t){return t&&t.length?t[0]:i}var Ho=Xe((function(t){var n=Tn(t,_i);return n.length&&n[0]===t[0]?Re(n):[]})),Ko=Xe((function(t){var n=Xo(t),r=Tn(t,_i);return n===Xo(r)?n=i:r.pop(),r.length&&r[0]===t[0]?Re(r,fo(n,2)):[]})),Vo=Xe((function(t){var n=Xo(t),r=Tn(t,_i);return(n="function"==typeof n?n:i)&&r.pop(),r.length&&r[0]===t[0]?Re(r,i,n):[]}));function Xo(t){var n=null==t?0:t.length;return n?t[n-1]:i}var Qo=Xe(Yo);function Yo(t,n){return t&&t.length&&n&&n.length?Ge(t,n):t}var tu=eo((function(t,n){var r=null==t?0:t.length,e=ae(t,n);return He(t,Tn(n,(function(t){return wo(t,r)?+t:t})).sort(Oi)),e}));function nu(t){return null==t?t:Er.call(t)}var ru=Xe((function(t){return li(_e(t,1,Hu,!0))})),eu=Xe((function(t){var n=Xo(t);return Hu(n)&&(n=i),li(_e(t,1,Hu,!0),fo(n,2))})),iu=Xe((function(t){var n=Xo(t);return n="function"==typeof n?n:i,li(_e(t,1,Hu,!0),i,n)}));function ou(t){if(!t||!t.length)return[];var n=0;return t=Nn(t,(function(t){if(Hu(t))return n=mr(t.length,n),!0})),Qn(n,(function(n){return Tn(t,Hn(n))}))}function uu(t,n){if(!t||!t.length)return[];var r=ou(t);return null==n?r:Tn(r,(function(t){return kn(n,i,t)}))}var au=Xe((function(t,n){return Hu(t)?he(t,n):[]})),cu=Xe((function(t){return gi(Nn(t,Hu))})),fu=Xe((function(t){var n=Xo(t);return Hu(n)&&(n=i),gi(Nn(t,Hu),fo(n,2))})),su=Xe((function(t){var n=Xo(t);return n="function"==typeof n?n:i,gi(Nn(t,Hu),i,n)})),lu=Xe(ou);var hu=Xe((function(t){var n=t.length,r=n>1?t[n-1]:i;return r="function"==typeof r?(t.pop(),r):i,uu(t,r)}));function pu(t){var n=Wr(t);return n.__chain__=!0,n}function du(t,n){return n(t)}var vu=eo((function(t){var n=t.length,r=n?t[0]:0,e=this.__wrapped__,o=function(n){return ae(n,t)};return!(n>1||this.__actions__.length)&&e instanceof Jr&&wo(r)?((e=e.slice(r,+r+(n?1:0))).__actions__.push({func:du,args:[o],thisArg:i}),new qr(e,this.__chain__).thru((function(t){return n&&!t.length&&t.push(i),t}))):this.thru(o)}));var gu=zi((function(t,n,r){Tt.call(t,r)?++t[r]:ue(t,r,1)}));var yu=Pi(qo),_u=Pi(Jo);function mu(t,n){return(Ju(t)?Rn:pe)(t,fo(n,3))}function wu(t,n){return(Ju(t)?Cn:de)(t,fo(n,3))}var bu=zi((function(t,n,r){Tt.call(t,r)?t[r].push(n):ue(t,r,[n])}));var xu=Xe((function(t,n,r){var i=-1,o="function"==typeof n,u=Gu(t)?e(t.length):[];return pe(t,(function(t){u[++i]=o?kn(n,t,r):Ce(t,n,r)})),u})),Au=zi((function(t,n,r){ue(t,r,n)}));function Eu(t,n){return(Ju(t)?Tn:Me)(t,fo(n,3))}var ju=zi((function(t,n,r){t[r?0:1].push(n)}),(function(){return[[],[]]}));var Iu=Xe((function(t,n){if(null==t)return[];var r=n.length;return r>1&&bo(t,n[0],n[1])?n=[]:r>2&&bo(n[0],n[1],n[2])&&(n=[n[0]]),Je(t,_e(n,1),[])})),Ou=ln||function(){return gn.Date.now()};function ku(t,n,r){return n=r?i:n,n=t&&null==n?t.length:n,Qi(t,l,i,i,i,i,n)}function Su(t,n){var r;if("function"!=typeof n)throw new Rt(o);return t=va(t),function(){return--t>0&&(r=n.apply(this,arguments)),t<=1&&(n=i),r}}var Ru=Xe((function(t,n,r){var e=1;if(r.length){var i=lr(r,co(Ru));e|=f}return Qi(t,e,n,r,i)})),Cu=Xe((function(t,n,r){var e=3;if(r.length){var i=lr(r,co(Cu));e|=f}return Qi(n,e,t,r,i)}));function zu(t,n,r){var e,u,a,c,f,s,l=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new Rt(o);function v(n){var r=e,o=u;return e=u=i,l=n,c=t.apply(o,r)}function g(t){var r=t-s;return s===i||r>=n||r<0||p&&t-l>=a}function y(){var t=Ou();if(g(t))return _(t);f=zo(y,function(t){var r=n-(t-s);return p?wr(r,a-(t-l)):r}(t))}function _(t){return f=i,d&&e?v(t):(e=u=i,c)}function m(){var t=Ou(),r=g(t);if(e=arguments,u=this,s=t,r){if(f===i)return function(t){return l=t,f=zo(y,n),h?v(t):c}(s);if(p)return Ai(f),f=zo(y,n),v(s)}return f===i&&(f=zo(y,n)),c}return n=ya(n)||0,na(r)&&(h=!!r.leading,a=(p="maxWait"in r)?mr(ya(r.maxWait)||0,n):a,d="trailing"in r?!!r.trailing:d),m.cancel=function(){f!==i&&Ai(f),l=0,e=s=u=f=i},m.flush=function(){return f===i?c:_(Ou())},m}var Nu=Xe((function(t,n){return le(t,1,n)})),$u=Xe((function(t,n,r){return le(t,ya(n)||0,r)}));function Bu(t,n){if("function"!=typeof t||null!=n&&"function"!=typeof n)throw new Rt(o);var r=function(){var e=arguments,i=n?n.apply(this,e):e[0],o=r.cache;if(o.has(i))return o.get(i);var u=t.apply(this,e);return r.cache=o.set(i,u)||o,u};return r.cache=new(Bu.Cache||Hr),r}function Tu(t){if("function"!=typeof t)throw new Rt(o);return function(){var n=arguments;switch(n.length){case 0:return!t.call(this);case 1:return!t.call(this,n[0]);case 2:return!t.call(this,n[0],n[1]);case 3:return!t.call(this,n[0],n[1],n[2])}return!t.apply(this,n)}}Bu.Cache=Hr;var Lu=bi((function(t,n){var r=(n=1==n.length&&Ju(n[0])?Tn(n[0],tr(fo())):Tn(_e(n,1),tr(fo()))).length;return Xe((function(e){for(var i=-1,o=wr(e.length,r);++i<o;)e[i]=n[i].call(this,e[i]);return kn(t,this,e)}))})),Uu=Xe((function(t,n){var r=lr(n,co(Uu));return Qi(t,f,i,n,r)})),Pu=Xe((function(t,n){var r=lr(n,co(Pu));return Qi(t,s,i,n,r)})),Mu=eo((function(t,n){return Qi(t,h,i,i,i,n)}));function Wu(t,n){return t===n||t!=t&&n!=n}var Du=Gi(Oe),Fu=Gi((function(t,n){return t>=n})),qu=ze(function(){return arguments}())?ze:function(t){return ra(t)&&Tt.call(t,"callee")&&!Kt.call(t,"callee")},Ju=e.isArray,Zu=xn?tr(xn):function(t){return ra(t)&&Ie(t)==$};function Gu(t){return null!=t&&ta(t.length)&&!Qu(t)}function Hu(t){return ra(t)&&Gu(t)}var Ku=wn||yc,Vu=An?tr(An):function(t){return ra(t)&&Ie(t)==b};function Xu(t){if(!ra(t))return!1;var n=Ie(t);return n==x||"[object DOMException]"==n||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Qu(t){if(!na(t))return!1;var n=Ie(t);return n==A||n==E||"[object AsyncFunction]"==n||"[object Proxy]"==n}function Yu(t){return"number"==typeof t&&t==va(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=d}function na(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}function ra(t){return null!=t&&"object"==typeof t}var ea=En?tr(En):function(t){return ra(t)&&go(t)==j};function ia(t){return"number"==typeof t||ra(t)&&Ie(t)==I}function oa(t){if(!ra(t)||Ie(t)!=O)return!1;var n=Gt(t);if(null===n)return!0;var r=Tt.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&Bt.call(r)==Mt}var ua=jn?tr(jn):function(t){return ra(t)&&Ie(t)==S};var aa=In?tr(In):function(t){return ra(t)&&go(t)==R};function ca(t){return"string"==typeof t||!Ju(t)&&ra(t)&&Ie(t)==C}function fa(t){return"symbol"==typeof t||ra(t)&&Ie(t)==z}var sa=On?tr(On):function(t){return ra(t)&&ta(t.length)&&!!fn[Ie(t)]};var la=Gi(Pe),ha=Gi((function(t,n){return t<=n}));function pa(t){if(!t)return[];if(Gu(t))return ca(t)?vr(t):Ri(t);if(Qt&&t[Qt])return function(t){for(var n,r=[];!(n=t.next()).done;)r.push(n.value);return r}(t[Qt]());var n=go(t);return(n==j?fr:n==R?hr:Wa)(t)}function da(t){return t?(t=ya(t))===p||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function va(t){var n=da(t),r=n%1;return n==n?r?n-r:n:0}function ga(t){return t?ce(va(t),0,g):0}function ya(t){if("number"==typeof t)return t;if(fa(t))return v;if(na(t)){var n="function"==typeof t.valueOf?t.valueOf():t;t=na(n)?n+"":n}if("string"!=typeof t)return 0===t?t:+t;t=Yn(t);var r=yt.test(t);return r||mt.test(t)?pn(t.slice(2),r?2:8):gt.test(t)?v:+t}function _a(t){return Ci(t,Na(t))}function ma(t){return null==t?"":si(t)}var wa=Ni((function(t,n){if(jo(n)||Gu(n))Ci(n,za(n),t);else for(var r in n)Tt.call(n,r)&&re(t,r,n[r])})),ba=Ni((function(t,n){Ci(n,Na(n),t)})),xa=Ni((function(t,n,r,e){Ci(n,Na(n),t,e)})),Aa=Ni((function(t,n,r,e){Ci(n,za(n),t,e)})),Ea=eo(ae);var ja=Xe((function(t,n){t=Ot(t);var r=-1,e=n.length,o=e>2?n[2]:i;for(o&&bo(n[0],n[1],o)&&(e=1);++r<e;)for(var u=n[r],a=Na(u),c=-1,f=a.length;++c<f;){var s=a[c],l=t[s];(l===i||Wu(l,Nt[s])&&!Tt.call(t,s))&&(t[s]=u[s])}return t})),Ia=Xe((function(t){return t.push(i,to),kn(Ba,i,t)}));function Oa(t,n,r){var e=null==t?i:Ee(t,n);return e===i?r:e}function ka(t,n){return null!=t&&yo(t,n,Se)}var Sa=Di((function(t,n,r){null!=n&&"function"!=typeof n.toString&&(n=Pt.call(n)),t[n]=r}),nc(ic)),Ra=Di((function(t,n,r){null!=n&&"function"!=typeof n.toString&&(n=Pt.call(n)),Tt.call(t,n)?t[n].push(r):t[n]=[r]}),fo),Ca=Xe(Ce);function za(t){return Gu(t)?Xr(t):Le(t)}function Na(t){return Gu(t)?Xr(t,!0):Ue(t)}var $a=Ni((function(t,n,r){Fe(t,n,r)})),Ba=Ni((function(t,n,r,e){Fe(t,n,r,e)})),Ta=eo((function(t,n){var r={};if(null==t)return r;var e=!1;n=Tn(n,(function(n){return n=wi(n,t),e||(e=n.length>1),n})),Ci(t,oo(t),r),e&&(r=fe(r,7,no));for(var i=n.length;i--;)hi(r,n[i]);return r}));var La=eo((function(t,n){return null==t?{}:function(t,n){return Ze(t,n,(function(n,r){return ka(t,r)}))}(t,n)}));function Ua(t,n){if(null==t)return{};var r=Tn(oo(t),(function(t){return[t]}));return n=fo(n),Ze(t,r,(function(t,r){return n(t,r[0])}))}var Pa=Xi(za),Ma=Xi(Na);function Wa(t){return null==t?[]:nr(t,za(t))}var Da=Li((function(t,n,r){return n=n.toLowerCase(),t+(r?Fa(n):n)}));function Fa(t){return Xa(ma(t).toLowerCase())}function qa(t){return(t=ma(t))&&t.replace(bt,or).replace(nn,"")}var Ja=Li((function(t,n,r){return t+(r?"-":"")+n.toLowerCase()})),Za=Li((function(t,n,r){return t+(r?" ":"")+n.toLowerCase()})),Ga=Ti("toLowerCase");var Ha=Li((function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}));var Ka=Li((function(t,n,r){return t+(r?" ":"")+Xa(n)}));var Va=Li((function(t,n,r){return t+(r?" ":"")+n.toUpperCase()})),Xa=Ti("toUpperCase");function Qa(t,n,r){return t=ma(t),(n=r?i:n)===i?function(t){return un.test(t)}(t)?function(t){return t.match(en)||[]}(t):function(t){return t.match(lt)||[]}(t):t.match(n)||[]}var Ya=Xe((function(t,n){try{return kn(t,i,n)}catch(t){return Xu(t)?t:new Et(t)}})),tc=eo((function(t,n){return Rn(n,(function(n){n=Uo(n),ue(t,n,Ru(t[n],t))})),t}));function nc(t){return function(){return t}}var rc=Mi(),ec=Mi(!0);function ic(t){return t}function oc(t){return Te("function"==typeof t?t:fe(t,1))}var uc=Xe((function(t,n){return function(r){return Ce(r,t,n)}})),ac=Xe((function(t,n){return function(r){return Ce(t,r,n)}}));function cc(t,n,r){var e=za(n),i=Ae(n,e);null!=r||na(n)&&(i.length||!e.length)||(r=n,n=t,t=this,i=Ae(n,za(n)));var o=!(na(r)&&"chain"in r&&!r.chain),u=Qu(t);return Rn(i,(function(r){var e=n[r];t[r]=e,u&&(t.prototype[r]=function(){var n=this.__chain__;if(o||n){var r=t(this.__wrapped__);return(r.__actions__=Ri(this.__actions__)).push({func:e,args:arguments,thisArg:t}),r.__chain__=n,r}return e.apply(t,Ln([this.value()],arguments))})})),t}function fc(){}var sc=qi(Tn),lc=qi(zn),hc=qi(Mn);function pc(t){return xo(t)?Hn(Uo(t)):function(t){return function(n){return Ee(n,t)}}(t)}var dc=Zi(),vc=Zi(!0);function gc(){return[]}function yc(){return!1}var _c=Fi((function(t,n){return t+n}),0),mc=Ki("ceil"),wc=Fi((function(t,n){return t/n}),1),bc=Ki("floor");var xc,Ac=Fi((function(t,n){return t*n}),1),Ec=Ki("round"),jc=Fi((function(t,n){return t-n}),0);return Wr.after=function(t,n){if("function"!=typeof n)throw new Rt(o);return t=va(t),function(){if(--t<1)return n.apply(this,arguments)}},Wr.ary=ku,Wr.assign=wa,Wr.assignIn=ba,Wr.assignInWith=xa,Wr.assignWith=Aa,Wr.at=Ea,Wr.before=Su,Wr.bind=Ru,Wr.bindAll=tc,Wr.bindKey=Cu,Wr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Ju(t)?t:[t]},Wr.chain=pu,Wr.chunk=function(t,n,r){n=(r?bo(t,n,r):n===i)?1:mr(va(n),0);var o=null==t?0:t.length;if(!o||n<1)return[];for(var u=0,a=0,c=e(vn(o/n));u<o;)c[a++]=ii(t,u,u+=n);return c},Wr.compact=function(t){for(var n=-1,r=null==t?0:t.length,e=0,i=[];++n<r;){var o=t[n];o&&(i[e++]=o)}return i},Wr.concat=function(){var t=arguments.length;if(!t)return[];for(var n=e(t-1),r=arguments[0],i=t;i--;)n[i-1]=arguments[i];return Ln(Ju(r)?Ri(r):[r],_e(n,1))},Wr.cond=function(t){var n=null==t?0:t.length,r=fo();return t=n?Tn(t,(function(t){if("function"!=typeof t[1])throw new Rt(o);return[r(t[0]),t[1]]})):[],Xe((function(r){for(var e=-1;++e<n;){var i=t[e];if(kn(i[0],this,r))return kn(i[1],this,r)}}))},Wr.conforms=function(t){return function(t){var n=za(t);return function(r){return se(r,t,n)}}(fe(t,1))},Wr.constant=nc,Wr.countBy=gu,Wr.create=function(t,n){var r=Dr(t);return null==n?r:oe(r,n)},Wr.curry=function t(n,r,e){var o=Qi(n,8,i,i,i,i,i,r=e?i:r);return o.placeholder=t.placeholder,o},Wr.curryRight=function t(n,r,e){var o=Qi(n,c,i,i,i,i,i,r=e?i:r);return o.placeholder=t.placeholder,o},Wr.debounce=zu,Wr.defaults=ja,Wr.defaultsDeep=Ia,Wr.defer=Nu,Wr.delay=$u,Wr.difference=Wo,Wr.differenceBy=Do,Wr.differenceWith=Fo,Wr.drop=function(t,n,r){var e=null==t?0:t.length;return e?ii(t,(n=r||n===i?1:va(n))<0?0:n,e):[]},Wr.dropRight=function(t,n,r){var e=null==t?0:t.length;return e?ii(t,0,(n=e-(n=r||n===i?1:va(n)))<0?0:n):[]},Wr.dropRightWhile=function(t,n){return t&&t.length?di(t,fo(n,3),!0,!0):[]},Wr.dropWhile=function(t,n){return t&&t.length?di(t,fo(n,3),!0):[]},Wr.fill=function(t,n,r,e){var o=null==t?0:t.length;return o?(r&&"number"!=typeof r&&bo(t,n,r)&&(r=0,e=o),function(t,n,r,e){var o=t.length;for((r=va(r))<0&&(r=-r>o?0:o+r),(e=e===i||e>o?o:va(e))<0&&(e+=o),e=r>e?0:ga(e);r<e;)t[r++]=n;return t}(t,n,r,e)):[]},Wr.filter=function(t,n){return(Ju(t)?Nn:ye)(t,fo(n,3))},Wr.flatMap=function(t,n){return _e(Eu(t,n),1)},Wr.flatMapDeep=function(t,n){return _e(Eu(t,n),p)},Wr.flatMapDepth=function(t,n,r){return r=r===i?1:va(r),_e(Eu(t,n),r)},Wr.flatten=Zo,Wr.flattenDeep=function(t){return(null==t?0:t.length)?_e(t,p):[]},Wr.flattenDepth=function(t,n){return(null==t?0:t.length)?_e(t,n=n===i?1:va(n)):[]},Wr.flip=function(t){return Qi(t,512)},Wr.flow=rc,Wr.flowRight=ec,Wr.fromPairs=function(t){for(var n=-1,r=null==t?0:t.length,e={};++n<r;){var i=t[n];e[i[0]]=i[1]}return e},Wr.functions=function(t){return null==t?[]:Ae(t,za(t))},Wr.functionsIn=function(t){return null==t?[]:Ae(t,Na(t))},Wr.groupBy=bu,Wr.initial=function(t){return(null==t?0:t.length)?ii(t,0,-1):[]},Wr.intersection=Ho,Wr.intersectionBy=Ko,Wr.intersectionWith=Vo,Wr.invert=Sa,Wr.invertBy=Ra,Wr.invokeMap=xu,Wr.iteratee=oc,Wr.keyBy=Au,Wr.keys=za,Wr.keysIn=Na,Wr.map=Eu,Wr.mapKeys=function(t,n){var r={};return n=fo(n,3),be(t,(function(t,e,i){ue(r,n(t,e,i),t)})),r},Wr.mapValues=function(t,n){var r={};return n=fo(n,3),be(t,(function(t,e,i){ue(r,e,n(t,e,i))})),r},Wr.matches=function(t){return We(fe(t,1))},Wr.matchesProperty=function(t,n){return De(t,fe(n,1))},Wr.memoize=Bu,Wr.merge=$a,Wr.mergeWith=Ba,Wr.method=uc,Wr.methodOf=ac,Wr.mixin=cc,Wr.negate=Tu,Wr.nthArg=function(t){return t=va(t),Xe((function(n){return qe(n,t)}))},Wr.omit=Ta,Wr.omitBy=function(t,n){return Ua(t,Tu(fo(n)))},Wr.once=function(t){return Su(2,t)},Wr.orderBy=function(t,n,r,e){return null==t?[]:(Ju(n)||(n=null==n?[]:[n]),Ju(r=e?i:r)||(r=null==r?[]:[r]),Je(t,n,r))},Wr.over=sc,Wr.overArgs=Lu,Wr.overEvery=lc,Wr.overSome=hc,Wr.partial=Uu,Wr.partialRight=Pu,Wr.partition=ju,Wr.pick=La,Wr.pickBy=Ua,Wr.property=pc,Wr.propertyOf=function(t){return function(n){return null==t?i:Ee(t,n)}},Wr.pull=Qo,Wr.pullAll=Yo,Wr.pullAllBy=function(t,n,r){return t&&t.length&&n&&n.length?Ge(t,n,fo(r,2)):t},Wr.pullAllWith=function(t,n,r){return t&&t.length&&n&&n.length?Ge(t,n,i,r):t},Wr.pullAt=tu,Wr.range=dc,Wr.rangeRight=vc,Wr.rearg=Mu,Wr.reject=function(t,n){return(Ju(t)?Nn:ye)(t,Tu(fo(n,3)))},Wr.remove=function(t,n){var r=[];if(!t||!t.length)return r;var e=-1,i=[],o=t.length;for(n=fo(n,3);++e<o;){var u=t[e];n(u,e,t)&&(r.push(u),i.push(e))}return He(t,i),r},Wr.rest=function(t,n){if("function"!=typeof t)throw new Rt(o);return Xe(t,n=n===i?n:va(n))},Wr.reverse=nu,Wr.sampleSize=function(t,n,r){return n=(r?bo(t,n,r):n===i)?1:va(n),(Ju(t)?Yr:Ye)(t,n)},Wr.set=function(t,n,r){return null==t?t:ti(t,n,r)},Wr.setWith=function(t,n,r,e){return e="function"==typeof e?e:i,null==t?t:ti(t,n,r,e)},Wr.shuffle=function(t){return(Ju(t)?te:ei)(t)},Wr.slice=function(t,n,r){var e=null==t?0:t.length;return e?(r&&"number"!=typeof r&&bo(t,n,r)?(n=0,r=e):(n=null==n?0:va(n),r=r===i?e:va(r)),ii(t,n,r)):[]},Wr.sortBy=Iu,Wr.sortedUniq=function(t){return t&&t.length?ci(t):[]},Wr.sortedUniqBy=function(t,n){return t&&t.length?ci(t,fo(n,2)):[]},Wr.split=function(t,n,r){return r&&"number"!=typeof r&&bo(t,n,r)&&(n=r=i),(r=r===i?g:r>>>0)?(t=ma(t))&&("string"==typeof n||null!=n&&!ua(n))&&!(n=si(n))&&cr(t)?xi(vr(t),0,r):t.split(n,r):[]},Wr.spread=function(t,n){if("function"!=typeof t)throw new Rt(o);return n=null==n?0:mr(va(n),0),Xe((function(r){var e=r[n],i=xi(r,0,n);return e&&Ln(i,e),kn(t,this,i)}))},Wr.tail=function(t){var n=null==t?0:t.length;return n?ii(t,1,n):[]},Wr.take=function(t,n,r){return t&&t.length?ii(t,0,(n=r||n===i?1:va(n))<0?0:n):[]},Wr.takeRight=function(t,n,r){var e=null==t?0:t.length;return e?ii(t,(n=e-(n=r||n===i?1:va(n)))<0?0:n,e):[]},Wr.takeRightWhile=function(t,n){return t&&t.length?di(t,fo(n,3),!1,!0):[]},Wr.takeWhile=function(t,n){return t&&t.length?di(t,fo(n,3)):[]},Wr.tap=function(t,n){return n(t),t},Wr.throttle=function(t,n,r){var e=!0,i=!0;if("function"!=typeof t)throw new Rt(o);return na(r)&&(e="leading"in r?!!r.leading:e,i="trailing"in r?!!r.trailing:i),zu(t,n,{leading:e,maxWait:n,trailing:i})},Wr.thru=du,Wr.toArray=pa,Wr.toPairs=Pa,Wr.toPairsIn=Ma,Wr.toPath=function(t){return Ju(t)?Tn(t,Uo):fa(t)?[t]:Ri(Lo(ma(t)))},Wr.toPlainObject=_a,Wr.transform=function(t,n,r){var e=Ju(t),i=e||Ku(t)||sa(t);if(n=fo(n,4),null==r){var o=t&&t.constructor;r=i?e?new o:[]:na(t)&&Qu(o)?Dr(Gt(t)):{}}return(i?Rn:be)(t,(function(t,e,i){return n(r,t,e,i)})),r},Wr.unary=function(t){return ku(t,1)},Wr.union=ru,Wr.unionBy=eu,Wr.unionWith=iu,Wr.uniq=function(t){return t&&t.length?li(t):[]},Wr.uniqBy=function(t,n){return t&&t.length?li(t,fo(n,2)):[]},Wr.uniqWith=function(t,n){return n="function"==typeof n?n:i,t&&t.length?li(t,i,n):[]},Wr.unset=function(t,n){return null==t||hi(t,n)},Wr.unzip=ou,Wr.unzipWith=uu,Wr.update=function(t,n,r){return null==t?t:pi(t,n,mi(r))},Wr.updateWith=function(t,n,r,e){return e="function"==typeof e?e:i,null==t?t:pi(t,n,mi(r),e)},Wr.values=Wa,Wr.valuesIn=function(t){return null==t?[]:nr(t,Na(t))},Wr.without=au,Wr.words=Qa,Wr.wrap=function(t,n){return Uu(mi(n),t)},Wr.xor=cu,Wr.xorBy=fu,Wr.xorWith=su,Wr.zip=lu,Wr.zipObject=function(t,n){return yi(t||[],n||[],re)},Wr.zipObjectDeep=function(t,n){return yi(t||[],n||[],ti)},Wr.zipWith=hu,Wr.entries=Pa,Wr.entriesIn=Ma,Wr.extend=ba,Wr.extendWith=xa,cc(Wr,Wr),Wr.add=_c,Wr.attempt=Ya,Wr.camelCase=Da,Wr.capitalize=Fa,Wr.ceil=mc,Wr.clamp=function(t,n,r){return r===i&&(r=n,n=i),r!==i&&(r=(r=ya(r))==r?r:0),n!==i&&(n=(n=ya(n))==n?n:0),ce(ya(t),n,r)},Wr.clone=function(t){return fe(t,4)},Wr.cloneDeep=function(t){return fe(t,5)},Wr.cloneDeepWith=function(t,n){return fe(t,5,n="function"==typeof n?n:i)},Wr.cloneWith=function(t,n){return fe(t,4,n="function"==typeof n?n:i)},Wr.conformsTo=function(t,n){return null==n||se(t,n,za(n))},Wr.deburr=qa,Wr.defaultTo=function(t,n){return null==t||t!=t?n:t},Wr.divide=wc,Wr.endsWith=function(t,n,r){t=ma(t),n=si(n);var e=t.length,o=r=r===i?e:ce(va(r),0,e);return(r-=n.length)>=0&&t.slice(r,o)==n},Wr.eq=Wu,Wr.escape=function(t){return(t=ma(t))&&X.test(t)?t.replace(K,ur):t},Wr.escapeRegExp=function(t){return(t=ma(t))&&ot.test(t)?t.replace(it,"\\$&"):t},Wr.every=function(t,n,r){var e=Ju(t)?zn:ve;return r&&bo(t,n,r)&&(n=i),e(t,fo(n,3))},Wr.find=yu,Wr.findIndex=qo,Wr.findKey=function(t,n){return Dn(t,fo(n,3),be)},Wr.findLast=_u,Wr.findLastIndex=Jo,Wr.findLastKey=function(t,n){return Dn(t,fo(n,3),xe)},Wr.floor=bc,Wr.forEach=mu,Wr.forEachRight=wu,Wr.forIn=function(t,n){return null==t?t:me(t,fo(n,3),Na)},Wr.forInRight=function(t,n){return null==t?t:we(t,fo(n,3),Na)},Wr.forOwn=function(t,n){return t&&be(t,fo(n,3))},Wr.forOwnRight=function(t,n){return t&&xe(t,fo(n,3))},Wr.get=Oa,Wr.gt=Du,Wr.gte=Fu,Wr.has=function(t,n){return null!=t&&yo(t,n,ke)},Wr.hasIn=ka,Wr.head=Go,Wr.identity=ic,Wr.includes=function(t,n,r,e){t=Gu(t)?t:Wa(t),r=r&&!e?va(r):0;var i=t.length;return r<0&&(r=mr(i+r,0)),ca(t)?r<=i&&t.indexOf(n,r)>-1:!!i&&qn(t,n,r)>-1},Wr.indexOf=function(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var i=null==r?0:va(r);return i<0&&(i=mr(e+i,0)),qn(t,n,i)},Wr.inRange=function(t,n,r){return n=da(n),r===i?(r=n,n=0):r=da(r),function(t,n,r){return t>=wr(n,r)&&t<mr(n,r)}(t=ya(t),n,r)},Wr.invoke=Ca,Wr.isArguments=qu,Wr.isArray=Ju,Wr.isArrayBuffer=Zu,Wr.isArrayLike=Gu,Wr.isArrayLikeObject=Hu,Wr.isBoolean=function(t){return!0===t||!1===t||ra(t)&&Ie(t)==w},Wr.isBuffer=Ku,Wr.isDate=Vu,Wr.isElement=function(t){return ra(t)&&1===t.nodeType&&!oa(t)},Wr.isEmpty=function(t){if(null==t)return!0;if(Gu(t)&&(Ju(t)||"string"==typeof t||"function"==typeof t.splice||Ku(t)||sa(t)||qu(t)))return!t.length;var n=go(t);if(n==j||n==R)return!t.size;if(jo(t))return!Le(t).length;for(var r in t)if(Tt.call(t,r))return!1;return!0},Wr.isEqual=function(t,n){return Ne(t,n)},Wr.isEqualWith=function(t,n,r){var e=(r="function"==typeof r?r:i)?r(t,n):i;return e===i?Ne(t,n,i,r):!!e},Wr.isError=Xu,Wr.isFinite=function(t){return"number"==typeof t&&bn(t)},Wr.isFunction=Qu,Wr.isInteger=Yu,Wr.isLength=ta,Wr.isMap=ea,Wr.isMatch=function(t,n){return t===n||$e(t,n,lo(n))},Wr.isMatchWith=function(t,n,r){return r="function"==typeof r?r:i,$e(t,n,lo(n),r)},Wr.isNaN=function(t){return ia(t)&&t!=+t},Wr.isNative=function(t){if(Eo(t))throw new Et("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Be(t)},Wr.isNil=function(t){return null==t},Wr.isNull=function(t){return null===t},Wr.isNumber=ia,Wr.isObject=na,Wr.isObjectLike=ra,Wr.isPlainObject=oa,Wr.isRegExp=ua,Wr.isSafeInteger=function(t){return Yu(t)&&t>=-9007199254740991&&t<=d},Wr.isSet=aa,Wr.isString=ca,Wr.isSymbol=fa,Wr.isTypedArray=sa,Wr.isUndefined=function(t){return t===i},Wr.isWeakMap=function(t){return ra(t)&&go(t)==N},Wr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ie(t)},Wr.join=function(t,n){return null==t?"":Wn.call(t,n)},Wr.kebabCase=Ja,Wr.last=Xo,Wr.lastIndexOf=function(t,n,r){var e=null==t?0:t.length;if(!e)return-1;var o=e;return r!==i&&(o=(o=va(r))<0?mr(e+o,0):wr(o,e-1)),n==n?function(t,n,r){for(var e=r+1;e--;)if(t[e]===n)return e;return e}(t,n,o):Fn(t,Zn,o,!0)},Wr.lowerCase=Za,Wr.lowerFirst=Ga,Wr.lt=la,Wr.lte=ha,Wr.max=function(t){return t&&t.length?ge(t,ic,Oe):i},Wr.maxBy=function(t,n){return t&&t.length?ge(t,fo(n,2),Oe):i},Wr.mean=function(t){return Gn(t,ic)},Wr.meanBy=function(t,n){return Gn(t,fo(n,2))},Wr.min=function(t){return t&&t.length?ge(t,ic,Pe):i},Wr.minBy=function(t,n){return t&&t.length?ge(t,fo(n,2),Pe):i},Wr.stubArray=gc,Wr.stubFalse=yc,Wr.stubObject=function(){return{}},Wr.stubString=function(){return""},Wr.stubTrue=function(){return!0},Wr.multiply=Ac,Wr.nth=function(t,n){return t&&t.length?qe(t,va(n)):i},Wr.noConflict=function(){return gn._===this&&(gn._=Wt),this},Wr.noop=fc,Wr.now=Ou,Wr.pad=function(t,n,r){t=ma(t);var e=(n=va(n))?dr(t):0;if(!n||e>=n)return t;var i=(n-e)/2;return Ji(yn(i),r)+t+Ji(vn(i),r)},Wr.padEnd=function(t,n,r){t=ma(t);var e=(n=va(n))?dr(t):0;return n&&e<n?t+Ji(n-e,r):t},Wr.padStart=function(t,n,r){t=ma(t);var e=(n=va(n))?dr(t):0;return n&&e<n?Ji(n-e,r)+t:t},Wr.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),xr(ma(t).replace(ut,""),n||0)},Wr.random=function(t,n,r){if(r&&"boolean"!=typeof r&&bo(t,n,r)&&(n=r=i),r===i&&("boolean"==typeof n?(r=n,n=i):"boolean"==typeof t&&(r=t,t=i)),t===i&&n===i?(t=0,n=1):(t=da(t),n===i?(n=t,t=0):n=da(n)),t>n){var e=t;t=n,n=e}if(r||t%1||n%1){var o=Ar();return wr(t+o*(n-t+hn("1e-"+((o+"").length-1))),n)}return Ke(t,n)},Wr.reduce=function(t,n,r){var e=Ju(t)?Un:Vn,i=arguments.length<3;return e(t,fo(n,4),r,i,pe)},Wr.reduceRight=function(t,n,r){var e=Ju(t)?Pn:Vn,i=arguments.length<3;return e(t,fo(n,4),r,i,de)},Wr.repeat=function(t,n,r){return n=(r?bo(t,n,r):n===i)?1:va(n),Ve(ma(t),n)},Wr.replace=function(){var t=arguments,n=ma(t[0]);return t.length<3?n:n.replace(t[1],t[2])},Wr.result=function(t,n,r){var e=-1,o=(n=wi(n,t)).length;for(o||(o=1,t=i);++e<o;){var u=null==t?i:t[Uo(n[e])];u===i&&(e=o,u=r),t=Qu(u)?u.call(t):u}return t},Wr.round=Ec,Wr.runInContext=t,Wr.sample=function(t){return(Ju(t)?Qr:Qe)(t)},Wr.size=function(t){if(null==t)return 0;if(Gu(t))return ca(t)?dr(t):t.length;var n=go(t);return n==j||n==R?t.size:Le(t).length},Wr.snakeCase=Ha,Wr.some=function(t,n,r){var e=Ju(t)?Mn:oi;return r&&bo(t,n,r)&&(n=i),e(t,fo(n,3))},Wr.sortedIndex=function(t,n){return ui(t,n)},Wr.sortedIndexBy=function(t,n,r){return ai(t,n,fo(r,2))},Wr.sortedIndexOf=function(t,n){var r=null==t?0:t.length;if(r){var e=ui(t,n);if(e<r&&Wu(t[e],n))return e}return-1},Wr.sortedLastIndex=function(t,n){return ui(t,n,!0)},Wr.sortedLastIndexBy=function(t,n,r){return ai(t,n,fo(r,2),!0)},Wr.sortedLastIndexOf=function(t,n){if(null==t?0:t.length){var r=ui(t,n,!0)-1;if(Wu(t[r],n))return r}return-1},Wr.startCase=Ka,Wr.startsWith=function(t,n,r){return t=ma(t),r=null==r?0:ce(va(r),0,t.length),n=si(n),t.slice(r,r+n.length)==n},Wr.subtract=jc,Wr.sum=function(t){return t&&t.length?Xn(t,ic):0},Wr.sumBy=function(t,n){return t&&t.length?Xn(t,fo(n,2)):0},Wr.template=function(t,n,r){var e=Wr.templateSettings;r&&bo(t,n,r)&&(n=i),t=ma(t),n=xa({},n,e,Yi);var o,u,a=xa({},n.imports,e.imports,Yi),c=za(a),f=nr(a,c),s=0,l=n.interpolate||xt,h="__p += '",p=kt((n.escape||xt).source+"|"+l.source+"|"+(l===tt?dt:xt).source+"|"+(n.evaluate||xt).source+"|$","g"),d="//# sourceURL="+(Tt.call(n,"sourceURL")?(n.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++cn+"]")+"\n";t.replace(p,(function(n,r,e,i,a,c){return e||(e=i),h+=t.slice(s,c).replace(At,ar),r&&(o=!0,h+="' +\n__e("+r+") +\n'"),a&&(u=!0,h+="';\n"+a+";\n__p += '"),e&&(h+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),s=c+n.length,n})),h+="';\n";var v=Tt.call(n,"variable")&&n.variable;if(v){if(ht.test(v))throw new Et("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(u?h.replace(J,""):h).replace(Z,"$1").replace(G,"$1;"),h="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Ya((function(){return jt(c,d+"return "+h).apply(i,f)}));if(g.source=h,Xu(g))throw g;return g},Wr.times=function(t,n){if((t=va(t))<1||t>d)return[];var r=g,e=wr(t,g);n=fo(n),t-=g;for(var i=Qn(e,n);++r<t;)n(r);return i},Wr.toFinite=da,Wr.toInteger=va,Wr.toLength=ga,Wr.toLower=function(t){return ma(t).toLowerCase()},Wr.toNumber=ya,Wr.toSafeInteger=function(t){return t?ce(va(t),-9007199254740991,d):0===t?t:0},Wr.toString=ma,Wr.toUpper=function(t){return ma(t).toUpperCase()},Wr.trim=function(t,n,r){if((t=ma(t))&&(r||n===i))return Yn(t);if(!t||!(n=si(n)))return t;var e=vr(t),o=vr(n);return xi(e,er(e,o),ir(e,o)+1).join("")},Wr.trimEnd=function(t,n,r){if((t=ma(t))&&(r||n===i))return t.slice(0,gr(t)+1);if(!t||!(n=si(n)))return t;var e=vr(t);return xi(e,0,ir(e,vr(n))+1).join("")},Wr.trimStart=function(t,n,r){if((t=ma(t))&&(r||n===i))return t.replace(ut,"");if(!t||!(n=si(n)))return t;var e=vr(t);return xi(e,er(e,vr(n))).join("")},Wr.truncate=function(t,n){var r=30,e="...";if(na(n)){var o="separator"in n?n.separator:o;r="length"in n?va(n.length):r,e="omission"in n?si(n.omission):e}var u=(t=ma(t)).length;if(cr(t)){var a=vr(t);u=a.length}if(r>=u)return t;var c=r-dr(e);if(c<1)return e;var f=a?xi(a,0,c).join(""):t.slice(0,c);if(o===i)return f+e;if(a&&(c+=f.length-c),ua(o)){if(t.slice(c).search(o)){var s,l=f;for(o.global||(o=kt(o.source,ma(vt.exec(o))+"g")),o.lastIndex=0;s=o.exec(l);)var h=s.index;f=f.slice(0,h===i?c:h)}}else if(t.indexOf(si(o),c)!=c){var p=f.lastIndexOf(o);p>-1&&(f=f.slice(0,p))}return f+e},Wr.unescape=function(t){return(t=ma(t))&&V.test(t)?t.replace(H,yr):t},Wr.uniqueId=function(t){var n=++Lt;return ma(t)+n},Wr.upperCase=Va,Wr.upperFirst=Xa,Wr.each=mu,Wr.eachRight=wu,Wr.first=Go,cc(Wr,(xc={},be(Wr,(function(t,n){Tt.call(Wr.prototype,n)||(xc[n]=t)})),xc),{chain:!1}),Wr.VERSION="4.17.21",Rn(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Wr[t].placeholder=Wr})),Rn(["drop","take"],(function(t,n){Jr.prototype[t]=function(r){r=r===i?1:mr(va(r),0);var e=this.__filtered__&&!n?new Jr(this):this.clone();return e.__filtered__?e.__takeCount__=wr(r,e.__takeCount__):e.__views__.push({size:wr(r,g),type:t+(e.__dir__<0?"Right":"")}),e},Jr.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}})),Rn(["filter","map","takeWhile"],(function(t,n){var r=n+1,e=1==r||3==r;Jr.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:fo(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}})),Rn(["head","last"],(function(t,n){var r="take"+(n?"Right":"");Jr.prototype[t]=function(){return this[r](1).value()[0]}})),Rn(["initial","tail"],(function(t,n){var r="drop"+(n?"":"Right");Jr.prototype[t]=function(){return this.__filtered__?new Jr(this):this[r](1)}})),Jr.prototype.compact=function(){return this.filter(ic)},Jr.prototype.find=function(t){return this.filter(t).head()},Jr.prototype.findLast=function(t){return this.reverse().find(t)},Jr.prototype.invokeMap=Xe((function(t,n){return"function"==typeof t?new Jr(this):this.map((function(r){return Ce(r,t,n)}))})),Jr.prototype.reject=function(t){return this.filter(Tu(fo(t)))},Jr.prototype.slice=function(t,n){t=va(t);var r=this;return r.__filtered__&&(t>0||n<0)?new Jr(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==i&&(r=(n=va(n))<0?r.dropRight(-n):r.take(n-t)),r)},Jr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Jr.prototype.toArray=function(){return this.take(g)},be(Jr.prototype,(function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),o=Wr[e?"take"+("last"==n?"Right":""):n],u=e||/^find/.test(n);o&&(Wr.prototype[n]=function(){var n=this.__wrapped__,a=e?[1]:arguments,c=n instanceof Jr,f=a[0],s=c||Ju(n),l=function(t){var n=o.apply(Wr,Ln([t],a));return e&&h?n[0]:n};s&&r&&"function"==typeof f&&1!=f.length&&(c=s=!1);var h=this.__chain__,p=!!this.__actions__.length,d=u&&!h,v=c&&!p;if(!u&&s){n=v?n:new Jr(this);var g=t.apply(n,a);return g.__actions__.push({func:du,args:[l],thisArg:i}),new qr(g,h)}return d&&v?t.apply(this,a):(g=this.thru(l),d?e?g.value()[0]:g.value():g)})})),Rn(["pop","push","shift","sort","splice","unshift"],(function(t){var n=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t);Wr.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var i=this.value();return n.apply(Ju(i)?i:[],t)}return this[r]((function(r){return n.apply(Ju(r)?r:[],t)}))}})),be(Jr.prototype,(function(t,n){var r=Wr[n];if(r){var e=r.name+"";Tt.call(zr,e)||(zr[e]=[]),zr[e].push({name:n,func:r})}})),zr[Wi(i,2).name]=[{name:"wrapper",func:i}],Jr.prototype.clone=function(){var t=new Jr(this.__wrapped__);return t.__actions__=Ri(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ri(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ri(this.__views__),t},Jr.prototype.reverse=function(){if(this.__filtered__){var t=new Jr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Jr.prototype.value=function(){var t=this.__wrapped__.value(),n=this.__dir__,r=Ju(t),e=n<0,i=r?t.length:0,o=function(t,n,r){var e=-1,i=r.length;for(;++e<i;){var o=r[e],u=o.size;switch(o.type){case"drop":t+=u;break;case"dropRight":n-=u;break;case"take":n=wr(n,t+u);break;case"takeRight":t=mr(t,n-u)}}return{start:t,end:n}}(0,i,this.__views__),u=o.start,a=o.end,c=a-u,f=e?a:u-1,s=this.__iteratees__,l=s.length,h=0,p=wr(c,this.__takeCount__);if(!r||!e&&i==c&&p==c)return vi(t,this.__actions__);var d=[];t:for(;c--&&h<p;){for(var v=-1,g=t[f+=n];++v<l;){var y=s[v],_=y.iteratee,m=y.type,w=_(g);if(2==m)g=w;else if(!w){if(1==m)continue t;break t}}d[h++]=g}return d},Wr.prototype.at=vu,Wr.prototype.chain=function(){return pu(this)},Wr.prototype.commit=function(){return new qr(this.value(),this.__chain__)},Wr.prototype.next=function(){this.__values__===i&&(this.__values__=pa(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?i:this.__values__[this.__index__++]}},Wr.prototype.plant=function(t){for(var n,r=this;r instanceof Fr;){var e=Mo(r);e.__index__=0,e.__values__=i,n?o.__wrapped__=e:n=e;var o=e;r=r.__wrapped__}return o.__wrapped__=t,n},Wr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Jr){var n=t;return this.__actions__.length&&(n=new Jr(this)),(n=n.reverse()).__actions__.push({func:du,args:[nu],thisArg:i}),new qr(n,this.__chain__)}return this.thru(nu)},Wr.prototype.toJSON=Wr.prototype.valueOf=Wr.prototype.value=function(){return vi(this.__wrapped__,this.__actions__)},Wr.prototype.first=Wr.prototype.head,Qt&&(Wr.prototype[Qt]=function(){return this}),Wr}();gn._=_r,(e=function(){return _r}.call(n,r,n,t))===i||(t.exports=e)}.call(this)},836:t=>{t.exports=u,u.default=u,u.stable=s,u.stableStringify=s;var n="[...]",r="[Circular]",e=[],i=[];function o(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function u(t,n,r,u){var a;void 0===u&&(u=o()),c(t,"",0,[],void 0,0,u);try{a=0===i.length?JSON.stringify(t,n,r):JSON.stringify(t,h(n),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==e.length;){var f=e.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function a(t,n,r,o){var u=Object.getOwnPropertyDescriptor(o,r);void 0!==u.get?u.configurable?(Object.defineProperty(o,r,{value:t}),e.push([o,r,n,u])):i.push([n,r,t]):(o[r]=t,e.push([o,r,n]))}function c(t,e,i,o,u,f,s){var l;if(f+=1,"object"==typeof t&&null!==t){for(l=0;l<o.length;l++)if(o[l]===t)return void a(r,t,e,u);if(void 0!==s.depthLimit&&f>s.depthLimit)return void a(n,t,e,u);if(void 0!==s.edgesLimit&&i+1>s.edgesLimit)return void a(n,t,e,u);if(o.push(t),Array.isArray(t))for(l=0;l<t.length;l++)c(t[l],l,l,o,t,f,s);else{var h=Object.keys(t);for(l=0;l<h.length;l++){var p=h[l];c(t[p],p,l,o,t,f,s)}}o.pop()}}function f(t,n){return t<n?-1:t>n?1:0}function s(t,n,r,u){void 0===u&&(u=o());var a,c=l(t,"",0,[],void 0,0,u)||t;try{a=0===i.length?JSON.stringify(c,n,r):JSON.stringify(c,h(n),r)}catch(t){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==e.length;){var f=e.pop();4===f.length?Object.defineProperty(f[0],f[1],f[3]):f[0][f[1]]=f[2]}}return a}function l(t,i,o,u,c,s,h){var p;if(s+=1,"object"==typeof t&&null!==t){for(p=0;p<u.length;p++)if(u[p]===t)return void a(r,t,i,c);try{if("function"==typeof t.toJSON)return}catch(t){return}if(void 0!==h.depthLimit&&s>h.depthLimit)return void a(n,t,i,c);if(void 0!==h.edgesLimit&&o+1>h.edgesLimit)return void a(n,t,i,c);if(u.push(t),Array.isArray(t))for(p=0;p<t.length;p++)l(t[p],p,p,u,t,s,h);else{var d={},v=Object.keys(t).sort(f);for(p=0;p<v.length;p++){var g=v[p];l(t[g],g,p,u,t,s,h),d[g]=t[g]}if(void 0===c)return d;e.push([c,i,t]),c[i]=d}u.pop()}}function h(t){return t=void 0!==t?t:function(t,n){return n},function(n,r){if(i.length>0)for(var e=0;e<i.length;e++){var o=i[e];if(o[1]===n&&o[0]===r){r=o[2],i.splice(e,1);break}}return t.call(this,n,r)}}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.d=(t,n)=>{for(var e in n)r.o(n,e)&&!r.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:n[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var e={};(()=>{"use strict";function t(t){return Boolean(t)&&"object"==typeof t&&!Array.isArray(t)}r.r(e),r.d(e,{onRpcRequest:()=>gr});const n=(t,n)=>Object.hasOwnProperty.call(t,n);var i;!function(t){t[t.Null=4]="Null",t[t.Comma=1]="Comma",t[t.Wrapper=1]="Wrapper",t[t.True=4]="True",t[t.False=5]="False",t[t.Quote=1]="Quote",t[t.Colon=1]="Colon",t[t.Date=24]="Date"}(i=i||(i={}));var o=r(836);class u extends TypeError{constructor(t,n){let r;const{message:e,explanation:i,...o}=t,{path:u}=t,a=0===u.length?e:`At path: ${u.join(".")} -- ${e}`;super(i??a),null!=i&&(this.cause=a),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>r??(r=[t,...n()])}}function a(t){return"object"==typeof t&&null!==t}function c(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function f(t,n,r,e){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:i,branch:o}=n,{type:u}=r,{refinement:a,message:f=`Expected a value of type \`${u}\`${a?` with refinement \`${a}\``:""}, but received: \`${c(e)}\``}=t;return{value:e,type:u,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:f}}function*s(t,n,r,e){(function(t){return a(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const i of t){const t=f(i,n,r,e);t&&(yield t)}}function*l(t,n,r={}){const{path:e=[],branch:i=[t],coerce:o=!1,mask:u=!1}=r,c={path:e,branch:i};if(o&&(t=n.coercer(t,c),u&&"type"!==n.type&&a(n.schema)&&a(t)&&!Array.isArray(t)))for(const r in t)void 0===n.schema[r]&&delete t[r];let f="valid";for(const e of n.validator(t,c))e.explanation=r.message,f="not_valid",yield[e,void 0];for(let[s,h,p]of n.entries(t,c)){const n=l(h,p,{path:void 0===s?e:[...e,s],branch:void 0===s?i:[...i,h],coerce:o,mask:u,message:r.message});for(const r of n)r[0]?(f=null===r[0].refinement||void 0===r[0].refinement?"not_valid":"not_refined",yield[r[0],void 0]):o&&(h=r[1],void 0===s?t=h:t instanceof Map?t.set(s,h):t instanceof Set?t.add(h):a(t)&&(void 0!==h||s in t)&&(t[s]=h))}if("not_valid"!==f)for(const e of n.refiner(t,c))e.explanation=r.message,f="not_refined",yield[e,void 0];"valid"===f&&(yield[void 0,t])}class h{constructor(t){const{type:n,schema:r,validator:e,refiner:i,coercer:o=t=>t,entries:u=function*(){}}=t;this.type=n,this.schema=r,this.entries=u,this.coercer=o,this.validator=e?(t,n)=>s(e(t,n),n,this,t):()=>[],this.refiner=i?(t,n)=>s(i(t,n),n,this,t):()=>[]}assert(t,n){return function(t,n,r){const e=y(t,n,{message:r});if(e[0])throw e[0]}(t,this,n)}create(t,n){return v(t,this,n)}is(t){return g(t,this)}mask(t,n){return function(t,n,r){const e=y(t,n,{coerce:!0,mask:!0,message:r});if(e[0])throw e[0];return e[1]}(t,this,n)}validate(t,n={}){return y(t,this,n)}}const p="EXACT_OPTIONAL";class d extends h{constructor(t){super({...t,type:`exact optional ${t.type}`}),this.brand=p}static isExactOptional(t){return a(t)&&"brand"in t&&t.brand===p}}function v(t,n,r){const e=y(t,n,{coerce:!0,message:r});if(e[0])throw e[0];return e[1]}function g(t,n){return!y(t,n)[0]}function y(t,n,r={}){const e=l(t,n,r),i=function(t){const{done:n,value:r}=t.next();return n?void 0:r}(e);if(i[0]){return[new u(i[0],(function*(){for(const t of e)t[0]&&(yield t[0])})),void 0]}return[void 0,i[1]]}function _(t,n){return new h({type:t,schema:null,validator:n})}function m(){return _("never",(()=>!1))}function w(t){const n=t?Object.keys(t):[],r=m();return new h({type:"object",schema:t??null,*entries(e){if(t&&a(e)){const i=new Set(Object.keys(e));for(const r of n){i.delete(r);const n=t[r];d.isExactOptional(n)&&!Object.prototype.hasOwnProperty.call(e,r)||(yield[r,e[r],t[r]])}for(const t of i)yield[t,e[t],r]}},validator:t=>a(t)||`Expected an object, but received: ${c(t)}`,coercer:t=>a(t)?{...t}:t})}function b(t){return new h({...t,validator:(n,r)=>void 0===n||t.validator(n,r),refiner:(n,r)=>void 0===n||t.refiner(n,r)})}function x(){return _("string",(t=>"string"==typeof t||`Expected a string, but received: ${c(t)}`))}function A(t){const n=t.map((t=>t.type)).join(" | ");return new h({type:"union",schema:null,coercer(n){for(const r of t){const[t,e]=r.validate(n,{coerce:!0});if(!t)return e}return n},validator(r,e){const i=[];for(const n of t){const[...t]=l(r,n,e),[o]=t;if(!o?.[0])return[];for(const[n]of t)n&&i.push(n)}return[`Expected the value to satisfy a union of \`${n}\`, but received: ${c(r)}`,...i]}})}function E(t,n,r){return new h({...t,coercer:(e,i)=>g(e,n)?t.coercer(r(e,i),i):t.coercer(e,i)})}function j(t,n){return I(t,"pattern",(r=>n.test(r)||`Expected a ${t.type} matching \`/${n.source}/\` but received "${r}"`))}function I(t,n,r){return new h({...t,*refiner(e,i){yield*t.refiner(e,i);const o=s(r(e,i),i,t,e);for(const t of o)yield{...t,refinement:n}}})}const O=t=>w(t);function k({path:t,branch:r}){const e=t[t.length-1];return n(r[r.length-2],e)}function S(t){return new h({...t,type:`optional ${t.type}`,validator:(n,r)=>!k(r)||t.validator(n,r),refiner:(n,r)=>!k(r)||t.refiner(n,r)})}function R(t){if(null===t||"boolean"==typeof t||"string"==typeof t)return!0;if("number"==typeof t&&Number.isFinite(t))return!0;if("object"==typeof t){let n=!0;if(Array.isArray(t)){for(let r=0;r<t.length;r++)if(!R(t[r])){n=!1;break}return n}const r=Object.entries(t);for(let t=0;t<r.length;t++)if("string"!=typeof r[t][0]||!R(r[t][1])){n=!1;break}return n}return!1}const C=_("JSON",(t=>R(t))),z=E(C,I(_("any",(()=>!0)),"JSON",(t=>g(t,C))),(t=>JSON.parse(JSON.stringify(t,((t,n)=>{if("__proto__"!==t&&"constructor"!==t)return n})))));function N(t){try{return function(t){v(t,z)}(t),!0}catch{return!1}}const $=function(t){const n=c(t),r=typeof t;return new h({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?t:null,validator:r=>r===t||`Expected the literal \`${n}\`, but received: ${c(r)}`})}("2.0"),B=(T=A([_("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${c(t)}`)),x()]),new h({...T,validator:(t,n)=>null===t||T.validator(t,n),refiner:(t,n)=>null===t||T.refiner(t,n)}));var T;const L=O({code:_("integer",(t=>"number"==typeof t&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${c(t)}`)),message:x(),data:S(z),stack:S(x())}),U=A([(M=x(),W=z,new h({type:"record",schema:null,*entries(t){if(a(t))for(const n in t){const r=t[n];yield[n,n,M],yield[n,r,W]}},validator:t=>a(t)||`Expected an object, but received: ${c(t)}`})),(P=z,new h({type:"array",schema:P,*entries(t){if(P&&Array.isArray(t))for(const[n,r]of t.entries())yield[n,r,P]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${c(t)}`}))]);var P,M,W;O({id:B,jsonrpc:$,method:x(),params:S(U)}),O({jsonrpc:$,method:x(),params:S(U)});w({id:B,jsonrpc:$,result:b(_("unknown",(()=>!0))),error:b(L)});const D=O({id:B,jsonrpc:$,result:z}),F=O({id:B,jsonrpc:$,error:L});A([D,F]);const q={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},J={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},Z={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},G=q.internal,H=(K(G),"Unspecified server error.");function K(t,r="Unspecified error message. This is a bug, please report it."){if(function(t){return Number.isInteger(t)}(t)){const r=t.toString();if(n(Z,r))return Z[r].message;if(function(t){return t>=-32099&&t<=-32e3}(t))return H}return r}function V(n){return Array.isArray(n)?n.map((n=>N(n)?n:t(n)?X(n):null)):t(n)?X(n):N(n)?n:null}function X(t){return Object.getOwnPropertyNames(t).reduce(((n,r)=>{const e=t[r];return N(e)&&(n[r]=e),n}),{})}const Q=function(t){return t?.__esModule?t.default:t}(o);class Y extends Error{constructor(r,e,i){if(!Number.isInteger(r))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a non-empty string.');!function(r){return t(r)&&n(r,"cause")&&t(r.cause)}(i)?super(e):(super(e,{cause:i.cause}),n(this,"cause")||Object.assign(this,{cause:i.cause})),void 0!==i&&(this.data=i),this.code=r}serialize(){const t={code:this.code,message:this.message};return void 0!==this.data&&(t.data=this.data,function(t){if("object"!=typeof t||null===t)return!1;try{let n=t;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(t)===n}catch(t){return!1}}(this.data)&&(t.data.cause=V(this.data.cause))),this.stack&&(t.stack=this.stack),t}toString(){return Q(this.serialize(),nt,2)}}class tt extends Y{constructor(t,n,r){if(!function(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,n,r)}}function nt(t,n){if("[Circular]"!==n)return n}const rt=t=>_t(q.parse,t),et=t=>_t(q.invalidRequest,t),it=t=>_t(q.invalidParams,t),ot=t=>_t(q.methodNotFound,t),ut=t=>_t(q.internal,t),at=t=>_t(q.invalidInput,t),ct=t=>_t(q.resourceNotFound,t),ft=t=>_t(q.resourceUnavailable,t),st=t=>_t(q.transactionRejected,t),lt=t=>_t(q.methodNotSupported,t),ht=t=>_t(q.limitExceeded,t),pt=t=>mt(J.userRejectedRequest,t),dt=t=>mt(J.unauthorized,t),vt=t=>mt(J.unsupportedMethod,t),gt=t=>mt(J.disconnected,t),yt=t=>mt(J.chainDisconnected,t);function _t(t,n){const[r,e]=wt(n);return new Y(t,r??K(t),e)}function mt(t,n){const[r,e]=wt(n);return new tt(t,r??K(t),e)}function wt(t){if(t){if("string"==typeof t)return[t];if("object"==typeof t&&!Array.isArray(t)){const{message:n,data:r}=t;if(n&&"string"!=typeof n)throw new Error("Must specify string message.");return[n??void 0,r]}}return[]}function bt(r,e,i=null){return t(r)&&n(r,e)?r[e]:i}function xt(t,n,r=String(t)){const e=bt(t,n);return"string"==typeof e?e:r}function At(t){const n=bt(t,"data");return null!==n&&N(n)&&!Array.isArray(n)?n:{}}class Et extends Error{#t;#n;#r;#e;constructor(t,n={}){const r=function(t){return xt(t,"message")}(t);super(r),this.#n=r,this.#t=function(t){const n=bt(t,"code");return"number"==typeof n&&Number.isInteger(n)?n:-32603}(t);const e={...At(t),...n};Object.keys(e).length>0&&(this.#r=e),this.#e=super.stack}get name(){return"SnapError"}get code(){return this.#t}get message(){return this.#n}get data(){return this.#r}get stack(){return this.#e}toJSON(){return{code:-31002,message:"Snap Error",data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function jt(t){return class extends Et{constructor(n,r){if("object"==typeof n){const r=t();return void super({code:r.code,message:r.message,data:n})}const e=t(n);super({code:e.code,message:e.message,data:r})}}}jt(ut),jt(at),jt(it),jt(et),jt(ht);const It=jt(ot),Ot=jt(lt);jt(rt),jt(ct),jt(ft),jt(st),jt(yt),jt(gt),jt(dt),jt(vt),jt(pt);function kt(t,n){return _(t,(t=>"string"==typeof t&&n.test(t)))}const St=/^(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})$/u,Rt=/^[-a-z0-9]{3,8}$/u,Ct=/^[-_a-zA-Z0-9]{1,32}$/u,zt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32})):(?<accountAddress>[-.%a-zA-Z0-9]{1,128})$/u,Nt=/^[-.%a-zA-Z0-9]{1,128}$/u,$t=/^[-a-z0-9]{3,8}$/u,Bt=/^[-.%a-zA-Z0-9]{1,128}$/u,Tt=/^[-.%a-zA-Z0-9]{1,78}$/u,Lt=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})$/u,Ut=/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})\/(?<tokenId>[-.%a-zA-Z0-9]{1,78})$/u;kt("CaipChainId",St),kt("CaipNamespace",Rt),kt("CaipReference",Ct),kt("CaipAccountId",zt),kt("CaipAccountAddress",Nt),kt("CaipAssetNamespace",$t),kt("CaipAssetReference",Bt),kt("CaipTokenId",Tt),kt("CaipAssetType",Lt),kt("CaipAssetId",Ut),kt("CaipAssetTypeOrId",/^(?<chainId>(?<namespace>[-a-z0-9]{3,8}):(?<reference>[-_a-zA-Z0-9]{1,32}))\/(?<assetNamespace>[-a-z0-9]{3,8}):(?<assetReference>[-.%a-zA-Z0-9]{1,128})(\/(?<tokenId>[-.%a-zA-Z0-9]{1,78}))?$/u);var Pt;function Mt(t){const n=zt.exec(t);if(!n?.groups)throw new Error("Invalid CAIP account ID.");return{address:n.groups.accountAddress,chainId:n.groups.chainId,chain:{namespace:n.groups.namespace,reference:n.groups.reference}}}function Wt(t,n){return r=t,Boolean("string"==typeof r?.prototype?.constructor?.name)?new t({message:n}):t({message:n});var r}!function(t){t.Bip122="bip122",t.Solana="solana",t.Tron="tron",t.Eip155="eip155",t.Wallet="wallet"}(Pt=Pt||(Pt={}));class Dt extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}function Ft(t,n="Assertion failed.",r=Dt){if(!t){if(n instanceof Error)throw n;throw Wt(r,n)}}function qt(t){if(!Number.isSafeInteger(t))throw new Error(`Wrong integer: ${t}`)}function Jt(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function Zt(...t){const n=t=>t,r=(t,n)=>r=>t(n(r));return{encode:t.map((t=>t.encode)).reduceRight(r,n),decode:t.map((t=>t.decode)).reduce(r,n)}}function Gt(t){return{encode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("alphabet.encode input should be an array of numbers");return n.map((n=>{if(qt(n),n<0||n>=t.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);return t[n]}))},decode:n=>{if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("alphabet.decode input should be array of strings");return n.map((n=>{if("string"!=typeof n)throw new Error(`alphabet.decode: not string element=${n}`);const r=t.indexOf(n);if(-1===r)throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);return r}))}}}function Ht(t=""){if("string"!=typeof t)throw new Error("join separator should be string");return{encode:n=>{if(!Array.isArray(n)||n.length&&"string"!=typeof n[0])throw new Error("join.encode input should be array of strings");for(let t of n)if("string"!=typeof t)throw new Error(`join.encode: non-string input=${t}`);return n.join(t)},decode:n=>{if("string"!=typeof n)throw new Error("join.decode input should be string");return n.split(t)}}}function Kt(t,n="="){if(qt(t),"string"!=typeof n)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.encode: non-string input=${t}`);for(;r.length*t%8;)r.push(n);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let t of r)if("string"!=typeof t)throw new Error(`padding.decode: non-string input=${t}`);let e=r.length;if(e*t%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;e>0&&r[e-1]===n;e--)if(!((e-1)*t%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,e)}}}function Vt(t){if("function"!=typeof t)throw new Error("normalize fn should be function");return{encode:t=>t,decode:n=>t(n)}}function Xt(t,n,r){if(n<2)throw new Error(`convertRadix: wrong from=${n}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(t))throw new Error("convertRadix: data should be array");if(!t.length)return[];let e=0;const i=[],o=Array.from(t);for(o.forEach((t=>{if(qt(t),t<0||t>=n)throw new Error(`Wrong integer: ${t}`)}));;){let t=0,u=!0;for(let i=e;i<o.length;i++){const a=o[i],c=n*t+a;if(!Number.isSafeInteger(c)||n*t/n!==t||c-a!=n*t)throw new Error("convertRadix: carry overflow");t=c%r;const f=Math.floor(c/r);if(o[i]=f,!Number.isSafeInteger(f)||f*r+t!==c)throw new Error("convertRadix: carry overflow");u&&(f?u=!1:e=i)}if(i.push(t),u)break}for(let n=0;n<t.length-1&&0===t[n];n++)i.push(0);return i.reverse()}const Qt=(t,n)=>n?Qt(n,t%n):t,Yt=(t,n)=>t+(n-Qt(t,n));function tn(t,n,r,e){if(!Array.isArray(t))throw new Error("convertRadix2: data should be array");if(n<=0||n>32)throw new Error(`convertRadix2: wrong from=${n}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(Yt(n,r)>32)throw new Error(`convertRadix2: carry overflow from=${n} to=${r} carryBits=${Yt(n,r)}`);let i=0,o=0;const u=2**r-1,a=[];for(const e of t){if(qt(e),e>=2**n)throw new Error(`convertRadix2: invalid data word=${e} from=${n}`);if(i=i<<n|e,o+n>32)throw new Error(`convertRadix2: carry overflow pos=${o} from=${n}`);for(o+=n;o>=r;o-=r)a.push((i>>o-r&u)>>>0);i&=2**o-1}if(i=i<<r-o&u,!e&&o>=n)throw new Error("Excess padding");if(!e&&i)throw new Error(`Non-zero padding: ${i}`);return e&&o>0&&a.push(i>>>0),a}function nn(t){return qt(t),{encode:n=>{if(!Jt(n))throw new Error("radix.encode input should be Uint8Array");return Xt(Array.from(n),256,t)},decode:n=>{if(!Array.isArray(n)||n.length&&"number"!=typeof n[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(Xt(n,t,256))}}}function rn(t,n=!1){if(qt(t),t<=0||t>32)throw new Error("radix2: bits should be in (0..32]");if(Yt(8,t)>32||Yt(t,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!Jt(r))throw new Error("radix2.encode input should be Uint8Array");return tn(Array.from(r),8,t,!n)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(tn(r,t,8,n))}}}const en=Zt(rn(4),Gt("0123456789ABCDEF"),Ht("")),on=Zt(rn(5),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Kt(5),Ht("")),un=(Zt(rn(5),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ht("")),Zt(rn(5),Gt("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Kt(5),Ht("")),Zt(rn(5),Gt("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ht("")),Zt(rn(5),Gt("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Ht(""),Vt((t=>t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),Zt(rn(6),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Kt(6),Ht(""))),an=(Zt(rn(6),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ht("")),Zt(rn(6),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Kt(6),Ht(""))),cn=(Zt(rn(6),Gt("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ht("")),t=>Zt(nn(58),Gt(t),Ht(""))),fn=cn("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),sn=[0,2,3,5,6,7,9,10,11],ln={encode(t){let n="";for(let r=0;r<t.length;r+=8){const e=t.subarray(r,r+8);n+=fn.encode(e).padStart(sn[e.length],"1")}return n},decode(t){let n=[];for(let r=0;r<t.length;r+=11){const e=t.slice(r,r+11),i=sn.indexOf(e.length),o=fn.decode(e);for(let t=0;t<o.length-i;t++)if(0!==o[t])throw new Error("base58xmr: wrong padding");n=n.concat(Array.from(o.slice(o.length-i)))}return Uint8Array.from(n)}};Zt(Gt("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Ht(""));const hn={encode:t=>(new TextDecoder).decode(t),decode:t=>(new TextEncoder).encode(t)},pn=(Zt(rn(4),Gt("0123456789abcdef"),Ht(""),Vt((t=>{if("string"!=typeof t||t.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof t} with length ${t.length}`);return t.toLowerCase()}))),BigInt(2**32-1)),dn=BigInt(32);function vn(t,n=!1){return n?{h:Number(t&pn),l:Number(t>>dn&pn)}:{h:0|Number(t>>dn&pn),l:0|Number(t&pn)}}function gn(t,n=!1){const r=t.length;let e=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:u}=vn(t[o],n);[e[o],i[o]]=[r,u]}return[e,i]}const yn=(t,n,r)=>t<<r|n>>>32-r,_n=(t,n,r)=>n<<r|t>>>32-r,mn=(t,n,r)=>n<<r-32|t>>>64-r,wn=(t,n,r)=>t<<r-32|n>>>64-r;function bn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function xn(t,...n){if(!((r=t)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(n.length>0&&!n.includes(t.length))throw new Error("Uint8Array expected of length "+n+", got length="+t.length)}function An(t,n=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(n&&t.finished)throw new Error("Hash#digest() has already been called")}function En(...t){for(let n=0;n<t.length;n++)t[n].fill(0)}const jn=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];function In(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const On=jn?t=>t:function(t){for(let n=0;n<t.length;n++)t[n]=In(t[n]);return t};Array.from({length:256},((t,n)=>n.toString(16).padStart(2,"0")));function kn(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))}function Sn(t){return"string"==typeof t&&(t=kn(t)),xn(t),t}class Rn{}function Cn(t){const n=n=>t().update(Sn(n)).digest(),r=t();return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=()=>t(),n}const zn=BigInt(0),Nn=BigInt(1),$n=BigInt(2),Bn=BigInt(7),Tn=BigInt(256),Ln=BigInt(113),Un=[],Pn=[],Mn=[];for(let t=0,n=Nn,r=1,e=0;t<24;t++){[r,e]=[e,(2*r+3*e)%5],Un.push(2*(5*e+r)),Pn.push((t+1)*(t+2)/2%64);let i=zn;for(let t=0;t<7;t++)n=(n<<Nn^(n>>Bn)*Ln)%Tn,n&$n&&(i^=Nn<<(Nn<<BigInt(t))-Nn);Mn.push(i)}const Wn=gn(Mn,!0),Dn=Wn[0],Fn=Wn[1],qn=(t,n,r)=>r>32?mn(t,n,r):yn(t,n,r),Jn=(t,n,r)=>r>32?wn(t,n,r):_n(t,n,r);class Zn extends Rn{constructor(t,n,r,e=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=e,this.rounds=i,bn(r),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");var o;this.state=new Uint8Array(200),this.state32=(o=this.state,new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)))}clone(){return this._cloneInto()}keccak(){On(this.state32),function(t,n=24){const r=new Uint32Array(10);for(let e=24-n;e<24;e++){for(let n=0;n<10;n++)r[n]=t[n]^t[n+10]^t[n+20]^t[n+30]^t[n+40];for(let n=0;n<10;n+=2){const e=(n+8)%10,i=(n+2)%10,o=r[i],u=r[i+1],a=qn(o,u,1)^r[e],c=Jn(o,u,1)^r[e+1];for(let r=0;r<50;r+=10)t[n+r]^=a,t[n+r+1]^=c}let n=t[2],i=t[3];for(let r=0;r<24;r++){const e=Pn[r],o=qn(n,i,e),u=Jn(n,i,e),a=Un[r];n=t[a],i=t[a+1],t[a]=o,t[a+1]=u}for(let n=0;n<50;n+=10){for(let e=0;e<10;e++)r[e]=t[n+e];for(let e=0;e<10;e++)t[n+e]^=~r[(e+2)%10]&r[(e+4)%10]}t[0]^=Dn[e],t[1]^=Fn[e]}En(r)}(this.state32,this.rounds),On(this.state32),this.posOut=0,this.pos=0}update(t){An(this),xn(t=Sn(t));const{blockLen:n,state:r}=this,e=t.length;for(let i=0;i<e;){const o=Math.min(n-this.pos,e-i);for(let n=0;n<o;n++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:r,blockLen:e}=this;t[r]^=n,128&n&&r===e-1&&this.keccak(),t[e-1]^=128,this.keccak()}writeInto(t){An(this,!1),xn(t),this.finish();const n=this.state,{blockLen:r}=this;for(let e=0,i=t.length;e<i;){this.posOut>=r&&this.keccak();const o=Math.min(r-this.posOut,i-e);t.set(n.subarray(this.posOut,this.posOut+o),e),this.posOut+=o,e+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return bn(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,n){xn(t);const r=n.outputLen;if(t.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,En(this.state)}_cloneInto(t){const{blockLen:n,suffix:r,outputLen:e,rounds:i,enableXOF:o}=this;return t||(t=new Zn(n,r,e,o,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=e,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Gn=(t,n,r)=>Cn((()=>new Zn(n,t,r))),Hn=Gn(1,136,32);var Kn=r(76);const{memoize:Vn}=Kn,Xn=/^(?:0x)?[0-9a-f]+$/iu,Qn=/^0x[0-9a-f]+$/iu,Yn=/^0x[0-9a-f]{40}$/u,tr=/^0x[0-9a-fA-F]{40}$/u,nr=(j(x(),Xn),j(x(),Qn),j(x(),Yn),j(x(),tr),t=>"string"==typeof t);function rr(t){return nr(t)&&tr.test(t)}const er=Vn((function(t){Ft(rr(t),"Invalid hex address.");const n=function(t){if(t.startsWith("0x")||t.startsWith("0X"))return t.substring(2);return t}(t).toLowerCase(),r=Hn(n),{length:e}=n,i=new Array(e);for(let t=0;t<e;t++){const e=1&t,o=r[t>>1],u=0===e?o>>4:15&o;i[t]=u>=8?n[t].toUpperCase():n[t]}return`0x${i.join("")}`}));const ir=Vn((function(t){return!!rr(t)&&er(t)===t}));Vn((function(t){return nr(n=t)&&Yn.test(n)||ir(t);var n}));const or=function(){const t=[];return()=>{if(0===t.length)for(let n=0;n<256;n++)t.push(n.toString(16).padStart(2,"0"));return t}}();function ur(t){return t instanceof Uint8Array}function ar(t){Ft(ur(t),"Value must be a Uint8Array.")}function cr(t){if(ar(t),0===t.length)return"0x";const n=or(),r=new Array(t.length);for(let e=0;e<t.length;e++)r[e]=n[t[e]];return function(t){return t.startsWith("0x")?t:t.startsWith("0X")?`0x${t.substring(2)}`:`0x${t}`}(r.join(""))}function fr(t){return ar(t),un.encode(t)}function sr(t){return Ft("string"==typeof t,"Value must be a string."),(new TextEncoder).encode(t)}class lr{scope;constructor(t){this.scope=t}async invokeMethod(t){return await snap.request({method:"wallet_invokeMethod",params:{scope:this.scope,request:t}})}}class hr extends lr{async signMessage(t,n){const{address:r}=Mt(t);return await this.invokeMethod({method:"personal_sign",params:[cr(sr(n)),r]})}async signTypedData(t,n){const{chain:{reference:r},address:e}=Mt(t);return await this.invokeMethod({method:"eth_signTypedData_v4",params:[e,{types:{EIP712Domain:[{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}],Person:[{name:"name",type:"string"},{name:"wallet",type:"address"}],Mail:[{name:"from",type:"Person"},{name:"to",type:"Person"},{name:"contents",type:"string"}]},primaryType:"Mail",domain:{name:"Ether Mail",version:"1",chainId:BigInt(r).toString(10),verifyingContract:"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC"},message:{from:{name:"Snap",wallet:e},to:{name:"Bob",wallet:"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB"},contents:n}}]})}async getGenesisHash(){const t=await this.invokeMethod({method:"eth_getBlockByNumber",params:["0x0",!1]});return Ft(t,"Multichain API did not return a valid block."),t.hash}}class pr extends lr{async signMessage(t,n){const{address:r}=Mt(t),e=sr(n);return(await this.invokeMethod({method:"signMessage",params:{account:{address:r},message:fr(e)}})).signature}async signTypedData(t,n){throw new Ot}async getGenesisHash(){return await this.invokeMethod({method:"getGenesisHash"})}}async function dr(t){const n=await snap.request({method:"wallet_getSession"});return n.sessionScopes[t]?.accounts??[]}function vr(t){const{namespace:n}=function(t){const n=St.exec(t);if(!n?.groups)throw new Error("Invalid CAIP chain ID.");return{namespace:n.groups.namespace,reference:n.groups.reference}}(t);switch(n){case"eip155":return new hr(t);case"solana":return new pr(t);default:throw new Error(`${n} not supported.`)}}const gr=async({request:t})=>{const{scope:n="eip155:1"}=t.params??{},r=vr(n);switch(t.method){case"createSession":return await async function(){return await snap.request({method:"wallet_createSession",params:{optionalScopes:{"eip155:1":{methods:["personal_sign","eth_signTypedData_v4"],notifications:[],accounts:[]},"eip155:11155111":{methods:["personal_sign","eth_signTypedData_v4"],notifications:[],accounts:[]},"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":{methods:["signMessage","getGenesisHash"],notifications:[],accounts:[]}}}})}();case"revokeSession":return await async function(){return await snap.request({method:"wallet_revokeSession",params:{}})}();case"getChainId":return Ft(n.startsWith("eip155"),new Ot({method:t.method})),await r.invokeMethod({method:"eth_chainId"});case"getAccounts":return await dr(n);case"signMessage":{const e=t.params,i=await dr(n);return await r.signMessage(i[0],e.message)}case"signTypedData":{const e=t.params,i=await dr(n);return await r.signTypedData(i[0],e.message)}case"getGenesisHash":return await r.getGenesisHash();default:throw new It({method:t.method})}}})(),module.exports=e})();
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@metamask/multichain-provider-example-snap",
3
+ "version": "1.0.0",
4
+ "description": "MetaMask example Snap demonstrating the use of the Multichain Provider API and `endowment:multichain-provider` permission",
5
+ "keywords": [
6
+ "MetaMask",
7
+ "Snaps",
8
+ "Ethereum"
9
+ ],
10
+ "homepage": "https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/multichain-provider#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/MetaMask/snaps/issues"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/MetaMask/snaps.git"
17
+ },
18
+ "license": "(MIT-0 OR Apache-2.0)",
19
+ "sideEffects": false,
20
+ "main": "./dist/bundle.js",
21
+ "files": [
22
+ "dist",
23
+ "snap.manifest.json"
24
+ ],
25
+ "scripts": {
26
+ "build": "mm-snap build",
27
+ "build:clean": "yarn clean && yarn build",
28
+ "changelog:update": "../../../../scripts/update-changelog.sh @metamask/multichain-provider-example-snap",
29
+ "changelog:validate": "../../../../scripts/validate-changelog.sh @metamask/multichain-provider-example-snap",
30
+ "clean": "rimraf \"dist\"",
31
+ "lint": "yarn lint:eslint && yarn lint:misc --check && yarn changelog:validate && yarn lint:dependencies",
32
+ "lint:ci": "yarn lint",
33
+ "lint:dependencies": "depcheck",
34
+ "lint:eslint": "eslint . --cache",
35
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
36
+ "lint:misc": "prettier --no-error-on-unmatched-pattern --log-level warn \"**/*.json\" \"**/*.md\" \"**/*.html\" \"!CHANGELOG.md\" \"!snap.manifest.json\" --ignore-path ../../../../.gitignore",
37
+ "publish:preview": "yarn npm publish --tag preview",
38
+ "since-latest-release": "../../../../scripts/since-latest-release.sh",
39
+ "start": "mm-snap watch",
40
+ "test": "jest --reporters=jest-silent-reporter",
41
+ "test:clean": "jest --clearCache",
42
+ "test:verbose": "jest --verbose",
43
+ "test:watch": "jest --watch"
44
+ },
45
+ "dependencies": {
46
+ "@metamask/snaps-sdk": "^10.4.0",
47
+ "@metamask/utils": "^11.9.0"
48
+ },
49
+ "devDependencies": {
50
+ "@jest/globals": "^29.5.0",
51
+ "@lavamoat/allow-scripts": "^3.4.2",
52
+ "@metamask/auto-changelog": "^5.0.2",
53
+ "@metamask/snaps-cli": "^8.4.0",
54
+ "@metamask/snaps-jest": "^10.0.0",
55
+ "@swc/core": "1.11.31",
56
+ "@swc/jest": "^0.2.38",
57
+ "@types/node": "18.14.2",
58
+ "deepmerge": "^4.2.2",
59
+ "depcheck": "^1.4.7",
60
+ "eslint": "^9.11.0",
61
+ "jest": "^29.0.2",
62
+ "jest-silent-reporter": "^0.6.0",
63
+ "prettier": "^3.3.3",
64
+ "ts-node": "^10.9.1",
65
+ "typescript": "~5.3.3"
66
+ },
67
+ "engines": {
68
+ "node": "^20 || >=22"
69
+ },
70
+ "publishConfig": {
71
+ "access": "public",
72
+ "registry": "https://registry.npmjs.org/"
73
+ }
74
+ }
@@ -0,0 +1,27 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "description": "MetaMask example Snap demonstrating the use of the Multichain Provider API and `endowment:multichain-provider` permission.",
4
+ "proposedName": "Multichain Provider Example Snap",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/MetaMask/snaps.git"
8
+ },
9
+ "source": {
10
+ "shasum": "jfHLDvDp6aQQ0dIfa6J0oSMURJ+8qwMMC2VoLrYTEWQ=",
11
+ "location": {
12
+ "npm": {
13
+ "filePath": "dist/bundle.js",
14
+ "packageName": "@metamask/multichain-provider-example-snap",
15
+ "registry": "https://registry.npmjs.org/"
16
+ }
17
+ }
18
+ },
19
+ "initialPermissions": {
20
+ "endowment:rpc": {
21
+ "dapps": true
22
+ },
23
+ "endowment:multichain-provider": {}
24
+ },
25
+ "platformVersion": "10.4.0",
26
+ "manifestVersion": "0.1"
27
+ }