tinybase 5.3.0-beta.1 → 5.3.0-beta.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.
Files changed (43) hide show
  1. package/@types/ui-react/index.d.cts +0 -71
  2. package/@types/ui-react/index.d.ts +0 -71
  3. package/@types/ui-react/with-schemas/index.d.cts +0 -71
  4. package/@types/ui-react/with-schemas/index.d.ts +0 -71
  5. package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
  6. package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
  7. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  8. package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  9. package/cjs/es6/ui-react-inspector/index.cjs +1 -1
  10. package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +1 -1
  11. package/cjs/min/ui-react-inspector/index.cjs +1 -1
  12. package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
  13. package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
  14. package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
  15. package/cjs/ui-react-inspector/index.cjs +1 -1
  16. package/cjs/ui-react-inspector/with-schemas/index.cjs +1 -1
  17. package/es6/min/ui-react-inspector/index.js +1 -1
  18. package/es6/min/ui-react-inspector/index.js.gz +0 -0
  19. package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  20. package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  21. package/es6/ui-react-inspector/index.js +1 -1
  22. package/es6/ui-react-inspector/with-schemas/index.js +1 -1
  23. package/min/ui-react-inspector/index.js +1 -1
  24. package/min/ui-react-inspector/index.js.gz +0 -0
  25. package/min/ui-react-inspector/with-schemas/index.js +1 -1
  26. package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  27. package/package.json +1 -1
  28. package/readme.md +2 -2
  29. package/releases.md +2 -2
  30. package/ui-react-inspector/index.js +1 -1
  31. package/ui-react-inspector/with-schemas/index.js +1 -1
  32. package/umd/es6/min/ui-react-inspector/index.js +1 -1
  33. package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
  34. package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
  35. package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  36. package/umd/es6/ui-react-inspector/index.js +2 -1
  37. package/umd/es6/ui-react-inspector/with-schemas/index.js +2 -1
  38. package/umd/min/ui-react-inspector/index.js +1 -1
  39. package/umd/min/ui-react-inspector/index.js.gz +0 -0
  40. package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
  41. package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
  42. package/umd/ui-react-inspector/index.js +2 -1
  43. package/umd/ui-react-inspector/with-schemas/index.js +2 -1
@@ -10568,77 +10568,6 @@ export function useCheckpoints(id?: Id): Checkpoints | undefined;
10568
10568
  * @category Checkpoints hooks
10569
10569
  * @since v4.1.0
10570
10570
  */
10571
- /**
10572
- * The useProvideCheckpoints hook is used to add a Checkpoints object by Id to a
10573
- * Provider component, but imperatively from a component within it.
10574
- *
10575
- * Normally you will register a Checkpoints object by Id in a context by using
10576
- * the `checkpointsById` prop of the top-level Provider component. This hook,
10577
- * however, lets you dynamically add a new Checkpoints object to the context,
10578
- * from within a component. This is useful for applications where the set of
10579
- * Checkpoints objects is not known at the time of the first render of the root
10580
- * Provider.
10581
- *
10582
- * A Checkpoints object added to the Provider context in this way will be
10583
- * available to other components within the context (using the useCheckpoints
10584
- * hook and so on). If you use the same Id as an existing Checkpoints object
10585
- * registration, the new one will take priority over one provided by the
10586
- * `checkpointsById` prop.
10587
- *
10588
- * Note that other components that consume a Checkpoints object registered like
10589
- * this should defend against it being undefined at first. On the first render,
10590
- * the other component will likely not yet have completed the registration. In
10591
- * the example below, we use the null-safe `useCheckpoints('petCheckpoints')?`
10592
- * to do this.
10593
- * @param checkpointsId The Id of the Checkpoints object to be registered with
10594
- * the Provider.
10595
- * @param checkpoints The Checkpoints object to be registered.
10596
- * @example
10597
- * This example creates a Provider context. A child component registers a
10598
- * Checkpoints object into it which is then consumable by a peer child
10599
- * component.
10600
- *
10601
- * ```jsx
10602
- * import {
10603
- * Provider,
10604
- * useCheckpoints,
10605
- * useCreateCheckpoints,
10606
- * useCreateStore,
10607
- * useProvideCheckpoints,
10608
- * } from 'tinybase/ui-react';
10609
- * import {createCheckpoints, createStore} from 'tinybase';
10610
- * import React from 'react';
10611
- * import {createRoot} from 'react-dom/client';
10612
- *
10613
- * const App = () => (
10614
- * <Provider>
10615
- * <RegisterCheckpoints />
10616
- * <ConsumeCheckpoints />
10617
- * </Provider>
10618
- * );
10619
- * const RegisterCheckpoints = () => {
10620
- * const store = useCreateStore(() =>
10621
- * createStore().setCell('pets', 'fido', 'color', 'brown'),
10622
- * );
10623
- * const checkpoints = useCreateCheckpoints(store, createCheckpoints);
10624
- * useProvideCheckpoints('petCheckpoints', checkpoints);
10625
- * return null;
10626
- * };
10627
- * const ConsumeCheckpoints = () => (
10628
- * <span>
10629
- * {JSON.stringify(useCheckpoints('petCheckpoints')?.getCheckpointIds())}
10630
- * </span>
10631
- * );
10632
- *
10633
- * const app = document.createElement('div');
10634
- * const root = createRoot(app);
10635
- * root.render(<App />); // !act
10636
- * console.log(app.innerHTML);
10637
- * // -> '<span>[[],"0",[]]</span>'
10638
- * ```
10639
- * @category Checkpoints hooks
10640
- * @since v5.3.0
10641
- */
10642
10571
  export function useCheckpointsOrCheckpointsById(
10643
10572
  checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
10644
10573
  ): Checkpoints | undefined;
@@ -10568,77 +10568,6 @@ export function useCheckpoints(id?: Id): Checkpoints | undefined;
10568
10568
  * @category Checkpoints hooks
10569
10569
  * @since v4.1.0
10570
10570
  */
10571
- /**
10572
- * The useProvideCheckpoints hook is used to add a Checkpoints object by Id to a
10573
- * Provider component, but imperatively from a component within it.
10574
- *
10575
- * Normally you will register a Checkpoints object by Id in a context by using
10576
- * the `checkpointsById` prop of the top-level Provider component. This hook,
10577
- * however, lets you dynamically add a new Checkpoints object to the context,
10578
- * from within a component. This is useful for applications where the set of
10579
- * Checkpoints objects is not known at the time of the first render of the root
10580
- * Provider.
10581
- *
10582
- * A Checkpoints object added to the Provider context in this way will be
10583
- * available to other components within the context (using the useCheckpoints
10584
- * hook and so on). If you use the same Id as an existing Checkpoints object
10585
- * registration, the new one will take priority over one provided by the
10586
- * `checkpointsById` prop.
10587
- *
10588
- * Note that other components that consume a Checkpoints object registered like
10589
- * this should defend against it being undefined at first. On the first render,
10590
- * the other component will likely not yet have completed the registration. In
10591
- * the example below, we use the null-safe `useCheckpoints('petCheckpoints')?`
10592
- * to do this.
10593
- * @param checkpointsId The Id of the Checkpoints object to be registered with
10594
- * the Provider.
10595
- * @param checkpoints The Checkpoints object to be registered.
10596
- * @example
10597
- * This example creates a Provider context. A child component registers a
10598
- * Checkpoints object into it which is then consumable by a peer child
10599
- * component.
10600
- *
10601
- * ```jsx
10602
- * import {
10603
- * Provider,
10604
- * useCheckpoints,
10605
- * useCreateCheckpoints,
10606
- * useCreateStore,
10607
- * useProvideCheckpoints,
10608
- * } from 'tinybase/ui-react';
10609
- * import {createCheckpoints, createStore} from 'tinybase';
10610
- * import React from 'react';
10611
- * import {createRoot} from 'react-dom/client';
10612
- *
10613
- * const App = () => (
10614
- * <Provider>
10615
- * <RegisterCheckpoints />
10616
- * <ConsumeCheckpoints />
10617
- * </Provider>
10618
- * );
10619
- * const RegisterCheckpoints = () => {
10620
- * const store = useCreateStore(() =>
10621
- * createStore().setCell('pets', 'fido', 'color', 'brown'),
10622
- * );
10623
- * const checkpoints = useCreateCheckpoints(store, createCheckpoints);
10624
- * useProvideCheckpoints('petCheckpoints', checkpoints);
10625
- * return null;
10626
- * };
10627
- * const ConsumeCheckpoints = () => (
10628
- * <span>
10629
- * {JSON.stringify(useCheckpoints('petCheckpoints')?.getCheckpointIds())}
10630
- * </span>
10631
- * );
10632
- *
10633
- * const app = document.createElement('div');
10634
- * const root = createRoot(app);
10635
- * root.render(<App />); // !act
10636
- * console.log(app.innerHTML);
10637
- * // -> '<span>[[],"0",[]]</span>'
10638
- * ```
10639
- * @category Checkpoints hooks
10640
- * @since v5.3.0
10641
- */
10642
10571
  export function useCheckpointsOrCheckpointsById(
10643
10572
  checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId,
10644
10573
  ): Checkpoints | undefined;
@@ -11826,77 +11826,6 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
11826
11826
  * ```
11827
11827
  * @category Checkpoints hooks
11828
11828
  * @since v4.1.0
11829
- */
11830
- /**
11831
- * The useProvideCheckpoints hook is used to add a Checkpoints object by Id to a
11832
- * Provider component, but imperatively from a component within it.
11833
- *
11834
- * Normally you will register a Checkpoints object by Id in a context by using
11835
- * the `checkpointsById` prop of the top-level Provider component. This hook,
11836
- * however, lets you dynamically add a new Checkpoints object to the context,
11837
- * from within a component. This is useful for applications where the set of
11838
- * Checkpoints objects is not known at the time of the first render of the root
11839
- * Provider.
11840
- *
11841
- * A Checkpoints object added to the Provider context in this way will be
11842
- * available to other components within the context (using the useCheckpoints
11843
- * hook and so on). If you use the same Id as an existing Checkpoints object
11844
- * registration, the new one will take priority over one provided by the
11845
- * `checkpointsById` prop.
11846
- *
11847
- * Note that other components that consume a Checkpoints object registered like
11848
- * this should defend against it being undefined at first. On the first render,
11849
- * the other component will likely not yet have completed the registration. In
11850
- * the example below, we use the null-safe `useCheckpoints('petCheckpoints')?`
11851
- * to do this.
11852
- * @param checkpointsId The Id of the Checkpoints object to be registered with
11853
- * the Provider.
11854
- * @param checkpoints The Checkpoints object to be registered.
11855
- * @example
11856
- * This example creates a Provider context. A child component registers a
11857
- * Checkpoints object into it which is then consumable by a peer child
11858
- * component.
11859
- *
11860
- * ```jsx
11861
- * import {
11862
- * Provider,
11863
- * useCheckpoints,
11864
- * useCreateCheckpoints,
11865
- * useCreateStore,
11866
- * useProvideCheckpoints,
11867
- * } from 'tinybase/ui-react';
11868
- * import {createCheckpoints, createStore} from 'tinybase';
11869
- * import React from 'react';
11870
- * import {createRoot} from 'react-dom/client';
11871
- *
11872
- * const App = () => (
11873
- * <Provider>
11874
- * <RegisterCheckpoints />
11875
- * <ConsumeCheckpoints />
11876
- * </Provider>
11877
- * );
11878
- * const RegisterCheckpoints = () => {
11879
- * const store = useCreateStore(() =>
11880
- * createStore().setCell('pets', 'fido', 'color', 'brown'),
11881
- * );
11882
- * const checkpoints = useCreateCheckpoints(store, createCheckpoints);
11883
- * useProvideCheckpoints('petCheckpoints', checkpoints);
11884
- * return null;
11885
- * };
11886
- * const ConsumeCheckpoints = () => (
11887
- * <span>
11888
- * {JSON.stringify(useCheckpoints('petCheckpoints')?.getCheckpointIds())}
11889
- * </span>
11890
- * );
11891
- *
11892
- * const app = document.createElement('div');
11893
- * const root = createRoot(app);
11894
- * root.render(<App />); // !act
11895
- * console.log(app.innerHTML);
11896
- * // -> '<span>[[],"0",[]]</span>'
11897
- * ```
11898
- * @category Checkpoints hooks
11899
- * @since v5.3.0
11900
11829
  */
11901
11830
  useCheckpointsOrCheckpointsById: (
11902
11831
  checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId<Schemas>,
@@ -11826,77 +11826,6 @@ export type WithSchemas<Schemas extends OptionalSchemas> = {
11826
11826
  * ```
11827
11827
  * @category Checkpoints hooks
11828
11828
  * @since v4.1.0
11829
- */
11830
- /**
11831
- * The useProvideCheckpoints hook is used to add a Checkpoints object by Id to a
11832
- * Provider component, but imperatively from a component within it.
11833
- *
11834
- * Normally you will register a Checkpoints object by Id in a context by using
11835
- * the `checkpointsById` prop of the top-level Provider component. This hook,
11836
- * however, lets you dynamically add a new Checkpoints object to the context,
11837
- * from within a component. This is useful for applications where the set of
11838
- * Checkpoints objects is not known at the time of the first render of the root
11839
- * Provider.
11840
- *
11841
- * A Checkpoints object added to the Provider context in this way will be
11842
- * available to other components within the context (using the useCheckpoints
11843
- * hook and so on). If you use the same Id as an existing Checkpoints object
11844
- * registration, the new one will take priority over one provided by the
11845
- * `checkpointsById` prop.
11846
- *
11847
- * Note that other components that consume a Checkpoints object registered like
11848
- * this should defend against it being undefined at first. On the first render,
11849
- * the other component will likely not yet have completed the registration. In
11850
- * the example below, we use the null-safe `useCheckpoints('petCheckpoints')?`
11851
- * to do this.
11852
- * @param checkpointsId The Id of the Checkpoints object to be registered with
11853
- * the Provider.
11854
- * @param checkpoints The Checkpoints object to be registered.
11855
- * @example
11856
- * This example creates a Provider context. A child component registers a
11857
- * Checkpoints object into it which is then consumable by a peer child
11858
- * component.
11859
- *
11860
- * ```jsx
11861
- * import {
11862
- * Provider,
11863
- * useCheckpoints,
11864
- * useCreateCheckpoints,
11865
- * useCreateStore,
11866
- * useProvideCheckpoints,
11867
- * } from 'tinybase/ui-react';
11868
- * import {createCheckpoints, createStore} from 'tinybase';
11869
- * import React from 'react';
11870
- * import {createRoot} from 'react-dom/client';
11871
- *
11872
- * const App = () => (
11873
- * <Provider>
11874
- * <RegisterCheckpoints />
11875
- * <ConsumeCheckpoints />
11876
- * </Provider>
11877
- * );
11878
- * const RegisterCheckpoints = () => {
11879
- * const store = useCreateStore(() =>
11880
- * createStore().setCell('pets', 'fido', 'color', 'brown'),
11881
- * );
11882
- * const checkpoints = useCreateCheckpoints(store, createCheckpoints);
11883
- * useProvideCheckpoints('petCheckpoints', checkpoints);
11884
- * return null;
11885
- * };
11886
- * const ConsumeCheckpoints = () => (
11887
- * <span>
11888
- * {JSON.stringify(useCheckpoints('petCheckpoints')?.getCheckpointIds())}
11889
- * </span>
11890
- * );
11891
- *
11892
- * const app = document.createElement('div');
11893
- * const root = createRoot(app);
11894
- * root.render(<App />); // !act
11895
- * console.log(app.innerHTML);
11896
- * // -> '<span>[[],"0",[]]</span>'
11897
- * ```
11898
- * @category Checkpoints hooks
11899
- * @since v5.3.0
11900
11829
  */
