tinybase 5.0.0 → 5.0.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 +62 -45
  2. package/@types/ui-react/index.d.ts +62 -45
  3. package/@types/ui-react/with-schemas/index.d.cts +83 -59
  4. package/@types/ui-react/with-schemas/index.d.ts +83 -59
  5. package/cjs/es6/min/ui-react/index.cjs +1 -1
  6. package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
  7. package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
  8. package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
  9. package/cjs/es6/ui-react/index.cjs +14 -34
  10. package/cjs/es6/ui-react/with-schemas/index.cjs +14 -34
  11. package/cjs/min/ui-react/index.cjs +1 -1
  12. package/cjs/min/ui-react/index.cjs.gz +0 -0
  13. package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
  14. package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
  15. package/cjs/ui-react/index.cjs +12 -12
  16. package/cjs/ui-react/with-schemas/index.cjs +12 -12
  17. package/es6/min/ui-react/index.js +1 -1
  18. package/es6/min/ui-react/index.js.gz +0 -0
  19. package/es6/min/ui-react/with-schemas/index.js +1 -1
  20. package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
  21. package/es6/ui-react/index.js +14 -34
  22. package/es6/ui-react/with-schemas/index.js +14 -34
  23. package/min/ui-react/index.js +1 -1
  24. package/min/ui-react/index.js.gz +0 -0
  25. package/min/ui-react/with-schemas/index.js +1 -1
  26. package/min/ui-react/with-schemas/index.js.gz +0 -0
  27. package/package.json +1 -1
  28. package/readme.md +40 -13
  29. package/releases.md +22 -22
  30. package/ui-react/index.js +12 -12
  31. package/ui-react/with-schemas/index.js +12 -12
  32. package/umd/es6/min/ui-react/index.js +1 -1
  33. package/umd/es6/min/ui-react/index.js.gz +0 -0
  34. package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
  35. package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
  36. package/umd/es6/ui-react/index.js +17 -34
  37. package/umd/es6/ui-react/with-schemas/index.js +17 -34
  38. package/umd/min/ui-react/index.js +1 -1
  39. package/umd/min/ui-react/index.js.gz +0 -0
  40. package/umd/min/ui-react/with-schemas/index.js +1 -1
  41. package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
  42. package/umd/ui-react/index.js +13 -12
  43. package/umd/ui-react/with-schemas/index.js +13 -12
