tinybase 5.0.0 → 5.0.1

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 (39) hide show
  1. package/cjs/es6/min/ui-react/index.cjs +1 -1
  2. package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
  3. package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
  4. package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
  5. package/cjs/es6/ui-react/index.cjs +1 -28
  6. package/cjs/es6/ui-react/with-schemas/index.cjs +1 -28
  7. package/cjs/min/ui-react/index.cjs +1 -1
  8. package/cjs/min/ui-react/index.cjs.gz +0 -0
  9. package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
  10. package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
  11. package/cjs/ui-react/index.cjs +1 -6
  12. package/cjs/ui-react/with-schemas/index.cjs +1 -6
  13. package/es6/min/ui-react/index.js +1 -1
  14. package/es6/min/ui-react/index.js.gz +0 -0
  15. package/es6/min/ui-react/with-schemas/index.js +1 -1
  16. package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
  17. package/es6/ui-react/index.js +1 -28
  18. package/es6/ui-react/with-schemas/index.js +1 -28
  19. package/min/ui-react/index.js +1 -1
  20. package/min/ui-react/index.js.gz +0 -0
  21. package/min/ui-react/with-schemas/index.js +1 -1
  22. package/min/ui-react/with-schemas/index.js.gz +0 -0
  23. package/package.json +1 -1
  24. package/readme.md +40 -13
  25. package/releases.md +22 -22
  26. package/ui-react/index.js +1 -6
  27. package/ui-react/with-schemas/index.js +1 -6
  28. package/umd/es6/min/ui-react/index.js +1 -1
  29. package/umd/es6/min/ui-react/index.js.gz +0 -0
  30. package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
  31. package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
  32. package/umd/es6/ui-react/index.js +1 -28
  33. package/umd/es6/ui-react/with-schemas/index.js +1 -28
  34. package/umd/min/ui-react/index.js +1 -1
  35. package/umd/min/ui-react/index.js.gz +0 -0
  36. package/umd/min/ui-react/with-schemas/index.js +1 -1
  37. package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
  38. package/umd/ui-react/index.js +1 -6
  39. package/umd/ui-react/with-schemas/index.js +1 -6
