statezero 0.8.0 → 0.9.2

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,5 +1,9 @@
1
1
  # statezero
2
2
 
3
+ [![npm version](https://badge.fury.io/js/statezero.svg)](https://www.npmjs.com/package/statezero)
4
+ [![CI](https://github.com/andornaut/statezero/actions/workflows/release.yml/badge.svg)](https://github.com/andornaut/statezero/actions/workflows/release.yml)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
3
7
  Small, simple, functional JavaScript library for managing immutable state.
4
8
 
5
9
  Statezero is used by [Jetstart - a library for building web interfaces](https://github.com/andornaut/jetstart).
@@ -26,19 +30,27 @@ Statezero is packaged as both ESM and UMD bundles, so it can be loaded in variou
26
30
  </script>
27
31
  ```
28
32
 
29
- ### ES6 Module
33
+ ### ES6 Module (Recommended)
34
+
35
+ The default ESM import is tree-shakeable. Dependencies (lodash, deep-diff, simple-deep-freeze) are external, so modern bundlers will tree-shake everything automatically.
30
36
 
31
37
  ```javascript
32
38
  import { action, subscribe } from "statezero";
33
39
  ```
34
40
 
35
- ### ES6 Module with tree shaking (not transpiled)
41
+ Bundle size: **~3.6KB minified** (statezero code only, external dependencies resolved by your bundler)
42
+
43
+ ### ES6 Module from Source
44
+
45
+ Import directly from unbundled source files for maximum flexibility:
36
46
 
37
47
  ```javascript
38
48
  // Note that the import path ends with '/src'
39
49
  import { action, subscribe } from "statezero/src";
40
50
  ```
41
51
 
52
+ This gives your bundler complete control over transpilation and tree-shaking.
53
+
42
54
  ### Node
43
55
 
44
56
  ```javascript
@@ -190,13 +202,13 @@ but if you want the callbacks to be invoked synchronously, then you can use `sub
190
202
 
191
203
  Getters are analogous to "computed properties" (see, for example,
192
204
  [computed properties in Vuex](https://vuex.vuejs.org/guide/state.html#getting-vuex-state-into-vue-components)).
193
- Getters are defined by calling `defineGetter(fn, path)`, where "fn" is a function that you define, which should return
194
- the value of the property, and "path" is the
205
+ Getters are defined by calling `defineGetter(path, fn, enumerable)`, where "path" is the
195
206
  [dot notation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Property_accessors)
196
207
  path of the
197
- [getter Property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters)
198
- that you wish to define. Any non-existent ancestors in the "path" will be created as empty objects. Note that you should
199
- avoid [cycles](https://en.wikipedia.org/wiki/Circular_dependency) in getters.
208
+ [getter property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects#Defining_getters_and_setters)
209
+ that you wish to define, "fn" is a function that returns the computed value, and "enumerable" (optional, defaults to
210
+ false) determines whether the property shows up during enumeration. Any non-existent ancestors in the "path" will be
211
+ created as empty objects. Note that you should avoid [cycles](https://en.wikipedia.org/wiki/Circular_dependency) in getters.
200
212
 
201
213
  The function that you pass to `defineGetter()` is itself passed two arguments by statezero: `parent` and `root`.
202
214
  `parent` corresponds to the object on which the getter was defined; in the case of a top-level getter, this is the
@@ -226,7 +238,10 @@ subscribe(console.log, "nested.countTimesTwo");
226
238
  Getter functions are called with the root state as the second argument.
227
239
 
228
240
  ```javascript
229
- defineGetter("nested.countTimesTwoTimesRootCount", (parent, root) => parent.count * 2 * root.count);
241
+ defineGetter(
242
+ "nested.countTimesTwoTimesRootCount",
243
+ (parent, root) => parent.count * 2 * root.count,
244
+ );
230
245
 
231
246
  subscribe(console.log, "nested.countTimesTwoTimesRootCount");
232
247
 
@@ -237,12 +252,15 @@ Getters can be
237
252
  [enumerable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties).
238
253
 
239
254
  ```javascript
240
- // The last argument defaults to `false`
241
- defineGetter('nested.property', () => null, true);
242
- const { enumerable } = Object.getOwnPropertyDescriptor(getState().nested, 'property');
243
- console.log(enumerable);
244
-
245
- // Prints "true"
255
+ // The last argument defaults to `false`
256
+ defineGetter("nested.property", () => null, true);
257
+ const { enumerable } = Object.getOwnPropertyDescriptor(
258
+ getState().nested,
259
+ "property",
260
+ );
261
+ console.log(enumerable);
262
+
263
+ // Prints "true"
246
264
  ```
247
265
 
248
266
  See [./test](./test) for more examples.
@@ -268,8 +286,26 @@ are logged; if not specified then all changes are logged. `logger` can be used t
268
286
  ```bash
269
287
  npm install
270
288
  npm run build # Development build (UMD + ESM)
289
+ npm run format # Format code with prettier-eslint
290
+ npm run lint # ESLint with zero-warning policy
271
291
  npm run test # Run tests with Jest
272
292
  npm run test:watch # Run tests in watch mode
273
- npm run lint # ESLint with zero-warning policy
274
- npm run format # Format code with prettier-eslint
275
293
  ```
294
+
295
+ ## Publishing
296
+
297
+ ```bash
298
+ npm version minor # or major/patch - updates package.json and creates git tag
299
+ git push && git push --tags
300
+ ```
301
+
302
+ Pushing the tag is the whole release. The Release workflow runs the checks,
303
+ cuts the GitHub release, and publishes to npm. `npm publish` is not run by
304
+ hand.
305
+
306
+ Nothing here holds an npm token. The workflow authenticates with a short-lived
307
+ credential minted from its own OIDC claim, against a trusted publisher
308
+ registered on npm that names this repository and
309
+ `.github/workflows/release.yml`. Renaming that file stops publishing until the
310
+ trusted publisher is updated to match. Publishing this way also attests
311
+ provenance, which is why no `--provenance` flag appears anywhere.
@@ -0,0 +1,251 @@
1
+ // TypeScript definitions for statezero
2
+
3
+ /**
4
+ * The root state type. Users can override this via module augmentation:
5
+ * @example
6
+ * declare module 'statezero' {
7
+ * interface StateSchema {
8
+ * count: number;
9
+ * user: { name: string };
10
+ * }
11
+ * }
12
+ */
13
+ export interface StateSchema {
14
+ [key: string]: unknown;
15
+ }
16
+
17
+ /**
18
+ * A selector for selecting a portion of state.
19
+ * Can be a dot-notation path, array of paths, selector function, or undefined for full state.
20
+ */
21
+ export type Selector<TState = StateSchema, TSelected = unknown> =
22
+ string | string[] | ((state: TState) => TSelected) | undefined;
23
+
24
+ /**
25
+ * Context provided to action functions
26
+ */
27
+ export interface ActionContext<TState = StateSchema> {
28
+ /** Commits the modified state, triggering subscriptions */
29
+ commit: (nextState: TState) => void;
30
+ /** A mutable clone of the current state */
31
+ state: TState;
32
+ }
33
+
34
+ /**
35
+ * Function signature for action definitions
36
+ */
37
+ export type ActionFunction<
38
+ TState = StateSchema,
39
+ TArgs extends unknown[] = unknown[],
40
+ TReturn = void,
41
+ > = (context: ActionContext<TState>, ...args: TArgs) => TReturn;
42
+
43
+ /**
44
+ * The callable action returned by action()
45
+ */
46
+ export type Action<TArgs extends unknown[] = unknown[], TReturn = void> = (
47
+ ...args: TArgs
48
+ ) => TReturn;
49
+
50
+ /**
51
+ * Callback function for state change subscriptions
52
+ */
53
+ export type SubscriberCallback<TSelected = unknown, TState = StateSchema> = (
54
+ nextState: TSelected,
55
+ prevState: TSelected,
56
+ nextRootState: TState,
57
+ ) => void;
58
+
59
+ /**
60
+ * A subscription handle returned by subscribe functions, used for unsubscribing
61
+ */
62
+ export type Subscription<
63
+ TSelected = unknown,
64
+ TState = StateSchema,
65
+ > = SubscriberCallback<TSelected, TState>;
66
+
67
+ /**
68
+ * Function signature for getters (computed properties)
69
+ * @param parent - The parent object on which the getter is defined
70
+ * @param root - The root state object
71
+ */
72
+ export type GetterFunction<TState = StateSchema, TReturn = unknown> = (
73
+ parent: unknown,
74
+ root: TState,
75
+ ) => TReturn;
76
+
77
+ /**
78
+ * Log entry for state change differences
79
+ */
80
+ export interface LogDiffEntry {
81
+ changeType: "New" | "Changed" | "Deleted" | "Array changed";
82
+ from: unknown;
83
+ to: unknown;
84
+ }
85
+
86
+ /**
87
+ * Properties passed to the logger function
88
+ */
89
+ export type LogProperties = Record<string, LogDiffEntry>;
90
+
91
+ /**
92
+ * Logger function signature for startLogging
93
+ */
94
+ export type LoggerFunction = (
95
+ properties: LogProperties,
96
+ columns: ["changeType", "from", "to"],
97
+ ) => void;
98
+
99
+ /**
100
+ * Create an action that can modify state.
101
+ * Actions receive a context with a mutable state clone and a commit function.
102
+ *
103
+ * @example
104
+ * const incrementCount = action(({ commit, state }) => {
105
+ * state.count = (state.count || 0) + 1;
106
+ * commit(state);
107
+ * });
108
+ */
109
+ export function action<TArgs extends unknown[] = unknown[], TReturn = void>(
110
+ fn: ActionFunction<StateSchema, TArgs, TReturn>,
111
+ ): Action<TArgs, TReturn>;
112
+
113
+ /**
114
+ * Get the current state or a subset of it.
115
+ *
116
+ * @example
117
+ * getState(); // returns full state
118
+ * getState('user.name'); // returns state.user.name
119
+ * getState(['count', 'user.name']); // returns [state.count, state.user.name]
120
+ * getState(state => state.count * 2); // returns computed value
121
+ */
122
+ export function getState(): StateSchema;
123
+ export function getState<T = unknown>(selector: string): T;
124
+ export function getState<T = unknown>(selector: string[]): T[];
125
+ export function getState<T = unknown>(selector: (state: StateSchema) => T): T;
126
+
127
+ /**
128
+ * Set state at the given selector path.
129
+ * If selector is undefined, null, or empty string, replaces the entire state.
130
+ *
131
+ * @example
132
+ * setState('count', 1);
133
+ * setState('user.name', 'Alice');
134
+ * setState('', { count: 0 }); // replaces entire state
135
+ */
136
+ export const setState: Action<
137
+ [selector: string | undefined | null, value: unknown],
138
+ void
139
+ >;
140
+
141
+ /**
142
+ * Set immutable state at the given selector path.
143
+ * Immutable objects can be replaced or deleted, but not mutated.
144
+ * Attempting to mutate an immutable object will throw an error.
145
+ *
146
+ * @param selector - A non-empty dot-notation path string
147
+ * @param obj - A plain object to store as immutable
148
+ */
149
+ export function setImmutableState(
150
+ selector: string,
151
+ obj: Record<string, unknown>,
152
+ ): void;
153
+
154
+ /**
155
+ * Subscribe to state changes.
156
+ * Returns a subscription handle for unsubscribing.
157
+ *
158
+ * @param callback - Function called when selected state changes
159
+ * @param selector - Optional selector to filter which state changes trigger the callback
160
+ * @param isSync - If true, callback is called synchronously; otherwise debounced to next tick
161
+ *
162
+ * @example
163
+ * const subscription = subscribe((count) => console.log(count), 'count');
164
+ * unsubscribe(subscription);
165
+ */
166
+ export function subscribe<T = unknown>(
167
+ callback: SubscriberCallback<T>,
168
+ selector?: Selector<StateSchema, T>,
169
+ isSync?: boolean,
170
+ ): Subscription<T>;
171
+
172
+ /**
173
+ * Subscribe to state changes synchronously.
174
+ * Callbacks are invoked immediately on each state change.
175
+ */
176
+ export function subscribeSync<T = unknown>(
177
+ callback: SubscriberCallback<T>,
178
+ selector?: Selector<StateSchema, T>,
179
+ ): Subscription<T>;
180
+
181
+ /**
182
+ * Subscribe to a single state change, then automatically unsubscribe.
183
+ */
184
+ export function subscribeOnce<T = unknown>(
185
+ callback: SubscriberCallback<T>,
186
+ selector?: Selector<StateSchema, T>,
187
+ isSync?: boolean,
188
+ ): Subscription<T>;
189
+
190
+ /**
191
+ * Subscribe to a single state change synchronously, then automatically unsubscribe.
192
+ */
193
+ export function subscribeOnceSync<T = unknown>(
194
+ callback: SubscriberCallback<T>,
195
+ selector?: Selector<StateSchema, T>,
196
+ ): Subscription<T>;
197
+
198
+ /**
199
+ * Unsubscribe from state changes.
200
+ * Pass the subscription handle returned by subscribe functions.
201
+ */
202
+ export function unsubscribe(subscription: Subscription): void;
203
+
204
+ /**
205
+ * Unsubscribe all subscribers (both async and sync).
206
+ */
207
+ export function unsubscribeAll(): void;
208
+
209
+ /**
210
+ * Define a getter (computed property) on the state.
211
+ * Getters are re-evaluated on each access.
212
+ *
213
+ * @param path - Dot-notation path or array path for the getter
214
+ * @param fn - Function that computes the getter value
215
+ * @param enumerable - Whether the property shows up during enumeration (default: false)
216
+ *
217
+ * @example
218
+ * defineGetter('countTimesTwo', (parent) => parent.count * 2);
219
+ * defineGetter('nested.computed', (parent, root) => parent.value + root.count);
220
+ */
221
+ export const defineGetter: Action<
222
+ [path: string | string[], fn: GetterFunction, enumerable?: boolean],
223
+ void
224
+ >;
225
+
226
+ /**
227
+ * Start logging state changes to the console.
228
+ * Uses console.table by default to display a diff of changes.
229
+ *
230
+ * @param selector - Optional selector to filter which changes are logged
231
+ * @param logger - Optional custom logger function (default: console.table)
232
+ */
233
+ export function startLogging(
234
+ selector?: Selector,
235
+ logger?: LoggerFunction,
236
+ ): void;
237
+
238
+ /**
239
+ * Stop logging state changes.
240
+ */
241
+ export function stopLogging(): void;
242
+
243
+ /**
244
+ * Set of async subscribers (debounced to next tick)
245
+ */
246
+ export const subscribersAsync: Set<SubscriberCallback>;
247
+
248
+ /**
249
+ * Set of sync subscribers (called immediately)
250
+ */
251
+ export const subscribersSync: Set<SubscriberCallback>;
@@ -1 +1 @@
1
- import U from"lodash/get";import Y from"lodash/set";var x="__statezero__root";function b(t){return t?t[x]:void 0}function d(t,e){Object.defineProperty(t,x,{enumerable:!1,value:e})}import j from"lodash/get";import I from"lodash/isPlainObject";import M from"lodash/set";import N from"simple-deep-freeze";import E from"lodash/cloneDeepWith";import R from"lodash/isPlainObject";var A="__statezero_immutable";function g(t){return t&&t[A]===!0}function O(t){Object.defineProperty(t,A,{enumerable:!1,value:!0})}var z=(t,e)=>typeof e=="object"?E(e,t):e,P=t=>{let e=new WeakMap,r,i=n=>{if(n instanceof Element||typeof n=="function"||g(n))return n;if(!R(n))return;let o=e.get(n);if(o)return o;if(o={},e.set(n,o),r||(r=o),!b(n)){for(let s of Object.getOwnPropertyNames(n))s.startsWith("__statezero")||s.startsWith("$jscomp")||(o[s]=z(i,n[s]));return o}d(o,r);for(let[s,c]of Object.entries(Object.getOwnPropertyDescriptors(n)))if(!(s.startsWith("__statezero")||s.startsWith("$jscomp"))){if(c.get){Object.defineProperty(o,s,c);continue}c.enumerable&&(o[s]=z(i,c.value))}return o};return E(t,i)};import _ from"lodash/get";import D from"lodash/isEqualWith";var m=new Set,p=new Set,W=(t,e)=>g(t)?t===e:void 0,$=(t,e)=>(r,i)=>{let n=e(r),o=e(i);D(n,o,W)||t(n,o,r)},T=t=>(e,r)=>{t(e,r,e)},F=t=>e=>t.map(r=>_(e,r)),L=t=>e=>_(e,t),y=(t,e,r=!1)=>{if(typeof e=="string"?e=L(e):Array.isArray(e)&&(e=F(e)),typeof e=="function")t=$(t,e);else if(e===void 0)t=T(t);else throw new Error(`statezero: subscribe() must be called with an Array/Function/String/undefined "selector" argument; not ${e}`);return r?p.add(t):m.add(t),t},it=(t,e)=>y(t,e,!0),C=(t,e,r=!1)=>{let n=y((...o)=>{t(...o),S(n)},e,r);return n},st=(t,e)=>C(t,e,!0),S=t=>{m.delete(t),p.delete(t)},ft=()=>{m.clear(),p.clear()};var f=N({}),l,q=t=>{l===void 0&&(l=t,setTimeout(()=>{let e=l;l=void 0;for(let r of m)r(f,e)}))},G=t=>{for(let e of p)e(f,t)},B=t=>{if(!I(t))throw new Error(`statezero: commit() must be called with a plain object "nextState" argument; not: ${t}`);let e=f;f=N(t),q(e),G(e)},w=t=>(...e)=>t({commit:B,state:P(f)},...e),yt=t=>{if(t===void 0)return f;if(typeof t=="string")return j(f,t);if(Array.isArray(t))return t.map(e=>j(f,e));if(typeof t=="function")return t(f);throw new Error(`statezero: getState() must be called with an Array/Function/String/undefined "selector" argument; not ${t}`)},H=w(({commit:t,state:e},r,i)=>{if(r==null||r==="")e=i;else if(typeof r=="string")M(e,r,i);else throw new Error(`statezero: setState() must be called with an String/undefined "selector" argument; not ${r}`);t(e)}),lt=(t,e)=>{if(!t)throw new Error('statezero: setImmutableState() must be called with a non-empty String "selector" argument');if(!I(e))throw new Error(`statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${e}`);O(e),H(t,e)};var Ot=w(({commit:t,state:e},r,i,n=!1)=>{let o=Array.isArray(r)?r:r.split("."),s=o.length-1,c=o[s],h=o.slice(0,s),a=e;h.length&&(a=U(e,h,{}),Y(e,h,a)),Object.defineProperty(a,c,{get(){return i.call(this,this,b(this))},enumerable:n}),d(a,e),t(e)});import J from"deep-diff";var u,K={A:"Array changed",D:"Deleted",E:"Changed",N:"New"},Q=t=>(e,r)=>{let i={},n=J(r,e);if(n!==void 0){for(let o of n){let{path:s}=o;i[s]={changeType:K[o.kind],from:o.lhs,to:o.rhs}}t(i,["changeType","from","to"])}},_t=(t,e)=>{u||(u=y(Q(e||console.table),t))},jt=()=>{u&&(S(u),u=null)};export{w as action,Ot as defineGetter,yt as getState,lt as setImmutableState,H as setState,_t as startLogging,jt as stopLogging,y as subscribe,C as subscribeOnce,st as subscribeOnceSync,it as subscribeSync,m as subscribersAsync,p as subscribersSync,S as unsubscribe,ft as unsubscribeAll};
1
+ import{get as B,set as H}from"lodash-es";var x="__statezero_root";function b(t){return t?t[x]:void 0}function d(t,e){Object.defineProperty(t,x,{enumerable:!1,value:e})}import{get as P,isPlainObject as _,set as J}from"lodash-es";import I from"simple-deep-freeze";import{cloneDeepWith as z,isPlainObject as R}from"lodash-es";var A="__statezero_immutable";function l(t){return t&&t[A]===!0}function O(t){Object.defineProperty(t,A,{enumerable:!1,value:!0})}var j=(t,e)=>typeof e=="object"?z(e,t):e,E=t=>{let e=new WeakMap,r,i=o=>{if(o instanceof Element||typeof o=="function"||l(o))return o;if(!R(o))return;let n=e.get(o);if(n)return n;if(n={},e.set(o,n),r||(r=n),!b(o)){for(let s of Object.getOwnPropertyNames(o))s.startsWith("__statezero")||s.startsWith("$jscomp")||(n[s]=j(i,o[s]));return n}d(n,r);for(let[s,f]of Object.entries(Object.getOwnPropertyDescriptors(o)))if(!(s.startsWith("__statezero")||s.startsWith("$jscomp"))){if(f.get){Object.defineProperty(n,s,f);continue}f.enumerable&&(n[s]=j(i,f.value))}return n};return z(t,i)};import{get as N,isEqualWith as D}from"lodash-es";var p=new Set,a=new Set,W=(t,e)=>l(t)?t===e:void 0,$=(t,e)=>(r,i)=>{let o=e(r),n=e(i);D(o,n,W)||t(o,n,r)},T=t=>(e,r)=>{t(e,r,e)},F=t=>e=>t.map(r=>N(e,r)),L=t=>e=>N(e,t),y=(t,e,r=!1)=>{let i=e;typeof e=="string"?i=L(e):Array.isArray(e)&&(i=F(e));let o;if(typeof i=="function")o=$(t,i);else if(i===void 0)o=T(t);else{let n=typeof e=="object"?JSON.stringify(e):e;throw new Error(`statezero: subscribe() must be called with an Array/Function/String/undefined selector; not ${n}`)}return r?a.add(o):p.add(o),o},ot=(t,e)=>y(t,e,!0),C=(t,e,r=!1)=>{let o=y((...n)=>{t(...n),h(o)},e,r);return o},nt=(t,e)=>C(t,e,!0),h=t=>{p.delete(t),a.delete(t)},it=()=>{p.clear(),a.clear()};var c=I({}),g,M=t=>{g===void 0&&(g=t,setTimeout(()=>{let e=g;g=void 0;for(let r of p)r(c,e)}))},k=t=>{for(let e of a)e(c,t)},q=t=>{if(!_(t))throw new Error(`statezero: commit() must be called with a plain object "nextState" argument; not: ${t}`);let e=c;c=I(t),M(e),k(e)},w=t=>(...e)=>t({commit:q,state:E(c)},...e),ut=t=>{if(t===void 0)return c;if(typeof t=="string")return P(c,t);if(Array.isArray(t))return t.map(r=>P(c,r));if(typeof t=="function")return t(c);let e=typeof t=="object"?JSON.stringify(t):t;throw new Error(`statezero: getState() must be called with an Array/Function/String/undefined selector; not ${e}`)},G=w(({commit:t,state:e},r,i)=>{let o=e;if(r==null||r==="")o=i;else if(typeof r=="string")J(e,r,i);else{let n=typeof r=="object"?JSON.stringify(r):r;throw new Error(`statezero: setState() must be called with an String/undefined "selector" argument; not ${n}`)}t(o)}),bt=(t,e)=>{if(!t)throw new Error('statezero: setImmutableState() must be called with a non-empty String "selector" argument');if(!_(e))throw new Error(`statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${e}`);O(e),G(t,e)};var St=w(({commit:t,state:e},r,i,o=!1)=>{let n=Array.isArray(r)?r:r.split("."),s=n.length-1,f=n[s],S=n.slice(0,s),u=e;S.length&&(u=B(e,S,{}),H(e,S,u)),Object.defineProperty(u,f,{enumerable:o,get(){return i.call(this,this,b(this))}}),d(u,e),t(e)});import U from"deep-diff";var m,Y={A:"Array changed",D:"Deleted",E:"Changed",N:"New"},K=t=>(e,r)=>{let i={},o=U(r,e);if(o!==void 0){for(let n of o){let{path:s}=n;i[s]={changeType:Y[n.kind],from:n.lhs,to:n.rhs}}t(i,["changeType","from","to"])}},At=(t,e)=>{m||(m=y(K(e||console.table),t))},Ot=()=>{m&&(h(m),m=null)};export{w as action,St as defineGetter,ut as getState,bt as setImmutableState,G as setState,At as startLogging,Ot as stopLogging,y as subscribe,C as subscribeOnce,nt as subscribeOnceSync,ot as subscribeSync,p as subscribersAsync,a as subscribersSync,h as unsubscribe,it as unsubscribeAll};
package/dist/statezero.js CHANGED
@@ -1 +1,14 @@
1
- var statezero=(()=>{var us=Object.create;var he=Object.defineProperty;var fs=Object.getOwnPropertyDescriptor;var ps=Object.getOwnPropertyNames;var cs=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty;var i=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),ys=(e,r)=>{for(var t in r)he(e,t,{get:r[t],enumerable:!0})},Nr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of ps(r))!ls.call(e,f)&&f!==t&&he(e,f,{get:()=>r[f],enumerable:!(n=fs(r,f))||n.enumerable});return e};var E=(e,r,t)=>(t=e!=null?us(cs(e)):{},Nr(r||!e||!e.__esModule?he(t,"default",{value:e,enumerable:!0}):t,e)),ds=e=>Nr(he({},"__esModule",{value:!0}),e);var M=i((kg,Lr)=>{var bs=Array.isArray;Lr.exports=bs});var Ye=i((ev,Mr)=>{var gs=typeof global=="object"&&global&&global.Object===Object&&global;Mr.exports=gs});var I=i((rv,Fr)=>{var vs=Ye(),hs=typeof self=="object"&&self&&self.Object===Object&&self,qs=vs||hs||Function("return this")();Fr.exports=qs});var $=i((tv,Gr)=>{var xs=I(),ms=xs.Symbol;Gr.exports=ms});var Kr=i((nv,Ur)=>{var Rr=$(),Br=Object.prototype,As=Br.hasOwnProperty,_s=Br.toString,ie=Rr?Rr.toStringTag:void 0;function Ts(e){var r=As.call(e,ie),t=e[ie];try{e[ie]=void 0;var n=!0}catch{}var f=_s.call(e);return n&&(r?e[ie]=t:delete e[ie]),f}Ur.exports=Ts});var Hr=i((iv,zr)=>{var Os=Object.prototype,ws=Os.toString;function Ss(e){return ws.call(e)}zr.exports=Ss});var R=i((av,Yr)=>{var $r=$(),js=Kr(),Ps=Hr(),Cs="[object Null]",Es="[object Undefined]",Wr=$r?$r.toStringTag:void 0;function Is(e){return e==null?e===void 0?Es:Cs:Wr&&Wr in Object(e)?js(e):Ps(e)}Yr.exports=Is});var N=i((ov,Xr)=>{function Ds(e){return e!=null&&typeof e=="object"}Xr.exports=Ds});var qe=i((sv,Zr)=>{var Ns=R(),Ls=N(),Ms="[object Symbol]";function Fs(e){return typeof e=="symbol"||Ls(e)&&Ns(e)==Ms}Zr.exports=Fs});var Qr=i((uv,Jr)=>{var Gs=M(),Rs=qe(),Bs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Us=/^\w*$/;function Ks(e,r){if(Gs(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Rs(e)?!0:Us.test(e)||!Bs.test(e)||r!=null&&e in Object(r)}Jr.exports=Ks});var B=i((fv,Vr)=>{function zs(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}Vr.exports=zs});var Xe=i((pv,kr)=>{var Hs=R(),$s=B(),Ws="[object AsyncFunction]",Ys="[object Function]",Xs="[object GeneratorFunction]",Zs="[object Proxy]";function Js(e){if(!$s(e))return!1;var r=Hs(e);return r==Ys||r==Xs||r==Ws||r==Zs}kr.exports=Js});var rt=i((cv,et)=>{var Qs=I(),Vs=Qs["__core-js_shared__"];et.exports=Vs});var it=i((lv,nt)=>{var Ze=rt(),tt=(function(){var e=/[^.]+$/.exec(Ze&&Ze.keys&&Ze.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function ks(e){return!!tt&&tt in e}nt.exports=ks});var Je=i((yv,at)=>{var eu=Function.prototype,ru=eu.toString;function tu(e){if(e!=null){try{return ru.call(e)}catch{}try{return e+""}catch{}}return""}at.exports=tu});var st=i((dv,ot)=>{var nu=Xe(),iu=it(),au=B(),ou=Je(),su=/[\\^$.*+?()[\]{}|]/g,uu=/^\[object .+?Constructor\]$/,fu=Function.prototype,pu=Object.prototype,cu=fu.toString,lu=pu.hasOwnProperty,yu=RegExp("^"+cu.call(lu).replace(su,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function du(e){if(!au(e)||iu(e))return!1;var r=nu(e)?yu:uu;return r.test(ou(e))}ot.exports=du});var ft=i((bv,ut)=>{function bu(e,r){return e?.[r]}ut.exports=bu});var F=i((gv,pt)=>{var gu=st(),vu=ft();function hu(e,r){var t=vu(e,r);return gu(t)?t:void 0}pt.exports=hu});var ae=i((vv,ct)=>{var qu=F(),xu=qu(Object,"create");ct.exports=xu});var dt=i((hv,yt)=>{var lt=ae();function mu(){this.__data__=lt?lt(null):{},this.size=0}yt.exports=mu});var gt=i((qv,bt)=>{function Au(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}bt.exports=Au});var ht=i((xv,vt)=>{var _u=ae(),Tu="__lodash_hash_undefined__",Ou=Object.prototype,wu=Ou.hasOwnProperty;function Su(e){var r=this.__data__;if(_u){var t=r[e];return t===Tu?void 0:t}return wu.call(r,e)?r[e]:void 0}vt.exports=Su});var xt=i((mv,qt)=>{var ju=ae(),Pu=Object.prototype,Cu=Pu.hasOwnProperty;function Eu(e){var r=this.__data__;return ju?r[e]!==void 0:Cu.call(r,e)}qt.exports=Eu});var At=i((Av,mt)=>{var Iu=ae(),Du="__lodash_hash_undefined__";function Nu(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Iu&&r===void 0?Du:r,this}mt.exports=Nu});var Tt=i((_v,_t)=>{var Lu=dt(),Mu=gt(),Fu=ht(),Gu=xt(),Ru=At();function W(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}W.prototype.clear=Lu;W.prototype.delete=Mu;W.prototype.get=Fu;W.prototype.has=Gu;W.prototype.set=Ru;_t.exports=W});var wt=i((Tv,Ot)=>{function Bu(){this.__data__=[],this.size=0}Ot.exports=Bu});var xe=i((Ov,St)=>{function Uu(e,r){return e===r||e!==e&&r!==r}St.exports=Uu});var oe=i((wv,jt)=>{var Ku=xe();function zu(e,r){for(var t=e.length;t--;)if(Ku(e[t][0],r))return t;return-1}jt.exports=zu});var Ct=i((Sv,Pt)=>{var Hu=oe(),$u=Array.prototype,Wu=$u.splice;function Yu(e){var r=this.__data__,t=Hu(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Wu.call(r,t,1),--this.size,!0}Pt.exports=Yu});var It=i((jv,Et)=>{var Xu=oe();function Zu(e){var r=this.__data__,t=Xu(r,e);return t<0?void 0:r[t][1]}Et.exports=Zu});var Nt=i((Pv,Dt)=>{var Ju=oe();function Qu(e){return Ju(this.__data__,e)>-1}Dt.exports=Qu});var Mt=i((Cv,Lt)=>{var Vu=oe();function ku(e,r){var t=this.__data__,n=Vu(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}Lt.exports=ku});var se=i((Ev,Ft)=>{var ef=wt(),rf=Ct(),tf=It(),nf=Nt(),af=Mt();function Y(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}Y.prototype.clear=ef;Y.prototype.delete=rf;Y.prototype.get=tf;Y.prototype.has=nf;Y.prototype.set=af;Ft.exports=Y});var me=i((Iv,Gt)=>{var of=F(),sf=I(),uf=of(sf,"Map");Gt.exports=uf});var Ut=i((Dv,Bt)=>{var Rt=Tt(),ff=se(),pf=me();function cf(){this.size=0,this.__data__={hash:new Rt,map:new(pf||ff),string:new Rt}}Bt.exports=cf});var zt=i((Nv,Kt)=>{function lf(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}Kt.exports=lf});var ue=i((Lv,Ht)=>{var yf=zt();function df(e,r){var t=e.__data__;return yf(r)?t[typeof r=="string"?"string":"hash"]:t.map}Ht.exports=df});var Wt=i((Mv,$t)=>{var bf=ue();function gf(e){var r=bf(this,e).delete(e);return this.size-=r?1:0,r}$t.exports=gf});var Xt=i((Fv,Yt)=>{var vf=ue();function hf(e){return vf(this,e).get(e)}Yt.exports=hf});var Jt=i((Gv,Zt)=>{var qf=ue();function xf(e){return qf(this,e).has(e)}Zt.exports=xf});var Vt=i((Rv,Qt)=>{var mf=ue();function Af(e,r){var t=mf(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}Qt.exports=Af});var Ae=i((Bv,kt)=>{var _f=Ut(),Tf=Wt(),Of=Xt(),wf=Jt(),Sf=Vt();function X(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}X.prototype.clear=_f;X.prototype.delete=Tf;X.prototype.get=Of;X.prototype.has=wf;X.prototype.set=Sf;kt.exports=X});var tn=i((Uv,rn)=>{var en=Ae(),jf="Expected a function";function Qe(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(jf);var t=function(){var n=arguments,f=r?r.apply(this,n):n[0],s=t.cache;if(s.has(f))return s.get(f);var c=e.apply(this,n);return t.cache=s.set(f,c)||s,c};return t.cache=new(Qe.Cache||en),t}Qe.Cache=en;rn.exports=Qe});var an=i((Kv,nn)=>{var Pf=tn(),Cf=500;function Ef(e){var r=Pf(e,function(n){return t.size===Cf&&t.clear(),n}),t=r.cache;return r}nn.exports=Ef});var sn=i((zv,on)=>{var If=an(),Df=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nf=/\\(\\)?/g,Lf=If(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(Df,function(t,n,f,s){r.push(f?s.replace(Nf,"$1"):n||t)}),r});on.exports=Lf});var fn=i((Hv,un)=>{function Mf(e,r){for(var t=-1,n=e==null?0:e.length,f=Array(n);++t<n;)f[t]=r(e[t],t,e);return f}un.exports=Mf});var bn=i(($v,dn)=>{var pn=$(),Ff=fn(),Gf=M(),Rf=qe(),Bf=1/0,cn=pn?pn.prototype:void 0,ln=cn?cn.toString:void 0;function yn(e){if(typeof e=="string")return e;if(Gf(e))return Ff(e,yn)+"";if(Rf(e))return ln?ln.call(e):"";var r=e+"";return r=="0"&&1/e==-Bf?"-0":r}dn.exports=yn});var vn=i((Wv,gn)=>{var Uf=bn();function Kf(e){return e==null?"":Uf(e)}gn.exports=Kf});var Ve=i((Yv,hn)=>{var zf=M(),Hf=Qr(),$f=sn(),Wf=vn();function Yf(e,r){return zf(e)?e:Hf(e,r)?[e]:$f(Wf(e))}hn.exports=Yf});var ke=i((Xv,qn)=>{var Xf=qe(),Zf=1/0;function Jf(e){if(typeof e=="string"||Xf(e))return e;var r=e+"";return r=="0"&&1/e==-Zf?"-0":r}qn.exports=Jf});var mn=i((Zv,xn)=>{var Qf=Ve(),Vf=ke();function kf(e,r){r=Qf(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[Vf(r[t++])];return t&&t==n?e:void 0}xn.exports=kf});var _e=i((Jv,An)=>{var ep=mn();function rp(e,r,t){var n=e==null?void 0:ep(e,r);return n===void 0?t:n}An.exports=rp});var Tn=i((Qv,_n)=>{var tp=F(),np=(function(){try{var e=tp(Object,"defineProperty");return e({},"",{}),e}catch{}})();_n.exports=np});var er=i((Vv,wn)=>{var On=Tn();function ip(e,r,t){r=="__proto__"&&On?On(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}wn.exports=ip});var Te=i((kv,Sn)=>{var ap=er(),op=xe(),sp=Object.prototype,up=sp.hasOwnProperty;function fp(e,r,t){var n=e[r];(!(up.call(e,r)&&op(n,t))||t===void 0&&!(r in e))&&ap(e,r,t)}Sn.exports=fp});var rr=i((eh,jn)=>{var pp=9007199254740991,cp=/^(?:0|[1-9]\d*)$/;function lp(e,r){var t=typeof e;return r=r??pp,!!r&&(t=="number"||t!="symbol"&&cp.test(e))&&e>-1&&e%1==0&&e<r}jn.exports=lp});var En=i((rh,Cn)=>{var yp=Te(),dp=Ve(),bp=rr(),Pn=B(),gp=ke();function vp(e,r,t,n){if(!Pn(e))return e;r=dp(r,e);for(var f=-1,s=r.length,c=s-1,y=e;y!=null&&++f<s;){var d=gp(r[f]),b=t;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(f!=c){var _=y[d];b=n?n(_,d,y):void 0,b===void 0&&(b=Pn(_)?_:bp(r[f+1])?[]:{})}yp(y,d,b),y=y[d]}return e}Cn.exports=vp});var tr=i((th,In)=>{var hp=En();function qp(e,r,t){return e==null?e:hp(e,r,t)}In.exports=qp});var nr=i((ih,Nn)=>{function xp(e,r){return function(t){return e(r(t))}}Nn.exports=xp});var Se=i((ah,Ln)=>{var mp=nr(),Ap=mp(Object.getPrototypeOf,Object);Ln.exports=Ap});var ir=i((oh,Fn)=>{var _p=R(),Tp=Se(),Op=N(),wp="[object Object]",Sp=Function.prototype,jp=Object.prototype,Mn=Sp.toString,Pp=jp.hasOwnProperty,Cp=Mn.call(Object);function Ep(e){if(!Op(e)||_p(e)!=wp)return!1;var r=Tp(e);if(r===null)return!0;var t=Pp.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Mn.call(t)==Cp}Fn.exports=Ep});var Rn=i((sh,Gn)=>{"use strict";Gn.exports=function e(r){try{return r}catch{}if(Object.isFrozen(r))return r;if(!Array.isArray(r)&&Object.getPrototypeOf(r)!==Object.getPrototypeOf({}))throw new Error("simpleDeepFreeze only supports plain objects, arrays, and primitives");return Object.freeze(r),Object.keys(r).forEach(function(t){e(r[t])}),r}});var Un=i((uh,Bn)=>{var Ip=se();function Dp(){this.__data__=new Ip,this.size=0}Bn.exports=Dp});var zn=i((fh,Kn)=>{function Np(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}Kn.exports=Np});var $n=i((ph,Hn)=>{function Lp(e){return this.__data__.get(e)}Hn.exports=Lp});var Yn=i((ch,Wn)=>{function Mp(e){return this.__data__.has(e)}Wn.exports=Mp});var Zn=i((lh,Xn)=>{var Fp=se(),Gp=me(),Rp=Ae(),Bp=200;function Up(e,r){var t=this.__data__;if(t instanceof Fp){var n=t.__data__;if(!Gp||n.length<Bp-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new Rp(n)}return t.set(e,r),this.size=t.size,this}Xn.exports=Up});var ar=i((yh,Jn)=>{var Kp=se(),zp=Un(),Hp=zn(),$p=$n(),Wp=Yn(),Yp=Zn();function Z(e){var r=this.__data__=new Kp(e);this.size=r.size}Z.prototype.clear=zp;Z.prototype.delete=Hp;Z.prototype.get=$p;Z.prototype.has=Wp;Z.prototype.set=Yp;Jn.exports=Z});var Vn=i((dh,Qn)=>{function Xp(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}Qn.exports=Xp});var fe=i((bh,kn)=>{var Zp=Te(),Jp=er();function Qp(e,r,t,n){var f=!t;t||(t={});for(var s=-1,c=r.length;++s<c;){var y=r[s],d=n?n(t[y],e[y],y,t,e):void 0;d===void 0&&(d=e[y]),f?Jp(t,y,d):Zp(t,y,d)}return t}kn.exports=Qp});var ri=i((gh,ei)=>{function Vp(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}ei.exports=Vp});var ni=i((vh,ti)=>{var kp=R(),ec=N(),rc="[object Arguments]";function tc(e){return ec(e)&&kp(e)==rc}ti.exports=tc});var si=i((hh,oi)=>{var ii=ni(),nc=N(),ai=Object.prototype,ic=ai.hasOwnProperty,ac=ai.propertyIsEnumerable,oc=ii((function(){return arguments})())?ii:function(e){return nc(e)&&ic.call(e,"callee")&&!ac.call(e,"callee")};oi.exports=oc});var fi=i((qh,ui)=>{function sc(){return!1}ui.exports=sc});var je=i((pe,J)=>{var uc=I(),fc=fi(),li=typeof pe=="object"&&pe&&!pe.nodeType&&pe,pi=li&&typeof J=="object"&&J&&!J.nodeType&&J,pc=pi&&pi.exports===li,ci=pc?uc.Buffer:void 0,cc=ci?ci.isBuffer:void 0,lc=cc||fc;J.exports=lc});var or=i((xh,yi)=>{var yc=9007199254740991;function dc(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=yc}yi.exports=dc});var bi=i((mh,di)=>{var bc=R(),gc=or(),vc=N(),hc="[object Arguments]",qc="[object Array]",xc="[object Boolean]",mc="[object Date]",Ac="[object Error]",_c="[object Function]",Tc="[object Map]",Oc="[object Number]",wc="[object Object]",Sc="[object RegExp]",jc="[object Set]",Pc="[object String]",Cc="[object WeakMap]",Ec="[object ArrayBuffer]",Ic="[object DataView]",Dc="[object Float32Array]",Nc="[object Float64Array]",Lc="[object Int8Array]",Mc="[object Int16Array]",Fc="[object Int32Array]",Gc="[object Uint8Array]",Rc="[object Uint8ClampedArray]",Bc="[object Uint16Array]",Uc="[object Uint32Array]",m={};m[Dc]=m[Nc]=m[Lc]=m[Mc]=m[Fc]=m[Gc]=m[Rc]=m[Bc]=m[Uc]=!0;m[hc]=m[qc]=m[Ec]=m[xc]=m[Ic]=m[mc]=m[Ac]=m[_c]=m[Tc]=m[Oc]=m[wc]=m[Sc]=m[jc]=m[Pc]=m[Cc]=!1;function Kc(e){return vc(e)&&gc(e.length)&&!!m[bc(e)]}di.exports=Kc});var Pe=i((Ah,gi)=>{function zc(e){return function(r){return e(r)}}gi.exports=zc});var Ce=i((ce,Q)=>{var Hc=Ye(),vi=typeof ce=="object"&&ce&&!ce.nodeType&&ce,le=vi&&typeof Q=="object"&&Q&&!Q.nodeType&&Q,$c=le&&le.exports===vi,sr=$c&&Hc.process,Wc=(function(){try{var e=le&&le.require&&le.require("util").types;return e||sr&&sr.binding&&sr.binding("util")}catch{}})();Q.exports=Wc});var ur=i((_h,xi)=>{var Yc=bi(),Xc=Pe(),hi=Ce(),qi=hi&&hi.isTypedArray,Zc=qi?Xc(qi):Yc;xi.exports=Zc});var fr=i((Th,mi)=>{var Jc=ri(),Qc=si(),Vc=M(),kc=je(),el=rr(),rl=ur(),tl=Object.prototype,nl=tl.hasOwnProperty;function il(e,r){var t=Vc(e),n=!t&&Qc(e),f=!t&&!n&&kc(e),s=!t&&!n&&!f&&rl(e),c=t||n||f||s,y=c?Jc(e.length,String):[],d=y.length;for(var b in e)(r||nl.call(e,b))&&!(c&&(b=="length"||f&&(b=="offset"||b=="parent")||s&&(b=="buffer"||b=="byteLength"||b=="byteOffset")||el(b,d)))&&y.push(b);return y}mi.exports=il});var Ee=i((Oh,Ai)=>{var al=Object.prototype;function ol(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||al;return e===t}Ai.exports=ol});var Ti=i((wh,_i)=>{var sl=nr(),ul=sl(Object.keys,Object);_i.exports=ul});var wi=i((Sh,Oi)=>{var fl=Ee(),pl=Ti(),cl=Object.prototype,ll=cl.hasOwnProperty;function yl(e){if(!fl(e))return pl(e);var r=[];for(var t in Object(e))ll.call(e,t)&&t!="constructor"&&r.push(t);return r}Oi.exports=yl});var pr=i((jh,Si)=>{var dl=Xe(),bl=or();function gl(e){return e!=null&&bl(e.length)&&!dl(e)}Si.exports=gl});var Ie=i((Ph,ji)=>{var vl=fr(),hl=wi(),ql=pr();function xl(e){return ql(e)?vl(e):hl(e)}ji.exports=xl});var Ci=i((Ch,Pi)=>{var ml=fe(),Al=Ie();function _l(e,r){return e&&ml(r,Al(r),e)}Pi.exports=_l});var Ii=i((Eh,Ei)=>{function Tl(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}Ei.exports=Tl});var Ni=i((Ih,Di)=>{var Ol=B(),wl=Ee(),Sl=Ii(),jl=Object.prototype,Pl=jl.hasOwnProperty;function Cl(e){if(!Ol(e))return Sl(e);var r=wl(e),t=[];for(var n in e)n=="constructor"&&(r||!Pl.call(e,n))||t.push(n);return t}Di.exports=Cl});var De=i((Dh,Li)=>{var El=fr(),Il=Ni(),Dl=pr();function Nl(e){return Dl(e)?El(e,!0):Il(e)}Li.exports=Nl});var Fi=i((Nh,Mi)=>{var Ll=fe(),Ml=De();function Fl(e,r){return e&&Ll(r,Ml(r),e)}Mi.exports=Fl});var Ki=i((ye,V)=>{var Gl=I(),Ui=typeof ye=="object"&&ye&&!ye.nodeType&&ye,Gi=Ui&&typeof V=="object"&&V&&!V.nodeType&&V,Rl=Gi&&Gi.exports===Ui,Ri=Rl?Gl.Buffer:void 0,Bi=Ri?Ri.allocUnsafe:void 0;function Bl(e,r){if(r)return e.slice();var t=e.length,n=Bi?Bi(t):new e.constructor(t);return e.copy(n),n}V.exports=Bl});var Hi=i((Lh,zi)=>{function Ul(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}zi.exports=Ul});var Wi=i((Mh,$i)=>{function Kl(e,r){for(var t=-1,n=e==null?0:e.length,f=0,s=[];++t<n;){var c=e[t];r(c,t,e)&&(s[f++]=c)}return s}$i.exports=Kl});var cr=i((Fh,Yi)=>{function zl(){return[]}Yi.exports=zl});var Ne=i((Gh,Zi)=>{var Hl=Wi(),$l=cr(),Wl=Object.prototype,Yl=Wl.propertyIsEnumerable,Xi=Object.getOwnPropertySymbols,Xl=Xi?function(e){return e==null?[]:(e=Object(e),Hl(Xi(e),function(r){return Yl.call(e,r)}))}:$l;Zi.exports=Xl});var Qi=i((Rh,Ji)=>{var Zl=fe(),Jl=Ne();function Ql(e,r){return Zl(e,Jl(e),r)}Ji.exports=Ql});var lr=i((Bh,Vi)=>{function Vl(e,r){for(var t=-1,n=r.length,f=e.length;++t<n;)e[f+t]=r[t];return e}Vi.exports=Vl});var yr=i((Uh,ki)=>{var kl=lr(),ey=Se(),ry=Ne(),ty=cr(),ny=Object.getOwnPropertySymbols,iy=ny?function(e){for(var r=[];e;)kl(r,ry(e)),e=ey(e);return r}:ty;ki.exports=iy});var ra=i((Kh,ea)=>{var ay=fe(),oy=yr();function sy(e,r){return ay(e,oy(e),r)}ea.exports=sy});var dr=i((zh,ta)=>{var uy=lr(),fy=M();function py(e,r,t){var n=r(e);return fy(e)?n:uy(n,t(e))}ta.exports=py});var br=i((Hh,na)=>{var cy=dr(),ly=Ne(),yy=Ie();function dy(e){return cy(e,yy,ly)}na.exports=dy});var aa=i(($h,ia)=>{var by=dr(),gy=yr(),vy=De();function hy(e){return by(e,vy,gy)}ia.exports=hy});var sa=i((Wh,oa)=>{var qy=F(),xy=I(),my=qy(xy,"DataView");oa.exports=my});var fa=i((Yh,ua)=>{var Ay=F(),_y=I(),Ty=Ay(_y,"Promise");ua.exports=Ty});var ca=i((Xh,pa)=>{var Oy=F(),wy=I(),Sy=Oy(wy,"Set");pa.exports=Sy});var ya=i((Zh,la)=>{var jy=F(),Py=I(),Cy=jy(Py,"WeakMap");la.exports=Cy});var de=i((Jh,xa)=>{var gr=sa(),vr=me(),hr=fa(),qr=ca(),xr=ya(),qa=R(),k=Je(),da="[object Map]",Ey="[object Object]",ba="[object Promise]",ga="[object Set]",va="[object WeakMap]",ha="[object DataView]",Iy=k(gr),Dy=k(vr),Ny=k(hr),Ly=k(qr),My=k(xr),U=qa;(gr&&U(new gr(new ArrayBuffer(1)))!=ha||vr&&U(new vr)!=da||hr&&U(hr.resolve())!=ba||qr&&U(new qr)!=ga||xr&&U(new xr)!=va)&&(U=function(e){var r=qa(e),t=r==Ey?e.constructor:void 0,n=t?k(t):"";if(n)switch(n){case Iy:return ha;case Dy:return da;case Ny:return ba;case Ly:return ga;case My:return va}return r});xa.exports=U});var Aa=i((Qh,ma)=>{var Fy=Object.prototype,Gy=Fy.hasOwnProperty;function Ry(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Gy.call(e,"index")&&(t.index=e.index,t.input=e.input),t}ma.exports=Ry});var mr=i((Vh,_a)=>{var By=I(),Uy=By.Uint8Array;_a.exports=Uy});var Le=i((kh,Oa)=>{var Ta=mr();function Ky(e){var r=new e.constructor(e.byteLength);return new Ta(r).set(new Ta(e)),r}Oa.exports=Ky});var Sa=i((eq,wa)=>{var zy=Le();function Hy(e,r){var t=r?zy(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}wa.exports=Hy});var Pa=i((rq,ja)=>{var $y=/\w*$/;function Wy(e){var r=new e.constructor(e.source,$y.exec(e));return r.lastIndex=e.lastIndex,r}ja.exports=Wy});var Na=i((tq,Da)=>{var Ca=$(),Ea=Ca?Ca.prototype:void 0,Ia=Ea?Ea.valueOf:void 0;function Yy(e){return Ia?Object(Ia.call(e)):{}}Da.exports=Yy});var Ma=i((nq,La)=>{var Xy=Le();function Zy(e,r){var t=r?Xy(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}La.exports=Zy});var Ga=i((iq,Fa)=>{var Jy=Le(),Qy=Sa(),Vy=Pa(),ky=Na(),ed=Ma(),rd="[object Boolean]",td="[object Date]",nd="[object Map]",id="[object Number]",ad="[object RegExp]",od="[object Set]",sd="[object String]",ud="[object Symbol]",fd="[object ArrayBuffer]",pd="[object DataView]",cd="[object Float32Array]",ld="[object Float64Array]",yd="[object Int8Array]",dd="[object Int16Array]",bd="[object Int32Array]",gd="[object Uint8Array]",vd="[object Uint8ClampedArray]",hd="[object Uint16Array]",qd="[object Uint32Array]";function xd(e,r,t){var n=e.constructor;switch(r){case fd:return Jy(e);case rd:case td:return new n(+e);case pd:return Qy(e,t);case cd:case ld:case yd:case dd:case bd:case gd:case vd:case hd:case qd:return ed(e,t);case nd:return new n;case id:case sd:return new n(e);case ad:return Vy(e);case od:return new n;case ud:return ky(e)}}Fa.exports=xd});var Ua=i((aq,Ba)=>{var md=B(),Ra=Object.create,Ad=(function(){function e(){}return function(r){if(!md(r))return{};if(Ra)return Ra(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}})();Ba.exports=Ad});var za=i((oq,Ka)=>{var _d=Ua(),Td=Se(),Od=Ee();function wd(e){return typeof e.constructor=="function"&&!Od(e)?_d(Td(e)):{}}Ka.exports=wd});var $a=i((sq,Ha)=>{var Sd=de(),jd=N(),Pd="[object Map]";function Cd(e){return jd(e)&&Sd(e)==Pd}Ha.exports=Cd});var Za=i((uq,Xa)=>{var Ed=$a(),Id=Pe(),Wa=Ce(),Ya=Wa&&Wa.isMap,Dd=Ya?Id(Ya):Ed;Xa.exports=Dd});var Qa=i((fq,Ja)=>{var Nd=de(),Ld=N(),Md="[object Set]";function Fd(e){return Ld(e)&&Nd(e)==Md}Ja.exports=Fd});var ro=i((pq,eo)=>{var Gd=Qa(),Rd=Pe(),Va=Ce(),ka=Va&&Va.isSet,Bd=ka?Rd(ka):Gd;eo.exports=Bd});var oo=i((cq,ao)=>{var Ud=ar(),Kd=Vn(),zd=Te(),Hd=Ci(),$d=Fi(),Wd=Ki(),Yd=Hi(),Xd=Qi(),Zd=ra(),Jd=br(),Qd=aa(),Vd=de(),kd=Aa(),eb=Ga(),rb=za(),tb=M(),nb=je(),ib=Za(),ab=B(),ob=ro(),sb=Ie(),ub=De(),fb=1,pb=2,cb=4,to="[object Arguments]",lb="[object Array]",yb="[object Boolean]",db="[object Date]",bb="[object Error]",no="[object Function]",gb="[object GeneratorFunction]",vb="[object Map]",hb="[object Number]",io="[object Object]",qb="[object RegExp]",xb="[object Set]",mb="[object String]",Ab="[object Symbol]",_b="[object WeakMap]",Tb="[object ArrayBuffer]",Ob="[object DataView]",wb="[object Float32Array]",Sb="[object Float64Array]",jb="[object Int8Array]",Pb="[object Int16Array]",Cb="[object Int32Array]",Eb="[object Uint8Array]",Ib="[object Uint8ClampedArray]",Db="[object Uint16Array]",Nb="[object Uint32Array]",x={};x[to]=x[lb]=x[Tb]=x[Ob]=x[yb]=x[db]=x[wb]=x[Sb]=x[jb]=x[Pb]=x[Cb]=x[vb]=x[hb]=x[io]=x[qb]=x[xb]=x[mb]=x[Ab]=x[Eb]=x[Ib]=x[Db]=x[Nb]=!0;x[bb]=x[no]=x[_b]=!1;function Me(e,r,t,n,f,s){var c,y=r&fb,d=r&pb,b=r&cb;if(t&&(c=f?t(e,n,f,s):t(e)),c!==void 0)return c;if(!ab(e))return e;var _=tb(e);if(_){if(c=kd(e),!y)return Yd(e,c)}else{var h=Vd(e),q=h==no||h==gb;if(nb(e))return Wd(e,y);if(h==io||h==to||q&&!f){if(c=d||q?{}:rb(e),!y)return d?Zd(e,$d(c,e)):Xd(e,Hd(c,e))}else{if(!x[h])return f?e:{};c=eb(e,h,y)}}s||(s=new Ud);var S=s.get(e);if(S)return S;s.set(e,c),ob(e)?e.forEach(function(O){c.add(Me(O,r,t,O,e,s))}):ib(e)&&e.forEach(function(O,w){c.set(w,Me(O,r,t,w,e,s))});var j=b?d?Qd:Jd:d?ub:sb,T=_?void 0:j(e);return Kd(T||e,function(O,w){T&&(w=O,O=e[w]),zd(c,w,Me(O,r,t,w,e,s))}),c}ao.exports=Me});var uo=i((lq,so)=>{var Lb=oo(),Mb=1,Fb=4;function Gb(e,r){return r=typeof r=="function"?r:void 0,Lb(e,Mb|Fb,r)}so.exports=Gb});var go=i((vq,bo)=>{var Rb="__lodash_hash_undefined__";function Bb(e){return this.__data__.set(e,Rb),this}bo.exports=Bb});var ho=i((hq,vo)=>{function Ub(e){return this.__data__.has(e)}vo.exports=Ub});var xo=i((qq,qo)=>{var Kb=Ae(),zb=go(),Hb=ho();function Ge(e){var r=-1,t=e==null?0:e.length;for(this.__data__=new Kb;++r<t;)this.add(e[r])}Ge.prototype.add=Ge.prototype.push=zb;Ge.prototype.has=Hb;qo.exports=Ge});var Ao=i((xq,mo)=>{function $b(e,r){for(var t=-1,n=e==null?0:e.length;++t<n;)if(r(e[t],t,e))return!0;return!1}mo.exports=$b});var To=i((mq,_o)=>{function Wb(e,r){return e.has(r)}_o.exports=Wb});var _r=i((Aq,Oo)=>{var Yb=xo(),Xb=Ao(),Zb=To(),Jb=1,Qb=2;function Vb(e,r,t,n,f,s){var c=t&Jb,y=e.length,d=r.length;if(y!=d&&!(c&&d>y))return!1;var b=s.get(e),_=s.get(r);if(b&&_)return b==r&&_==e;var h=-1,q=!0,S=t&Qb?new Yb:void 0;for(s.set(e,r),s.set(r,e);++h<y;){var j=e[h],T=r[h];if(n)var O=c?n(T,j,h,r,e,s):n(j,T,h,e,r,s);if(O!==void 0){if(O)continue;q=!1;break}if(S){if(!Xb(r,function(w,D){if(!Zb(S,D)&&(j===w||f(j,w,t,n,s)))return S.push(D)})){q=!1;break}}else if(!(j===T||f(j,T,t,n,s))){q=!1;break}}return s.delete(e),s.delete(r),q}Oo.exports=Vb});var So=i((_q,wo)=>{function kb(e){var r=-1,t=Array(e.size);return e.forEach(function(n,f){t[++r]=[f,n]}),t}wo.exports=kb});var Po=i((Tq,jo)=>{function eg(e){var r=-1,t=Array(e.size);return e.forEach(function(n){t[++r]=n}),t}jo.exports=eg});var No=i((Oq,Do)=>{var Co=$(),Eo=mr(),rg=xe(),tg=_r(),ng=So(),ig=Po(),ag=1,og=2,sg="[object Boolean]",ug="[object Date]",fg="[object Error]",pg="[object Map]",cg="[object Number]",lg="[object RegExp]",yg="[object Set]",dg="[object String]",bg="[object Symbol]",gg="[object ArrayBuffer]",vg="[object DataView]",Io=Co?Co.prototype:void 0,Tr=Io?Io.valueOf:void 0;function hg(e,r,t,n,f,s,c){switch(t){case vg:if(e.byteLength!=r.byteLength||e.byteOffset!=r.byteOffset)return!1;e=e.buffer,r=r.buffer;case gg:return!(e.byteLength!=r.byteLength||!s(new Eo(e),new Eo(r)));case sg:case ug:case cg:return rg(+e,+r);case fg:return e.name==r.name&&e.message==r.message;case lg:case dg:return e==r+"";case pg:var y=ng;case yg:var d=n&ag;if(y||(y=ig),e.size!=r.size&&!d)return!1;var b=c.get(e);if(b)return b==r;n|=og,c.set(e,r);var _=tg(y(e),y(r),n,f,s,c);return c.delete(e),_;case bg:if(Tr)return Tr.call(e)==Tr.call(r)}return!1}Do.exports=hg});var Fo=i((wq,Mo)=>{var Lo=br(),qg=1,xg=Object.prototype,mg=xg.hasOwnProperty;function Ag(e,r,t,n,f,s){var c=t&qg,y=Lo(e),d=y.length,b=Lo(r),_=b.length;if(d!=_&&!c)return!1;for(var h=d;h--;){var q=y[h];if(!(c?q in r:mg.call(r,q)))return!1}var S=s.get(e),j=s.get(r);if(S&&j)return S==r&&j==e;var T=!0;s.set(e,r),s.set(r,e);for(var O=c;++h<d;){q=y[h];var w=e[q],D=r[q];if(n)var K=c?n(D,w,q,r,e,s):n(w,D,q,e,r,s);if(!(K===void 0?w===D||f(w,D,t,n,s):K)){T=!1;break}O||(O=q=="constructor")}if(T&&!O){var z=e.constructor,H=r.constructor;z!=H&&"constructor"in e&&"constructor"in r&&!(typeof z=="function"&&z instanceof z&&typeof H=="function"&&H instanceof H)&&(T=!1)}return s.delete(e),s.delete(r),T}Mo.exports=Ag});var $o=i((Sq,Ho)=>{var Or=ar(),_g=_r(),Tg=No(),Og=Fo(),Go=de(),Ro=M(),Bo=je(),wg=ur(),Sg=1,Uo="[object Arguments]",Ko="[object Array]",Re="[object Object]",jg=Object.prototype,zo=jg.hasOwnProperty;function Pg(e,r,t,n,f,s){var c=Ro(e),y=Ro(r),d=c?Ko:Go(e),b=y?Ko:Go(r);d=d==Uo?Re:d,b=b==Uo?Re:b;var _=d==Re,h=b==Re,q=d==b;if(q&&Bo(e)){if(!Bo(r))return!1;c=!0,_=!1}if(q&&!_)return s||(s=new Or),c||wg(e)?_g(e,r,t,n,f,s):Tg(e,r,d,t,n,f,s);if(!(t&Sg)){var S=_&&zo.call(e,"__wrapped__"),j=h&&zo.call(r,"__wrapped__");if(S||j){var T=S?e.value():e,O=j?r.value():r;return s||(s=new Or),f(T,O,t,n,s)}}return q?(s||(s=new Or),Og(e,r,t,n,f,s)):!1}Ho.exports=Pg});var Zo=i((jq,Xo)=>{var Cg=$o(),Wo=N();function Yo(e,r,t,n,f){return e===r?!0:e==null||r==null||!Wo(e)&&!Wo(r)?e!==e&&r!==r:Cg(e,r,t,n,Yo,f)}Xo.exports=Yo});var Qo=i((Pq,Jo)=>{var Eg=Zo();function Ig(e,r,t){t=typeof t=="function"?t:void 0;var n=t?t(e,r):void 0;return n===void 0?Eg(e,r,void 0,t):!!n}Jo.exports=Ig});var as=i((Cr,is)=>{(function(e,r){var t=r(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return t});else if(typeof Cr=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))is.exports=t;else{var n=e.DeepDiff;t.noConflict=function(){return e.DeepDiff===t&&(e.DeepDiff=n),t},e.DeepDiff=t}})(Cr,function(e){var r=["N","E","A","D"];function t(o,u){o.super_=u,o.prototype=Object.create(u.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}})}function n(o,u){Object.defineProperty(this,"kind",{value:o,enumerable:!0}),u&&u.length&&Object.defineProperty(this,"path",{value:u,enumerable:!0})}function f(o,u,a){f.super_.call(this,"E",o),Object.defineProperty(this,"lhs",{value:u,enumerable:!0}),Object.defineProperty(this,"rhs",{value:a,enumerable:!0})}t(f,n);function s(o,u){s.super_.call(this,"N",o),Object.defineProperty(this,"rhs",{value:u,enumerable:!0})}t(s,n);function c(o,u){c.super_.call(this,"D",o),Object.defineProperty(this,"lhs",{value:u,enumerable:!0})}t(c,n);function y(o,u,a){y.super_.call(this,"A",o),Object.defineProperty(this,"index",{value:u,enumerable:!0}),Object.defineProperty(this,"item",{value:a,enumerable:!0})}t(y,n);function d(o,u,a){var p=o.slice((a||u)+1||o.length);return o.length=u<0?o.length+u:u,o.push.apply(o,p),o}function b(o){var u=typeof o;return u!=="object"?u:o===Math?"math":o===null?"null":Array.isArray(o)?"array":Object.prototype.toString.call(o)==="[object Date]"?"date":typeof o.toString=="function"&&/^\/.*\//.test(o.toString())?"regexp":"object"}function _(o){var u=0;if(o.length===0)return u;for(var a=0;a<o.length;a++){var p=o.charCodeAt(a);u=(u<<5)-u+p,u=u&u}return u}function h(o){var u=0,a=b(o);if(a==="array"){o.forEach(function(G){u+=h(G)});var p="[type: array, hash: "+u+"]";return u+_(p)}if(a==="object"){for(var l in o)if(o.hasOwnProperty(l)){var v="[ type: object, key: "+l+", value hash: "+h(o[l])+"]";u+=_(v)}return u}var g="[ type: "+a+" ; value: "+o+"]";return u+_(g)}function q(o,u,a,p,l,v,g,G){a=a||[],l=l||[],g=g||[];var P=l.slice(0);if(typeof v<"u"&&v!==null){if(p){if(typeof p=="function"&&p(P,v))return;if(typeof p=="object"){if(p.prefilter&&p.prefilter(P,v))return;if(p.normalize){var ze=p.normalize(P,v,o,u);ze&&(o=ze[0],u=ze[1])}}}P.push(v)}b(o)==="regexp"&&b(u)==="regexp"&&(o=o.toString(),u=u.toString());var He=typeof o,ss=typeof u,A,te,C,ne,Er=He!=="undefined"||g&&g.length>0&&g[g.length-1].lhs&&Object.getOwnPropertyDescriptor(g[g.length-1].lhs,v),Ir=ss!=="undefined"||g&&g.length>0&&g[g.length-1].rhs&&Object.getOwnPropertyDescriptor(g[g.length-1].rhs,v);if(!Er&&Ir)a.push(new s(P,u));else if(!Ir&&Er)a.push(new c(P,o));else if(b(o)!==b(u))a.push(new f(P,o,u));else if(b(o)==="date"&&o-u!==0)a.push(new f(P,o,u));else if(He==="object"&&o!==null&&u!==null){for(A=g.length-1;A>-1;--A)if(g[A].lhs===o){ne=!0;break}if(ne)o!==u&&a.push(new f(P,o,u));else{if(g.push({lhs:o,rhs:u}),Array.isArray(o)){for(G&&(o.sort(function($e,We){return h($e)-h(We)}),u.sort(function($e,We){return h($e)-h(We)})),A=u.length-1,te=o.length-1;A>te;)a.push(new y(P,A,new s(void 0,u[A--])));for(;te>A;)a.push(new y(P,te,new c(void 0,o[te--])));for(;A>=0;--A)q(o[A],u[A],a,p,P,A,g,G)}else{var Dr=Object.keys(o),ve=Object.keys(u);for(A=0;A<Dr.length;++A)C=Dr[A],ne=ve.indexOf(C),ne>=0?(q(o[C],u[C],a,p,P,C,g,G),ve[ne]=null):q(o[C],void 0,a,p,P,C,g,G);for(A=0;A<ve.length;++A)C=ve[A],C&&q(void 0,u[C],a,p,P,C,g,G)}g.length=g.length-1}}else o!==u&&(He==="number"&&isNaN(o)&&isNaN(u)||a.push(new f(P,o,u)))}function S(o,u,a,p,l){var v=[];if(q(o,u,v,p,null,null,null,l),a)for(var g=0;g<v.length;++g)a(v[g]);return v}function j(o,u,a,p,l,v,g){return q(o,u,a,p,l,v,g,!0)}function T(o,u,a,p){var l=p?function(g){g&&p.push(g)}:void 0,v=S(o,u,l,a);return p||(v.length?v:void 0)}function O(o,u,a,p){var l=p?function(g){g&&p.push(g)}:void 0,v=S(o,u,l,a,!0);return p||(v.length?v:void 0)}function w(o,u,a){if(a.path&&a.path.length){var p=o[u],l,v=a.path.length-1;for(l=0;l<v;l++)p=p[a.path[l]];switch(a.kind){case"A":w(p[a.path[l]],a.index,a.item);break;case"D":delete p[a.path[l]];break;case"E":case"N":p[a.path[l]]=a.rhs;break}}else switch(a.kind){case"A":w(o[u],a.index,a.item);break;case"D":o=d(o,u);break;case"E":case"N":o[u]=a.rhs;break}return o}function D(o,u,a){if(typeof a>"u"&&u&&~r.indexOf(u.kind)&&(a=u),o&&a&&a.kind){for(var p=o,l=-1,v=a.path?a.path.length-1:0;++l<v;)typeof p[a.path[l]]>"u"&&(p[a.path[l]]=typeof a.path[l+1]<"u"&&typeof a.path[l+1]=="number"?[]:{}),p=p[a.path[l]];switch(a.kind){case"A":a.path&&typeof p[a.path[l]]>"u"&&(p[a.path[l]]=[]),w(a.path?p[a.path[l]]:p,a.index,a.item);break;case"D":delete p[a.path[l]];break;case"E":case"N":p[a.path[l]]=a.rhs;break}}}function K(o,u,a){if(a.path&&a.path.length){var p=o[u],l,v=a.path.length-1;for(l=0;l<v;l++)p=p[a.path[l]];switch(a.kind){case"A":K(p[a.path[l]],a.index,a.item);break;case"D":p[a.path[l]]=a.lhs;break;case"E":p[a.path[l]]=a.lhs;break;case"N":delete p[a.path[l]];break}}else switch(a.kind){case"A":K(o[u],a.index,a.item);break;case"D":o[u]=a.lhs;break;case"E":o[u]=a.lhs;break;case"N":o=d(o,u);break}return o}function z(o,u,a){if(o&&u&&a&&a.kind){var p=o,l,v;for(v=a.path.length-1,l=0;l<v;l++)typeof p[a.path[l]]>"u"&&(p[a.path[l]]={}),p=p[a.path[l]];switch(a.kind){case"A":K(p[a.path[l]],a.index,a.item);break;case"D":p[a.path[l]]=a.lhs;break;case"E":p[a.path[l]]=a.lhs;break;case"N":delete p[a.path[l]];break}}}function H(o,u,a){if(o&&u){var p=function(l){(!a||a(o,u,l))&&D(o,u,l)};S(o,u,p)}}return Object.defineProperties(T,{diff:{value:T,enumerable:!0},orderIndependentDiff:{value:O,enumerable:!0},observableDiff:{value:S,enumerable:!0},orderIndependentObservableDiff:{value:j,enumerable:!0},orderIndepHash:{value:h,enumerable:!0},applyDiff:{value:H,enumerable:!0},applyChange:{value:D,enumerable:!0},revertChange:{value:z,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),T.DeepDiff=T,e&&(e.DeepDiff=T),T})});var Qg={};ys(Qg,{action:()=>Ke,defineGetter:()=>Wg,getState:()=>Hg,setImmutableState:()=>$g,setState:()=>rs,startLogging:()=>Zg,stopLogging:()=>Jg,subscribe:()=>be,subscribeOnce:()=>ko,subscribeOnceSync:()=>Rg,subscribeSync:()=>Gg,subscribersAsync:()=>ee,subscribersSync:()=>re,unsubscribe:()=>Be,unsubscribeAll:()=>Bg});var ts=E(_e()),ns=E(tr());var Dn="__statezero__root";function Oe(e){return e?e[Dn]:void 0}function we(e,r){Object.defineProperty(e,Dn,{enumerable:!1,value:r})}var Sr=E(_e()),jr=E(ir()),es=E(tr()),Pr=E(Rn());var Ar=E(uo()),lo=E(ir());var fo="__statezero_immutable";function Fe(e){return e&&e[fo]===!0}function po(e){Object.defineProperty(e,fo,{enumerable:!1,value:!0})}var co=(e,r)=>typeof r=="object"?(0,Ar.default)(r,e):r,yo=e=>{let r=new WeakMap,t,n=f=>{if(f instanceof Element||typeof f=="function"||Fe(f))return f;if(!(0,lo.default)(f))return;let s=r.get(f);if(s)return s;if(s={},r.set(f,s),t||(t=s),!Oe(f)){for(let c of Object.getOwnPropertyNames(f))c.startsWith("__statezero")||c.startsWith("$jscomp")||(s[c]=co(n,f[c]));return s}we(s,t);for(let[c,y]of Object.entries(Object.getOwnPropertyDescriptors(f)))if(!(c.startsWith("__statezero")||c.startsWith("$jscomp"))){if(y.get){Object.defineProperty(s,c,y);continue}y.enumerable&&(s[c]=co(n,y.value))}return s};return(0,Ar.default)(e,n)};var wr=E(_e()),Vo=E(Qo());var ee=new Set,re=new Set,Dg=(e,r)=>Fe(e)?e===r:void 0,Ng=(e,r)=>(t,n)=>{let f=r(t),s=r(n);(0,Vo.default)(f,s,Dg)||e(f,s,t)},Lg=e=>(r,t)=>{e(r,t,r)},Mg=e=>r=>e.map(t=>(0,wr.default)(r,t)),Fg=e=>r=>(0,wr.default)(r,e),be=(e,r,t=!1)=>{if(typeof r=="string"?r=Fg(r):Array.isArray(r)&&(r=Mg(r)),typeof r=="function")e=Ng(e,r);else if(r===void 0)e=Lg(e);else throw new Error(`statezero: subscribe() must be called with an Array/Function/String/undefined "selector" argument; not ${r}`);return t?re.add(e):ee.add(e),e},Gg=(e,r)=>be(e,r,!0),ko=(e,r,t=!1)=>{let f=be((...s)=>{e(...s),Be(f)},r,t);return f},Rg=(e,r)=>ko(e,r,!0),Be=e=>{ee.delete(e),re.delete(e)},Bg=()=>{ee.clear(),re.clear()};var L=(0,Pr.default)({}),Ue,Ug=e=>{Ue===void 0&&(Ue=e,setTimeout(()=>{let r=Ue;Ue=void 0;for(let t of ee)t(L,r)}))},Kg=e=>{for(let r of re)r(L,e)},zg=e=>{if(!(0,jr.default)(e))throw new Error(`statezero: commit() must be called with a plain object "nextState" argument; not: ${e}`);let r=L;L=(0,Pr.default)(e),Ug(r),Kg(r)},Ke=e=>(...r)=>e({commit:zg,state:yo(L)},...r),Hg=e=>{if(e===void 0)return L;if(typeof e=="string")return(0,Sr.default)(L,e);if(Array.isArray(e))return e.map(r=>(0,Sr.default)(L,r));if(typeof e=="function")return e(L);throw new Error(`statezero: getState() must be called with an Array/Function/String/undefined "selector" argument; not ${e}`)},rs=Ke(({commit:e,state:r},t,n)=>{if(t==null||t==="")r=n;else if(typeof t=="string")(0,es.default)(r,t,n);else throw new Error(`statezero: setState() must be called with an String/undefined "selector" argument; not ${t}`);e(r)}),$g=(e,r)=>{if(!e)throw new Error('statezero: setImmutableState() must be called with a non-empty String "selector" argument');if(!(0,jr.default)(r))throw new Error(`statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${r}`);po(r),rs(e,r)};var Wg=Ke(({commit:e,state:r},t,n,f=!1)=>{let s=Array.isArray(t)?t:t.split("."),c=s.length-1,y=s[c],d=s.slice(0,c),b=r;d.length&&(b=(0,ts.default)(r,d,{}),(0,ns.default)(r,d,b)),Object.defineProperty(b,y,{get(){return n.call(this,this,Oe(this))},enumerable:f}),we(b,r),e(r)});var os=E(as());var ge,Yg={A:"Array changed",D:"Deleted",E:"Changed",N:"New"},Xg=e=>(r,t)=>{let n={},f=(0,os.default)(t,r);if(f!==void 0){for(let s of f){let{path:c}=s;n[c]={changeType:Yg[s.kind],from:s.lhs,to:s.rhs}}e(n,["changeType","from","to"])}},Zg=(e,r)=>{ge||(ge=be(Xg(r||console.table),e))},Jg=()=>{ge&&(Be(ge),ge=null)};return ds(Qg);})();
1
+ var statezero=(()=>{var qo=Object.create;var Ee=Object.defineProperty;var $o=Object.getOwnPropertyDescriptor;var Jo=Object.getOwnPropertyNames;var Yo=Object.getPrototypeOf,Xo=Object.prototype.hasOwnProperty;var _t=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Zo=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},wt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let p of Jo(t))!Xo.call(e,p)&&p!==r&&Ee(e,p,{get:()=>t[p],enumerable:!(o=$o(t,p))||o.enumerable});return e};var St=(e,t,r)=>(r=e!=null?qo(Yo(e)):{},wt(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),Vo=e=>wt(Ee({},"__esModule",{value:!0}),e);var No=_t((Yy,Lo)=>{"use strict";Lo.exports=function e(t){try{return t}catch{}if(Object.isFrozen(t))return t;if(!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.getPrototypeOf({}))throw new Error("simpleDeepFreeze only supports plain objects, arrays, and primitives");return Object.freeze(t),Object.keys(t).forEach(function(r){e(t[r])}),t}});var zo=_t((vt,Wo)=>{(function(e,t){var r=t(e);if(typeof define=="function"&&define.amd)define("DeepDiff",function(){return r});else if(typeof vt=="object"||typeof navigator=="object"&&navigator.product.match(/ReactNative/i))Wo.exports=r;else{var o=e.DeepDiff;r.noConflict=function(){return e.DeepDiff===r&&(e.DeepDiff=o),r},e.DeepDiff=r}})(vt,function(e){var t=["N","E","A","D"];function r(f,i){f.super_=i,f.prototype=Object.create(i.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}})}function o(f,i){Object.defineProperty(this,"kind",{value:f,enumerable:!0}),i&&i.length&&Object.defineProperty(this,"path",{value:i,enumerable:!0})}function p(f,i,a){p.super_.call(this,"E",f),Object.defineProperty(this,"lhs",{value:i,enumerable:!0}),Object.defineProperty(this,"rhs",{value:a,enumerable:!0})}r(p,o);function n(f,i){n.super_.call(this,"N",f),Object.defineProperty(this,"rhs",{value:i,enumerable:!0})}r(n,o);function u(f,i){u.super_.call(this,"D",f),Object.defineProperty(this,"lhs",{value:i,enumerable:!0})}r(u,o);function m(f,i,a){m.super_.call(this,"A",f),Object.defineProperty(this,"index",{value:i,enumerable:!0}),Object.defineProperty(this,"item",{value:a,enumerable:!0})}r(m,o);function d(f,i,a){var s=f.slice((a||i)+1||f.length);return f.length=i<0?f.length+i:i,f.push.apply(f,s),f}function c(f){var i=typeof f;return i!=="object"?i:f===Math?"math":f===null?"null":Array.isArray(f)?"array":Object.prototype.toString.call(f)==="[object Date]"?"date":typeof f.toString=="function"&&/^\/.*\//.test(f.toString())?"regexp":"object"}function O(f){var i=0;if(f.length===0)return i;for(var a=0;a<f.length;a++){var s=f.charCodeAt(a);i=(i<<5)-i+s,i=i&i}return i}function b(f){var i=0,a=c(f);if(a==="array"){f.forEach(function(X){i+=b(X)});var s="[type: array, hash: "+i+"]";return i+O(s)}if(a==="object"){for(var l in f)if(f.hasOwnProperty(l)){var y="[ type: object, key: "+l+", value hash: "+b(f[l])+"]";i+=O(y)}return i}var x="[ type: "+a+" ; value: "+f+"]";return i+O(x)}function g(f,i,a,s,l,y,x,X){a=a||[],l=l||[],x=x||[];var E=l.slice(0);if(typeof y<"u"&&y!==null){if(s){if(typeof s=="function"&&s(E,y))return;if(typeof s=="object"){if(s.prefilter&&s.prefilter(E,y))return;if(s.normalize){var pt=s.normalize(E,y,f,i);pt&&(f=pt[0],i=pt[1])}}}E.push(y)}c(f)==="regexp"&&c(i)==="regexp"&&(f=f.toString(),i=i.toString());var st=typeof f,Ho=typeof i,A,Ae,R,Oe,At=st!=="undefined"||x&&x.length>0&&x[x.length-1].lhs&&Object.getOwnPropertyDescriptor(x[x.length-1].lhs,y),Ot=Ho!=="undefined"||x&&x.length>0&&x[x.length-1].rhs&&Object.getOwnPropertyDescriptor(x[x.length-1].rhs,y);if(!At&&Ot)a.push(new n(E,i));else if(!Ot&&At)a.push(new u(E,f));else if(c(f)!==c(i))a.push(new p(E,f,i));else if(c(f)==="date"&&f-i!==0)a.push(new p(E,f,i));else if(st==="object"&&f!==null&&i!==null){for(A=x.length-1;A>-1;--A)if(x[A].lhs===f){Oe=!0;break}if(Oe)f!==i&&a.push(new p(E,f,i));else{if(x.push({lhs:f,rhs:i}),Array.isArray(f)){for(X&&(f.sort(function(ut,lt){return b(ut)-b(lt)}),i.sort(function(ut,lt){return b(ut)-b(lt)})),A=i.length-1,Ae=f.length-1;A>Ae;)a.push(new m(E,A,new n(void 0,i[A--])));for(;Ae>A;)a.push(new m(E,Ae,new u(void 0,f[Ae--])));for(;A>=0;--A)g(f[A],i[A],a,s,E,A,x,X)}else{var Tt=Object.keys(f),Ie=Object.keys(i);for(A=0;A<Tt.length;++A)R=Tt[A],Oe=Ie.indexOf(R),Oe>=0?(g(f[R],i[R],a,s,E,R,x,X),Ie[Oe]=null):g(f[R],void 0,a,s,E,R,x,X);for(A=0;A<Ie.length;++A)R=Ie[A],R&&g(void 0,i[R],a,s,E,R,x,X)}x.length=x.length-1}}else f!==i&&(st==="number"&&isNaN(f)&&isNaN(i)||a.push(new p(E,f,i)))}function j(f,i,a,s,l){var y=[];if(g(f,i,y,s,null,null,null,l),a)for(var x=0;x<y.length;++x)a(y[x]);return y}function I(f,i,a,s,l,y,x){return g(f,i,a,s,l,y,x,!0)}function T(f,i,a,s){var l=s?function(x){x&&s.push(x)}:void 0,y=j(f,i,l,a);return s||(y.length?y:void 0)}function w(f,i,a,s){var l=s?function(x){x&&s.push(x)}:void 0,y=j(f,i,l,a,!0);return s||(y.length?y:void 0)}function S(f,i,a){if(a.path&&a.path.length){var s=f[i],l,y=a.path.length-1;for(l=0;l<y;l++)s=s[a.path[l]];switch(a.kind){case"A":S(s[a.path[l]],a.index,a.item);break;case"D":delete s[a.path[l]];break;case"E":case"N":s[a.path[l]]=a.rhs;break}}else switch(a.kind){case"A":S(f[i],a.index,a.item);break;case"D":f=d(f,i);break;case"E":case"N":f[i]=a.rhs;break}return f}function B(f,i,a){if(typeof a>"u"&&i&&~t.indexOf(i.kind)&&(a=i),f&&a&&a.kind){for(var s=f,l=-1,y=a.path?a.path.length-1:0;++l<y;)typeof s[a.path[l]]>"u"&&(s[a.path[l]]=typeof a.path[l+1]<"u"&&typeof a.path[l+1]=="number"?[]:{}),s=s[a.path[l]];switch(a.kind){case"A":a.path&&typeof s[a.path[l]]>"u"&&(s[a.path[l]]=[]),S(a.path?s[a.path[l]]:s,a.index,a.item);break;case"D":delete s[a.path[l]];break;case"E":case"N":s[a.path[l]]=a.rhs;break}}}function k(f,i,a){if(a.path&&a.path.length){var s=f[i],l,y=a.path.length-1;for(l=0;l<y;l++)s=s[a.path[l]];switch(a.kind){case"A":k(s[a.path[l]],a.index,a.item);break;case"D":s[a.path[l]]=a.lhs;break;case"E":s[a.path[l]]=a.lhs;break;case"N":delete s[a.path[l]];break}}else switch(a.kind){case"A":k(f[i],a.index,a.item);break;case"D":f[i]=a.lhs;break;case"E":f[i]=a.lhs;break;case"N":f=d(f,i);break}return f}function ee(f,i,a){if(f&&i&&a&&a.kind){var s=f,l,y;for(y=a.path.length-1,l=0;l<y;l++)typeof s[a.path[l]]>"u"&&(s[a.path[l]]={}),s=s[a.path[l]];switch(a.kind){case"A":k(s[a.path[l]],a.index,a.item);break;case"D":s[a.path[l]]=a.lhs;break;case"E":s[a.path[l]]=a.lhs;break;case"N":delete s[a.path[l]];break}}}function te(f,i,a){if(f&&i){var s=function(l){(!a||a(f,i,l))&&B(f,i,l)};j(f,i,s)}}return Object.defineProperties(T,{diff:{value:T,enumerable:!0},orderIndependentDiff:{value:w,enumerable:!0},observableDiff:{value:j,enumerable:!0},orderIndependentObservableDiff:{value:I,enumerable:!0},orderIndepHash:{value:b,enumerable:!0},applyDiff:{value:te,enumerable:!0},applyChange:{value:B,enumerable:!0},revertChange:{value:ee,enumerable:!0},isConflict:{value:function(){return typeof $conflict<"u"},enumerable:!0}}),T.DeepDiff=T,e&&(e.DeepDiff=T),T})});var zs={};Zo(zs,{action:()=>it,defineGetter:()=>Bs,getState:()=>Ms,setImmutableState:()=>Rs,setState:()=>Uo,startLogging:()=>Us,stopLogging:()=>Ws,subscribe:()=>je,subscribeOnce:()=>Go,subscribeOnceSync:()=>Es,subscribeSync:()=>Is,subscribersAsync:()=>he,subscribersSync:()=>ve,unsubscribe:()=>ft,unsubscribeAll:()=>Cs});var Qo=typeof global=="object"&&global&&global.Object===Object&&global,Ce=Qo;var ko=typeof self=="object"&&self&&self.Object===Object&&self,ea=Ce||ko||Function("return this")(),_=ea;var ta=_.Symbol,C=ta;var jt=Object.prototype,ra=jt.hasOwnProperty,oa=jt.toString,Te=C?C.toStringTag:void 0;function aa(e){var t=ra.call(e,Te),r=e[Te];try{e[Te]=void 0;var o=!0}catch{}var p=oa.call(e);return o&&(t?e[Te]=r:delete e[Te]),p}var Pt=aa;var fa=Object.prototype,na=fa.toString;function ia(e){return na.call(e)}var It=ia;var pa="[object Null]",sa="[object Undefined]",Et=C?C.toStringTag:void 0;function ua(e){return e==null?e===void 0?sa:pa:Et&&Et in Object(e)?Pt(e):It(e)}var N=ua;function la(e){return e!=null&&typeof e=="object"}var P=la;var ma="[object Symbol]";function da(e){return typeof e=="symbol"||P(e)&&N(e)==ma}var re=da;function ca(e,t){for(var r=-1,o=e==null?0:e.length,p=Array(o);++r<o;)p[r]=t(e[r],r,e);return p}var Ct=ca;var xa=Array.isArray,D=xa;var ya=1/0,Dt=C?C.prototype:void 0,Lt=Dt?Dt.toString:void 0;function Nt(e){if(typeof e=="string")return e;if(D(e))return Ct(e,Nt)+"";if(re(e))return Lt?Lt.call(e):"";var t=e+"";return t=="0"&&1/e==-ya?"-0":t}var Mt=Nt;function ba(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var M=ba;var ga="[object AsyncFunction]",ha="[object Function]",va="[object GeneratorFunction]",Aa="[object Proxy]";function Oa(e){if(!M(e))return!1;var t=N(e);return t==ha||t==va||t==ga||t==Aa}var De=Oa;var Ta=_["__core-js_shared__"],Le=Ta;var Rt=(function(){var e=/[^.]+$/.exec(Le&&Le.keys&&Le.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function _a(e){return!!Rt&&Rt in e}var Bt=_a;var wa=Function.prototype,Sa=wa.toString;function ja(e){if(e!=null){try{return Sa.call(e)}catch{}try{return e+""}catch{}}return""}var F=ja;var Pa=/[\\^$.*+?()[\]{}|]/g,Ia=/^\[object .+?Constructor\]$/,Ea=Function.prototype,Ca=Object.prototype,Da=Ea.toString,La=Ca.hasOwnProperty,Na=RegExp("^"+Da.call(La).replace(Pa,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ma(e){if(!M(e)||Bt(e))return!1;var t=De(e)?Na:Ia;return t.test(F(e))}var Ft=Ma;function Ra(e,t){return e?.[t]}var Gt=Ra;function Ba(e,t){var r=Gt(e,t);return Ft(r)?r:void 0}var L=Ba;var Fa=L(_,"WeakMap"),Ne=Fa;var Ut=Object.create,Ga=(function(){function e(){}return function(t){if(!M(t))return{};if(Ut)return Ut(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})(),Wt=Ga;function Ua(e,t){var r=-1,o=e.length;for(t||(t=Array(o));++r<o;)t[r]=e[r];return t}var zt=Ua;var Wa=(function(){try{var e=L(Object,"defineProperty");return e({},"",{}),e}catch{}})(),mt=Wa;function za(e,t){for(var r=-1,o=e==null?0:e.length;++r<o&&t(e[r],r,e)!==!1;);return e}var Kt=za;var Ka=9007199254740991,Ha=/^(?:0|[1-9]\d*)$/;function qa(e,t){var r=typeof e;return t=t??Ka,!!t&&(r=="number"||r!="symbol"&&Ha.test(e))&&e>-1&&e%1==0&&e<t}var Me=qa;function $a(e,t,r){t=="__proto__"&&mt?mt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Re=$a;function Ja(e,t){return e===t||e!==e&&t!==t}var oe=Ja;var Ya=Object.prototype,Xa=Ya.hasOwnProperty;function Za(e,t,r){var o=e[t];(!(Xa.call(e,t)&&oe(o,r))||r===void 0&&!(t in e))&&Re(e,t,r)}var ae=Za;function Va(e,t,r,o){var p=!r;r||(r={});for(var n=-1,u=t.length;++n<u;){var m=t[n],d=o?o(r[m],e[m],m,r,e):void 0;d===void 0&&(d=e[m]),p?Re(r,m,d):ae(r,m,d)}return r}var H=Va;var Qa=9007199254740991;function ka(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Qa}var Be=ka;function ef(e){return e!=null&&Be(e.length)&&!De(e)}var Fe=ef;var tf=Object.prototype;function rf(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||tf;return e===r}var fe=rf;function of(e,t){for(var r=-1,o=Array(e);++r<e;)o[r]=t(r);return o}var Ht=of;var af="[object Arguments]";function ff(e){return P(e)&&N(e)==af}var dt=ff;var qt=Object.prototype,nf=qt.hasOwnProperty,pf=qt.propertyIsEnumerable,sf=dt((function(){return arguments})())?dt:function(e){return P(e)&&nf.call(e,"callee")&&!pf.call(e,"callee")},$t=sf;function uf(){return!1}var Jt=uf;var Zt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Yt=Zt&&typeof module=="object"&&module&&!module.nodeType&&module,lf=Yt&&Yt.exports===Zt,Xt=lf?_.Buffer:void 0,mf=Xt?Xt.isBuffer:void 0,df=mf||Jt,Z=df;var cf="[object Arguments]",xf="[object Array]",yf="[object Boolean]",bf="[object Date]",gf="[object Error]",hf="[object Function]",vf="[object Map]",Af="[object Number]",Of="[object Object]",Tf="[object RegExp]",_f="[object Set]",wf="[object String]",Sf="[object WeakMap]",jf="[object ArrayBuffer]",Pf="[object DataView]",If="[object Float32Array]",Ef="[object Float64Array]",Cf="[object Int8Array]",Df="[object Int16Array]",Lf="[object Int32Array]",Nf="[object Uint8Array]",Mf="[object Uint8ClampedArray]",Rf="[object Uint16Array]",Bf="[object Uint32Array]",v={};v[If]=v[Ef]=v[Cf]=v[Df]=v[Lf]=v[Nf]=v[Mf]=v[Rf]=v[Bf]=!0;v[cf]=v[xf]=v[jf]=v[yf]=v[Pf]=v[bf]=v[gf]=v[hf]=v[vf]=v[Af]=v[Of]=v[Tf]=v[_f]=v[wf]=v[Sf]=!1;function Ff(e){return P(e)&&Be(e.length)&&!!v[N(e)]}var Vt=Ff;function Gf(e){return function(t){return e(t)}}var ne=Gf;var Qt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_e=Qt&&typeof module=="object"&&module&&!module.nodeType&&module,Uf=_e&&_e.exports===Qt,ct=Uf&&Ce.process,Wf=(function(){try{var e=_e&&_e.require&&_e.require("util").types;return e||ct&&ct.binding&&ct.binding("util")}catch{}})(),G=Wf;var kt=G&&G.isTypedArray,zf=kt?ne(kt):Vt,Ge=zf;var Kf=Object.prototype,Hf=Kf.hasOwnProperty;function qf(e,t){var r=D(e),o=!r&&$t(e),p=!r&&!o&&Z(e),n=!r&&!o&&!p&&Ge(e),u=r||o||p||n,m=u?Ht(e.length,String):[],d=m.length;for(var c in e)(t||Hf.call(e,c))&&!(u&&(c=="length"||p&&(c=="offset"||c=="parent")||n&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Me(c,d)))&&m.push(c);return m}var Ue=qf;function $f(e,t){return function(r){return e(t(r))}}var We=$f;var Jf=We(Object.keys,Object),er=Jf;var Yf=Object.prototype,Xf=Yf.hasOwnProperty;function Zf(e){if(!fe(e))return er(e);var t=[];for(var r in Object(e))Xf.call(e,r)&&r!="constructor"&&t.push(r);return t}var tr=Zf;function Vf(e){return Fe(e)?Ue(e):tr(e)}var ie=Vf;function Qf(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var rr=Qf;var kf=Object.prototype,en=kf.hasOwnProperty;function tn(e){if(!M(e))return rr(e);var t=fe(e),r=[];for(var o in e)o=="constructor"&&(t||!en.call(e,o))||r.push(o);return r}var or=tn;function rn(e){return Fe(e)?Ue(e,!0):or(e)}var pe=rn;var on=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,an=/^\w*$/;function fn(e,t){if(D(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||re(e)?!0:an.test(e)||!on.test(e)||t!=null&&e in Object(t)}var ar=fn;var nn=L(Object,"create"),U=nn;function pn(){this.__data__=U?U(null):{},this.size=0}var fr=pn;function sn(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var nr=sn;var un="__lodash_hash_undefined__",ln=Object.prototype,mn=ln.hasOwnProperty;function dn(e){var t=this.__data__;if(U){var r=t[e];return r===un?void 0:r}return mn.call(t,e)?t[e]:void 0}var ir=dn;var cn=Object.prototype,xn=cn.hasOwnProperty;function yn(e){var t=this.__data__;return U?t[e]!==void 0:xn.call(t,e)}var pr=yn;var bn="__lodash_hash_undefined__";function gn(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=U&&t===void 0?bn:t,this}var sr=gn;function se(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}se.prototype.clear=fr;se.prototype.delete=nr;se.prototype.get=ir;se.prototype.has=pr;se.prototype.set=sr;var xt=se;function hn(){this.__data__=[],this.size=0}var ur=hn;function vn(e,t){for(var r=e.length;r--;)if(oe(e[r][0],t))return r;return-1}var q=vn;var An=Array.prototype,On=An.splice;function Tn(e){var t=this.__data__,r=q(t,e);if(r<0)return!1;var o=t.length-1;return r==o?t.pop():On.call(t,r,1),--this.size,!0}var lr=Tn;function _n(e){var t=this.__data__,r=q(t,e);return r<0?void 0:t[r][1]}var mr=_n;function wn(e){return q(this.__data__,e)>-1}var dr=wn;function Sn(e,t){var r=this.__data__,o=q(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}var cr=Sn;function ue(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}ue.prototype.clear=ur;ue.prototype.delete=lr;ue.prototype.get=mr;ue.prototype.has=dr;ue.prototype.set=cr;var $=ue;var jn=L(_,"Map"),J=jn;function Pn(){this.size=0,this.__data__={hash:new xt,map:new(J||$),string:new xt}}var xr=Pn;function In(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var yr=In;function En(e,t){var r=e.__data__;return yr(t)?r[typeof t=="string"?"string":"hash"]:r.map}var Y=En;function Cn(e){var t=Y(this,e).delete(e);return this.size-=t?1:0,t}var br=Cn;function Dn(e){return Y(this,e).get(e)}var gr=Dn;function Ln(e){return Y(this,e).has(e)}var hr=Ln;function Nn(e,t){var r=Y(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}var vr=Nn;function le(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var o=e[t];this.set(o[0],o[1])}}le.prototype.clear=xr;le.prototype.delete=br;le.prototype.get=gr;le.prototype.has=hr;le.prototype.set=vr;var V=le;var Mn="Expected a function";function yt(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Mn);var r=function(){var o=arguments,p=t?t.apply(this,o):o[0],n=r.cache;if(n.has(p))return n.get(p);var u=e.apply(this,o);return r.cache=n.set(p,u)||n,u};return r.cache=new(yt.Cache||V),r}yt.Cache=V;var Ar=yt;var Rn=500;function Bn(e){var t=Ar(e,function(o){return r.size===Rn&&r.clear(),o}),r=t.cache;return t}var Or=Bn;var Fn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Gn=/\\(\\)?/g,Un=Or(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Fn,function(r,o,p,n){t.push(p?n.replace(Gn,"$1"):o||r)}),t}),Tr=Un;function Wn(e){return e==null?"":Mt(e)}var _r=Wn;function zn(e,t){return D(e)?e:ar(e,t)?[e]:Tr(_r(e))}var ze=zn;var Kn=1/0;function Hn(e){if(typeof e=="string"||re(e))return e;var t=e+"";return t=="0"&&1/e==-Kn?"-0":t}var Ke=Hn;function qn(e,t){t=ze(t,e);for(var r=0,o=t.length;e!=null&&r<o;)e=e[Ke(t[r++])];return r&&r==o?e:void 0}var wr=qn;function $n(e,t,r){var o=e==null?void 0:wr(e,t);return o===void 0?r:o}var W=$n;function Jn(e,t){for(var r=-1,o=t.length,p=e.length;++r<o;)e[p+r]=t[r];return e}var He=Jn;var Yn=We(Object.getPrototypeOf,Object),me=Yn;var Xn="[object Object]",Zn=Function.prototype,Vn=Object.prototype,Sr=Zn.toString,Qn=Vn.hasOwnProperty,kn=Sr.call(Object);function ei(e){if(!P(e)||N(e)!=Xn)return!1;var t=me(e);if(t===null)return!0;var r=Qn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Sr.call(r)==kn}var de=ei;function ti(){this.__data__=new $,this.size=0}var jr=ti;function ri(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var Pr=ri;function oi(e){return this.__data__.get(e)}var Ir=oi;function ai(e){return this.__data__.has(e)}var Er=ai;var fi=200;function ni(e,t){var r=this.__data__;if(r instanceof $){var o=r.__data__;if(!J||o.length<fi-1)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new V(o)}return r.set(e,t),this.size=r.size,this}var Cr=ni;function ce(e){var t=this.__data__=new $(e);this.size=t.size}ce.prototype.clear=jr;ce.prototype.delete=Pr;ce.prototype.get=Ir;ce.prototype.has=Er;ce.prototype.set=Cr;var xe=ce;function ii(e,t){return e&&H(t,ie(t),e)}var Dr=ii;function pi(e,t){return e&&H(t,pe(t),e)}var Lr=pi;var Br=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Nr=Br&&typeof module=="object"&&module&&!module.nodeType&&module,si=Nr&&Nr.exports===Br,Mr=si?_.Buffer:void 0,Rr=Mr?Mr.allocUnsafe:void 0;function ui(e,t){if(t)return e.slice();var r=e.length,o=Rr?Rr(r):new e.constructor(r);return e.copy(o),o}var Fr=ui;function li(e,t){for(var r=-1,o=e==null?0:e.length,p=0,n=[];++r<o;){var u=e[r];t(u,r,e)&&(n[p++]=u)}return n}var Gr=li;function mi(){return[]}var qe=mi;var di=Object.prototype,ci=di.propertyIsEnumerable,Ur=Object.getOwnPropertySymbols,xi=Ur?function(e){return e==null?[]:(e=Object(e),Gr(Ur(e),function(t){return ci.call(e,t)}))}:qe,ye=xi;function yi(e,t){return H(e,ye(e),t)}var Wr=yi;var bi=Object.getOwnPropertySymbols,gi=bi?function(e){for(var t=[];e;)He(t,ye(e)),e=me(e);return t}:qe,$e=gi;function hi(e,t){return H(e,$e(e),t)}var zr=hi;function vi(e,t,r){var o=t(e);return D(e)?o:He(o,r(e))}var Je=vi;function Ai(e){return Je(e,ie,ye)}var we=Ai;function Oi(e){return Je(e,pe,$e)}var Kr=Oi;var Ti=L(_,"DataView"),Ye=Ti;var _i=L(_,"Promise"),Xe=_i;var wi=L(_,"Set"),Ze=wi;var Hr="[object Map]",Si="[object Object]",qr="[object Promise]",$r="[object Set]",Jr="[object WeakMap]",Yr="[object DataView]",ji=F(Ye),Pi=F(J),Ii=F(Xe),Ei=F(Ze),Ci=F(Ne),Q=N;(Ye&&Q(new Ye(new ArrayBuffer(1)))!=Yr||J&&Q(new J)!=Hr||Xe&&Q(Xe.resolve())!=qr||Ze&&Q(new Ze)!=$r||Ne&&Q(new Ne)!=Jr)&&(Q=function(e){var t=N(e),r=t==Si?e.constructor:void 0,o=r?F(r):"";if(o)switch(o){case ji:return Yr;case Pi:return Hr;case Ii:return qr;case Ei:return $r;case Ci:return Jr}return t});var z=Q;var Di=Object.prototype,Li=Di.hasOwnProperty;function Ni(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&Li.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var Xr=Ni;var Mi=_.Uint8Array,be=Mi;function Ri(e){var t=new e.constructor(e.byteLength);return new be(t).set(new be(e)),t}var ge=Ri;function Bi(e,t){var r=t?ge(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var Zr=Bi;var Fi=/\w*$/;function Gi(e){var t=new e.constructor(e.source,Fi.exec(e));return t.lastIndex=e.lastIndex,t}var Vr=Gi;var Qr=C?C.prototype:void 0,kr=Qr?Qr.valueOf:void 0;function Ui(e){return kr?Object(kr.call(e)):{}}var eo=Ui;function Wi(e,t){var r=t?ge(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var to=Wi;var zi="[object Boolean]",Ki="[object Date]",Hi="[object Map]",qi="[object Number]",$i="[object RegExp]",Ji="[object Set]",Yi="[object String]",Xi="[object Symbol]",Zi="[object ArrayBuffer]",Vi="[object DataView]",Qi="[object Float32Array]",ki="[object Float64Array]",ep="[object Int8Array]",tp="[object Int16Array]",rp="[object Int32Array]",op="[object Uint8Array]",ap="[object Uint8ClampedArray]",fp="[object Uint16Array]",np="[object Uint32Array]";function ip(e,t,r){var o=e.constructor;switch(t){case Zi:return ge(e);case zi:case Ki:return new o(+e);case Vi:return Zr(e,r);case Qi:case ki:case ep:case tp:case rp:case op:case ap:case fp:case np:return to(e,r);case Hi:return new o;case qi:case Yi:return new o(e);case $i:return Vr(e);case Ji:return new o;case Xi:return eo(e)}}var ro=ip;function pp(e){return typeof e.constructor=="function"&&!fe(e)?Wt(me(e)):{}}var oo=pp;var sp="[object Map]";function up(e){return P(e)&&z(e)==sp}var ao=up;var fo=G&&G.isMap,lp=fo?ne(fo):ao,no=lp;var mp="[object Set]";function dp(e){return P(e)&&z(e)==mp}var io=dp;var po=G&&G.isSet,cp=po?ne(po):io,so=cp;var xp=1,yp=2,bp=4,uo="[object Arguments]",gp="[object Array]",hp="[object Boolean]",vp="[object Date]",Ap="[object Error]",lo="[object Function]",Op="[object GeneratorFunction]",Tp="[object Map]",_p="[object Number]",mo="[object Object]",wp="[object RegExp]",Sp="[object Set]",jp="[object String]",Pp="[object Symbol]",Ip="[object WeakMap]",Ep="[object ArrayBuffer]",Cp="[object DataView]",Dp="[object Float32Array]",Lp="[object Float64Array]",Np="[object Int8Array]",Mp="[object Int16Array]",Rp="[object Int32Array]",Bp="[object Uint8Array]",Fp="[object Uint8ClampedArray]",Gp="[object Uint16Array]",Up="[object Uint32Array]",h={};h[uo]=h[gp]=h[Ep]=h[Cp]=h[hp]=h[vp]=h[Dp]=h[Lp]=h[Np]=h[Mp]=h[Rp]=h[Tp]=h[_p]=h[mo]=h[wp]=h[Sp]=h[jp]=h[Pp]=h[Bp]=h[Fp]=h[Gp]=h[Up]=!0;h[Ap]=h[lo]=h[Ip]=!1;function Ve(e,t,r,o,p,n){var u,m=t&xp,d=t&yp,c=t&bp;if(r&&(u=p?r(e,o,p,n):r(e)),u!==void 0)return u;if(!M(e))return e;var O=D(e);if(O){if(u=Xr(e),!m)return zt(e,u)}else{var b=z(e),g=b==lo||b==Op;if(Z(e))return Fr(e,m);if(b==mo||b==uo||g&&!p){if(u=d||g?{}:oo(e),!m)return d?zr(e,Lr(u,e)):Wr(e,Dr(u,e))}else{if(!h[b])return p?e:{};u=ro(e,b,m)}}n||(n=new xe);var j=n.get(e);if(j)return j;n.set(e,u),so(e)?e.forEach(function(w){u.add(Ve(w,t,r,w,e,n))}):no(e)&&e.forEach(function(w,S){u.set(S,Ve(w,t,r,S,e,n))});var I=c?d?Kr:we:d?pe:ie,T=O?void 0:I(e);return Kt(T||e,function(w,S){T&&(S=w,w=e[S]),ae(u,S,Ve(w,t,r,S,e,n))}),u}var co=Ve;var Wp=1,zp=4;function Kp(e,t){return t=typeof t=="function"?t:void 0,co(e,Wp|zp,t)}var Qe=Kp;var Hp="__lodash_hash_undefined__";function qp(e){return this.__data__.set(e,Hp),this}var xo=qp;function $p(e){return this.__data__.has(e)}var yo=$p;function ke(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new V;++t<r;)this.add(e[t])}ke.prototype.add=ke.prototype.push=xo;ke.prototype.has=yo;var bo=ke;function Jp(e,t){for(var r=-1,o=e==null?0:e.length;++r<o;)if(t(e[r],r,e))return!0;return!1}var go=Jp;function Yp(e,t){return e.has(t)}var ho=Yp;var Xp=1,Zp=2;function Vp(e,t,r,o,p,n){var u=r&Xp,m=e.length,d=t.length;if(m!=d&&!(u&&d>m))return!1;var c=n.get(e),O=n.get(t);if(c&&O)return c==t&&O==e;var b=-1,g=!0,j=r&Zp?new bo:void 0;for(n.set(e,t),n.set(t,e);++b<m;){var I=e[b],T=t[b];if(o)var w=u?o(T,I,b,t,e,n):o(I,T,b,e,t,n);if(w!==void 0){if(w)continue;g=!1;break}if(j){if(!go(t,function(S,B){if(!ho(j,B)&&(I===S||p(I,S,r,o,n)))return j.push(B)})){g=!1;break}}else if(!(I===T||p(I,T,r,o,n))){g=!1;break}}return n.delete(e),n.delete(t),g}var et=Vp;function Qp(e){var t=-1,r=Array(e.size);return e.forEach(function(o,p){r[++t]=[p,o]}),r}var vo=Qp;function kp(e){var t=-1,r=Array(e.size);return e.forEach(function(o){r[++t]=o}),r}var Ao=kp;var es=1,ts=2,rs="[object Boolean]",os="[object Date]",as="[object Error]",fs="[object Map]",ns="[object Number]",is="[object RegExp]",ps="[object Set]",ss="[object String]",us="[object Symbol]",ls="[object ArrayBuffer]",ms="[object DataView]",Oo=C?C.prototype:void 0,bt=Oo?Oo.valueOf:void 0;function ds(e,t,r,o,p,n,u){switch(r){case ms:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case ls:return!(e.byteLength!=t.byteLength||!n(new be(e),new be(t)));case rs:case os:case ns:return oe(+e,+t);case as:return e.name==t.name&&e.message==t.message;case is:case ss:return e==t+"";case fs:var m=vo;case ps:var d=o&es;if(m||(m=Ao),e.size!=t.size&&!d)return!1;var c=u.get(e);if(c)return c==t;o|=ts,u.set(e,t);var O=et(m(e),m(t),o,p,n,u);return u.delete(e),O;case us:if(bt)return bt.call(e)==bt.call(t)}return!1}var To=ds;var cs=1,xs=Object.prototype,ys=xs.hasOwnProperty;function bs(e,t,r,o,p,n){var u=r&cs,m=we(e),d=m.length,c=we(t),O=c.length;if(d!=O&&!u)return!1;for(var b=d;b--;){var g=m[b];if(!(u?g in t:ys.call(t,g)))return!1}var j=n.get(e),I=n.get(t);if(j&&I)return j==t&&I==e;var T=!0;n.set(e,t),n.set(t,e);for(var w=u;++b<d;){g=m[b];var S=e[g],B=t[g];if(o)var k=u?o(B,S,g,t,e,n):o(S,B,g,e,t,n);if(!(k===void 0?S===B||p(S,B,r,o,n):k)){T=!1;break}w||(w=g=="constructor")}if(T&&!w){var ee=e.constructor,te=t.constructor;ee!=te&&"constructor"in e&&"constructor"in t&&!(typeof ee=="function"&&ee instanceof ee&&typeof te=="function"&&te instanceof te)&&(T=!1)}return n.delete(e),n.delete(t),T}var _o=bs;var gs=1,wo="[object Arguments]",So="[object Array]",tt="[object Object]",hs=Object.prototype,jo=hs.hasOwnProperty;function vs(e,t,r,o,p,n){var u=D(e),m=D(t),d=u?So:z(e),c=m?So:z(t);d=d==wo?tt:d,c=c==wo?tt:c;var O=d==tt,b=c==tt,g=d==c;if(g&&Z(e)){if(!Z(t))return!1;u=!0,O=!1}if(g&&!O)return n||(n=new xe),u||Ge(e)?et(e,t,r,o,p,n):To(e,t,d,r,o,p,n);if(!(r&gs)){var j=O&&jo.call(e,"__wrapped__"),I=b&&jo.call(t,"__wrapped__");if(j||I){var T=j?e.value():e,w=I?t.value():t;return n||(n=new xe),p(T,w,r,o,n)}}return g?(n||(n=new xe),_o(e,t,r,o,p,n)):!1}var Po=vs;function Io(e,t,r,o,p){return e===t?!0:e==null||t==null||!P(e)&&!P(t)?e!==e&&t!==t:Po(e,t,r,o,Io,p)}var Eo=Io;function As(e,t,r){r=typeof r=="function"?r:void 0;var o=r?r(e,t):void 0;return o===void 0?Eo(e,t,void 0,r):!!o}var gt=As;function Os(e,t,r,o){if(!M(e))return e;t=ze(t,e);for(var p=-1,n=t.length,u=n-1,m=e;m!=null&&++p<n;){var d=Ke(t[p]),c=r;if(d==="__proto__"||d==="constructor"||d==="prototype")return e;if(p!=u){var O=m[d];c=o?o(O,d,m):void 0,c===void 0&&(c=M(O)?O:Me(t[p+1])?[]:{})}ae(m,d,c),m=m[d]}return e}var Co=Os;function Ts(e,t,r){return e==null?e:Co(e,t,r)}var Se=Ts;var Do="__statezero_root";function rt(e){return e?e[Do]:void 0}function ot(e,t){Object.defineProperty(e,Do,{enumerable:!1,value:t})}var ht=St(No());var Mo="__statezero_immutable";function at(e){return e&&e[Mo]===!0}function Ro(e){Object.defineProperty(e,Mo,{enumerable:!1,value:!0})}var Bo=(e,t)=>typeof t=="object"?Qe(t,e):t,Fo=e=>{let t=new WeakMap,r,o=p=>{if(p instanceof Element||typeof p=="function"||at(p))return p;if(!de(p))return;let n=t.get(p);if(n)return n;if(n={},t.set(p,n),r||(r=n),!rt(p)){for(let u of Object.getOwnPropertyNames(p))u.startsWith("__statezero")||u.startsWith("$jscomp")||(n[u]=Bo(o,p[u]));return n}ot(n,r);for(let[u,m]of Object.entries(Object.getOwnPropertyDescriptors(p)))if(!(u.startsWith("__statezero")||u.startsWith("$jscomp"))){if(m.get){Object.defineProperty(n,u,m);continue}m.enumerable&&(n[u]=Bo(o,m.value))}return n};return Qe(e,o)};var he=new Set,ve=new Set,_s=(e,t)=>at(e)?e===t:void 0,ws=(e,t)=>(r,o)=>{let p=t(r),n=t(o);gt(p,n,_s)||e(p,n,r)},Ss=e=>(t,r)=>{e(t,r,t)},js=e=>t=>e.map(r=>W(t,r)),Ps=e=>t=>W(t,e),je=(e,t,r=!1)=>{let o=t;typeof t=="string"?o=Ps(t):Array.isArray(t)&&(o=js(t));let p;if(typeof o=="function")p=ws(e,o);else if(o===void 0)p=Ss(e);else{let n=typeof t=="object"?JSON.stringify(t):t;throw new Error(`statezero: subscribe() must be called with an Array/Function/String/undefined selector; not ${n}`)}return r?ve.add(p):he.add(p),p},Is=(e,t)=>je(e,t,!0),Go=(e,t,r=!1)=>{let p=je((...n)=>{e(...n),ft(p)},t,r);return p},Es=(e,t)=>Go(e,t,!0),ft=e=>{he.delete(e),ve.delete(e)},Cs=()=>{he.clear(),ve.clear()};var K=(0,ht.default)({}),nt,Ds=e=>{nt===void 0&&(nt=e,setTimeout(()=>{let t=nt;nt=void 0;for(let r of he)r(K,t)}))},Ls=e=>{for(let t of ve)t(K,e)},Ns=e=>{if(!de(e))throw new Error(`statezero: commit() must be called with a plain object "nextState" argument; not: ${e}`);let t=K;K=(0,ht.default)(e),Ds(t),Ls(t)},it=e=>(...t)=>e({commit:Ns,state:Fo(K)},...t),Ms=e=>{if(e===void 0)return K;if(typeof e=="string")return W(K,e);if(Array.isArray(e))return e.map(r=>W(K,r));if(typeof e=="function")return e(K);let t=typeof e=="object"?JSON.stringify(e):e;throw new Error(`statezero: getState() must be called with an Array/Function/String/undefined selector; not ${t}`)},Uo=it(({commit:e,state:t},r,o)=>{let p=t;if(r==null||r==="")p=o;else if(typeof r=="string")Se(t,r,o);else{let n=typeof r=="object"?JSON.stringify(r):r;throw new Error(`statezero: setState() must be called with an String/undefined "selector" argument; not ${n}`)}e(p)}),Rs=(e,t)=>{if(!e)throw new Error('statezero: setImmutableState() must be called with a non-empty String "selector" argument');if(!de(t))throw new Error(`statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${t}`);Ro(t),Uo(e,t)};var Bs=it(({commit:e,state:t},r,o,p=!1)=>{let n=Array.isArray(r)?r:r.split("."),u=n.length-1,m=n[u],d=n.slice(0,u),c=t;d.length&&(c=W(t,d,{}),Se(t,d,c)),Object.defineProperty(c,m,{enumerable:p,get(){return o.call(this,this,rt(this))}}),ot(c,t),e(t)});var Ko=St(zo());var Pe,Fs={A:"Array changed",D:"Deleted",E:"Changed",N:"New"},Gs=e=>(t,r)=>{let o={},p=(0,Ko.default)(r,t);if(p!==void 0){for(let n of p){let{path:u}=n;o[u]={changeType:Fs[n.kind],from:n.lhs,to:n.rhs}}e(o,["changeType","from","to"])}},Us=(e,t)=>{Pe||(Pe=je(Gs(t||console.table),e))},Ws=()=>{Pe&&(ft(Pe),Pe=null)};return Vo(zs);})();
2
+ /*! Bundled license information:
3
+
4
+ lodash-es/lodash.js:
5
+ (**
6
+ * @license
7
+ * Lodash (Custom Build) <https://lodash.com/>
8
+ * Build: `lodash modularize exports="es" --repo lodash/lodash#4.18.1 -o ./`
9
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
10
+ * Released under MIT license <https://lodash.com/license>
11
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
12
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
13
+ *)
14
+ */
package/package.json CHANGED
@@ -1,12 +1,18 @@
1
1
  {
2
2
  "name": "statezero",
3
- "version": "0.8.0",
3
+ "version": "0.9.2",
4
4
  "author": "andornaut",
5
5
  "description": "Small, simple, functional JavaScript library for managing immutable state",
6
6
  "keywords": [
7
+ "flux",
7
8
  "functional",
8
9
  "immutable",
10
+ "minimal",
11
+ "observable",
12
+ "observer",
13
+ "pubsub",
9
14
  "reactive",
15
+ "redux-alternative",
10
16
  "state",
11
17
  "state-management",
12
18
  "store"
@@ -14,8 +20,11 @@
14
20
  "license": "MIT",
15
21
  "main": "dist/statezero.js",
16
22
  "module": "dist/statezero.esm.js",
23
+ "browser": "./dist/statezero.js",
24
+ "types": "dist/index.d.ts",
17
25
  "exports": {
18
26
  ".": {
27
+ "types": "./dist/index.d.ts",
19
28
  "import": "./dist/statezero.esm.js",
20
29
  "require": "./dist/statezero.js"
21
30
  },
@@ -29,38 +38,46 @@
29
38
  "src"
30
39
  ],
31
40
  "engines": {
32
- "node": ">=18"
41
+ "node": ">=20"
42
+ },
43
+ "repository": {
44
+ "type": "git",
45
+ "url": "https://github.com/andornaut/statezero.git"
33
46
  },
34
- "repository": "andornaut/statezero",
35
47
  "homepage": "https://github.com/andornaut/statezero#readme",
36
48
  "bugs": "https://github.com/andornaut/statezero/issues",
37
49
  "dependencies": {
38
50
  "deep-diff": "^1.0.2",
39
- "lodash": "^4.17.23",
51
+ "lodash-es": "^4.18.1",
40
52
  "simple-deep-freeze": "^0.0.2"
41
53
  },
42
54
  "devDependencies": {
43
- "@babel/core": "^7.29.0",
44
- "@babel/preset-env": "^7.29.0",
45
- "esbuild": "^0.27.3",
46
- "eslint": "^8.57.1",
47
- "eslint-plugin-simple-import-sort": "^12.1.1",
55
+ "@babel/core": "^8.0.1",
56
+ "@babel/preset-env": "^8.0.2",
57
+ "@eslint/js": "^10.0.1",
58
+ "@size-limit/preset-small-lib": "^13.0.1",
59
+ "esbuild": "^0.28.0",
60
+ "eslint": "^10.1.0",
61
+ "eslint-plugin-simple-import-sort": "^14.0.0",
48
62
  "eslint-plugin-sort-destructure-keys": "^3.0.0",
63
+ "globals": "^17.6.0",
49
64
  "husky": "^9.1.7",
50
- "jest": "^30.0.2",
51
- "jest-environment-jsdom": "^30.0.2",
52
- "lint-staged": "^16.2.7",
53
- "prettier-eslint-cli": "^8.0.1"
65
+ "jest": "^30.3.0",
66
+ "jest-environment-jsdom": "^30.3.0",
67
+ "lint-staged": "^17.3.0",
68
+ "prettier": "^3.9.6",
69
+ "size-limit": "^13.0.1"
54
70
  },
55
71
  "scripts": {
56
72
  "build": "npm run build:esm && npm run build:umd",
57
73
  "build:esm": "esbuild src/index.js --bundle --format=esm --packages=external --outfile=dist/statezero.esm.js",
58
74
  "build:production": "npm run build:esm -- --minify && npm run build:umd -- --minify",
59
75
  "build:umd": "esbuild src/index.js --bundle --format=iife --global-name=statezero --outfile=dist/statezero.js",
60
- "format": "prettier-eslint --write \"${PWD}/{src/**,/test/**/,./}*.{css,js,json,jsx,md}\"",
61
- "lint": "eslint --max-warnings 0 {src,test}/**/*.js",
76
+ "format": "prettier --write . && eslint --fix .",
77
+ "lint": "prettier --check . && eslint --max-warnings 0 .",
62
78
  "prepare": "husky",
63
79
  "prepublishOnly": "npm run test && npm run build:production",
80
+ "size": "size-limit",
64
81
  "test": "jest",
65
82
  "test:watch": "jest --watch"
66
83
  }
package/src/clone.js CHANGED
@@ -1,10 +1,10 @@
1
- import cloneDeepWith from "lodash/cloneDeepWith";
2
- import isPlainObject from "lodash/isPlainObject";
1
+ import { cloneDeepWith, isPlainObject } from "lodash-es";
3
2
 
4
3
  import { isImmutable } from "./immutable";
5
4
  import { getRoot, setRoot } from "./root";
6
5
 
7
- const cloneProp = (customizer, value) => (typeof value === "object" ? cloneDeepWith(value, customizer) : value);
6
+ const cloneProp = (customizer, value) =>
7
+ typeof value === "object" ? cloneDeepWith(value, customizer) : value;
8
8
 
9
9
  /* Deep clone the given object.
10
10
  *
@@ -21,7 +21,11 @@ export const clone = (obj) => {
21
21
  let root;
22
22
 
23
23
  const customizer = (value) => {
24
- if (value instanceof Element || typeof value === "function" || isImmutable(value)) {
24
+ if (
25
+ value instanceof Element ||
26
+ typeof value === "function" ||
27
+ isImmutable(value)
28
+ ) {
25
29
  // Do not attempt to clone DOM nodes, immutable objects, or Function, but don't replace them with {} either, which
26
30
  // is what lodash would usually do. Leave them as is instead.
27
31
  return value;
@@ -49,7 +53,10 @@ export const clone = (obj) => {
49
53
  // We know that there are no getters if there is no ROOT, b/c defineGetters sets ROOT.
50
54
  // Even `cloned[ROOT] = root;` is costly, so we avoid that here too.
51
55
  for (const propName of Object.getOwnPropertyNames(value)) {
52
- if (propName.startsWith("__statezero") || propName.startsWith("$jscomp")) {
56
+ if (
57
+ propName.startsWith("__statezero") ||
58
+ propName.startsWith("$jscomp")
59
+ ) {
53
60
  continue;
54
61
  }
55
62
  cloned[propName] = cloneProp(customizer, value[propName]);
@@ -59,8 +66,13 @@ export const clone = (obj) => {
59
66
 
60
67
  setRoot(cloned, root);
61
68
 
62
- for (const [propName, descriptor] of Object.entries(Object.getOwnPropertyDescriptors(value))) {
63
- if (propName.startsWith("__statezero") || propName.startsWith("$jscomp")) {
69
+ for (const [propName, descriptor] of Object.entries(
70
+ Object.getOwnPropertyDescriptors(value),
71
+ )) {
72
+ if (
73
+ propName.startsWith("__statezero") ||
74
+ propName.startsWith("$jscomp")
75
+ ) {
64
76
  continue;
65
77
  }
66
78
  if (descriptor.get) {
package/src/getters.js CHANGED
@@ -1,5 +1,4 @@
1
- import get from "lodash/get";
2
- import set from "lodash/set";
1
+ import { get, set } from "lodash-es";
3
2
 
4
3
  import { getRoot, setRoot } from "./root";
5
4
  import { action } from "./state";
@@ -12,25 +11,27 @@ import { action } from "./state";
12
11
  * @param fn: A function which takes state as its only parameter and returns a value.
13
12
  * @param enumerable: A boolean which determine whether this property shows up during enumeration.
14
13
  */
15
- export const defineGetter = action(({ commit, state }, path, fn, enumerable = false) => {
16
- const pathArray = Array.isArray(path) ? path : path.split(".");
17
- const lastIdx = pathArray.length - 1;
18
- const propName = pathArray[lastIdx];
19
- const parentPath = pathArray.slice(0, lastIdx);
14
+ export const defineGetter = action(
15
+ ({ commit, state }, path, fn, enumerable = false) => {
16
+ const pathArray = Array.isArray(path) ? path : path.split(".");
17
+ const lastIdx = pathArray.length - 1;
18
+ const propName = pathArray[lastIdx];
19
+ const parentPath = pathArray.slice(0, lastIdx);
20
20
 
21
- let obj = state;
22
- if (parentPath.length) {
23
- obj = get(state, parentPath, {});
24
- // Set parentPath in case it didn't exist (the default case of get() above).
25
- set(state, parentPath, obj);
26
- }
21
+ let obj = state;
22
+ if (parentPath.length) {
23
+ obj = get(state, parentPath, {});
24
+ // Set parentPath in case it didn't exist (the default case of get() above).
25
+ set(state, parentPath, obj);
26
+ }
27
27
 
28
- Object.defineProperty(obj, propName, {
29
- get() {
30
- return fn.call(this, this, getRoot(this));
31
- },
32
- enumerable,
33
- });
34
- setRoot(obj, state);
35
- commit(state);
36
- });
28
+ Object.defineProperty(obj, propName, {
29
+ enumerable,
30
+ get() {
31
+ return fn.call(this, this, getRoot(this));
32
+ },
33
+ });
34
+ setRoot(obj, state);
35
+ commit(state);
36
+ },
37
+ );
package/src/logger.js CHANGED
@@ -34,7 +34,6 @@ export const startLogging = (selector, logger) => {
34
34
  return;
35
35
  }
36
36
 
37
- // eslint-disable-next-line no-console
38
37
  subscription = subscribe(createDiffLogger(logger || console.table), selector);
39
38
  };
40
39
 
package/src/root.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Keep track of the top-level state object during cloning so that getters can access it later
2
- const ROOT = "__statezero__root";
2
+ const ROOT = "__statezero_root";
3
3
 
4
4
  export function getRoot(obj) {
5
5
  return obj ? obj[ROOT] : undefined;
package/src/state.js CHANGED
@@ -1,6 +1,4 @@
1
- import get from "lodash/get";
2
- import isPlainObject from "lodash/isPlainObject";
3
- import set from "lodash/set";
1
+ import { get, isPlainObject, set } from "lodash-es";
4
2
  import simpleDeepFreeze from "simple-deep-freeze";
5
3
 
6
4
  import { clone } from "./clone";
@@ -34,7 +32,9 @@ const notifySync = (prevState) => {
34
32
 
35
33
  const commit = (nextState) => {
36
34
  if (!isPlainObject(nextState)) {
37
- throw new Error(`statezero: commit() must be called with a plain object "nextState" argument; not: ${nextState}`);
35
+ throw new Error(
36
+ `statezero: commit() must be called with a plain object "nextState" argument; not: ${nextState}`,
37
+ );
38
38
  }
39
39
  const prevState = state;
40
40
  state = simpleDeepFreeze(nextState);
@@ -60,31 +60,41 @@ export const getState = (selector) => {
60
60
  if (typeof selector === "function") {
61
61
  return selector(state);
62
62
  }
63
+ const selectorStr =
64
+ typeof selector === "object" ? JSON.stringify(selector) : selector;
63
65
  throw new Error(
64
- `statezero: getState() must be called with an Array/Function/String/undefined "selector" argument; not ${selector}`,
66
+ `statezero: getState() must be called with an Array/Function/String/undefined selector; not ${selectorStr}`,
65
67
  );
66
68
  };
67
69
 
68
- // eslint-disable-next-line no-shadow
69
70
  export const setState = action(({ commit, state }, selector, value) => {
71
+ // Replacing the root commits `value` itself; a nested selector mutates the
72
+ // state object in place and commits that.
73
+ let next = state;
70
74
  if (selector === undefined || selector === null || selector === "") {
71
- state = value;
75
+ next = value;
72
76
  } else if (typeof selector === "string") {
73
77
  set(state, selector, value);
74
78
  } else {
79
+ const selectorStr =
80
+ typeof selector === "object" ? JSON.stringify(selector) : selector;
75
81
  throw new Error(
76
- `statezero: setState() must be called with an String/undefined "selector" argument; not ${selector}`,
82
+ `statezero: setState() must be called with an String/undefined "selector" argument; not ${selectorStr}`,
77
83
  );
78
84
  }
79
- commit(state);
85
+ commit(next);
80
86
  });
81
87
 
82
88
  export const setImmutableState = (selector, obj) => {
83
89
  if (!selector) {
84
- throw new Error('statezero: setImmutableState() must be called with a non-empty String "selector" argument');
90
+ throw new Error(
91
+ 'statezero: setImmutableState() must be called with a non-empty String "selector" argument',
92
+ );
85
93
  }
86
94
  if (!isPlainObject(obj)) {
87
- throw new Error(`statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${obj}`);
95
+ throw new Error(
96
+ `statezero: setImmutableState() must be called with a plain object "obj" argument; not: ${obj}`,
97
+ );
88
98
  }
89
99
  markImmutable(obj);
90
100
  setState(selector, obj);
@@ -1,5 +1,4 @@
1
- import get from "lodash/get";
2
- import isEqualWith from "lodash/isEqualWith";
1
+ import { get, isEqualWith } from "lodash-es";
3
2
 
4
3
  import { isImmutable } from "./immutable";
5
4
 
@@ -8,7 +7,8 @@ export const subscribersSync = new Set();
8
7
 
9
8
  // When customizer returns undefined, comparisons are handled by lodash
10
9
  // https://lodash.com/docs/4.17.15#isEqualWith
11
- const isEqualCustomizer = (value, othValue) => (isImmutable(value) ? value === othValue : undefined);
10
+ const isEqualCustomizer = (value, othValue) =>
11
+ isImmutable(value) ? value === othValue : undefined;
12
12
 
13
13
  const applySelector = (callback, selector) => (nextState, prevState) => {
14
14
  const selectedNextState = selector(nextState);
@@ -22,7 +22,8 @@ const applyRootState = (callback) => (nextState, prevState) => {
22
22
  callback(nextState, prevState, nextState);
23
23
  };
24
24
 
25
- const createArraySelector = (paths) => (_state) => paths.map((path) => get(_state, path));
25
+ const createArraySelector = (paths) => (_state) =>
26
+ paths.map((path) => get(_state, path));
26
27
 
27
28
  const createStringSelector = (path) => (_state) => get(_state, path);
28
29
 
@@ -39,39 +40,43 @@ const createStringSelector = (path) => (_state) => get(_state, path);
39
40
  */
40
41
  export const subscribe = (callback, selector, isSync = false) => {
41
42
  // Convert an array or string selector into a function.
43
+ let select = selector;
42
44
  if (typeof selector === "string") {
43
- selector = createStringSelector(selector);
45
+ select = createStringSelector(selector);
44
46
  } else if (Array.isArray(selector)) {
45
- selector = createArraySelector(selector);
47
+ select = createArraySelector(selector);
46
48
  }
47
49
 
48
- if (typeof selector === "function") {
49
- callback = applySelector(callback, selector);
50
- } else if (selector === undefined) {
51
- callback = applyRootState(callback);
50
+ // Every branch below assigns it or throws.
51
+ let notify;
52
+ if (typeof select === "function") {
53
+ notify = applySelector(callback, select);
54
+ } else if (select === undefined) {
55
+ notify = applyRootState(callback);
52
56
  } else {
57
+ const selectorStr =
58
+ typeof selector === "object" ? JSON.stringify(selector) : selector;
53
59
  throw new Error(
54
- `statezero: subscribe() must be called with an Array/Function/String/undefined "selector" argument; not\
55
- ${selector}`,
60
+ `statezero: subscribe() must be called with an Array/Function/String/undefined selector; not ${selectorStr}`,
56
61
  );
57
62
  }
58
63
 
59
64
  if (isSync) {
60
- subscribersSync.add(callback);
65
+ subscribersSync.add(notify);
61
66
  } else {
62
- subscribersAsync.add(callback);
67
+ subscribersAsync.add(notify);
63
68
  }
64
69
 
65
70
  // If a `selector` was provided, then the caller will need to use the returned `callback` in order to `unsubscribe()`.
66
- return callback;
71
+ return notify;
67
72
  };
68
73
 
69
- export const subscribeSync = (callback, selector) => subscribe(callback, selector, true);
74
+ export const subscribeSync = (callback, selector) =>
75
+ subscribe(callback, selector, true);
70
76
 
71
77
  export const subscribeOnce = (callback, selector, isSync = false) => {
72
78
  const wrapper = (...args) => {
73
79
  callback(...args);
74
- // eslint-disable-next-line no-use-before-define
75
80
  unsubscribe(subscription);
76
81
  };
77
82
 
@@ -79,7 +84,8 @@ export const subscribeOnce = (callback, selector, isSync = false) => {
79
84
  return subscription;
80
85
  };
81
86
 
82
- export const subscribeOnceSync = (callback, selector) => subscribeOnce(callback, selector, true);
87
+ export const subscribeOnceSync = (callback, selector) =>
88
+ subscribeOnce(callback, selector, true);
83
89
 
84
90
  export const unsubscribe = (callback) => {
85
91
  subscribersAsync.delete(callback);