@@ -1 +1 @@
1
- import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",b=I+u,v="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,h=(e,t,o)=>w(e)?null==o?void 0:o():t(e),k=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,O=()=>{},x=(e,t)=>e.every(t),q=(e,t)=>R(e)===R(t)&&x(e,((e,o)=>t[o]===e)),S=(e,t)=>e.map(t),j=Object,L=e=>j.getPrototypeOf(e),E=j.entries,B=e=>!w(e)&&h(L(e),(e=>e==j.prototype||w(L(e))),(()=>!0)),T=j.keys,M=(e,t)=>h(e,(e=>e[t])),F=(e,t)=>{const o=E(e);return R(o)===R(T(t))&&x(o,(([e,o])=>B(o)?!!B(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:k(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||k(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=Object.defineProperty,se=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ie=(e,t,o)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ae=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:ce,useEffect:Ie,useMemo:pe,useLayoutEffect:be,useRef:ve,useState:ge,useSyncExternalStore:ye}=e,me=[],Ce=[{},[],[me,void 0,me],void 0,!1,0],fe=[F,q,([e,t,o],[r,n,l])=>t===n&&q(e,r)&&q(o,l)],we=(e,t)=>e===t,he=(e,t,o=me)=>{const[,r]=ge(),[n,l]=ge();return Ie((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},ke=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Pe=(e,t,r,n=me)=>{const l=ve(Ce[r]),s=ce((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:Ce[r];return(null!=(d=fe[r])?d:we)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=ce((l=>ke(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]),i=ye(u,s);return 0==r?((e,t)=>{for(var o in t||(t={}))de.call(t,o)&&ie(e,o,t[o]);if(se)for(var o of se(t))ue.call(t,o)&&ie(e,o,t[o]);return e})({},i):r<3?[...i]:i},Re=(e,t,o,r=me,n=me,...l)=>be((()=>ke(t,e,...n,o,...l)),[t,e,...n,...r,...l]),Oe=(e,t,o,r=me,n=O,l=me,...s)=>{const d=J(e);return ce((e=>h(d,(r=>h(o(e,r),(o=>n(r["set"+t](...S(s,(t=>P(t)?t(e,r):t)),o),o)))))),[d,t,...r,...l,...s])},xe=(e,t,o=O,r=me,...n)=>{const l=J(e);return ce((()=>o(null==l?void 0:l["del"+t](...n))),[l,t,...r,...n])},qe=(e,t,o)=>{const r=oe(e);return ce((()=>null==r?void 0:r[t](o)),[r,t,o])},Se=(e,t=me)=>pe(e,t),je=(e,t=me)=>pe(e,t),Le=()=>z(1),Ee=e=>Pe(a,J(e),4,[]),Be=e=>Pe(a,J(e),0),Te=e=>Pe(c,J(e),1),Me=(e,t)=>Pe(i,J(t),4,[e]),Fe=(e,t)=>Pe(i,J(t),0,[e]),Ve=(e,t)=>Pe(i+y,J(t),1,[e]),Ae=(e,t,o)=>Pe(i+g,J(o),4,[e,t]),De=(e,t)=>Pe(p,J(t),5,[e]),He=(e,t)=>Pe(b,J(t),1,[e]),Qe=(e,t,o,r=0,n,l)=>Pe(v,J(l),1,[e,t,o,r,n]),We=(e,t,o)=>Pe(I,J(o),4,[e,t]),ze=(e,t,o)=>Pe(I,J(o),0,[e,t]),Ge=(e,t,o)=>Pe(y,J(o),1,[e,t]),Je=(e,t,o,r)=>Pe(g,J(r),4,[e,t,o]),Ke=(e,t,o,r)=>Pe(g,J(r),3,[e,t,o]),Ne=e=>Pe(C,J(e),4,[]),Ue=e=>Pe(C,J(e),0),Xe=e=>Pe(f,J(e),1),Ye=(e,t)=>Pe(m,J(t),4,[e]),Ze=(e,t)=>Pe(m,J(t),3,[e]),$e=(e,t,o,r,n)=>Oe(o,a,e,t,r,n),_e=(e,t,o,r,n,l)=>Oe(r,i,t,o,n,l,e),et=(e,t,o,r,n,l,s)=>Oe(n,I,o,r,l,s,e,t),tt=(e,t,o=me,r,n=O,l=me,s=!0)=>{const d=J(r);return ce((o=>h(d,(r=>h(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},ot=(e,t,o,r,n,l,s)=>Oe(n,"PartialRow",o,r,l,s,e,t),rt=(e,t,o,r,n,l,s,d)=>Oe(l,g,r,n,s,d,e,t,o),nt=(e,t,o,r,n)=>Oe(o,C,e,t,r,n),lt=(e,t,o,r,n)=>Oe(o,"PartialValues",e,t,r,n),st=(e,t,o,r,n,l)=>Oe(r,m,t,o,n,l,e),dt=(e,t,o)=>xe(e,a,t,o),ut=(e,t,o,r)=>xe(t,i,o,r,e),it=(e,t,o,r,n)=>xe(o,I,r,n,e,t),at=(e,t,o,r,n,l,s)=>xe(n,g,l,s,e,t,o,r),ct=(e,t,o)=>xe(e,C,t,o),It=(e,t,o,r)=>xe(t,m,o,r,e),pt=(e,t,o,r)=>Re(d+a,J(r),e,t,[],o),bt=(e,t,o,r)=>Re(a,J(r),e,t,me,o),vt=(e,t,o,r)=>Re(c,J(r),e,t,me,o),gt=(e,t,o,r,n)=>Re(d+i,J(n),t,o,[e],r),yt=(e,t,o,r,n)=>Re(i,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>Re(i+y,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l)=>Re(d+i+g,J(l),o,r,[e,t],n),ft=(e,t,o,r,n)=>Re(p,J(n),t,o,[e],r),wt=(e,t,o,r,n)=>Re(b,J(n),t,o,[e],r),ht=(e,t,o,r,n,l,s,d,u)=>Re(v,J(u),l,s,[e,t,o,r,n],d),kt=(e,t,o,r,n,l)=>Re(d+I,J(l),o,r,[e,t],n),Pt=(e,t,o,r,n,l)=>Re(I,J(l),o,r,[e,t],n),Rt=(e,t,o,r,n,l)=>Re(y,J(l),o,r,[e,t],n),Ot=(e,t,o,r,n,l,s)=>Re(d+g,J(s),r,n,[e,t,o],l),xt=(e,t,o,r,n,l,s)=>Re(g,J(s),r,n,[e,t,o],l),qt=(e,t,o,r)=>Re(d+C,J(r),e,t,[],o),St=(e,t,o,r)=>Re(C,J(r),e,t,me,o),jt=(e,t,o,r)=>Re(f,J(r),e,t,me,o),Lt=(e,t,o,r,n)=>Re(d+m,J(n),t,o,[e],r),Et=(e,t,o,r,n)=>Re(m,J(n),t,o,[e],r),Bt=(e,t,o)=>Re("Start"+ne,J(o),e,t),Tt=(e,t,o)=>Re("WillFinish"+ne,J(o),e,t),Mt=(e,t,o)=>Re("DidFinish"+ne,J(o),e,t),Ft=(e,t,o)=>he(e,t,o),Vt=()=>z(3),At=e=>Pe("MetricIds",U(e),1),Dt=(e,t)=>Pe("Metric",U(t),3,[e]),Ht=(e,t,o,r)=>Re("Metric",U(r),t,o,[e]),Qt=(e,t,o)=>he(e,t,o),Wt=()=>z(5),zt=(e,t)=>Pe("SliceIds",Y(t),1,[e]),Gt=e=>Pe("IndexIds",Y(e),1),Jt=(e,t,o)=>Pe("Slice"+b,Y(o),1,[e,t]),Kt=(e,t,o,r)=>Re("SliceIds",Y(r),t,o,[e]),Nt=(e,t,o,r,n)=>Re("Slice"+b,Y(n),o,r,[e,t]),Ut=(e,t,o)=>he(e,t,o),Xt=()=>z(7),Yt=e=>Pe("RelationshipIds",$(e),1),Zt=(e,t,o)=>Pe("RemoteRowId",$(o),3,[e,t]),$t=(e,t,o)=>Pe("Local"+b,$(o),1,[e,t]),_t=(e,t,o)=>Pe("Linked"+b,$(o),1,[e,t]),eo=(e,t,o,r,n)=>Re("RemoteRowId",$(n),o,r,[e,t]),to=(e,t,o,r,n)=>Re("Local"+b,$(n),o,r,[e,t]),oo=(e,t,o,r,n)=>Re("Linked"+b,$(n),o,r,[e,t]),ro=(e,t,o)=>he(e,t,o),no=()=>z(9),lo=e=>Pe("QueryIds",ee(e),1),so=(e,t)=>Pe(s+i,ee(t),0,[e]),uo=(e,t)=>Pe(s+i+y,ee(t),1,[e]),io=(e,t)=>Pe(s+p,ee(t),5,[e]),ao=(e,t)=>Pe(s+b,ee(t),1,[e]),co=(e,t,o,r=0,n,l)=>Pe(s+v,ee(l),1,[e,t,o,r,n]),Io=(e,t,o)=>Pe(s+I,ee(o),0,[e,t]),po=(e,t,o)=>Pe(s+y,ee(o),1,[e,t]),bo=(e,t,o,r)=>Pe(s+g,ee(r),3,[e,t,o]),vo=(e,t,o,r)=>Re(s+i,ee(r),t,o,[e]),go=(e,t,o,r)=>Re(s+i+y,ee(r),t,o,[e]),yo=(e,t,o,r)=>Re(s+p,ee(r),t,o,[e]),mo=(e,t,o,r)=>Re(s+b,ee(r),t,o,[e]),Co=(e,t,o,r,n,l,d,u)=>Re(s+v,ee(u),l,d,[e,t,o,r,n]),fo=(e,t,o,r,n)=>Re(s+I,ee(n),o,r,[e,t]),wo=(e,t,o,r,n)=>Re(s+y,ee(n),o,r,[e,t]),ho=(e,t,o,r,n,l)=>Re(s+g,ee(l),r,n,[e,t,o]),ko=(e,t,o)=>he(e,t,o),Po=()=>z(11),Ro=e=>Pe("CheckpointIds",oe(e),2),Oo=(e,t)=>Pe("Checkpoint",oe(t),3,[e]),xo=(e=O,t=me,o,r=O,n=me)=>{const l=oe(o);return ce((t=>h(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},qo=e=>qe(e,"goBackward"),So=e=>qe(e,"goForward"),jo=(e,t=me,o,r=O,n=me)=>{const l=oe(o);return ce((t=>h(l,(o=>h(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},Lo=e=>{var t;const r=oe(e),[n,l]=Ro(r);return[(s=n,!(0==R(s))),qo(r),l,null!=(t=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Eo=e=>{var t;const r=oe(e),[,,[n]]=Ro(r);return[!w(n),So(r),n,null!=(t=h(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Bo=(e,t,o)=>Re("CheckpointIds",oe(o),e,t),To=(e,t,o,r)=>Re("Checkpoint",oe(r),t,o,[e]),Mo=(e,t,o=me,r,n=me,l,s=me)=>{const[,d]=ge(),[u,i]=ge();return Ie((()=>{const o=e?t(e):void 0;i(o),o&&r&&ae(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),Ie((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Fo=(e,t,o=me,r,n=me)=>{const[l,s]=ge();return Ie((()=>{ae(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),Ie((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:Vo,Fragment:Ao,createElement:Do,useCallback:Ho,useLayoutEffect:Qo,useRef:Wo,useState:zo}=e,Go=(e,...t)=>w(e)?{}:e(...t),Jo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var Ko=Object.defineProperty,No=Object.defineProperties,Uo=Object.getOwnPropertyDescriptors,Xo=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,$o=(e,t,o)=>t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,_o=(e,t)=>{for(var o in t||(t={}))Yo.call(t,o)&&$o(e,o,t[o]);if(Xo)for(var o of Xo(t))Zo.call(t,o)&&$o(e,o,t[o]);return e},er=(e,t)=>No(e,Uo(t)),tr=(e,t)=>{var o={};for(var r in e)Yo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Xo)for(var r of Xo(e))t.indexOf(r)<0&&Zo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:or,useContext:rr,useMemo:nr,useState:lr}=e,sr=({tableId:e,store:t,rowComponent:o=pr,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>cr(S(d,(l=>Do(o,er(_o({},Go(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),dr=({queryId:e,queries:t,resultRowComponent:o=Or,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>cr(S(s,(n=>Do(o,er(_o({},Go(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),ur=({relationshipId:e,relationships:t,rowComponent:o=pr,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Jo($(t),e),c=s(e,d,u);return cr(S(c,(e=>Do(o,er(_o({},Go(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},ir=e=>({checkpoints:t,checkpointComponent:o=Sr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return cr(S(e(Ro(s)),(e=>Do(o,er(_o({},Go(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},ar=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=rr(H),[b,v]=lr({}),g=or(((e,t)=>v((o=>M(o,e)==t?o:er(_o({},o),{[e]:t})))),[]),y=or((e=>v((t=>_o({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Do(H.Provider,{value:nr((()=>[null!=e?e:p[0],_o(_o(_o({},p[1]),t),b),null!=o?o:p[2],_o(_o({},p[3]),r),null!=n?n:p[4],_o(_o({},p[5]),l),null!=s?s:p[6],_o(_o({},p[7]),d),null!=u?u:p[8],_o(_o({},p[9]),i),null!=a?a:p[10],_o(_o({},p[11]),c),g,y]),[e,t,b,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},cr=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:S(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},Ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return cr(o+(null!=(s=Ke(e,t,r,n))?s:o),void 0,l,r)},pr=({tableId:e,rowId:t,store:o,cellComponent:r=Ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>cr(S(((e,t,o,r)=>{const n=Ge(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Do(r,er(_o({},Go(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),br=e=>sr(e,He(e.tableId,e.store)),vr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=tr(t,["cellId","descending","offset","limit"]);return sr(s,Qe(s.tableId,o,r,n,l,s.store))},gr=({store:e,tableComponent:t=br,getTableComponentProps:o,separator:r,debugIds:n})=>cr(S(Te(e),(r=>Do(t,er(_o({},Go(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),yr=({valueId:e,store:t,debugIds:r})=>{var n;return cr(o+(null!=(n=Ze(e,t))?n:o),void 0,r,e)},mr=({store:e,valueComponent:t=yr,getValueComponentProps:o,separator:r,debugIds:n})=>cr(S(Xe(e),(r=>Do(t,er(_o({},Go(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),Cr=({metricId:e,metrics:t,debugIds:r})=>{var n;return cr(null!=(n=Dt(e,t))?n:o,void 0,r,e)},fr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=pr,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Jt(e,t,d);return cr(S(a,(e=>Do(r,er(_o({},Go(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},wr=({indexId:e,indexes:t,sliceComponent:o=fr,getSliceComponentProps:r,separator:n,debugIds:l})=>cr(S(zt(e,t),(n=>Do(o,er(_o({},Go(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),hr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=pr,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Jo($(o),e),i=Zt(e,t,s);return cr(w(u)||w(i)?null:Do(r,er(_o({},Go(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},kr=e=>ur(e,$t,e.remoteRowId),Pr=e=>ur(e,_t,e.firstRowId),Rr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return cr(o+(null!=(s=bo(e,t,r,n))?s:o),void 0,l,r)},Or=({queryId:e,rowId:t,queries:o,resultCellComponent:r=Rr,getResultCellComponentProps:n,separator:l,debugIds:s})=>cr(S(po(e,t,o),(l=>Do(r,er(_o({},Go(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),xr=e=>dr(e,ao(e.queryId,e.queries)),qr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=tr(t,["cellId","descending","offset","limit"]);return dr(s,co(s.queryId,o,r,n,l,s.queries))},Sr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return cr(null!=(n=Oo(t,e))?n:o,void 0,r,t)},jr=ir((e=>e[0])),Lr=ir((e=>w(e[1])?[]:[e[1]])),Er=ir((e=>e[2]));export{jr as BackwardCheckpointsView,Ir as CellView,Sr as CheckpointView,Lr as CurrentCheckpointView,Er as ForwardCheckpointsView,wr as IndexView,Pr as LinkedRowsView,kr as LocalRowsView,Cr as MetricView,ar as Provider,hr as RemoteRowView,Rr as ResultCellView,Or as ResultRowView,qr as ResultSortedTableView,xr as ResultTableView,pr as RowView,fr as SliceView,vr as SortedTableView,br as TableView,gr as TablesView,yr as ValueView,mr as ValuesView,tt as useAddRowCallback,Ke as useCell,Ge as useCellIds,Rt as useCellIdsListener,xt as useCellListener,Oo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,te as useCheckpoints,Po as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,ko as useCreateCheckpoints,Qt as useCreateIndexes,je as useCreateMergeableStore,Ft as useCreateMetrics,Mo as useCreatePersister,ro as useCreateQueries,Ut as useCreateRelationships,Se as useCreateStore,Fo as useCreateSynchronizer,at as useDelCellCallback,it as useDelRowCallback,ut as useDelTableCallback,dt as useDelTablesCallback,It as useDelValueCallback,ct as useDelValuesCallback,Mt as useDidFinishTransactionListener,qo as useGoBackwardCallback,So as useGoForwardCallback,jo as useGoToCallback,Je as useHasCell,Ot as useHasCellListener,We as useHasRow,kt as useHasRowListener,Me as useHasTable,Ae as useHasTableCell,Ct as useHasTableCellListener,gt as useHasTableListener,Ee as useHasTables,pt as useHasTablesListener,Ye as useHasValue,Lt as useHasValueListener,Ne as useHasValues,qt as useHasValuesListener,Gt as useIndexIds,X as useIndexes,Wt as useIndexesIds,Y as useIndexesOrIndexesById,_t as useLinkedRowIds,oo as useLinkedRowIdsListener,$t as useLocalRowIds,to as useLocalRowIdsListener,Dt as useMetric,At as useMetricIds,Ht as useMetricListener,N as useMetrics,Vt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,no as useQueriesIds,ee as useQueriesOrQueriesById,lo as useQueryIds,Eo as useRedoInformation,Yt as useRelationshipIds,Z as useRelationships,Xt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Zt as useRemoteRowId,eo as useRemoteRowIdListener,bo as useResultCell,po as useResultCellIds,wo as useResultCellIdsListener,ho as useResultCellListener,Io as useResultRow,io as useResultRowCount,yo as useResultRowCountListener,ao as useResultRowIds,mo as useResultRowIdsListener,fo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,uo as useResultTableCellIds,go as useResultTableCellIdsListener,vo as useResultTableListener,ze as useRow,De as useRowCount,ft as useRowCountListener,He as useRowIds,wt as useRowIdsListener,Pt as useRowListener,rt as useSetCellCallback,xo as useSetCheckpointCallback,ot as useSetPartialRowCallback,lt as useSetPartialValuesCallback,et as useSetRowCallback,_e as useSetTableCallback,$e as useSetTablesCallback,st as useSetValueCallback,nt as useSetValuesCallback,zt as useSliceIds,Kt as useSliceIdsListener,Jt as useSliceRowIds,Nt as useSliceRowIdsListener,Qe as useSortedRowIds,ht as useSortedRowIdsListener,Bt as useStartTransactionListener,G as useStore,Le as useStoreIds,J as useStoreOrStoreById,Fe as useTable,Ve as useTableCellIds,mt as useTableCellIdsListener,Te as useTableIds,vt as useTableIdsListener,yt as useTableListener,Be as useTables,bt as useTablesListener,Lo as useUndoInformation,Ze as useValue,Xe as useValueIds,jt as useValueIdsListener,Et as useValueListener,Ue as useValues,St as useValuesListener,Tt as useWillFinishTransactionListener};
1
+ import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,k=(e,t,o)=>w(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!w(e)&&k(j(e),(e=>e==L.prototype||w(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ae,useState:ce,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ce(),[n,l]=ce();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ae(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},fe=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),we=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...ke(s,r,e),o),o)))))),[d,t,...r,...l,...he(s)])},ke=(e,t,o)=>O(e,(e=>P(e)?e(o,t):e)),he=e=>{return t=e=>!P(e),e.filter(t);var t},Pe=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((e=>o(null==l?void 0:l["del"+t](...ke(n,l,e)))),[l,t,...r,...he(n)])},Re=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},xe=(e,t=pe)=>ue(e,t),qe=(e,t=pe)=>ue(e,t),Se=()=>z(1),Oe=e=>Ce(a,J(e),4,[]),Le=e=>Ce(a,J(e),0),je=e=>Ce(c,J(e),1),Be=(e,t)=>Ce(i,J(t),4,[e]),Ee=(e,t)=>Ce(i,J(t),0,[e]),Te=(e,t)=>Ce(i+y,J(t),1,[e]),Me=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Fe=(e,t)=>Ce(p,J(t),5,[e]),Ve=(e,t)=>Ce(v,J(t),1,[e]),Ae=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),De=(e,t,o)=>Ce(I,J(o),4,[e,t]),He=(e,t,o)=>Ce(I,J(o),0,[e,t]),Qe=(e,t,o)=>Ce(y,J(o),1,[e,t]),We=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),ze=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),Ge=e=>Ce(C,J(e),4,[]),Je=e=>Ce(C,J(e),0),Ke=e=>Ce(f,J(e),1),Ne=(e,t)=>Ce(m,J(t),4,[e]),Ue=(e,t)=>Ce(m,J(t),3,[e]),Xe=(e,t,o,r,n)=>we(o,a,e,t,r,n),Ye=(e,t,o,r,n,l)=>we(r,i,t,o,n,l,e),Ze=(e,t,o,r,n,l,s)=>we(n,I,o,r,l,s,e,t),$e=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},_e=(e,t,o,r,n,l,s)=>we(n,"PartialRow",o,r,l,s,e,t),et=(e,t,o,r,n,l,s,d)=>we(l,g,r,n,s,d,e,t,o),tt=(e,t,o,r,n)=>we(o,C,e,t,r,n),ot=(e,t,o,r,n)=>we(o,"PartialValues",e,t,r,n),rt=(e,t,o,r,n,l)=>we(r,m,t,o,n,l,e),nt=(e,t,o)=>Pe(e,a,t,o),lt=(e,t,o,r)=>Pe(t,i,o,r,e),st=(e,t,o,r,n)=>Pe(o,I,r,n,e,t),dt=(e,t,o,r,n,l,s)=>Pe(n,g,l,s,e,t,o,r),ut=(e,t,o)=>Pe(e,C,t,o),it=(e,t,o,r)=>Pe(t,m,o,r,e),at=(e,t,o,r)=>fe(d+a,J(r),e,t,[],o),ct=(e,t,o,r)=>fe(a,J(r),e,t,pe,o),It=(e,t,o,r)=>fe(c,J(r),e,t,pe,o),pt=(e,t,o,r,n)=>fe(d+i,J(n),t,o,[e],r),vt=(e,t,o,r,n)=>fe(i,J(n),t,o,[e],r),bt=(e,t,o,r,n)=>fe(i+y,J(n),t,o,[e],r),gt=(e,t,o,r,n,l)=>fe(d+i+g,J(l),o,r,[e,t],n),yt=(e,t,o,r,n)=>fe(p,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>fe(v,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l,s,d,u)=>fe(b,J(u),l,s,[e,t,o,r,n],d),ft=(e,t,o,r,n,l)=>fe(d+I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>fe(I,J(l),o,r,[e,t],n),kt=(e,t,o,r,n,l)=>fe(y,J(l),o,r,[e,t],n),ht=(e,t,o,r,n,l,s)=>fe(d+g,J(s),r,n,[e,t,o],l),Pt=(e,t,o,r,n,l,s)=>fe(g,J(s),r,n,[e,t,o],l),Rt=(e,t,o,r)=>fe(d+C,J(r),e,t,[],o),xt=(e,t,o,r)=>fe(C,J(r),e,t,pe,o),qt=(e,t,o,r)=>fe(f,J(r),e,t,pe,o),St=(e,t,o,r,n)=>fe(d+m,J(n),t,o,[e],r),Ot=(e,t,o,r,n)=>fe(m,J(n),t,o,[e],r),Lt=(e,t,o)=>fe("Start"+ne,J(o),e,t),jt=(e,t,o)=>fe("WillFinish"+ne,J(o),e,t),Bt=(e,t,o)=>fe("DidFinish"+ne,J(o),e,t),Et=(e,t,o)=>ye(e,t,o),Tt=()=>z(3),Mt=e=>Ce("MetricIds",U(e),1),Ft=(e,t)=>Ce("Metric",U(t),3,[e]),Vt=(e,t,o,r)=>fe("Metric",U(r),t,o,[e]),At=(e,t,o)=>ye(e,t,o),Dt=()=>z(5),Ht=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Qt=e=>Ce("IndexIds",Y(e),1),Wt=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),zt=(e,t,o,r)=>fe("SliceIds",Y(r),t,o,[e]),Gt=(e,t,o,r,n)=>fe("Slice"+v,Y(n),o,r,[e,t]),Jt=(e,t,o)=>ye(e,t,o),Kt=()=>z(7),Nt=e=>Ce("RelationshipIds",$(e),1),Ut=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Xt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Yt=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Zt=(e,t,o,r,n)=>fe("RemoteRowId",$(n),o,r,[e,t]),$t=(e,t,o,r,n)=>fe("Local"+v,$(n),o,r,[e,t]),_t=(e,t,o,r,n)=>fe("Linked"+v,$(n),o,r,[e,t]),eo=(e,t,o)=>ye(e,t,o),to=()=>z(9),oo=e=>Ce("QueryIds",ee(e),1),ro=(e,t)=>Ce(s+i,ee(t),0,[e]),no=(e,t)=>Ce(s+i+y,ee(t),1,[e]),lo=(e,t)=>Ce(s+p,ee(t),5,[e]),so=(e,t)=>Ce(s+v,ee(t),1,[e]),uo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),io=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),ao=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),co=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),Io=(e,t,o,r)=>fe(s+i,ee(r),t,o,[e]),po=(e,t,o,r)=>fe(s+i+y,ee(r),t,o,[e]),vo=(e,t,o,r)=>fe(s+p,ee(r),t,o,[e]),bo=(e,t,o,r)=>fe(s+v,ee(r),t,o,[e]),go=(e,t,o,r,n,l,d,u)=>fe(s+b,ee(u),l,d,[e,t,o,r,n]),yo=(e,t,o,r,n)=>fe(s+I,ee(n),o,r,[e,t]),mo=(e,t,o,r,n)=>fe(s+y,ee(n),o,r,[e,t]),Co=(e,t,o,r,n,l)=>fe(s+g,ee(l),r,n,[e,t,o]),fo=(e,t,o)=>ye(e,t,o),wo=()=>z(11),ko=e=>Ce("CheckpointIds",oe(e),2),ho=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),Po=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},Ro=e=>Re(e,"goBackward"),xo=e=>Re(e,"goForward"),qo=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},So=e=>{var t;const r=oe(e),[n,l]=ko(r);return[(s=n,!(0==R(s))),Ro(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Oo=e=>{var t;const r=oe(e),[,,[n]]=ko(r);return[!w(n),xo(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Lo=(e,t,o)=>fe("CheckpointIds",oe(o),e,t),jo=(e,t,o,r)=>fe("Checkpoint",oe(r),t,o,[e]),Bo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ce(),[u,i]=ce();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Eo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ce();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:To,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>w(e)?{}:e(...t),Wo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var zo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Xo=(e,t,o)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Yo=(e,t)=>{for(var o in t||(t={}))No.call(t,o)&&Xo(e,o,t[o]);if(Ko)for(var o of Ko(t))Uo.call(t,o)&&Xo(e,o,t[o]);return e},Zo=(e,t)=>Go(e,Jo(t)),$o=(e,t)=>{var o={};for(var r in e)No.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Ko)for(var r of Ko(e))t.indexOf(r)<0&&Uo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:_o,useContext:er,useMemo:tr,useState:or}=e,rr=({tableId:e,store:t,rowComponent:o=ar,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>ur(O(d,(l=>Fo(o,Zo(Yo({},Qo(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),nr=({queryId:e,queries:t,resultRowComponent:o=hr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>ur(O(s,(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),lr=({relationshipId:e,relationships:t,rowComponent:o=ar,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Wo($(t),e),c=s(e,d,u);return ur(O(c,(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},sr=e=>({checkpoints:t,checkpointComponent:o=xr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return ur(O(e(ko(s)),(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},dr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=er(H),[v,b]=or({}),g=_o(((e,t)=>b((o=>M(o,e)==t?o:Zo(Yo({},o),{[e]:t})))),[]),y=_o((e=>b((t=>Yo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Fo(H.Provider,{value:tr((()=>[null!=e?e:p[0],Yo(Yo(Yo({},p[1]),t),v),null!=o?o:p[2],Yo(Yo({},p[3]),r),null!=n?n:p[4],Yo(Yo({},p[5]),l),null!=s?s:p[6],Yo(Yo({},p[7]),d),null!=u?u:p[8],Yo(Yo({},p[9]),i),null!=a?a:p[10],Yo(Yo({},p[11]),c),g,y]),[e,t,v,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},ur=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return ur(o+(null!=(s=ze(e,t,r,n))?s:o),void 0,l,r)},ar=({tableId:e,rowId:t,store:o,cellComponent:r=ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>ur(O(((e,t,o,r)=>{const n=Qe(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),cr=e=>rr(e,Ve(e.tableId,e.store)),Ir=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return rr(s,Ae(s.tableId,o,r,n,l,s.store))},pr=({store:e,tableComponent:t=cr,getTableComponentProps:o,separator:r,debugIds:n})=>ur(O(je(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),vr=({valueId:e,store:t,debugIds:r})=>{var n;return ur(o+(null!=(n=Ue(e,t))?n:o),void 0,r,e)},br=({store:e,valueComponent:t=vr,getValueComponentProps:o,separator:r,debugIds:n})=>ur(O(Ke(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),gr=({metricId:e,metrics:t,debugIds:r})=>{var n;return ur(null!=(n=Ft(e,t))?n:o,void 0,r,e)},yr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ar,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Wt(e,t,d);return ur(O(a,(e=>Fo(r,Zo(Yo({},Qo(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},mr=({indexId:e,indexes:t,sliceComponent:o=yr,getSliceComponentProps:r,separator:n,debugIds:l})=>ur(O(Ht(e,t),(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),Cr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ar,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Wo($(o),e),i=Ut(e,t,s);return ur(w(u)||w(i)?null:Fo(r,Zo(Yo({},Qo(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},fr=e=>lr(e,Xt,e.remoteRowId),wr=e=>lr(e,Yt,e.firstRowId),kr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return ur(o+(null!=(s=co(e,t,r,n))?s:o),void 0,l,r)},hr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=kr,getResultCellComponentProps:n,separator:l,debugIds:s})=>ur(O(ao(e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),Pr=e=>nr(e,so(e.queryId,e.queries)),Rr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return nr(s,uo(s.queryId,o,r,n,l,s.queries))},xr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return ur(null!=(n=ho(t,e))?n:o,void 0,r,t)},qr=sr((e=>e[0])),Sr=sr((e=>w(e[1])?[]:[e[1]])),Or=sr((e=>e[2]));export{qr as BackwardCheckpointsView,ir as CellView,xr as CheckpointView,Sr as CurrentCheckpointView,Or as ForwardCheckpointsView,mr as IndexView,wr as LinkedRowsView,fr as LocalRowsView,gr as MetricView,dr as Provider,Cr as RemoteRowView,kr as ResultCellView,hr as ResultRowView,Rr as ResultSortedTableView,Pr as ResultTableView,ar as RowView,yr as SliceView,Ir as SortedTableView,cr as TableView,pr as TablesView,vr as ValueView,br as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,kt as useCellIdsListener,Pt as useCellListener,ho as useCheckpoint,ko as useCheckpointIds,Lo as useCheckpointIdsListener,jo as useCheckpointListener,te as useCheckpoints,wo as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Et as useCreateMetrics,Bo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,xe as useCreateStore,Eo as useCreateSynchronizer,dt as useDelCellCallback,st as useDelRowCallback,lt as useDelTableCallback,nt as useDelTablesCallback,it as useDelValueCallback,ut as useDelValuesCallback,Bt as useDidFinishTransactionListener,Ro as useGoBackwardCallback,xo as useGoForwardCallback,qo as useGoToCallback,We as useHasCell,ht as useHasCellListener,De as useHasRow,ft as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,pt as useHasTableListener,Oe as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,Rt as useHasValuesListener,Qt as useIndexIds,X as useIndexes,Dt as useIndexesIds,Y as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,N as useMetrics,Tt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,to as useQueriesIds,ee as useQueriesOrQueriesById,oo as useQueryIds,Oo as useRedoInformation,Nt as useRelationshipIds,Z as useRelationships,Kt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,co as useResultCell,ao as useResultCellIds,mo as useResultCellIdsListener,Co as useResultCellListener,io as useResultRow,lo as useResultRowCount,vo as useResultRowCountListener,so as useResultRowIds,bo as useResultRowIdsListener,yo as useResultRowListener,uo as useResultSortedRowIds,go as useResultSortedRowIdsListener,ro as useResultTable,no as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Fe as useRowCount,yt as useRowCountListener,Ve as useRowIds,mt as useRowIdsListener,wt as useRowListener,et as useSetCellCallback,Po as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,rt as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,Ae as useSortedRowIds,Ct as useSortedRowIdsListener,Lt as useStartTransactionListener,G as useStore,Se as useStoreIds,J as useStoreOrStoreById,Ee as useTable,Te as useTableCellIds,bt as useTableCellIdsListener,je as useTableIds,It as useTableIdsListener,vt as useTableListener,Le as useTables,ct as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,qt as useValueIdsListener,Ot as useValueListener,Je as useValues,xt as useValuesListener,jt as useWillFinishTransactionListener};
Binary file
@@ -1 +1 @@
1
- import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",b=I+u,v="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,h=(e,t,o)=>w(e)?null==o?void 0:o():t(e),k=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,O=()=>{},x=(e,t)=>e.every(t),q=(e,t)=>R(e)===R(t)&&x(e,((e,o)=>t[o]===e)),S=(e,t)=>e.map(t),j=Object,L=e=>j.getPrototypeOf(e),E=j.entries,B=e=>!w(e)&&h(L(e),(e=>e==j.prototype||w(L(e))),(()=>!0)),T=j.keys,M=(e,t)=>h(e,(e=>e[t])),F=(e,t)=>{const o=E(e);return R(o)===R(T(t))&&x(o,(([e,o])=>B(o)?!!B(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:k(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||k(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=Object.defineProperty,se=Object.getOwnPropertySymbols,de=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ie=(e,t,o)=>t in e?le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,ae=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:ce,useEffect:Ie,useMemo:pe,useLayoutEffect:be,useRef:ve,useState:ge,useSyncExternalStore:ye}=e,me=[],Ce=[{},[],[me,void 0,me],void 0,!1,0],fe=[F,q,([e,t,o],[r,n,l])=>t===n&&q(e,r)&&q(o,l)],we=(e,t)=>e===t,he=(e,t,o=me)=>{const[,r]=ge(),[n,l]=ge();return Ie((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},ke=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Pe=(e,t,r,n=me)=>{const l=ve(Ce[r]),s=ce((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:Ce[r];return(null!=(d=fe[r])?d:we)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=ce((l=>ke(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]),i=ye(u,s);return 0==r?((e,t)=>{for(var o in t||(t={}))de.call(t,o)&&ie(e,o,t[o]);if(se)for(var o of se(t))ue.call(t,o)&&ie(e,o,t[o]);return e})({},i):r<3?[...i]:i},Re=(e,t,o,r=me,n=me,...l)=>be((()=>ke(t,e,...n,o,...l)),[t,e,...n,...r,...l]),Oe=(e,t,o,r=me,n=O,l=me,...s)=>{const d=J(e);return ce((e=>h(d,(r=>h(o(e,r),(o=>n(r["set"+t](...S(s,(t=>P(t)?t(e,r):t)),o),o)))))),[d,t,...r,...l,...s])},xe=(e,t,o=O,r=me,...n)=>{const l=J(e);return ce((()=>o(null==l?void 0:l["del"+t](...n))),[l,t,...r,...n])},qe=(e,t,o)=>{const r=oe(e);return ce((()=>null==r?void 0:r[t](o)),[r,t,o])},Se=(e,t=me)=>pe(e,t),je=(e,t=me)=>pe(e,t),Le=()=>z(1),Ee=e=>Pe(a,J(e),4,[]),Be=e=>Pe(a,J(e),0),Te=e=>Pe(c,J(e),1),Me=(e,t)=>Pe(i,J(t),4,[e]),Fe=(e,t)=>Pe(i,J(t),0,[e]),Ve=(e,t)=>Pe(i+y,J(t),1,[e]),Ae=(e,t,o)=>Pe(i+g,J(o),4,[e,t]),De=(e,t)=>Pe(p,J(t),5,[e]),He=(e,t)=>Pe(b,J(t),1,[e]),Qe=(e,t,o,r=0,n,l)=>Pe(v,J(l),1,[e,t,o,r,n]),We=(e,t,o)=>Pe(I,J(o),4,[e,t]),ze=(e,t,o)=>Pe(I,J(o),0,[e,t]),Ge=(e,t,o)=>Pe(y,J(o),1,[e,t]),Je=(e,t,o,r)=>Pe(g,J(r),4,[e,t,o]),Ke=(e,t,o,r)=>Pe(g,J(r),3,[e,t,o]),Ne=e=>Pe(C,J(e),4,[]),Ue=e=>Pe(C,J(e),0),Xe=e=>Pe(f,J(e),1),Ye=(e,t)=>Pe(m,J(t),4,[e]),Ze=(e,t)=>Pe(m,J(t),3,[e]),$e=(e,t,o,r,n)=>Oe(o,a,e,t,r,n),_e=(e,t,o,r,n,l)=>Oe(r,i,t,o,n,l,e),et=(e,t,o,r,n,l,s)=>Oe(n,I,o,r,l,s,e,t),tt=(e,t,o=me,r,n=O,l=me,s=!0)=>{const d=J(r);return ce((o=>h(d,(r=>h(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},ot=(e,t,o,r,n,l,s)=>Oe(n,"PartialRow",o,r,l,s,e,t),rt=(e,t,o,r,n,l,s,d)=>Oe(l,g,r,n,s,d,e,t,o),nt=(e,t,o,r,n)=>Oe(o,C,e,t,r,n),lt=(e,t,o,r,n)=>Oe(o,"PartialValues",e,t,r,n),st=(e,t,o,r,n,l)=>Oe(r,m,t,o,n,l,e),dt=(e,t,o)=>xe(e,a,t,o),ut=(e,t,o,r)=>xe(t,i,o,r,e),it=(e,t,o,r,n)=>xe(o,I,r,n,e,t),at=(e,t,o,r,n,l,s)=>xe(n,g,l,s,e,t,o,r),ct=(e,t,o)=>xe(e,C,t,o),It=(e,t,o,r)=>xe(t,m,o,r,e),pt=(e,t,o,r)=>Re(d+a,J(r),e,t,[],o),bt=(e,t,o,r)=>Re(a,J(r),e,t,me,o),vt=(e,t,o,r)=>Re(c,J(r),e,t,me,o),gt=(e,t,o,r,n)=>Re(d+i,J(n),t,o,[e],r),yt=(e,t,o,r,n)=>Re(i,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>Re(i+y,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l)=>Re(d+i+g,J(l),o,r,[e,t],n),ft=(e,t,o,r,n)=>Re(p,J(n),t,o,[e],r),wt=(e,t,o,r,n)=>Re(b,J(n),t,o,[e],r),ht=(e,t,o,r,n,l,s,d,u)=>Re(v,J(u),l,s,[e,t,o,r,n],d),kt=(e,t,o,r,n,l)=>Re(d+I,J(l),o,r,[e,t],n),Pt=(e,t,o,r,n,l)=>Re(I,J(l),o,r,[e,t],n),Rt=(e,t,o,r,n,l)=>Re(y,J(l),o,r,[e,t],n),Ot=(e,t,o,r,n,l,s)=>Re(d+g,J(s),r,n,[e,t,o],l),xt=(e,t,o,r,n,l,s)=>Re(g,J(s),r,n,[e,t,o],l),qt=(e,t,o,r)=>Re(d+C,J(r),e,t,[],o),St=(e,t,o,r)=>Re(C,J(r),e,t,me,o),jt=(e,t,o,r)=>Re(f,J(r),e,t,me,o),Lt=(e,t,o,r,n)=>Re(d+m,J(n),t,o,[e],r),Et=(e,t,o,r,n)=>Re(m,J(n),t,o,[e],r),Bt=(e,t,o)=>Re("Start"+ne,J(o),e,t),Tt=(e,t,o)=>Re("WillFinish"+ne,J(o),e,t),Mt=(e,t,o)=>Re("DidFinish"+ne,J(o),e,t),Ft=(e,t,o)=>he(e,t,o),Vt=()=>z(3),At=e=>Pe("MetricIds",U(e),1),Dt=(e,t)=>Pe("Metric",U(t),3,[e]),Ht=(e,t,o,r)=>Re("Metric",U(r),t,o,[e]),Qt=(e,t,o)=>he(e,t,o),Wt=()=>z(5),zt=(e,t)=>Pe("SliceIds",Y(t),1,[e]),Gt=e=>Pe("IndexIds",Y(e),1),Jt=(e,t,o)=>Pe("Slice"+b,Y(o),1,[e,t]),Kt=(e,t,o,r)=>Re("SliceIds",Y(r),t,o,[e]),Nt=(e,t,o,r,n)=>Re("Slice"+b,Y(n),o,r,[e,t]),Ut=(e,t,o)=>he(e,t,o),Xt=()=>z(7),Yt=e=>Pe("RelationshipIds",$(e),1),Zt=(e,t,o)=>Pe("RemoteRowId",$(o),3,[e,t]),$t=(e,t,o)=>Pe("Local"+b,$(o),1,[e,t]),_t=(e,t,o)=>Pe("Linked"+b,$(o),1,[e,t]),eo=(e,t,o,r,n)=>Re("RemoteRowId",$(n),o,r,[e,t]),to=(e,t,o,r,n)=>Re("Local"+b,$(n),o,r,[e,t]),oo=(e,t,o,r,n)=>Re("Linked"+b,$(n),o,r,[e,t]),ro=(e,t,o)=>he(e,t,o),no=()=>z(9),lo=e=>Pe("QueryIds",ee(e),1),so=(e,t)=>Pe(s+i,ee(t),0,[e]),uo=(e,t)=>Pe(s+i+y,ee(t),1,[e]),io=(e,t)=>Pe(s+p,ee(t),5,[e]),ao=(e,t)=>Pe(s+b,ee(t),1,[e]),co=(e,t,o,r=0,n,l)=>Pe(s+v,ee(l),1,[e,t,o,r,n]),Io=(e,t,o)=>Pe(s+I,ee(o),0,[e,t]),po=(e,t,o)=>Pe(s+y,ee(o),1,[e,t]),bo=(e,t,o,r)=>Pe(s+g,ee(r),3,[e,t,o]),vo=(e,t,o,r)=>Re(s+i,ee(r),t,o,[e]),go=(e,t,o,r)=>Re(s+i+y,ee(r),t,o,[e]),yo=(e,t,o,r)=>Re(s+p,ee(r),t,o,[e]),mo=(e,t,o,r)=>Re(s+b,ee(r),t,o,[e]),Co=(e,t,o,r,n,l,d,u)=>Re(s+v,ee(u),l,d,[e,t,o,r,n]),fo=(e,t,o,r,n)=>Re(s+I,ee(n),o,r,[e,t]),wo=(e,t,o,r,n)=>Re(s+y,ee(n),o,r,[e,t]),ho=(e,t,o,r,n,l)=>Re(s+g,ee(l),r,n,[e,t,o]),ko=(e,t,o)=>he(e,t,o),Po=()=>z(11),Ro=e=>Pe("CheckpointIds",oe(e),2),Oo=(e,t)=>Pe("Checkpoint",oe(t),3,[e]),xo=(e=O,t=me,o,r=O,n=me)=>{const l=oe(o);return ce((t=>h(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},qo=e=>qe(e,"goBackward"),So=e=>qe(e,"goForward"),jo=(e,t=me,o,r=O,n=me)=>{const l=oe(o);return ce((t=>h(l,(o=>h(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},Lo=e=>{var t;const r=oe(e),[n,l]=Ro(r);return[(s=n,!(0==R(s))),qo(r),l,null!=(t=h(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Eo=e=>{var t;const r=oe(e),[,,[n]]=Ro(r);return[!w(n),So(r),n,null!=(t=h(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Bo=(e,t,o)=>Re("CheckpointIds",oe(o),e,t),To=(e,t,o,r)=>Re("Checkpoint",oe(r),t,o,[e]),Mo=(e,t,o=me,r,n=me,l,s=me)=>{const[,d]=ge(),[u,i]=ge();return Ie((()=>{const o=e?t(e):void 0;i(o),o&&r&&ae(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),Ie((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Fo=(e,t,o=me,r,n=me)=>{const[l,s]=ge();return Ie((()=>{ae(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),Ie((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:Vo,Fragment:Ao,createElement:Do,useCallback:Ho,useLayoutEffect:Qo,useRef:Wo,useState:zo}=e,Go=(e,...t)=>w(e)?{}:e(...t),Jo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var Ko=Object.defineProperty,No=Object.defineProperties,Uo=Object.getOwnPropertyDescriptors,Xo=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable,$o=(e,t,o)=>t in e?Ko(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,_o=(e,t)=>{for(var o in t||(t={}))Yo.call(t,o)&&$o(e,o,t[o]);if(Xo)for(var o of Xo(t))Zo.call(t,o)&&$o(e,o,t[o]);return e},er=(e,t)=>No(e,Uo(t)),tr=(e,t)=>{var o={};for(var r in e)Yo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Xo)for(var r of Xo(e))t.indexOf(r)<0&&Zo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:or,useContext:rr,useMemo:nr,useState:lr}=e,sr=({tableId:e,store:t,rowComponent:o=pr,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>cr(S(d,(l=>Do(o,er(_o({},Go(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),dr=({queryId:e,queries:t,resultRowComponent:o=Or,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>cr(S(s,(n=>Do(o,er(_o({},Go(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),ur=({relationshipId:e,relationships:t,rowComponent:o=pr,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Jo($(t),e),c=s(e,d,u);return cr(S(c,(e=>Do(o,er(_o({},Go(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},ir=e=>({checkpoints:t,checkpointComponent:o=Sr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return cr(S(e(Ro(s)),(e=>Do(o,er(_o({},Go(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},ar=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=rr(H),[b,v]=lr({}),g=or(((e,t)=>v((o=>M(o,e)==t?o:er(_o({},o),{[e]:t})))),[]),y=or((e=>v((t=>_o({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Do(H.Provider,{value:nr((()=>[null!=e?e:p[0],_o(_o(_o({},p[1]),t),b),null!=o?o:p[2],_o(_o({},p[3]),r),null!=n?n:p[4],_o(_o({},p[5]),l),null!=s?s:p[6],_o(_o({},p[7]),d),null!=u?u:p[8],_o(_o({},p[9]),i),null!=a?a:p[10],_o(_o({},p[11]),c),g,y]),[e,t,b,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},cr=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:S(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},Ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return cr(o+(null!=(s=Ke(e,t,r,n))?s:o),void 0,l,r)},pr=({tableId:e,rowId:t,store:o,cellComponent:r=Ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>cr(S(((e,t,o,r)=>{const n=Ge(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Do(r,er(_o({},Go(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),br=e=>sr(e,He(e.tableId,e.store)),vr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=tr(t,["cellId","descending","offset","limit"]);return sr(s,Qe(s.tableId,o,r,n,l,s.store))},gr=({store:e,tableComponent:t=br,getTableComponentProps:o,separator:r,debugIds:n})=>cr(S(Te(e),(r=>Do(t,er(_o({},Go(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),yr=({valueId:e,store:t,debugIds:r})=>{var n;return cr(o+(null!=(n=Ze(e,t))?n:o),void 0,r,e)},mr=({store:e,valueComponent:t=yr,getValueComponentProps:o,separator:r,debugIds:n})=>cr(S(Xe(e),(r=>Do(t,er(_o({},Go(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),Cr=({metricId:e,metrics:t,debugIds:r})=>{var n;return cr(null!=(n=Dt(e,t))?n:o,void 0,r,e)},fr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=pr,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Jt(e,t,d);return cr(S(a,(e=>Do(r,er(_o({},Go(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},wr=({indexId:e,indexes:t,sliceComponent:o=fr,getSliceComponentProps:r,separator:n,debugIds:l})=>cr(S(zt(e,t),(n=>Do(o,er(_o({},Go(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),hr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=pr,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Jo($(o),e),i=Zt(e,t,s);return cr(w(u)||w(i)?null:Do(r,er(_o({},Go(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},kr=e=>ur(e,$t,e.remoteRowId),Pr=e=>ur(e,_t,e.firstRowId),Rr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return cr(o+(null!=(s=bo(e,t,r,n))?s:o),void 0,l,r)},Or=({queryId:e,rowId:t,queries:o,resultCellComponent:r=Rr,getResultCellComponentProps:n,separator:l,debugIds:s})=>cr(S(po(e,t,o),(l=>Do(r,er(_o({},Go(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),xr=e=>dr(e,ao(e.queryId,e.queries)),qr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=tr(t,["cellId","descending","offset","limit"]);return dr(s,co(s.queryId,o,r,n,l,s.queries))},Sr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return cr(null!=(n=Oo(t,e))?n:o,void 0,r,t)},jr=ir((e=>e[0])),Lr=ir((e=>w(e[1])?[]:[e[1]])),Er=ir((e=>e[2]));export{jr as BackwardCheckpointsView,Ir as CellView,Sr as CheckpointView,Lr as CurrentCheckpointView,Er as ForwardCheckpointsView,wr as IndexView,Pr as LinkedRowsView,kr as LocalRowsView,Cr as MetricView,ar as Provider,hr as RemoteRowView,Rr as ResultCellView,Or as ResultRowView,qr as ResultSortedTableView,xr as ResultTableView,pr as RowView,fr as SliceView,vr as SortedTableView,br as TableView,gr as TablesView,yr as ValueView,mr as ValuesView,tt as useAddRowCallback,Ke as useCell,Ge as useCellIds,Rt as useCellIdsListener,xt as useCellListener,Oo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,te as useCheckpoints,Po as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,ko as useCreateCheckpoints,Qt as useCreateIndexes,je as useCreateMergeableStore,Ft as useCreateMetrics,Mo as useCreatePersister,ro as useCreateQueries,Ut as useCreateRelationships,Se as useCreateStore,Fo as useCreateSynchronizer,at as useDelCellCallback,it as useDelRowCallback,ut as useDelTableCallback,dt as useDelTablesCallback,It as useDelValueCallback,ct as useDelValuesCallback,Mt as useDidFinishTransactionListener,qo as useGoBackwardCallback,So as useGoForwardCallback,jo as useGoToCallback,Je as useHasCell,Ot as useHasCellListener,We as useHasRow,kt as useHasRowListener,Me as useHasTable,Ae as useHasTableCell,Ct as useHasTableCellListener,gt as useHasTableListener,Ee as useHasTables,pt as useHasTablesListener,Ye as useHasValue,Lt as useHasValueListener,Ne as useHasValues,qt as useHasValuesListener,Gt as useIndexIds,X as useIndexes,Wt as useIndexesIds,Y as useIndexesOrIndexesById,_t as useLinkedRowIds,oo as useLinkedRowIdsListener,$t as useLocalRowIds,to as useLocalRowIdsListener,Dt as useMetric,At as useMetricIds,Ht as useMetricListener,N as useMetrics,Vt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,no as useQueriesIds,ee as useQueriesOrQueriesById,lo as useQueryIds,Eo as useRedoInformation,Yt as useRelationshipIds,Z as useRelationships,Xt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Zt as useRemoteRowId,eo as useRemoteRowIdListener,bo as useResultCell,po as useResultCellIds,wo as useResultCellIdsListener,ho as useResultCellListener,Io as useResultRow,io as useResultRowCount,yo as useResultRowCountListener,ao as useResultRowIds,mo as useResultRowIdsListener,fo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,uo as useResultTableCellIds,go as useResultTableCellIdsListener,vo as useResultTableListener,ze as useRow,De as useRowCount,ft as useRowCountListener,He as useRowIds,wt as useRowIdsListener,Pt as useRowListener,rt as useSetCellCallback,xo as useSetCheckpointCallback,ot as useSetPartialRowCallback,lt as useSetPartialValuesCallback,et as useSetRowCallback,_e as useSetTableCallback,$e as useSetTablesCallback,st as useSetValueCallback,nt as useSetValuesCallback,zt as useSliceIds,Kt as useSliceIdsListener,Jt as useSliceRowIds,Nt as useSliceRowIdsListener,Qe as useSortedRowIds,ht as useSortedRowIdsListener,Bt as useStartTransactionListener,G as useStore,Le as useStoreIds,J as useStoreOrStoreById,Fe as useTable,Ve as useTableCellIds,mt as useTableCellIdsListener,Te as useTableIds,vt as useTableIdsListener,yt as useTableListener,Be as useTables,bt as useTablesListener,Lo as useUndoInformation,Ze as useValue,Xe as useValueIds,jt as useValueIdsListener,Et as useValueListener,Ue as useValues,St as useValuesListener,Tt as useWillFinishTransactionListener};
1
+ import e from"react";const t=e=>typeof e,o="",r=t(o),n=t(t),l="Listener",s="Result",d="Has",u="Ids",i="Table",a=i+"s",c=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",f=m+u,w=e=>null==e,k=(e,t,o)=>w(e)?null==o?void 0:o():t(e),h=e=>t(e)==r,P=e=>t(e)==n,R=e=>e.length,x=()=>{},q=(e,t)=>e.every(t),S=(e,t)=>R(e)===R(t)&&q(e,((e,o)=>t[o]===e)),O=(e,t)=>e.map(t),L=Object,j=e=>L.getPrototypeOf(e),B=L.entries,E=e=>!w(e)&&k(j(e),(e=>e==L.prototype||w(j(e))),(()=>!0)),T=L.keys,M=(e,t)=>k(e,(e=>e[t])),F=(e,t)=>{const o=B(e);return R(o)===R(T(t))&&q(o,(([e,o])=>E(o)?!!E(t[e])&&F(t[e],o):t[e]===o))},{createContext:V,useContext:A,useEffect:D}=e,H=V([]),Q=(e,t)=>{var o;const r=A(H);return w(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return w(e)||h(e)?o:e},z=e=>{var t;return T(null!=(t=A(H)[e])?t:{})},G=e=>Q(e,0),J=e=>W(e,0),K=(e,t)=>{const{12:o,13:r}=A(H);D((()=>(null==o||o(e,t),()=>null==r?void 0:r(e))),[o,e,t,r])},N=e=>Q(e,2),U=e=>W(e,2),X=e=>Q(e,4),Y=e=>W(e,4),Z=e=>Q(e,6),$=e=>W(e,6),_=e=>Q(e,8),ee=e=>W(e,8),te=e=>Q(e,10),oe=e=>W(e,10),re=e=>e.toLowerCase();re(l);const ne="Transaction";re(ne);var le=(e,t,o)=>new Promise(((r,n)=>{var l=e=>{try{d(o.next(e))}catch(e){n(e)}},s=e=>{try{d(o.throw(e))}catch(e){n(e)}},d=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,s);d((o=o.apply(e,t)).next())}));const{useCallback:se,useEffect:de,useMemo:ue,useLayoutEffect:ie,useRef:ae,useState:ce,useSyncExternalStore:Ie}=e,pe=[],ve=[{},[],[pe,void 0,pe],void 0,!1,0],be=[F,S,([e,t,o],[r,n,l])=>t===n&&S(e,r)&&S(o,l)],ge=(e,t)=>e===t,ye=(e,t,o=pe)=>{const[,r]=ce(),[n,l]=ce();return de((()=>{const o=e?t(e):void 0;return l(o),r([]),null==o?void 0:o.destroy}),[e,...o]),n},me=(e,t,...o)=>{var r;const n=null==(r=null==e?void 0:e["add"+t+l])?void 0:r.call(e,...o);return()=>null==e?void 0:e.delListener(n)},Ce=(e,t,r,n=pe)=>{const l=ae(ve[r]),s=se((()=>{var o,s,d;const u=null!=(s=null==(o=null==t?void 0:t[(4==r?"has":"get")+e])?void 0:o.call(t,...n))?s:ve[r];return(null!=(d=be[r])?d:ge)(u,l.current)?l.current:l.current=u}),[t,r,e,...n]),u=se((l=>me(t,(4==r?d:o)+e,...n,l)),[t,r,e,...n]);return Ie(u,s)},fe=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),we=(e,t,o,r=pe,n=x,l=pe,...s)=>{const d=J(e);return se((e=>k(d,(r=>k(o(e,r),(o=>n(r["set"+t](...ke(s,r,e),o),o)))))),[d,t,...r,...l,...he(s)])},ke=(e,t,o)=>O(e,(e=>P(e)?e(o,t):e)),he=e=>{return t=e=>!P(e),e.filter(t);var t},Pe=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((e=>o(null==l?void 0:l["del"+t](...ke(n,l,e)))),[l,t,...r,...he(n)])},Re=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},xe=(e,t=pe)=>ue(e,t),qe=(e,t=pe)=>ue(e,t),Se=()=>z(1),Oe=e=>Ce(a,J(e),4,[]),Le=e=>Ce(a,J(e),0),je=e=>Ce(c,J(e),1),Be=(e,t)=>Ce(i,J(t),4,[e]),Ee=(e,t)=>Ce(i,J(t),0,[e]),Te=(e,t)=>Ce(i+y,J(t),1,[e]),Me=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Fe=(e,t)=>Ce(p,J(t),5,[e]),Ve=(e,t)=>Ce(v,J(t),1,[e]),Ae=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),De=(e,t,o)=>Ce(I,J(o),4,[e,t]),He=(e,t,o)=>Ce(I,J(o),0,[e,t]),Qe=(e,t,o)=>Ce(y,J(o),1,[e,t]),We=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),ze=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),Ge=e=>Ce(C,J(e),4,[]),Je=e=>Ce(C,J(e),0),Ke=e=>Ce(f,J(e),1),Ne=(e,t)=>Ce(m,J(t),4,[e]),Ue=(e,t)=>Ce(m,J(t),3,[e]),Xe=(e,t,o,r,n)=>we(o,a,e,t,r,n),Ye=(e,t,o,r,n,l)=>we(r,i,t,o,n,l,e),Ze=(e,t,o,r,n,l,s)=>we(n,I,o,r,l,s,e,t),$e=(e,t,o=pe,r,n=x,l=pe,s=!0)=>{const d=J(r);return se((o=>k(d,(r=>k(t(o,r),(t=>n(r.addRow(P(e)?e(o,r):e,t,s),r,t)))))),[d,e,...o,...l,s])},_e=(e,t,o,r,n,l,s)=>we(n,"PartialRow",o,r,l,s,e,t),et=(e,t,o,r,n,l,s,d)=>we(l,g,r,n,s,d,e,t,o),tt=(e,t,o,r,n)=>we(o,C,e,t,r,n),ot=(e,t,o,r,n)=>we(o,"PartialValues",e,t,r,n),rt=(e,t,o,r,n,l)=>we(r,m,t,o,n,l,e),nt=(e,t,o)=>Pe(e,a,t,o),lt=(e,t,o,r)=>Pe(t,i,o,r,e),st=(e,t,o,r,n)=>Pe(o,I,r,n,e,t),dt=(e,t,o,r,n,l,s)=>Pe(n,g,l,s,e,t,o,r),ut=(e,t,o)=>Pe(e,C,t,o),it=(e,t,o,r)=>Pe(t,m,o,r,e),at=(e,t,o,r)=>fe(d+a,J(r),e,t,[],o),ct=(e,t,o,r)=>fe(a,J(r),e,t,pe,o),It=(e,t,o,r)=>fe(c,J(r),e,t,pe,o),pt=(e,t,o,r,n)=>fe(d+i,J(n),t,o,[e],r),vt=(e,t,o,r,n)=>fe(i,J(n),t,o,[e],r),bt=(e,t,o,r,n)=>fe(i+y,J(n),t,o,[e],r),gt=(e,t,o,r,n,l)=>fe(d+i+g,J(l),o,r,[e,t],n),yt=(e,t,o,r,n)=>fe(p,J(n),t,o,[e],r),mt=(e,t,o,r,n)=>fe(v,J(n),t,o,[e],r),Ct=(e,t,o,r,n,l,s,d,u)=>fe(b,J(u),l,s,[e,t,o,r,n],d),ft=(e,t,o,r,n,l)=>fe(d+I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>fe(I,J(l),o,r,[e,t],n),kt=(e,t,o,r,n,l)=>fe(y,J(l),o,r,[e,t],n),ht=(e,t,o,r,n,l,s)=>fe(d+g,J(s),r,n,[e,t,o],l),Pt=(e,t,o,r,n,l,s)=>fe(g,J(s),r,n,[e,t,o],l),Rt=(e,t,o,r)=>fe(d+C,J(r),e,t,[],o),xt=(e,t,o,r)=>fe(C,J(r),e,t,pe,o),qt=(e,t,o,r)=>fe(f,J(r),e,t,pe,o),St=(e,t,o,r,n)=>fe(d+m,J(n),t,o,[e],r),Ot=(e,t,o,r,n)=>fe(m,J(n),t,o,[e],r),Lt=(e,t,o)=>fe("Start"+ne,J(o),e,t),jt=(e,t,o)=>fe("WillFinish"+ne,J(o),e,t),Bt=(e,t,o)=>fe("DidFinish"+ne,J(o),e,t),Et=(e,t,o)=>ye(e,t,o),Tt=()=>z(3),Mt=e=>Ce("MetricIds",U(e),1),Ft=(e,t)=>Ce("Metric",U(t),3,[e]),Vt=(e,t,o,r)=>fe("Metric",U(r),t,o,[e]),At=(e,t,o)=>ye(e,t,o),Dt=()=>z(5),Ht=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Qt=e=>Ce("IndexIds",Y(e),1),Wt=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),zt=(e,t,o,r)=>fe("SliceIds",Y(r),t,o,[e]),Gt=(e,t,o,r,n)=>fe("Slice"+v,Y(n),o,r,[e,t]),Jt=(e,t,o)=>ye(e,t,o),Kt=()=>z(7),Nt=e=>Ce("RelationshipIds",$(e),1),Ut=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Xt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Yt=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Zt=(e,t,o,r,n)=>fe("RemoteRowId",$(n),o,r,[e,t]),$t=(e,t,o,r,n)=>fe("Local"+v,$(n),o,r,[e,t]),_t=(e,t,o,r,n)=>fe("Linked"+v,$(n),o,r,[e,t]),eo=(e,t,o)=>ye(e,t,o),to=()=>z(9),oo=e=>Ce("QueryIds",ee(e),1),ro=(e,t)=>Ce(s+i,ee(t),0,[e]),no=(e,t)=>Ce(s+i+y,ee(t),1,[e]),lo=(e,t)=>Ce(s+p,ee(t),5,[e]),so=(e,t)=>Ce(s+v,ee(t),1,[e]),uo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),io=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),ao=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),co=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),Io=(e,t,o,r)=>fe(s+i,ee(r),t,o,[e]),po=(e,t,o,r)=>fe(s+i+y,ee(r),t,o,[e]),vo=(e,t,o,r)=>fe(s+p,ee(r),t,o,[e]),bo=(e,t,o,r)=>fe(s+v,ee(r),t,o,[e]),go=(e,t,o,r,n,l,d,u)=>fe(s+b,ee(u),l,d,[e,t,o,r,n]),yo=(e,t,o,r,n)=>fe(s+I,ee(n),o,r,[e,t]),mo=(e,t,o,r,n)=>fe(s+y,ee(n),o,r,[e,t]),Co=(e,t,o,r,n,l)=>fe(s+g,ee(l),r,n,[e,t,o]),fo=(e,t,o)=>ye(e,t,o),wo=()=>z(11),ko=e=>Ce("CheckpointIds",oe(e),2),ho=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),Po=(e=x,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>{const n=e(t);r(o.addCheckpoint(n),o,n)}))),[l,...t,...n])},Ro=e=>Re(e,"goBackward"),xo=e=>Re(e,"goForward"),qo=(e,t=pe,o,r=x,n=pe)=>{const l=oe(o);return se((t=>k(l,(o=>k(e(t),(e=>r(o.goTo(e),e)))))),[l,...t,...n])},So=e=>{var t;const r=oe(e),[n,l]=ko(r);return[(s=n,!(0==R(s))),Ro(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},Oo=e=>{var t;const r=oe(e),[,,[n]]=ko(r);return[!w(n),xo(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},Lo=(e,t,o)=>fe("CheckpointIds",oe(o),e,t),jo=(e,t,o,r)=>fe("Checkpoint",oe(r),t,o,[e]),Bo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ce(),[u,i]=ce();return de((()=>{const o=e?t(e):void 0;i(o),o&&r&&le(void 0,null,(function*(){yield r(o),d([])}))}),[e,...o,...n]),de((()=>()=>{u&&(u.destroy(),null==l||l(u))}),[u,...s]),u},Eo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ce();return de((()=>{le(void 0,null,(function*(){const o=e?yield t(e):void 0;s(o)}))}),[e,...o]),de((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...n]),l},{PureComponent:To,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>w(e)?{}:e(...t),Wo=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var zo=Object.defineProperty,Go=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,No=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Xo=(e,t,o)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Yo=(e,t)=>{for(var o in t||(t={}))No.call(t,o)&&Xo(e,o,t[o]);if(Ko)for(var o of Ko(t))Uo.call(t,o)&&Xo(e,o,t[o]);return e},Zo=(e,t)=>Go(e,Jo(t)),$o=(e,t)=>{var o={};for(var r in e)No.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Ko)for(var r of Ko(e))t.indexOf(r)<0&&Uo.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:_o,useContext:er,useMemo:tr,useState:or}=e,rr=({tableId:e,store:t,rowComponent:o=ar,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>ur(O(d,(l=>Fo(o,Zo(Yo({},Qo(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),nr=({queryId:e,queries:t,resultRowComponent:o=hr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>ur(O(s,(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),lr=({relationshipId:e,relationships:t,rowComponent:o=ar,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,a]=Wo($(t),e),c=s(e,d,u);return ur(O(c,(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,tableId:a,rowId:e,store:i,debugIds:l})))),n,l,d)},sr=e=>({checkpoints:t,checkpointComponent:o=xr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return ur(O(e(ko(s)),(e=>Fo(o,Zo(Yo({},Qo(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},dr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:a,checkpointsById:c,children:I})=>{const p=er(H),[v,b]=or({}),g=_o(((e,t)=>b((o=>M(o,e)==t?o:Zo(Yo({},o),{[e]:t})))),[]),y=_o((e=>b((t=>Yo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return Fo(H.Provider,{value:tr((()=>[null!=e?e:p[0],Yo(Yo(Yo({},p[1]),t),v),null!=o?o:p[2],Yo(Yo({},p[3]),r),null!=n?n:p[4],Yo(Yo({},p[5]),l),null!=s?s:p[6],Yo(Yo({},p[7]),d),null!=u?u:p[8],Yo(Yo({},p[9]),i),null!=a?a:p[10],Yo(Yo({},p[11]),c),g,y]),[e,t,v,o,r,n,l,s,d,u,i,a,c,p,g,y])},I)},ur=(e,t,o,r)=>{const n=w(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},ir=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return ur(o+(null!=(s=ze(e,t,r,n))?s:o),void 0,l,r)},ar=({tableId:e,rowId:t,store:o,cellComponent:r=ir,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>ur(O(((e,t,o,r)=>{const n=Qe(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),cr=e=>rr(e,Ve(e.tableId,e.store)),Ir=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return rr(s,Ae(s.tableId,o,r,n,l,s.store))},pr=({store:e,tableComponent:t=cr,getTableComponentProps:o,separator:r,debugIds:n})=>ur(O(je(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),vr=({valueId:e,store:t,debugIds:r})=>{var n;return ur(o+(null!=(n=Ue(e,t))?n:o),void 0,r,e)},br=({store:e,valueComponent:t=vr,getValueComponentProps:o,separator:r,debugIds:n})=>ur(O(Ke(e),(r=>Fo(t,Zo(Yo({},Qo(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),gr=({metricId:e,metrics:t,debugIds:r})=>{var n;return ur(null!=(n=Ft(e,t))?n:o,void 0,r,e)},yr=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ar,getRowComponentProps:n,separator:l,debugIds:s})=>{const[d,u,i]=((e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(t)])(Y(o),e),a=Wt(e,t,d);return ur(O(a,(e=>Fo(r,Zo(Yo({},Qo(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},mr=({indexId:e,indexes:t,sliceComponent:o=yr,getSliceComponentProps:r,separator:n,debugIds:l})=>ur(O(Ht(e,t),(n=>Fo(o,Zo(Yo({},Qo(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),Cr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ar,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Wo($(o),e),i=Ut(e,t,s);return ur(w(u)||w(i)?null:Fo(r,Zo(Yo({},Qo(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},fr=e=>lr(e,Xt,e.remoteRowId),wr=e=>lr(e,Yt,e.firstRowId),kr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return ur(o+(null!=(s=co(e,t,r,n))?s:o),void 0,l,r)},hr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=kr,getResultCellComponentProps:n,separator:l,debugIds:s})=>ur(O(ao(e,t,o),(l=>Fo(r,Zo(Yo({},Qo(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),Pr=e=>nr(e,so(e.queryId,e.queries)),Rr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=$o(t,["cellId","descending","offset","limit"]);return nr(s,uo(s.queryId,o,r,n,l,s.queries))},xr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return ur(null!=(n=ho(t,e))?n:o,void 0,r,t)},qr=sr((e=>e[0])),Sr=sr((e=>w(e[1])?[]:[e[1]])),Or=sr((e=>e[2]));export{qr as BackwardCheckpointsView,ir as CellView,xr as CheckpointView,Sr as CurrentCheckpointView,Or as ForwardCheckpointsView,mr as IndexView,wr as LinkedRowsView,fr as LocalRowsView,gr as MetricView,dr as Provider,Cr as RemoteRowView,kr as ResultCellView,hr as ResultRowView,Rr as ResultSortedTableView,Pr as ResultTableView,ar as RowView,yr as SliceView,Ir as SortedTableView,cr as TableView,pr as TablesView,vr as ValueView,br as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,kt as useCellIdsListener,Pt as useCellListener,ho as useCheckpoint,ko as useCheckpointIds,Lo as useCheckpointIdsListener,jo as useCheckpointListener,te as useCheckpoints,wo as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,fo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Et as useCreateMetrics,Bo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,xe as useCreateStore,Eo as useCreateSynchronizer,dt as useDelCellCallback,st as useDelRowCallback,lt as useDelTableCallback,nt as useDelTablesCallback,it as useDelValueCallback,ut as useDelValuesCallback,Bt as useDidFinishTransactionListener,Ro as useGoBackwardCallback,xo as useGoForwardCallback,qo as useGoToCallback,We as useHasCell,ht as useHasCellListener,De as useHasRow,ft as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,pt as useHasTableListener,Oe as useHasTables,at as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,Rt as useHasValuesListener,Qt as useIndexIds,X as useIndexes,Dt as useIndexesIds,Y as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,N as useMetrics,Tt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,to as useQueriesIds,ee as useQueriesOrQueriesById,oo as useQueryIds,Oo as useRedoInformation,Nt as useRelationshipIds,Z as useRelationships,Kt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,co as useResultCell,ao as useResultCellIds,mo as useResultCellIdsListener,Co as useResultCellListener,io as useResultRow,lo as useResultRowCount,vo as useResultRowCountListener,so as useResultRowIds,bo as useResultRowIdsListener,yo as useResultRowListener,uo as useResultSortedRowIds,go as useResultSortedRowIdsListener,ro as useResultTable,no as useResultTableCellIds,po as useResultTableCellIdsListener,Io as useResultTableListener,He as useRow,Fe as useRowCount,yt as useRowCountListener,Ve as useRowIds,mt as useRowIdsListener,wt as useRowListener,et as useSetCellCallback,Po as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,rt as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,Ae as useSortedRowIds,Ct as useSortedRowIdsListener,Lt as useStartTransactionListener,G as useStore,Se as useStoreIds,J as useStoreOrStoreById,Ee as useTable,Te as useTableCellIds,bt as useTableCellIdsListener,je as useTableIds,It as useTableIdsListener,vt as useTableListener,Le as useTables,ct as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,qt as useValueIdsListener,Ot as useValueListener,Je as useValues,xt as useValuesListener,jt as useWillFinishTransactionListener};
@@ -39,6 +39,7 @@ const arrayIsEqual = (array1, array2) =>
39
39
  arrayEvery(array1, (value1, index) => array2[index] === value1);
40
40
  const arrayMap = (array, cb) => array.map(cb);
41
41
  const arrayIsEmpty = (array) => size(array) == 0;
42
+ const arrayFilter = (array, cb) => array.filter(cb);
42
43
 
43
44
  const object = Object;
44
45
  const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
@@ -127,28 +128,6 @@ lower(LISTENER);
127
128
  const TRANSACTION = 'Transaction';
128
129
  lower(TRANSACTION);
129
130
 
130
- var __defProp$1 = Object.defineProperty;
131
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
132
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
133
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
134
- var __defNormalProp$1 = (obj, key, value) =>
135
- key in obj
136
- ? __defProp$1(obj, key, {
137
- enumerable: true,
138
- configurable: true,
139
- writable: true,
140
- value,
141
- })
142
- : (obj[key] = value);
143
- var __spreadValues$1 = (a, b) => {
144
- for (var prop in b || (b = {}))
145
- if (__hasOwnProp$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
146
- if (__getOwnPropSymbols$1)
147
- for (var prop of __getOwnPropSymbols$1(b)) {
148
- if (__propIsEnum$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
149
- }
150
- return a;
151
- };
152
131
  var __async = (__this, __arguments, generator) => {
153
132
  return new Promise((resolve, reject) => {
154
133
  var fulfilled = (value) => {
@@ -256,12 +235,7 @@ const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
256
235
  /* eslint-disable-next-line react-hooks/exhaustive-deps */
257
236
  [thing, returnType, listenable, ...args],
258
237
  );
259
- const result = useSyncExternalStore(subscribe, getResult);
260
- return returnType == 0 /* Object */
261
- ? __spreadValues$1({}, result)
262
- : returnType < 3 /* CellOrValue */
263
- ? [...result]
264
- : result;
238
+ return useSyncExternalStore(subscribe, getResult);
265
239
  };
266
240
  const useListener = (
267
241
  listenable,
@@ -293,9 +267,7 @@ const useSetCallback = (
293
267
  ifNotUndefined(get(parameter, store2), (thing) =>
294
268
  then(
295
269
  store2['set' + settable](
296
- ...arrayMap(args, (arg) =>
297
- isFunction(arg) ? arg(parameter, store2) : arg,
298
- ),
270
+ ...argsOrGetArgs(args, store2, parameter),
299
271
  thing,
300
272
  ),
301
273
  thing,
@@ -303,9 +275,12 @@ const useSetCallback = (
303
275
  ),
304
276
  ),
305
277
  // eslint-disable-next-line react-hooks/exhaustive-deps
306
- [store, settable, ...getDeps, ...thenDeps, ...args],
278
+ [store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
307
279
  );
308
280
  };
281
+ const argsOrGetArgs = (args, store, parameter) =>
282
+ arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
283
+ const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
309
284
  const useDel = (
310
285
  storeOrStoreId,
311
286
  deletable,
@@ -315,9 +290,14 @@ const useDel = (
315
290
  ) => {
316
291
  const store = useStoreOrStoreById(storeOrStoreId);
317
292
  return useCallback$2(
318
- () => then(store == null ? void 0 : store['del' + deletable](...args)),
293
+ (parameter) =>
294
+ then(
295
+ store == null
296
+ ? void 0
297
+ : store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
298
+ ),
319
299
  // eslint-disable-next-line react-hooks/exhaustive-deps
320
- [store, deletable, ...thenDeps, ...args],
300
+ [store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
321
301
  );
322
302
  };
323
303
  const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
@@ -39,6 +39,7 @@ const arrayIsEqual = (array1, array2) =>
39
39
  arrayEvery(array1, (value1, index) => array2[index] === value1);
40
40
  const arrayMap = (array, cb) => array.map(cb);
41
41
  const arrayIsEmpty = (array) => size(array) == 0;
42
+ const arrayFilter = (array, cb) => array.filter(cb);
42
43
 
43
44
  const object = Object;
44
45
  const getPrototypeOf = (obj) => object.getPrototypeOf(obj);
@@ -127,28 +128,6 @@ lower(LISTENER);
127
128
  const TRANSACTION = 'Transaction';
128
129
  lower(TRANSACTION);
129
130
 
130
- var __defProp$1 = Object.defineProperty;
131
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
132
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
133
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
134
- var __defNormalProp$1 = (obj, key, value) =>
135
- key in obj
136
- ? __defProp$1(obj, key, {
137
- enumerable: true,
138
- configurable: true,
139
- writable: true,
140
- value,
141
- })
142
- : (obj[key] = value);
143
- var __spreadValues$1 = (a, b) => {
144
- for (var prop in b || (b = {}))
145
- if (__hasOwnProp$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
146
- if (__getOwnPropSymbols$1)
147
- for (var prop of __getOwnPropSymbols$1(b)) {
148
- if (__propIsEnum$1.call(b, prop)) __defNormalProp$1(a, prop, b[prop]);
149
- }
150
- return a;
151
- };
152
131
  var __async = (__this, __arguments, generator) => {
153
132
  return new Promise((resolve, reject) => {
154
133
  var fulfilled = (value) => {
@@ -256,12 +235,7 @@ const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
256
235
  /* eslint-disable-next-line react-hooks/exhaustive-deps */
257
236
  [thing, returnType, listenable, ...args],
258
237
  );
259
- const result = useSyncExternalStore(subscribe, getResult);
260
- return returnType == 0 /* Object */
261
- ? __spreadValues$1({}, result)
262
- : returnType < 3 /* CellOrValue */
263
- ? [...result]
264
- : result;
238
+ return useSyncExternalStore(subscribe, getResult);
265
239
  };
266
240
  const useListener = (
267
241
  listenable,
@@ -293,9 +267,7 @@ const useSetCallback = (
293
267
  ifNotUndefined(get(parameter, store2), (thing) =>
294
268
  then(
295
269
  store2['set' + settable](
296
- ...arrayMap(args, (arg) =>
297
- isFunction(arg) ? arg(parameter, store2) : arg,
298
- ),
270
+ ...argsOrGetArgs(args, store2, parameter),
299
271
  thing,
300
272
  ),
301
273
  thing,
@@ -303,9 +275,12 @@ const useSetCallback = (
303
275
  ),
304
276
  ),
305
277
  // eslint-disable-next-line react-hooks/exhaustive-deps
306
- [store, settable, ...getDeps, ...thenDeps, ...args],
278
+ [store, settable, ...getDeps, ...thenDeps, ...nonFunctionDeps(args)],
307
279
  );
308
280
  };
281
+ const argsOrGetArgs = (args, store, parameter) =>
282
+ arrayMap(args, (arg) => (isFunction(arg) ? arg(parameter, store) : arg));
283
+ const nonFunctionDeps = (args) => arrayFilter(args, (arg) => !isFunction(arg));
309
284
  const useDel = (
310
285
  storeOrStoreId,
311
286
  deletable,
@@ -315,9 +290,14 @@ const useDel = (
315
290
  ) => {
316
291
  const store = useStoreOrStoreById(storeOrStoreId);
317
292
  return useCallback$2(
318
- () => then(store == null ? void 0 : store['del' + deletable](...args)),
293
+ (parameter) =>
294
+ then(
295
+ store == null
296
+ ? void 0
297
+ : store['del' + deletable](...argsOrGetArgs(args, store, parameter)),
298
+ ),
319
299
  // eslint-disable-next-line react-hooks/exhaustive-deps
320
- [store, deletable, ...thenDeps, ...args],
300
+ [store, deletable, ...thenDeps, ...nonFunctionDeps(args)],
321
301
  );
322
302
  };
323
303
  const useCheckpointAction = (checkpointsOrCheckpointsId, action, arg) => {
@@ -1 +1 @@
1
- import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",I="Table",i=I+"s",l=I+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:Ie,useRef:ie,useState:le,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=le(),[r,d]=le();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=ie(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]),I=ae(c,n);return 0==s?{...I}:s<3?[...I]:I},we=(e,t,o,s=pe,r=pe,...d)=>Ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...L(n,(t=>v(t)?t(e,s):t)),o),o)))))),[u,t,...s,...d,...n])},Re=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((()=>o(d?.["del"+t](...r))),[d,t,...s,...r])},fe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},ve=(e,t=pe)=>ce(e,t),qe=(e,t=pe)=>ce(e,t),Pe=()=>G(1),xe=e=>ke(i,K(e),4,[]),Se=e=>ke(i,K(e),0),Le=e=>ke(l,K(e),1),Be=(e,t)=>ke(I,K(t),4,[e]),Te=(e,t)=>ke(I,K(t),0,[e]),Ee=(e,t)=>ke(I+m,K(t),1,[e]),Me=(e,t,o)=>ke(I+C,K(o),4,[e,t]),Fe=(e,t)=>ke(p,K(t),5,[e]),Ve=(e,t)=>ke(g,K(t),1,[e]),Ae=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),Oe=(e,t,o)=>ke(a,K(o),4,[e,t]),je=(e,t,o)=>ke(a,K(o),0,[e,t]),De=(e,t,o)=>ke(m,K(o),1,[e,t]),He=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),Qe=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),We=e=>ke(k,K(e),4,[]),ze=e=>ke(k,K(e),0),Ge=e=>ke(w,K(e),1),Je=(e,t)=>ke(y,K(t),4,[e]),Ke=(e,t)=>ke(y,K(t),3,[e]),Ne=(e,t,o,s,r)=>he(o,i,e,t,s,r),Ue=(e,t,o,s,r,d)=>he(s,I,t,o,r,d,e),Xe=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),Ye=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},Ze=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),$e=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),_e=(e,t,o,s,r)=>he(o,k,e,t,s,r),et=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),tt=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),ot=(e,t,o)=>Re(e,i,t,o),st=(e,t,o,s)=>Re(t,I,o,s,e),rt=(e,t,o,s,r)=>Re(o,a,s,r,e,t),dt=(e,t,o,s,r,d,n)=>Re(r,C,d,n,e,t,o,s),nt=(e,t,o)=>Re(e,k,t,o),ut=(e,t,o,s)=>Re(t,y,o,s,e),ct=(e,t,o,s)=>we(u+i,K(s),e,t,[],o),It=(e,t,o,s)=>we(i,K(s),e,t,pe,o),it=(e,t,o,s)=>we(l,K(s),e,t,pe,o),lt=(e,t,o,s,r)=>we(u+I,K(r),t,o,[e],s),at=(e,t,o,s,r)=>we(I,K(r),t,o,[e],s),pt=(e,t,o,s,r)=>we(I+m,K(r),t,o,[e],s),gt=(e,t,o,s,r,d)=>we(u+I+C,K(d),o,s,[e,t],r),bt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),Ct=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),mt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),yt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),kt=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),wt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),Rt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),ft=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),vt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),qt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),Pt=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),xt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),St=(e,t,o)=>we("Start"+de,K(o),e,t),Lt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Bt=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Tt=(e,t,o)=>me(e,t,o),Et=()=>G(3),Mt=e=>ke("MetricIds",X(e),1),Ft=(e,t)=>ke("Metric",X(t),3,[e]),Vt=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),At=(e,t,o)=>me(e,t,o),Ot=()=>G(5),jt=(e,t)=>ke("SliceIds",Z(t),1,[e]),Dt=e=>ke("IndexIds",Z(e),1),Ht=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),Qt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Wt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),zt=(e,t,o)=>me(e,t,o),Gt=()=>G(7),Jt=e=>ke("RelationshipIds",_(e),1),Kt=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Nt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Ut=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Xt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),Yt=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),Zt=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),$t=(e,t,o)=>me(e,t,o),_t=()=>G(9),eo=e=>ke("QueryIds",te(e),1),to=(e,t)=>ke(n+I,te(t),0,[e]),oo=(e,t)=>ke(n+I+m,te(t),1,[e]),so=(e,t)=>ke(n+p,te(t),5,[e]),ro=(e,t)=>ke(n+g,te(t),1,[e]),no=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),uo=(e,t,o)=>ke(n+a,te(o),0,[e,t]),co=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),io=(e,t,o,s)=>we(n+I,te(s),t,o,[e]),lo=(e,t,o,s)=>we(n+I+m,te(s),t,o,[e]),ao=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),go=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),bo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),Co=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),mo=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),yo=(e,t,o)=>me(e,t,o),ko=()=>G(11),wo=e=>ke("CheckpointIds",se(e),2),ho=(e,t)=>ke("Checkpoint",se(t),3,[e]),Ro=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},fo=e=>fe(e,"goBackward"),vo=e=>fe(e,"goForward"),qo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},Po=e=>{const t=se(e),[s,r]=wo(t);return[(d=s,!(0==q(d))),fo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},xo=e=>{const t=se(e),[,,[s]]=wo(t);return[!h(s),vo(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},So=(e,t,o)=>we("CheckpointIds",se(o),e,t),Lo=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Bo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=le(),[c,I]=le();return ue((()=>{const o=e?t(e):void 0;I(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},To=(e,t,o=pe,s,r=pe)=>{const[d,n]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Eo,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Oo,useState:jo}=e,Do=(e,...t)=>h(e)?{}:e(...t),Ho=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:Qo,useContext:Wo,useMemo:zo,useState:Go}=e,Jo=({tableId:e,store:t,rowComponent:o=$o,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>Yo(L(u,(d=>Fo(o,{...Do(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Ko=({queryId:e,queries:t,resultRowComponent:o=ls,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>Yo(L(n,(r=>Fo(o,{...Do(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),No=({relationshipId:e,relationships:t,rowComponent:o=$o,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,I,i]=Ho(_(t),e),l=n(e,u,c);return Yo(L(l,(e=>Fo(o,{...Do(s,e),key:e,tableId:i,rowId:e,store:I,debugIds:d}))),r,d,u)},Uo=e=>({checkpoints:t,checkpointComponent:o=gs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return Yo(L(e(wo(n)),(e=>Fo(o,{...Do(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Xo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:I,checkpoints:i,checkpointsById:l,children:a})=>{const p=Wo(Q),[g,b]=Go({}),C=Qo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=Qo((e=>b((t=>({...A(t,e)})))),[]);return Fo(Q.Provider,{value:zo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...I},i??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,I,i,l,p,C,m])},a)},Yo=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},Zo=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>Yo(o+(Qe(e,t,s,r)??o),void 0,d,s),$o=({tableId:e,rowId:t,store:o,cellComponent:s=Zo,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>Yo(L(((e,t,o,s)=>{const r=De(t,o,s);return e??r})(d,e,t,o),(d=>Fo(s,{...Do(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),_o=e=>Jo(e,Ve(e.tableId,e.store)),es=({cellId:e,descending:t,offset:o,limit:s,...r})=>Jo(r,Ae(r.tableId,e,t,o,s,r.store)),ts=({store:e,tableComponent:t=_o,getTableComponentProps:o,separator:s,debugIds:r})=>Yo(L(Le(e),(s=>Fo(t,{...Do(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),os=({valueId:e,store:t,debugIds:s})=>Yo(o+(Ke(e,t)??o),void 0,s,e),ss=({store:e,valueComponent:t=os,getValueComponentProps:o,separator:s,debugIds:r})=>Yo(L(Ge(e),(s=>Fo(t,{...Do(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),rs=({metricId:e,metrics:t,debugIds:s})=>Yo(Ft(e,t)??o,void 0,s,e),ds=({indexId:e,sliceId:t,indexes:o,rowComponent:s=$o,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,I]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),i=Ht(e,t,u);return Yo(L(i,(e=>Fo(s,{...Do(r,e),key:e,tableId:I,rowId:e,store:c,debugIds:n}))),d,n,t)},ns=({indexId:e,indexes:t,sliceComponent:o=ds,getSliceComponentProps:s,separator:r,debugIds:d})=>Yo(L(jt(e,t),(r=>Fo(o,{...Do(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),us=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=$o,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Ho(_(o),e),I=Kt(e,t,n);return Yo(h(c)||h(I)?null:Fo(s,{...Do(r,I),key:I,tableId:c,rowId:I,store:u,debugIds:d}),void 0,d,t)},cs=e=>No(e,Nt,e.remoteRowId),Is=e=>No(e,Ut,e.firstRowId),is=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>Yo(o+(Io(e,t,s,r)??o),void 0,d,s),ls=({queryId:e,rowId:t,queries:o,resultCellComponent:s=is,getResultCellComponentProps:r,separator:d,debugIds:n})=>Yo(L(co(e,t,o),(d=>Fo(s,{...Do(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),as=e=>Ko(e,ro(e.queryId,e.queries)),ps=({cellId:e,descending:t,offset:o,limit:s,...r})=>Ko(r,no(r.queryId,e,t,o,s,r.queries)),gs=({checkpoints:e,checkpointId:t,debugIds:s})=>Yo(ho(t,e)??o,void 0,s,t),bs=Uo((e=>e[0])),Cs=Uo((e=>h(e[1])?[]:[e[1]])),ms=Uo((e=>e[2]));export{bs as BackwardCheckpointsView,Zo as CellView,gs as CheckpointView,Cs as CurrentCheckpointView,ms as ForwardCheckpointsView,ns as IndexView,Is as LinkedRowsView,cs as LocalRowsView,rs as MetricView,Xo as Provider,us as RemoteRowView,is as ResultCellView,ls as ResultRowView,ps as ResultSortedTableView,as as ResultTableView,$o as RowView,ds as SliceView,es as SortedTableView,_o as TableView,ts as TablesView,os as ValueView,ss as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,Rt as useCellListener,ho as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Lo as useCheckpointListener,oe as useCheckpoints,ko as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,yo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Tt as useCreateMetrics,Bo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,ve as useCreateStore,To as useCreateSynchronizer,dt as useDelCellCallback,rt as useDelRowCallback,st as useDelTableCallback,ot as useDelTablesCallback,ut as useDelValueCallback,nt as useDelValuesCallback,Bt as useDidFinishTransactionListener,fo as useGoBackwardCallback,vo as useGoForwardCallback,qo as useGoToCallback,He as useHasCell,ht as useHasCellListener,Oe as useHasRow,yt as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,lt as useHasTableListener,xe as useHasTables,ct as useHasTablesListener,Je as useHasValue,Pt as useHasValueListener,We as useHasValues,ft as useHasValuesListener,Dt as useIndexIds,Y as useIndexes,Ot as useIndexesIds,Z as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,U as useMetrics,Et as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,_t as useQueriesIds,te as useQueriesOrQueriesById,eo as useQueryIds,xo as useRedoInformation,Jt as useRelationshipIds,$ as useRelationships,Gt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,Io as useResultCell,co as useResultCellIds,Co as useResultCellIdsListener,mo as useResultCellListener,uo as useResultRow,so as useResultRowCount,ao as useResultRowCountListener,ro as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,no as useResultSortedRowIds,go as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,lo as useResultTableCellIdsListener,io as useResultTableListener,je as useRow,Fe as useRowCount,bt as useRowCountListener,Ve as useRowIds,Ct as useRowIdsListener,kt as useRowListener,$e as useSetCellCallback,Ro as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,jt as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Ae as useSortedRowIds,mt as useSortedRowIdsListener,St as useStartTransactionListener,J as useStore,Pe as useStoreIds,K as useStoreOrStoreById,Te as useTable,Ee as useTableCellIds,pt as useTableCellIdsListener,Le as useTableIds,it as useTableIdsListener,at as useTableListener,Se as useTables,It as useTablesListener,Po as useUndoInformation,Ke as useValue,Ge as useValueIds,qt as useValueIdsListener,xt as useValueListener,ze as useValues,vt as useValuesListener,Lt as useWillFinishTransactionListener};
1
+ import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",l=i+"s",I=i+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:ie,useRef:le,useState:Ie,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=Ie(),[r,d]=Ie();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=le(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return ae(c,n)},we=(e,t,o,s=pe,r=pe,...d)=>ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...Re(n,s,e),o),o)))))),[u,t,...s,...d,...fe(n)])},Re=(e,t,o)=>L(e,(e=>v(e)?e(o,t):e)),fe=e=>{return t=e=>!v(e),e.filter(t);var t},ve=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((e=>o(d?.["del"+t](...Re(r,d,e)))),[d,t,...s,...fe(r)])},qe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},Pe=(e,t=pe)=>ce(e,t),xe=(e,t=pe)=>ce(e,t),Se=()=>G(1),Le=e=>ke(l,K(e),4,[]),Be=e=>ke(l,K(e),0),Te=e=>ke(I,K(e),1),Ee=(e,t)=>ke(i,K(t),4,[e]),Me=(e,t)=>ke(i,K(t),0,[e]),Fe=(e,t)=>ke(i+m,K(t),1,[e]),Ve=(e,t,o)=>ke(i+C,K(o),4,[e,t]),Ae=(e,t)=>ke(p,K(t),5,[e]),Oe=(e,t)=>ke(g,K(t),1,[e]),je=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),De=(e,t,o)=>ke(a,K(o),4,[e,t]),He=(e,t,o)=>ke(a,K(o),0,[e,t]),Qe=(e,t,o)=>ke(m,K(o),1,[e,t]),We=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),ze=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),Ge=e=>ke(k,K(e),4,[]),Je=e=>ke(k,K(e),0),Ke=e=>ke(w,K(e),1),Ne=(e,t)=>ke(y,K(t),4,[e]),Ue=(e,t)=>ke(y,K(t),3,[e]),Xe=(e,t,o,s,r)=>he(o,l,e,t,s,r),Ye=(e,t,o,s,r,d)=>he(s,i,t,o,r,d,e),Ze=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),$e=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},_e=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),et=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),tt=(e,t,o,s,r)=>he(o,k,e,t,s,r),ot=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),st=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),rt=(e,t,o)=>ve(e,l,t,o),dt=(e,t,o,s)=>ve(t,i,o,s,e),nt=(e,t,o,s,r)=>ve(o,a,s,r,e,t),ut=(e,t,o,s,r,d,n)=>ve(r,C,d,n,e,t,o,s),ct=(e,t,o)=>ve(e,k,t,o),it=(e,t,o,s)=>ve(t,y,o,s,e),lt=(e,t,o,s)=>we(u+l,K(s),e,t,[],o),It=(e,t,o,s)=>we(l,K(s),e,t,pe,o),at=(e,t,o,s)=>we(I,K(s),e,t,pe,o),pt=(e,t,o,s,r)=>we(u+i,K(r),t,o,[e],s),gt=(e,t,o,s,r)=>we(i,K(r),t,o,[e],s),bt=(e,t,o,s,r)=>we(i+m,K(r),t,o,[e],s),Ct=(e,t,o,s,r,d)=>we(u+i+C,K(d),o,s,[e,t],r),mt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),yt=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),kt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),wt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),Rt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ft=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),vt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),qt=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),Pt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),xt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),St=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),Lt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),Bt=(e,t,o)=>we("Start"+de,K(o),e,t),Tt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Et=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Mt=(e,t,o)=>me(e,t,o),Ft=()=>G(3),Vt=e=>ke("MetricIds",X(e),1),At=(e,t)=>ke("Metric",X(t),3,[e]),Ot=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),jt=(e,t,o)=>me(e,t,o),Dt=()=>G(5),Ht=(e,t)=>ke("SliceIds",Z(t),1,[e]),Qt=e=>ke("IndexIds",Z(e),1),Wt=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),zt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Gt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),Jt=(e,t,o)=>me(e,t,o),Kt=()=>G(7),Nt=e=>ke("RelationshipIds",_(e),1),Ut=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Xt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Yt=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Zt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),$t=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),_t=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),eo=(e,t,o)=>me(e,t,o),to=()=>G(9),oo=e=>ke("QueryIds",te(e),1),so=(e,t)=>ke(n+i,te(t),0,[e]),ro=(e,t)=>ke(n+i+m,te(t),1,[e]),no=(e,t)=>ke(n+p,te(t),5,[e]),uo=(e,t)=>ke(n+g,te(t),1,[e]),co=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),io=(e,t,o)=>ke(n+a,te(o),0,[e,t]),lo=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),ao=(e,t,o,s)=>we(n+i,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+i+m,te(s),t,o,[e]),go=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),bo=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),Co=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),mo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),yo=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),ko=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),wo=(e,t,o)=>me(e,t,o),ho=()=>G(11),Ro=e=>ke("CheckpointIds",se(e),2),fo=(e,t)=>ke("Checkpoint",se(t),3,[e]),vo=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},qo=e=>qe(e,"goBackward"),Po=e=>qe(e,"goForward"),xo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},So=e=>{const t=se(e),[s,r]=Ro(t);return[(d=s,!(0==q(d))),qo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},Lo=e=>{const t=se(e),[,,[s]]=Ro(t);return[!h(s),Po(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},Bo=(e,t,o)=>we("CheckpointIds",se(o),e,t),To=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Eo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=Ie(),[c,i]=Ie();return ue((()=>{const o=e?t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Mo=(e,t,o=pe,s,r=pe)=>{const[d,n]=Ie();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Fo,Fragment:Vo,createElement:Ao,useCallback:Oo,useLayoutEffect:jo,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>h(e)?{}:e(...t),Wo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:zo,useContext:Go,useMemo:Jo,useState:Ko}=e,No=({tableId:e,store:t,rowComponent:o=es,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>$o(L(u,(d=>Ao(o,{...Qo(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Uo=({queryId:e,queries:t,resultRowComponent:o=ps,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>$o(L(n,(r=>Ao(o,{...Qo(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),Xo=({relationshipId:e,relationships:t,rowComponent:o=es,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,l]=Wo(_(t),e),I=n(e,u,c);return $o(L(I,(e=>Ao(o,{...Qo(s,e),key:e,tableId:l,rowId:e,store:i,debugIds:d}))),r,d,u)},Yo=e=>({checkpoints:t,checkpointComponent:o=Cs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return $o(L(e(Ro(n)),(e=>Ao(o,{...Qo(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Zo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:l,checkpointsById:I,children:a})=>{const p=Go(Q),[g,b]=Ko({}),C=zo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=zo((e=>b((t=>({...A(t,e)})))),[]);return Ao(Q.Provider,{value:Jo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},l??p[10],{...p[11],...I},C,m]),[e,t,g,o,s,r,d,n,u,c,i,l,I,p,C,m])},a)},$o=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},_o=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>$o(o+(ze(e,t,s,r)??o),void 0,d,s),es=({tableId:e,rowId:t,store:o,cellComponent:s=_o,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>$o(L(((e,t,o,s)=>{const r=Qe(t,o,s);return e??r})(d,e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ts=e=>No(e,Oe(e.tableId,e.store)),os=({cellId:e,descending:t,offset:o,limit:s,...r})=>No(r,je(r.tableId,e,t,o,s,r.store)),ss=({store:e,tableComponent:t=ts,getTableComponentProps:o,separator:s,debugIds:r})=>$o(L(Te(e),(s=>Ao(t,{...Qo(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),rs=({valueId:e,store:t,debugIds:s})=>$o(o+(Ue(e,t)??o),void 0,s,e),ds=({store:e,valueComponent:t=rs,getValueComponentProps:o,separator:s,debugIds:r})=>$o(L(Ke(e),(s=>Ao(t,{...Qo(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),ns=({metricId:e,metrics:t,debugIds:s})=>$o(At(e,t)??o,void 0,s,e),us=({indexId:e,sliceId:t,indexes:o,rowComponent:s=es,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),l=Wt(e,t,u);return $o(L(l,(e=>Ao(s,{...Qo(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},cs=({indexId:e,indexes:t,sliceComponent:o=us,getSliceComponentProps:s,separator:r,debugIds:d})=>$o(L(Ht(e,t),(r=>Ao(o,{...Qo(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),is=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=es,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Wo(_(o),e),i=Ut(e,t,n);return $o(h(c)||h(i)?null:Ao(s,{...Qo(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},ls=e=>Xo(e,Xt,e.remoteRowId),Is=e=>Xo(e,Yt,e.firstRowId),as=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>$o(o+(Io(e,t,s,r)??o),void 0,d,s),ps=({queryId:e,rowId:t,queries:o,resultCellComponent:s=as,getResultCellComponentProps:r,separator:d,debugIds:n})=>$o(L(lo(e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),gs=e=>Uo(e,uo(e.queryId,e.queries)),bs=({cellId:e,descending:t,offset:o,limit:s,...r})=>Uo(r,co(r.queryId,e,t,o,s,r.queries)),Cs=({checkpoints:e,checkpointId:t,debugIds:s})=>$o(fo(t,e)??o,void 0,s,t),ms=Yo((e=>e[0])),ys=Yo((e=>h(e[1])?[]:[e[1]])),ks=Yo((e=>e[2]));export{ms as BackwardCheckpointsView,_o as CellView,Cs as CheckpointView,ys as CurrentCheckpointView,ks as ForwardCheckpointsView,cs as IndexView,Is as LinkedRowsView,ls as LocalRowsView,ns as MetricView,Zo as Provider,is as RemoteRowView,as as ResultCellView,ps as ResultRowView,bs as ResultSortedTableView,gs as ResultTableView,es as RowView,us as SliceView,os as SortedTableView,ts as TableView,ss as TablesView,rs as ValueView,ds as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,Rt as useCellIdsListener,vt as useCellListener,fo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,oe as useCheckpoints,ho as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,wo as useCreateCheckpoints,jt as useCreateIndexes,xe as useCreateMergeableStore,Mt as useCreateMetrics,Eo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,Pe as useCreateStore,Mo as useCreateSynchronizer,ut as useDelCellCallback,nt as useDelRowCallback,dt as useDelTableCallback,rt as useDelTablesCallback,it as useDelValueCallback,ct as useDelValuesCallback,Et as useDidFinishTransactionListener,qo as useGoBackwardCallback,Po as useGoForwardCallback,xo as useGoToCallback,We as useHasCell,ft as useHasCellListener,De as useHasRow,wt as useHasRowListener,Ee as useHasTable,Ve as useHasTableCell,Ct as useHasTableCellListener,pt as useHasTableListener,Le as useHasTables,lt as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,qt as useHasValuesListener,Qt as useIndexIds,Y as useIndexes,Dt as useIndexesIds,Z as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,At as useMetric,Vt as useMetricIds,Ot as useMetricListener,U as useMetrics,Ft as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,to as useQueriesIds,te as useQueriesOrQueriesById,oo as useQueryIds,Lo as useRedoInformation,Nt as useRelationshipIds,$ as useRelationships,Kt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,Io as useResultCell,lo as useResultCellIds,yo as useResultCellIdsListener,ko as useResultCellListener,io as useResultRow,no as useResultRowCount,go as useResultRowCountListener,uo as useResultRowIds,bo as useResultRowIdsListener,mo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,ro as useResultTableCellIds,po as useResultTableCellIdsListener,ao as useResultTableListener,He as useRow,Ae as useRowCount,mt as useRowCountListener,Oe as useRowIds,yt as useRowIdsListener,ht as useRowListener,et as useSetCellCallback,vo as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,st as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,je as useSortedRowIds,kt as useSortedRowIdsListener,Bt as useStartTransactionListener,J as useStore,Se as useStoreIds,K as useStoreOrStoreById,Me as useTable,Fe as useTableCellIds,bt as useTableCellIdsListener,Te as useTableIds,at as useTableIdsListener,gt as useTableListener,Be as useTables,It as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,xt as useValueIdsListener,Lt as useValueListener,Je as useValues,Pt as useValuesListener,Tt as useWillFinishTransactionListener};
Binary file
@@ -1 +1 @@
1
- import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",I="Table",i=I+"s",l=I+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:Ie,useRef:ie,useState:le,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=le(),[r,d]=le();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=ie(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]),I=ae(c,n);return 0==s?{...I}:s<3?[...I]:I},we=(e,t,o,s=pe,r=pe,...d)=>Ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...L(n,(t=>v(t)?t(e,s):t)),o),o)))))),[u,t,...s,...d,...n])},Re=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((()=>o(d?.["del"+t](...r))),[d,t,...s,...r])},fe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},ve=(e,t=pe)=>ce(e,t),qe=(e,t=pe)=>ce(e,t),Pe=()=>G(1),xe=e=>ke(i,K(e),4,[]),Se=e=>ke(i,K(e),0),Le=e=>ke(l,K(e),1),Be=(e,t)=>ke(I,K(t),4,[e]),Te=(e,t)=>ke(I,K(t),0,[e]),Ee=(e,t)=>ke(I+m,K(t),1,[e]),Me=(e,t,o)=>ke(I+C,K(o),4,[e,t]),Fe=(e,t)=>ke(p,K(t),5,[e]),Ve=(e,t)=>ke(g,K(t),1,[e]),Ae=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),Oe=(e,t,o)=>ke(a,K(o),4,[e,t]),je=(e,t,o)=>ke(a,K(o),0,[e,t]),De=(e,t,o)=>ke(m,K(o),1,[e,t]),He=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),Qe=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),We=e=>ke(k,K(e),4,[]),ze=e=>ke(k,K(e),0),Ge=e=>ke(w,K(e),1),Je=(e,t)=>ke(y,K(t),4,[e]),Ke=(e,t)=>ke(y,K(t),3,[e]),Ne=(e,t,o,s,r)=>he(o,i,e,t,s,r),Ue=(e,t,o,s,r,d)=>he(s,I,t,o,r,d,e),Xe=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),Ye=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},Ze=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),$e=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),_e=(e,t,o,s,r)=>he(o,k,e,t,s,r),et=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),tt=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),ot=(e,t,o)=>Re(e,i,t,o),st=(e,t,o,s)=>Re(t,I,o,s,e),rt=(e,t,o,s,r)=>Re(o,a,s,r,e,t),dt=(e,t,o,s,r,d,n)=>Re(r,C,d,n,e,t,o,s),nt=(e,t,o)=>Re(e,k,t,o),ut=(e,t,o,s)=>Re(t,y,o,s,e),ct=(e,t,o,s)=>we(u+i,K(s),e,t,[],o),It=(e,t,o,s)=>we(i,K(s),e,t,pe,o),it=(e,t,o,s)=>we(l,K(s),e,t,pe,o),lt=(e,t,o,s,r)=>we(u+I,K(r),t,o,[e],s),at=(e,t,o,s,r)=>we(I,K(r),t,o,[e],s),pt=(e,t,o,s,r)=>we(I+m,K(r),t,o,[e],s),gt=(e,t,o,s,r,d)=>we(u+I+C,K(d),o,s,[e,t],r),bt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),Ct=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),mt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),yt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),kt=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),wt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),Rt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),ft=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),vt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),qt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),Pt=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),xt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),St=(e,t,o)=>we("Start"+de,K(o),e,t),Lt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Bt=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Tt=(e,t,o)=>me(e,t,o),Et=()=>G(3),Mt=e=>ke("MetricIds",X(e),1),Ft=(e,t)=>ke("Metric",X(t),3,[e]),Vt=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),At=(e,t,o)=>me(e,t,o),Ot=()=>G(5),jt=(e,t)=>ke("SliceIds",Z(t),1,[e]),Dt=e=>ke("IndexIds",Z(e),1),Ht=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),Qt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Wt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),zt=(e,t,o)=>me(e,t,o),Gt=()=>G(7),Jt=e=>ke("RelationshipIds",_(e),1),Kt=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Nt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Ut=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Xt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),Yt=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),Zt=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),$t=(e,t,o)=>me(e,t,o),_t=()=>G(9),eo=e=>ke("QueryIds",te(e),1),to=(e,t)=>ke(n+I,te(t),0,[e]),oo=(e,t)=>ke(n+I+m,te(t),1,[e]),so=(e,t)=>ke(n+p,te(t),5,[e]),ro=(e,t)=>ke(n+g,te(t),1,[e]),no=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),uo=(e,t,o)=>ke(n+a,te(o),0,[e,t]),co=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),io=(e,t,o,s)=>we(n+I,te(s),t,o,[e]),lo=(e,t,o,s)=>we(n+I+m,te(s),t,o,[e]),ao=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),go=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),bo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),Co=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),mo=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),yo=(e,t,o)=>me(e,t,o),ko=()=>G(11),wo=e=>ke("CheckpointIds",se(e),2),ho=(e,t)=>ke("Checkpoint",se(t),3,[e]),Ro=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},fo=e=>fe(e,"goBackward"),vo=e=>fe(e,"goForward"),qo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},Po=e=>{const t=se(e),[s,r]=wo(t);return[(d=s,!(0==q(d))),fo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},xo=e=>{const t=se(e),[,,[s]]=wo(t);return[!h(s),vo(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},So=(e,t,o)=>we("CheckpointIds",se(o),e,t),Lo=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Bo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=le(),[c,I]=le();return ue((()=>{const o=e?t(e):void 0;I(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},To=(e,t,o=pe,s,r=pe)=>{const[d,n]=le();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Eo,Fragment:Mo,createElement:Fo,useCallback:Vo,useLayoutEffect:Ao,useRef:Oo,useState:jo}=e,Do=(e,...t)=>h(e)?{}:e(...t),Ho=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:Qo,useContext:Wo,useMemo:zo,useState:Go}=e,Jo=({tableId:e,store:t,rowComponent:o=$o,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>Yo(L(u,(d=>Fo(o,{...Do(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Ko=({queryId:e,queries:t,resultRowComponent:o=ls,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>Yo(L(n,(r=>Fo(o,{...Do(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),No=({relationshipId:e,relationships:t,rowComponent:o=$o,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,I,i]=Ho(_(t),e),l=n(e,u,c);return Yo(L(l,(e=>Fo(o,{...Do(s,e),key:e,tableId:i,rowId:e,store:I,debugIds:d}))),r,d,u)},Uo=e=>({checkpoints:t,checkpointComponent:o=gs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return Yo(L(e(wo(n)),(e=>Fo(o,{...Do(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Xo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:I,checkpoints:i,checkpointsById:l,children:a})=>{const p=Wo(Q),[g,b]=Go({}),C=Qo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=Qo((e=>b((t=>({...A(t,e)})))),[]);return Fo(Q.Provider,{value:zo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...I},i??p[10],{...p[11],...l},C,m]),[e,t,g,o,s,r,d,n,u,c,I,i,l,p,C,m])},a)},Yo=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},Zo=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>Yo(o+(Qe(e,t,s,r)??o),void 0,d,s),$o=({tableId:e,rowId:t,store:o,cellComponent:s=Zo,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>Yo(L(((e,t,o,s)=>{const r=De(t,o,s);return e??r})(d,e,t,o),(d=>Fo(s,{...Do(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),_o=e=>Jo(e,Ve(e.tableId,e.store)),es=({cellId:e,descending:t,offset:o,limit:s,...r})=>Jo(r,Ae(r.tableId,e,t,o,s,r.store)),ts=({store:e,tableComponent:t=_o,getTableComponentProps:o,separator:s,debugIds:r})=>Yo(L(Le(e),(s=>Fo(t,{...Do(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),os=({valueId:e,store:t,debugIds:s})=>Yo(o+(Ke(e,t)??o),void 0,s,e),ss=({store:e,valueComponent:t=os,getValueComponentProps:o,separator:s,debugIds:r})=>Yo(L(Ge(e),(s=>Fo(t,{...Do(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),rs=({metricId:e,metrics:t,debugIds:s})=>Yo(Ft(e,t)??o,void 0,s,e),ds=({indexId:e,sliceId:t,indexes:o,rowComponent:s=$o,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,I]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),i=Ht(e,t,u);return Yo(L(i,(e=>Fo(s,{...Do(r,e),key:e,tableId:I,rowId:e,store:c,debugIds:n}))),d,n,t)},ns=({indexId:e,indexes:t,sliceComponent:o=ds,getSliceComponentProps:s,separator:r,debugIds:d})=>Yo(L(jt(e,t),(r=>Fo(o,{...Do(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),us=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=$o,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Ho(_(o),e),I=Kt(e,t,n);return Yo(h(c)||h(I)?null:Fo(s,{...Do(r,I),key:I,tableId:c,rowId:I,store:u,debugIds:d}),void 0,d,t)},cs=e=>No(e,Nt,e.remoteRowId),Is=e=>No(e,Ut,e.firstRowId),is=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>Yo(o+(Io(e,t,s,r)??o),void 0,d,s),ls=({queryId:e,rowId:t,queries:o,resultCellComponent:s=is,getResultCellComponentProps:r,separator:d,debugIds:n})=>Yo(L(co(e,t,o),(d=>Fo(s,{...Do(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),as=e=>Ko(e,ro(e.queryId,e.queries)),ps=({cellId:e,descending:t,offset:o,limit:s,...r})=>Ko(r,no(r.queryId,e,t,o,s,r.queries)),gs=({checkpoints:e,checkpointId:t,debugIds:s})=>Yo(ho(t,e)??o,void 0,s,t),bs=Uo((e=>e[0])),Cs=Uo((e=>h(e[1])?[]:[e[1]])),ms=Uo((e=>e[2]));export{bs as BackwardCheckpointsView,Zo as CellView,gs as CheckpointView,Cs as CurrentCheckpointView,ms as ForwardCheckpointsView,ns as IndexView,Is as LinkedRowsView,cs as LocalRowsView,rs as MetricView,Xo as Provider,us as RemoteRowView,is as ResultCellView,ls as ResultRowView,ps as ResultSortedTableView,as as ResultTableView,$o as RowView,ds as SliceView,es as SortedTableView,_o as TableView,ts as TablesView,os as ValueView,ss as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,Rt as useCellListener,ho as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Lo as useCheckpointListener,oe as useCheckpoints,ko as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,yo as useCreateCheckpoints,At as useCreateIndexes,qe as useCreateMergeableStore,Tt as useCreateMetrics,Bo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,ve as useCreateStore,To as useCreateSynchronizer,dt as useDelCellCallback,rt as useDelRowCallback,st as useDelTableCallback,ot as useDelTablesCallback,ut as useDelValueCallback,nt as useDelValuesCallback,Bt as useDidFinishTransactionListener,fo as useGoBackwardCallback,vo as useGoForwardCallback,qo as useGoToCallback,He as useHasCell,ht as useHasCellListener,Oe as useHasRow,yt as useHasRowListener,Be as useHasTable,Me as useHasTableCell,gt as useHasTableCellListener,lt as useHasTableListener,xe as useHasTables,ct as useHasTablesListener,Je as useHasValue,Pt as useHasValueListener,We as useHasValues,ft as useHasValuesListener,Dt as useIndexIds,Y as useIndexes,Ot as useIndexesIds,Z as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Ft as useMetric,Mt as useMetricIds,Vt as useMetricListener,U as useMetrics,Et as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,_t as useQueriesIds,te as useQueriesOrQueriesById,eo as useQueryIds,xo as useRedoInformation,Jt as useRelationshipIds,$ as useRelationships,Gt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,Io as useResultCell,co as useResultCellIds,Co as useResultCellIdsListener,mo as useResultCellListener,uo as useResultRow,so as useResultRowCount,ao as useResultRowCountListener,ro as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,no as useResultSortedRowIds,go as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,lo as useResultTableCellIdsListener,io as useResultTableListener,je as useRow,Fe as useRowCount,bt as useRowCountListener,Ve as useRowIds,Ct as useRowIdsListener,kt as useRowListener,$e as useSetCellCallback,Ro as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,jt as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Ae as useSortedRowIds,mt as useSortedRowIdsListener,St as useStartTransactionListener,J as useStore,Pe as useStoreIds,K as useStoreOrStoreById,Te as useTable,Ee as useTableCellIds,pt as useTableCellIdsListener,Le as useTableIds,it as useTableIdsListener,at as useTableListener,Se as useTables,It as useTablesListener,Po as useUndoInformation,Ke as useValue,Ge as useValueIds,qt as useValueIdsListener,xt as useValueListener,ze as useValues,vt as useValuesListener,Lt as useWillFinishTransactionListener};
1
+ import e from"react";const t=e=>typeof e,o="",s=t(o),r=t(t),d="Listener",n="Result",u="Has",c="Ids",i="Table",l=i+"s",I=i+c,a="Row",p=a+"Count",g=a+c,b="Sorted"+a+c,C="Cell",m=C+c,y="Value",k=y+"s",w=y+c,h=e=>null==e,R=(e,t,o)=>h(e)?o?.():t(e),f=e=>t(e)==s,v=e=>t(e)==r,q=e=>e.length,P=()=>{},x=(e,t)=>e.every(t),S=(e,t)=>q(e)===q(t)&&x(e,((e,o)=>t[o]===e)),L=(e,t)=>e.map(t),B=Object,T=e=>B.getPrototypeOf(e),E=B.entries,M=e=>!h(e)&&R(T(e),(e=>e==B.prototype||h(T(e))),(()=>!0)),F=B.keys,V=(e,t)=>R(e,(e=>e[t])),A=(e,t)=>(delete e[t],e),O=(e,t)=>{const o=E(e);return q(o)===q(F(t))&&x(o,(([e,o])=>M(o)?!!M(t[e])&&O(t[e],o):t[e]===o))},{createContext:j,useContext:D,useEffect:H}=e,Q=j([]),W=(e,t)=>{const o=D(Q);return h(e)?o[t]:f(e)?V(o[t+1]??{},e):e},z=(e,t)=>{const o=W(e,t);return h(e)||f(e)?o:e},G=e=>F(D(Q)[e]??{}),J=e=>W(e,0),K=e=>z(e,0),N=(e,t)=>{const{12:o,13:s}=D(Q);H((()=>(o?.(e,t),()=>s?.(e))),[o,e,t,s])},U=e=>W(e,2),X=e=>z(e,2),Y=e=>W(e,4),Z=e=>z(e,4),$=e=>W(e,6),_=e=>z(e,6),ee=e=>W(e,8),te=e=>z(e,8),oe=e=>W(e,10),se=e=>z(e,10),re=e=>e.toLowerCase();re(d);const de="Transaction";re(de);const{useCallback:ne,useEffect:ue,useMemo:ce,useLayoutEffect:ie,useRef:le,useState:Ie,useSyncExternalStore:ae}=e,pe=[],ge=[{},[],[pe,void 0,pe],void 0,!1,0],be=[O,S,([e,t,o],[s,r,d])=>t===r&&S(e,s)&&S(o,d)],Ce=(e,t)=>e===t,me=(e,t,o=pe)=>{const[,s]=Ie(),[r,d]=Ie();return ue((()=>{const o=e?t(e):void 0;return d(o),s([]),o?.destroy}),[e,...o]),r},ye=(e,t,...o)=>{const s=e?.["add"+t+d]?.(...o);return()=>e?.delListener(s)},ke=(e,t,s,r=pe)=>{const d=le(ge[s]),n=ne((()=>{const o=t?.[(4==s?"has":"get")+e]?.(...r)??ge[s];return(be[s]??Ce)(o,d.current)?d.current:d.current=o}),[t,s,e,...r]),c=ne((d=>ye(t,(4==s?u:o)+e,...r,d)),[t,s,e,...r]);return ae(c,n)},we=(e,t,o,s=pe,r=pe,...d)=>ie((()=>ye(t,e,...r,o,...d)),[t,e,...r,...s,...d]),he=(e,t,o,s=pe,r=P,d=pe,...n)=>{const u=K(e);return ne((e=>R(u,(s=>R(o(e,s),(o=>r(s["set"+t](...Re(n,s,e),o),o)))))),[u,t,...s,...d,...fe(n)])},Re=(e,t,o)=>L(e,(e=>v(e)?e(o,t):e)),fe=e=>{return t=e=>!v(e),e.filter(t);var t},ve=(e,t,o=P,s=pe,...r)=>{const d=K(e);return ne((e=>o(d?.["del"+t](...Re(r,d,e)))),[d,t,...s,...fe(r)])},qe=(e,t,o)=>{const s=se(e);return ne((()=>s?.[t](o)),[s,t,o])},Pe=(e,t=pe)=>ce(e,t),xe=(e,t=pe)=>ce(e,t),Se=()=>G(1),Le=e=>ke(l,K(e),4,[]),Be=e=>ke(l,K(e),0),Te=e=>ke(I,K(e),1),Ee=(e,t)=>ke(i,K(t),4,[e]),Me=(e,t)=>ke(i,K(t),0,[e]),Fe=(e,t)=>ke(i+m,K(t),1,[e]),Ve=(e,t,o)=>ke(i+C,K(o),4,[e,t]),Ae=(e,t)=>ke(p,K(t),5,[e]),Oe=(e,t)=>ke(g,K(t),1,[e]),je=(e,t,o,s=0,r,d)=>ke(b,K(d),1,[e,t,o,s,r]),De=(e,t,o)=>ke(a,K(o),4,[e,t]),He=(e,t,o)=>ke(a,K(o),0,[e,t]),Qe=(e,t,o)=>ke(m,K(o),1,[e,t]),We=(e,t,o,s)=>ke(C,K(s),4,[e,t,o]),ze=(e,t,o,s)=>ke(C,K(s),3,[e,t,o]),Ge=e=>ke(k,K(e),4,[]),Je=e=>ke(k,K(e),0),Ke=e=>ke(w,K(e),1),Ne=(e,t)=>ke(y,K(t),4,[e]),Ue=(e,t)=>ke(y,K(t),3,[e]),Xe=(e,t,o,s,r)=>he(o,l,e,t,s,r),Ye=(e,t,o,s,r,d)=>he(s,i,t,o,r,d,e),Ze=(e,t,o,s,r,d,n)=>he(r,a,o,s,d,n,e,t),$e=(e,t,o=pe,s,r=P,d=pe,n=!0)=>{const u=K(s);return ne((o=>R(u,(s=>R(t(o,s),(t=>r(s.addRow(v(e)?e(o,s):e,t,n),s,t)))))),[u,e,...o,...d,n])},_e=(e,t,o,s,r,d,n)=>he(r,"PartialRow",o,s,d,n,e,t),et=(e,t,o,s,r,d,n,u)=>he(d,C,s,r,n,u,e,t,o),tt=(e,t,o,s,r)=>he(o,k,e,t,s,r),ot=(e,t,o,s,r)=>he(o,"PartialValues",e,t,s,r),st=(e,t,o,s,r,d)=>he(s,y,t,o,r,d,e),rt=(e,t,o)=>ve(e,l,t,o),dt=(e,t,o,s)=>ve(t,i,o,s,e),nt=(e,t,o,s,r)=>ve(o,a,s,r,e,t),ut=(e,t,o,s,r,d,n)=>ve(r,C,d,n,e,t,o,s),ct=(e,t,o)=>ve(e,k,t,o),it=(e,t,o,s)=>ve(t,y,o,s,e),lt=(e,t,o,s)=>we(u+l,K(s),e,t,[],o),It=(e,t,o,s)=>we(l,K(s),e,t,pe,o),at=(e,t,o,s)=>we(I,K(s),e,t,pe,o),pt=(e,t,o,s,r)=>we(u+i,K(r),t,o,[e],s),gt=(e,t,o,s,r)=>we(i,K(r),t,o,[e],s),bt=(e,t,o,s,r)=>we(i+m,K(r),t,o,[e],s),Ct=(e,t,o,s,r,d)=>we(u+i+C,K(d),o,s,[e,t],r),mt=(e,t,o,s,r)=>we(p,K(r),t,o,[e],s),yt=(e,t,o,s,r)=>we(g,K(r),t,o,[e],s),kt=(e,t,o,s,r,d,n,u,c)=>we(b,K(c),d,n,[e,t,o,s,r],u),wt=(e,t,o,s,r,d)=>we(u+a,K(d),o,s,[e,t],r),ht=(e,t,o,s,r,d)=>we(a,K(d),o,s,[e,t],r),Rt=(e,t,o,s,r,d)=>we(m,K(d),o,s,[e,t],r),ft=(e,t,o,s,r,d,n)=>we(u+C,K(n),s,r,[e,t,o],d),vt=(e,t,o,s,r,d,n)=>we(C,K(n),s,r,[e,t,o],d),qt=(e,t,o,s)=>we(u+k,K(s),e,t,[],o),Pt=(e,t,o,s)=>we(k,K(s),e,t,pe,o),xt=(e,t,o,s)=>we(w,K(s),e,t,pe,o),St=(e,t,o,s,r)=>we(u+y,K(r),t,o,[e],s),Lt=(e,t,o,s,r)=>we(y,K(r),t,o,[e],s),Bt=(e,t,o)=>we("Start"+de,K(o),e,t),Tt=(e,t,o)=>we("WillFinish"+de,K(o),e,t),Et=(e,t,o)=>we("DidFinish"+de,K(o),e,t),Mt=(e,t,o)=>me(e,t,o),Ft=()=>G(3),Vt=e=>ke("MetricIds",X(e),1),At=(e,t)=>ke("Metric",X(t),3,[e]),Ot=(e,t,o,s)=>we("Metric",X(s),t,o,[e]),jt=(e,t,o)=>me(e,t,o),Dt=()=>G(5),Ht=(e,t)=>ke("SliceIds",Z(t),1,[e]),Qt=e=>ke("IndexIds",Z(e),1),Wt=(e,t,o)=>ke("Slice"+g,Z(o),1,[e,t]),zt=(e,t,o,s)=>we("SliceIds",Z(s),t,o,[e]),Gt=(e,t,o,s,r)=>we("Slice"+g,Z(r),o,s,[e,t]),Jt=(e,t,o)=>me(e,t,o),Kt=()=>G(7),Nt=e=>ke("RelationshipIds",_(e),1),Ut=(e,t,o)=>ke("RemoteRowId",_(o),3,[e,t]),Xt=(e,t,o)=>ke("Local"+g,_(o),1,[e,t]),Yt=(e,t,o)=>ke("Linked"+g,_(o),1,[e,t]),Zt=(e,t,o,s,r)=>we("RemoteRowId",_(r),o,s,[e,t]),$t=(e,t,o,s,r)=>we("Local"+g,_(r),o,s,[e,t]),_t=(e,t,o,s,r)=>we("Linked"+g,_(r),o,s,[e,t]),eo=(e,t,o)=>me(e,t,o),to=()=>G(9),oo=e=>ke("QueryIds",te(e),1),so=(e,t)=>ke(n+i,te(t),0,[e]),ro=(e,t)=>ke(n+i+m,te(t),1,[e]),no=(e,t)=>ke(n+p,te(t),5,[e]),uo=(e,t)=>ke(n+g,te(t),1,[e]),co=(e,t,o,s=0,r,d)=>ke(n+b,te(d),1,[e,t,o,s,r]),io=(e,t,o)=>ke(n+a,te(o),0,[e,t]),lo=(e,t,o)=>ke(n+m,te(o),1,[e,t]),Io=(e,t,o,s)=>ke(n+C,te(s),3,[e,t,o]),ao=(e,t,o,s)=>we(n+i,te(s),t,o,[e]),po=(e,t,o,s)=>we(n+i+m,te(s),t,o,[e]),go=(e,t,o,s)=>we(n+p,te(s),t,o,[e]),bo=(e,t,o,s)=>we(n+g,te(s),t,o,[e]),Co=(e,t,o,s,r,d,u,c)=>we(n+b,te(c),d,u,[e,t,o,s,r]),mo=(e,t,o,s,r)=>we(n+a,te(r),o,s,[e,t]),yo=(e,t,o,s,r)=>we(n+m,te(r),o,s,[e,t]),ko=(e,t,o,s,r,d)=>we(n+C,te(d),s,r,[e,t,o]),wo=(e,t,o)=>me(e,t,o),ho=()=>G(11),Ro=e=>ke("CheckpointIds",se(e),2),fo=(e,t)=>ke("Checkpoint",se(t),3,[e]),vo=(e=P,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>{const r=e(t);s(o.addCheckpoint(r),o,r)}))),[d,...t,...r])},qo=e=>qe(e,"goBackward"),Po=e=>qe(e,"goForward"),xo=(e,t=pe,o,s=P,r=pe)=>{const d=se(o);return ne((t=>R(d,(o=>R(e(t),(e=>s(o.goTo(e),e)))))),[d,...t,...r])},So=e=>{const t=se(e),[s,r]=Ro(t);return[(d=s,!(0==q(d))),qo(t),r,R(r,(e=>t?.getCheckpoint(e)))??o];var d},Lo=e=>{const t=se(e),[,,[s]]=Ro(t);return[!h(s),Po(t),s,R(s,(e=>t?.getCheckpoint(e)))??o]},Bo=(e,t,o)=>we("CheckpointIds",se(o),e,t),To=(e,t,o,s)=>we("Checkpoint",se(s),t,o,[e]),Eo=(e,t,o=pe,s,r=pe,d,n=pe)=>{const[,u]=Ie(),[c,i]=Ie();return ue((()=>{const o=e?t(e):void 0;i(o),o&&s&&(async()=>{await s(o),u([])})()}),[e,...o,...r]),ue((()=>()=>{c&&(c.destroy(),d?.(c))}),[c,...n]),c},Mo=(e,t,o=pe,s,r=pe)=>{const[d,n]=Ie();return ue((()=>{(async()=>{const o=e?await t(e):void 0;n(o)})()}),[e,...o]),ue((()=>()=>{d&&(d.destroy(),s?.(d))}),[d,...r]),d},{PureComponent:Fo,Fragment:Vo,createElement:Ao,useCallback:Oo,useLayoutEffect:jo,useRef:Do,useState:Ho}=e,Qo=(e,...t)=>h(e)?{}:e(...t),Wo=(e,t)=>[e,e?.getStore(),e?.getLocalTableId(t),e?.getRemoteTableId(t)],{useCallback:zo,useContext:Go,useMemo:Jo,useState:Ko}=e,No=({tableId:e,store:t,rowComponent:o=es,getRowComponentProps:s,customCellIds:r,separator:d,debugIds:n},u)=>$o(L(u,(d=>Ao(o,{...Qo(s,d),key:d,tableId:e,rowId:d,customCellIds:r,store:t,debugIds:n}))),d,n,e),Uo=({queryId:e,queries:t,resultRowComponent:o=ps,getResultRowComponentProps:s,separator:r,debugIds:d},n)=>$o(L(n,(r=>Ao(o,{...Qo(s,r),key:r,queryId:e,rowId:r,queries:t,debugIds:d}))),r,d,e),Xo=({relationshipId:e,relationships:t,rowComponent:o=es,getRowComponentProps:s,separator:r,debugIds:d},n,u)=>{const[c,i,l]=Wo(_(t),e),I=n(e,u,c);return $o(L(I,(e=>Ao(o,{...Qo(s,e),key:e,tableId:l,rowId:e,store:i,debugIds:d}))),r,d,u)},Yo=e=>({checkpoints:t,checkpointComponent:o=Cs,getCheckpointComponentProps:s,separator:r,debugIds:d})=>{const n=se(t);return $o(L(e(Ro(n)),(e=>Ao(o,{...Qo(s,e),key:e,checkpoints:n,checkpointId:e,debugIds:d}))),r)},Zo=({store:e,storesById:t,metrics:o,metricsById:s,indexes:r,indexesById:d,relationships:n,relationshipsById:u,queries:c,queriesById:i,checkpoints:l,checkpointsById:I,children:a})=>{const p=Go(Q),[g,b]=Ko({}),C=zo(((e,t)=>b((o=>V(o,e)==t?o:{...o,[e]:t}))),[]),m=zo((e=>b((t=>({...A(t,e)})))),[]);return Ao(Q.Provider,{value:Jo((()=>[e??p[0],{...p[1],...t,...g},o??p[2],{...p[3],...s},r??p[4],{...p[5],...d},n??p[6],{...p[7],...u},c??p[8],{...p[9],...i},l??p[10],{...p[11],...I},C,m]),[e,t,g,o,s,r,d,n,u,c,i,l,I,p,C,m])},a)},$o=(e,t,o,s)=>{const r=h(t)||!Array.isArray(e)?e:L(e,((e,o)=>o>0?[t,e]:e));return o?[s,":{",r,"}"]:r},_o=({tableId:e,rowId:t,cellId:s,store:r,debugIds:d})=>$o(o+(ze(e,t,s,r)??o),void 0,d,s),es=({tableId:e,rowId:t,store:o,cellComponent:s=_o,getCellComponentProps:r,customCellIds:d,separator:n,debugIds:u})=>$o(L(((e,t,o,s)=>{const r=Qe(t,o,s);return e??r})(d,e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,tableId:e,rowId:t,cellId:d,store:o,debugIds:u}))),n,u,t),ts=e=>No(e,Oe(e.tableId,e.store)),os=({cellId:e,descending:t,offset:o,limit:s,...r})=>No(r,je(r.tableId,e,t,o,s,r.store)),ss=({store:e,tableComponent:t=ts,getTableComponentProps:o,separator:s,debugIds:r})=>$o(L(Te(e),(s=>Ao(t,{...Qo(o,s),key:s,tableId:s,store:e,debugIds:r}))),s),rs=({valueId:e,store:t,debugIds:s})=>$o(o+(Ue(e,t)??o),void 0,s,e),ds=({store:e,valueComponent:t=rs,getValueComponentProps:o,separator:s,debugIds:r})=>$o(L(Ke(e),(s=>Ao(t,{...Qo(o,s),key:s,valueId:s,store:e,debugIds:r}))),s),ns=({metricId:e,metrics:t,debugIds:s})=>$o(At(e,t)??o,void 0,s,e),us=({indexId:e,sliceId:t,indexes:o,rowComponent:s=es,getRowComponentProps:r,separator:d,debugIds:n})=>{const[u,c,i]=((e,t)=>[e,e?.getStore(),e?.getTableId(t)])(Z(o),e),l=Wt(e,t,u);return $o(L(l,(e=>Ao(s,{...Qo(r,e),key:e,tableId:i,rowId:e,store:c,debugIds:n}))),d,n,t)},cs=({indexId:e,indexes:t,sliceComponent:o=us,getSliceComponentProps:s,separator:r,debugIds:d})=>$o(L(Ht(e,t),(r=>Ao(o,{...Qo(s,r),key:r,indexId:e,sliceId:r,indexes:t,debugIds:d}))),r,d,e),is=({relationshipId:e,localRowId:t,relationships:o,rowComponent:s=es,getRowComponentProps:r,debugIds:d})=>{const[n,u,,c]=Wo(_(o),e),i=Ut(e,t,n);return $o(h(c)||h(i)?null:Ao(s,{...Qo(r,i),key:i,tableId:c,rowId:i,store:u,debugIds:d}),void 0,d,t)},ls=e=>Xo(e,Xt,e.remoteRowId),Is=e=>Xo(e,Yt,e.firstRowId),as=({queryId:e,rowId:t,cellId:s,queries:r,debugIds:d})=>$o(o+(Io(e,t,s,r)??o),void 0,d,s),ps=({queryId:e,rowId:t,queries:o,resultCellComponent:s=as,getResultCellComponentProps:r,separator:d,debugIds:n})=>$o(L(lo(e,t,o),(d=>Ao(s,{...Qo(r,d),key:d,queryId:e,rowId:t,cellId:d,queries:o,debugIds:n}))),d,n,t),gs=e=>Uo(e,uo(e.queryId,e.queries)),bs=({cellId:e,descending:t,offset:o,limit:s,...r})=>Uo(r,co(r.queryId,e,t,o,s,r.queries)),Cs=({checkpoints:e,checkpointId:t,debugIds:s})=>$o(fo(t,e)??o,void 0,s,t),ms=Yo((e=>e[0])),ys=Yo((e=>h(e[1])?[]:[e[1]])),ks=Yo((e=>e[2]));export{ms as BackwardCheckpointsView,_o as CellView,Cs as CheckpointView,ys as CurrentCheckpointView,ks as ForwardCheckpointsView,cs as IndexView,Is as LinkedRowsView,ls as LocalRowsView,ns as MetricView,Zo as Provider,is as RemoteRowView,as as ResultCellView,ps as ResultRowView,bs as ResultSortedTableView,gs as ResultTableView,es as RowView,us as SliceView,os as SortedTableView,ts as TableView,ss as TablesView,rs as ValueView,ds as ValuesView,$e as useAddRowCallback,ze as useCell,Qe as useCellIds,Rt as useCellIdsListener,vt as useCellListener,fo as useCheckpoint,Ro as useCheckpointIds,Bo as useCheckpointIdsListener,To as useCheckpointListener,oe as useCheckpoints,ho as useCheckpointsIds,se as useCheckpointsOrCheckpointsById,wo as useCreateCheckpoints,jt as useCreateIndexes,xe as useCreateMergeableStore,Mt as useCreateMetrics,Eo as useCreatePersister,eo as useCreateQueries,Jt as useCreateRelationships,Pe as useCreateStore,Mo as useCreateSynchronizer,ut as useDelCellCallback,nt as useDelRowCallback,dt as useDelTableCallback,rt as useDelTablesCallback,it as useDelValueCallback,ct as useDelValuesCallback,Et as useDidFinishTransactionListener,qo as useGoBackwardCallback,Po as useGoForwardCallback,xo as useGoToCallback,We as useHasCell,ft as useHasCellListener,De as useHasRow,wt as useHasRowListener,Ee as useHasTable,Ve as useHasTableCell,Ct as useHasTableCellListener,pt as useHasTableListener,Le as useHasTables,lt as useHasTablesListener,Ne as useHasValue,St as useHasValueListener,Ge as useHasValues,qt as useHasValuesListener,Qt as useIndexIds,Y as useIndexes,Dt as useIndexesIds,Z as useIndexesOrIndexesById,Yt as useLinkedRowIds,_t as useLinkedRowIdsListener,Xt as useLocalRowIds,$t as useLocalRowIdsListener,At as useMetric,Vt as useMetricIds,Ot as useMetricListener,U as useMetrics,Ft as useMetricsIds,X as useMetricsOrMetricsById,N as useProvideStore,ee as useQueries,to as useQueriesIds,te as useQueriesOrQueriesById,oo as useQueryIds,Lo as useRedoInformation,Nt as useRelationshipIds,$ as useRelationships,Kt as useRelationshipsIds,_ as useRelationshipsOrRelationshipsById,Ut as useRemoteRowId,Zt as useRemoteRowIdListener,Io as useResultCell,lo as useResultCellIds,yo as useResultCellIdsListener,ko as useResultCellListener,io as useResultRow,no as useResultRowCount,go as useResultRowCountListener,uo as useResultRowIds,bo as useResultRowIdsListener,mo as useResultRowListener,co as useResultSortedRowIds,Co as useResultSortedRowIdsListener,so as useResultTable,ro as useResultTableCellIds,po as useResultTableCellIdsListener,ao as useResultTableListener,He as useRow,Ae as useRowCount,mt as useRowCountListener,Oe as useRowIds,yt as useRowIdsListener,ht as useRowListener,et as useSetCellCallback,vo as useSetCheckpointCallback,_e as useSetPartialRowCallback,ot as useSetPartialValuesCallback,Ze as useSetRowCallback,Ye as useSetTableCallback,Xe as useSetTablesCallback,st as useSetValueCallback,tt as useSetValuesCallback,Ht as useSliceIds,zt as useSliceIdsListener,Wt as useSliceRowIds,Gt as useSliceRowIdsListener,je as useSortedRowIds,kt as useSortedRowIdsListener,Bt as useStartTransactionListener,J as useStore,Se as useStoreIds,K as useStoreOrStoreById,Me as useTable,Fe as useTableCellIds,bt as useTableCellIdsListener,Te as useTableIds,at as useTableIdsListener,gt as useTableListener,Be as useTables,It as useTablesListener,So as useUndoInformation,Ue as useValue,Ke as useValueIds,xt as useValueIdsListener,Lt as useValueListener,Je as useValues,Pt as useValuesListener,Tt as useWillFinishTransactionListener};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",