@@ -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",c=i+"s",a=i+u,I="Row",p=I+"Count",v=I+u,b="Sorted"+I+u,g="Cell",y=g+u,m="Value",C=m+"s",w=m+u,f=e=>null==e,k=(e,t,o)=>f(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=>!f(e)&&k(j(e),(e=>e==L.prototype||f(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 f(e)?r[t]:h(e)?M(null!=(o=r[t+1])?o:{},e):e},W=(e,t)=>{const o=Q(e,t);return f(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:ce,useState:ae,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]=ae(),[n,l]=ae();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=ce(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)},we=(e,t,o,r=pe,n=pe,...l)=>ie((()=>me(t,e,...n,o,...l)),[t,e,...n,...r,...l]),fe=(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](...O(s,(t=>P(t)?t(e,r):t)),o),o)))))),[d,t,...r,...l,...s])},ke=(e,t,o=x,r=pe,...n)=>{const l=J(e);return se((()=>o(null==l?void 0:l["del"+t](...n))),[l,t,...r,...n])},he=(e,t,o)=>{const r=oe(e);return se((()=>null==r?void 0:r[t](o)),[r,t,o])},Pe=(e,t=pe)=>ue(e,t),Re=(e,t=pe)=>ue(e,t),xe=()=>z(1),qe=e=>Ce(c,J(e),4,[]),Se=e=>Ce(c,J(e),0),Oe=e=>Ce(a,J(e),1),Le=(e,t)=>Ce(i,J(t),4,[e]),je=(e,t)=>Ce(i,J(t),0,[e]),Be=(e,t)=>Ce(i+y,J(t),1,[e]),Ee=(e,t,o)=>Ce(i+g,J(o),4,[e,t]),Te=(e,t)=>Ce(p,J(t),5,[e]),Me=(e,t)=>Ce(v,J(t),1,[e]),Fe=(e,t,o,r=0,n,l)=>Ce(b,J(l),1,[e,t,o,r,n]),Ve=(e,t,o)=>Ce(I,J(o),4,[e,t]),Ae=(e,t,o)=>Ce(I,J(o),0,[e,t]),De=(e,t,o)=>Ce(y,J(o),1,[e,t]),He=(e,t,o,r)=>Ce(g,J(r),4,[e,t,o]),Qe=(e,t,o,r)=>Ce(g,J(r),3,[e,t,o]),We=e=>Ce(C,J(e),4,[]),ze=e=>Ce(C,J(e),0),Ge=e=>Ce(w,J(e),1),Je=(e,t)=>Ce(m,J(t),4,[e]),Ke=(e,t)=>Ce(m,J(t),3,[e]),Ne=(e,t,o,r,n)=>fe(o,c,e,t,r,n),Ue=(e,t,o,r,n,l)=>fe(r,i,t,o,n,l,e),Xe=(e,t,o,r,n,l,s)=>fe(n,I,o,r,l,s,e,t),Ye=(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])},Ze=(e,t,o,r,n,l,s)=>fe(n,"PartialRow",o,r,l,s,e,t),$e=(e,t,o,r,n,l,s,d)=>fe(l,g,r,n,s,d,e,t,o),_e=(e,t,o,r,n)=>fe(o,C,e,t,r,n),et=(e,t,o,r,n)=>fe(o,"PartialValues",e,t,r,n),tt=(e,t,o,r,n,l)=>fe(r,m,t,o,n,l,e),ot=(e,t,o)=>ke(e,c,t,o),rt=(e,t,o,r)=>ke(t,i,o,r,e),nt=(e,t,o,r,n)=>ke(o,I,r,n,e,t),lt=(e,t,o,r,n,l,s)=>ke(n,g,l,s,e,t,o,r),st=(e,t,o)=>ke(e,C,t,o),dt=(e,t,o,r)=>ke(t,m,o,r,e),ut=(e,t,o,r)=>we(d+c,J(r),e,t,[],o),it=(e,t,o,r)=>we(c,J(r),e,t,pe,o),ct=(e,t,o,r)=>we(a,J(r),e,t,pe,o),at=(e,t,o,r,n)=>we(d+i,J(n),t,o,[e],r),It=(e,t,o,r,n)=>we(i,J(n),t,o,[e],r),pt=(e,t,o,r,n)=>we(i+y,J(n),t,o,[e],r),vt=(e,t,o,r,n,l)=>we(d+i+g,J(l),o,r,[e,t],n),bt=(e,t,o,r,n)=>we(p,J(n),t,o,[e],r),gt=(e,t,o,r,n)=>we(v,J(n),t,o,[e],r),yt=(e,t,o,r,n,l,s,d,u)=>we(b,J(u),l,s,[e,t,o,r,n],d),mt=(e,t,o,r,n,l)=>we(d+I,J(l),o,r,[e,t],n),Ct=(e,t,o,r,n,l)=>we(I,J(l),o,r,[e,t],n),wt=(e,t,o,r,n,l)=>we(y,J(l),o,r,[e,t],n),ft=(e,t,o,r,n,l,s)=>we(d+g,J(s),r,n,[e,t,o],l),kt=(e,t,o,r,n,l,s)=>we(g,J(s),r,n,[e,t,o],l),ht=(e,t,o,r)=>we(d+C,J(r),e,t,[],o),Pt=(e,t,o,r)=>we(C,J(r),e,t,pe,o),Rt=(e,t,o,r)=>we(w,J(r),e,t,pe,o),xt=(e,t,o,r,n)=>we(d+m,J(n),t,o,[e],r),qt=(e,t,o,r,n)=>we(m,J(n),t,o,[e],r),St=(e,t,o)=>we("Start"+ne,J(o),e,t),Ot=(e,t,o)=>we("WillFinish"+ne,J(o),e,t),Lt=(e,t,o)=>we("DidFinish"+ne,J(o),e,t),jt=(e,t,o)=>ye(e,t,o),Bt=()=>z(3),Et=e=>Ce("MetricIds",U(e),1),Tt=(e,t)=>Ce("Metric",U(t),3,[e]),Mt=(e,t,o,r)=>we("Metric",U(r),t,o,[e]),Ft=(e,t,o)=>ye(e,t,o),Vt=()=>z(5),At=(e,t)=>Ce("SliceIds",Y(t),1,[e]),Dt=e=>Ce("IndexIds",Y(e),1),Ht=(e,t,o)=>Ce("Slice"+v,Y(o),1,[e,t]),Qt=(e,t,o,r)=>we("SliceIds",Y(r),t,o,[e]),Wt=(e,t,o,r,n)=>we("Slice"+v,Y(n),o,r,[e,t]),zt=(e,t,o)=>ye(e,t,o),Gt=()=>z(7),Jt=e=>Ce("RelationshipIds",$(e),1),Kt=(e,t,o)=>Ce("RemoteRowId",$(o),3,[e,t]),Nt=(e,t,o)=>Ce("Local"+v,$(o),1,[e,t]),Ut=(e,t,o)=>Ce("Linked"+v,$(o),1,[e,t]),Xt=(e,t,o,r,n)=>we("RemoteRowId",$(n),o,r,[e,t]),Yt=(e,t,o,r,n)=>we("Local"+v,$(n),o,r,[e,t]),Zt=(e,t,o,r,n)=>we("Linked"+v,$(n),o,r,[e,t]),$t=(e,t,o)=>ye(e,t,o),_t=()=>z(9),eo=e=>Ce("QueryIds",ee(e),1),to=(e,t)=>Ce(s+i,ee(t),0,[e]),oo=(e,t)=>Ce(s+i+y,ee(t),1,[e]),ro=(e,t)=>Ce(s+p,ee(t),5,[e]),no=(e,t)=>Ce(s+v,ee(t),1,[e]),lo=(e,t,o,r=0,n,l)=>Ce(s+b,ee(l),1,[e,t,o,r,n]),so=(e,t,o)=>Ce(s+I,ee(o),0,[e,t]),uo=(e,t,o)=>Ce(s+y,ee(o),1,[e,t]),io=(e,t,o,r)=>Ce(s+g,ee(r),3,[e,t,o]),co=(e,t,o,r)=>we(s+i,ee(r),t,o,[e]),ao=(e,t,o,r)=>we(s+i+y,ee(r),t,o,[e]),Io=(e,t,o,r)=>we(s+p,ee(r),t,o,[e]),po=(e,t,o,r)=>we(s+v,ee(r),t,o,[e]),vo=(e,t,o,r,n,l,d,u)=>we(s+b,ee(u),l,d,[e,t,o,r,n]),bo=(e,t,o,r,n)=>we(s+I,ee(n),o,r,[e,t]),go=(e,t,o,r,n)=>we(s+y,ee(n),o,r,[e,t]),yo=(e,t,o,r,n,l)=>we(s+g,ee(l),r,n,[e,t,o]),mo=(e,t,o)=>ye(e,t,o),Co=()=>z(11),wo=e=>Ce("CheckpointIds",oe(e),2),fo=(e,t)=>Ce("Checkpoint",oe(t),3,[e]),ko=(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])},ho=e=>he(e,"goBackward"),Po=e=>he(e,"goForward"),Ro=(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])},xo=e=>{var t;const r=oe(e),[n,l]=wo(r);return[(s=n,!(0==R(s))),ho(r),l,null!=(t=k(l,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o];var s},qo=e=>{var t;const r=oe(e),[,,[n]]=wo(r);return[!f(n),Po(r),n,null!=(t=k(n,(e=>null==r?void 0:r.getCheckpoint(e))))?t:o]},So=(e,t,o)=>we("CheckpointIds",oe(o),e,t),Oo=(e,t,o,r)=>we("Checkpoint",oe(r),t,o,[e]),Lo=(e,t,o=pe,r,n=pe,l,s=pe)=>{const[,d]=ae(),[u,i]=ae();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},jo=(e,t,o=pe,r,n=pe)=>{const[l,s]=ae();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:Bo,Fragment:Eo,createElement:To,useCallback:Mo,useLayoutEffect:Fo,useRef:Vo,useState:Ao}=e,Do=(e,...t)=>f(e)?{}:e(...t),Ho=(e,t)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(t),null==e?void 0:e.getRemoteTableId(t)];var Qo=Object.defineProperty,Wo=Object.defineProperties,zo=Object.getOwnPropertyDescriptors,Go=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Ko=Object.prototype.propertyIsEnumerable,No=(e,t,o)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,Uo=(e,t)=>{for(var o in t||(t={}))Jo.call(t,o)&&No(e,o,t[o]);if(Go)for(var o of Go(t))Ko.call(t,o)&&No(e,o,t[o]);return e},Xo=(e,t)=>Wo(e,zo(t)),Yo=(e,t)=>{var o={};for(var r in e)Jo.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&Go)for(var r of Go(e))t.indexOf(r)<0&&Ko.call(e,r)&&(o[r]=e[r]);return o};const{useCallback:Zo,useContext:$o,useMemo:_o,useState:er}=e,tr=({tableId:e,store:t,rowComponent:o=ur,getRowComponentProps:r,customCellIds:n,separator:l,debugIds:s},d)=>sr(O(d,(l=>To(o,Xo(Uo({},Do(r,l)),{key:l,tableId:e,rowId:l,customCellIds:n,store:t,debugIds:s})))),l,s,e),or=({queryId:e,queries:t,resultRowComponent:o=fr,getResultRowComponentProps:r,separator:n,debugIds:l},s)=>sr(O(s,(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,queryId:e,rowId:n,queries:t,debugIds:l})))),n,l,e),rr=({relationshipId:e,relationships:t,rowComponent:o=ur,getRowComponentProps:r,separator:n,debugIds:l},s,d)=>{const[u,i,c]=Ho($(t),e),a=s(e,d,u);return sr(O(a,(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,tableId:c,rowId:e,store:i,debugIds:l})))),n,l,d)},nr=e=>({checkpoints:t,checkpointComponent:o=Pr,getCheckpointComponentProps:r,separator:n,debugIds:l})=>{const s=oe(t);return sr(O(e(wo(s)),(e=>To(o,Xo(Uo({},Do(r,e)),{key:e,checkpoints:s,checkpointId:e,debugIds:l})))),n)},lr=({store:e,storesById:t,metrics:o,metricsById:r,indexes:n,indexesById:l,relationships:s,relationshipsById:d,queries:u,queriesById:i,checkpoints:c,checkpointsById:a,children:I})=>{const p=$o(H),[v,b]=er({}),g=Zo(((e,t)=>b((o=>M(o,e)==t?o:Xo(Uo({},o),{[e]:t})))),[]),y=Zo((e=>b((t=>Uo({},((e,t)=>(delete e[t],e))(t,e))))),[]);return To(H.Provider,{value:_o((()=>[null!=e?e:p[0],Uo(Uo(Uo({},p[1]),t),v),null!=o?o:p[2],Uo(Uo({},p[3]),r),null!=n?n:p[4],Uo(Uo({},p[5]),l),null!=s?s:p[6],Uo(Uo({},p[7]),d),null!=u?u:p[8],Uo(Uo({},p[9]),i),null!=c?c:p[10],Uo(Uo({},p[11]),a),g,y]),[e,t,v,o,r,n,l,s,d,u,i,c,a,p,g,y])},I)},sr=(e,t,o,r)=>{const n=f(t)||!Array.isArray(e)?e:O(e,((e,o)=>o>0?[t,e]:e));return o?[r,":{",n,"}"]:n},dr=({tableId:e,rowId:t,cellId:r,store:n,debugIds:l})=>{var s;return sr(o+(null!=(s=Qe(e,t,r,n))?s:o),void 0,l,r)},ur=({tableId:e,rowId:t,store:o,cellComponent:r=dr,getCellComponentProps:n,customCellIds:l,separator:s,debugIds:d})=>sr(O(((e,t,o,r)=>{const n=De(t,o,r);return null!=e?e:n})(l,e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,tableId:e,rowId:t,cellId:l,store:o,debugIds:d})))),s,d,t),ir=e=>tr(e,Me(e.tableId,e.store)),cr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return tr(s,Fe(s.tableId,o,r,n,l,s.store))},ar=({store:e,tableComponent:t=ir,getTableComponentProps:o,separator:r,debugIds:n})=>sr(O(Oe(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,tableId:r,store:e,debugIds:n})))),r),Ir=({valueId:e,store:t,debugIds:r})=>{var n;return sr(o+(null!=(n=Ke(e,t))?n:o),void 0,r,e)},pr=({store:e,valueComponent:t=Ir,getValueComponentProps:o,separator:r,debugIds:n})=>sr(O(Ge(e),(r=>To(t,Xo(Uo({},Do(o,r)),{key:r,valueId:r,store:e,debugIds:n})))),r),vr=({metricId:e,metrics:t,debugIds:r})=>{var n;return sr(null!=(n=Tt(e,t))?n:o,void 0,r,e)},br=({indexId:e,sliceId:t,indexes:o,rowComponent:r=ur,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),c=Ht(e,t,d);return sr(O(c,(e=>To(r,Xo(Uo({},Do(n,e)),{key:e,tableId:i,rowId:e,store:u,debugIds:s})))),l,s,t)},gr=({indexId:e,indexes:t,sliceComponent:o=br,getSliceComponentProps:r,separator:n,debugIds:l})=>sr(O(At(e,t),(n=>To(o,Xo(Uo({},Do(r,n)),{key:n,indexId:e,sliceId:n,indexes:t,debugIds:l})))),n,l,e),yr=({relationshipId:e,localRowId:t,relationships:o,rowComponent:r=ur,getRowComponentProps:n,debugIds:l})=>{const[s,d,,u]=Ho($(o),e),i=Kt(e,t,s);return sr(f(u)||f(i)?null:To(r,Xo(Uo({},Do(n,i)),{key:i,tableId:u,rowId:i,store:d,debugIds:l})),void 0,l,t)},mr=e=>rr(e,Nt,e.remoteRowId),Cr=e=>rr(e,Ut,e.firstRowId),wr=({queryId:e,rowId:t,cellId:r,queries:n,debugIds:l})=>{var s;return sr(o+(null!=(s=io(e,t,r,n))?s:o),void 0,l,r)},fr=({queryId:e,rowId:t,queries:o,resultCellComponent:r=wr,getResultCellComponentProps:n,separator:l,debugIds:s})=>sr(O(uo(e,t,o),(l=>To(r,Xo(Uo({},Do(n,l)),{key:l,queryId:e,rowId:t,cellId:l,queries:o,debugIds:s})))),l,s,t),kr=e=>or(e,no(e.queryId,e.queries)),hr=e=>{var t=e,{cellId:o,descending:r,offset:n,limit:l}=t,s=Yo(t,["cellId","descending","offset","limit"]);return or(s,lo(s.queryId,o,r,n,l,s.queries))},Pr=({checkpoints:e,checkpointId:t,debugIds:r})=>{var n;return sr(null!=(n=fo(t,e))?n:o,void 0,r,t)},Rr=nr((e=>e[0])),xr=nr((e=>f(e[1])?[]:[e[1]])),qr=nr((e=>e[2]));export{Rr as BackwardCheckpointsView,dr as CellView,Pr as CheckpointView,xr as CurrentCheckpointView,qr as ForwardCheckpointsView,gr as IndexView,Cr as LinkedRowsView,mr as LocalRowsView,vr as MetricView,lr as Provider,yr as RemoteRowView,wr as ResultCellView,fr as ResultRowView,hr as ResultSortedTableView,kr as ResultTableView,ur as RowView,br as SliceView,cr as SortedTableView,ir as TableView,ar as TablesView,Ir as ValueView,pr as ValuesView,Ye as useAddRowCallback,Qe as useCell,De as useCellIds,wt as useCellIdsListener,kt as useCellListener,fo as useCheckpoint,wo as useCheckpointIds,So as useCheckpointIdsListener,Oo as useCheckpointListener,te as useCheckpoints,Co as useCheckpointsIds,oe as useCheckpointsOrCheckpointsById,mo as useCreateCheckpoints,Ft as useCreateIndexes,Re as useCreateMergeableStore,jt as useCreateMetrics,Lo as useCreatePersister,$t as useCreateQueries,zt as useCreateRelationships,Pe as useCreateStore,jo as useCreateSynchronizer,lt as useDelCellCallback,nt as useDelRowCallback,rt as useDelTableCallback,ot as useDelTablesCallback,dt as useDelValueCallback,st as useDelValuesCallback,Lt as useDidFinishTransactionListener,ho as useGoBackwardCallback,Po as useGoForwardCallback,Ro as useGoToCallback,He as useHasCell,ft as useHasCellListener,Ve as useHasRow,mt as useHasRowListener,Le as useHasTable,Ee as useHasTableCell,vt as useHasTableCellListener,at as useHasTableListener,qe as useHasTables,ut as useHasTablesListener,Je as useHasValue,xt as useHasValueListener,We as useHasValues,ht as useHasValuesListener,Dt as useIndexIds,X as useIndexes,Vt as useIndexesIds,Y as useIndexesOrIndexesById,Ut as useLinkedRowIds,Zt as useLinkedRowIdsListener,Nt as useLocalRowIds,Yt as useLocalRowIdsListener,Tt as useMetric,Et as useMetricIds,Mt as useMetricListener,N as useMetrics,Bt as useMetricsIds,U as useMetricsOrMetricsById,K as useProvideStore,_ as useQueries,_t as useQueriesIds,ee as useQueriesOrQueriesById,eo as useQueryIds,qo as useRedoInformation,Jt as useRelationshipIds,Z as useRelationships,Gt as useRelationshipsIds,$ as useRelationshipsOrRelationshipsById,Kt as useRemoteRowId,Xt as useRemoteRowIdListener,io as useResultCell,uo as useResultCellIds,go as useResultCellIdsListener,yo as useResultCellListener,so as useResultRow,ro as useResultRowCount,Io as useResultRowCountListener,no as useResultRowIds,po as useResultRowIdsListener,bo as useResultRowListener,lo as useResultSortedRowIds,vo as useResultSortedRowIdsListener,to as useResultTable,oo as useResultTableCellIds,ao as useResultTableCellIdsListener,co as useResultTableListener,Ae as useRow,Te as useRowCount,bt as useRowCountListener,Me as useRowIds,gt as useRowIdsListener,Ct as useRowListener,$e as useSetCellCallback,ko as useSetCheckpointCallback,Ze as useSetPartialRowCallback,et as useSetPartialValuesCallback,Xe as useSetRowCallback,Ue as useSetTableCallback,Ne as useSetTablesCallback,tt as useSetValueCallback,_e as useSetValuesCallback,At as useSliceIds,Qt as useSliceIdsListener,Ht as useSliceRowIds,Wt as useSliceRowIdsListener,Fe as useSortedRowIds,yt as useSortedRowIdsListener,St as useStartTransactionListener,G as useStore,xe as useStoreIds,J as useStoreOrStoreById,je as useTable,Be as useTableCellIds,pt as useTableCellIdsListener,Oe as useTableIds,ct as useTableIdsListener,It as useTableListener,Se as useTables,it as useTablesListener,xo as useUndoInformation,Ke as useValue,Ge as useValueIds,Rt as useValueIdsListener,qt as useValueListener,ze as useValues,Pt as useValuesListener,Ot as useWillFinishTransactionListener};
@@ -127,28 +127,6 @@ lower(LISTENER);
127
127
  const TRANSACTION = 'Transaction';
