@thanksjs/react-native-webview 1.0.0 → 1.2.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/README.md CHANGED
@@ -1,9 +1,12 @@
1
- Thanks JS react native adapter
2
- ===
3
- [ThanksJS React-Native](https://www.npmjs.com/package/@thanksjs/react-native-webview)
4
- | [ThanksJS React](https://www.npmjs.com/package/@thanksjs/react)
5
- | [ThanksJS Web](https://www.npmjs.com/package/@thanksjs/web)
6
- | [Integration Examples](https://github.com/thanksad/Thanks-examples)
1
+ # Thanks JS react native adapter
2
+
3
+ [ThanksJS React-Native](https://www.npmjs.com/package/@thanksjs/react-native-webview) |
4
+ [ThanksJS React](https://www.npmjs.com/package/@thanksjs/react) |
5
+ [ThanksJS Web](https://www.npmjs.com/package/@thanksjs/web) |
6
+ [Integration Examples](https://github.com/thanksad/Thanks-examples)
7
+
8
+ [Documentation for RN Adapter](https://partners.thanks.co/docs/npm/react-native)
9
+
7
10
  ## Installation
8
11
 
9
12
  ```bash
@@ -16,16 +19,22 @@ yarn add @thanksjs/react-native-webview
16
19
  import { ThanksWidget } from '@thanksjs/react-native-webview';
17
20
 
18
21
  /// somewhere in your code
19
- <ThanksWidget
20
- partnerId="{your partner id}"
21
- // other available props, see Thanks Configuration section
22
- />
22
+ <ThanksWidget partnerId="{your partner id}" />;
23
23
  ```
24
+
24
25
  It's all comes with TypeScript support, dont worry.
25
26
 
27
+ ## Parameters
28
+
29
+ Refer to the full
30
+ [Thanks API configuration documentation for more](https://partners.thanks.co/docs/types/configuration).
31
+
26
32
  ### Advanced usage
33
+
27
34
  The important parts are:
28
- - providing a customer `email`. Strictly sha256 hash will be transferred during the widget lifecycle. No sensitive information leaves your application without your permission.
35
+
36
+ - providing a customer `email`. Strictly sha256 hash will be transferred during the widget lifecycle. No sensitive
37
+ information leaves your application without your permission.
29
38
  - giving permission to send Personal Information to improve efficiency of communications
30
39
  - `subject` and `info` can be used to decide what information to send
31
40
  - `subject` can be `notification` or `autofill` of visible UI elements
@@ -33,11 +42,12 @@ The important parts are:
33
42
  - `keywords`, `category` and `items` are used to fine-tune ads to display
34
43
 
35
44
  Example
45
+
36
46
  ```tsx
37
47
  <ThanksWidget
38
- partnerId='{your partner id}'
48
+ partnerId="{your partner id}"
39
49
  // information for the first scren
40
- statusText='Your order has been confirmed'
50
+ statusText="Your order has been confirmed"
41
51
  emailHash={{ sha256: customersEmailHash }}
42
52
  // or
43
53
  email={customerEmail}
@@ -47,70 +57,175 @@ Example
47
57
  firstName: 'TestUser',
48
58
  };
49
59
  }}
50
-
51
60
  onDisplay={() => {
52
61
  console.log('widget displayed');
53
62
  }}
54
63
  onClose={() => {
55
64
  console.log('widget closed');
56
65
  }}
57
-
58
- keywords={[
59
- 'violet',
60
- 'roses',
61
- 'blueberry',
62
- ]}
66
+ keywords={['violet', 'roses', 'blueberry']}
63
67
  items={[
64
68
  {
65
- 'name': 'Flatwhite',
66
- 'value': 4.00,
67
- 'currency': 'AUD',
68
- 'quantity': 2,
69
- 'type': 'coffee',
70
- 'category': 'drinks',
71
- 'subcategory': 'australian-coffee',
69
+ name: 'Flatwhite',
70
+ value: 4.0,
71
+ currency: 'AUD',
72
+ quantity: 2,
73
+ type: 'coffee',
74
+ category: 'drinks',
75
+ subcategory: 'australian-coffee',
72
76
  },
73
77
  ]}
74
- categories={[
75
- 'lifestyle',
76
- ]}
77
- />;
78
+ categories={['lifestyle']}
79
+ />
80
+ ```
81
+
82
+ ## Indirect usage
83
+
84
+ Sometimes an event-based solution is easier to manage, in thie case we handle some state management for you.
85
+
86
+ ```tsx
87
+ import { ThanksWidgetController, thanksWidget } from '@thanksjs/react-native';
88
+
89
+ const YourApplication = () => (
90
+ <>
91
+ {someCode}
92
+ // put AFTER all other views, so it will be displayed on top
93
+ <ThanksWidgetController partnerId="your-id" />
94
+ </>
95
+ );
96
+
97
+ const YourThanksPage = () => {
98
+ useEffect(
99
+ () => {
100
+ // ThanksWidgetController will render Widget instantly
101
+ // if ThanksWidgetController is not present this will throw an error
102
+ thanksWidget.open(thanksConfiguration);
103
+
104
+ // and hide when you navigate away from the page
105
+ return () => thanksWidget.close();
106
+ },
107
+ [
108
+ // important to keep dependencies free to prevent re-rendering widget
109
+ // as customer's journey will be reset
110
+ ],
111
+ );
112
+
113
+ return pageCode;
114
+ };
78
115
  ```
79
116
 
80
117
  ## Managing Personal Information
81
- By default, Thanks Widget does not send any personal information.
82
- The `email` specified in configuration is always converted into sha256 `emailHash` before being sent to server.
83
- All other extended information provided is used only to improve the efficiency of the widget and is not stored unless user performs an action.
84
- In such case the information will kept until the action is settled, but no longer than 60 days.
118
+
119
+ By default, Thanks Widget does not send any personal information. The `email` specified in configuration is always
120
+ converted into sha256 `emailHash` before being sent to server. All other extended information provided is used only to
121
+ improve the efficiency of the widget and is not stored unless user performs an action. In such case the information will
122
+ kept until the action is settled, but no longer than 60 days.
85
123
 
86
124
  However, there are situations when we need Partner to provide Personal Information:
125
+
87
126
  - to improve our communications and send email notification to the user following their actions
88
127
  - prefill a form with user's data to ease their interactions
89
128
 
90
- In both case we are going to call `onPersonalInformationRequest` function with `subject` and `info` arguments.
91
- Depending on request you may decide to return some information, or return nothing.
129
+ In both case we are going to call `onPersonalInformationRequest` function with `subject` and `info` arguments. Depending
130
+ on request you may decide to return some information, or return nothing.
131
+
92
132
  ```tsx
93
- onPersonalInformationRequest: (subject:'notification' | 'autofill', info) => {
133
+ onPersonalInformationRequest: (subject: 'notification' | 'autofill', info) => {
94
134
  return {
95
135
  email,
96
136
  firstName: 'TestUser',
97
137
  };
98
- }
138
+ };
99
139
  ```
100
- - subject of type `notification` will be used to send email notification to the user about the action just taken, for example coupon code they just claimed
101
- - subject of type `autofill` will be used to prefill a form with user's data, making the subscription process friction less
102
140
 
103
- In case of `onPersonalInformationRequest` is not defined, but `email` is provided as a part of configuraiton - nothing will happen.
104
- The process of capturing PII information is always in the Partners hands.
141
+ - subject of type `notification` will be used to send email notification to the user about the action just taken, for
142
+ example coupon code they just claimed
143
+ - subject of type `autofill` will be used to prefill a form with user's data, making the subscription process friction
144
+ less
105
145
 
106
- 💡It's not always known upfront if PII is required, so `onPersonalInformationRequest` will be called more often than PII information is being "consumed".
107
- In case it was not required, the information will be discarded.
146
+ In case of `onPersonalInformationRequest` is not defined, but `email` is provided as a part of configuraiton - nothing
147
+ will happen. The process of capturing PII information is always in the Partners hands.
148
+
149
+ 💡It's not always known upfront if PII is required, so `onPersonalInformationRequest` will be called more often than PII
150
+ information is being "consumed". In case it was not required, the information will be discarded.
108
151
 
109
152
  ### Using PII information for Promotions
110
- While not every Ad requires PII, some Ads can have a "Promotion" attached to them,
111
- for example "Subscribe to XYZ newsletter to enter the draw".
112
- In case of user action PII information might not be used by a particular Ad, but will be used by Promotion to keep track of participation.
113
- The information will be redacted after the Promotion ends.
153
+
154
+ While not every Ad requires PII, some Ads can have a "Promotion" attached to them, for example "Subscribe to XYZ
155
+ newsletter to enter the draw". In case of user action PII information might not be used by a particular Ad, but will be
156
+ used by Promotion to keep track of participation. The information will be redacted after the Promotion ends.
157
+
158
+ ## Dealing with `'RNCWebView' could not be found`
159
+
160
+ In this package, we use [`react-native-webview`](https://www.npmjs.com/package/react-native-webview) to embed our Widget
161
+ within your application. Although this package already depends on `react-native-webview`, you may still encounter issues
162
+ relating to this dependency.
163
+
164
+ Since [`react-native-webview`](https://www.npmjs.com/package/react-native-webview) is a
165
+ [native module](https://reactnative.dev/docs/native-modules-intro), you'll need to ensure `react-native-webview` is
166
+ properly linked as a native module. For the following examples, we'll assume you use Expo. If you don't use Expo, you
167
+ can apply the same steps to your workflow.
168
+
169
+ ### Option 1: Install `react-native-webview`
170
+
171
+ #### Step 1: Install `react-native-webview`
172
+
173
+ ```sh
174
+ npm install react-native-webview
175
+ ```
176
+
177
+ #### Step 2: Re-run the Prebuild Command
178
+
179
+ Now, run the prebuild command again:
180
+
181
+ ```sh
182
+ expo prebuild
183
+ ```
184
+
185
+ #### Step 3: Run the Custom Development Client
186
+
187
+ Follow the previous steps to build your custom development client:
188
+
189
+ ```sh
190
+ expo run:ios
191
+ ```
192
+
193
+ OR
194
+
195
+ ```sh
196
+ expo run:android
197
+ ```
198
+
199
+ By doing this, we force Expo to add Expo Modules to the iOS `Podfile` (and `build.gradle` for Android)
200
+
201
+ ### Option 2: Manually install `react-native-webview`
202
+
203
+ If you do not want to add another dependency to your project, we recommend you manually link the native modules to your
204
+ Native app's output.
205
+
206
+ #### Step 1: Add `react-native-webview` to your Podfile.
207
+
208
+ ```ruby
209
+ target 'YourProjectName' do
210
+ # ... (other existing pods)
211
+
212
+ pod 'react-native-webview', :path => '../node_modules/react-native-webview'
213
+ end
214
+ ```
215
+
216
+ #### Step 2: Clean the project and reinstall the pods
217
+
218
+ ```sh
219
+ npx expo prebuild --clean
220
+ cd ios && pod install && cd ..
221
+ ```
222
+
223
+ #### Step 3: Fun the development client
224
+
225
+ ```sh
226
+ npx expo run:ios
227
+ ```
114
228
 
115
229
  # License
230
+
116
231
  MIT
package/dist/esm/index.js CHANGED
@@ -1,3 +1,52 @@
1
- var W="INIT_TUNNEL",k="TUNNEL_READY",E="rocket-seed";var w=e=>typeof e=="object"&&"seed"in e&&e.seed===E&&"cmd"in e?e:{error:!0},D=(e,r)=>({cmd:e,payload:r,seed:E}),M=(e,r,t)=>{(e[r]||[]).forEach(o=>o(t))};var v=(e,r)=>{let t={},o=!1,c=n=>{let{cmd:i,payload:a,error:d}=w(n);d?console.log("error decoding event",n,d):M(t,i,a)};return{on(n,i){(t[n]=t[n]||[]).push(i)},isReady(){return o},pushMessage:n=>{let{cmd:i,payload:a,error:d}=w(n);if(o){c(n);return}!d&&i===W&&a===e&&(o=!0,M(t,k,void 0))},send(n,i){if(!o)throw new Error("trying to `send` into non initialized tunnel");r(D(n,i))}}};var U=e=>{let r=Object.entries(e).filter(([t,o])=>!!o);return Object.fromEntries(r)},_=(e,r={})=>{let t={...r};return t.__forceAd=e.__forceAd,t.impressionId=e.impressionId,new URLSearchParams(U(t)).toString()},A=(e="production")=>e==="development"?"http://localhost:8081/":e==="staging"?"https://thanksad.dev/":"https://thanks.is/";var R={xs:360,sm:768,md:1024,lg:1200,xl:1350};var V=()=>typeof window>"u"||window.innerWidth>=R.sm?"desktop":"mobile";var j=e=>Array.from(new Uint8Array(e)).map(r=>r.toString(16).padStart(2,"0")).join("");var N=async e=>{if(!e)return;let r=new TextEncoder().encode(e);return j(await crypto.subtle.digest("SHA-256",r))};var B=async(e,r)=>{let t=e?await(typeof e=="function"?e({encode:N}):N(e)):"";return Object.assign({sha256:t},r)};var G=async e=>{let{partnerId:r,email:t,userId:o,traceId:c=o,keywords:p,items:n,flags:i={},style:a}=e,{switches:d,...x}=i,l=(await B(t,e.emailHash)).sha256;return _(x,{partnerId:r,emailHash:l,traceId:c,deviceMode:V(),keywords:p?p.join(","):void 0,items:JSON.stringify(n),embedTheme:a?.embed?.theme})},S=async(e,r)=>`${A(r)}?${await G(e)}`;import"react";import{useCallback as C,useEffect as I,useRef as xe,useState as b}from"react";import{Modal as Ce,Linking as be}from"react-native";import{WebView as Ee}from"react-native-webview";import{View as K,Modal as Z}from"react-native";import Te from"react-native-webview";import"react";import{Text as J,View as Y,TouchableOpacity as Q}from"react-native";var O=({onBack:e})=><Y style={{height:150,justifyContent:"center",alignItems:"flex-end",backgroundColor:"#000",width:"100%"}}><Q onPress={e}><J style={{color:"#FFF"}}>Close</J></Q></Y>;import{Component as X}from"react";var T=class extends X{state={error:null};static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,t){this.props.onError(r,t.componentStack)}render(){return this.state.error?null:this.props.children}};var L=({uri:e,onClose:r})=><T onError={r}><Z animationType="slide"onRequestClose={r}><K style={{flex:1,justifyContent:"center",alignItems:"center",display:"flex",flexDirection:"column"}}><O onBack={r}/><Te source={{uri:e}}onError={t=>{console.error("visible page error",t),r()}}onContentProcessDidTerminate={t=>{console.error("visible page terminate",t),r()}}onRenderProcessGone={t=>{console.error("visible render gone",t),r()}}style={{flex:1}}/><O onBack={r}/></K></Z></T>;var we=`
1
+ var N="INIT_TUNNEL",A="TUNNEL_READY",E="rocket-seed";var U=n=>typeof n=="object"&&"seed"in n&&n.seed===E&&"cmd"in n?n:{error:!0},L=(n,t)=>({cmd:n,payload:t,seed:E}),W=(n,t,r)=>{(n[t]||[]).forEach(e=>e(r))};var M=(n,t)=>{let r={},e=!1,u=i=>{let{cmd:o,payload:a,error:s}=U(i);s?console.log("error decoding event",i,s):W(r,o,a)};return{on(i,o){(r[i]=r[i]||[]).push(o)},isReady(){return e},pushMessage:i=>{let{cmd:o,payload:a,error:s}=U(i);if(e){u(i);return}!s&&o===N&&a===n&&(e=!0,W(r,A,void 0))},send(i,o){if(!e)throw new Error("trying to `send` into non initialized tunnel");t(L(i,o))}}};var In="THANKS_AD_LOCAL_ID",K=()=>{if(!(typeof localStorage>"u"))return localStorage.getItem(In)||void 0};var R={xs:360,sm:768,md:1024,lg:1200,xl:1350};var F=()=>typeof window>"u"||window.innerWidth>=R.sm?"desktop":"mobile";var T=()=>"https://thanks.is/";var Y=n=>n?n.join(",").toLowerCase():void 0;var $=n=>Array.from(new Uint8Array(n)).map(t=>t.toString(16).padStart(2,"0")).join("");var H,q=n=>H=n,Q=()=>H;var z=async n=>{if(!n)return;let t=new TextEncoder().encode(n),r=Q()??crypto.subtle;return $(await r.digest("SHA-256",t))};var J=async(n,t)=>{let r=n?await(typeof n=="function"?n({encode:z}):z(n)):"";return Object.assign({sha256:r},t)};var kn=n=>{let t=Object.entries(n).filter(([r,e])=>!!e);return Object.fromEntries(t)},G=(n,t={})=>{let r={...t};return r.__forceAd=n.__forceAd,r.impressionId=n.impressionId,new URLSearchParams(kn(r))};var Sn=async n=>{let{partnerId:t,email:r,userId:e,traceId:u=e,keywords:f,items:i,flags:o={},style:a}=n,{switches:s,...x}=o,h=(await J(r,n.emailHash)).sha256;return G(x,{partnerId:t,emailHash:h,traceId:u,localId:K(),deviceMode:F(),keywords:Y(f),items:JSON.stringify(i),embedTheme:a?.embed?.theme,source:o.taint||"popup"})},D=async n=>`${T()}?${await Sn(n)}`;import"react";import{useCallback as b,useEffect as O,useRef as mt,useState as j}from"react";import{Modal as At,Linking as jt}from"react-native";import{WebView as An}from"react-native-webview";import{View as Mn,Modal as Rn}from"react-native";import{WebView as Dn}from"react-native-webview";import"react";import{Text as On,View as En,TouchableOpacity as Un}from"react-native";var P=({onBack:n})=><En style={{height:150,justifyContent:"center",alignItems:"flex-end",backgroundColor:"#000",width:"100%"}}>
2
+ <Un onPress={n}>
3
+ <On style={{color:"#FFF"}}>Close</On>
4
+ </Un>
5
+ </En>;import{Component as Wn}from"react";var _=class extends Wn{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error(t),this.props.onError(t,r.componentStack)}render(){return this.state.error?null:this.props.children}};var Z=({uri:n,onClose:t})=><_ onError={t}>
6
+ <Rn animationType="slide"onRequestClose={t}>
7
+ <Mn style={{flex:1,justifyContent:"center",alignItems:"center",display:"flex",flexDirection:"column"}}>
8
+ <P onBack={t}/>
9
+
10
+ <Dn source={{uri:n}}onError={r=>{console.error("visible page error",r),t()}}onContentProcessDidTerminate={r=>{console.error("visible page terminate",r),t()}}onRenderProcessGone={r=>{console.error("visible render gone",r),t()}}style={{flex:1}}/>
11
+
12
+ <P onBack={t}/>
13
+ </Mn>
14
+ </Rn>
15
+ </_>;import{useCallback as en,useEffect as Qn,useMemo as Jn,useRef as Gn,useState as un}from"react";import{WebView as Zn}from"react-native-webview";function Pn(n){return n.hasOwnProperty("__serializer_id")}async function C(n,t){if(typeof t!="object")return t;let r=n.find(u=>u.isType(t));if(r){let u=r.toObject?await r.toObject(t):t;return{__serializer_id:r.id,value:await C(n,u)}}let e=t instanceof Array?[]:{};for(let u in t)e[u]=await C(n,t[u]);return e}async function I(n,t){if(typeof t!="object")return t;if(Pn(t)){let e=await I(n,t.value),u=n.find(({id:f})=>f==t.__serializer_id);return u?.fromObject?u.fromObject(e):e}let r=t instanceof Array?[]:{};for(let e in t)r[e]=await I(n,t[e]);return r}function k(){return window.crypto.subtle||window.crypto.webkitSubtle}async function X(n){let t=decodeURIComponent(n),r=JSON.parse(t);return await I(tn(!0),r)}async function nn(n,t=!0){let r=await C(tn(t),n),e=JSON.stringify(r);return encodeURIComponent(e)}function tn(n){return[Bn,Ln(n),Fn]}var Bn={id:"ArrayBuffer",isType:n=>n instanceof ArrayBuffer,toObject:async n=>{let t=new Int8Array(n),r=64*1024;if(t.length<=r)return String.fromCharCode.apply(null,t);let e="";for(let u=0;u<t.length;u+=r)e+=String.fromCharCode.apply(null,t.slice(u,u+r));return e},fromObject:async n=>{let t=new ArrayBuffer(n.length),r=new Int8Array(t);for(let e=0,u=n.length;e<u;e++)r[e]=n.charCodeAt(e);return t}};function Vn(n){return n.hasOwnProperty("_promise")}function Nn(n){return n instanceof Int8Array?"Int8Array":n instanceof Uint8Array?"Uint8Array":n instanceof Uint8ClampedArray?"Uint8ClampedArray":n instanceof Int16Array?"Int16Array":n instanceof Uint16Array?"Uint16Array":n instanceof Int32Array?"Int32Array":n instanceof Uint32Array?"Uint32Array":n instanceof Float32Array?"Float32Array":n instanceof Float64Array?"Float64Array":(n instanceof DataView,"DataView")}function Ln(n){return{id:"ArrayBufferView",isType:ArrayBuffer.isView,toObject:async t=>(n&&Vn(t)&&await t._promise,{name:Nn(t),buffer:t.buffer}),fromObject:async t=>{switch(t.name){case"Int8Array":return new Int8Array(t.buffer);case"Uint8Array":return new Uint8Array(t.buffer);case"Uint8ClampedArray":return new Uint8ClampedArray(t.buffer);case"Int16Array":return new Int16Array(t.buffer);case"Uint16Array":return new Uint16Array(t.buffer);case"Int32Array":return new Int32Array(t.buffer);case"Uint32Array":return new Uint32Array(t.buffer);case"Float32Array":return new Float32Array(t.buffer);case"Float64Array":return new Float64Array(t.buffer);case"DataView":return new DataView(t.buffer)}}}}function Kn(n){return n._import!==void 0}var Fn={id:"CryptoKey",isType:n=>{let t=n.toLocaleString(),r=t==="[object CryptoKey]"||t==="[object Key]",e=n._import&&!n.serialized;return r||e},toObject:async n=>Kn(n)?{serialized:!0,_import:n._import,type:n.type,extractable:n.extractable,algorithm:n.algorithm,usages:n.usages}:{_import:{format:"jwk",keyData:await k().exportKey("jwk",n)},serialized:!0,algorithm:n.algorithm,extractable:n.extractable,usages:n.usages,type:n.type},fromObject:async n=>{if(crypto.fake){let t={...n};return delete t.serialized,t}return n._import.format==="jwk"?await k().importKey(n._import.format,n._import.keyData,n.algorithm,n.extractable,n.usages):await k().importKey(n._import.format,n._import.keyData,n.algorithm,n.extractable,n.usages)}};var Yn=["encrypt","decrypt","sign","verify","digest","generateKey","deriveKey","deriveBits","importKey","exportKey","wrapKey","unwrapKey"],m=class n{constructor(t,r=!1){this.sendToWebView=t;this.debug=r}toSend=[];readyToSend=!1;messages={};get crypto(){return{subtle:this.subtle,getRandomValues:this.getRandomValues.bind(this),fake:!0}}get subtle(){let t={};for(let r of Yn)t[r]=(...e)=>this.callMethod(`subtle.${r}`,e,!0);return t}getRandomValues(t){let r=this.callMethod("getRandomValues",[t],!1);return Object.defineProperty(t,"_promise",{value:r,configurable:!0,enumerable:!1,writable:!0}),r.then(e=>{t.set(e)}),t}onWebViewMessage(t){if(!this.readyToSend){this.debug&&console.log("[webview-crypto] Got first message; ready to send"),this.readyToSend=!0;for(let r of this.toSend)this.sendToWebView(r);return}X(t).then(({id:r,value:e,reason:u})=>{if(this.debug&&console.log("[webview-crypto] Received message:",JSON.stringify({id:r,value:e,reason:u})),!r){console.warn("[webview-crypto] no ID passed back from message:");return}let{resolve:f,reject:i}=this.messages[r];u?i(u):f(e),delete this.messages[r]}).catch(r=>{console.warn("[webview-crypto] error in `parse` of message:",JSON.stringify(t),"reason:",r)})}callMethod(t,r,e){let u=n.uuid(),f=new Promise((o,a)=>{this.messages[u]={resolve:o,reject:a}}),i={method:t,id:u,args:r};return this.debug&&console.log("[webview-crypto] Sending message:",JSON.stringify({method:t,args:r,payloadObject:i})),nn(i,e).then(o=>{this.readyToSend?this.sendToWebView(o):this.toSend.push(o)}).catch(o=>{this.messages[u].reject({message:`exception in stringify-ing message: ${t} ${u}`,reason:o}),delete this.messages[u]}),f}static uuid(){function t(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return`${t()}-${t()}-${t()}-${t()}-${t()}-${t()}-${t()}-${t()}`}};var B=`var WebViewWorker=function(n){function t(e){if(r[e])return r[e].exports;var u=r[e]={exports:{},id:e,loaded:!1};return n[e].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var r={};return t.m=n,t.c=r,t.p="",t(0)}([function(n,t,r){n.exports=r(1)},function(n,t,r){"use strict";var e=this&&this.__awaiter||function(n,t,r,e){function u(n){return n instanceof r?n:new r(function(t){t(n)})}return new(r||(r=Promise))(function(r,i){function o(n){try{f(e.next(n))}catch(n){i(n)}}function a(n){try{f(e.throw(n))}catch(n){i(n)}}function f(n){n.done?r(n.value):u(n.value).then(o,a)}f((e=e.apply(n,t||[])).next())})},u=this&&this.__generator||function(n,t){function r(n){return function(t){return e([n,t])}}function e(r){if(u)throw new TypeError("Generator is already executing.");for(;f;)try{if(u=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return f.label++,{value:r[1],done:!1};case 5:f.label++,i=r[1],r=[0];continue;case 7:r=f.ops.pop(),f.trys.pop();continue;default:if(o=f.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){f=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){f.label=r[1];break}if(6===r[0]&&f.label<o[1]){f.label=o[1],o=r;break}if(o&&f.label<o[2]){f.label=o[2],f.ops.push(r);break}o[2]&&f.ops.pop(),f.trys.pop();continue}r=t.call(n,f)}catch(n){r=[6,n],i=0}finally{u=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var u,i,o,a,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a},i=r(2),o=r(3),a=r(7),f=function(){function n(n){this.sendToMain=n,n("We are ready!")}return n.prototype.onMainMessage=function(n){return e(this,void 0,void 0,function(){var t,r,e,f,c,l,s,h;return u(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,4]),[4,(0,o.parse)(n)];case 1:return h=u.sent(),t=h.id,r=h.method,e=h.args,[3,4];case 2:return f=u.sent(),[4,this.send({reason:"Couldn't parse data: "+f})];case 3:return u.sent(),[2];case 4:return u.trys.push([4,8,,10]),"getRandomValues"!==r?[3,5]:(c=crypto.getRandomValues(e[0]),[3,7]);case 5:return l=r.split(".")[1],console.log(l,e),[4,(0,a.subtle)()[l].apply((0,a.subtle)(),e)];case 6:c=u.sent(),"importKey"===l&&(c._import={format:e[0],keyData:e[1]}),u.label=7;case 7:return[3,10];case 8:return s=u.sent(),[4,this.send({id:t,reason:i(s)})];case 9:return u.sent(),[2];case 10:return[4,this.send({id:t,value:c})];case 11:return u.sent(),[2]}})})},n.prototype.send=function(n){return e(this,void 0,void 0,function(){var t,r,e;return u(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,(0,o.stringify)(n)];case 1:return t=u.sent(),[3,3];case 2:return r=u.sent(),e={id:n.id,reason:"stringify error "+r},this.sendToMain(JSON.stringify(e)),[2];case 3:return this.sendToMain(t),[2]}})})},n}();n.exports=f},function(n,t){"use strict";function r(n,t){var e;return e=Array.isArray(n)?[]:{},t.push(n),Object.keys(n).forEach(function(u){var i=n[u];if("function"!=typeof i)return i&&"object"==typeof i?t.indexOf(n[u])===-1?void(e[u]=r(n[u],t.slice(0))):void(e[u]="[Circular]"):void(e[u]=i)}),"string"==typeof n.name&&(e.name=n.name),"string"==typeof n.message&&(e.message=n.message),"string"==typeof n.stack&&(e.stack=n.stack),e}n.exports=function(n){return"object"==typeof n?r(n,[]):"function"==typeof n?"[Function: "+(n.name||"anonymous")+"]":n}},function(n,t,r){"use strict";function e(n){return s(this,void 0,void 0,function(){var t,r;return h(this,function(e){switch(e.label){case 0:return t=decodeURIComponent(n),r=JSON.parse(t),[4,(0,p.fromObjects)(i(!0),r)];case 1:return[2,e.sent()]}})})}function u(n,t){return void 0===t&&(t=!0),s(this,void 0,void 0,function(){var r,e;return h(this,function(u){switch(u.label){case 0:return[4,(0,p.toObjects)(i(t),n)];case 1:return r=u.sent(),e=JSON.stringify(r),[2,encodeURIComponent(e)]}})})}function i(n){return[_,f(n),y]}function o(n){return n.hasOwnProperty("_promise")}function a(n){return n instanceof Int8Array?"Int8Array":n instanceof Uint8Array?"Uint8Array":n instanceof Uint8ClampedArray?"Uint8ClampedArray":n instanceof Int16Array?"Int16Array":n instanceof Uint16Array?"Uint16Array":n instanceof Int32Array?"Int32Array":n instanceof Uint32Array?"Uint32Array":n instanceof Float32Array?"Float32Array":n instanceof Float64Array?"Float64Array":n instanceof DataView?"DataView":void 0}function f(n){var t=this;return{id:"ArrayBufferView",isType:ArrayBuffer.isView,toObject:function(r){return s(t,void 0,void 0,function(){return h(this,function(t){switch(t.label){case 0:return n&&o(r)?[4,r._promise]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2,{name:a(r),buffer:r.buffer}]}})})},fromObject:function(n){return s(t,void 0,void 0,function(){return h(this,function(t){switch(n.name){case"Int8Array":return[2,new Int8Array(n.buffer)];case"Uint8Array":return[2,new Uint8Array(n.buffer)];case"Uint8ClampedArray":return[2,new Uint8ClampedArray(n.buffer)];case"Int16Array":return[2,new Int16Array(n.buffer)];case"Uint16Array":return[2,new Uint16Array(n.buffer)];case"Int32Array":return[2,new Int32Array(n.buffer)];case"Uint32Array":return[2,new Uint32Array(n.buffer)];case"Float32Array":return[2,new Float32Array(n.buffer)];case"Float64Array":return[2,new Float64Array(n.buffer)];case"DataView":return[2,new DataView(n.buffer)]}return[2]})})}}}function c(n){return void 0!==n._import}var l=this&&this.__assign||function(){return l=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++){t=arguments[r];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(n[u]=t[u])}return n},l.apply(this,arguments)},s=this&&this.__awaiter||function(n,t,r,e){function u(n){return n instanceof r?n:new r(function(t){t(n)})}return new(r||(r=Promise))(function(r,i){function o(n){try{f(e.next(n))}catch(n){i(n)}}function a(n){try{f(e.throw(n))}catch(n){i(n)}}function f(n){n.done?r(n.value):u(n.value).then(o,a)}f((e=e.apply(n,t||[])).next())})},h=this&&this.__generator||function(n,t){function r(n){return function(t){return e([n,t])}}function e(r){if(u)throw new TypeError("Generator is already executing.");for(;f;)try{if(u=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return f.label++,{value:r[1],done:!1};case 5:f.label++,i=r[1],r=[0];continue;case 7:r=f.ops.pop(),f.trys.pop();continue;default:if(o=f.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){f=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){f.label=r[1];break}if(6===r[0]&&f.label<o[1]){f.label=o[1],o=r;break}if(o&&f.label<o[2]){f.label=o[2],f.ops.push(r);break}o[2]&&f.ops.pop(),f.trys.pop();continue}r=t.call(n,f)}catch(n){r=[6,n],i=0}finally{u=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var u,i,o,a,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0}),t.stringify=t.parse=void 0;var p=r(4),v=r(7);t.parse=e,t.stringify=u;var _={id:"ArrayBuffer",isType:function(n){return n instanceof ArrayBuffer},toObject:function(n){return s(void 0,void 0,void 0,function(){return h(this,function(t){return[2,String.fromCharCode.apply(null,new Int8Array(n))]})})},fromObject:function(n){return s(void 0,void 0,void 0,function(){var t,r,e,u;return h(this,function(i){for(t=new ArrayBuffer(n.length),r=new Int8Array(t),e=0,u=n.length;e<u;e++)r[e]=n.charCodeAt(e);return[2,t]})})}},y={id:"CryptoKey",isType:function(n){var t=n.toLocaleString(),r="[object CryptoKey]"===t||"[object Key]"===t,e=n._import&&!n.serialized;return r||e},toObject:function(n){return s(void 0,void 0,void 0,function(){var t;return h(this,function(r){switch(r.label){case 0:return c(n)?[2,{serialized:!0,_import:n._import,type:n.type,extractable:n.extractable,algorithm:n.algorithm,usages:n.usages}]:[4,(0,v.subtle)().exportKey("jwk",n)];case 1:return t=r.sent(),[2,{_import:{format:"jwk",keyData:t},serialized:!0,algorithm:n.algorithm,extractable:n.extractable,usages:n.usages,type:n.type}]}})})},fromObject:function(n){return s(void 0,void 0,void 0,function(){var t;return h(this,function(r){switch(r.label){case 0:return crypto.fake?(t=l({},n),delete t.serialized,[2,t]):"jwk"!==n._import.format?[3,2]:[4,(0,v.subtle)().importKey(n._import.format,n._import.keyData,n.algorithm,n.extractable,n.usages)];case 1:return[2,r.sent()];case 2:return[4,(0,v.subtle)().importKey(n._import.format,n._import.keyData,n.algorithm,n.extractable,n.usages)];case 3:return[2,r.sent()]}})})}}},function(n,t,r){"use strict";function e(n){return n.hasOwnProperty("__serializer_id")}function u(n,t){return o(this,void 0,void 0,function(){var r,e,i,o,c,l,s,h,p,v,_;return a(this,function(a){switch(a.label){case 0:return"object"!=typeof t?[2,t]:(r=(0,f.find)(n,function(n){return n.isType(t)}),r?r.toObject?[4,r.toObject(t)]:[3,2]:[3,5]);case 1:return i=a.sent(),[3,3];case 2:i=t,a.label=3;case 3:return e=i,_={__serializer_id:r.id},[4,u(n,e)];case 4:return[2,(_.value=a.sent(),_)];case 5:o=t instanceof Array?[]:{},c=[];for(l in t)c.push(l);s=0,a.label=6;case 6:return s<c.length?(h=c[s],p=o,v=h,[4,u(n,t[h])]):[3,9];case 7:p[v]=a.sent(),a.label=8;case 8:return s++,[3,6];case 9:return[2,o]}})})}function i(n,t){return o(this,void 0,void 0,function(){var r,u,o,c,l,s,h,p,v;return a(this,function(a){switch(a.label){case 0:return"object"!=typeof t?[2,t]:e(t)?[4,i(n,t.value)]:[3,2];case 1:return r=a.sent(),u=(0,f.find)(n,["id",t.__serializer_id]),u.fromObject?[2,u.fromObject(r)]:[2,r];case 2:o=t instanceof Array?[]:{},c=[];for(l in t)c.push(l);s=0,a.label=3;case 3:return s<c.length?(h=c[s],p=o,v=h,[4,i(n,t[h])]):[3,6];case 4:p[v]=a.sent(),a.label=5;case 5:return s++,[3,3];case 6:return[2,o]}})})}var o=this&&this.__awaiter||function(n,t,r,e){function u(n){return n instanceof r?n:new r(function(t){t(n)})}return new(r||(r=Promise))(function(r,i){function o(n){try{f(e.next(n))}catch(n){i(n)}}function a(n){try{f(e.throw(n))}catch(n){i(n)}}function f(n){n.done?r(n.value):u(n.value).then(o,a)}f((e=e.apply(n,t||[])).next())})},a=this&&this.__generator||function(n,t){function r(n){return function(t){return e([n,t])}}function e(r){if(u)throw new TypeError("Generator is already executing.");for(;f;)try{if(u=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return f.label++,{value:r[1],done:!1};case 5:f.label++,i=r[1],r=[0];continue;case 7:r=f.ops.pop(),f.trys.pop();continue;default:if(o=f.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){f=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){f.label=r[1];break}if(6===r[0]&&f.label<o[1]){f.label=o[1],o=r;break}if(o&&f.label<o[2]){f.label=o[2],f.ops.push(r);break}o[2]&&f.ops.pop(),f.trys.pop();continue}r=t.call(n,f)}catch(n){r=[6,n],i=0}finally{u=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var u,i,o,a,f={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0}),t.fromObjects=t.toObjects=void 0;var f=r(5);t.toObjects=u,t.fromObjects=i},function(n,t,r){var e;(function(n,u){(function(){function i(n,t){return n.set(t[0],t[1]),n}function o(n,t){return n.add(t),n}function a(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function f(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function c(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&t(n[r],r,n)!==!1;);return n}function l(n,t){for(var r=null==n?0:n.length;r--&&t(n[r],r,n)!==!1;);return n}function s(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function h(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function p(n,t){var r=null==n?0:n.length;return!!r&&j(n,t,0)>-1}function v(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function _(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function y(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function g(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function d(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function b(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function w(n){return n.split("")}function m(n){return n.match(Vt)||[]}function x(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function A(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function j(n,t,r){return t===t?Y(n,t,r):A(n,O,r)}function k(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function O(n){return n!==n}function I(n,t){var r=null==n?0:n.length;return r?U(n,t)/r:Dn}function S(n){return function(t){return null==t?un:t[n]}}function z(n){return function(t){return null==n?un:n[t]}}function R(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function E(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}function U(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==un&&(r=r===un?i:r+i)}return r}function C(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function W(n,t){return _(t,function(t){return[t,n[t]]})}function T(n){return function(t){return n(t)}}function L(n,t){return _(t,function(t){return n[t]})}function B(n,t){return n.has(t)}function D(n,t){for(var r=-1,e=n.length;++r<e&&j(t,n[r],0)>-1;);return r}function F(n,t){for(var r=n.length;r--&&j(t,n[r],0)>-1;);return r}function M(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}function P(n){return"\\\\"+re[n]}function $(n,t){return null==n?un:n[t]}function N(n){return Zr.test(n)}function V(n){return Gr.test(n)}function K(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function q(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function Z(n,t){return function(r){return n(t(r))}}function G(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==hn||(n[r]=hn,i[u++]=r)}return i}function J(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function H(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function Y(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}function Q(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}function X(n){return N(n)?tn(n):be(n)}function nn(n){return N(n)?rn(n):w(n)}function tn(n){for(var t=Kr.lastIndex=0;Kr.test(n);)++t;return t}function rn(n){return n.match(Kr)||[]}function en(n){return n.match(qr)||[]}var un,on="4.17.3",an=200,fn="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",cn="Expected a function",ln="__lodash_hash_undefined__",sn=500,hn="__lodash_placeholder__",pn=1,vn=2,_n=4,yn=1,gn=2,dn=1,bn=2,wn=4,mn=8,xn=16,An=32,jn=64,kn=128,On=256,In=512,Sn=30,zn="...",Rn=800,En=16,Un=1,Cn=2,Wn=3,Tn=1/0,Ln=9007199254740991,Bn=1.7976931348623157e308,Dn=NaN,Fn=4294967295,Mn=Fn-1,Pn=Fn>>>1,$n=[["ary",kn],["bind",dn],["bindKey",bn],["curry",mn],["curryRight",xn],["flip",In],["partial",An],["partialRight",jn],["rearg",On]],Nn="[object Arguments]",Vn="[object Array]",Kn="[object AsyncFunction]",qn="[object Boolean]",Zn="[object Date]",Gn="[object DOMException]",Jn="[object Error]",Hn="[object Function]",Yn="[object GeneratorFunction]",Qn="[object Map]",Xn="[object Number]",nt="[object Null]",tt="[object Object]",rt="[object Promise]",et="[object Proxy]",ut="[object RegExp]",it="[object Set]",ot="[object String]",at="[object Symbol]",ft="[object Undefined]",ct="[object WeakMap]",lt="[object WeakSet]",st="[object ArrayBuffer]",ht="[object DataView]",pt="[object Float32Array]",vt="[object Float64Array]",_t="[object Int8Array]",yt="[object Int16Array]",gt="[object Int32Array]",dt="[object Uint8Array]",bt="[object Uint8ClampedArray]",wt="[object Uint16Array]",mt="[object Uint32Array]",xt=/\\b__p \\+= '';/g,At=/\\b(__p \\+=) '' \\+/g,jt=/(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g,kt=/&(?:amp|lt|gt|quot|#39);/g,Ot=/[&<>"']/g,It=RegExp(kt.source),St=RegExp(Ot.source),zt=/<%-([\\s\\S]+?)%>/g,Rt=/<%([\\s\\S]+?)%>/g,Et=/<%=([\\s\\S]+?)%>/g,Ut=/\\.|\\[(?:[^[\\]]*|(["'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,Ct=/^\\w*$/,Wt=/^\\./,Tt=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Lt=/[\\\\^$.*+?()[\\]{}|]/g,Bt=RegExp(Lt.source),Dt=/^\\s+|\\s+$/g,Ft=/^\\s+/,Mt=/\\s+$/,Pt=/\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,$t=/\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,Nt=/,? & /,Vt=/[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g,Kt=/\\\\(\\\\)?/g,qt=/\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g,Zt=/\\w*$/,Gt=/^[-+]0x[0-9a-f]+$/i,Jt=/^0b[01]+$/i,Ht=/^\\[object .+?Constructor\\]$/,Yt=/^0o[0-7]+$/i,Qt=/^(?:0|[1-9]\\d*)$/,Xt=/[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g,nr=/($^)/,tr=/['\\n\\r\\u2028\\u2029\\\\]/g,rr="\\\\ud800-\\\\udfff",er="\\\\u0300-\\\\u036f",ur="\\\\ufe20-\\\\ufe2f",ir="\\\\u20d0-\\\\u20ff",or=er+ur+ir,ar="\\\\u2700-\\\\u27bf",fr="a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff",cr="\\\\xac\\\\xb1\\\\xd7\\\\xf7",lr="\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf",sr="\\\\u2000-\\\\u206f",hr=" \\\\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",pr="A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde",vr="\\\\ufe0e\\\\ufe0f",_r=cr+lr+sr+hr,yr="['\u2019]",gr="["+rr+"]",dr="["+_r+"]",br="["+or+"]",wr="\\\\d+",mr="["+ar+"]",xr="["+fr+"]",Ar="[^"+rr+_r+wr+ar+fr+pr+"]",jr="\\\\ud83c[\\\\udffb-\\\\udfff]",kr="(?:"+br+"|"+jr+")",Or="[^"+rr+"]",Ir="(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}",Sr="[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]",zr="["+pr+"]",Rr="\\\\u200d",Er="(?:"+xr+"|"+Ar+")",Ur="(?:"+zr+"|"+Ar+")",Cr="(?:"+yr+"(?:d|ll|m|re|s|t|ve))?",Wr="(?:"+yr+"(?:D|LL|M|RE|S|T|VE))?",Tr=kr+"?",Lr="["+vr+"]?",Br="(?:"+Rr+"(?:"+[Or,Ir,Sr].join("|")+")"+Lr+Tr+")*",Dr="\\\\d*(?:(?:1st|2nd|3rd|(?![123])\\\\dth)\\\\b)",Fr="\\\\d*(?:(?:1ST|2ND|3RD|(?![123])\\\\dTH)\\\\b)",Mr=Lr+Tr+Br,Pr="(?:"+[mr,Ir,Sr].join("|")+")"+Mr,$r="(?:"+[Or+br+"?",br,Ir,Sr,gr].join("|")+")",Nr=RegExp(yr,"g"),Vr=RegExp(br,"g"),Kr=RegExp(jr+"(?="+jr+")|"+$r+Mr,"g"),qr=RegExp([zr+"?"+xr+"+"+Cr+"(?="+[dr,zr,"$"].join("|")+")",Ur+"+"+Wr+"(?="+[dr,zr+Er,"$"].join("|")+")",zr+"?"+Er+"+"+Cr,zr+"+"+Wr,Fr,Dr,wr,Pr].join("|"),"g"),Zr=RegExp("["+Rr+rr+or+vr+"]"),Gr=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jr=["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"],Hr=-1,Yr={};Yr[pt]=Yr[vt]=Yr[_t]=Yr[yt]=Yr[gt]=Yr[dt]=Yr[bt]=Yr[wt]=Yr[mt]=!0,Yr[Nn]=Yr[Vn]=Yr[st]=Yr[qn]=Yr[ht]=Yr[Zn]=Yr[Jn]=Yr[Hn]=Yr[Qn]=Yr[Xn]=Yr[tt]=Yr[ut]=Yr[it]=Yr[ot]=Yr[ct]=!1;var Qr={};Qr[Nn]=Qr[Vn]=Qr[st]=Qr[ht]=Qr[qn]=Qr[Zn]=Qr[pt]=Qr[vt]=Qr[_t]=Qr[yt]=Qr[gt]=Qr[Qn]=Qr[Xn]=Qr[tt]=Qr[ut]=Qr[it]=Qr[ot]=Qr[at]=Qr[dt]=Qr[bt]=Qr[wt]=Qr[mt]=!0,Qr[Jn]=Qr[Hn]=Qr[ct]=!1;var Xr={"\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xC7":"C","\xE7":"c","\xD0":"D","\xF0":"d","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xD1":"N","\xF1":"n","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xDD":"Y","\xFD":"y","\xFF":"y","\xC6":"Ae","\xE6":"ae","\xDE":"Th","\xFE":"th","\xDF":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010A":"C","\u010C":"C","\u0107":"c","\u0109":"c","\u010B":"c","\u010D":"c","\u010E":"D","\u0110":"D","\u010F":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011A":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011B":"e","\u011C":"G","\u011E":"G","\u0120":"G","\u0122":"G","\u011D":"g","\u011F":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012A":"I","\u012C":"I","\u012E":"I","\u0130":"I","\u0129":"i","\u012B":"i","\u012D":"i","\u012F":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013B":"L","\u013D":"L","\u013F":"L","\u0141":"L","\u013A":"l","\u013C":"l","\u013E":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014A":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014B":"n","\u014C":"O","\u014E":"O","\u0150":"O","\u014D":"o","\u014F":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015A":"S","\u015C":"S","\u015E":"S","\u0160":"S","\u015B":"s","\u015D":"s","\u015F":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016A":"U","\u016C":"U","\u016E":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016B":"u","\u016D":"u","\u016F":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017B":"Z","\u017D":"Z","\u017A":"z","\u017C":"z","\u017E":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017F":"s"},ne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},te={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},re={"\\\\":"\\\\","'":"'","\\n":"n","\\r":"r","\\u2028":"u2028","\\u2029":"u2029"},ee=parseFloat,ue=parseInt,ie="object"==typeof n&&n&&n.Object===Object&&n,oe="object"==typeof self&&self&&self.Object===Object&&self,ae=ie||oe||Function("return this")(),fe="object"==typeof t&&t&&!t.nodeType&&t,ce=fe&&"object"==typeof u&&u&&!u.nodeType&&u,le=ce&&ce.exports===fe,se=le&&ie.process,he=function(){try{return se&&se.binding&&se.binding("util")}catch(n){}}(),pe=he&&he.isArrayBuffer,ve=he&&he.isDate,_e=he&&he.isMap,ye=he&&he.isRegExp,ge=he&&he.isSet,de=he&&he.isTypedArray,be=S("length"),we=z(Xr),me=z(ne),xe=z(te),Ae=function n(t){function r(n){if(lf(n)&&!mh(n)&&!(n instanceof w)){if(n instanceof u)return n;if(ml.call(n,"__wrapped__"))return io(n)}return new u(n)}function e(){}function u(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=un}function w(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Fn,this.__views__=[]}function z(){var n=new w(this.__wrapped__);return n.__actions__=Mu(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Mu(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Mu(this.__views__),n}function Y(){if(this.__filtered__){var n=new w(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n}function tn(){var n=this.__wrapped__.value(),t=this.__dir__,r=mh(n),e=t<0,u=r?n.length:0,i=zi(0,u,this.__views__),o=i.start,a=i.end,f=a-o,c=e?a:o-1,l=this.__iteratees__,s=l.length,h=0,p=Yl(f,this.__takeCount__);if(!r||!e&&u==f&&p==f)return mu(n,this.__actions__);var v=[];n:for(;f--&&h<p;){c+=t;for(var _=-1,y=n[c];++_<s;){var g=l[_],d=g.iteratee,b=g.type,w=d(y);if(b==Cn)y=w;else if(!w){if(b==Un)continue n;break n}}v[h++]=y}return v}function rn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Vt(){this.__data__=as?as(null):{},this.size=0}function rr(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t}function er(n){var t=this.__data__;if(as){var r=t[n];return r===ln?un:r}return ml.call(t,n)?t[n]:un}function ur(n){var t=this.__data__;return as?t[n]!==un:ml.call(t,n)}function ir(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=as&&t===un?ln:t,this}function or(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function ar(){this.__data__=[],this.size=0}function fr(n){var t=this.__data__,r=Cr(t,n);if(r<0)return!1;var e=t.length-1;return r==e?t.pop():Tl.call(t,r,1),--this.size,!0}function cr(n){var t=this.__data__,r=Cr(t,n);return r<0?un:t[r][1]}function lr(n){return Cr(this.__data__,n)>-1}function sr(n,t){var r=this.__data__,e=Cr(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this}function hr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function pr(){this.size=0,this.__data__={hash:new rn,map:new(es||or),string:new rn}}function vr(n){var t=ki(this,n).delete(n);return this.size-=t?1:0,t}function _r(n){return ki(this,n).get(n)}function yr(n){return ki(this,n).has(n)}function gr(n,t){var r=ki(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this}function dr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new hr;++t<r;)this.add(n[t])}function br(n){return this.__data__.set(n,ln),this}function wr(n){return this.__data__.has(n)}function mr(n){var t=this.__data__=new or(n);this.size=t.size}function xr(){this.__data__=new or,this.size=0}function Ar(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r}function jr(n){return this.__data__.get(n)}function kr(n){return this.__data__.has(n)}function Or(n,t){var r=this.__data__;if(r instanceof or){var e=r.__data__;if(!es||e.length<an-1)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new hr(e)}return r.set(n,t),this.size=r.size,this}function Ir(n,t){var r=mh(n),e=!r&&wh(n),u=!r&&!e&&Ah(n),i=!r&&!e&&!u&&Sh(n),o=r||e||u||i,a=o?C(n.length,vl):[],f=a.length;for(var c in n)!t&&!ml.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Bi(c,f))||a.push(c);return a}function Sr(n){var t=n.length;return t?n[ru(0,t-1)]:un}function zr(n,t){return to(Mu(n),Fr(t,0,n.length))}function Rr(n){return to(Mu(n))}function Er(n,t,r){(r===un||Ja(n[t],r))&&(r!==un||t in n)||Br(n,t,r)}function Ur(n,t,r){var e=n[t];ml.call(n,t)&&Ja(e,r)&&(r!==un||t in n)||Br(n,t,r)}function Cr(n,t){for(var r=n.length;r--;)if(Ja(n[r][0],t))return r;return-1}function Wr(n,t,r,e){return bs(n,function(n,u,i){t(e,n,r(n),i)}),e}function Tr(n,t){return n&&Pu(t,Kf(t),n)}function Lr(n,t){return n&&Pu(t,qf(t),n)}function Br(n,t,r){"__proto__"==t&&Fl?Fl(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function Dr(n,t){for(var r=-1,e=t.length,u=al(e),i=null==n;++r<e;)u[r]=i?un:$f(n,t[r]);return u}function Fr(n,t,r){return n===n&&(r!==un&&(n=n<=r?n:r),t!==un&&(n=n>=t?n:t)),n}function Mr(n,t,r,e,u,i){var o,a=t&pn,f=t&vn,l=t&_n;if(r&&(o=u?r(n,e,u,i):r(n)),o!==un)return o;if(!cf(n))return n;var s=mh(n);if(s){if(o=Ui(n),!a)return Mu(n,o)}else{var h=Es(n),p=h==Hn||h==Yn;if(Ah(n))return Su(n,a);if(h==tt||h==Nn||p&&!u){if(o=f||p?{}:Ci(n),!a)return f?Nu(n,Lr(o,n)):$u(n,Tr(o,n))}else{if(!Qr[h])return u?n:{};o=Wi(n,h,Mr,a)}}i||(i=new mr);var v=i.get(n);if(v)return v;i.set(n,o);var _=l?f?mi:wi:f?qf:Kf,y=s?un:_(n);return c(y||n,function(e,u){y&&(u=e,e=n[u]),Ur(o,u,Mr(e,t,r,u,n,i))}),o}function Pr(n){var t=Kf(n);return function(r){return $r(r,n,t)}}function $r(n,t,r){var e=r.length;if(null==n)return!e;for(n=hl(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===un&&!(u in n)||!i(o))return!1}return!0}function Kr(n,t,r){if("function"!=typeof n)throw new _l(cn);return Ws(function(){n.apply(un,r)},t)}function qr(n,t,r,e){var u=-1,i=p,o=!0,a=n.length,f=[],c=t.length;if(!a)return f;r&&(t=_(t,T(r))),e?(i=v,o=!1):t.length>=an&&(i=B,o=!1,t=new dr(t));n:for(;++u<a;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s===s){for(var h=c;h--;)if(t[h]===s)continue n;f.push(l)}else i(t,s,e)||f.push(l)}return f}function Zr(n,t){var r=!0;return bs(n,function(n,e,u){return r=!!t(n,e,u)}),r}function Gr(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(a===un?o===o&&!mf(o):r(o,a)))var a=o,f=i}return f}function Xr(n,t,r,e){var u=n.length;for(r=If(r),r<0&&(r=-r>u?0:u+r),e=e===un||e>u?u:If(e),e<0&&(e+=u),e=r>e?0:Sf(e);r<e;)n[r++]=t;return n}function ne(n,t){var r=[];return bs(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function te(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=Li),u||(u=[]);++i<o;){var a=n[i];t>0&&r(a)?t>1?te(a,t-1,r,e,u):y(u,a):e||(u[u.length]=a)}return u}function re(n,t){return n&&ms(n,t,Kf)}function ie(n,t){return n&&xs(n,t,Kf)}function oe(n,t){return h(t,function(t){return of(n[t])})}function fe(n,t){t=Ou(t,n);for(var r=0,e=t.length;null!=n&&r<e;)n=n[ro(t[r++])];return r&&r==e?n:un}function ce(n,t,r){var e=t(n);return mh(n)?e:y(e,r(n))}function se(n){return null==n?n===un?ft:nt:Dl&&Dl in hl(n)?Si(n):Ji(n)}function he(n,t){return n>t}function be(n,t){return null!=n&&ml.call(n,t)}function Ae(n,t){return null!=n&&t in hl(n)}function ke(n,t,r){return n>=Yl(t,r)&&n<Hl(t,r)}function Oe(n,t,r){for(var e=r?v:p,u=n[0].length,i=n.length,o=i,a=al(i),f=1/0,c=[];o--;){var l=n[o];o&&t&&(l=_(l,T(t))),f=Yl(l.length,f),a[o]=!r&&(t||u>=120&&l.length>=120)?new dr(o&&l):un}l=n[0];var s=-1,h=a[0];n:for(;++s<u&&c.length<f;){var y=l[s],g=t?t(y):y;if(y=r||0!==y?y:0,!(h?B(h,g):e(c,g,r))){for(o=i;--o;){var d=a[o];if(!(d?B(d,g):e(n[o],g,r)))continue n}h&&h.push(g),c.push(y)}}return c}function Ie(n,t,r,e){return re(n,function(n,u,i){t(e,r(n),u,i)}),e}function Se(n,t,r){t=Ou(t,n),n=Yi(n,t);var e=null==n?n:n[ro(ko(t))];return null==e?un:a(e,n,r)}function ze(n){return lf(n)&&se(n)==Nn}function Re(n){return lf(n)&&se(n)==st}function Ee(n){return lf(n)&&se(n)==Zn}function Ue(n,t,r,e,u){return n===t||(null==n||null==t||!lf(n)&&!lf(t)?n!==n&&t!==t:Ce(n,t,r,e,Ue,u))}function Ce(n,t,r,e,u,i){var o=mh(n),a=mh(t),f=o?Vn:Es(n),c=a?Vn:Es(t);f=f==Nn?tt:f,c=c==Nn?tt:c;var l=f==tt,s=c==tt,h=f==c;if(h&&Ah(n)){if(!Ah(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new mr),o||Sh(n)?yi(n,t,r,e,u,i):gi(n,t,f,r,e,u,i);if(!(r&yn)){var p=l&&ml.call(n,"__wrapped__"),v=s&&ml.call(t,"__wrapped__");if(p||v){var _=p?n.value():n,y=v?t.value():t;return i||(i=new mr),u(_,y,r,e,i)}}return!!h&&(i||(i=new mr),di(n,t,r,e,u,i))}function We(n){return lf(n)&&Es(n)==Qn}function Te(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=hl(n);u--;){var a=r[u];if(o&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++u<i;){a=r[u];var f=a[0],c=n[f],l=a[1];if(o&&a[2]){if(c===un&&!(f in n))return!1}else{var s=new mr;if(e)var h=e(c,l,f,n,t,s);if(!(h===un?Ue(l,c,yn|gn,e,s):h))return!1}}return!0}function Le(n){if(!cf(n)||$i(n))return!1;var t=of(n)?Il:Ht;return t.test(eo(n))}function Be(n){return lf(n)&&se(n)==ut}function De(n){return lf(n)&&Es(n)==it}function Fe(n){return lf(n)&&ff(n.length)&&!!Yr[se(n)]}function Me(n){return"function"==typeof n?n:null==n?Tc:"object"==typeof n?mh(n)?qe(n[0],n[1]):Ke(n):Nc(n)}function Pe(n){if(!Ni(n))return Jl(n);var t=[];for(var r in hl(n))ml.call(n,r)&&"constructor"!=r&&t.push(r);return t}function $e(n){if(!cf(n))return Gi(n);var t=Ni(n),r=[];for(var e in n)("constructor"!=e||!t&&ml.call(n,e))&&r.push(e);return r}function Ne(n,t){return n<t}function Ve(n,t){var r=-1,e=Ha(n)?al(n.length):[];return bs(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Ke(n){var t=Oi(n);return 1==t.length&&t[0][2]?Ki(t[0][0],t[0][1]):function(r){return r===n||Te(r,n,t)}}function qe(n,t){return Fi(n)&&Vi(t)?Ki(ro(n),t):function(r){var e=$f(r,n);return e===un&&e===t?Vf(r,n):Ue(t,e,yn|gn)}}function Ze(n,t,r,e,u){n!==t&&ms(t,function(i,o){if(cf(i))u||(u=new mr),Ge(n,t,o,r,Ze,e,u);else{var a=e?e(n[o],i,o+"",n,t,u):un;a===un&&(a=i),Er(n,o,a)}},qf)}function Ge(n,t,r,e,u,i,o){var a=n[r],f=t[r],c=o.get(f);if(c)return void Er(n,r,c);var l=i?i(a,f,r+"",n,t,o):un,s=l===un;if(s){var h=mh(f),p=!h&&Ah(f),v=!h&&!p&&Sh(f);l=f,h||p||v?mh(a)?l=a:Ya(a)?l=Mu(a):p?(s=!1,l=Su(f,!0)):v?(s=!1,l=Tu(f,!0)):l=[]:df(f)||wh(f)?(l=a,wh(a)?l=Rf(a):(!cf(a)||e&&of(a))&&(l=Ci(f))):s=!1}s&&(o.set(f,l),u(l,f,e,i,o),o.delete(f)),Er(n,r,l)}function Je(n,t){var r=n.length;if(r)return t+=t<0?r:0,Bi(t,r)?n[t]:un}function He(n,t,r){var e=-1;t=_(t.length?t:[Tc],T(ji()));var u=Ve(n,function(n,r,u){var i=_(t,function(t){return t(n)});return{criteria:i,index:++e,value:n}});return E(u,function(n,t){return Bu(n,t,r)})}function Ye(n,t){return Qe(n,t,function(t,r){return Vf(n,r)})}function Qe(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],a=fe(n,o);r(a,o)&&fu(i,Ou(o,n),a)}return i}function Xe(n){return function(t){return fe(t,n)}}function nu(n,t,r,e){
16
+ var u=e?k:j,i=-1,o=t.length,a=n;for(n===t&&(t=Mu(t)),r&&(a=_(n,T(r)));++i<o;)for(var f=0,c=t[i],l=r?r(c):c;(f=u(a,l,f,e))>-1;)a!==n&&Tl.call(a,f,1),Tl.call(n,f,1);return n}function tu(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Bi(u)?Tl.call(n,u,1):du(n,u)}}return n}function ru(n,t){return n+Vl(ns()*(t-n+1))}function eu(n,t,r,e){for(var u=-1,i=Hl(Nl((t-n)/(r||1)),0),o=al(i);i--;)o[e?i:++u]=n,n+=r;return o}function uu(n,t){var r="";if(!n||t<1||t>Ln)return r;do t%2&&(r+=n),t=Vl(t/2),t&&(n+=n);while(t);return r}function iu(n,t){return Ts(Hi(n,t,Tc),n+"")}function ou(n){return Sr(uc(n))}function au(n,t){var r=uc(n);return to(r,Fr(t,0,r.length))}function fu(n,t,r,e){if(!cf(n))return n;t=Ou(t,n);for(var u=-1,i=t.length,o=i-1,a=n;null!=a&&++u<i;){var f=ro(t[u]),c=r;if(u!=o){var l=a[f];c=e?e(l,f,a):un,c===un&&(c=cf(l)?l:Bi(t[u+1])?[]:{})}Ur(a,f,c),a=a[f]}return n}function cu(n){return to(uc(n))}function lu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),r=r>u?u:r,r<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=al(u);++e<u;)i[e]=n[e+t];return i}function su(n,t){var r;return bs(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function hu(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t===t&&u<=Pn){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!mf(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return pu(n,t,Tc,r)}function pu(n,t,r,e){t=r(t);for(var u=0,i=null==n?0:n.length,o=t!==t,a=null===t,f=mf(t),c=t===un;u<i;){var l=Vl((u+i)/2),s=r(n[l]),h=s!==un,p=null===s,v=s===s,_=mf(s);if(o)var y=e||v;else y=c?v&&(e||h):a?v&&h&&(e||!p):f?v&&h&&!p&&(e||!_):!p&&!_&&(e?s<=t:s<t);y?u=l+1:i=l}return Yl(i,Mn)}function vu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],a=t?t(o):o;if(!r||!Ja(a,f)){var f=a;i[u++]=0===o?0:o}}return i}function _u(n){return"number"==typeof n?n:mf(n)?Dn:+n}function yu(n){if("string"==typeof n)return n;if(mh(n))return _(n,yu)+"";if(mf(n))return gs?gs.call(n):"";var t=n+"";return"0"==t&&1/n==-Tn?"-0":t}function gu(n,t,r){var e=-1,u=p,i=n.length,o=!0,a=[],f=a;if(r)o=!1,u=v;else if(i>=an){var c=t?null:Is(n);if(c)return J(c);o=!1,u=B,f=new dr}else f=t?[]:a;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s===s){for(var h=f.length;h--;)if(f[h]===s)continue n;t&&f.push(s),a.push(l)}else u(f,s,r)||(f!==a&&f.push(s),a.push(l))}return a}function du(n,t){return t=Ou(t,n),n=Yi(n,t),null==n||delete n[ro(ko(t))]}function bu(n,t,r,e){return fu(n,t,r(fe(n,t)),e)}function wu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?lu(n,e?0:i,e?i+1:u):lu(n,e?i+1:0,e?u:i)}function mu(n,t){var r=n;return r instanceof w&&(r=r.value()),g(t,function(n,t){return t.func.apply(t.thisArg,y([n],t.args))},r)}function xu(n,t,r){var e=n.length;if(e<2)return e?gu(n[0]):[];for(var u=-1,i=al(e);++u<e;)for(var o=n[u],a=-1;++a<e;)a!=u&&(i[u]=qr(i[u]||o,n[a],t,r));return gu(te(i,1),t,r)}function Au(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;){var a=e<i?t[e]:un;r(o,n[e],a)}return o}function ju(n){return Ya(n)?n:[]}function ku(n){return"function"==typeof n?n:Tc}function Ou(n,t){return mh(n)?n:Fi(n,t)?[n]:Ls(Uf(n))}function Iu(n,t,r){var e=n.length;return r=r===un?e:r,!t&&r>=e?n:lu(n,t,r)}function Su(n,t){if(t)return n.slice();var r=n.length,e=El?El(r):new n.constructor(r);return n.copy(e),e}function zu(n){var t=new n.constructor(n.byteLength);return new Rl(t).set(new Rl(n)),t}function Ru(n,t){var r=t?zu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}function Eu(n,t,r){var e=t?r(q(n),pn):q(n);return g(e,i,new n.constructor)}function Uu(n){var t=new n.constructor(n.source,Zt.exec(n));return t.lastIndex=n.lastIndex,t}function Cu(n,t,r){var e=t?r(J(n),pn):J(n);return g(e,o,new n.constructor)}function Wu(n){return ys?hl(ys.call(n)):{}}function Tu(n,t){var r=t?zu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function Lu(n,t){if(n!==t){var r=n!==un,e=null===n,u=n===n,i=mf(n),o=t!==un,a=null===t,f=t===t,c=mf(t);if(!a&&!c&&!i&&n>t||i&&o&&f&&!a&&!c||e&&o&&f||!r&&f||!u)return 1;if(!e&&!i&&!c&&n<t||c&&r&&u&&!e&&!i||a&&r&&u||!o&&u||!f)return-1}return 0}function Bu(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,a=r.length;++e<o;){var f=Lu(u[e],i[e]);if(f){if(e>=a)return f;var c=r[e];return f*("desc"==c?-1:1)}}return n.index-t.index}function Du(n,t,r,e){for(var u=-1,i=n.length,o=r.length,a=-1,f=t.length,c=Hl(i-o,0),l=al(f+c),s=!e;++a<f;)l[a]=t[a];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[a++]=n[u++];return l}function Fu(n,t,r,e){for(var u=-1,i=n.length,o=-1,a=r.length,f=-1,c=t.length,l=Hl(i-a,0),s=al(l+c),h=!e;++u<l;)s[u]=n[u];for(var p=u;++f<c;)s[p+f]=t[f];for(;++o<a;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Mu(n,t){var r=-1,e=n.length;for(t||(t=al(e));++r<e;)t[r]=n[r];return t}function Pu(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var a=t[i],f=e?e(r[a],n[a],a,r,n):un;f===un&&(f=n[a]),u?Br(r,a,f):Ur(r,a,f)}return r}function $u(n,t){return Pu(n,zs(n),t)}function Nu(n,t){return Pu(n,Rs(n),t)}function Vu(n,t){return function(r,e){var u=mh(r)?f:Wr,i=t?t():{};return u(r,n,ji(e,2),i)}}function Ku(n){return iu(function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:un,o=u>2?r[2]:un;for(i=n.length>3&&"function"==typeof i?(u--,i):un,o&&Di(r[0],r[1],o)&&(i=u<3?un:i,u=1),t=hl(t);++e<u;){var a=r[e];a&&n(t,a,e,i)}return t})}function qu(n,t){return function(r,e){if(null==r)return r;if(!Ha(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=hl(r);(t?i--:++i<u)&&e(o[i],i,o)!==!1;);return r}}function Zu(n){return function(t,r,e){for(var u=-1,i=hl(t),o=e(t),a=o.length;a--;){var f=o[n?a:++u];if(r(i[f],f,i)===!1)break}return t}}function Gu(n,t,r){function e(){var t=this&&this!==ae&&this instanceof e?i:n;return t.apply(u?r:this,arguments)}var u=t&dn,i=Yu(n);return e}function Ju(n){return function(t){t=Uf(t);var r=N(t)?nn(t):un,e=r?r[0]:t.charAt(0),u=r?Iu(r,1).join(""):t.slice(1);return e[n]()+u}}function Hu(n){return function(t){return g(Rc(lc(t).replace(Nr,"")),n,"")}}function Yu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=ds(n.prototype),e=n.apply(r,t);return cf(e)?e:r}}function Qu(n,t,r){function e(){for(var i=arguments.length,o=al(i),f=i,c=Ai(e);f--;)o[f]=arguments[f];var l=i<3&&o[0]!==c&&o[i-1]!==c?[]:G(o,c);if(i-=l.length,i<r)return ci(n,t,ti,e.placeholder,un,o,l,un,un,r-i);var s=this&&this!==ae&&this instanceof e?u:n;return a(s,this,o)}var u=Yu(n);return e}function Xu(n){return function(t,r,e){var u=hl(t);if(!Ha(t)){var i=ji(r,3);t=Kf(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:un}}function ni(n){return bi(function(t){var r=t.length,e=r,i=u.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if("function"!=typeof o)throw new _l(cn);if(i&&!a&&"wrapper"==xi(o))var a=new u([],!0)}for(e=a?e:r;++e<r;){o=t[e];var f=xi(o),c="wrapper"==f?Ss(o):un;a=c&&Pi(c[0])&&c[1]==(kn|mn|An|On)&&!c[4].length&&1==c[9]?a[xi(c[0])].apply(a,c[3]):1==o.length&&Pi(o)?a[f]():a.thru(o)}return function(){var n=arguments,e=n[0];if(a&&1==n.length&&mh(e))return a.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function ti(n,t,r,e,u,i,o,a,f,c){function l(){for(var g=arguments.length,d=al(g),b=g;b--;)d[b]=arguments[b];if(v)var w=Ai(l),m=M(d,w);if(e&&(d=Du(d,e,u,v)),i&&(d=Fu(d,i,o,v)),g-=m,v&&g<c){var x=G(d,w);return ci(n,t,ti,l.placeholder,r,d,x,a,f,c-g)}var A=h?r:this,j=p?A[n]:n;return g=d.length,a?d=Qi(d,a):_&&g>1&&d.reverse(),s&&f<g&&(d.length=f),this&&this!==ae&&this instanceof l&&(j=y||Yu(j)),j.apply(A,d)}var s=t&kn,h=t&dn,p=t&bn,v=t&(mn|xn),_=t&In,y=p?un:Yu(n);return l}function ri(n,t){return function(r,e){return Ie(r,n,t(e),{})}}function ei(n,t){return function(r,e){var u;if(r===un&&e===un)return t;if(r!==un&&(u=r),e!==un){if(u===un)return e;"string"==typeof r||"string"==typeof e?(r=yu(r),e=yu(e)):(r=_u(r),e=_u(e)),u=n(r,e)}return u}}function ui(n){return bi(function(t){return t=_(t,T(ji())),iu(function(r){var e=this;return n(t,function(n){return a(n,e,r)})})})}function ii(n,t){t=t===un?" ":yu(t);var r=t.length;if(r<2)return r?uu(t,n):t;var e=uu(t,Nl(n/X(t)));return N(t)?Iu(nn(e),0,n).join(""):e.slice(0,n)}function oi(n,t,r,e){function u(){for(var t=-1,f=arguments.length,c=-1,l=e.length,s=al(l+f),h=this&&this!==ae&&this instanceof u?o:n;++c<l;)s[c]=e[c];for(;f--;)s[c++]=arguments[++t];return a(h,i?r:this,s)}var i=t&dn,o=Yu(n);return u}function ai(n){return function(t,r,e){return e&&"number"!=typeof e&&Di(t,r,e)&&(r=e=un),t=Of(t),r===un?(r=t,t=0):r=Of(r),e=e===un?t<r?1:-1:Of(e),eu(t,r,e,n)}}function fi(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=zf(t),r=zf(r)),n(t,r)}}function ci(n,t,r,e,u,i,o,a,f,c){var l=t&mn,s=l?o:un,h=l?un:o,p=l?i:un,v=l?un:i;t|=l?An:jn,t&=~(l?jn:An),t&wn||(t&=~(dn|bn));var _=[n,t,u,p,s,v,h,a,f,c],y=r.apply(un,_);return Pi(n)&&Cs(y,_),y.placeholder=e,Xi(y,n,t)}function li(n){var t=sl[n];return function(n,r){if(n=zf(n),r=null==r?0:Yl(If(r),292)){var e=(Uf(n)+"e").split("e"),u=t(e[0]+"e"+(+e[1]+r));return e=(Uf(u)+"e").split("e"),+(e[0]+"e"+(+e[1]-r))}return t(n)}}function si(n){return function(t){var r=Es(t);return r==Qn?q(t):r==it?H(t):W(t,n(t))}}function hi(n,t,r,e,u,i,o,a){var f=t&bn;if(!f&&"function"!=typeof n)throw new _l(cn);var c=e?e.length:0;if(c||(t&=~(An|jn),e=u=un),o=o===un?o:Hl(If(o),0),a=a===un?a:If(a),c-=u?u.length:0,t&jn){var l=e,s=u;e=u=un}var h=f?un:Ss(n),p=[n,t,r,e,u,l,s,i,o,a];if(h&&Zi(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],a=p[9]=p[9]===un?f?0:n.length:Hl(p[9]-c,0),!a&&t&(mn|xn)&&(t&=~(mn|xn)),t&&t!=dn)v=t==mn||t==xn?Qu(n,t,a):t!=An&&t!=(dn|An)||u.length?ti.apply(un,p):oi(n,t,r,e);else var v=Gu(n,t,r);var _=h?As:Cs;return Xi(_(v,p),n,t)}function pi(n,t,r,e){return n===un||Ja(n,dl[r])&&!ml.call(e,r)?t:n}function vi(n,t,r,e,u,i){return cf(n)&&cf(t)&&(i.set(t,n),Ze(n,t,un,vi,i),i.delete(t)),n}function _i(n,t){return t!==un&&df(n)?un:n}function yi(n,t,r,e,u,i){var o=r&yn,a=n.length,f=t.length;if(a!=f&&!(o&&f>a))return!1;var c=i.get(n);if(c&&i.get(t))return c==t;var l=-1,s=!0,h=r&gn?new dr:un;for(i.set(n,t),i.set(t,n);++l<a;){var p=n[l],v=t[l];if(e)var _=o?e(v,p,l,t,n,i):e(p,v,l,n,t,i);if(_!==un){if(_)continue;s=!1;break}if(h){if(!b(t,function(n,t){if(!B(h,t)&&(p===n||u(p,n,r,e,i)))return h.push(t)})){s=!1;break}}else if(p!==v&&!u(p,v,r,e,i)){s=!1;break}}return i.delete(n),i.delete(t),s}function gi(n,t,r,e,u,i,o){switch(r){case ht:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case st:return!(n.byteLength!=t.byteLength||!i(new Rl(n),new Rl(t)));case qn:case Zn:case Xn:return Ja(+n,+t);case Jn:return n.name==t.name&&n.message==t.message;case ut:case ot:return n==t+"";case Qn:var a=q;case it:var f=e&yn;if(a||(a=J),n.size!=t.size&&!f)return!1;var c=o.get(n);if(c)return c==t;e|=gn,o.set(n,t);var l=yi(a(n),a(t),e,u,i,o);return o.delete(n),l;case at:if(ys)return ys.call(n)==ys.call(t)}return!1}function di(n,t,r,e,u,i){var o=r&yn,a=wi(n),f=a.length,c=wi(t),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var h=a[s];if(!(o?h in t:ml.call(t,h)))return!1}var p=i.get(n);if(p&&i.get(t))return p==t;var v=!0;i.set(n,t),i.set(t,n);for(var _=o;++s<f;){h=a[s];var y=n[h],g=t[h];if(e)var d=o?e(g,y,h,t,n,i):e(y,g,h,n,t,i);if(!(d===un?y===g||u(y,g,r,e,i):d)){v=!1;break}_||(_="constructor"==h)}if(v&&!_){var b=n.constructor,w=t.constructor;b!=w&&"constructor"in n&&"constructor"in t&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(v=!1)}return i.delete(n),i.delete(t),v}function bi(n){return Ts(Hi(n,un,yo),n+"")}function wi(n){return ce(n,Kf,zs)}function mi(n){return ce(n,qf,Rs)}function xi(n){for(var t=n.name+"",r=cs[t],e=ml.call(cs,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function Ai(n){var t=ml.call(r,"placeholder")?r:n;return t.placeholder}function ji(){var n=r.iteratee||Lc;return n=n===Lc?Me:n,arguments.length?n(arguments[0],arguments[1]):n}function ki(n,t){var r=n.__data__;return Mi(t)?r["string"==typeof t?"string":"hash"]:r.map}function Oi(n){for(var t=Kf(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,Vi(u)]}return t}function Ii(n,t){var r=$(n,t);return Le(r)?r:un}function Si(n){var t=ml.call(n,Dl),r=n[Dl];try{n[Dl]=un;var e=!0}catch(n){}var u=jl.call(n);return e&&(t?n[Dl]=r:delete n[Dl]),u}function zi(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=Yl(t,n+o);break;case"takeRight":n=Hl(n,t-o)}}return{start:n,end:t}}function Ri(n){var t=n.match($t);return t?t[1].split(Nt):[]}function Ei(n,t,r){t=Ou(t,n);for(var e=-1,u=t.length,i=!1;++e<u;){var o=ro(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:(u=null==n?0:n.length,!!u&&ff(u)&&Bi(o,u)&&(mh(n)||wh(n)))}function Ui(n){var t=n.length,r=n.constructor(t);return t&&"string"==typeof n[0]&&ml.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Ci(n){return"function"!=typeof n.constructor||Ni(n)?{}:ds(Ul(n))}function Wi(n,t,r,e){var u=n.constructor;switch(t){case st:return zu(n);case qn:case Zn:return new u(+n);case ht:return Ru(n,e);case pt:case vt:case _t:case yt:case gt:case dt:case bt:case wt:case mt:return Tu(n,e);case Qn:return Eu(n,e,r);case Xn:case ot:return new u(n);case ut:return Uu(n);case it:return Cu(n,e,r);case at:return Wu(n)}}function Ti(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Pt,"{\\n/* [wrapped with "+t+"] */\\n")}function Li(n){return mh(n)||wh(n)||!!(Ll&&n&&n[Ll])}function Bi(n,t){return t=null==t?Ln:t,!!t&&("number"==typeof n||Qt.test(n))&&n>-1&&n%1==0&&n<t}function Di(n,t,r){if(!cf(r))return!1;var e=typeof t;return!!("number"==e?Ha(r)&&Bi(t,r.length):"string"==e&&t in r)&&Ja(r[t],n)}function Fi(n,t){if(mh(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!mf(n))||(Ct.test(n)||!Ut.test(n)||null!=t&&n in hl(t))}function Mi(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}function Pi(n){var t=xi(n),e=r[t];if("function"!=typeof e||!(t in w.prototype))return!1;if(n===e)return!0;var u=Ss(e);return!!u&&n===u[0]}function $i(n){return!!Al&&Al in n}function Ni(n){var t=n&&n.constructor,r="function"==typeof t&&t.prototype||dl;return n===r}function Vi(n){return n===n&&!cf(n)}function Ki(n,t){return function(r){return null!=r&&(r[n]===t&&(t!==un||n in hl(r)))}}function qi(n){var t=Ta(n,function(n){return r.size===sn&&r.clear(),n}),r=t.cache;return t}function Zi(n,t){var r=n[1],e=t[1],u=r|e,i=u<(dn|bn|kn),o=e==kn&&r==mn||e==kn&&r==On&&n[7].length<=t[8]||e==(kn|On)&&t[7].length<=t[8]&&r==mn;if(!i&&!o)return n;e&dn&&(n[2]=t[2],u|=r&dn?0:wn);var a=t[3];if(a){var f=n[3];n[3]=f?Du(f,a,t[4]):a,n[4]=f?G(n[3],hn):t[4]}return a=t[5],a&&(f=n[5],n[5]=f?Fu(f,a,t[6]):a,n[6]=f?G(n[5],hn):t[6]),a=t[7],a&&(n[7]=a),e&kn&&(n[8]=null==n[8]?t[8]:Yl(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u,n}function Gi(n){var t=[];if(null!=n)for(var r in hl(n))t.push(r);return t}function Ji(n){return jl.call(n)}function Hi(n,t,r){return t=Hl(t===un?n.length-1:t,0),function(){for(var e=arguments,u=-1,i=Hl(e.length-t,0),o=al(i);++u<i;)o[u]=e[t+u];u=-1;for(var f=al(t+1);++u<t;)f[u]=e[u];return f[t]=r(o),a(n,this,f)}}function Yi(n,t){return t.length<2?n:fe(n,lu(t,0,-1))}function Qi(n,t){for(var r=n.length,e=Yl(t.length,r),u=Mu(n);e--;){var i=t[e];n[e]=Bi(i,r)?u[i]:un}return n}function Xi(n,t,r){var e=t+"";return Ts(n,Ti(e,uo(Ri(e),r)))}function no(n){var t=0,r=0;return function(){var e=Ql(),u=En-(e-r);if(r=e,u>0){if(++t>=Rn)return arguments[0]}else t=0;return n.apply(un,arguments)}}function to(n,t){var r=-1,e=n.length,u=e-1;for(t=t===un?e:t;++r<t;){var i=ru(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function ro(n){if("string"==typeof n||mf(n))return n;var t=n+"";return"0"==t&&1/n==-Tn?"-0":t}function eo(n){if(null!=n){try{return wl.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function uo(n,t){return c($n,function(r){var e="_."+r[0];t&r[1]&&!p(n,e)&&n.push(e)}),n.sort()}function io(n){if(n instanceof w)return n.clone();var t=new u(n.__wrapped__,n.__chain__);return t.__actions__=Mu(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function oo(n,t,r){t=(r?Di(n,t,r):t===un)?1:Hl(If(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=al(Nl(e/t));u<e;)o[i++]=lu(n,u,u+=t);return o}function ao(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u}function fo(){var n=arguments.length;if(!n)return[];for(var t=al(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return y(mh(r)?Mu(r):[r],te(t,1))}function co(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===un?1:If(t),lu(n,t<0?0:t,e)):[]}function lo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===un?1:If(t),t=e-t,lu(n,0,t<0?0:t)):[]}function so(n,t){return n&&n.length?wu(n,ji(t,3),!0,!0):[]}function ho(n,t){return n&&n.length?wu(n,ji(t,3),!0):[]}function po(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&Di(n,t,r)&&(r=0,e=u),Xr(n,t,r,e)):[]}function vo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:If(r);return u<0&&(u=Hl(e+u,0)),A(n,ji(t,3),u)}function _o(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==un&&(u=If(r),u=r<0?Hl(e+u,0):Yl(u,e-1)),A(n,ji(t,3),u,!0)}function yo(n){var t=null==n?0:n.length;return t?te(n,1):[]}function go(n){var t=null==n?0:n.length;return t?te(n,Tn):[]}function bo(n,t){var r=null==n?0:n.length;return r?(t=t===un?1:If(t),te(n,t)):[]}function wo(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e}function mo(n){return n&&n.length?n[0]:un}function xo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:If(r);return u<0&&(u=Hl(e+u,0)),j(n,t,u)}function Ao(n){var t=null==n?0:n.length;return t?lu(n,0,-1):[]}function jo(n,t){return null==n?"":Gl.call(n,t)}function ko(n){var t=null==n?0:n.length;return t?n[t-1]:un}function Oo(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==un&&(u=If(r),u=u<0?Hl(e+u,0):Yl(u,e-1)),t===t?Q(n,t,u):A(n,O,u,!0)}function Io(n,t){return n&&n.length?Je(n,If(t)):un}function So(n,t){return n&&n.length&&t&&t.length?nu(n,t):n}function zo(n,t,r){return n&&n.length&&t&&t.length?nu(n,t,ji(r,2)):n}function Ro(n,t,r){return n&&n.length&&t&&t.length?nu(n,t,un,r):n}function Eo(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ji(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return tu(n,u),r}function Uo(n){return null==n?n:ts.call(n)}function Co(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&Di(n,t,r)?(t=0,r=e):(t=null==t?0:If(t),r=r===un?e:If(r)),lu(n,t,r)):[]}function Wo(n,t){return hu(n,t)}function To(n,t,r){return pu(n,t,ji(r,2))}function Lo(n,t){var r=null==n?0:n.length;if(r){var e=hu(n,t);if(e<r&&Ja(n[e],t))return e}return-1}function Bo(n,t){return hu(n,t,!0)}function Do(n,t,r){return pu(n,t,ji(r,2),!0)}function Fo(n,t){var r=null==n?0:n.length;if(r){var e=hu(n,t,!0)-1;if(Ja(n[e],t))return e}return-1}function Mo(n){return n&&n.length?vu(n):[]}function Po(n,t){return n&&n.length?vu(n,ji(t,2)):[]}function $o(n){var t=null==n?0:n.length;return t?lu(n,1,t):[]}function No(n,t,r){return n&&n.length?(t=r||t===un?1:If(t),lu(n,0,t<0?0:t)):[]}function Vo(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===un?1:If(t),t=e-t,lu(n,t<0?0:t,e)):[]}function Ko(n,t){return n&&n.length?wu(n,ji(t,3),!1,!0):[]}function qo(n,t){return n&&n.length?wu(n,ji(t,3)):[]}function Zo(n){return n&&n.length?gu(n):[]}function Go(n,t){return n&&n.length?gu(n,ji(t,2)):[]}function Jo(n,t){return t="function"==typeof t?t:un,n&&n.length?gu(n,un,t):[]}function Ho(n){if(!n||!n.length)return[];var t=0;return n=h(n,function(n){if(Ya(n))return t=Hl(n.length,t),!0}),C(t,function(t){return _(n,S(t))})}function Yo(n,t){if(!n||!n.length)return[];var r=Ho(n);return null==t?r:_(r,function(n){return a(t,un,n)})}function Qo(n,t){return Au(n||[],t||[],Ur)}function Xo(n,t){return Au(n||[],t||[],fu)}function na(n){var t=r(n);return t.__chain__=!0,t}function ta(n,t){return t(n),n}function ra(n,t){return t(n)}function ea(){return na(this)}function ua(){return new u(this.value(),this.__chain__)}function ia(){this.__values__===un&&(this.__values__=kf(this.value()));var n=this.__index__>=this.__values__.length,t=n?un:this.__values__[this.__index__++];return{done:n,value:t}}function oa(){return this}function aa(n){for(var t,r=this;r instanceof e;){var u=io(r);u.__index__=0,u.__values__=un,t?i.__wrapped__=u:t=u;var i=u;r=r.__wrapped__}return i.__wrapped__=n,t}function fa(){var n=this.__wrapped__;if(n instanceof w){var t=n;return this.__actions__.length&&(t=new w(this)),t=t.reverse(),t.__actions__.push({func:ra,args:[Uo],thisArg:un}),new u(t,this.__chain__)}return this.thru(Uo)}function ca(){return mu(this.__wrapped__,this.__actions__)}function la(n,t,r){var e=mh(n)?s:Zr;return r&&Di(n,t,r)&&(t=un),e(n,ji(t,3))}function sa(n,t){var r=mh(n)?h:ne;return r(n,ji(t,3))}function ha(n,t){return te(da(n,t),1)}function pa(n,t){return te(da(n,t),Tn)}function va(n,t,r){return r=r===un?1:If(r),te(da(n,t),r)}function _a(n,t){var r=mh(n)?c:bs;return r(n,ji(t,3))}function ya(n,t){var r=mh(n)?l:ws;return r(n,ji(t,3))}function ga(n,t,r,e){n=Ha(n)?n:uc(n),r=r&&!e?If(r):0;var u=n.length;return r<0&&(r=Hl(u+r,0)),wf(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&j(n,t,r)>-1}function da(n,t){var r=mh(n)?_:Ve;return r(n,ji(t,3))}function ba(n,t,r,e){return null==n?[]:(mh(t)||(t=null==t?[]:[t]),r=e?un:r,mh(r)||(r=null==r?[]:[r]),He(n,t,r))}function wa(n,t,r){var e=mh(n)?g:R,u=arguments.length<3;return e(n,ji(t,4),r,u,bs)}function ma(n,t,r){var e=mh(n)?d:R,u=arguments.length<3;return e(n,ji(t,4),r,u,ws)}function xa(n,t){var r=mh(n)?h:ne;return r(n,La(ji(t,3)))}function Aa(n){var t=mh(n)?Sr:ou;return t(n)}function ja(n,t,r){t=(r?Di(n,t,r):t===un)?1:If(t);var e=mh(n)?zr:au;return e(n,t)}function ka(n){var t=mh(n)?Rr:cu;return t(n)}function Oa(n){if(null==n)return 0;if(Ha(n))return wf(n)?X(n):n.length;var t=Es(n);return t==Qn||t==it?n.size:Pe(n).length}function Ia(n,t,r){var e=mh(n)?b:su;return r&&Di(n,t,r)&&(t=un),e(n,ji(t,3))}function Sa(n,t){if("function"!=typeof t)throw new _l(cn);return n=If(n),function(){if(--n<1)return t.apply(this,arguments)}}function za(n,t,r){return t=r?un:t,t=n&&null==t?n.length:t,hi(n,kn,un,un,un,un,t)}function Ra(n,t){var r;if("function"!=typeof t)throw new _l(cn);return n=If(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=un),r}}function Ea(n,t,r){t=r?un:t;var e=hi(n,mn,un,un,un,un,un,t);return e.placeholder=Ea.placeholder,e}function Ua(n,t,r){t=r?un:t;var e=hi(n,xn,un,un,un,un,un,t);return e.placeholder=Ua.placeholder,e}function Ca(n,t,r){function e(t){var r=h,e=p;return h=p=un,d=t,_=n.apply(e,r)}function u(n){return d=n,y=Ws(a,t),b?e(n):_}function i(n){var r=n-g,e=n-d,u=t-r;return w?Yl(u,v-e):u}function o(n){var r=n-g,e=n-d;return g===un||r>=t||r<0||w&&e>=v}function a(){var n=ch();return o(n)?f(n):void(y=Ws(a,i(n)))}function f(n){return y=un,m&&h?e(n):(h=p=un,_)}function c(){y!==un&&Os(y),d=0,h=g=p=y=un}function l(){return y===un?_:f(ch())}function s(){var n=ch(),r=o(n);if(h=arguments,p=this,g=n,r){if(y===un)return u(g);if(w)return y=Ws(a,t),e(g)}return y===un&&(y=Ws(a,t)),_}var h,p,v,_,y,g,d=0,b=!1,w=!1,m=!0;if("function"!=typeof n)throw new _l(cn);return t=zf(t)||0,cf(r)&&(b=!!r.leading,w="maxWait"in r,v=w?Hl(zf(r.maxWait)||0,t):v,m="trailing"in r?!!r.trailing:m),s.cancel=c,s.flush=l,s}function Wa(n){return hi(n,In)}function Ta(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new _l(cn);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Ta.Cache||hr),r}function La(n){if("function"!=typeof n)throw new _l(cn);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Ba(n){return Ra(2,n)}function Da(n,t){if("function"!=typeof n)throw new _l(cn);return t=t===un?t:If(t),iu(n,t)}function Fa(n,t){if("function"!=typeof n)throw new _l(cn);return t=null==t?0:Hl(If(t),0),iu(function(r){var e=r[t],u=Iu(r,0,t);return e&&y(u,e),a(n,this,u)})}function Ma(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new _l(cn);return cf(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Ca(n,t,{leading:e,maxWait:t,trailing:u})}function Pa(n){return za(n,1)}function $a(n,t){return _h(ku(t),n)}function Na(){if(!arguments.length)return[];var n=arguments[0];return mh(n)?n:[n]}function Va(n){return Mr(n,_n)}function Ka(n,t){return t="function"==typeof t?t:un,Mr(n,_n,t)}function qa(n){return Mr(n,pn|_n)}function Za(n,t){return t="function"==typeof t?t:un,Mr(n,pn|_n,t)}function Ga(n,t){return null==t||$r(n,t,Kf(t))}function Ja(n,t){return n===t||n!==n&&t!==t}function Ha(n){return null!=n&&ff(n.length)&&!of(n)}function Ya(n){return lf(n)&&Ha(n)}function Qa(n){return n===!0||n===!1||lf(n)&&se(n)==qn}function Xa(n){return lf(n)&&1===n.nodeType&&!df(n)}function nf(n){if(null==n)return!0;if(Ha(n)&&(mh(n)||"string"==typeof n||"function"==typeof n.splice||Ah(n)||Sh(n)||wh(n)))return!n.length;var t=Es(n);if(t==Qn||t==it)return!n.size;if(Ni(n))return!Pe(n).length;for(var r in n)if(ml.call(n,r))return!1;return!0}function tf(n,t){return Ue(n,t)}function rf(n,t,r){r="function"==typeof r?r:un;var e=r?r(n,t):un;return e===un?Ue(n,t,un,r):!!e}function ef(n){if(!lf(n))return!1;var t=se(n);return t==Jn||t==Gn||"string"==typeof n.message&&"string"==typeof n.name&&!df(n)}function uf(n){return"number"==typeof n&&Zl(n)}function of(n){if(!cf(n))return!1;var t=se(n);return t==Hn||t==Yn||t==Kn||t==et}function af(n){return"number"==typeof n&&n==If(n)}function ff(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Ln}function cf(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function lf(n){return null!=n&&"object"==typeof n}function sf(n,t){return n===t||Te(n,t,Oi(t))}function hf(n,t,r){return r="function"==typeof r?r:un,Te(n,t,Oi(t),r)}function pf(n){return gf(n)&&n!=+n}function vf(n){if(Us(n))throw new cl(fn);return Le(n)}function _f(n){return null===n}function yf(n){return null==n}function gf(n){return"number"==typeof n||lf(n)&&se(n)==Xn}function df(n){if(!lf(n)||se(n)!=tt)return!1;var t=Ul(n);if(null===t)return!0;var r=ml.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&wl.call(r)==kl}function bf(n){return af(n)&&n>=-Ln&&n<=Ln}function wf(n){return"string"==typeof n||!mh(n)&&lf(n)&&se(n)==ot}function mf(n){return"symbol"==typeof n||lf(n)&&se(n)==at}function xf(n){return n===un}function Af(n){return lf(n)&&Es(n)==ct}function jf(n){return lf(n)&&se(n)==lt}function kf(n){if(!n)return[];if(Ha(n))return wf(n)?nn(n):Mu(n);if(Bl&&n[Bl])return K(n[Bl]());var t=Es(n),r=t==Qn?q:t==it?J:uc;return r(n)}function Of(n){if(!n)return 0===n?n:0;if(n=zf(n),n===Tn||n===-Tn){var t=n<0?-1:1;return t*Bn}return n===n?n:0}function If(n){var t=Of(n),r=t%1;return t===t?r?t-r:t:0}function Sf(n){return n?Fr(If(n),0,Fn):0}function zf(n){if("number"==typeof n)return n;if(mf(n))return Dn;if(cf(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=cf(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=n.replace(Dt,"");var r=Jt.test(n);return r||Yt.test(n)?ue(n.slice(2),r?2:8):Gt.test(n)?Dn:+n}function Rf(n){return Pu(n,qf(n))}function Ef(n){return n?Fr(If(n),-Ln,Ln):0===n?n:0}function Uf(n){return null==n?"":yu(n)}function Cf(n,t){var r=ds(n);return null==t?r:Tr(r,t)}function Wf(n,t){return x(n,ji(t,3),re)}function Tf(n,t){return x(n,ji(t,3),ie)}function Lf(n,t){return null==n?n:ms(n,ji(t,3),qf)}function Bf(n,t){return null==n?n:xs(n,ji(t,3),qf)}function Df(n,t){return n&&re(n,ji(t,3))}function Ff(n,t){return n&&ie(n,ji(t,3))}function Mf(n){return null==n?[]:oe(n,Kf(n))}function Pf(n){return null==n?[]:oe(n,qf(n))}function $f(n,t,r){var e=null==n?un:fe(n,t);return e===un?r:e}function Nf(n,t){return null!=n&&Ei(n,t,be)}function Vf(n,t){return null!=n&&Ei(n,t,Ae)}function Kf(n){return Ha(n)?Ir(n):Pe(n)}function qf(n){return Ha(n)?Ir(n,!0):$e(n)}function Zf(n,t){var r={};return t=ji(t,3),re(n,function(n,e,u){Br(r,t(n,e,u),n)}),r}function Gf(n,t){var r={};return t=ji(t,3),re(n,function(n,e,u){Br(r,e,t(n,e,u))}),r}function Jf(n,t){return Hf(n,La(ji(t)))}function Hf(n,t){if(null==n)return{};var r=_(mi(n),function(n){return[n]});return t=ji(t),Qe(n,r,function(n,r){return t(n,r[0])})}function Yf(n,t,r){t=Ou(t,n);var e=-1,u=t.length;for(u||(u=1,n=un);++e<u;){var i=null==n?un:n[ro(t[e])];i===un&&(e=u,i=r),n=of(i)?i.call(n):i}return n}function Qf(n,t,r){return null==n?n:fu(n,t,r)}function Xf(n,t,r,e){return e="function"==typeof e?e:un,null==n?n:fu(n,t,r,e)}function nc(n,t,r){var e=mh(n),u=e||Ah(n)||Sh(n);if(t=ji(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:cf(n)&&of(i)?ds(Ul(n)):{}}return(u?c:re)(n,function(n,e,u){return t(r,n,e,u)}),r}function tc(n,t){return null==n||du(n,t)}function rc(n,t,r){return null==n?n:bu(n,t,ku(r))}function ec(n,t,r,e){return e="function"==typeof e?e:un,null==n?n:bu(n,t,ku(r),e)}function uc(n){return null==n?[]:L(n,Kf(n))}function ic(n){return null==n?[]:L(n,qf(n))}function oc(n,t,r){return r===un&&(r=t,t=un),r!==un&&(r=zf(r),r=r===r?r:0),t!==un&&(t=zf(t),t=t===t?t:0),Fr(zf(n),t,r)}function ac(n,t,r){return t=Of(t),r===un?(r=t,t=0):r=Of(r),n=zf(n),ke(n,t,r)}function fc(n,t,r){if(r&&"boolean"!=typeof r&&Di(n,t,r)&&(t=r=un),r===un&&("boolean"==typeof t?(r=t,t=un):"boolean"==typeof n&&(r=n,n=un)),n===un&&t===un?(n=0,t=1):(n=Of(n),t===un?(t=n,n=0):t=Of(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=ns();return Yl(n+u*(t-n+ee("1e-"+((u+"").length-1))),t)}return ru(n,t)}function cc(n){return np(Uf(n).toLowerCase())}function lc(n){return n=Uf(n),n&&n.replace(Xt,we).replace(Vr,"")}function sc(n,t,r){n=Uf(n),t=yu(t);var e=n.length;r=r===un?e:Fr(If(r),0,e);var u=r;return r-=t.length,r>=0&&n.slice(r,u)==t}function hc(n){return n=Uf(n),n&&St.test(n)?n.replace(Ot,me):n}function pc(n){return n=Uf(n),n&&Bt.test(n)?n.replace(Lt,"\\\\$&"):n}function vc(n,t,r){n=Uf(n),t=If(t);var e=t?X(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return ii(Vl(u),r)+n+ii(Nl(u),r)}function _c(n,t,r){n=Uf(n),t=If(t);var e=t?X(n):0;return t&&e<t?n+ii(t-e,r):n}function yc(n,t,r){n=Uf(n),t=If(t);var e=t?X(n):0;return t&&e<t?ii(t-e,r)+n:n}function gc(n,t,r){return r||null==t?t=0:t&&(t=+t),Xl(Uf(n).replace(Ft,""),t||0)}function dc(n,t,r){return t=(r?Di(n,t,r):t===un)?1:If(t),uu(Uf(n),t)}function bc(){var n=arguments,t=Uf(n[0]);return n.length<3?t:t.replace(n[1],n[2])}function wc(n,t,r){return r&&"number"!=typeof r&&Di(n,t,r)&&(t=r=un),(r=r===un?Fn:r>>>0)?(n=Uf(n),n&&("string"==typeof t||null!=t&&!Oh(t))&&(t=yu(t),!t&&N(n))?Iu(nn(n),0,r):n.split(t,r)):[]}function mc(n,t,r){return n=Uf(n),r=null==r?0:Fr(If(r),0,n.length),t=yu(t),n.slice(r,r+t.length)==t}function xc(n,t,e){var u=r.templateSettings;e&&Di(n,t,e)&&(t=un),n=Uf(n),t=Ch({},t,u,pi);var i,o,a=Ch({},t.imports,u.imports,pi),f=Kf(a),c=L(a,f),l=0,s=t.interpolate||nr,h="__p += '",p=pl((t.escape||nr).source+"|"+s.source+"|"+(s===Et?qt:nr).source+"|"+(t.evaluate||nr).source+"|$","g"),v="//# sourceURL="+("sourceURL"in t?t.sourceURL:"lodash.templateSources["+ ++Hr+"]")+"\\n";n.replace(p,function(t,r,e,u,a,f){return e||(e=u),h+=n.slice(l,f).replace(tr,P),r&&(i=!0,h+="' +\\n__e("+r+") +\\n'"),a&&(o=!0,h+="';\\n"+a+";\\n__p += '"),e&&(h+="' +\\n((__t = ("+e+")) == null ? '' : __t) +\\n'"),l=f+t.length,t}),h+="';\\n";var _=t.variable;_||(h="with (obj) {\\n"+h+"\\n}\\n"),h=(o?h.replace(xt,""):h).replace(At,"$1").replace(jt,"$1;"),h="function("+(_||"obj")+") {\\n"+(_?"":"obj || (obj = {});\\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\\nfunction print() { __p += __j.call(arguments, '') }\\n":";\\n")+h+"return __p\\n}";
17
+ var y=tp(function(){return ll(f,v+"return "+h).apply(un,c)});if(y.source=h,ef(y))throw y;return y}function Ac(n){return Uf(n).toLowerCase()}function jc(n){return Uf(n).toUpperCase()}function kc(n,t,r){if(n=Uf(n),n&&(r||t===un))return n.replace(Dt,"");if(!n||!(t=yu(t)))return n;var e=nn(n),u=nn(t),i=D(e,u),o=F(e,u)+1;return Iu(e,i,o).join("")}function Oc(n,t,r){if(n=Uf(n),n&&(r||t===un))return n.replace(Mt,"");if(!n||!(t=yu(t)))return n;var e=nn(n),u=F(e,nn(t))+1;return Iu(e,0,u).join("")}function Ic(n,t,r){if(n=Uf(n),n&&(r||t===un))return n.replace(Ft,"");if(!n||!(t=yu(t)))return n;var e=nn(n),u=D(e,nn(t));return Iu(e,u).join("")}function Sc(n,t){var r=Sn,e=zn;if(cf(t)){var u="separator"in t?t.separator:u;r="length"in t?If(t.length):r,e="omission"in t?yu(t.omission):e}n=Uf(n);var i=n.length;if(N(n)){var o=nn(n);i=o.length}if(r>=i)return n;var a=r-X(e);if(a<1)return e;var f=o?Iu(o,0,a).join(""):n.slice(0,a);if(u===un)return f+e;if(o&&(a+=f.length-a),Oh(u)){if(n.slice(a).search(u)){var c,l=f;for(u.global||(u=pl(u.source,Uf(Zt.exec(u))+"g")),u.lastIndex=0;c=u.exec(l);)var s=c.index;f=f.slice(0,s===un?a:s)}}else if(n.indexOf(yu(u),a)!=a){var h=f.lastIndexOf(u);h>-1&&(f=f.slice(0,h))}return f+e}function zc(n){return n=Uf(n),n&&It.test(n)?n.replace(kt,xe):n}function Rc(n,t,r){return n=Uf(n),t=r?un:t,t===un?V(n)?en(n):m(n):n.match(t)||[]}function Ec(n){var t=null==n?0:n.length,r=ji();return n=t?_(n,function(n){if("function"!=typeof n[1])throw new _l(cn);return[r(n[0]),n[1]]}):[],iu(function(r){for(var e=-1;++e<t;){var u=n[e];if(a(u[0],this,r))return a(u[1],this,r)}})}function Uc(n){return Pr(Mr(n,pn))}function Cc(n){return function(){return n}}function Wc(n,t){return null==n||n!==n?t:n}function Tc(n){return n}function Lc(n){return Me("function"==typeof n?n:Mr(n,pn))}function Bc(n){return Ke(Mr(n,pn))}function Dc(n,t){return qe(n,Mr(t,pn))}function Fc(n,t,r){var e=Kf(t),u=oe(t,e);null!=r||cf(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=oe(t,Kf(t)));var i=!(cf(r)&&"chain"in r&&!r.chain),o=of(n);return c(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__),u=r.__actions__=Mu(this.__actions__);return u.push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,y([this.value()],arguments))})}),n}function Mc(){return ae._===this&&(ae._=Ol),this}function Pc(){}function $c(n){return n=If(n),iu(function(t){return Je(t,n)})}function Nc(n){return Fi(n)?S(ro(n)):Xe(n)}function Vc(n){return function(t){return null==n?un:fe(n,t)}}function Kc(){return[]}function qc(){return!1}function Zc(){return{}}function Gc(){return""}function Jc(){return!0}function Hc(n,t){if(n=If(n),n<1||n>Ln)return[];var r=Fn,e=Yl(n,Fn);t=ji(t),n-=Fn;for(var u=C(e,t);++r<n;)t(r);return u}function Yc(n){return mh(n)?_(n,ro):mf(n)?[n]:Mu(Ls(Uf(n)))}function Qc(n){var t=++xl;return Uf(n)+t}function Xc(n){return n&&n.length?Gr(n,Tc,he):un}function nl(n,t){return n&&n.length?Gr(n,ji(t,2),he):un}function tl(n){return I(n,Tc)}function rl(n,t){return I(n,ji(t,2))}function el(n){return n&&n.length?Gr(n,Tc,Ne):un}function ul(n,t){return n&&n.length?Gr(n,ji(t,2),Ne):un}function il(n){return n&&n.length?U(n,Tc):0}function ol(n,t){return n&&n.length?U(n,ji(t,2)):0}t=null==t?ae:je.defaults(ae.Object(),t,je.pick(ae,Jr));var al=t.Array,fl=t.Date,cl=t.Error,ll=t.Function,sl=t.Math,hl=t.Object,pl=t.RegExp,vl=t.String,_l=t.TypeError,yl=al.prototype,gl=ll.prototype,dl=hl.prototype,bl=t["__core-js_shared__"],wl=gl.toString,ml=dl.hasOwnProperty,xl=0,Al=function(){var n=/[^.]+$/.exec(bl&&bl.keys&&bl.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),jl=dl.toString,kl=wl.call(hl),Ol=ae._,Il=pl("^"+wl.call(ml).replace(Lt,"\\\\$&").replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,"$1.*?")+"$"),Sl=le?t.Buffer:un,zl=t.Symbol,Rl=t.Uint8Array,El=Sl?Sl.allocUnsafe:un,Ul=Z(hl.getPrototypeOf,hl),Cl=hl.create,Wl=dl.propertyIsEnumerable,Tl=yl.splice,Ll=zl?zl.isConcatSpreadable:un,Bl=zl?zl.iterator:un,Dl=zl?zl.toStringTag:un,Fl=function(){try{var n=Ii(hl,"defineProperty");return n({},"",{}),n}catch(n){}}(),Ml=t.clearTimeout!==ae.clearTimeout&&t.clearTimeout,Pl=fl&&fl.now!==ae.Date.now&&fl.now,$l=t.setTimeout!==ae.setTimeout&&t.setTimeout,Nl=sl.ceil,Vl=sl.floor,Kl=hl.getOwnPropertySymbols,ql=Sl?Sl.isBuffer:un,Zl=t.isFinite,Gl=yl.join,Jl=Z(hl.keys,hl),Hl=sl.max,Yl=sl.min,Ql=fl.now,Xl=t.parseInt,ns=sl.random,ts=yl.reverse,rs=Ii(t,"DataView"),es=Ii(t,"Map"),us=Ii(t,"Promise"),is=Ii(t,"Set"),os=Ii(t,"WeakMap"),as=Ii(hl,"create"),fs=os&&new os,cs={},ls=eo(rs),ss=eo(es),hs=eo(us),ps=eo(is),vs=eo(os),_s=zl?zl.prototype:un,ys=_s?_s.valueOf:un,gs=_s?_s.toString:un,ds=function(){function n(){}return function(t){if(!cf(t))return{};if(Cl)return Cl(t);n.prototype=t;var r=new n;return n.prototype=un,r}}();r.templateSettings={escape:zt,evaluate:Rt,interpolate:Et,variable:"",imports:{_:r}},r.prototype=e.prototype,r.prototype.constructor=r,u.prototype=ds(e.prototype),u.prototype.constructor=u,w.prototype=ds(e.prototype),w.prototype.constructor=w,rn.prototype.clear=Vt,rn.prototype.delete=rr,rn.prototype.get=er,rn.prototype.has=ur,rn.prototype.set=ir,or.prototype.clear=ar,or.prototype.delete=fr,or.prototype.get=cr,or.prototype.has=lr,or.prototype.set=sr,hr.prototype.clear=pr,hr.prototype.delete=vr,hr.prototype.get=_r,hr.prototype.has=yr,hr.prototype.set=gr,dr.prototype.add=dr.prototype.push=br,dr.prototype.has=wr,mr.prototype.clear=xr,mr.prototype.delete=Ar,mr.prototype.get=jr,mr.prototype.has=kr,mr.prototype.set=Or;var bs=qu(re),ws=qu(ie,!0),ms=Zu(),xs=Zu(!0),As=fs?function(n,t){return fs.set(n,t),n}:Tc,js=Fl?function(n,t){return Fl(n,"toString",{configurable:!0,enumerable:!1,value:Cc(t),writable:!0})}:Tc,ks=iu,Os=Ml||function(n){return ae.clearTimeout(n)},Is=is&&1/J(new is([,-0]))[1]==Tn?function(n){return new is(n)}:Pc,Ss=fs?function(n){return fs.get(n)}:Pc,zs=Kl?function(n){return null==n?[]:(n=hl(n),h(Kl(n),function(t){return Wl.call(n,t)}))}:Kc,Rs=Kl?function(n){for(var t=[];n;)y(t,zs(n)),n=Ul(n);return t}:Kc,Es=se;(rs&&Es(new rs(new ArrayBuffer(1)))!=ht||es&&Es(new es)!=Qn||us&&Es(us.resolve())!=rt||is&&Es(new is)!=it||os&&Es(new os)!=ct)&&(Es=function(n){var t=se(n),r=t==tt?n.constructor:un,e=r?eo(r):"";if(e)switch(e){case ls:return ht;case ss:return Qn;case hs:return rt;case ps:return it;case vs:return ct}return t});var Us=bl?of:qc,Cs=no(As),Ws=$l||function(n,t){return ae.setTimeout(n,t)},Ts=no(js),Ls=qi(function(n){var t=[];return Wt.test(n)&&t.push(""),n.replace(Tt,function(n,r,e,u){t.push(e?u.replace(Kt,"$1"):r||n)}),t}),Bs=iu(function(n,t){return Ya(n)?qr(n,te(t,1,Ya,!0)):[]}),Ds=iu(function(n,t){var r=ko(t);return Ya(r)&&(r=un),Ya(n)?qr(n,te(t,1,Ya,!0),ji(r,2)):[]}),Fs=iu(function(n,t){var r=ko(t);return Ya(r)&&(r=un),Ya(n)?qr(n,te(t,1,Ya,!0),un,r):[]}),Ms=iu(function(n){var t=_(n,ju);return t.length&&t[0]===n[0]?Oe(t):[]}),Ps=iu(function(n){var t=ko(n),r=_(n,ju);return t===ko(r)?t=un:r.pop(),r.length&&r[0]===n[0]?Oe(r,ji(t,2)):[]}),$s=iu(function(n){var t=ko(n),r=_(n,ju);return t="function"==typeof t?t:un,t&&r.pop(),r.length&&r[0]===n[0]?Oe(r,un,t):[]}),Ns=iu(So),Vs=bi(function(n,t){var r=null==n?0:n.length,e=Dr(n,t);return tu(n,_(t,function(n){return Bi(n,r)?+n:n}).sort(Lu)),e}),Ks=iu(function(n){return gu(te(n,1,Ya,!0))}),qs=iu(function(n){var t=ko(n);return Ya(t)&&(t=un),gu(te(n,1,Ya,!0),ji(t,2))}),Zs=iu(function(n){var t=ko(n);return t="function"==typeof t?t:un,gu(te(n,1,Ya,!0),un,t)}),Gs=iu(function(n,t){return Ya(n)?qr(n,t):[]}),Js=iu(function(n){return xu(h(n,Ya))}),Hs=iu(function(n){var t=ko(n);return Ya(t)&&(t=un),xu(h(n,Ya),ji(t,2))}),Ys=iu(function(n){var t=ko(n);return t="function"==typeof t?t:un,xu(h(n,Ya),un,t)}),Qs=iu(Ho),Xs=iu(function(n){var t=n.length,r=t>1?n[t-1]:un;return r="function"==typeof r?(n.pop(),r):un,Yo(n,r)}),nh=bi(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,i=function(t){return Dr(t,n)};return!(t>1||this.__actions__.length)&&e instanceof w&&Bi(r)?(e=e.slice(r,+r+(t?1:0)),e.__actions__.push({func:ra,args:[i],thisArg:un}),new u(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push(un),n})):this.thru(i)}),th=Vu(function(n,t,r){ml.call(n,r)?++n[r]:Br(n,r,1)}),rh=Xu(vo),eh=Xu(_o),uh=Vu(function(n,t,r){ml.call(n,r)?n[r].push(t):Br(n,r,[t])}),ih=iu(function(n,t,r){var e=-1,u="function"==typeof t,i=Ha(n)?al(n.length):[];return bs(n,function(n){i[++e]=u?a(t,n,r):Se(n,t,r)}),i}),oh=Vu(function(n,t,r){Br(n,r,t)}),ah=Vu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),fh=iu(function(n,t){if(null==n)return[];var r=t.length;return r>1&&Di(n,t[0],t[1])?t=[]:r>2&&Di(t[0],t[1],t[2])&&(t=[t[0]]),He(n,te(t,1),[])}),ch=Pl||function(){return ae.Date.now()},lh=iu(function(n,t,r){var e=dn;if(r.length){var u=G(r,Ai(lh));e|=An}return hi(n,e,t,r,u)}),sh=iu(function(n,t,r){var e=dn|bn;if(r.length){var u=G(r,Ai(sh));e|=An}return hi(t,e,n,r,u)}),hh=iu(function(n,t){return Kr(n,1,t)}),ph=iu(function(n,t,r){return Kr(n,zf(t)||0,r)});Ta.Cache=hr;var vh=ks(function(n,t){t=1==t.length&&mh(t[0])?_(t[0],T(ji())):_(te(t,1),T(ji()));var r=t.length;return iu(function(e){for(var u=-1,i=Yl(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return a(n,this,e)})}),_h=iu(function(n,t){var r=G(t,Ai(_h));return hi(n,An,un,t,r)}),yh=iu(function(n,t){var r=G(t,Ai(yh));return hi(n,jn,un,t,r)}),gh=bi(function(n,t){return hi(n,On,un,un,un,t)}),dh=fi(he),bh=fi(function(n,t){return n>=t}),wh=ze(function(){return arguments}())?ze:function(n){return lf(n)&&ml.call(n,"callee")&&!Wl.call(n,"callee")},mh=al.isArray,xh=pe?T(pe):Re,Ah=ql||qc,jh=ve?T(ve):Ee,kh=_e?T(_e):We,Oh=ye?T(ye):Be,Ih=ge?T(ge):De,Sh=de?T(de):Fe,zh=fi(Ne),Rh=fi(function(n,t){return n<=t}),Eh=Ku(function(n,t){if(Ni(t)||Ha(t))return void Pu(t,Kf(t),n);for(var r in t)ml.call(t,r)&&Ur(n,r,t[r])}),Uh=Ku(function(n,t){Pu(t,qf(t),n)}),Ch=Ku(function(n,t,r,e){Pu(t,qf(t),n,e)}),Wh=Ku(function(n,t,r,e){Pu(t,Kf(t),n,e)}),Th=bi(Dr),Lh=iu(function(n){return n.push(un,pi),a(Ch,un,n)}),Bh=iu(function(n){return n.push(un,vi),a($h,un,n)}),Dh=ri(function(n,t,r){n[t]=r},Cc(Tc)),Fh=ri(function(n,t,r){ml.call(n,t)?n[t].push(r):n[t]=[r]},ji),Mh=iu(Se),Ph=Ku(function(n,t,r){Ze(n,t,r)}),$h=Ku(function(n,t,r,e){Ze(n,t,r,e)}),Nh=bi(function(n,t){var r={};if(null==n)return r;var e=!1;t=_(t,function(t){return t=Ou(t,n),e||(e=t.length>1),t}),Pu(n,mi(n),r),e&&(r=Mr(r,pn|vn|_n,_i));for(var u=t.length;u--;)du(r,t[u]);return r}),Vh=bi(function(n,t){return null==n?{}:Ye(n,t)}),Kh=si(Kf),qh=si(qf),Zh=Hu(function(n,t,r){return t=t.toLowerCase(),n+(r?cc(t):t)}),Gh=Hu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Jh=Hu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Hh=Ju("toLowerCase"),Yh=Hu(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Qh=Hu(function(n,t,r){return n+(r?" ":"")+np(t)}),Xh=Hu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),np=Ju("toUpperCase"),tp=iu(function(n,t){try{return a(n,un,t)}catch(n){return ef(n)?n:new cl(n)}}),rp=bi(function(n,t){return c(t,function(t){t=ro(t),Br(n,t,lh(n[t],n))}),n}),ep=ni(),up=ni(!0),ip=iu(function(n,t){return function(r){return Se(r,n,t)}}),op=iu(function(n,t){return function(r){return Se(n,r,t)}}),ap=ui(_),fp=ui(s),cp=ui(b),lp=ai(),sp=ai(!0),hp=ei(function(n,t){return n+t},0),pp=li("ceil"),vp=ei(function(n,t){return n/t},1),_p=li("floor"),yp=ei(function(n,t){return n*t},1),gp=li("round"),dp=ei(function(n,t){return n-t},0);return r.after=Sa,r.ary=za,r.assign=Eh,r.assignIn=Uh,r.assignInWith=Ch,r.assignWith=Wh,r.at=Th,r.before=Ra,r.bind=lh,r.bindAll=rp,r.bindKey=sh,r.castArray=Na,r.chain=na,r.chunk=oo,r.compact=ao,r.concat=fo,r.cond=Ec,r.conforms=Uc,r.constant=Cc,r.countBy=th,r.create=Cf,r.curry=Ea,r.curryRight=Ua,r.debounce=Ca,r.defaults=Lh,r.defaultsDeep=Bh,r.defer=hh,r.delay=ph,r.difference=Bs,r.differenceBy=Ds,r.differenceWith=Fs,r.drop=co,r.dropRight=lo,r.dropRightWhile=so,r.dropWhile=ho,r.fill=po,r.filter=sa,r.flatMap=ha,r.flatMapDeep=pa,r.flatMapDepth=va,r.flatten=yo,r.flattenDeep=go,r.flattenDepth=bo,r.flip=Wa,r.flow=ep,r.flowRight=up,r.fromPairs=wo,r.functions=Mf,r.functionsIn=Pf,r.groupBy=uh,r.initial=Ao,r.intersection=Ms,r.intersectionBy=Ps,r.intersectionWith=$s,r.invert=Dh,r.invertBy=Fh,r.invokeMap=ih,r.iteratee=Lc,r.keyBy=oh,r.keys=Kf,r.keysIn=qf,r.map=da,r.mapKeys=Zf,r.mapValues=Gf,r.matches=Bc,r.matchesProperty=Dc,r.memoize=Ta,r.merge=Ph,r.mergeWith=$h,r.method=ip,r.methodOf=op,r.mixin=Fc,r.negate=La,r.nthArg=$c,r.omit=Nh,r.omitBy=Jf,r.once=Ba,r.orderBy=ba,r.over=ap,r.overArgs=vh,r.overEvery=fp,r.overSome=cp,r.partial=_h,r.partialRight=yh,r.partition=ah,r.pick=Vh,r.pickBy=Hf,r.property=Nc,r.propertyOf=Vc,r.pull=Ns,r.pullAll=So,r.pullAllBy=zo,r.pullAllWith=Ro,r.pullAt=Vs,r.range=lp,r.rangeRight=sp,r.rearg=gh,r.reject=xa,r.remove=Eo,r.rest=Da,r.reverse=Uo,r.sampleSize=ja,r.set=Qf,r.setWith=Xf,r.shuffle=ka,r.slice=Co,r.sortBy=fh,r.sortedUniq=Mo,r.sortedUniqBy=Po,r.split=wc,r.spread=Fa,r.tail=$o,r.take=No,r.takeRight=Vo,r.takeRightWhile=Ko,r.takeWhile=qo,r.tap=ta,r.throttle=Ma,r.thru=ra,r.toArray=kf,r.toPairs=Kh,r.toPairsIn=qh,r.toPath=Yc,r.toPlainObject=Rf,r.transform=nc,r.unary=Pa,r.union=Ks,r.unionBy=qs,r.unionWith=Zs,r.uniq=Zo,r.uniqBy=Go,r.uniqWith=Jo,r.unset=tc,r.unzip=Ho,r.unzipWith=Yo,r.update=rc,r.updateWith=ec,r.values=uc,r.valuesIn=ic,r.without=Gs,r.words=Rc,r.wrap=$a,r.xor=Js,r.xorBy=Hs,r.xorWith=Ys,r.zip=Qs,r.zipObject=Qo,r.zipObjectDeep=Xo,r.zipWith=Xs,r.entries=Kh,r.entriesIn=qh,r.extend=Uh,r.extendWith=Ch,Fc(r,r),r.add=hp,r.attempt=tp,r.camelCase=Zh,r.capitalize=cc,r.ceil=pp,r.clamp=oc,r.clone=Va,r.cloneDeep=qa,r.cloneDeepWith=Za,r.cloneWith=Ka,r.conformsTo=Ga,r.deburr=lc,r.defaultTo=Wc,r.divide=vp,r.endsWith=sc,r.eq=Ja,r.escape=hc,r.escapeRegExp=pc,r.every=la,r.find=rh,r.findIndex=vo,r.findKey=Wf,r.findLast=eh,r.findLastIndex=_o,r.findLastKey=Tf,r.floor=_p,r.forEach=_a,r.forEachRight=ya,r.forIn=Lf,r.forInRight=Bf,r.forOwn=Df,r.forOwnRight=Ff,r.get=$f,r.gt=dh,r.gte=bh,r.has=Nf,r.hasIn=Vf,r.head=mo,r.identity=Tc,r.includes=ga,r.indexOf=xo,r.inRange=ac,r.invoke=Mh,r.isArguments=wh,r.isArray=mh,r.isArrayBuffer=xh,r.isArrayLike=Ha,r.isArrayLikeObject=Ya,r.isBoolean=Qa,r.isBuffer=Ah,r.isDate=jh,r.isElement=Xa,r.isEmpty=nf,r.isEqual=tf,r.isEqualWith=rf,r.isError=ef,r.isFinite=uf,r.isFunction=of,r.isInteger=af,r.isLength=ff,r.isMap=kh,r.isMatch=sf,r.isMatchWith=hf,r.isNaN=pf,r.isNative=vf,r.isNil=yf,r.isNull=_f,r.isNumber=gf,r.isObject=cf,r.isObjectLike=lf,r.isPlainObject=df,r.isRegExp=Oh,r.isSafeInteger=bf,r.isSet=Ih,r.isString=wf,r.isSymbol=mf,r.isTypedArray=Sh,r.isUndefined=xf,r.isWeakMap=Af,r.isWeakSet=jf,r.join=jo,r.kebabCase=Gh,r.last=ko,r.lastIndexOf=Oo,r.lowerCase=Jh,r.lowerFirst=Hh,r.lt=zh,r.lte=Rh,r.max=Xc,r.maxBy=nl,r.mean=tl,r.meanBy=rl,r.min=el,r.minBy=ul,r.stubArray=Kc,r.stubFalse=qc,r.stubObject=Zc,r.stubString=Gc,r.stubTrue=Jc,r.multiply=yp,r.nth=Io,r.noConflict=Mc,r.noop=Pc,r.now=ch,r.pad=vc,r.padEnd=_c,r.padStart=yc,r.parseInt=gc,r.random=fc,r.reduce=wa,r.reduceRight=ma,r.repeat=dc,r.replace=bc,r.result=Yf,r.round=gp,r.runInContext=n,r.sample=Aa,r.size=Oa,r.snakeCase=Yh,r.some=Ia,r.sortedIndex=Wo,r.sortedIndexBy=To,r.sortedIndexOf=Lo,r.sortedLastIndex=Bo,r.sortedLastIndexBy=Do,r.sortedLastIndexOf=Fo,r.startCase=Qh,r.startsWith=mc,r.subtract=dp,r.sum=il,r.sumBy=ol,r.template=xc,r.times=Hc,r.toFinite=Of,r.toInteger=If,r.toLength=Sf,r.toLower=Ac,r.toNumber=zf,r.toSafeInteger=Ef,r.toString=Uf,r.toUpper=jc,r.trim=kc,r.trimEnd=Oc,r.trimStart=Ic,r.truncate=Sc,r.unescape=zc,r.uniqueId=Qc,r.upperCase=Xh,r.upperFirst=np,r.each=_a,r.eachRight=ya,r.first=mo,Fc(r,function(){var n={};return re(r,function(t,e){ml.call(r.prototype,e)||(n[e]=t)}),n}(),{chain:!1}),r.VERSION=on,c(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){r[n].placeholder=r}),c(["drop","take"],function(n,t){w.prototype[n]=function(r){r=r===un?1:Hl(If(r),0);var e=this.__filtered__&&!t?new w(this):this.clone();return e.__filtered__?e.__takeCount__=Yl(r,e.__takeCount__):e.__views__.push({size:Yl(r,Fn),type:n+(e.__dir__<0?"Right":"")}),e},w.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),c(["filter","map","takeWhile"],function(n,t){var r=t+1,e=r==Un||r==Wn;w.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ji(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),c(["head","last"],function(n,t){var r="take"+(t?"Right":"");w.prototype[n]=function(){return this[r](1).value()[0]}}),c(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");w.prototype[n]=function(){return this.__filtered__?new w(this):this[r](1)}}),w.prototype.compact=function(){return this.filter(Tc)},w.prototype.find=function(n){return this.filter(n).head()},w.prototype.findLast=function(n){return this.reverse().find(n)},w.prototype.invokeMap=iu(function(n,t){return"function"==typeof n?new w(this):this.map(function(r){return Se(r,n,t)})}),w.prototype.reject=function(n){return this.filter(La(ji(n)))},w.prototype.slice=function(n,t){n=If(n);var r=this;return r.__filtered__&&(n>0||t<0)?new w(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==un&&(t=If(t),r=t<0?r.dropRight(-t):r.take(t-n)),r)},w.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},w.prototype.toArray=function(){return this.take(Fn)},re(w.prototype,function(n,t){var e=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),o=r[i?"take"+("last"==t?"Right":""):t],a=i||/^find/.test(t);o&&(r.prototype[t]=function(){var t=this.__wrapped__,f=i?[1]:arguments,c=t instanceof w,l=f[0],s=c||mh(t),h=function(n){var t=o.apply(r,y([n],f));return i&&p?t[0]:t};s&&e&&"function"==typeof l&&1!=l.length&&(c=s=!1);var p=this.__chain__,v=!!this.__actions__.length,_=a&&!p,g=c&&!v;if(!a&&s){t=g?t:new w(this);var d=n.apply(t,f);return d.__actions__.push({func:ra,args:[h],thisArg:un}),new u(d,p)}return _&&g?n.apply(this,f):(d=this.thru(h),_?i?d.value()[0]:d.value():d)})}),c(["pop","push","shift","sort","splice","unshift"],function(n){var t=yl[n],e=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",u=/^(?:pop|shift)$/.test(n);r.prototype[n]=function(){var n=arguments;if(u&&!this.__chain__){var r=this.value();return t.apply(mh(r)?r:[],n)}return this[e](function(r){return t.apply(mh(r)?r:[],n)})}}),re(w.prototype,function(n,t){var e=r[t];if(e){var u=e.name+"",i=cs[u]||(cs[u]=[]);i.push({name:t,func:e})}}),cs[ti(un,bn).name]=[{name:"wrapper",func:un}],w.prototype.clone=z,w.prototype.reverse=Y,w.prototype.value=tn,r.prototype.at=nh,r.prototype.chain=ea,r.prototype.commit=ua,r.prototype.next=ia,r.prototype.plant=aa,r.prototype.reverse=fa,r.prototype.toJSON=r.prototype.valueOf=r.prototype.value=ca,r.prototype.first=r.prototype.head,Bl&&(r.prototype[Bl]=oa),r},je=Ae();ae._=je,e=function(){return je}.call(t,r,t,u),!(e!==un&&(u.exports=e))}).call(this)}).call(t,function(){return this}(),r(6)(n))},function(n,t){n.exports=function(n){return n.webpackPolyfill||(n.deprecate=function(){},n.paths=[],n.children=[],n.webpackPolyfill=1),n}},function(n,t){"use strict";function r(){return window.crypto.subtle||window.crypto.webkitSubtle}Object.defineProperty(t,"__esModule",{value:!0}),t.subtle=void 0,t.subtle=r}]);`;var rn=()=>{let n,t;return{promise:new Promise((e,u)=>{n=e,t=u}),resolve:n,reject:t}};import{StyleSheet as $n,View as Hn}from"react-native";var qn=$n.create({hide:{display:"none",position:"absolute",width:0,height:0,flexGrow:0,flexShrink:1}}),S=({children:n})=><Hn style={qn.hide}>{n}</Hn>;var Xn=`
18
+ (function () {
19
+ function postMessage (message) {
20
+ if (window.ReactNativeWebView.postMessage === undefined) {
21
+ setTimeout(postMessage, 200, message)
22
+ } else {
23
+ window.ReactNativeWebView.postMessage(message)
24
+ }
25
+ }
26
+ var wvw = new WebViewWorker(postMessage)
27
+ // for android
28
+ window.document.addEventListener('message', function (e) {wvw.onMainMessage(e.data);})
29
+ // for ios
30
+ window.addEventListener('message', function (e) {wvw.onMainMessage(e.data);})
31
+ }())
32
+ `,nt=n=>({decrypt(...t){return n.then(r=>r.crypto.subtle.decrypt(...t))},deriveBits(...t){return n.then(r=>r.crypto.subtle.deriveBits(...t))},deriveKey(...t){return n.then(r=>r.crypto.subtle.deriveKey(...t))},digest(...t){return n.then(r=>r.crypto.subtle.digest(...t))},encrypt(...t){return n.then(r=>r.crypto.subtle.encrypt(...t))},sign(...t){return n.then(r=>r.crypto.subtle.sign(...t))},unwrapKey(...t){return n.then(r=>r.crypto.subtle.unwrapKey(...t))},verify(...t){return n.then(r=>r.crypto.subtle.verify(...t))},wrapKey(...t){return n.then(r=>r.crypto.subtle.wrapKey(...t))}}),_t=({onContentProcessDidTerminate:n})=>{let t=Gn(null),[r]=un(()=>rn());Jn(()=>{q(nt(r.promise))},[]);let e=en(i=>{let{data:o}=i.nativeEvent;return r.promise.then(a=>a.onWebViewMessage(o))},[]);Qn(()=>{r.resolve(new m(i=>{t.current?.postMessage(i)}))},[]);let f=`<html><body><script language='javascript'>${`((function () {${B};${Xn}})())`}<\/script></body></html>`;return<S>
33
+ <Zn cacheEnabled javaScriptEnabled={!0}onContentProcessDidTerminate={n}onError={i=>console.error(Object.keys(i),i.type,i.nativeEvent.description)}onMessage={e}ref={t}originWhitelist={["*"]}source={{html:f,baseUrl:"https://localhost"}}/>
34
+ </S>},_n=()=>{let[n,t]=un(0),r=en(()=>{t(e=>e+1)},[]);return globalThis.crypto?.subtle?.digest?null:<_t key={n}onContentProcessDidTerminate={r}/>};var Tt=`
2
35
  window.onerror = (e) => { console.error(e); window.ReactNativeWebView.postMessage({cmd: 'error', payload: e.message});}
3
- `,Me=({uri:e,animationType:r="slide",thanks:t,onClose:o,onLinkClick:c,children:p})=>{let n=xe(),i=C(s=>{n.current=s},[]),[a,d]=b("idle"),x=C(()=>{d("closed")},[]),l=C(()=>{d("complete")},[]),[m]=b(()=>v("rocket",$=>{n.current?.injectJavaScript(`window.messageToThanks(${JSON.stringify($)});`)})),F=C(s=>{m.pushMessage(JSON.parse(s.nativeEvent.data))},[]),[P,H]=b();return I(()=>(m.on(k,()=>{m.send("init",{mode:"mobile",topOffset:t.offsetTop?.(),statusText:t.statusText,referral:"react-native"}),d("active"),t.onDisplay?.()}),m.on("close",()=>{x()}),m.on("terminate",()=>{l()}),m.on("click",s=>{(!c||c(s))&&be.openURL(s)}),()=>{m.isReady()&&m.send("close"),t.onClose?.()}),[]),I(()=>{a==="complete"&&o()},[a]),a==="complete"?null:<T onError={x}><Ce onRequestClose={x}animationType={r}transparent><Ee ref={i}source={{uri:e,headers:{referer:"https://react-native","x-thanksjs-integration-mode":"react-native"}}}onMessage={F}onError={s=>{console.error("page error",s),l()}}onContentProcessDidTerminate={s=>{console.error("page terminate",s),l()}}onRenderProcessGone={s=>{console.error("render gone",s),l()}}onLoad={s=>{}}style={{flex:1,backgroundColor:"transparent"}}webviewDebuggingEnabled injectedJavaScript={we}/>{P?<L uri={P}onClose={()=>H(void 0)}/>:null}{p}</Ce></T>},br=({onLinkClick:e,onClose:r,env:t="production",animationType:o,children:c,...p})=>{let[n,i]=b();I(()=>{S(p,t).then(d=>{i(d)})},[]);let a=C(()=>{i(void 0),r?.()},[]);return n?<Me uri={n}thanks={p}onClose={a}onLinkClick={e}animationType={o}>{c}</Me>:null};export{br as ThanksWidget};
36
+ // if you ever need a debug
37
+ // window.console.error = (...args) => { alert(...args);}
38
+ `,Ct=({uri:n,animationType:t="slide",thanks:r,onClose:e,onLinkClick:u,children:f})=>{let i=mt(),o=b(c=>{i.current=c},[]),[a,s]=j("idle"),x=b(()=>{s("closed")},[]),h=b(()=>{s("complete")},[]),[l]=j(()=>M("rocket",Cn=>{i.current?.injectJavaScript(`window.messageToThanks(${JSON.stringify(Cn)});`)})),jn=b(c=>{l.pushMessage(JSON.parse(c.nativeEvent.data))},[]),[V,Tn]=j();return O(()=>(l.on(A,()=>{l.send("init",{mode:"mobile",topOffset:r.offsetTop?.(),statusText:r.statusText,referral:"react-native"}),s("active"),r.onDisplay?.()}),l.on("close",()=>{x()}),l.on("terminate",()=>{h()}),l.on("click",c=>{(!u||u(c))&&jt.openURL(c)}),()=>{l.isReady()&&l.send("close"),r.onClose?.()}),[]),O(()=>{a==="complete"&&e()},[a]),a==="complete"?null:<_ onError={x}>
39
+ <At onRequestClose={x}animationType={t}transparent>
40
+ <An cacheEnabled ref={o}source={{uri:n,headers:{referer:"https://react-native","x-thanksjs-integration-mode":"react-native"}}}onMessage={jn}onError={c=>{console.error("page error",c),h()}}onContentProcessDidTerminate={c=>{console.error("page terminate",c),h()}}onRenderProcessGone={c=>{console.error("render gone",c),h()}}onLoad={c=>{}}style={{flex:1,backgroundColor:"transparent"}}webviewDebuggingEnabled injectedJavaScript={Tt}androidLayerType="software"/>
41
+
42
+ {V?<Z uri={V}onClose={()=>Tn(void 0)}/>:null}
43
+ {f}
44
+ </At>
45
+ </_>},ue=()=><S>
46
+ <An cacheEnabled source={{uri:`${T()}/preload`}}/>
47
+ </S>,It=n=><>
48
+ <_n/>
49
+ <St{...n}/>
50
+ </>,St=({onLinkClick:n,onClose:t,animationType:r,children:e,...u})=>{let[f,i]=j();O(()=>{D(u).then(a=>{i(a)}).catch(a=>{throw console.error(a),a})},[]);let o=b(()=>{i(void 0),t?.()},[]);return f?<Ct uri={f}thanks={u}onClose={o}onLinkClick={n}animationType={r}>
51
+ {e}
52
+ </Ct>:null},w,ie={open:(n={})=>{if(!w)throw new Error("ThanksWidgetController not found on the page");w(n)},close:()=>{if(!w)throw new Error("ThanksWidgetController not found on the page");w(void 0)}},oe=n=>{let[t,r]=j(void 0);w=r;let e={...n,...t};O(()=>()=>{w=void 0},[]);let u=b(()=>{e.onClose?.(),r(void 0)},[e.onClose]);return t?<It{...e}onClose={u}/>:null};export{It as ThanksWidget,oe as ThanksWidgetController,ue as ThanksWidgetPreload,ie as thanksWidget};
@@ -1,4 +1,5 @@
1
1
  import { FC } from 'react';
2
+ import { JSX as JSX_2 } from 'react/jsx-runtime';
2
3
  import { PropsWithChildren } from 'react';
3
4
 
4
5
  declare type MayBePromise<T> = T | Promise<T>;
@@ -75,7 +76,11 @@ declare type ThanksEmbedConfiguration = ThanksSharedConfiguration & {
75
76
  * specifies an element for embedded widget
76
77
  * this option will suppress automatic widget Display
77
78
  */
78
- embeddedInto: HTMLElement;
79
+ embeddedInto:
80
+ | HTMLElement
81
+ | HTMLElement[]
82
+ | (() => HTMLElement | HTMLElement[]);
83
+ slot?: string | undefined;
79
84
  };
80
85
 
81
86
  declare type ThanksLocation = {
@@ -83,6 +88,8 @@ declare type ThanksLocation = {
83
88
  postcode?: string;
84
89
  };
85
90
 
91
+ declare type ThanksProps = Omit<ThanksConfiguration, 'partnerId'> & Pick<Required<ThanksConfiguration>, 'partnerId'> & ThanksCallbacks & ThanksStyleProps;
92
+
86
93
  /**
87
94
  * A configuration options for the Thanks widget
88
95
  * @public
@@ -127,12 +134,29 @@ declare type ThanksSharedConfiguration = {
127
134
  * ```
128
135
  */
129
136
  emailHash?: ThanksEmailHashConfiguration;
137
+ /**
138
+ * @deprecated use traceId
139
+ */
140
+ userId?: string;
141
+ /**
142
+ * an unique id for partner to trace widget activity from their side
143
+ * @optional
144
+ */
145
+ traceId?: string;
130
146
 
131
147
  /**
132
148
  * a callback to retrieve personal information
133
149
  * @see how we process PII
134
150
  */
135
151
  onPersonalInformationRequest?: PersonalInformationRequest;
152
+
153
+ /**
154
+ * Allows storing information at the publisher's side to improve user tracking
155
+ * May be required in case of `emailHash` is not provided
156
+ * @default false
157
+ */
158
+ allowLocalStorage?: boolean;
159
+
136
160
  /**
137
161
  * location of a customer
138
162
  * @optional
@@ -143,16 +167,6 @@ declare type ThanksSharedConfiguration = {
143
167
  * @optional
144
168
  */
145
169
  purchaseLocation?: ThanksLocation;
146
- /**
147
- * @deprecated use traceId
148
- */
149
- userId?: string;
150
- /**
151
- * an unique id for partner to trace widget activity from their side
152
- * @optional
153
- */
154
- traceId?: string;
155
-
156
170
  /**
157
171
  * a set of keywords related to this activity
158
172
  * @recommended
@@ -202,6 +216,17 @@ declare type ThanksSharedConfiguration = {
202
216
  */
203
217
  closeWidget?(): void;
204
218
 
219
+ /**
220
+ * a command available to the user.
221
+ * opens Widget using current _thanks settings
222
+ */
223
+ openWidget?(): void;
224
+
225
+ /**
226
+ * callback on thanksAPI ready
227
+ */
228
+ onReady?(api: ThanksSharedConfiguration): void;
229
+
205
230
 
206
231
  };
207
232
 
@@ -221,8 +246,52 @@ export declare type ThanksStyleProps = {
221
246
  *
222
247
  * @public ThanksWidget itself
223
248
  */
224
- export declare const ThanksWidget: FC<Omit<ThanksConfiguration, 'partnerId'> & Pick<Required<ThanksConfiguration>, 'partnerId'> & ThanksCallbacks & ThanksStyleProps & PropsWithChildren>;
249
+ export declare const ThanksWidget: FC<ThanksProps & PropsWithChildren>;
250
+
251
+ /**
252
+ * To be used only with {@link ThanksWidgetController}.
253
+ *
254
+ * Provides external control over ThanksWidget.
255
+ * Both ThanksWidgetController and thanksWidget.open can take settings with thanksWidget overriding values provided to ThanksWidgetController
256
+ * @public Indirect API for ThanksAd
257
+ * @example
258
+ * ```tsx
259
+ * // in some place
260
+ * <ThanksWidgetController partnerId="id" {...props}/>
261
+ *
262
+ * // in some other place
263
+ * thanksWidget.open({...propsOverride})
264
+ * thanksWidget.open()
265
+ * ```
266
+ */
267
+ export declare const thanksWidget: {
268
+ open: (configuration?: Partial<ThanksProps>) => void;
269
+ close: () => void;
270
+ };
225
271
 
226
272
  declare type ThanksWidgetConfiguration = ThanksSharedConfiguration;
227
273
 
274
+ /**
275
+ * To be used only with {@link thanksWidget}.
276
+ *
277
+ * Provides external control over ThanksWidget.
278
+ * Both ThanksWidgetController and thanksWidget.open can take settings with thanksWidget overriding values provided to ThanksWidgetController
279
+ * @public Indirect API for ThanksAd
280
+ * @example
281
+ * ```tsx
282
+ * // in some place
283
+ * <ThanksWidgetController partnerId="id" {...props}/>
284
+ *
285
+ * // in some other place
286
+ * thanksWidget.open({...propsOverride})
287
+ * thanksWidget.open()
288
+ * ```
289
+ */
290
+ export declare const ThanksWidgetController: FC<ThanksProps>;
291
+
292
+ /**
293
+ * Preloads ThanksWidget to speedup operations
294
+ */
295
+ export declare const ThanksWidgetPreload: () => JSX_2.Element;
296
+
228
297
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thanksjs/react-native-webview",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "ThanksJS React Native WebView",
5
5
  "homepage": "https://thanks.co/",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "react-native": "dist/esm/index.js",
10
10
  "types": "dist/react-native-webview-public.d.ts",
11
11
  "dependencies": {
12
- "react-native-webview": "^13.6.3"
12
+ "react-native-webview": "13.8.6"
13
13
  },
14
14
  "peerDependencies": {
15
15
  "react": "*",