11901
11830
  useCheckpointsOrCheckpointsById: (
11902
11831
  checkpointsOrCheckpointsId?: CheckpointsOrCheckpointsId<Schemas>,
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("../ui-react/index.cjs");const l=e=>typeof e,n="",s=l(n),r=l(!0),a=l(0),o=l(l),i="type",u="default",d="Has",c="Ids",h="Table",m=h+"s",p=h+c,b="Row",g=b+"Count",v=b+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",x="value",S=e=>n+e,T=globalThis.window,V=Math,O=V.min,R=V.floor,q=isFinite,M=e=>null==e,P=(e,t,l)=>M(e)?null==l?void 0:l():t(e),N=e=>e==s||e==r,L=e=>l(e)==o,E=e=>Array.isArray(e),j=(e,t,l)=>e.slice(t,l),z=e=>e.length,$=e=>{throw Error(e)},{PureComponent:A,Fragment:F,createElement:J,useCallback:D,useLayoutEffect:B,useRef:Q,useState:H}=e,W=(e,...t)=>M(e)?{}:e(...t),G=(e,t)=>e.sort(t),K=(e,t)=>e.forEach(t),U=(e,t)=>e.map(t),X=e=>0==z(e),Y=(e,...t)=>e.push(...t),Z=e=>e.shift(),_=Object,ee=e=>_.getPrototypeOf(e),te=_.entries,le=_.isFrozen,ne=e=>!M(e)&&P(ee(e),(e=>e==_.prototype||M(ee(e))),(()=>!0)),se=_.keys,re=_.freeze,ae=(e=[])=>_.fromEntries(e),oe=(e,t)=>t in e,ie=(e,t)=>(delete e[t],e),ue=(e,t)=>U(te(e),(([e,l])=>t(l,e))),de=e=>ne(e)&&0==(e=>z(se(e)))(e),ce=(e,t,l,n=0)=>M(e)||!ne(e)||!n&&de(e)||le(e)?(null==l||l(),!1):(ue(e,((l,n)=>{t(l,n)||ie(e,n)})),!!n||!de(e)),he=JSON.stringify,me=JSON.parse,pe=e=>he(e,((e,t)=>t instanceof Map?_.fromEntries([...t]):t)),be="tinybaseInspector",ge="TinyBase Inspector",ve=["left","top","bottom","right","full"],fe="state",Ie="sort",ye="open",we="position",Ce=ye,ke="editable",xe=(...e)=>pe(e),Se=(e,t)=>U(G(e),t),Te=(e,l)=>[!!t.useCell(fe,e,ke,l),D((t=>{l.setCell(fe,e,ke,(e=>!e)),t.preventDefault()}),[l,e])],Ve="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",Oe='content:url("',Re=Oe+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",qe='</svg>")',Me=Oe+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",Pe=U([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,n])=>Re+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${n}' fill='white'/>`+qe)),Ne=Re+"<path d='M20 20l60 60M20 80l60-60' />"+qe,Le=Re+`<path d='${Ve}' />`+qe,Ee=Re+`<path d='${Ve}M20 20l60 60' />`+qe;var je=Object.defineProperty,ze=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,De=(e,t,l)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Be=(e,t)=>{for(var l in t||(t={}))Fe.call(t,l)&&De(e,l,t[l]);if(Ae)for(var l of Ae(t))Je.call(t,l)&&De(e,l,t[l]);return e},Qe=(e,t)=>ze(e,$e(t));const He="*::-webkit-scrollbar",We=((e,t="")=>e.join(t))(ue(Qe(Be(Qe(Be(Qe(Be({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[He]:"width:0.5rem;height:0.5rem;",[He+"-track"]:"background:#111",[He+"-thumb"]:"background:#999;border:1px solid #111",[He+"-thumb:hover"]:"background:#fff",[He+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+Me},ae(U(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ae(U(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":Me,"header>img:nth-of-type(6)":Ne}),ae(U(Pe,((e,t)=>[`header>img[data-id='${t}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":Le,"details[open]>summary img.done":Ee,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem",[`th,#${be} td`]:"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,t)=>e?`#${be} ${t}{${e}}`:""))),Ge=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1,s=t.useSetValueCallback(Ce,(()=>!0),[],e);return t.useValue(Ce,e)?null:J("img",{onClick:s,title:ge,"data-position":n})},Ke=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:a})=>{const o=!!t.useCell(fe,e,ye,a),i=t.useSetCellCallback(fe,e,ye,(e=>e[k].open),[],a);return J("details",{open:o,onToggle:i},J("summary",null,l,s?J("img",{onClick:s,className:n?"done":"edit"}):null),r)},Ue=e=>{const t=l(e);return N(t)||t==a&&q(e)?t:void 0},Xe=(e,t,l,n,s)=>M(s)?e.delCell(t,l,n,!0):e.setCell(t,l,n,s),Ye=(e,t,l)=>M(l)?e.delValue(t):e.setValue(t,l),Ze=(e,t,l,n)=>e==s?t:e==a?l:n;var _e=Object.defineProperty,et=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,lt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,rt=(e,t,l)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,at=(e,t)=>{for(var l in t||(t={}))nt.call(t,l)&&rt(e,l,t[l]);if(lt)for(var l of lt(t))st.call(t,l)&&rt(e,l,t[l]);return e},ot=(e,t)=>et(e,tt(t)),it=(e,t)=>{var l={};for(var n in e)nt.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&lt)for(var n of lt(e))t.indexOf(n)<0&&st.call(e,n)&&(l[n]=e[n]);return l};const{useCallback:ut,useMemo:dt,useState:ct}=e,ht="editable",mt=(e,l)=>U(t.useTableCellIds(e,l),(t=>e+"."+t)),pt=(e,t,l)=>{const n=ut(e,t);return l?n:void 0},bt=(...e)=>dt((()=>e),e),gt=(e,t)=>dt((()=>({store:e,tableId:t})),[e,t]),vt=(e,t)=>dt((()=>({queries:e,queryId:t})),[e,t]),ft=(e,t=!1,l,n=0,s,r,a,o)=>{const[[i,u,d],c]=ct([e,t,n]),h=ut((e=>{c(e),null==o||o(e)}),[o]),m=pt((e=>h([e,e==i&&!u,d])),[h,i,u,d],l),p=ut((e=>h([i,u,e])),[h,i,u]),b=!0===a?Mt:a;return[[i,u,d],m,dt((()=>!1===a?null:J(b,{offset:d,limit:s,total:r,onChange:p})),[a,b,d,s,r,p])]},It=(e,t,n)=>dt((()=>{const r=null!=t?t:e;return a=E(r)?ae(U(r,(e=>[e,e]))):r,o=(e,t)=>at(at({},{label:t,component:n}),l(e)==s?{label:e}:e),ae(ue(a,((e,t)=>[t,o(e,t)])));var a,o}),[t,n,e]),yt=({className:e,headerRow:t,idColumn:l,params:[n,s,r,a,o,i]})=>J("table",{className:e},i?J("caption",null,i):null,!1===t?null:J("thead",null,J("tr",null,!1===l?null:J(wt,{sort:null!=a?a:[],label:"Id",onClick:o}),ue(n,(({label:e},t)=>J(wt,{key:t,cellId:t,label:e,sort:null!=a?a:[],onClick:o}))))),J("tbody",null,U(r,(e=>J("tr",{key:e},!1===l?null:J("th",null,e),ue(n,(({component:t,getComponentProps:l},n)=>J("td",{key:n},J(t,ot(at(at({},W(l,e,n)),s),{rowId:e,cellId:n})))))))))),wt=({cellId:e,sort:[t,l],label:s=(null!=e?e:n),onClick:r})=>J("th",{onClick:pt((()=>null==r?void 0:r(e)),[r,e],r),className:M(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},M(l)||t!=e?null:(l?"↓":"↑")+" ",s),Ct=({localRowId:l,params:[n,s,r,a,o,i,u]})=>{const d=t.useRemoteRowId(o,l,i);return J("tr",null,!1===n?null:J(e.Fragment,null,J("th",null,l),J("th",null,d)),ue(s,(({component:e,getComponentProps:t},n)=>{const[s,o]=n.split(".",2),i=s===r?l:s===a?d:null;return M(i)?null:J("td",{key:n},J(e,ot(at({},W(t,i,o)),{store:u,tableId:s,rowId:i,cellId:o})))})))},kt=({thing:e,onThingChange:t,className:l,hasSchema:n,showType:o=!0})=>{const[i,u]=ct(),[d,c]=ct(),[h,m]=ct(),[p,b]=ct(),[g,v]=ct();d!==e&&(u(Ue(e)),c(e),m(e+""),b(Number(e)||0),v(!!e));const f=ut(((e,l)=>{l(e),c(e),t(e)}),[t]),I=ut((()=>{if(!(null==n?void 0:n())){const e=Ze(i,a,r,s),l=Ze(e,h,p,g);u(e),c(l),t(l)}}),[n,t,h,p,g,i]);return J("div",{className:l},o?J("button",{className:i,onClick:I},i):null,Ze(i,J("input",{key:i,value:h,onChange:ut((e=>f(e[k][x]+"",m)),[f])}),J("input",{key:i,type:"number",value:p,onChange:ut((e=>f(Number(e[k][x]||0),b)),[f])}),J("input",{key:i,type:"checkbox",checked:g,onChange:ut((e=>f(!!e[k].checked,v)),[f])})))},xt=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:a,limit:o,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,p=it(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[b,g,v]=ft(s,r,d,a,o,t.useRowCount(n,i),c,h);return J(yt,ot(at({},p),{params:bt(It(t.useTableCellIds(n,i),m,u?Rt:t.CellView),gt(i,n),t.useSortedRowIds(n,...b,o,i),b,g,v)}))},St=({store:e,editable:l=!1,valueComponent:n=(l?qt:t.ValueView),getValueComponentProps:s,className:r,headerRow:a,idColumn:o})=>J("table",{className:r},!1===a?null:J("thead",null,J("tr",null,!1===o?null:J("th",null,"Id"),J("th",null,y))),J("tbody",null,U(t.useValueIds(e),(t=>J("tr",{key:t},!1===o?null:J("th",null,t),J("td",null,J(n,ot(at({},W(s,t)),{valueId:t,store:e})))))))),Tt=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:a,customCells:o}=l,i=it(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(t.useIndexesOrIndexesById(r),n);return J(yt,ot(at({},i),{params:bt(It(t.useTableCellIds(c,d),o,a?Rt:t.CellView),gt(d,c),t.useSliceRowIds(n,s,u))}))},Vt=({relationshipId:l,relationships:n,editable:s,customCells:r,className:a,headerRow:o,idColumn:i=!0})=>{const[u,d,c,h]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(t.useRelationshipsOrRelationshipsById(n),l),m=It([...mt(c,d),...mt(h,d)],r,s?Rt:t.CellView),p=bt(i,m,c,h,l,u,d);return J("table",{className:a},!1===o?null:J("thead",null,J("tr",null,!1===i?null:J(e.Fragment,null,J("th",null,c,".Id"),J("th",null,h,".Id")),ue(m,(({label:e},t)=>J("th",{key:t},e))))),J("tbody",null,U(t.useRowIds(c,d),(e=>J(Ct,{key:e,localRowId:e,params:p})))))},Ot=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:a,limit:o,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=it(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[p,b,g]=ft(s,r,u,a,o,t.useResultRowCount(n,i),d,h);return J(yt,ot(at({},m),{params:bt(It(t.useResultTableCellIds(n,i),c,t.ResultCellView),vt(i,n),t.useResultSortedRowIds(n,...p,o,i),p,b,g)}))},Rt=({tableId:e,rowId:l,cellId:n,store:s,className:r,showType:a})=>{var o;return J(kt,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:ht+f,showType:a,hasSchema:null==(o=t.useStoreOrStoreById(s))?void 0:o.hasTablesSchema})},qt=({valueId:e,store:l,className:n,showType:s})=>{var r;return J(kt,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:ht+y,showType:s,hasSchema:null==(r=t.useStoreOrStoreById(l))?void 0:r.hasValuesSchema})},Mt=({onChange:t,total:l,offset:n=0,limit:s=l,singular:r="row",plural:a=r+"s"})=>{(n>l||n<0)&&(n=0,t(0));const o=pt((()=>t(n-s)),[t,n,s],n>0),i=pt((()=>t(n+s)),[t,n,s],n+s<l);return J(e.Fragment,null,l>s&&J(e.Fragment,null,J("button",{className:"previous",disabled:0==n,onClick:o},"←"),J("button",{className:"next",disabled:n+s>=l,onClick:i},"→"),n+1," to ",O(l,n+s)," of "),l," ",1!=l?a:r)},Pt=({indexes:e,indexesId:l,indexId:n,s:s})=>J(Ke,{uniqueId:xe("i",l,n),summary:"Index: "+n,s:s},U(t.useSliceIds(n,e),(t=>J(Nt,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Nt=({indexes:e,indexesId:t,indexId:l,sliceId:n,s:s})=>{const r=xe("i",t,l,n),[a,o]=Te(r,s);return J(Ke,{uniqueId:r,summary:"Slice: "+n,editable:a,handleEditable:o,s:s},J(Tt,{sliceId:n,indexId:l,indexes:e,editable:a}))},Lt=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return M(n)?null:J(Ke,{uniqueId:xe("i",e),summary:"Indexes: "+(null!=e?e:u),s:l},X(s)?"No indexes defined":Se(s,(t=>J(Pt,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Et=({metrics:e,metricId:l})=>J("tr",null,J("th",null,l),J("td",null,null==e?void 0:e.getTableId(l)),J("td",null,t.useMetric(l,e))),jt=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return M(n)?null:J(Ke,{uniqueId:xe("m",e),summary:"Metrics: "+(null!=e?e:u),s:l},X(s)?"No metrics defined":J("table",null,J("thead",null,J("th",null,"Metric Id"),J("th",null,"Table Id"),J("th",null,"Metric")),J("tbody",null,U(s,(e=>J(Et,{metrics:n,metricId:e,key:e}))))))},zt=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const a=xe("q",l,n),[o,i,u]=me(null!=(r=t.useCell(fe,a,Ie,s))?r:"[]"),d=t.useSetCellCallback(fe,a,Ie,pe,[],s);return J(Ke,{uniqueId:a,summary:"Query: "+n,s:s},J(Ot,{queryId:n,queries:e,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},$t=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return M(n)?null:J(Ke,{uniqueId:xe("q",e),summary:"Queries: "+(null!=e?e:u),s:l},X(s)?"No queries defined":Se(s,(t=>J(zt,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},At=({relationships:e,relationshipsId:t,relationshipId:l,s:n})=>{const s=xe("r",t,l),[r,a]=Te(s,n);return J(Ke,{uniqueId:s,summary:"Relationship: "+l,editable:r,handleEditable:a,s:n},J(Vt,{relationshipId:l,relationships:e,editable:r}))},Ft=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return M(n)?null:J(Ke,{uniqueId:xe("r",e),summary:"Relationships: "+(null!=e?e:u),s:l},X(s)?"No relationships defined":Se(s,(t=>J(At,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},Jt=({tableId:e,store:l,storeId:n,s:s})=>{var r;const a=xe("t",n,e),[o,i,u]=me(null!=(r=t.useCell(fe,a,Ie,s))?r:"[]"),d=t.useSetCellCallback(fe,a,Ie,pe,[],s),[c,m]=Te(a,s);return J(Ke,{uniqueId:a,summary:h+": "+e,editable:c,handleEditable:m,s:s},J(xt,{tableId:e,store:l,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Dt=({store:e,storeId:l,s:n})=>{const s=xe("v",l),[r,a]=Te(s,n);return X(t.useValueIds(e))?null:J(Ke,{uniqueId:s,summary:w,editable:r,handleEditable:a,s:n},J(St,{store:e,editable:r}))},Bt=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return M(n)?null:J(Ke,{uniqueId:xe("s",e),summary:(n.isMergeable()?"Mergeable":"")+"Store: "+(null!=e?e:u),s:l},J(Dt,{storeId:e,store:n,s:l}),Se(s,(t=>J(Jt,{store:n,storeId:e,tableId:t,s:l,key:t}))))},Qt=({s:e})=>{const l=Q(null),n=Q(0),[s,r]=H(!1),{scrollLeft:a,scrollTop:o}=t.useValues(e);B((()=>{const e=l.current;if(e&&!s){const t=new MutationObserver((()=>{e.scrollWidth>=R(a)+e.clientWidth&&e.scrollHeight>=R(o)+e.clientHeight&&e.scrollTo(a,o)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[s,a,o]);const i=D((t=>{const{scrollLeft:l,scrollTop:s}=t[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:l,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),p=t.useIndexesIds(),b=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return M(u)&&X(d)&&M(c)&&X(h)&&M(m)&&X(p)&&M(b)&&X(g)&&M(v)&&X(f)?J("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):J("article",{ref:l,onScroll:i},J(Bt,{s:e}),U(d,(t=>J(Bt,{storeId:t,s:e,key:t}))),J(jt,{s:e}),U(h,(t=>J(jt,{metricsId:t,s:e,key:t}))),J(Lt,{s:e}),U(p,(t=>J(Lt,{indexesId:t,s:e,key:t}))),J(Ft,{s:e}),U(g,(t=>J(Ft,{relationshipsId:t,s:e,key:t}))),J($t,{s:e}),U(f,(t=>J($t,{queriesId:t,s:e,key:t}))))};var Ht=Object.defineProperty;class Wt extends A{constructor(e){var t,l,n;super(e),n=(e,t)=>console.error(e,t.componentStack),(l="componentDidCatch")in(t=this)?Ht(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,this.state={e:0}}static getDerivedStateFromError(){return{e:1}}render(){return this.state.e?J("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const Gt=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1,s=t.useSetValueCallback(Ce,(()=>!1),[],e),r=t.useSetValueCallback(we,(e=>Number(e[k].dataset.id)),[],e);return J("header",null,J("img",{title:ge}),J("span",null,ge),U(ve,((e,t)=>t==n?null:J("img",{onClick:r,"data-id":t,title:"Dock to "+e,key:t}))),J("img",{onClick:s,title:"Close"}))},Kt=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1;return t.useValue(Ce,e)?J("main",{"data-position":n},J(Gt,{s:e}),J(Wt,null,J(Qt,{s:e}))):null},Ut=e=>t=>{return l=(t,l)=>t+e(l),ll(t).reduce(l,0);var l},Xt=e=>{var t;return null!=(t=null==e?void 0:e.size)?t:0},Yt=Ut(Xt),Zt=Ut(Yt),_t=Ut(Zt),el=(e,t)=>{var l;return null!=(l=null==e?void 0:e.has(t))&&l},tl=e=>M(e)||0==Xt(e),ll=e=>{var t;return[...null!=(t=null==e?void 0:e.values())?t:[]]},nl=e=>e.clear(),sl=(e,t)=>null==e?void 0:e.forEach(t),rl=(e,t)=>null==e?void 0:e.delete(t),al=e=>new Map(e),ol=e=>{var t;return[...null!=(t=null==e?void 0:e.keys())?t:[]]},il=(e,t)=>null==e?void 0:e.get(t),ul=(e,t)=>sl(e,((e,l)=>t(l,e))),dl=(e,t,l)=>M(l)?(rl(e,t),e):null==e?void 0:e.set(t,l),cl=(e,t,l,n)=>(el(e,t)?null==n||n(il(e,t)):dl(e,t,l()),il(e,t)),hl=(e,t,l,n=dl)=>(ue(t,((t,n)=>l(e,n,t))),ul(e,(l=>oe(t,l)?0:n(e,l))),e),ml=(e,t,l,n)=>{const s={};return sl(e,((e,r)=>{if(!(null==l?void 0:l(e,r))){const l=t?t(e,r):e;(null==n?void 0:n(l))||(s[r]=l)}})),s},pl=(e,t,l)=>ml(e,(e=>ml(e,t,l)),tl,de),bl=(e,t,l)=>ml(e,(e=>pl(e,t,l)),tl,de),gl=(e,t)=>{const l=al();return sl(e,((e,n)=>{var s;return l.set(n,null!=(s=null==t?void 0:t(e))?s:e)})),l},vl=e=>gl(e,gl),fl=e=>gl(e,vl),Il=(e,t,l,n,s=0)=>P((l?cl:il)(e,t[s],s>z(t)-2?l:al),(r=>{if(s>z(t)-2)return(null==n?void 0:n(r))&&dl(e,t[s]),r;const a=Il(r,t,l,n,s+1);return tl(r)&&dl(e,t[s]),a}));var yl=Object.defineProperty,wl=Object.getOwnPropertySymbols,Cl=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,xl=(e,t,l)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Sl=(e,t,l)=>new Promise(((n,s)=>{var r=e=>{try{o(l.next(e))}catch(e){s(e)}},a=e=>{try{o(l.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((l=l.apply(e,t)).next())}));const Tl=al(),Vl=al();var Ol=(e,t,l)=>new Promise(((n,s)=>{var r=e=>{try{o(l.next(e))}catch(e){s(e)}},a=e=>{try{o(l.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((l=l.apply(e,t)).next())}));const Rl="storage",ql=e=>new Set(E(e)||M(e)?e:[e]),Ml=(e,t)=>null==e?void 0:e.add(t),Pl=/^\d+$/,Nl=()=>{const e=[];let t=0;return[l=>{var s;return null!=(s=l?Z(e):null)?s:n+t++},t=>{Pl.test(t)&&z(e)<1e3&&Y(e,t)}]},Ll=e=>[e,e],El=(e,t=Yt)=>t(e[0])+t(e[1]),jl=()=>[al(),al()],zl=e=>[...e],$l=([e,t])=>e===t;al(U("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(n),((e,t)=>[e,t])));const Al=(e,t,l)=>dl(e,t,il(e,t)==-l?void 0:l),Fl=()=>{let e,t,l=!1,s=!1,r=0,o=[];const c=al(),k=al(),x=al(),T=al(),V=al(),O=al(),R=al(),q=al(),$=al(),A=al(),F=al(),J=al(),D=al(),B=al(),Q=ql(),H=al(),W=al(),X=al(),Z=al(),_=jl(),ee=jl(),te=jl(),le=jl(),ne=jl(),se=jl(),ae=jl(),he=jl(),be=jl(),ge=jl(),ve=jl(),fe=jl(),Ie=jl(),ye=jl(),we=jl(),Ce=jl(),ke=jl(),xe=jl(),Se=jl(),Te=jl(),Ve=jl(),Oe=jl(),Re=al(),qe=jl(),[Me,Pe,Ne,Le]=(()=>{let e;const[t,l]=Nl(),s=al();return[(l,r,a,o=[],i=()=>[])=>{null!=e||(e=Vl);const u=t(1);return dl(s,u,[l,r,a,o,i]),Ml(Il(r,null!=a?a:[n],ql),u),u},(t,l,...r)=>K(((e,t=[n])=>{const l=[],s=(e,n)=>n==z(t)?Y(l,e):null===t[n]?sl(e,(e=>s(e,n+1))):K([t[n],null],(t=>s(il(e,t),n+1)));return s(e,0),l})(t,l),(t=>sl(t,(t=>il(s,t)[0](e,...null!=l?l:[],...r))))),e=>P(il(s,e),(([,t,r])=>(Il(t,null!=r?r:[n],void 0,(t=>(rl(t,e),tl(t)?1:0))),dl(s,e),l(e),r))),t=>P(il(s,t),(([t,,l=[],n,s])=>{const r=(...a)=>{var o,i;const u=z(a);u==z(l)?t(e,...a,...s(a)):M(l[u])?K(null!=(i=null==(o=n[u])?void 0:o.call(n,...a))?i:[],(e=>r(...a,e))):r(...a,l[u])};r()}))]})(),Ee=e=>{if(!ce(e,((e,t)=>[i,u].includes(t))))return!1;const t=e[i];return!(!N(t)&&t!=a||(Ue(e[u])!=t&&ie(e,u),0))},je=E,ze=(t,l)=>(!e||el(F,l)||gt(l))&&ce(t,((e,t)=>$e(l,t,e)),(()=>gt(l))),$e=(e,t,l,n)=>ce(n?l:De(l,e,t),((n,s)=>P(Ae(e,t,s,n),(e=>(l[s]=e,!0)),(()=>!1))),(()=>gt(e,t))),Ae=(t,l,n,s)=>e?P(il(il(F,t),n),(e=>Ue(s)!=e[i]?gt(t,l,n,s,e[u]):s),(()=>gt(t,l,n,s))):M(Ue(s))?gt(t,l,n,s):s,Fe=(e,t)=>ce(t?e:Be(e),((t,l)=>P(Je(l,t),(t=>(e[l]=t,!0)),(()=>!1))),(()=>vt())),Je=(e,l)=>t?P(il(D,e),(t=>Ue(l)!=t[i]?vt(e,l,t[u]):l),(()=>vt(e,l))):M(Ue(l))?vt(e,l):l,De=(e,t,l)=>(P(il(J,t),(([n,s])=>{sl(n,((t,l)=>{oe(e,l)||(e[l]=t)})),sl(s,(n=>{oe(e,n)||gt(t,l,n)}))})),e),Be=e=>(t&&(sl(B,((t,l)=>{oe(e,l)||(e[l]=t)})),sl(Q,(t=>{oe(e,t)||vt(t)}))),e),Qe=e=>hl(F,e,((e,t,l)=>{const n=al(),s=ql();hl(cl(F,t,al),l,((e,t,l)=>{dl(e,t,l),P(l[u],(e=>dl(n,t,e)),(()=>Ml(s,t)))})),dl(J,t,[n,s])}),((e,t)=>{dl(F,t),dl(J,t)})),He=e=>hl(D,e,((e,t,l)=>{dl(D,t,l),P(l[u],(e=>dl(B,t,e)),(()=>Ml(Q,t)))}),((e,t)=>{dl(D,t),dl(B,t),rl(Q,t)})),We=e=>de(e)?Ut():Qt(e),Ge=e=>hl(X,e,((e,t,l)=>Ke(t,l)),((e,t)=>at(t))),Ke=(e,t)=>hl(cl(X,e,(()=>(dt(e,1),dl(H,e,Nl()),dl(W,e,al()),al()))),t,((t,l,n)=>Ze(e,t,l,n)),((t,l)=>ot(e,t,l))),Ze=(e,t,l,n,s)=>hl(cl(t,l,(()=>(ct(e,l,1),al()))),n,((t,n,s)=>_e(e,l,t,n,s)),((n,r)=>it(e,t,l,n,r,s))),_e=(e,t,l,n,s)=>{el(l,n)||ht(e,t,n,1);const r=il(l,n);s!==r&&(mt(e,t,n,r,s),dl(l,n,s))},et=(e,t,l,n,s)=>P(il(t,l),(t=>_e(e,l,t,n,s)),(()=>Ze(e,t,l,De({[n]:s},e,l)))),tt=e=>de(e)?wl():Ht(e),lt=e=>hl(Z,e,((e,t,l)=>nt(t,l)),((e,t)=>ut(t))),nt=(e,t)=>{el(Z,e)||pt(e,1);const l=il(Z,e);t!==l&&(bt(e,l,t),dl(Z,e,t))},st=(e,t)=>{const[l]=il(H,e),n=l(t);return el(il(X,e),n)?st(e,t):n},rt=e=>{var t;return null!=(t=il(X,e))?t:Ke(e,{})},at=e=>Ke(e,{}),ot=(e,t,l)=>{const[,n]=il(H,e);n(l),Ze(e,t,l,{},!0)},it=(e,t,l,n,s,r)=>{var a;const o=il(null==(a=il(J,e))?void 0:a[0],s);if(!M(o)&&!r)return _e(e,l,n,s,o);const i=t=>{mt(e,l,t,il(n,t)),ht(e,l,t,-1),dl(n,t)};M(o)?i(s):ul(n,i),tl(n)&&(ct(e,l,-1),tl(dl(t,l))&&(dt(e,-1),dl(X,e),dl(H,e),dl(W,e)))},ut=e=>{const t=il(B,e);if(!M(t))return nt(e,t);bt(e,il(Z,e)),pt(e,-1),dl(Z,e)},dt=(e,t)=>Al(c,e,t),ct=(e,t,l)=>Al(cl(T,e,al),t,l)&&dl(x,e,cl(x,e,(()=>0))+l),ht=(e,t,l,n)=>{var s;const r=il(W,e),a=null!=(s=il(r,l))?s:0;(0==a&&1==n||1==a&&-1==n)&&Al(cl(k,e,al),l,n),dl(r,l,a!=-n?a+n:null),Al(cl(cl(V,e,al),t,al),l,n)},mt=(e,t,l,n,s)=>{var r;cl(cl(cl(O,e,al),t,al),l,(()=>[n,0]))[1]=s,null==(r=o[3])||r.call(o,e,t,l,s)},pt=(e,t)=>Al(R,e,t),bt=(e,t,l)=>{var n;cl(q,e,(()=>[t,0]))[1]=l,null==(n=o[4])||n.call(o,e,l)},gt=(e,t,l,n,s)=>(Y(cl(cl(cl($,e,al),t,al),l,(()=>[])),n),s),vt=(e,t,l)=>(Y(cl(A,e,(()=>[])),t),l),ft=(e,t,l)=>P(il(il(il(O,e),t),l),(([e,t])=>[!0,e,t]),(()=>[!1,...Ll(Nt(e,t,l))])),It=e=>P(il(q,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Ll(jt(e))])),yt=e=>tl($)||tl(Ce[e])?0:sl(e?fl($):$,((t,l)=>sl(t,((t,n)=>sl(t,((t,s)=>Pe(Ce[e],[l,n,s],t))))))),wt=e=>tl(A)||tl(ke[e])?0:sl(e?gl(A):A,((t,l)=>Pe(ke[e],[l],t))),Ct=(e,t,l,n)=>{if(!tl(e))return Pe(t,n,(()=>ml(e))),ul(e,((e,t)=>Pe(l,[...null!=n?n:[],e],1==t))),1},kt=e=>{const t=zt();t!=l&&Pe(_[e],void 0,t);const n=tl(ge[e]),s=tl(Ie[e])&&tl(ye[e])&&tl(be[e])&&tl(ve[e])&&tl(se[e])&&tl(ae[e])&&tl(he[e])&&n&&tl(te[e])&&tl(le[e]),r=tl(we[e])&&tl(fe[e])&&tl(ne[e])&&tl(ee[e]);if(!s||!r){const t=e?[gl(c),vl(k),gl(x),vl(T),fl(V),fl(O)]:[c,k,x,T,V,O];if(!s){Ct(t[0],te[e],le[e]),sl(t[1],((t,l)=>Ct(t,se[e],ae[e],[l]))),sl(t[2],((t,l)=>{0!=t&&Pe(he[e],[l],Rt(l))}));const l=ql();sl(t[3],((t,s)=>{Ct(t,be[e],ve[e],[s])&&!n&&(Pe(ge[e],[s,null]),Ml(l,s))})),n||sl(t[5],((t,n)=>{if(!el(l,n)){const l=ql();sl(t,(e=>sl(e,(([t,n],s)=>n!==t?Ml(l,s):rl(e,s))))),sl(l,(t=>Pe(ge[e],[n,t])))}})),sl(t[4],((t,l)=>sl(t,((t,n)=>Ct(t,Ie[e],ye[e],[l,n])))))}if(!r){let l;sl(t[5],((t,n)=>{let s;sl(t,((t,r)=>{let a;sl(t,(([t,o],i)=>{o!==t&&(Pe(we[e],[n,r,i],o,t,ft),l=s=a=1)})),a&&Pe(fe[e],[n,r],ft)})),s&&Pe(ne[e],[n],ft)})),l&&Pe(ee[e],void 0,ft)}}},xt=e=>{const t=Dt();t!=s&&Pe(xe[e],void 0,t);const l=tl(Te[e])&&tl(Ve[e]),n=tl(Oe[e])&&tl(Se[e]);if(!l||!n){const t=e?[gl(R),gl(q)]:[R,q];if(l||Ct(t[0],Te[e],Ve[e]),!n){let l;sl(t[1],(([t,n],s)=>{n!==t&&(Pe(Oe[e],[s],n,t,It),l=1)})),l&&Pe(Se[e],void 0,It)}}},St=(e,...t)=>(xl((()=>e(...U(t,S)))),Vl),Tt=()=>bl(X),Vt=()=>ol(X),Ot=e=>ol(il(W,S(e))),Rt=e=>Xt(il(X,S(e))),qt=e=>ol(il(X,S(e))),Mt=(e,t,l,n=0,s)=>{return U(j(G((r=il(X,S(e)),a=(e,l)=>[M(t)?l:il(e,S(t)),l],U([...null!=(o=null==r?void 0:r.entries())?o:[]],(([e,t])=>a(t,e)))),(([e],[t])=>{return((null!=(n=e)?n:0)<(null!=(s=t)?s:0)?-1:1)*(l?-1:1);var n,s})),n,M(s)?s:n+s),(([,e])=>e));var r,a,o},Pt=(e,t)=>ol(il(il(X,S(e)),S(t))),Nt=(e,t,l)=>il(il(il(X,S(e)),S(t)),S(l)),Lt=()=>ml(Z),Et=()=>ol(Z),jt=e=>il(Z,S(e)),zt=()=>!tl(X),$t=e=>el(X,S(e)),At=(e,t)=>el(il(W,S(e)),S(t)),Ft=(e,t)=>el(il(X,S(e)),S(t)),Jt=(e,t,l)=>el(il(il(X,S(e)),S(t)),S(l)),Dt=()=>!tl(Z),Bt=e=>el(Z,S(e)),Qt=e=>St((()=>(e=>ce(e,ze,gt))(e)?Ge(e):0)),Ht=e=>St((()=>Fe(e)?lt(e):0)),Wt=e=>{try{We(me(e))}catch(e){}return Vl},Gt=t=>St((()=>{if((e=ce(t,(e=>ce(e,Ee))))&&(Qe(t),!tl(X))){const e=Tt();Ut(),Qt(e)}})),Kt=e=>St((()=>{if(t=(e=>ce(e,Ee))(e)){const l=Lt();kl(),wl(),t=!0,He(e),Ht(l)}})),Ut=()=>St((()=>Ge({}))),ll=e=>St((e=>el(X,e)?at(e):0),e),yl=(e,t)=>St(((e,t)=>P(il(X,e),(l=>el(l,t)?ot(e,l,t):0))),e,t),wl=()=>St((()=>lt({}))),Cl=()=>St((()=>{Qe({}),e=!1})),kl=()=>St((()=>{He({}),t=!1})),xl=(e,t)=>{if(-1!=r){Sl();const l=e();return Tl(t),l}},Sl=()=>{var e;return-1!=r&&r++,1==r&&(null==(e=o[0])||e.call(o),Pe(Re)),Vl},Tl=e=>{var t,n;return r>0&&(r--,0==r&&(r=1,yt(1),tl(O)||kt(1),wt(1),tl(q)||xt(1),(null==e?void 0:e(Vl))&&(sl(O,((e,t)=>sl(e,((e,l)=>sl(e,(([e],n)=>Xe(Vl,t,l,n,e))))))),nl(O),sl(q,(([e],t)=>Ye(Vl,t,e))),nl(q)),Pe(qe[0],void 0),r=-1,yt(0),tl(O)||kt(0),wt(0),tl(q)||xt(0),null==(t=o[1])||t.call(o),Pe(qe[1],void 0),null==(n=o[2])||n.call(o),r=0,l=zt(),s=Dt(),K([c,k,x,T,V,O,$,R,q,A],nl))),Vl},Vl={getContent:()=>[Tt(),Lt()],getTables:Tt,getTableIds:Vt,getTable:e=>pl(il(X,S(e))),getTableCellIds:Ot,getRowCount:Rt,getRowIds:qt,getSortedRowIds:Mt,getRow:(e,t)=>ml(il(il(X,S(e)),S(t))),getCellIds:Pt,getCell:Nt,getValues:Lt,getValueIds:Et,getValue:jt,hasTables:zt,hasTable:$t,hasTableCell:At,hasRow:Ft,hasCell:Jt,hasValues:Dt,hasValue:Bt,getTablesJson:()=>pe(X),getValuesJson:()=>pe(Z),getJson:()=>pe([X,Z]),getTablesSchemaJson:()=>pe(F),getValuesSchemaJson:()=>pe(D),getSchemaJson:()=>pe([F,D]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>St((()=>je(e)?(([e,t])=>{(de(e)?Ut:Qt)(e),(de(t)?wl:Ht)(t)})(e):0)),setTables:Qt,setTable:(e,t)=>St((e=>ze(t,e)?Ke(e,t):0),e),setRow:(e,t,l)=>St(((e,t)=>$e(e,t,l)?Ze(e,rt(e),t,l):0),e,t),addRow:(e,t,l=!0)=>xl((()=>{let n;return $e(e,n,t)&&(e=S(e),Ze(e,rt(e),n=st(e,l?1:0),t)),n})),setPartialRow:(e,t,l)=>St(((e,t)=>{if($e(e,t,l,1)){const n=rt(e);ue(l,((l,s)=>et(e,n,t,s,l)))}}),e,t),setCell:(e,t,l,n)=>St(((e,t,l)=>P(Ae(e,t,l,L(n)?n(Nt(e,t,l)):n),(n=>et(e,rt(e),t,l,n)))),e,t,l),setValues:Ht,setPartialValues:e=>St((()=>Fe(e,1)?ue(e,((e,t)=>nt(t,e))):0)),setValue:(e,t)=>St((e=>P(Je(e,L(t)?t(jt(e)):t),(t=>nt(e,t)))),e),applyChanges:e=>St((()=>{ue(e[0],((e,t)=>M(e)?ll(t):ue(e,((e,l)=>M(e)?yl(t,l):ue(e,((e,n)=>Xe(Vl,t,l,n,e))))))),ue(e[1],((e,t)=>Ye(Vl,t,e)))})),setTablesJson:Wt,setValuesJson:e=>{try{tt(me(e))}catch(e){}return Vl},setJson:e=>St((()=>{try{const[t,l]=me(e);We(t),tt(l)}catch(t){Wt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>St((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:ll,delRow:yl,delCell:(e,t,l,n)=>St(((e,t,l)=>P(il(X,e),(s=>P(il(s,t),(r=>el(r,l)?it(e,s,t,r,l,n):0))))),e,t,l),delValues:wl,delValue:e=>St((e=>el(Z,e)?ut(e):0),e),delTablesSchema:Cl,delValuesSchema:kl,delSchema:()=>St((()=>{Cl(),kl()})),transaction:xl,startTransaction:Sl,getTransactionChanges:()=>[ml(O,((e,t)=>-1===il(c,t)?void 0:ml(e,((e,l)=>-1===il(il(T,t),l)?void 0:ml(e,(([,e])=>e),(e=>$l(e)))),tl,de)),tl,de),ml(q,(([,e])=>e),(e=>$l(e))),1],getTransactionLog:()=>[!tl(O),!tl(q),bl(O,zl,$l),bl($),ml(q,zl,$l),ml(A),ml(c),pl(T),bl(V),ml(R)],finishTransaction:Tl,forEachTable:e=>sl(X,((t,l)=>e(l,(e=>sl(t,((t,l)=>e(l,(e=>ul(t,e))))))))),forEachTableCell:(e,t)=>ul(il(W,S(e)),t),forEachRow:(e,t)=>sl(il(X,S(e)),((e,l)=>t(l,(t=>ul(e,t))))),forEachCell:(e,t,l)=>ul(il(il(X,S(e)),S(t)),l),forEachValue:e=>ul(Z,e),addSortedRowIdsListener:(e,t,l,n,s,r,a)=>{let o=Mt(e,t,l,n,s);return Me((()=>{const a=Mt(e,t,l,n,s);var i,u,d;u=o,z(i=a)===z(u)&&(d=(e,t)=>u[t]===e,i.every(d))||(o=a,r(Vl,e,t,l,n,s,o))}),ge[a?1:0],[e,t],[Vt])},addStartTransactionListener:e=>Me(e,Re),addWillFinishTransactionListener:e=>Me(e,qe[0]),addDidFinishTransactionListener:e=>Me(e,qe[1]),callListener:e=>(Le(e),Vl),delListener:e=>(Ne(e),Vl),getListenerStats:()=>({hasTables:El(_),tables:El(ee),tableIds:El(te),hasTable:El(le),table:El(ne),tableCellIds:El(se),hasTableCell:El(ae,Zt),rowCount:El(he),rowIds:El(be),sortedRowIds:El(ge),hasRow:El(ve,Zt),row:El(fe,Zt),cellIds:El(Ie,Zt),hasCell:El(ye,_t),cell:El(we,_t),invalidCell:El(Ce,_t),hasValues:El(xe),values:El(Se),valueIds:El(Te),hasValue:El(Ve),value:El(Oe),invalidValue:El(ke),transaction:Yt(Re)+El(qe)}),isMergeable:()=>!1,createStore:Fl,addListener:Me,callListeners:Pe,setInternalListeners:(e,t,l,n,s)=>o=[e,t,l,n,s]};return ue({[d+m]:[0,_,[],()=>[zt()]],[m]:[0,ee],[p]:[0,te],[d+h]:[1,le,[Vt],e=>[$t(...e)]],[h]:[1,ne,[Vt]],[h+I]:[1,se,[Vt]],[d+h+f]:[2,ae,[Vt,Ot],e=>[At(...e)]],[g]:[1,he,[Vt]],[v]:[1,be,[Vt]],[d+b]:[2,ve,[Vt,qt],e=>[Ft(...e)]],[b]:[2,fe,[Vt,qt]],[I]:[2,Ie,[Vt,qt]],[d+f]:[3,ye,[Vt,qt,Pt],e=>[Jt(...e)]],[f]:[3,we,[Vt,qt,Pt],e=>Ll(Nt(...e))],InvalidCell:[3,Ce],[d+w]:[0,xe,[],()=>[Dt()]],[w]:[0,Se],[C]:[0,Te],[d+y]:[1,Ve,[Et],e=>[Bt(...e)]],[y]:[1,Oe,[Et],e=>Ll(jt(e[0]))],InvalidValue:[1,ke]},(([e,t,l,n],s)=>{Vl["add"+s+"Listener"]=(...s)=>Me(s[e],t[s[e+1]?1:0],e>0?j(s,0,e):void 0,l,n)})),re(Vl)};exports.Inspector=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(Fl),s=ve.indexOf(e);return t.useCreatePersister(n,(e=>{return t=be,l=sessionStorage,((e,t,l,n,s,r,a,o={},i=[])=>{let u,d,c,h=0,m=0,p=0;cl(Tl,i,(()=>0)),cl(Vl,i,(()=>[]));const[b,g,v,f,I]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!de(e)||!de(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!de(e)||!de(t),t.setContent]:$("Store type not supported by this Persister"))(a,e),y=t=>{(b&&E(null==t?void 0:t[0])?1===(null==t?void 0:t[2])?e.applyMergeableChanges:e.setMergeableContent:1===(null==t?void 0:t[2])?e.applyChanges:e.setContent)(t)},w=e=>Sl(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield S((()=>Sl(void 0,null,(function*(){try{const e=yield t();E(e)?y(e):$("Content is not an array "+e)}catch(t){e&&I(e)}h=0}))))),T})),C=()=>(d&&(s(d),d=void 0),T),k=e=>Sl(void 0,null,(function*(){return 1!=h&&(h=2,p++,yield S((()=>Sl(void 0,null,(function*(){try{yield l(g,e)}catch(e){}h=0}))))),T})),x=()=>(P(c,e.delListener),c=void 0,T),S=(...e)=>Sl(void 0,null,(function*(){return Y(il(Vl,i),...e),yield Sl(void 0,null,(function*(){if(!il(Tl,i)){for(dl(Tl,i,1);!M(u=Z(il(Vl,i)));)try{yield u()}catch(e){}dl(Tl,i,0)}})),T})),T=((e,t)=>{for(var l in t||(t={}))Cl.call(t,l)&&xl(e,l,t[l]);if(wl)for(var l of wl(t))kl.call(t,l)&&xl(e,l,t[l]);return e})({load:w,startAutoLoad:e=>Sl(void 0,null,(function*(){yield C().load(e);try{d=yield n(((e,t)=>Sl(void 0,null,(function*(){t||e?2!=h&&(h=1,m++,y(null!=t?t:e),h=0):yield w()}))))}catch(e){}return T})),stopAutoLoad:C,isAutoLoading:()=>!M(d),save:k,startAutoSave:()=>Sl(void 0,null,(function*(){return yield x().save(),c=e.addDidFinishTransactionListener((()=>{const e=v();f(e)&&k(e)})),T})),stopAutoSave:x,isAutoSaving:()=>!M(c),schedule:S,getStore:()=>e,destroy:()=>(il(Vl,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:p})},o);return re(T)})(e,(()=>Ol(void 0,null,(function*(){return e=l.getItem(t),me(e,((e,t)=>""===t?void 0:t));var e}))),(e=>Ol(void 0,null,(function*(){return l.setItem(t,(n=e(),he(n,((e,t)=>void 0===t?"":t))));var n}))),(e=>{const n=n=>{if(n.storageArea===l&&n.key===t)try{e(me(n.newValue))}catch(t){e()}};return T.addEventListener(Rl,n),n}),(e=>T.removeEventListener(Rl,e)),0,3,{getStorageName:()=>t});var t,l}),void 0,(e=>{return t=function*(){yield e.load([{},{position:-1==s?1:s,open:!!l}]),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),J(F,null,J("aside",{id:be},J(Ge,{s:n}),J(Kt,{s:n})),J("style",null,We))};
1
+ "use strict";var e=require("react"),t=require("../ui-react/index.cjs");const l=e=>typeof e,n="",s=l(n),r=l(!0),a=l(0),o=l(l),i="type",u="default",d="Has",c="Ids",h="Table",m=h+"s",p=h+c,b="Row",g=b+"Count",v=b+c,f="Cell",I=f+c,y="Value",w=y+"s",C=y+c,k="currentTarget",x="value",S=e=>n+e,T=globalThis.window,V=Math,O=V.min,R=V.floor,q=isFinite,M=e=>null==e,P=(e,t,l)=>M(e)?null==l?void 0:l():t(e),N=e=>e==s||e==r,L=e=>l(e)==o,E=e=>Array.isArray(e),j=(e,t,l)=>e.slice(t,l),z=e=>e.length,$=e=>{throw Error(e)},{PureComponent:A,Fragment:F,createElement:J,useCallback:D,useLayoutEffect:B,useRef:Q,useState:H}=e,W=(e,...t)=>M(e)?{}:e(...t),G=(e,t)=>e.sort(t),K=(e,t)=>e.forEach(t),U=(e,t)=>e.map(t),X=e=>0==z(e),Y=(e,...t)=>e.push(...t),Z=e=>e.shift(),_=Object,ee=e=>_.getPrototypeOf(e),te=_.entries,le=_.isFrozen,ne=e=>!M(e)&&P(ee(e),(e=>e==_.prototype||M(ee(e))),(()=>!0)),se=_.keys,re=_.freeze,ae=(e=[])=>_.fromEntries(e),oe=(e,t)=>t in e,ie=(e,t)=>(delete e[t],e),ue=(e,t)=>U(te(e),(([e,l])=>t(l,e))),de=e=>ne(e)&&0==(e=>z(se(e)))(e),ce=(e,t,l,n=0)=>M(e)||!ne(e)||!n&&de(e)||le(e)?(null==l||l(),!1):(ue(e,((l,n)=>{t(l,n)||ie(e,n)})),!!n||!de(e)),he=JSON.stringify,me=JSON.parse,pe=e=>he(e,((e,t)=>t instanceof Map?_.fromEntries([...t]):t)),be="tinybaseInspector",ge="TinyBase Inspector",ve=["left","top","bottom","right","full"],fe="state",Ie="sort",ye="open",we="position",Ce=ye,ke="editable",xe=(...e)=>pe(e),Se=(e,t)=>U(G([...e]),t),Te=(e,l)=>[!!t.useCell(fe,e,ke,l),D((t=>{l.setCell(fe,e,ke,(e=>!e)),t.preventDefault()}),[l,e])],Ve="M20 80l5-15l40-40l10 10l-40 40l-15 5m5-15l10 10",Oe='content:url("',Re=Oe+"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' stroke-width='4' stroke='white' fill='none'>",qe='</svg>")',Me=Oe+"data:image/svg+xml,%3csvg viewBox='0 0 680 680' xmlns='http://www.w3.org/2000/svg' style='width:680px%3bheight:680px'%3e %3cpath stroke='white' stroke-width='80' fill='none' d='M340 617a84 241 90 11.01 0zM131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124zm-12-127a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e %3cpath fill='%23d81b60' d='M131 475a94 254 70 10428-124 114 286 70 01-428 124zm0-140a94 254 70 10428-124 114 286 70 01-428 124z' /%3e %3cpath d='M249 619a94 240 90 00308-128 114 289 70 01-308 128zM119 208a94 254 70 00306 38 90 260 90 01-306-38zm221 3a74 241 90 11.01 0z' /%3e%3c/svg%3e\")",Pe=U([[20,20,20,60],[20,20,60,20],[20,60,60,20],[60,20,20,60],[30,30,40,40]],(([e,t,l,n])=>Re+`<rect x='20' y='20' width='60' height='60' fill='grey'/><rect x='${e}' y='${t}' width='${l}' height='${n}' fill='white'/>`+qe)),Ne=Re+"<path d='M20 20l60 60M20 80l60-60' />"+qe,Le=Re+`<path d='${Ve}' />`+qe,Ee=Re+`<path d='${Ve}M20 20l60 60' />`+qe;var je=Object.defineProperty,ze=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,Ae=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,De=(e,t,l)=>t in e?je(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Be=(e,t)=>{for(var l in t||(t={}))Fe.call(t,l)&&De(e,l,t[l]);if(Ae)for(var l of Ae(t))Je.call(t,l)&&De(e,l,t[l]);return e},Qe=(e,t)=>ze(e,$e(t));const He="*::-webkit-scrollbar",We=((e,t="")=>e.join(t))(ue(Qe(Be(Qe(Be(Qe(Be({"":"all:initial;font-family:sans-serif;font-size:0.75rem;position:fixed;z-index:999999","*":"all:revert","*::before":"all:revert","*::after":"all:revert",[He]:"width:0.5rem;height:0.5rem;",[He+"-track"]:"background:#111",[He+"-thumb"]:"background:#999;border:1px solid #111",[He+"-thumb:hover"]:"background:#fff",[He+"-corner"]:"background:#111",img:"width:1rem;height:1rem;background:#111;border:0;vertical-align:text-bottom",">img":"padding:0.25rem;bottom:0;right:0;position:fixed;"+Me},ae(U(["bottom:0;left:0","top:0;right:0"],((e,t)=>[`>img[data-position='${t}']`,e])))),{main:"display:flex;flex-direction:column;background:#111d;color:#fff;position:fixed;"}),ae(U(["bottom:0;left:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:30vh","bottom:0;left:0;width:100vw;height:30vh","top:0;right:0;width:35vw;height:100vh","top:0;right:0;width:100vw;height:100vh"],((e,t)=>[`main[data-position='${t}']`,e])))),{header:"display:flex;padding:0.25rem;background:#000;align-items:center","header>img:nth-of-type(1)":Me,"header>img:nth-of-type(6)":Ne}),ae(U(Pe,((e,t)=>[`header>img[data-id='${t}']`,e])))),{"header>span":"flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-left:0.25rem",article:"padding:0.25rem 0.25rem 0.25rem 0.5rem;overflow:auto;flex:1",details:"margin-left:0.75rem;width:fit-content;","details img":"display:none","details[open]>summary img":"display:unset;background:none;margin-left:0.25rem","details[open]>summary img.edit":Le,"details[open]>summary img.done":Ee,summary:"margin-left:-0.75rem;line-height:1.25rem;user-select:none;width:fit-content",table:"border-collapse:collapse;table-layout:fixed;margin-bottom:0.5rem","table input":"background:#111;color:unset;padding:0 0.25rem;border:0;font-size:unset;vertical-align:top;margin:0",'table input[type="number"]':"width:4rem","table tbody button":"font-size:0;background:#fff;border-radius:50%;margin:0 0.125rem 0 0;width:0.85rem;color:#111","table button:first-letter":"font-size:0.75rem",thead:"background:#222","th:nth-of-type(1)":"min-width:2rem;","th.sorted":"background:#000","table caption":"text-align:left;white-space:nowrap;line-height:1.25rem",button:"width:1.5rem;border:none;background:none;color:#fff;padding:0","button[disabled]":"color:#777","button.next":"margin-right:0.5rem",[`th,#${be} td`]:"overflow:hidden;text-overflow:ellipsis;padding:0.25rem 0.5rem;max-width:12rem;white-space:nowrap;border-width:1px 0;border-style:solid;border-color:#777;text-align:left","span.warn":"margin:0.25rem;color:#d81b60"}),((e,t)=>e?`#${be} ${t}{${e}}`:""))),Ge=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1,s=t.useSetValueCallback(Ce,(()=>!0),[],e);return t.useValue(Ce,e)?null:J("img",{onClick:s,title:ge,"data-position":n})},Ke=({uniqueId:e,summary:l,editable:n,handleEditable:s,children:r,s:a})=>{const o=!!t.useCell(fe,e,ye,a),i=t.useSetCellCallback(fe,e,ye,(e=>e[k].open),[],a);return J("details",{open:o,onToggle:i},J("summary",null,l,s?J("img",{onClick:s,className:n?"done":"edit"}):null),r)},Ue=e=>{const t=l(e);return N(t)||t==a&&q(e)?t:void 0},Xe=(e,t,l,n,s)=>M(s)?e.delCell(t,l,n,!0):e.setCell(t,l,n,s),Ye=(e,t,l)=>M(l)?e.delValue(t):e.setValue(t,l),Ze=(e,t,l,n)=>e==s?t:e==a?l:n;var _e=Object.defineProperty,et=Object.defineProperties,tt=Object.getOwnPropertyDescriptors,lt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable,rt=(e,t,l)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,at=(e,t)=>{for(var l in t||(t={}))nt.call(t,l)&&rt(e,l,t[l]);if(lt)for(var l of lt(t))st.call(t,l)&&rt(e,l,t[l]);return e},ot=(e,t)=>et(e,tt(t)),it=(e,t)=>{var l={};for(var n in e)nt.call(e,n)&&t.indexOf(n)<0&&(l[n]=e[n]);if(null!=e&&lt)for(var n of lt(e))t.indexOf(n)<0&&st.call(e,n)&&(l[n]=e[n]);return l};const{useCallback:ut,useMemo:dt,useState:ct}=e,ht="editable",mt=(e,l)=>U(t.useTableCellIds(e,l),(t=>e+"."+t)),pt=(e,t,l)=>{const n=ut(e,t);return l?n:void 0},bt=(...e)=>dt((()=>e),e),gt=(e,t)=>dt((()=>({store:e,tableId:t})),[e,t]),vt=(e,t)=>dt((()=>({queries:e,queryId:t})),[e,t]),ft=(e,t=!1,l,n=0,s,r,a,o)=>{const[[i,u,d],c]=ct([e,t,n]),h=ut((e=>{c(e),null==o||o(e)}),[o]),m=pt((e=>h([e,e==i&&!u,d])),[h,i,u,d],l),p=ut((e=>h([i,u,e])),[h,i,u]),b=!0===a?Mt:a;return[[i,u,d],m,dt((()=>!1===a?null:J(b,{offset:d,limit:s,total:r,onChange:p})),[a,b,d,s,r,p])]},It=(e,t,n)=>dt((()=>{const r=null!=t?t:e;return a=E(r)?ae(U(r,(e=>[e,e]))):r,o=(e,t)=>at(at({},{label:t,component:n}),l(e)==s?{label:e}:e),ae(ue(a,((e,t)=>[t,o(e,t)])));var a,o}),[t,n,e]),yt=({className:e,headerRow:t,idColumn:l,params:[n,s,r,a,o,i]})=>J("table",{className:e},i?J("caption",null,i):null,!1===t?null:J("thead",null,J("tr",null,!1===l?null:J(wt,{sort:null!=a?a:[],label:"Id",onClick:o}),ue(n,(({label:e},t)=>J(wt,{key:t,cellId:t,label:e,sort:null!=a?a:[],onClick:o}))))),J("tbody",null,U(r,(e=>J("tr",{key:e},!1===l?null:J("th",null,e),ue(n,(({component:t,getComponentProps:l},n)=>J("td",{key:n},J(t,ot(at(at({},W(l,e,n)),s),{rowId:e,cellId:n})))))))))),wt=({cellId:e,sort:[t,l],label:s=(null!=e?e:n),onClick:r})=>J("th",{onClick:pt((()=>null==r?void 0:r(e)),[r,e],r),className:M(l)||t!=e?void 0:`sorted ${l?"de":"a"}scending`},M(l)||t!=e?null:(l?"↓":"↑")+" ",s),Ct=({localRowId:l,params:[n,s,r,a,o,i,u]})=>{const d=t.useRemoteRowId(o,l,i);return J("tr",null,!1===n?null:J(e.Fragment,null,J("th",null,l),J("th",null,d)),ue(s,(({component:e,getComponentProps:t},n)=>{const[s,o]=n.split(".",2),i=s===r?l:s===a?d:null;return M(i)?null:J("td",{key:n},J(e,ot(at({},W(t,i,o)),{store:u,tableId:s,rowId:i,cellId:o})))})))},kt=({thing:e,onThingChange:t,className:l,hasSchema:n,showType:o=!0})=>{const[i,u]=ct(),[d,c]=ct(),[h,m]=ct(),[p,b]=ct(),[g,v]=ct();d!==e&&(u(Ue(e)),c(e),m(e+""),b(Number(e)||0),v(!!e));const f=ut(((e,l)=>{l(e),c(e),t(e)}),[t]),I=ut((()=>{if(!(null==n?void 0:n())){const e=Ze(i,a,r,s),l=Ze(e,h,p,g);u(e),c(l),t(l)}}),[n,t,h,p,g,i]);return J("div",{className:l},o?J("button",{className:i,onClick:I},i):null,Ze(i,J("input",{key:i,value:h,onChange:ut((e=>f(e[k][x]+"",m)),[f])}),J("input",{key:i,type:"number",value:p,onChange:ut((e=>f(Number(e[k][x]||0),b)),[f])}),J("input",{key:i,type:"checkbox",checked:g,onChange:ut((e=>f(!!e[k].checked,v)),[f])})))},xt=e=>{var l=e,{tableId:n,cellId:s,descending:r,offset:a,limit:o,store:i,editable:u,sortOnClick:d,paginator:c=!1,onChange:h,customCells:m}=l,p=it(l,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[b,g,v]=ft(s,r,d,a,o,t.useRowCount(n,i),c,h);return J(yt,ot(at({},p),{params:bt(It(t.useTableCellIds(n,i),m,u?Rt:t.CellView),gt(i,n),t.useSortedRowIds(n,...b,o,i),b,g,v)}))},St=({store:e,editable:l=!1,valueComponent:n=(l?qt:t.ValueView),getValueComponentProps:s,className:r,headerRow:a,idColumn:o})=>J("table",{className:r},!1===a?null:J("thead",null,J("tr",null,!1===o?null:J("th",null,"Id"),J("th",null,y))),J("tbody",null,U(t.useValueIds(e),(t=>J("tr",{key:t},!1===o?null:J("th",null,t),J("td",null,J(n,ot(at({},W(s,t)),{valueId:t,store:e})))))))),Tt=e=>{var l=e,{indexId:n,sliceId:s,indexes:r,editable:a,customCells:o}=l,i=it(l,["indexId","sliceId","indexes","editable","customCells"]);const[u,d,c]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(t.useIndexesOrIndexesById(r),n);return J(yt,ot(at({},i),{params:bt(It(t.useTableCellIds(c,d),o,a?Rt:t.CellView),gt(d,c),t.useSliceRowIds(n,s,u))}))},Vt=({relationshipId:l,relationships:n,editable:s,customCells:r,className:a,headerRow:o,idColumn:i=!0})=>{const[u,d,c,h]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)])(t.useRelationshipsOrRelationshipsById(n),l),m=It([...mt(c,d),...mt(h,d)],r,s?Rt:t.CellView),p=bt(i,m,c,h,l,u,d);return J("table",{className:a},!1===o?null:J("thead",null,J("tr",null,!1===i?null:J(e.Fragment,null,J("th",null,c,".Id"),J("th",null,h,".Id")),ue(m,(({label:e},t)=>J("th",{key:t},e))))),J("tbody",null,U(t.useRowIds(c,d),(e=>J(Ct,{key:e,localRowId:e,params:p})))))},Ot=e=>{var l=e,{queryId:n,cellId:s,descending:r,offset:a,limit:o,queries:i,sortOnClick:u,paginator:d=!1,customCells:c,onChange:h}=l,m=it(l,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[p,b,g]=ft(s,r,u,a,o,t.useResultRowCount(n,i),d,h);return J(yt,ot(at({},m),{params:bt(It(t.useResultTableCellIds(n,i),c,t.ResultCellView),vt(i,n),t.useResultSortedRowIds(n,...p,o,i),p,b,g)}))},Rt=({tableId:e,rowId:l,cellId:n,store:s,className:r,showType:a})=>{var o;return J(kt,{thing:t.useCell(e,l,n,s),onThingChange:t.useSetCellCallback(e,l,n,(e=>e),[],s),className:null!=r?r:ht+f,showType:a,hasSchema:null==(o=t.useStoreOrStoreById(s))?void 0:o.hasTablesSchema})},qt=({valueId:e,store:l,className:n,showType:s})=>{var r;return J(kt,{thing:t.useValue(e,l),onThingChange:t.useSetValueCallback(e,(e=>e),[],l),className:null!=n?n:ht+y,showType:s,hasSchema:null==(r=t.useStoreOrStoreById(l))?void 0:r.hasValuesSchema})},Mt=({onChange:t,total:l,offset:n=0,limit:s=l,singular:r="row",plural:a=r+"s"})=>{(n>l||n<0)&&(n=0,t(0));const o=pt((()=>t(n-s)),[t,n,s],n>0),i=pt((()=>t(n+s)),[t,n,s],n+s<l);return J(e.Fragment,null,l>s&&J(e.Fragment,null,J("button",{className:"previous",disabled:0==n,onClick:o},"←"),J("button",{className:"next",disabled:n+s>=l,onClick:i},"→"),n+1," to ",O(l,n+s)," of "),l," ",1!=l?a:r)},Pt=({indexes:e,indexesId:l,indexId:n,s:s})=>J(Ke,{uniqueId:xe("i",l,n),summary:"Index: "+n,s:s},U(t.useSliceIds(n,e),(t=>J(Nt,{indexes:e,indexesId:l,indexId:n,sliceId:t,s:s,key:t})))),Nt=({indexes:e,indexesId:t,indexId:l,sliceId:n,s:s})=>{const r=xe("i",t,l,n),[a,o]=Te(r,s);return J(Ke,{uniqueId:r,summary:"Slice: "+n,editable:a,handleEditable:o,s:s},J(Tt,{sliceId:n,indexId:l,indexes:e,editable:a}))},Lt=({indexesId:e,s:l})=>{const n=t.useIndexes(e),s=t.useIndexIds(n);return M(n)?null:J(Ke,{uniqueId:xe("i",e),summary:"Indexes: "+(null!=e?e:u),s:l},X(s)?"No indexes defined":Se(s,(t=>J(Pt,{indexes:n,indexesId:e,indexId:t,s:l,key:t}))))},Et=({metrics:e,metricId:l})=>J("tr",null,J("th",null,l),J("td",null,null==e?void 0:e.getTableId(l)),J("td",null,t.useMetric(l,e))),jt=({metricsId:e,s:l})=>{const n=t.useMetrics(e),s=t.useMetricIds(n);return M(n)?null:J(Ke,{uniqueId:xe("m",e),summary:"Metrics: "+(null!=e?e:u),s:l},X(s)?"No metrics defined":J("table",null,J("thead",null,J("th",null,"Metric Id"),J("th",null,"Table Id"),J("th",null,"Metric")),J("tbody",null,U(s,(e=>J(Et,{metrics:n,metricId:e,key:e}))))))},zt=({queries:e,queriesId:l,queryId:n,s:s})=>{var r;const a=xe("q",l,n),[o,i,u]=me(null!=(r=t.useCell(fe,a,Ie,s))?r:"[]"),d=t.useSetCellCallback(fe,a,Ie,pe,[],s);return J(Ke,{uniqueId:a,summary:"Query: "+n,s:s},J(Ot,{queryId:n,queries:e,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d}))},$t=({queriesId:e,s:l})=>{const n=t.useQueries(e),s=t.useQueryIds(n);return M(n)?null:J(Ke,{uniqueId:xe("q",e),summary:"Queries: "+(null!=e?e:u),s:l},X(s)?"No queries defined":Se(s,(t=>J(zt,{queries:n,queriesId:e,queryId:t,s:l,key:t}))))},At=({relationships:e,relationshipsId:t,relationshipId:l,s:n})=>{const s=xe("r",t,l),[r,a]=Te(s,n);return J(Ke,{uniqueId:s,summary:"Relationship: "+l,editable:r,handleEditable:a,s:n},J(Vt,{relationshipId:l,relationships:e,editable:r}))},Ft=({relationshipsId:e,s:l})=>{const n=t.useRelationships(e),s=t.useRelationshipIds(n);return M(n)?null:J(Ke,{uniqueId:xe("r",e),summary:"Relationships: "+(null!=e?e:u),s:l},X(s)?"No relationships defined":Se(s,(t=>J(At,{relationships:n,relationshipsId:e,relationshipId:t,s:l,key:t}))))},Jt=({tableId:e,store:l,storeId:n,s:s})=>{var r;const a=xe("t",n,e),[o,i,u]=me(null!=(r=t.useCell(fe,a,Ie,s))?r:"[]"),d=t.useSetCellCallback(fe,a,Ie,pe,[],s),[c,m]=Te(a,s);return J(Ke,{uniqueId:a,summary:h+": "+e,editable:c,handleEditable:m,s:s},J(xt,{tableId:e,store:l,cellId:o,descending:i,offset:u,limit:10,paginator:!0,sortOnClick:!0,onChange:d,editable:c}))},Dt=({store:e,storeId:l,s:n})=>{const s=xe("v",l),[r,a]=Te(s,n);return X(t.useValueIds(e))?null:J(Ke,{uniqueId:s,summary:w,editable:r,handleEditable:a,s:n},J(St,{store:e,editable:r}))},Bt=({storeId:e,s:l})=>{const n=t.useStore(e),s=t.useTableIds(n);return M(n)?null:J(Ke,{uniqueId:xe("s",e),summary:(n.isMergeable()?"Mergeable":"")+"Store: "+(null!=e?e:u),s:l},J(Dt,{storeId:e,store:n,s:l}),Se(s,(t=>J(Jt,{store:n,storeId:e,tableId:t,s:l,key:t}))))},Qt=({s:e})=>{const l=Q(null),n=Q(0),[s,r]=H(!1),{scrollLeft:a,scrollTop:o}=t.useValues(e);B((()=>{const e=l.current;if(e&&!s){const t=new MutationObserver((()=>{e.scrollWidth>=R(a)+e.clientWidth&&e.scrollHeight>=R(o)+e.clientHeight&&e.scrollTo(a,o)}));return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()}}),[s,a,o]);const i=D((t=>{const{scrollLeft:l,scrollTop:s}=t[k];cancelIdleCallback(n.current),n.current=requestIdleCallback((()=>{r(!0),e.setPartialValues({scrollLeft:l,scrollTop:s})}))}),[e]),u=t.useStore(),d=t.useStoreIds(),c=t.useMetrics(),h=t.useMetricsIds(),m=t.useIndexes(),p=t.useIndexesIds(),b=t.useRelationships(),g=t.useRelationshipsIds(),v=t.useQueries(),f=t.useQueriesIds();return M(u)&&X(d)&&M(c)&&X(h)&&M(m)&&X(p)&&M(b)&&X(g)&&M(v)&&X(f)?J("span",{className:"warn"},"There are no Stores or other objects to inspect. Make sure you placed the Inspector inside a Provider component."):J("article",{ref:l,onScroll:i},J(Bt,{s:e}),U(d,(t=>J(Bt,{storeId:t,s:e,key:t}))),J(jt,{s:e}),U(h,(t=>J(jt,{metricsId:t,s:e,key:t}))),J(Lt,{s:e}),U(p,(t=>J(Lt,{indexesId:t,s:e,key:t}))),J(Ft,{s:e}),U(g,(t=>J(Ft,{relationshipsId:t,s:e,key:t}))),J($t,{s:e}),U(f,(t=>J($t,{queriesId:t,s:e,key:t}))))};var Ht=Object.defineProperty;class Wt extends A{constructor(e){var t,l,n;super(e),n=(e,t)=>console.error(e,t.componentStack),(l="componentDidCatch")in(t=this)?Ht(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,this.state={e:0}}static getDerivedStateFromError(){return{e:1}}render(){return this.state.e?J("span",{className:"warn"},"Inspector error: please see console for details."):this.props.children}}const Gt=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1,s=t.useSetValueCallback(Ce,(()=>!1),[],e),r=t.useSetValueCallback(we,(e=>Number(e[k].dataset.id)),[],e);return J("header",null,J("img",{title:ge}),J("span",null,ge),U(ve,((e,t)=>t==n?null:J("img",{onClick:r,"data-id":t,title:"Dock to "+e,key:t}))),J("img",{onClick:s,title:"Close"}))},Kt=({s:e})=>{var l;const n=null!=(l=t.useValue(we,e))?l:1;return t.useValue(Ce,e)?J("main",{"data-position":n},J(Gt,{s:e}),J(Wt,null,J(Qt,{s:e}))):null},Ut=e=>t=>{return l=(t,l)=>t+e(l),ll(t).reduce(l,0);var l},Xt=e=>{var t;return null!=(t=null==e?void 0:e.size)?t:0},Yt=Ut(Xt),Zt=Ut(Yt),_t=Ut(Zt),el=(e,t)=>{var l;return null!=(l=null==e?void 0:e.has(t))&&l},tl=e=>M(e)||0==Xt(e),ll=e=>{var t;return[...null!=(t=null==e?void 0:e.values())?t:[]]},nl=e=>e.clear(),sl=(e,t)=>null==e?void 0:e.forEach(t),rl=(e,t)=>null==e?void 0:e.delete(t),al=e=>new Map(e),ol=e=>{var t;return[...null!=(t=null==e?void 0:e.keys())?t:[]]},il=(e,t)=>null==e?void 0:e.get(t),ul=(e,t)=>sl(e,((e,l)=>t(l,e))),dl=(e,t,l)=>M(l)?(rl(e,t),e):null==e?void 0:e.set(t,l),cl=(e,t,l,n)=>(el(e,t)?null==n||n(il(e,t)):dl(e,t,l()),il(e,t)),hl=(e,t,l,n=dl)=>(ue(t,((t,n)=>l(e,n,t))),ul(e,(l=>oe(t,l)?0:n(e,l))),e),ml=(e,t,l,n)=>{const s={};return sl(e,((e,r)=>{if(!(null==l?void 0:l(e,r))){const l=t?t(e,r):e;(null==n?void 0:n(l))||(s[r]=l)}})),s},pl=(e,t,l)=>ml(e,(e=>ml(e,t,l)),tl,de),bl=(e,t,l)=>ml(e,(e=>pl(e,t,l)),tl,de),gl=(e,t)=>{const l=al();return sl(e,((e,n)=>{var s;return l.set(n,null!=(s=null==t?void 0:t(e))?s:e)})),l},vl=e=>gl(e,gl),fl=e=>gl(e,vl),Il=(e,t,l,n,s=0)=>P((l?cl:il)(e,t[s],s>z(t)-2?l:al),(r=>{if(s>z(t)-2)return(null==n?void 0:n(r))&&dl(e,t[s]),r;const a=Il(r,t,l,n,s+1);return tl(r)&&dl(e,t[s]),a}));var yl=Object.defineProperty,wl=Object.getOwnPropertySymbols,Cl=Object.prototype.hasOwnProperty,kl=Object.prototype.propertyIsEnumerable,xl=(e,t,l)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,Sl=(e,t,l)=>new Promise(((n,s)=>{var r=e=>{try{o(l.next(e))}catch(e){s(e)}},a=e=>{try{o(l.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((l=l.apply(e,t)).next())}));const Tl=al(),Vl=al();var Ol=(e,t,l)=>new Promise(((n,s)=>{var r=e=>{try{o(l.next(e))}catch(e){s(e)}},a=e=>{try{o(l.throw(e))}catch(e){s(e)}},o=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,a);o((l=l.apply(e,t)).next())}));const Rl="storage",ql=e=>new Set(E(e)||M(e)?e:[e]),Ml=(e,t)=>null==e?void 0:e.add(t),Pl=/^\d+$/,Nl=()=>{const e=[];let t=0;return[l=>{var s;return null!=(s=l?Z(e):null)?s:n+t++},t=>{Pl.test(t)&&z(e)<1e3&&Y(e,t)}]},Ll=e=>[e,e],El=(e,t=Yt)=>t(e[0])+t(e[1]),jl=()=>[al(),al()],zl=e=>[...e],$l=([e,t])=>e===t;al(U("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(n),((e,t)=>[e,t])));const Al=(e,t,l)=>dl(e,t,il(e,t)==-l?void 0:l),Fl=()=>{let e,t,l=!1,s=!1,r=0,o=[];const c=al(),k=al(),x=al(),T=al(),V=al(),O=al(),R=al(),q=al(),$=al(),A=al(),F=al(),J=al(),D=al(),B=al(),Q=ql(),H=al(),W=al(),X=al(),Z=al(),_=jl(),ee=jl(),te=jl(),le=jl(),ne=jl(),se=jl(),ae=jl(),he=jl(),be=jl(),ge=jl(),ve=jl(),fe=jl(),Ie=jl(),ye=jl(),we=jl(),Ce=jl(),ke=jl(),xe=jl(),Se=jl(),Te=jl(),Ve=jl(),Oe=jl(),Re=al(),qe=jl(),[Me,Pe,Ne,Le]=(()=>{let e;const[t,l]=Nl(),s=al();return[(l,r,a,o=[],i=()=>[])=>{null!=e||(e=Vl);const u=t(1);return dl(s,u,[l,r,a,o,i]),Ml(Il(r,null!=a?a:[n],ql),u),u},(t,l,...r)=>K(((e,t=[n])=>{const l=[],s=(e,n)=>n==z(t)?Y(l,e):null===t[n]?sl(e,(e=>s(e,n+1))):K([t[n],null],(t=>s(il(e,t),n+1)));return s(e,0),l})(t,l),(t=>sl(t,(t=>il(s,t)[0](e,...null!=l?l:[],...r))))),e=>P(il(s,e),(([,t,r])=>(Il(t,null!=r?r:[n],void 0,(t=>(rl(t,e),tl(t)?1:0))),dl(s,e),l(e),r))),t=>P(il(s,t),(([t,,l=[],n,s])=>{const r=(...a)=>{var o,i;const u=z(a);u==z(l)?t(e,...a,...s(a)):M(l[u])?K(null!=(i=null==(o=n[u])?void 0:o.call(n,...a))?i:[],(e=>r(...a,e))):r(...a,l[u])};r()}))]})(),Ee=e=>{if(!ce(e,((e,t)=>[i,u].includes(t))))return!1;const t=e[i];return!(!N(t)&&t!=a||(Ue(e[u])!=t&&ie(e,u),0))},je=E,ze=(t,l)=>(!e||el(F,l)||gt(l))&&ce(t,((e,t)=>$e(l,t,e)),(()=>gt(l))),$e=(e,t,l,n)=>ce(n?l:De(l,e,t),((n,s)=>P(Ae(e,t,s,n),(e=>(l[s]=e,!0)),(()=>!1))),(()=>gt(e,t))),Ae=(t,l,n,s)=>e?P(il(il(F,t),n),(e=>Ue(s)!=e[i]?gt(t,l,n,s,e[u]):s),(()=>gt(t,l,n,s))):M(Ue(s))?gt(t,l,n,s):s,Fe=(e,t)=>ce(t?e:Be(e),((t,l)=>P(Je(l,t),(t=>(e[l]=t,!0)),(()=>!1))),(()=>vt())),Je=(e,l)=>t?P(il(D,e),(t=>Ue(l)!=t[i]?vt(e,l,t[u]):l),(()=>vt(e,l))):M(Ue(l))?vt(e,l):l,De=(e,t,l)=>(P(il(J,t),(([n,s])=>{sl(n,((t,l)=>{oe(e,l)||(e[l]=t)})),sl(s,(n=>{oe(e,n)||gt(t,l,n)}))})),e),Be=e=>(t&&(sl(B,((t,l)=>{oe(e,l)||(e[l]=t)})),sl(Q,(t=>{oe(e,t)||vt(t)}))),e),Qe=e=>hl(F,e,((e,t,l)=>{const n=al(),s=ql();hl(cl(F,t,al),l,((e,t,l)=>{dl(e,t,l),P(l[u],(e=>dl(n,t,e)),(()=>Ml(s,t)))})),dl(J,t,[n,s])}),((e,t)=>{dl(F,t),dl(J,t)})),He=e=>hl(D,e,((e,t,l)=>{dl(D,t,l),P(l[u],(e=>dl(B,t,e)),(()=>Ml(Q,t)))}),((e,t)=>{dl(D,t),dl(B,t),rl(Q,t)})),We=e=>de(e)?Ut():Qt(e),Ge=e=>hl(X,e,((e,t,l)=>Ke(t,l)),((e,t)=>at(t))),Ke=(e,t)=>hl(cl(X,e,(()=>(dt(e,1),dl(H,e,Nl()),dl(W,e,al()),al()))),t,((t,l,n)=>Ze(e,t,l,n)),((t,l)=>ot(e,t,l))),Ze=(e,t,l,n,s)=>hl(cl(t,l,(()=>(ct(e,l,1),al()))),n,((t,n,s)=>_e(e,l,t,n,s)),((n,r)=>it(e,t,l,n,r,s))),_e=(e,t,l,n,s)=>{el(l,n)||ht(e,t,n,1);const r=il(l,n);s!==r&&(mt(e,t,n,r,s),dl(l,n,s))},et=(e,t,l,n,s)=>P(il(t,l),(t=>_e(e,l,t,n,s)),(()=>Ze(e,t,l,De({[n]:s},e,l)))),tt=e=>de(e)?wl():Ht(e),lt=e=>hl(Z,e,((e,t,l)=>nt(t,l)),((e,t)=>ut(t))),nt=(e,t)=>{el(Z,e)||pt(e,1);const l=il(Z,e);t!==l&&(bt(e,l,t),dl(Z,e,t))},st=(e,t)=>{const[l]=il(H,e),n=l(t);return el(il(X,e),n)?st(e,t):n},rt=e=>{var t;return null!=(t=il(X,e))?t:Ke(e,{})},at=e=>Ke(e,{}),ot=(e,t,l)=>{const[,n]=il(H,e);n(l),Ze(e,t,l,{},!0)},it=(e,t,l,n,s,r)=>{var a;const o=il(null==(a=il(J,e))?void 0:a[0],s);if(!M(o)&&!r)return _e(e,l,n,s,o);const i=t=>{mt(e,l,t,il(n,t)),ht(e,l,t,-1),dl(n,t)};M(o)?i(s):ul(n,i),tl(n)&&(ct(e,l,-1),tl(dl(t,l))&&(dt(e,-1),dl(X,e),dl(H,e),dl(W,e)))},ut=e=>{const t=il(B,e);if(!M(t))return nt(e,t);bt(e,il(Z,e)),pt(e,-1),dl(Z,e)},dt=(e,t)=>Al(c,e,t),ct=(e,t,l)=>Al(cl(T,e,al),t,l)&&dl(x,e,cl(x,e,(()=>0))+l),ht=(e,t,l,n)=>{var s;const r=il(W,e),a=null!=(s=il(r,l))?s:0;(0==a&&1==n||1==a&&-1==n)&&Al(cl(k,e,al),l,n),dl(r,l,a!=-n?a+n:null),Al(cl(cl(V,e,al),t,al),l,n)},mt=(e,t,l,n,s)=>{var r;cl(cl(cl(O,e,al),t,al),l,(()=>[n,0]))[1]=s,null==(r=o[3])||r.call(o,e,t,l,s)},pt=(e,t)=>Al(R,e,t),bt=(e,t,l)=>{var n;cl(q,e,(()=>[t,0]))[1]=l,null==(n=o[4])||n.call(o,e,l)},gt=(e,t,l,n,s)=>(Y(cl(cl(cl($,e,al),t,al),l,(()=>[])),n),s),vt=(e,t,l)=>(Y(cl(A,e,(()=>[])),t),l),ft=(e,t,l)=>P(il(il(il(O,e),t),l),(([e,t])=>[!0,e,t]),(()=>[!1,...Ll(Nt(e,t,l))])),It=e=>P(il(q,e),(([e,t])=>[!0,e,t]),(()=>[!1,...Ll(jt(e))])),yt=e=>tl($)||tl(Ce[e])?0:sl(e?fl($):$,((t,l)=>sl(t,((t,n)=>sl(t,((t,s)=>Pe(Ce[e],[l,n,s],t))))))),wt=e=>tl(A)||tl(ke[e])?0:sl(e?gl(A):A,((t,l)=>Pe(ke[e],[l],t))),Ct=(e,t,l,n)=>{if(!tl(e))return Pe(t,n,(()=>ml(e))),ul(e,((e,t)=>Pe(l,[...null!=n?n:[],e],1==t))),1},kt=e=>{const t=zt();t!=l&&Pe(_[e],void 0,t);const n=tl(ge[e]),s=tl(Ie[e])&&tl(ye[e])&&tl(be[e])&&tl(ve[e])&&tl(se[e])&&tl(ae[e])&&tl(he[e])&&n&&tl(te[e])&&tl(le[e]),r=tl(we[e])&&tl(fe[e])&&tl(ne[e])&&tl(ee[e]);if(!s||!r){const t=e?[gl(c),vl(k),gl(x),vl(T),fl(V),fl(O)]:[c,k,x,T,V,O];if(!s){Ct(t[0],te[e],le[e]),sl(t[1],((t,l)=>Ct(t,se[e],ae[e],[l]))),sl(t[2],((t,l)=>{0!=t&&Pe(he[e],[l],Rt(l))}));const l=ql();sl(t[3],((t,s)=>{Ct(t,be[e],ve[e],[s])&&!n&&(Pe(ge[e],[s,null]),Ml(l,s))})),n||sl(t[5],((t,n)=>{if(!el(l,n)){const l=ql();sl(t,(e=>sl(e,(([t,n],s)=>n!==t?Ml(l,s):rl(e,s))))),sl(l,(t=>Pe(ge[e],[n,t])))}})),sl(t[4],((t,l)=>sl(t,((t,n)=>Ct(t,Ie[e],ye[e],[l,n])))))}if(!r){let l;sl(t[5],((t,n)=>{let s;sl(t,((t,r)=>{let a;sl(t,(([t,o],i)=>{o!==t&&(Pe(we[e],[n,r,i],o,t,ft),l=s=a=1)})),a&&Pe(fe[e],[n,r],ft)})),s&&Pe(ne[e],[n],ft)})),l&&Pe(ee[e],void 0,ft)}}},xt=e=>{const t=Dt();t!=s&&Pe(xe[e],void 0,t);const l=tl(Te[e])&&tl(Ve[e]),n=tl(Oe[e])&&tl(Se[e]);if(!l||!n){const t=e?[gl(R),gl(q)]:[R,q];if(l||Ct(t[0],Te[e],Ve[e]),!n){let l;sl(t[1],(([t,n],s)=>{n!==t&&(Pe(Oe[e],[s],n,t,It),l=1)})),l&&Pe(Se[e],void 0,It)}}},St=(e,...t)=>(xl((()=>e(...U(t,S)))),Vl),Tt=()=>bl(X),Vt=()=>ol(X),Ot=e=>ol(il(W,S(e))),Rt=e=>Xt(il(X,S(e))),qt=e=>ol(il(X,S(e))),Mt=(e,t,l,n=0,s)=>{return U(j(G((r=il(X,S(e)),a=(e,l)=>[M(t)?l:il(e,S(t)),l],U([...null!=(o=null==r?void 0:r.entries())?o:[]],(([e,t])=>a(t,e)))),(([e],[t])=>{return((null!=(n=e)?n:0)<(null!=(s=t)?s:0)?-1:1)*(l?-1:1);var n,s})),n,M(s)?s:n+s),(([,e])=>e));var r,a,o},Pt=(e,t)=>ol(il(il(X,S(e)),S(t))),Nt=(e,t,l)=>il(il(il(X,S(e)),S(t)),S(l)),Lt=()=>ml(Z),Et=()=>ol(Z),jt=e=>il(Z,S(e)),zt=()=>!tl(X),$t=e=>el(X,S(e)),At=(e,t)=>el(il(W,S(e)),S(t)),Ft=(e,t)=>el(il(X,S(e)),S(t)),Jt=(e,t,l)=>el(il(il(X,S(e)),S(t)),S(l)),Dt=()=>!tl(Z),Bt=e=>el(Z,S(e)),Qt=e=>St((()=>(e=>ce(e,ze,gt))(e)?Ge(e):0)),Ht=e=>St((()=>Fe(e)?lt(e):0)),Wt=e=>{try{We(me(e))}catch(e){}return Vl},Gt=t=>St((()=>{if((e=ce(t,(e=>ce(e,Ee))))&&(Qe(t),!tl(X))){const e=Tt();Ut(),Qt(e)}})),Kt=e=>St((()=>{if(t=(e=>ce(e,Ee))(e)){const l=Lt();kl(),wl(),t=!0,He(e),Ht(l)}})),Ut=()=>St((()=>Ge({}))),ll=e=>St((e=>el(X,e)?at(e):0),e),yl=(e,t)=>St(((e,t)=>P(il(X,e),(l=>el(l,t)?ot(e,l,t):0))),e,t),wl=()=>St((()=>lt({}))),Cl=()=>St((()=>{Qe({}),e=!1})),kl=()=>St((()=>{He({}),t=!1})),xl=(e,t)=>{if(-1!=r){Sl();const l=e();return Tl(t),l}},Sl=()=>{var e;return-1!=r&&r++,1==r&&(null==(e=o[0])||e.call(o),Pe(Re)),Vl},Tl=e=>{var t,n;return r>0&&(r--,0==r&&(r=1,yt(1),tl(O)||kt(1),wt(1),tl(q)||xt(1),(null==e?void 0:e(Vl))&&(sl(O,((e,t)=>sl(e,((e,l)=>sl(e,(([e],n)=>Xe(Vl,t,l,n,e))))))),nl(O),sl(q,(([e],t)=>Ye(Vl,t,e))),nl(q)),Pe(qe[0],void 0),r=-1,yt(0),tl(O)||kt(0),wt(0),tl(q)||xt(0),null==(t=o[1])||t.call(o),Pe(qe[1],void 0),null==(n=o[2])||n.call(o),r=0,l=zt(),s=Dt(),K([c,k,x,T,V,O,$,R,q,A],nl))),Vl},Vl={getContent:()=>[Tt(),Lt()],getTables:Tt,getTableIds:Vt,getTable:e=>pl(il(X,S(e))),getTableCellIds:Ot,getRowCount:Rt,getRowIds:qt,getSortedRowIds:Mt,getRow:(e,t)=>ml(il(il(X,S(e)),S(t))),getCellIds:Pt,getCell:Nt,getValues:Lt,getValueIds:Et,getValue:jt,hasTables:zt,hasTable:$t,hasTableCell:At,hasRow:Ft,hasCell:Jt,hasValues:Dt,hasValue:Bt,getTablesJson:()=>pe(X),getValuesJson:()=>pe(Z),getJson:()=>pe([X,Z]),getTablesSchemaJson:()=>pe(F),getValuesSchemaJson:()=>pe(D),getSchemaJson:()=>pe([F,D]),hasTablesSchema:()=>e,hasValuesSchema:()=>t,setContent:e=>St((()=>je(e)?(([e,t])=>{(de(e)?Ut:Qt)(e),(de(t)?wl:Ht)(t)})(e):0)),setTables:Qt,setTable:(e,t)=>St((e=>ze(t,e)?Ke(e,t):0),e),setRow:(e,t,l)=>St(((e,t)=>$e(e,t,l)?Ze(e,rt(e),t,l):0),e,t),addRow:(e,t,l=!0)=>xl((()=>{let n;return $e(e,n,t)&&(e=S(e),Ze(e,rt(e),n=st(e,l?1:0),t)),n})),setPartialRow:(e,t,l)=>St(((e,t)=>{if($e(e,t,l,1)){const n=rt(e);ue(l,((l,s)=>et(e,n,t,s,l)))}}),e,t),setCell:(e,t,l,n)=>St(((e,t,l)=>P(Ae(e,t,l,L(n)?n(Nt(e,t,l)):n),(n=>et(e,rt(e),t,l,n)))),e,t,l),setValues:Ht,setPartialValues:e=>St((()=>Fe(e,1)?ue(e,((e,t)=>nt(t,e))):0)),setValue:(e,t)=>St((e=>P(Je(e,L(t)?t(jt(e)):t),(t=>nt(e,t)))),e),applyChanges:e=>St((()=>{ue(e[0],((e,t)=>M(e)?ll(t):ue(e,((e,l)=>M(e)?yl(t,l):ue(e,((e,n)=>Xe(Vl,t,l,n,e))))))),ue(e[1],((e,t)=>Ye(Vl,t,e)))})),setTablesJson:Wt,setValuesJson:e=>{try{tt(me(e))}catch(e){}return Vl},setJson:e=>St((()=>{try{const[t,l]=me(e);We(t),tt(l)}catch(t){Wt(e)}})),setTablesSchema:Gt,setValuesSchema:Kt,setSchema:(e,t)=>St((()=>{Gt(e),Kt(t)})),delTables:Ut,delTable:ll,delRow:yl,delCell:(e,t,l,n)=>St(((e,t,l)=>P(il(X,e),(s=>P(il(s,t),(r=>el(r,l)?it(e,s,t,r,l,n):0))))),e,t,l),delValues:wl,delValue:e=>St((e=>el(Z,e)?ut(e):0),e),delTablesSchema:Cl,delValuesSchema:kl,delSchema:()=>St((()=>{Cl(),kl()})),transaction:xl,startTransaction:Sl,getTransactionChanges:()=>[ml(O,((e,t)=>-1===il(c,t)?void 0:ml(e,((e,l)=>-1===il(il(T,t),l)?void 0:ml(e,(([,e])=>e),(e=>$l(e)))),tl,de)),tl,de),ml(q,(([,e])=>e),(e=>$l(e))),1],getTransactionLog:()=>[!tl(O),!tl(q),bl(O,zl,$l),bl($),ml(q,zl,$l),ml(A),ml(c),pl(T),bl(V),ml(R)],finishTransaction:Tl,forEachTable:e=>sl(X,((t,l)=>e(l,(e=>sl(t,((t,l)=>e(l,(e=>ul(t,e))))))))),forEachTableCell:(e,t)=>ul(il(W,S(e)),t),forEachRow:(e,t)=>sl(il(X,S(e)),((e,l)=>t(l,(t=>ul(e,t))))),forEachCell:(e,t,l)=>ul(il(il(X,S(e)),S(t)),l),forEachValue:e=>ul(Z,e),addSortedRowIdsListener:(e,t,l,n,s,r,a)=>{let o=Mt(e,t,l,n,s);return Me((()=>{const a=Mt(e,t,l,n,s);var i,u,d;u=o,z(i=a)===z(u)&&(d=(e,t)=>u[t]===e,i.every(d))||(o=a,r(Vl,e,t,l,n,s,o))}),ge[a?1:0],[e,t],[Vt])},addStartTransactionListener:e=>Me(e,Re),addWillFinishTransactionListener:e=>Me(e,qe[0]),addDidFinishTransactionListener:e=>Me(e,qe[1]),callListener:e=>(Le(e),Vl),delListener:e=>(Ne(e),Vl),getListenerStats:()=>({hasTables:El(_),tables:El(ee),tableIds:El(te),hasTable:El(le),table:El(ne),tableCellIds:El(se),hasTableCell:El(ae,Zt),rowCount:El(he),rowIds:El(be),sortedRowIds:El(ge),hasRow:El(ve,Zt),row:El(fe,Zt),cellIds:El(Ie,Zt),hasCell:El(ye,_t),cell:El(we,_t),invalidCell:El(Ce,_t),hasValues:El(xe),values:El(Se),valueIds:El(Te),hasValue:El(Ve),value:El(Oe),invalidValue:El(ke),transaction:Yt(Re)+El(qe)}),isMergeable:()=>!1,createStore:Fl,addListener:Me,callListeners:Pe,setInternalListeners:(e,t,l,n,s)=>o=[e,t,l,n,s]};return ue({[d+m]:[0,_,[],()=>[zt()]],[m]:[0,ee],[p]:[0,te],[d+h]:[1,le,[Vt],e=>[$t(...e)]],[h]:[1,ne,[Vt]],[h+I]:[1,se,[Vt]],[d+h+f]:[2,ae,[Vt,Ot],e=>[At(...e)]],[g]:[1,he,[Vt]],[v]:[1,be,[Vt]],[d+b]:[2,ve,[Vt,qt],e=>[Ft(...e)]],[b]:[2,fe,[Vt,qt]],[I]:[2,Ie,[Vt,qt]],[d+f]:[3,ye,[Vt,qt,Pt],e=>[Jt(...e)]],[f]:[3,we,[Vt,qt,Pt],e=>Ll(Nt(...e))],InvalidCell:[3,Ce],[d+w]:[0,xe,[],()=>[Dt()]],[w]:[0,Se],[C]:[0,Te],[d+y]:[1,Ve,[Et],e=>[Bt(...e)]],[y]:[1,Oe,[Et],e=>Ll(jt(e[0]))],InvalidValue:[1,ke]},(([e,t,l,n],s)=>{Vl["add"+s+"Listener"]=(...s)=>Me(s[e],t[s[e+1]?1:0],e>0?j(s,0,e):void 0,l,n)})),re(Vl)};exports.Inspector=({position:e="right",open:l=!1})=>{const n=t.useCreateStore(Fl),s=ve.indexOf(e);return t.useCreatePersister(n,(e=>{return t=be,l=sessionStorage,((e,t,l,n,s,r,a,o={},i=[])=>{let u,d,c,h=0,m=0,p=0;cl(Tl,i,(()=>0)),cl(Vl,i,(()=>[]));const[b,g,v,f,I]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!de(e)||!de(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!de(e)||!de(t),t.setContent]:$("Store type not supported by this Persister"))(a,e),y=t=>{(b&&E(null==t?void 0:t[0])?1===(null==t?void 0:t[2])?e.applyMergeableChanges:e.setMergeableContent:1===(null==t?void 0:t[2])?e.applyChanges:e.setContent)(t)},w=e=>Sl(void 0,null,(function*(){return 2!=h&&(h=1,m++,yield S((()=>Sl(void 0,null,(function*(){try{const e=yield t();E(e)?y(e):$("Content is not an array "+e)}catch(t){e&&I(e)}h=0}))))),T})),C=()=>(d&&(s(d),d=void 0),T),k=e=>Sl(void 0,null,(function*(){return 1!=h&&(h=2,p++,yield S((()=>Sl(void 0,null,(function*(){try{yield l(g,e)}catch(e){}h=0}))))),T})),x=()=>(P(c,e.delListener),c=void 0,T),S=(...e)=>Sl(void 0,null,(function*(){return Y(il(Vl,i),...e),yield Sl(void 0,null,(function*(){if(!il(Tl,i)){for(dl(Tl,i,1);!M(u=Z(il(Vl,i)));)try{yield u()}catch(e){}dl(Tl,i,0)}})),T})),T=((e,t)=>{for(var l in t||(t={}))Cl.call(t,l)&&xl(e,l,t[l]);if(wl)for(var l of wl(t))kl.call(t,l)&&xl(e,l,t[l]);return e})({load:w,startAutoLoad:e=>Sl(void 0,null,(function*(){yield C().load(e);try{d=yield n(((e,t)=>Sl(void 0,null,(function*(){t||e?2!=h&&(h=1,m++,y(null!=t?t:e),h=0):yield w()}))))}catch(e){}return T})),stopAutoLoad:C,isAutoLoading:()=>!M(d),save:k,startAutoSave:()=>Sl(void 0,null,(function*(){return yield x().save(),c=e.addDidFinishTransactionListener((()=>{const e=v();f(e)&&k(e)})),T})),stopAutoSave:x,isAutoSaving:()=>!M(c),schedule:S,getStore:()=>e,destroy:()=>(il(Vl,i).splice(0,void 0),C().stopAutoSave()),getStats:()=>({loads:m,saves:p})},o);return re(T)})(e,(()=>Ol(void 0,null,(function*(){return e=l.getItem(t),me(e,((e,t)=>""===t?void 0:t));var e}))),(e=>Ol(void 0,null,(function*(){return l.setItem(t,(n=e(),he(n,((e,t)=>void 0===t?"":t))));var n}))),(e=>{const n=n=>{if(n.storageArea===l&&n.key===t)try{e(me(n.newValue))}catch(t){e()}};return T.addEventListener(Rl,n),n}),(e=>T.removeEventListener(Rl,e)),0,3,{getStorageName:()=>t});var t,l}),void 0,(e=>{return t=function*(){yield e.load([{},{position:-1==s?1:s,open:!!l}]),yield e.startAutoSave()},new Promise(((e,l)=>{var n=e=>{try{r(t.next(e))}catch(e){l(e)}},s=e=>{try{r(t.throw(e))}catch(e){l(e)}},r=t=>t.done?e(t.value):Promise.resolve(t.value).then(n,s);r((t=t.apply(void 0,null)).next())}));var t})),J(F,null,J("aside",{id:be},J(Ge,{s:n}),J(Kt,{s:n})),J("style",null,We))};