128
128
  lower(TRANSACTION);
129
129
 
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
130
  var __async = (__this, __arguments, generator) => {
153
131
  return new Promise((resolve, reject) => {
154
132
  var fulfilled = (value) => {
@@ -256,12 +234,7 @@ const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
256
234
  /* eslint-disable-next-line react-hooks/exhaustive-deps */
257
235
  [thing, returnType, listenable, ...args],
258
236
  );
259
- const result = useSyncExternalStore(subscribe, getResult);
260
- return returnType == 0 /* Object */
261
- ? __spreadValues$1({}, result)
262
- : returnType < 3 /* CellOrValue */
263
- ? [...result]
264
- : result;
237
+ return useSyncExternalStore(subscribe, getResult);
265
238
  };
266
239
  const useListener = (
267
240
  listenable,
@@ -127,28 +127,6 @@ lower(LISTENER);
127
127
  const TRANSACTION = 'Transaction';
128
128
  lower(TRANSACTION);
129
129
 
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
130
  var __async = (__this, __arguments, generator) => {
153
131
  return new Promise((resolve, reject) => {
154
132
  var fulfilled = (value) => {
@@ -256,12 +234,7 @@ const useListenable = (listenable, thing, returnType, args = EMPTY_ARRAY) => {
256
234
  /* eslint-disable-next-line react-hooks/exhaustive-deps */
257
235
  [thing, returnType, listenable, ...args],
258
236
  );
259
- const result = useSyncExternalStore(subscribe, getResult);
260
- return returnType == 0 /* Object */
261
- ? __spreadValues$1({}, result)
262
- : returnType < 3 /* CellOrValue */
263
- ? [...result]
264
- : result;
237
+ return useSyncExternalStore(subscribe, getResult);
265
238
  };
266
239
  const useListener = (
267
240
  listenable,
@@ -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",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]);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](...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};
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",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]);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](...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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinybase",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "author": "jamesgpearce",
5
5
  "repository": "github:tinyplex/tinybase",
6
6
  "license": "MIT",