@graphrefly/graphrefly 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cascading-DKIb6Pk8.d.cts → cascading-B25wxpRa.d.cts} +3 -3
- package/dist/{cascading-Bg0a4VSf.d.ts → cascading-BsJ4GbnS.d.ts} +3 -3
- package/dist/{chunk-TZLEMGAK.js → chunk-2Y3DKIZL.js} +2 -2
- package/dist/chunk-3OT7K33Q.js +1 -0
- package/dist/chunk-53XJ2S6D.js +1 -0
- package/dist/chunk-5CPPC75H.js +1 -0
- package/dist/chunk-5KPIYVCC.js +7 -0
- package/dist/{chunk-GAOX6OPT.js → chunk-5XZRCS2M.js} +1 -1
- package/dist/{chunk-C5DINHNP.js → chunk-6G5YD37E.js} +1 -1
- package/dist/{chunk-WBWBY6LI.js → chunk-6SVKZ7VI.js} +1 -1
- package/dist/chunk-A5HZZYRK.js +1 -0
- package/dist/chunk-BGEY3PXH.js +1 -0
- package/dist/chunk-CD4CB6S7.js +1 -0
- package/dist/chunk-CE72X3WO.js +1 -0
- package/dist/chunk-CUQFO6MT.js +1 -0
- package/dist/chunk-D5RFJOZ2.js +1 -0
- package/dist/{chunk-A3GDELMY.js → chunk-E5YSBQSF.js} +7 -7
- package/dist/{chunk-SFIM774L.js → chunk-EUE7ELFQ.js} +1 -1
- package/dist/chunk-F3IGTWCQ.js +1 -0
- package/dist/chunk-F672GV32.js +1 -0
- package/dist/{chunk-GCUYSIM4.js → chunk-GWOKTENT.js} +1 -1
- package/dist/{chunk-4NYSEUKV.js → chunk-J6TGRQUP.js} +1 -1
- package/dist/{chunk-4F564IPP.js → chunk-JJTF75VS.js} +1 -1
- package/dist/{chunk-BY4WKPKM.js → chunk-JUJEPZOI.js} +1 -1
- package/dist/{chunk-65WWQ5CB.js → chunk-M5UC63ZI.js} +5 -5
- package/dist/chunk-MQZWA3DF.js +1 -0
- package/dist/chunk-MYFR67PY.js +18 -0
- package/dist/{chunk-KN2UMFT6.js → chunk-PCD2MU7X.js} +1 -1
- package/dist/{chunk-YDWTVO4E.js → chunk-PIIUJIF7.js} +1 -1
- package/dist/chunk-PVUTRA5K.js +5 -0
- package/dist/chunk-Q7EUZ6NN.js +1 -0
- package/dist/chunk-RLMYS3XZ.js +1 -0
- package/dist/chunk-RRFOCAH6.js +1 -0
- package/dist/{chunk-Q46YJCQH.js → chunk-T6RPUERH.js} +1 -1
- package/dist/{chunk-IPNJDNE7.js → chunk-T7GWBGOO.js} +1 -1
- package/dist/{chunk-U2T2XWDA.js → chunk-U347KVM4.js} +1 -1
- package/dist/chunk-UAMWD4GG.js +1 -0
- package/dist/chunk-VN6RDSK2.js +1 -0
- package/dist/{chunk-CJMFZXIZ.js → chunk-W2ZU226Q.js} +1 -1
- package/dist/{chunk-UF746BQ4.js → chunk-XINLP35X.js} +1 -1
- package/dist/{chunk-TONEKQM3.js → chunk-XMDNNSMK.js} +1 -1
- package/dist/{chunk-INXDSJRC.js → chunk-YOUAVGHJ.js} +1 -1
- package/dist/chunk-YV2A2VWG.js +1 -0
- package/dist/{chunk-PBN426RU.js → chunk-ZGVA2SR5.js} +1 -1
- package/dist/compat/index.cjs +10 -10
- package/dist/compat/index.d.cts +17 -14
- package/dist/compat/index.d.ts +17 -14
- package/dist/compat/index.js +1 -1
- package/dist/compat/jotai/index.d.cts +2 -2
- package/dist/compat/jotai/index.d.ts +2 -2
- package/dist/compat/nanostores/index.d.cts +2 -2
- package/dist/compat/nanostores/index.d.ts +2 -2
- package/dist/compat/nestjs/index.cjs +12 -12
- package/dist/compat/nestjs/index.d.cts +9 -6
- package/dist/compat/nestjs/index.d.ts +9 -6
- package/dist/compat/nestjs/index.js +1 -1
- package/dist/compat/react/index.d.cts +2 -2
- package/dist/compat/react/index.d.ts +2 -2
- package/dist/compat/solid/index.d.cts +2 -2
- package/dist/compat/solid/index.d.ts +2 -2
- package/dist/compat/svelte/index.d.cts +2 -2
- package/dist/compat/svelte/index.d.ts +2 -2
- package/dist/compat/vue/index.d.cts +2 -2
- package/dist/compat/vue/index.d.ts +2 -2
- package/dist/compat/zustand/index.cjs +7 -7
- package/dist/compat/zustand/index.d.cts +5 -4
- package/dist/compat/zustand/index.d.ts +5 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/{composite-BPDU_XV1.d.ts → composite-CT_mApQD.d.ts} +2 -2
- package/dist/{composite-CmvdhTJe.d.cts → composite-_XckYx2e.d.cts} +2 -2
- package/dist/{content-addressed-storage-DqIWCmZG.d.cts → content-addressed-storage-4-ST1tYk.d.cts} +5 -5
- package/dist/{content-addressed-storage-BUiREIuj.d.ts → content-addressed-storage-DuYMjV7o.d.ts} +5 -5
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/extra/browser.cjs +1 -1
- package/dist/extra/browser.d.cts +4 -3
- package/dist/extra/browser.d.ts +4 -3
- package/dist/extra/browser.js +1 -1
- package/dist/extra/index.cjs +19 -19
- package/dist/extra/index.d.cts +13 -12
- package/dist/extra/index.d.ts +13 -12
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -3
- package/dist/extra/node.d.cts +3 -3
- package/dist/extra/node.d.ts +3 -3
- package/dist/extra/node.js +2 -2
- package/dist/extra/operators.cjs +1 -1
- package/dist/extra/operators.d.cts +1 -1
- package/dist/extra/operators.d.ts +1 -1
- package/dist/extra/operators.js +1 -1
- package/dist/extra/reactive.cjs +1 -1
- package/dist/extra/reactive.d.cts +4 -3
- package/dist/extra/reactive.d.ts +4 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/sources.cjs +1 -1
- package/dist/extra/sources.d.cts +57 -2
- package/dist/extra/sources.d.ts +57 -2
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.cjs +1 -1
- package/dist/extra/storage-browser.d.cts +8 -42
- package/dist/extra/storage-browser.d.ts +8 -42
- package/dist/extra/storage-browser.js +1 -1
- package/dist/extra/storage-core.cjs +1 -1
- package/dist/extra/storage-core.d.cts +13 -83
- package/dist/extra/storage-core.d.ts +13 -83
- package/dist/extra/storage-core.js +1 -1
- package/dist/extra/storage-node.cjs +1 -2
- package/dist/extra/storage-node.d.cts +1 -59
- package/dist/extra/storage-node.d.ts +1 -59
- package/dist/extra/storage-node.js +0 -1
- package/dist/extra/storage-tiers-browser.cjs +1 -0
- package/dist/extra/storage-tiers-browser.d.cts +49 -0
- package/dist/extra/storage-tiers-browser.d.ts +49 -0
- package/dist/extra/storage-tiers-browser.js +1 -0
- package/dist/extra/storage-tiers-node.cjs +1 -0
- package/dist/extra/storage-tiers-node.d.cts +86 -0
- package/dist/extra/storage-tiers-node.d.ts +86 -0
- package/dist/extra/storage-tiers-node.js +1 -0
- package/dist/extra/storage-tiers.cjs +1 -0
- package/dist/extra/storage-tiers.d.cts +284 -0
- package/dist/extra/storage-tiers.d.ts +284 -0
- package/dist/extra/storage-tiers.js +1 -0
- package/dist/{fallback-mYSd8vQo.d.ts → fallback-DuEXfA4F.d.ts} +14 -14
- package/dist/{fallback-9YznPvPP.d.cts → fallback-axI2cXwt.d.cts} +14 -14
- package/dist/graph/index.cjs +3 -3
- package/dist/graph/index.d.cts +6 -5
- package/dist/graph/index.d.ts +6 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BROUZPG9.d.ts → graph-Cv-8x0ZI.d.ts} +28 -16
- package/dist/{graph-DaoydJ_u.d.cts → graph-kTltt95s.d.cts} +28 -16
- package/dist/imperative-audit-ahAE65a9.d.cts +28 -0
- package/dist/imperative-audit-ahAE65a9.d.ts +28 -0
- package/dist/{index-CI5fULSz.d.ts → index-8OxXae3g.d.ts} +1 -1
- package/dist/{index-CQ1gt4rn.d.cts → index-9xhIaM-w.d.cts} +1 -1
- package/dist/{index-DhWrMTI6.d.cts → index-B3D_z0Z6.d.cts} +1 -1
- package/dist/{index-Ccv_61jG.d.cts → index-B3Dfl5sS.d.cts} +110 -27
- package/dist/{index-Dia4yc2y.d.ts → index-B4s70vYf.d.ts} +4 -4
- package/dist/{index-Db21wuaD.d.ts → index-B5UR87KG.d.ts} +3 -3
- package/dist/{index-DuvQAU02.d.ts → index-BBdwz2BW.d.ts} +2 -2
- package/dist/{index-B5eS17Bz.d.ts → index-BEvsFlfH.d.ts} +47 -32
- package/dist/{index-BUtCR0k6.d.ts → index-BF-ssbJB.d.ts} +7 -7
- package/dist/{index-ClKm7CFB.d.cts → index-BFuVcqL8.d.cts} +1 -1
- package/dist/{index-BkfL5MXh.d.cts → index-BWH17rK_.d.cts} +3 -3
- package/dist/{index-CD7qmvSf.d.ts → index-BZ1V5GzX.d.ts} +3 -3
- package/dist/{index-BDEhWLF4.d.cts → index-BhkPzu-Z.d.cts} +4 -4
- package/dist/{index-CNxdDb2e.d.ts → index-Bilohojo.d.ts} +3 -3
- package/dist/{index-zA1uVtk0.d.ts → index-BiomL7AW.d.ts} +1 -1
- package/dist/{index-BWiX5foT.d.ts → index-BjWZARLy.d.ts} +1 -1
- package/dist/{index-IxinNgAH.d.cts → index-BkbawFkI.d.cts} +16 -15
- package/dist/{index-RJX4snyi.d.cts → index-BlRVj-7Q.d.cts} +21 -21
- package/dist/index-BpFwRAf9.d.cts +26 -0
- package/dist/{index-Ds3Rz9m9.d.cts → index-BsZlbHM5.d.cts} +3 -3
- package/dist/{index-BFHpNSsV.d.ts → index-BtY2QVDf.d.cts} +8 -7
- package/dist/{index-BsxqmV6u.d.ts → index-BuMzxRO2.d.ts} +2 -2
- package/dist/{index-C5uMGVJw.d.ts → index-BwYGLgmI.d.ts} +4 -4
- package/dist/{index-3L3RC3VJ.d.ts → index-C40wA8zt.d.ts} +7 -7
- package/dist/{index-Bi4ZP6Hc.d.ts → index-C9xF16gc.d.ts} +110 -27
- package/dist/index-CAIhFfws.d.ts +171 -0
- package/dist/{index-BRisOxlx.d.ts → index-CDvC1m5p.d.ts} +1 -1
- package/dist/index-CGKs5ixV.d.cts +287 -0
- package/dist/{index-ygRFoyrN.d.ts → index-CI_yjtua.d.ts} +2 -2
- package/dist/{index-DxEcY7Om.d.ts → index-CIcu6fIR.d.ts} +1 -1
- package/dist/{index-CQtnGFrZ.d.cts → index-CfOSES72.d.cts} +7 -7
- package/dist/{index-Bd2AjMQY.d.ts → index-Cot94_82.d.ts} +21 -21
- package/dist/{index-B1hFhK1K.d.cts → index-CpZKtdMw.d.cts} +1 -1
- package/dist/{index-BO6t0HjV.d.cts → index-CqSJ25A9.d.cts} +1 -1
- package/dist/{index-Jgl7ev9I.d.cts → index-CzC0G0C3.d.cts} +9 -9
- package/dist/{index-p0bkNfby.d.cts → index-D6JRP-1_.d.cts} +3 -3
- package/dist/{index-D23g00HE.d.cts → index-D7r_vd0b.d.cts} +4 -4
- package/dist/{index-Cp91Sxbo.d.cts → index-D8IyqHvT.d.cts} +3 -3
- package/dist/{index-iKsmdnq6.d.cts → index-D9qoEOj_.d.cts} +2 -2
- package/dist/index-DBmBtqAN.d.ts +461 -0
- package/dist/{index-nP13Qe6T.d.ts → index-DFe2Pk2u.d.ts} +1 -1
- package/dist/{index-Cn3taOmp.d.cts → index-DKp1CIbG.d.cts} +2 -2
- package/dist/{index-CoR-tOZA.d.cts → index-DSD6xnbT.d.ts} +8 -7
- package/dist/{index-DheNs40A.d.ts → index-DXSLMoma.d.ts} +2 -2
- package/dist/{index-ZIQaKIdY.d.cts → index-DXZsXxtU.d.cts} +47 -32
- package/dist/{index-BVTjuKeP.d.cts → index-D_QQ_dTD.d.cts} +1 -1
- package/dist/{index-ChZvMC4M.d.cts → index-DeyzuqAi.d.cts} +7 -7
- package/dist/{index-Chi9IiHJ.d.ts → index-DlccEIi3.d.ts} +3 -3
- package/dist/{index-DR3XqZlV.d.cts → index-DmtWMP0X.d.cts} +1 -1
- package/dist/{index-CbCNoogR.d.ts → index-Dp69u0ym.d.ts} +16 -15
- package/dist/{index-b4a6Sg0R.d.ts → index-DwNNufVa.d.ts} +4 -4
- package/dist/{index-D80nGRb9.d.ts → index-DzYTXMBz.d.ts} +3 -3
- package/dist/index-DzgS5uYi.d.ts +26 -0
- package/dist/{index-B-KCkW4M.d.cts → index-GaW6Welt.d.cts} +4 -4
- package/dist/{index-DupIl9wI.d.ts → index-JYtN9uqM.d.ts} +1 -1
- package/dist/{index-Ced0dphF.d.ts → index-KNAMYngu.d.ts} +9 -9
- package/dist/{index-BpjQanLs.d.cts → index-PluovH45.d.cts} +2 -2
- package/dist/index-Qq-G9B6g.d.cts +171 -0
- package/dist/{index-yJY9thRY.d.cts → index-XxSeddWP.d.cts} +2 -2
- package/dist/{index-C8_bnDBZ.d.cts → index-ZhKyR8co.d.cts} +3 -3
- package/dist/index-hXKhbfh-.d.ts +287 -0
- package/dist/index-zK_mN1D-.d.cts +461 -0
- package/dist/index.cjs +59 -59
- package/dist/index.d.cts +53 -49
- package/dist/index.d.ts +53 -49
- package/dist/index.js +1 -1
- package/dist/{meta-BdjSt8ky.d.cts → meta-BGO6C7K9.d.cts} +1 -1
- package/dist/{meta-CtDjj7cU.d.ts → meta-CC6EPdpK.d.ts} +1 -1
- package/dist/{node-8qx0kgYt.d.cts → node-fSc-hCv8.d.cts} +1 -1
- package/dist/{node-8qx0kgYt.d.ts → node-fSc-hCv8.d.ts} +1 -1
- package/dist/{observable-B6Ba-TTI.d.cts → observable-Cqty11jG.d.cts} +1 -1
- package/dist/{observable-DOniYM2B.d.ts → observable-EAV_rNfM.d.ts} +1 -1
- package/dist/patterns/ai/browser.cjs +5 -5
- package/dist/patterns/ai/browser.d.cts +4 -4
- package/dist/patterns/ai/browser.d.ts +4 -4
- package/dist/patterns/ai/browser.js +1 -1
- package/dist/patterns/ai/index.cjs +19 -19
- package/dist/patterns/ai/index.d.cts +19 -17
- package/dist/patterns/ai/index.d.ts +19 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.cjs +1 -2
- package/dist/patterns/ai/node.d.cts +9 -9
- package/dist/patterns/ai/node.d.ts +9 -9
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/audit/index.cjs +6 -6
- package/dist/patterns/audit/index.d.cts +7 -5
- package/dist/patterns/audit/index.d.ts +7 -5
- package/dist/patterns/audit/index.js +1 -1
- package/dist/patterns/cqrs/index.cjs +7 -7
- package/dist/patterns/cqrs/index.d.cts +7 -4
- package/dist/patterns/cqrs/index.d.ts +7 -4
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +8 -8
- package/dist/patterns/demo-shell/index.d.cts +6 -5
- package/dist/patterns/demo-shell/index.d.ts +6 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +5 -5
- package/dist/patterns/domain-templates/index.d.cts +5 -4
- package/dist/patterns/domain-templates/index.d.ts +5 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +20 -20
- package/dist/patterns/graphspec/index.d.cts +6 -5
- package/dist/patterns/graphspec/index.d.ts +6 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/guarded-execution/index.cjs +7 -7
- package/dist/patterns/guarded-execution/index.d.cts +8 -6
- package/dist/patterns/guarded-execution/index.d.ts +8 -6
- package/dist/patterns/guarded-execution/index.js +1 -1
- package/dist/patterns/harness/index.cjs +12 -12
- package/dist/patterns/harness/index.d.cts +13 -10
- package/dist/patterns/harness/index.d.ts +13 -10
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/job-queue/index.cjs +7 -7
- package/dist/patterns/job-queue/index.d.cts +8 -4
- package/dist/patterns/job-queue/index.d.ts +8 -4
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/lens/index.cjs +4 -4
- package/dist/patterns/lens/index.d.cts +7 -6
- package/dist/patterns/lens/index.d.ts +7 -6
- package/dist/patterns/lens/index.js +1 -1
- package/dist/patterns/memory/index.cjs +1 -1
- package/dist/patterns/memory/index.d.cts +5 -4
- package/dist/patterns/memory/index.d.ts +5 -4
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +7 -7
- package/dist/patterns/messaging/index.d.cts +6 -4
- package/dist/patterns/messaging/index.d.ts +6 -4
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +7 -7
- package/dist/patterns/orchestration/index.d.cts +8 -5
- package/dist/patterns/orchestration/index.d.ts +8 -5
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -0
- package/dist/patterns/process/index.d.cts +10 -0
- package/dist/patterns/process/index.d.ts +10 -0
- package/dist/patterns/process/index.js +1 -0
- package/dist/patterns/reactive-layout/index.cjs +5 -5
- package/dist/patterns/reactive-layout/index.d.cts +6 -5
- package/dist/patterns/reactive-layout/index.d.ts +6 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +1 -1
- package/dist/patterns/reduction/index.d.cts +5 -4
- package/dist/patterns/reduction/index.d.ts +5 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/refine-loop/index.cjs +8 -8
- package/dist/patterns/refine-loop/index.d.cts +7 -5
- package/dist/patterns/refine-loop/index.d.ts +7 -5
- package/dist/patterns/refine-loop/index.js +1 -1
- package/dist/patterns/resilient-pipeline/index.cjs +1 -1
- package/dist/patterns/resilient-pipeline/index.d.cts +7 -6
- package/dist/patterns/resilient-pipeline/index.d.ts +7 -6
- package/dist/patterns/resilient-pipeline/index.js +1 -1
- package/dist/patterns/surface/index.cjs +11 -11
- package/dist/patterns/surface/index.d.cts +7 -6
- package/dist/patterns/surface/index.d.ts +7 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/pipeline-graph-B85HUrWg.d.cts +120 -0
- package/dist/pipeline-graph-HOTU4UG0.d.ts +120 -0
- package/dist/{reactive-layout-DBJ3Vz-m.d.ts → reactive-layout-Btv0-efV.d.ts} +2 -2
- package/dist/{reactive-layout-Dk9AOQb_.d.cts → reactive-layout-D9zqqaqK.d.cts} +2 -2
- package/dist/reactive-log-ByBb8g6A.d.ts +188 -0
- package/dist/reactive-log-CgbNqksB.d.cts +188 -0
- package/dist/{reactive-map-LjwjcFaW.d.ts → reactive-map-CHyeCf4D.d.ts} +1 -1
- package/dist/{reactive-map-Cm89Hk0c.d.cts → reactive-map-DmgeADH8.d.cts} +1 -1
- package/dist/{resilience-RjDIHZNZ.d.ts → resilience-BWP2c7Af.d.cts} +27 -45
- package/dist/{resilience-N_VtLf7W.d.cts → resilience-Bys63Cpd.d.ts} +27 -45
- package/dist/resilience-OBU472D2.js +1 -0
- package/dist/{sugar-CQkn_rxB.d.ts → sugar-D13E2M_z.d.ts} +1 -1
- package/dist/{sugar-DVEYhR7a.d.cts → sugar-DgaGJcI6.d.cts} +1 -1
- package/dist/{topology-tree-BB6oJxMz.d.cts → topology-tree-C50l9ARE.d.cts} +1 -1
- package/dist/{topology-tree-CAFOG5S5.d.ts → topology-tree-CJsT24DP.d.ts} +1 -1
- package/dist/{types-Cp_4coR_.d.cts → types-BMSGPlpO.d.cts} +1 -1
- package/dist/{types-B2LfBvNc.d.ts → types-CidcBDuk.d.ts} +1 -1
- package/package.json +41 -1
- package/dist/chunk-2JO6LXFT.js +0 -7
- package/dist/chunk-2LZ6DL45.js +0 -1
- package/dist/chunk-3JXNEPCD.js +0 -2
- package/dist/chunk-3Y4BXFFR.js +0 -1
- package/dist/chunk-55T3K37W.js +0 -1
- package/dist/chunk-6HQ6HVTF.js +0 -1
- package/dist/chunk-7Q2WPFQ7.js +0 -1
- package/dist/chunk-FKRPIRE6.js +0 -1
- package/dist/chunk-HTBOCKVD.js +0 -1
- package/dist/chunk-I6VIH3VA.js +0 -1
- package/dist/chunk-IB64M7VP.js +0 -1
- package/dist/chunk-IJFSR4NU.js +0 -1
- package/dist/chunk-LOF5HSD3.js +0 -18
- package/dist/chunk-T2TB37TW.js +0 -1
- package/dist/chunk-T7EQPKOP.js +0 -1
- package/dist/chunk-Y63GWRHO.js +0 -5
- package/dist/chunk-YUBV7EEE.js +0 -1
- package/dist/index-C2Dey3L-.d.cts +0 -152
- package/dist/index-ClJUZAOr.d.cts +0 -101
- package/dist/index-Cq7Uqgu4.d.ts +0 -192
- package/dist/index-Dtpr2FIB.d.ts +0 -101
- package/dist/index-HvJ90_tX.d.ts +0 -152
- package/dist/index-wcfc7W-f.d.cts +0 -192
- package/dist/reactive-log-CWC7jO4J.d.cts +0 -190
- package/dist/reactive-log-CqaBg8nf.d.ts +0 -190
- package/dist/resilience-7UZHSSGC.js +0 -1
- /package/dist/{chunk-L3KUKDZC.js → chunk-O32GJOUJ.js} +0 -0
package/dist/extra/operators.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var oe=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.prototype.hasOwnProperty;var A=(o,e)=>()=>(o&&(e=o(o=0)),e);var an=(o,e)=>{for(var t in e)oe(o,t,{get:e[t],enumerable:!0})},dn=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of on(e))!sn.call(o,n)&&n!==t&&oe(o,n,{get:()=>e[n],enumerable:!(r=rn(e,n))||r.enumerable});return o};var un=o=>dn(oe({},"__esModule",{value:!0}),o);function q(){return Math.trunc(performance.now()*1e6)}function ye(){return Date.now()*1e6}var se=A(()=>{"use strict"});var C,m,R,g,I,F,H,S,c,p,L,ie,ln,ae,cn,fn,de,ve,we,Ne,ue,W=A(()=>{"use strict";C=Symbol.for("graphrefly/START"),m=Symbol.for("graphrefly/DATA"),R=Symbol.for("graphrefly/DIRTY"),g=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),F=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),S=Symbol.for("graphrefly/TEARDOWN"),c=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),L=Object.freeze([R]),ie=Object.freeze([g]),ln=Object.freeze([I]),ae=Object.freeze([C]),cn=Object.freeze([c]),fn=Object.freeze([S]),de=Object.freeze([L]),ve=Object.freeze([ie]),we=Object.freeze([ln]),Ne=Object.freeze([cn]),ue=Object.freeze([fn])});function xe(o){o.registerCodec(pn)}var pn,Ee=A(()=>{"use strict";pn={name:"json",version:1,contentType:"application/json",encode(o){let e=JSON.stringify(o);return new TextEncoder().encode(e)},decode(o,e){let t=new TextDecoder().decode(o);return JSON.parse(t)}}});function K(o){if(o==null)return hn;let{type:e,id:t,...r}=o;return{type:e??"system",id:t??"",...r}}var hn,ke=A(()=>{"use strict";hn={type:"system",id:""}});function Me(){return le>0||mn}function De(){return le>0}function Se(o){le>0?gn.push(o):o()}function Y(o,e,t){if(e.length===0)return;if(e.length===1){let u=t(e[0][0]);if(u<3||!Me()){o(e);return}(u>=5?Re:u===4?Ae:Oe).push(()=>o(e));return}let r=e.length,n=r,s=r,a=r,i=0;for(;i<r&&t(e[i][0])<3;)i++;for(n=i;i<r&&t(e[i][0])===3;)i++;for(s=i;i<r&&t(e[i][0])===4;)i++;a=i;let d=Me();if(n>0){let u=e.slice(0,n);o(u)}if(s>n){let u=e.slice(n,s);d?Oe.push(()=>o(u)):o(u)}if(a>s){let u=e.slice(s,a);d?Ae.push(()=>o(u)):o(u)}if(r>a){let u=e.slice(a,r);d?Re.push(()=>o(u)):o(u)}}var le,mn,Oe,Ae,Re,gn,Ce=A(()=>{"use strict";le=0,mn=!1,Oe=[],Ae=[],Re=[],gn=[]});function Ie(o){o.registerMessageType(C,{tier:0,wireCrossing:!1}),o.registerMessageType(R,{tier:1,wireCrossing:!1}),o.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),o.registerMessageType(F,{tier:2,wireCrossing:!1}),o.registerMessageType(H,{tier:2,wireCrossing:!1}),o.registerMessageType(m,{tier:3,wireCrossing:!0}),o.registerMessageType(g,{tier:3,wireCrossing:!0}),o.registerMessageType(c,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(S,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var J,Fe=A(()=>{"use strict";W();J=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let r=this._messageTypes.get(t);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var G,Le=A(()=>{"use strict";G=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function ce(o){if(o===void 0)return null;if(typeof o=="number"){if(!Number.isFinite(o))throw new TypeError(`Cannot hash non-finite number: ${o}`);if(Number.isInteger(o)&&!Number.isSafeInteger(o))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${o}. Cross-language cid parity is not guaranteed for unsafe integers.`);return o}if(typeof o=="string"||typeof o=="boolean"||o===null)return o;if(Array.isArray(o))return o.map(ce);if(typeof o=="object"&&o!==null){let e={};for(let t of Object.keys(o).sort())e[t]=ce(o[t]);return e}return null}function _n(o){let e=Tn.encode(o),t=e.length,r=t*8,n=t+9+63&-64,s=new Uint8Array(n);s.set(e),s[t]=128;let a=new DataView(s.buffer);a.setUint32(n-4,r>>>0,!1),a.setUint32(n-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,d=3144134277,u=1013904242,l=2773480762,f=1359893119,_=2600822924,T=528734635,w=1541459225,k=new Uint32Array(64),v=(O,x)=>O>>>x|O<<32-x;for(let O=0;O<n;O+=64){for(let E=0;E<16;E++)k[E]=a.getUint32(O+E*4,!1);for(let E=16;E<64;E++){let V=k[E-15],U=k[E-2],z=v(V,7)^v(V,18)^V>>>3,re=v(U,17)^v(U,19)^U>>>10;k[E]=k[E-16]+z+k[E-7]+re>>>0}let x=i,M=d,P=u,ne=l,D=f,j=_,$=T,te=w;for(let E=0;E<64;E++){let V=v(D,6)^v(D,11)^v(D,25),U=D&j^~D&$,z=te+V+U+bn[E]+k[E]>>>0,re=v(x,2)^v(x,13)^v(x,22),nn=x&M^x&P^M&P,tn=re+nn>>>0;te=$,$=j,j=D,D=ne+z>>>0,ne=P,P=M,M=x,x=z+tn>>>0}i=i+x>>>0,d=d+M>>>0,u=u+P>>>0,l=l+ne>>>0,f=f+D>>>0,_=_+j>>>0,T=T+$>>>0,w=w+te>>>0}let N=O=>O.toString(16).padStart(8,"0");return N(i)+N(d)+N(u)+N(l)+N(f)+N(_)+N(T)+N(w)}function fe(o){let e=ce(o??null),t=JSON.stringify(e);return _n(t).slice(0,16)}function yn(){let o=globalThis.crypto;if(o?.randomUUID)return o.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function pe(o,e,t){let r=t?.id??yn();if(o===0)return{id:r,version:0};let s=(t?.hash??fe)(e);return{id:r,version:0,cid:s,prev:null}}function Ge(o,e,t){o.version+=1,"cid"in o&&(o.prev=o.cid,o.cid=t(e))}var bn,Tn,Pe=A(()=>{"use strict";bn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Tn=new TextEncoder});function He(o){return{node:o,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function he(o){o.prevData=void 0,o.dirty=!1,o.involvedThisWave=!1,o.dataBatch.length=0,o.terminal=void 0}function X(o){return o.length===0?o:typeof o[0]=="symbol"?[o]:o}function y(o,e,t){let r=We(o)?o:[],n=typeof o=="function"?o:typeof e=="function"?e:void 0,s={};return We(o)?s=(me(e)?e:t)??{}:me(o)?s=o:s=(me(e)?e:t)??{},new Z(r,n,s)}var Ve,Ue,vn,wn,ge,Z,We,me,be=A(()=>{"use strict";Ee();ke();Ce();se();Fe();Le();W();Pe();Ve=()=>{},Ue=100;vn=(o,e,t,r)=>{t.direction==="down-in"&&o._onDepMessage(t.depIndex,e)},wn=(o,e,t,r)=>{let n=o;if(n._status==="completed"||n._status==="errored")return;let s=n._cached,a=s===void 0?[ae]:[ae,[m,s]];n._status==="dirty"&&a.push(L),Y(e,a,n._config.tierOf)},ge=new J({onMessage:vn,onSubscribe:wn});Ie(ge);xe(ge);Z=class o{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,r){this._config=r.config??ge,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=t,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??fe;let n=r.versioning??this._config.defaultVersioning;this._versioningLevel=n,this._versioning=n!=null?pe(n,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(He);let s={};for(let[i,d]of Object.entries(r.meta??{})){let u={initial:d,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(u.guard=r.guard),s[i]=new o([],void 0,u)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let a=this;this._actions={emit(i){a._emit([[m,i]])},down(i){a._emit(X(i))},up(i){a._emitUp(X(i))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let n=t?.hash??this._hashFn;n!==this._hashFn&&(this._hashFn=n);let s=this._cached===void 0?void 0:this._cached,a=this._versioning,i=a?.id??t?.id,d=a?.version??0,u=pe(e,s,{id:i,hash:n});u.version=d,this._versioning=u,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=K(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!t&&!r)return;let n=K(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(n,s))throw new G({actor:n,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(n,s))throw new G({actor:n,action:s,nodeName:this.name})}this._lastMutation={actor:n,timestamp_ns:ye()}}down(e,t){let r=X(e);r.length!==0&&(this._checkGuard(t),this._emit(r))}emit(e,t){this._checkGuard(t),this._emit([[m,e]])}up(e,t){if(this._deps.length===0)return;let r=X(e);if(r.length===0)return;this._checkGuard(t);let n=t??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.node.up?.(r,n)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let r of e){let n=t(r[0]);if(n===3||n===4)throw new Error(`Node "${this.name}": tier-${n} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=K(t);if(!this._guard(d,"observe"))throw new G({actor:d,action:"observe",nodeName:this.name})}let n=this._isTerminal&&this._resubscribable;if(n){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)he(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:n},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let r=0;r<e;r++){let n=r,s=this._deps[r];s.unsub=Ve,s.unsub=s.node.subscribe(a=>{if(s.unsub===null)return;let i=this._config.tierOf,d=!1;for(let u of a)i(u[0])>=3&&(d=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:n},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(r){this._deps[t].unsub=null;for(let n=0;n<t;n++){let s=this._deps[n];if(s.unsub!=null){let a=s.unsub;s.unsub=null;try{a()}catch{}he(s)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let n=0;n<this._deps.length;n++)if(this._deps[n].node===e)return n;let t=this._deps.length,r=He(e);if(this._deps.push(r),this._sinks==null)return t;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de),r.unsub=Ve;try{r.unsub=e.subscribe(n=>{if(r.unsub===null)return;let s=this._config.tierOf,a=!1;for(let i of n)s(i[0])>=3&&(a=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(n){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,n}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(t!=null&&typeof t=="object"){let r=t.deactivate;if(typeof r=="function")try{r()}catch(n){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",n)]])}}for(let r of this._deps){if(r.unsub!=null){let n=r.unsub;r.unsub=null;try{n()}catch{}}he(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let r=this._deps[e],n=t[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(s)}if(n!==C){if(n===R){this._depDirtied(r);return}if(n===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(we);return}if(n===F||n===H){this._emit([t]);return}if(n===S){this._emit(ue);return}if(n===m)this._depSettledAsData(r,t[1]);else if(n===g)this._depSettledAsResolved(r);else if(n===c)this._depSettledAsTerminal(r,!0);else if(n===p)this._depSettledAsTerminal(r,t[1]);else{this._emit([t]);return}if(!this._fn){(n===m||n===g)&&this._emit([t]),(n===c||n===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(ve),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Ne)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(a){this._emit([[p,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(i){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),r=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let i=t[a];i!=null&&i.length>0&&(this._deps[a].prevData=i[i.length-1])}let n=this._deps.map(a=>a.terminal),s={prevData:r,terminalDeps:n,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:r};for(let i of this._inspectorHooks)i(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,s);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let i=a;(typeof i.beforeRun=="function"||typeof i.deactivate=="function"||typeof i.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[p,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ue?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ue} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let r=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[L,e[0]]:e;let r=!0,n=!1,s=!1,a=-1;for(let d of e){let u=t(d[0]);u<a&&(r=!1),u===3&&(n=!0),d[0]===R&&(s=!0),a=u}let i=e;if(!r){let d=e.map((u,l)=>({m:u,i:l,tier:t(u[0])}));d.sort((u,l)=>u.tier-l.tier||u.i-l.i),i=d.map(u=>u.m)}if(n&&!s&&this._status!=="dirty"){let d=0;for(;d<i.length&&t(i[d][0])===0;)d++;return d===0?[L,...i]:[...i.slice(0,d),L,...i.slice(d)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let d=e[i];if(d[0]===p&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(d=>d[0]===S||d[0]===I);if(i.length===0)return;t=i}t=this._frameBatch(t);let n=null;for(let i=0;i<t.length;i++){let d=t[i],u=d[0];if(u!==F&&u!==H){n?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${u===F?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let f=d[1];if(u===F)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))l=!1;else if(this._pauseLocks.delete(f),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let _=this._pauseBuffer;this._pauseBuffer=[],this._emit(_)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?n?.push(d):n==null&&(n=t.slice(0,i))}if(n!=null){if(n.length===0)return;t=n}if(this._hasMeta&&t.some(i=>i[0]===S))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(ue)}catch{}let{finalMessages:s,equalsError:a}=this._updateState(t);if(s.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,d=[];for(let u of s)i(u[0])===3?this._pauseBuffer.push(u):d.push(u);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(s);a!=null&&this._emit([[p,a]])}_updateState(e){let t=this._config.tierOf,r,n,s=-1,a=0;for(let l of e)t(l[0])===3&&a++;let i=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===m){d=l;break}}for(let l=0;l<e.length;l++){let f=e[l],_=f[0];if(_===m){if(f.length>=2){let T=!1;if(i&&this._cached!==void 0)try{T=this._equals(this._cached,f[1])}catch(w){n=this._wrapFnError("equals threw",w),s=l;break}if(T){r==null&&(r=e.slice(0,l)),r.push(ie),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(d<0||l===d)&&Ge(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),_===R)this._status="dirty";else if(_===g)this._status="resolved";else if(_===c){this._status="completed";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===p){this._status="errored";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===I){if(this._cached!==void 0){let w=this._config.rigorRecorder;if(w!=null)try{w.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let T=this._cleanup;if(typeof T=="function"){this._cleanup=void 0;try{T()}catch{}}else if(T!=null&&typeof T=="object"){let w=T.invalidate;if(typeof w=="function")try{w()}catch{}}}else _===S&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=s>=0?r??e.slice(0,s):r??e;return n!=null?{finalMessages:u,equalsError:n}:{finalMessages:u}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let r of t)r(e)};_dispatchOrAccumulate(e){if(De()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Se(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}Y(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);Y(this._deliverToSinks,t,this._config.tierOf)}},We=o=>Array.isArray(o),me=o=>typeof o=="object"&&o!=null&&!Array.isArray(o)});function b(o,e){return y((r,n,s)=>o(n,s)??void 0,{describeKind:"producer",...e})}function Be(o,e,t){return y(o,(n,s,a)=>{let i=n.map((d,u)=>d!=null&&d.length>0?d.at(-1):a.prevData[u]);s.emit(e(i,a))},{describeKind:"derived",...t})}var Te=A(()=>{"use strict";be()});function _e(o){return{describeKind:"producer",...o}}function je(o,e){return b(t=>{let r=!1;try{for(let n of o){if(r)return;t.emit(n)}r||t.down([[c]])}catch(n){r||t.down([[p,n]])}return()=>{r=!0}},_e(e))}function Nn(o){return o!=null&&typeof o.then=="function"}function xn(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=!1,a=()=>{s||(s=!0,n.down([[p,t.reason]]))};if(t?.aborted){a();return}return t?.addEventListener("abort",a,{once:!0}),Promise.resolve(o).then(i=>{s||(s=!0,t?.removeEventListener("abort",a),n.emit(i),n.down([[c]]))},i=>{s||(s=!0,t?.removeEventListener("abort",a),n.down([[p,i]]))}),()=>{s=!0,t?.removeEventListener("abort",a)}},_e(r))}function En(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=new AbortController,a=()=>s.abort(t?.reason);t?.aborted?s.abort(t.reason):t?.addEventListener("abort",a,{once:!0});let i=t??s.signal,d=!1,u=o[Symbol.asyncIterator](),l=()=>{d||i.aborted||Promise.resolve(u.next()).then(f=>{if(!(d||i.aborted)){if(f.done){n.down([[c]]);return}n.emit(f.value),l()}},f=>{!d&&!i.aborted&&n.down([[p,f]])})};return l(),()=>{d=!0,t?.removeEventListener("abort",a),s.abort(),Promise.resolve(u.return?.()).catch(()=>{})}},_e(r))}function kn(o){return o!=null&&typeof o=="object"&&"cache"in o&&typeof o.subscribe=="function"}function B(o,e){if(kn(o))return o;if(Nn(o))return xn(o,e);if(o!=null){let t=o;if(typeof t[Symbol.asyncIterator]=="function")return En(o,e);if(typeof t[Symbol.iterator]=="function")return je(o,e)}return On(o)}function On(...o){return je(o,void 0)}var $e=A(()=>{"use strict";W();Te()});var mt={};an(mt,{audit:()=>Qn,buffer:()=>nt,bufferCount:()=>tt,bufferTime:()=>ot,catchError:()=>ht,combine:()=>Je,combineLatest:()=>ct,concat:()=>$n,concatMap:()=>Yn,debounce:()=>Ze,debounceTime:()=>ft,delay:()=>Xn,distinctUntilChanged:()=>Un,elementAt:()=>Gn,exhaustMap:()=>Kn,filter:()=>qe,find:()=>Ln,first:()=>In,flatMap:()=>Jn,interval:()=>at,last:()=>Fn,map:()=>Rn,merge:()=>Bn,mergeMap:()=>Xe,onFirstData:()=>Ye,pairwise:()=>Hn,pausable:()=>ut,race:()=>zn,reduce:()=>Dn,repeat:()=>dt,rescue:()=>en,sample:()=>Zn,scan:()=>Mn,skip:()=>Ke,switchMap:()=>qn,take:()=>Q,takeUntil:()=>Cn,takeWhile:()=>Sn,tap:()=>Pn,tapFirst:()=>Vn,throttle:()=>Qe,throttleTime:()=>pt,timeout:()=>et,valve:()=>lt,window:()=>it,windowCount:()=>rt,windowTime:()=>st,withLatestFrom:()=>Wn,zip:()=>jn});module.exports=un(mt);se();W();be();Te();$e();function h(o){return{describeKind:"derived",...o}}function ze(o){return{describeKind:"derived",partial:!0,...o}}function Rn(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}for(let a of s)n.emit(e(a))},h(t))}function qe(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}let a=!1;for(let i of s)e(i)&&(n.emit(i),a=!0);a||n.down([[g]])},h(t))}function Mn(o,e,t,r){return y([o],(n,s,a)=>{"acc"in a.store||(a.store.acc=t);let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d),s.emit(a.store.acc)},{...h(r),initial:t,resetOnTeardown:!0})}function Dn(o,e,t,r){return y([o],(n,s,a)=>{if("acc"in a.store||(a.store.acc=t),a.terminalDeps[0]===!0){s.emit(a.store.acc),s.down([[c]]);return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d)},{...h(r),completeWhenDepsComplete:!1})}function Q(o,e,t){return e<=0?y([o],(r,n,s)=>{s.store.completed||(s.store.completed=!0,n.down([[c]]))},{...h(t),completeWhenDepsComplete:!1}):y([o],(r,n,s)=>{if("taken"in s.store||(s.store.taken=0),s.store.done){n.down([[g]]);return}if(s.terminalDeps[0]===!0){s.store.done=!0,n.down([[c]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a)if(s.store.taken++,n.emit(i),s.store.taken>=e){s.store.done=!0,n.down([[c]]);return}},{...h(t),completeWhenDepsComplete:!1})}function Ke(o,e,t){return y([o],(r,n,s)=>{"skipped"in s.store||(s.store.skipped=0);let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.skipped++,s.store.skipped<=e||(n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Sn(o,e,t){return y([o],(r,n,s)=>{if(s.store.done){n.down([[g]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a){if(!e(i)){s.store.done=!0,n.down([[c]]);return}n.emit(i)}},{...h(t),completeWhenDepsComplete:!1})}function Cn(o,e,t){let r=t?.predicate??(a=>a[0]===m),{predicate:n,...s}=t??{};return b(a=>{let i=!1,d=o.subscribe(l=>{if(!i)for(let f of l){if(i)return;f[0]===m?a.emit(f[1]):(f[0]===c||f[0]===p)&&(i=!0,a.down([f]))}}),u=e.subscribe(l=>{if(!i)for(let f of l){if(i)return;if(r(f)){i=!0,a.down([[c]]);return}}});return()=>{d(),u()}},h(s))}function In(o,e){return Q(o,1,e)}function Fn(o,e){let{defaultValue:t,...r}=e??{},n=e!=null&&Object.hasOwn(e,"defaultValue");return y([o],(s,a,i)=>{if(i.terminalDeps[0]===!0){i.store.has?a.emit(i.store.latest):n&&a.emit(t),a.down([[c]]);return}let d=s[0];if(d==null||d.length===0){a.down([[g]]);return}i.store.latest=d.at(-1),i.store.has=!0},{...h(r),completeWhenDepsComplete:!1})}function Ln(o,e,t){return Q(qe(o,e,t),1,t)}function Gn(o,e,t){return Q(Ke(o,e,t),1,t)}function Pn(o,e,t){if(typeof e=="function")return y([o],(n,s)=>{let a=n[0];if(a==null||a.length===0){s.down([[g]]);return}for(let i of a)e(i),s.emit(i)},h(t));let r=e;return y([o],(n,s,a)=>{if(a.terminalDeps[0]!==void 0){a.terminalDeps[0]===!0?(r.complete?.(),s.down([[c]])):(r.error?.(a.terminalDeps[0]),s.down([[p,a.terminalDeps[0]]]));return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)r.data?.(d),s.emit(d)},{...h(t),completeWhenDepsComplete:!1})}function Ye(o,e,t){let r=t?.where??(s=>s!=null),n=!1;return y([o],(s,a)=>{let i=s[0];if(i==null||i.length===0){a.down([[g]]);return}for(let d of i)!n&&r(d)&&(n=!0,e(d)),a.emit(d)},h(t))}var Vn=Ye;function Un(o,e=Object.is,t){return y([o],(r,n,s)=>{let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.hasPrev&&e(s.store.prev,d)||(s.store.prev=d,s.store.hasPrev=!0,n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Hn(o,e){return y([o],(t,r,n)=>{let s=t[0];if(s==null||s.length===0){r.down([[g]]);return}let a=!1;for(let i of s)if(!n.store.hasPrev)n.store.prev=i,n.store.hasPrev=!0;else{let d=[n.store.prev,i];n.store.prev=i,r.emit(d),a=!0}a||r.down([[g]])},h(e))}function Je(...o){let e=[...o];return Be(e,t=>t,{...h(),equals:(t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!Object.is(t[n],r[n]))return!1;return!0}})}function Wn(o,e,t){return y([o,e],(r,n,s)=>{let a=r[0],i=r[1],d=i!=null&&i.length>0?i.at(-1):s.prevData[1];if(a!=null&&a.length>0){if(!(i!=null&&i.length>0)&&s.prevData[1]===void 0){n.down([[g]]);return}for(let u of a)n.emit([u,d])}else n.down([[g]])},ze(t))}function Bn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):b(e=>{let t=o.length,r=0,n=[];for(let s of o){let a=s.subscribe(i=>{for(let d of i)d[0]===m?e.emit(d[1]):d[0]===c?(r+=1,r>=t&&e.down([[c]])):d[0]===p&&e.down([d])});n.push(a)}return()=>{for(let s of n)s()}},h())}function jn(...o){let e=o.length;return e===0?b(t=>{t.emit([]),t.down([[c]])},h()):b(t=>{let r=Array.from({length:e},()=>[]),n=e;function s(){for(;r.every(i=>i.length>0);){let i=r.map(d=>d.shift());t.emit(i)}}let a=[];for(let i=0;i<e;i++){let d=i,u=o[i].subscribe(l=>{for(let f of l)f[0]===m?(r[d].push(f[1]),s()):f[0]===c?(n-=1,(n===0||r[d].length===0)&&t.down([[c]])):f[0]===p&&t.down([f])});a.push(u)}return()=>{for(let i of a)i()}},h())}function $n(o,e,t){return b(r=>{let n=0,s=[],a,i;return i=e.subscribe(d=>{for(let u of d)n===0?u[0]===m?s.push(u[1]):u[0]===p&&r.down([u]):u[0]===m?r.emit(u[1]):(u[0]===c||u[0]===p)&&r.down([u])}),a=o.subscribe(d=>{for(let u of d)if(n===0)if(u[0]===m)r.emit(u[1]);else if(u[0]===c){n=1;for(let l of s)r.emit(l);s.length=0}else u[0]===p&&r.down([u])}),()=>{a?.(),i?.()}},h(t))}function zn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):o.length===1?y([o[0]],(e,t)=>{let r=e[0];if(r==null||r.length===0){t.down([[g]]);return}for(let n of r)t.emit(n)},h()):b(e=>{let t=null,r=[];for(let n=0;n<o.length;n++){let s=n,a=o[n].subscribe(i=>{for(let d of i){if(t!==null&&s!==t)return;d[0]===m?(t===null&&(t=s),e.emit(d[1])):(d[0]===c||d[0]===p)&&(t===null||s===t)&&e.down([d])}});r.push(a)}return()=>{for(let n of r)n()}},h())}function ee(o,e,t){let r,n=!1,s=()=>{n||(n=!0,t())};return r=o.subscribe(a=>{let i=!1,d=!1;for(let u of a)u[0]!==C&&(u[0]===m?e.emit(u[1]):u[0]===c?i=!0:u[0]===p?(d=!0,e.down([u])):(u[0]===R||u[0]===g)&&e.down([u]));d?(r?.(),r=void 0,s()):i&&s()}),()=>{r?.(),r=void 0}}function qn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return s(),r=ee(B(e(u[u.length-1])),i,()=>{s(),n&&i.down([[c]])}),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Kn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return r===void 0?r=ee(B(e(u[0])),i,()=>{s(),n&&i.down([[c]])}):i.down([[g]]),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Yn(o,e,t){let{maxBuffer:r,...n}=t??{},s=[],a,i=!1,d;function u(){a?.(),a=void 0}function l(){if(!d||a!==void 0)return;if(s.length===0){i&&d.down([[c]]);return}let _=s.shift();a=ee(B(e(_)),d,()=>{u(),l()})}function f(_){r&&r>0&&s.length>=r&&s.shift(),s.push(_),l()}return y([o],(_,T,w)=>{if(d=T,w.terminalDeps[0]!=null&&w.terminalDeps[0]!==!0){u(),s.length=0;return}if(w.terminalDeps[0]===!0){i=!0,l();return}let k=_[0];if(!(k==null||k.length===0)){for(let v of k)f(v);return{deactivate:()=>{u(),s.length=0,i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}function Xe(o,e,t){let{concurrent:r,...n}=t??{},s=r!=null&&r>0?r:Number.POSITIVE_INFINITY,a=0,i=!1,d=new Set,u=[],l;function f(){i&&a===0&&u.length===0&&l&&l.down([[c]])}function _(v){if(!l)return;a++;let N;N=ee(B(e(v)),l,()=>{N&&d.delete(N),a--,T(),f()}),d.add(N)}function T(){for(;u.length>0&&a<s;)_(u.shift())}function w(v){a<s?_(v):u.push(v)}function k(){for(let v of d)v();d.clear(),a=0,u.length=0}return y([o],(v,N,O)=>{if(l=N,O.terminalDeps[0]!=null&&O.terminalDeps[0]!==!0){k();return}if(O.terminalDeps[0]===!0){i=!0,f();return}let x=v[0];if(!(x==null||x.length===0)){for(let M of x)w(M);return{deactivate:()=>{k(),i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}var Jn=Xe;function Xn(o,e,t){return b(r=>{let n=new Set;function s(){for(let i of n)clearTimeout(i);n.clear()}let a=o.subscribe(i=>{for(let d of i)if(d[0]===m){let u=setTimeout(()=>{n.delete(u),r.emit(d[1])},e);n.add(u)}else if(d[0]===c){let u=setTimeout(()=>{n.delete(u),r.down([[c]])},e);n.add(u)}else d[0]===p&&(s(),r.down([d]))});return()=>{a(),s()}},h(t))}function Ze(o,e,t){return b(r=>{let n,s;function a(){n!==void 0&&(clearTimeout(n),n=void 0)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(a(),s=u[1],n=setTimeout(()=>{n=void 0,r.emit(s)},e)):u[0]===c?(n!==void 0&&(a(),r.emit(s)),r.down([[c]])):u[0]===p&&(a(),r.down([u]))});return()=>{i(),a()}},h(t))}function Qe(o,e,t){let{leading:r,trailing:n,...s}=t??{},a=r!==!1,i=n===!0,d=e*1e6;return b(u=>{let l,f=-1/0,_,T=!1;function w(){l!==void 0&&(clearTimeout(l),l=void 0)}let k=o.subscribe(v=>{for(let N of v)if(N[0]===m){let O=N[1],x=q();if(a&&x-f>=d)f=x,u.emit(O),w(),i&&(l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},e));else if(i&&(_=O,T=!0,l===void 0)){let M=(x-f)/1e6;l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},Math.max(0,e-M))}}else(N[0]===c||N[0]===p)&&(w(),u.down([N]))});return()=>{k(),w()}},h(s))}function Zn(o,e,t){return b(r=>{let n,s=!1,a=!1,i=o.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n={v:l[1]}:l[0]===p?(s=!0,r.down([l])):l[0]===c&&(a=!0,n=void 0)}}),d=e.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n!==void 0&&!a&&r.emit(n.v):l[0]===p?(s=!0,r.down([l])):l[0]===c&&(s=!0,r.down([[c]]))}});return()=>{i(),d()}},h(t))}function Qn(o,e,t){return b(r=>{let n,s,a=!1;function i(){n!==void 0&&(clearTimeout(n),n=void 0)}let d=o.subscribe(u=>{for(let l of u)l[0]===m?(s=l[1],a=!0,i(),n=setTimeout(()=>{n=void 0,a&&(a=!1,r.emit(s))},e)):(l[0]===c||l[0]===p)&&(i(),r.down([l]))});return()=>{d(),i()}},h(t))}function et(o,e,t){let{with:r,...n}=t??{},s=r??new Error("timeout");return b(a=>{let i;function d(){clearTimeout(i),i=setTimeout(()=>{i=void 0,a.down([[p,s]])},e)}d();let u=o.subscribe(l=>{for(let f of l)f[0]===m?(d(),a.emit(f[1])):(f[0]===c||f[0]===p)&&(clearTimeout(i),a.down([f]))});return()=>{u(),clearTimeout(i)}},h(n))}function nt(o,e,t){return b(r=>{let n=[],s=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&r.down([d])}),a=e.subscribe(i=>{for(let d of i)d[0]===m?n.length>0&&(r.emit([...n]),n.length=0):d[0]===c?r.down([[c]]):d[0]===p&&r.down([d])});return()=>{s(),a(),n.length=0}},h(t))}function tt(o,e,t){if(e<=0)throw new RangeError("bufferCount expects count > 0");return b(r=>{let n=[],s=o.subscribe(a=>{for(let i of a)i[0]===m?(n.push(i[1]),n.length>=e&&r.emit(n.splice(0,n.length))):i[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):i[0]===p&&r.down([i])});return()=>{s(),n.length=0}},h(t))}function rt(o,e,t){if(e<=0)throw new RangeError("windowCount expects count > 0");return b(r=>{let n,s=0;function a(){let d=b(u=>(n=u.down.bind(u),()=>{n=void 0}),h());s=0,r.emit(d)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(n||a(),n?.([[m,u[1]]]),s+=1,s>=e&&(n?.([[c]]),n=void 0)):u[0]===c?(n?.([[c]]),n=void 0,r.down([[c]])):u[0]===p&&(n?.([u]),n=void 0,r.down([u]))});return()=>{i(),n?.([[c]]),n=void 0}},h(t))}function ot(o,e,t){return b(r=>{let n=[],s=setInterval(()=>{n.length>0&&(r.emit([...n]),n.length=0)},e),a=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(clearInterval(s),n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&(clearInterval(s),r.down([d]))});return()=>{a(),clearInterval(s),n.length=0}},h(t))}function st(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}a();let i=setInterval(()=>{s(),a()},e),d=o.subscribe(u=>{for(let l of u)l[0]===m?n?.([[m,l[1]]]):l[0]===c?(clearInterval(i),s(),r.down([[c]])):l[0]===p&&(clearInterval(i),n?.([l]),s(),r.down([l]))});return()=>{d(),clearInterval(i),s()}},h(t))}function it(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}let i=o.subscribe(u=>{for(let l of u)l[0]===m?(n||a(),n?.([[m,l[1]]])):l[0]===c?(s(),r.down([[c]])):l[0]===p&&(n?.([l]),n=void 0,r.down([l]))}),d=e.subscribe(u=>{for(let l of u)l[0]===m&&(s(),a())});return()=>{i(),d(),s()}},h(t))}function at(o,e){return b((t,r)=>{"n"in r.store||(r.store.n=0);let n=setInterval(()=>{t.emit(r.store.n),r.store.n=r.store.n+1},o);return()=>clearInterval(n)},h(e))}function dt(o,e,t){if(e<=0)throw new RangeError("repeat expects count > 0");return b(r=>{let n=e,s,a=()=>{s?.(),s=o.subscribe(i=>{let d=!1,u=[];for(let l of i)l[0]===c?d=!0:u.push(l);u.length>0&&r.down(u),d&&(s?.(),s=void 0,n-=1,n>0?a():r.down([[c]]))})};return a(),()=>{s?.()}},h(t))}function ut(o,e){return y([o],(t,r)=>{let n=t[0];if(n==null||n.length===0){r.down([[g]]);return}for(let s of n)r.emit(s)},h(e))}function en(o,e,t){return b(r=>{let n=o.subscribe(s=>{for(let a of s)if(a[0]===m)r.emit(a[1]);else if(a[0]===p)try{r.emit(e(a[1]))}catch(i){r.down([[p,i]])}else a[0]===c&&r.down([[c]])});return()=>{n()}},h(t))}function lt(o,e,t){return y([o,e],(r,n,s)=>{let a=r[1];if(!(a!=null&&a.length>0?a.at(-1):s.prevData[1])){n.down([[g]]);return}let d=r[0];if(d!=null&&d.length>0){for(let u of d)n.emit(u);return}if(a!=null&&a.length>0&&s.prevData[0]!==void 0){n.emit(s.prevData[0]);return}n.down([[g]])},ze(t))}var ct=Je,ft=Ze,pt=Qe,ht=en;0&&(module.exports={audit,buffer,bufferCount,bufferTime,catchError,combine,combineLatest,concat,concatMap,debounce,debounceTime,delay,distinctUntilChanged,elementAt,exhaustMap,filter,find,first,flatMap,interval,last,map,merge,mergeMap,onFirstData,pairwise,pausable,race,reduce,repeat,rescue,sample,scan,skip,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,timeout,valve,window,windowCount,windowTime,withLatestFrom,zip});
|
|
1
|
+
"use strict";var oe=Object.defineProperty;var rn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var sn=Object.prototype.hasOwnProperty;var A=(o,e)=>()=>(o&&(e=o(o=0)),e);var an=(o,e)=>{for(var t in e)oe(o,t,{get:e[t],enumerable:!0})},dn=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of on(e))!sn.call(o,n)&&n!==t&&oe(o,n,{get:()=>e[n],enumerable:!(r=rn(e,n))||r.enumerable});return o};var un=o=>dn(oe({},"__esModule",{value:!0}),o);function q(){return Math.trunc(performance.now()*1e6)}function ye(){return Date.now()*1e6}var se=A(()=>{"use strict"});var D,m,R,g,I,F,H,C,c,p,L,ie,ln,ae,cn,fn,de,ve,we,Ne,ue,W=A(()=>{"use strict";D=Symbol.for("graphrefly/START"),m=Symbol.for("graphrefly/DATA"),R=Symbol.for("graphrefly/DIRTY"),g=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),F=Symbol.for("graphrefly/PAUSE"),H=Symbol.for("graphrefly/RESUME"),C=Symbol.for("graphrefly/TEARDOWN"),c=Symbol.for("graphrefly/COMPLETE"),p=Symbol.for("graphrefly/ERROR"),L=Object.freeze([R]),ie=Object.freeze([g]),ln=Object.freeze([I]),ae=Object.freeze([D]),cn=Object.freeze([c]),fn=Object.freeze([C]),de=Object.freeze([L]),ve=Object.freeze([ie]),we=Object.freeze([ln]),Ne=Object.freeze([cn]),ue=Object.freeze([fn])});function xe(o){o.registerCodec(pn)}var pn,Ee=A(()=>{"use strict";pn={name:"json",version:1,contentType:"application/json",encode(o){let e=JSON.stringify(o);return new TextEncoder().encode(e)},decode(o,e){let t=new TextDecoder().decode(o);return JSON.parse(t)}}});function K(o){if(o==null)return hn;let{type:e,id:t,...r}=o;return{type:e??"system",id:t??"",...r}}var hn,ke=A(()=>{"use strict";hn={type:"system",id:""}});function Me(){return le>0||mn}function Se(){return le>0}function De(o){le>0?gn.push(o):o()}function Y(o,e,t){if(e.length===0)return;if(e.length===1){let u=t(e[0][0]);if(u<3||!Me()){o(e);return}(u>=5?Re:u===4?Ae:Oe).push(()=>o(e));return}let r=e.length,n=r,s=r,a=r,i=0;for(;i<r&&t(e[i][0])<3;)i++;for(n=i;i<r&&t(e[i][0])===3;)i++;for(s=i;i<r&&t(e[i][0])===4;)i++;a=i;let d=Me();if(n>0){let u=e.slice(0,n);o(u)}if(s>n){let u=e.slice(n,s);d?Oe.push(()=>o(u)):o(u)}if(a>s){let u=e.slice(s,a);d?Ae.push(()=>o(u)):o(u)}if(r>a){let u=e.slice(a,r);d?Re.push(()=>o(u)):o(u)}}var le,mn,Oe,Ae,Re,gn,Ce=A(()=>{"use strict";le=0,mn=!1,Oe=[],Ae=[],Re=[],gn=[]});function Ie(o){o.registerMessageType(D,{tier:0,wireCrossing:!1}),o.registerMessageType(R,{tier:1,wireCrossing:!1}),o.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),o.registerMessageType(F,{tier:2,wireCrossing:!1}),o.registerMessageType(H,{tier:2,wireCrossing:!1}),o.registerMessageType(m,{tier:3,wireCrossing:!0}),o.registerMessageType(g,{tier:3,wireCrossing:!0}),o.registerMessageType(c,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(p,{tier:4,wireCrossing:!0,metaPassthrough:!1}),o.registerMessageType(C,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var J,Fe=A(()=>{"use strict";W();J=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=t=>{let r=this._messageTypes.get(t);return r!=null?r.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,t){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:t.tier,wireCrossing:t.wireCrossing??t.tier>=3,metaPassthrough:t.metaPassthrough??!0}),this}messageTier(e){let t=this._messageTypes.get(e);return t!=null?t.tier:1}isWireCrossing(e){let t=this._messageTypes.get(e);return t!=null?t.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let t=this._messageTypes.get(e);return t!=null?t.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var G,Le=A(()=>{"use strict";G=class extends Error{actor;action;nodeName;constructor(e,t){super(t??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function ce(o){if(o===void 0)return null;if(typeof o=="number"){if(!Number.isFinite(o))throw new TypeError(`Cannot hash non-finite number: ${o}`);if(Number.isInteger(o)&&!Number.isSafeInteger(o))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${o}. Cross-language cid parity is not guaranteed for unsafe integers.`);return o}if(typeof o=="string"||typeof o=="boolean"||o===null)return o;if(Array.isArray(o))return o.map(ce);if(typeof o=="object"&&o!==null){let e={};for(let t of Object.keys(o).sort())e[t]=ce(o[t]);return e}return null}function _n(o){let e=Tn.encode(o),t=e.length,r=t*8,n=t+9+63&-64,s=new Uint8Array(n);s.set(e),s[t]=128;let a=new DataView(s.buffer);a.setUint32(n-4,r>>>0,!1),a.setUint32(n-8,Math.floor(r/4294967296)>>>0,!1);let i=1779033703,d=3144134277,u=1013904242,l=2773480762,f=1359893119,_=2600822924,T=528734635,w=1541459225,k=new Uint32Array(64),v=(O,x)=>O>>>x|O<<32-x;for(let O=0;O<n;O+=64){for(let E=0;E<16;E++)k[E]=a.getUint32(O+E*4,!1);for(let E=16;E<64;E++){let V=k[E-15],U=k[E-2],z=v(V,7)^v(V,18)^V>>>3,re=v(U,17)^v(U,19)^U>>>10;k[E]=k[E-16]+z+k[E-7]+re>>>0}let x=i,M=d,P=u,ne=l,S=f,j=_,$=T,te=w;for(let E=0;E<64;E++){let V=v(S,6)^v(S,11)^v(S,25),U=S&j^~S&$,z=te+V+U+bn[E]+k[E]>>>0,re=v(x,2)^v(x,13)^v(x,22),nn=x&M^x&P^M&P,tn=re+nn>>>0;te=$,$=j,j=S,S=ne+z>>>0,ne=P,P=M,M=x,x=z+tn>>>0}i=i+x>>>0,d=d+M>>>0,u=u+P>>>0,l=l+ne>>>0,f=f+S>>>0,_=_+j>>>0,T=T+$>>>0,w=w+te>>>0}let N=O=>O.toString(16).padStart(8,"0");return N(i)+N(d)+N(u)+N(l)+N(f)+N(_)+N(T)+N(w)}function fe(o){let e=ce(o??null),t=JSON.stringify(e);return _n(t).slice(0,16)}function yn(){let o=globalThis.crypto;if(o?.randomUUID)return o.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),t=e()+e()+e()+e();return`${t.slice(0,8)}-${t.slice(8,12)}-4${t.slice(13,16)}-${(parseInt(t.slice(16,17),16)&3|8).toString(16)}${t.slice(17,20)}-${t.slice(20,32)}`}function pe(o,e,t){let r=t?.id??yn();if(o===0)return{id:r,version:0};let s=(t?.hash??fe)(e);return{id:r,version:0,cid:s,prev:null}}function Ge(o,e,t){o.version+=1,"cid"in o&&(o.prev=o.cid,o.cid=t(e))}var bn,Tn,Pe=A(()=>{"use strict";bn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Tn=new TextEncoder});function He(o){return{node:o,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function he(o){o.prevData=void 0,o.dirty=!1,o.involvedThisWave=!1,o.dataBatch.length=0,o.terminal=void 0}function X(o){return o.length===0?o:typeof o[0]=="symbol"?[o]:o}function y(o,e,t){let r=We(o)?o:[],n=typeof o=="function"?o:typeof e=="function"?e:void 0,s={};return We(o)?s=(me(e)?e:t)??{}:me(o)?s=o:s=(me(e)?e:t)??{},new Z(r,n,s)}var Ve,Ue,vn,wn,ge,Z,We,me,be=A(()=>{"use strict";Ee();ke();Ce();se();Fe();Le();W();Pe();Ve=()=>{},Ue=100;vn=(o,e,t,r)=>{t.direction==="down-in"&&o._onDepMessage(t.depIndex,e)},wn=(o,e,t,r)=>{let n=o;if(n._status==="completed"||n._status==="errored")return;let s=n._cached,a=s===void 0?[ae]:[ae,[m,s]];n._status==="dirty"&&a.push(L),Y(e,a,n._config.tierOf)},ge=new J({onMessage:vn,onSubscribe:wn});Ie(ge);xe(ge);Z=class o{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,t,r){this._config=r.config??ge,this._config.onMessage,this._optsName=r.name,this._describeKind=r.describeKind,this._equals=r.equals??Object.is,this._resubscribable=r.resubscribable??!1,this._resetOnTeardown=r.resetOnTeardown??!1,this._autoComplete=r.completeWhenDepsComplete??!0,this._autoError=r.errorWhenDepsError??!0,this._pausable=r.pausable??!0,this._guard=r.guard,this._fn=t,this._partial=r.partial??!1,this._cached=r.initial!==void 0?r.initial:void 0,this._status=e.length===0&&t==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=r.versioningHash??this._config.defaultHashFn??fe;let n=r.versioning??this._config.defaultVersioning;this._versioningLevel=n,this._versioning=n!=null?pe(n,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(He);let s={};for(let[i,d]of Object.entries(r.meta??{})){let u={initial:d,name:`${r.name??"node"}:meta:${i}`,describeKind:"state",config:this._config};r.guard!=null&&(u.guard=r.guard),s[i]=new o([],void 0,u)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let a=this;this._actions={emit(i){a._emit([[m,i]])},down(i){a._emit(X(i))},up(i){a._emitUp(X(i))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,t){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let r=this._versioningLevel;if(r!=null&&e<=r)return;let n=t?.hash??this._hashFn;n!==this._hashFn&&(this._hashFn=n);let s=this._cached===void 0?void 0:this._cached,a=this._versioning,i=a?.id??t?.id,d=a?.version??0,u=pe(e,s,{id:i,hash:n});u.version=d,this._versioning=u,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let t=K(e);if(this._guard!=null&&!this._guard(t,"observe"))return!1;if(this._extraGuards!=null){for(let r of this._extraGuards)if(!r(t,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let t=this._guard!=null||this._extraGuards!=null,r=e?.actor!=null;if(!t&&!r)return;let n=K(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(n,s))throw new G({actor:n,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(n,s))throw new G({actor:n,action:s,nodeName:this.name})}this._lastMutation={actor:n,timestamp_ns:ye()}}down(e,t){let r=X(e);r.length!==0&&(this._checkGuard(t),this._emit(r))}emit(e,t){this._checkGuard(t),this._emit([[m,e]])}up(e,t){if(this._deps.length===0)return;let r=X(e);if(r.length===0)return;this._checkGuard(t);let n=t??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.node.up?.(r,n)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let t of this._deps)t.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let t=this._config.tierOf;for(let r of e){let n=t(r[0]);if(n===3||n===4)throw new Error(`Node "${this.name}": tier-${n} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,t){if(t!=null&&this._guard!=null){let d=K(t);if(!this._guard(d,"observe"))throw new G({actor:d,action:"observe",nodeName:this.name})}let n=this._isTerminal&&this._resubscribable;if(n){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)he(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:n},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let i=!1;return()=>{i||(i=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[t]=this._sinks;this._sinks=t}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,t=0;try{for(let r=0;r<e;r++){let n=r,s=this._deps[r];s.unsub=Ve,s.unsub=s.node.subscribe(a=>{if(s.unsub===null)return;let i=this._config.tierOf,d=!1;for(let u of a)i(u[0])>=3&&(d=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:n},this._actions);d&&this._maybeRunFnOnSettlement()}),t++}}catch(r){this._deps[t].unsub=null;for(let n=0;n<t;n++){let s=this._deps[n];if(s.unsub!=null){let a=s.unsub;s.unsub=null;try{a()}catch{}he(s)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let n=0;n<this._deps.length;n++)if(this._deps[n].node===e)return n;let t=this._deps.length,r=He(e);if(this._deps.push(r),this._sinks==null)return t;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de),r.unsub=Ve;try{r.unsub=e.subscribe(n=>{if(r.unsub===null)return;let s=this._config.tierOf,a=!1;for(let i of n)s(i[0])>=3&&(a=!0),this._config.onMessage(this,i,{direction:"down-in",depIndex:t},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(n){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,n}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(r){this._emit([[p,this._wrapFnError("cleanup threw",r)]])}else if(t!=null&&typeof t=="object"){let r=t.deactivate;if(typeof r=="function")try{r()}catch(n){this._emit([[p,this._wrapFnError("cleanup.deactivate threw",n)]])}}for(let r of this._deps){if(r.unsub!=null){let n=r.unsub;r.unsub=null;try{n()}catch{}}he(r)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,t){let r=this._deps[e],n=t[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:t};for(let a of this._inspectorHooks)a(s)}if(n!==D){if(n===R){this._depDirtied(r);return}if(n===I){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(we);return}if(n===F||n===H){this._emit([t]);return}if(n===C){this._emit(ue);return}if(n===m)this._depSettledAsData(r,t[1]);else if(n===g)this._depSettledAsResolved(r);else if(n===c)this._depSettledAsTerminal(r,!0);else if(n===p)this._depSettledAsTerminal(r,t[1]);else{this._emit([t]);return}if(!this._fn){(n===m||n===g)&&this._emit([t]),(n===c||n===p)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(de))}_depSettledAsData(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(t),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,t){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=t,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let t=this._deps[e];if(t.dataBatch.length===0&&t.prevData===void 0&&t.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(ve),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(t=>t.terminal!==void 0&&t.terminal!==!0);if(e!=null){this._autoError&&this._emit([[p,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(Ne)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(a){this._emit([[p,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(i){this._emit([[p,this._wrapFnError("cleanup.beforeRun threw",i)]]);return}}}let t=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),r=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let i=t[a];i!=null&&i.length>0&&(this._deps[a].prevData=i[i.length-1])}let n=this._deps.map(a=>a.terminal),s={prevData:r,terminalDeps:n,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:t,prevData:r};for(let i of this._inspectorHooks)i(a)}this._isExecutingFn=!0;try{let a=this._fn(t,this._actions,s);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let i=a;(typeof i.beforeRun=="function"||typeof i.deactivate=="function"||typeof i.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[p,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ue?(this._rerunDepth=0,this._emit([[p,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ue} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,t){let r=t instanceof Error?t.message:String(t);return new Error(`Node "${this.name}": ${e}: ${r}`,{cause:t})}_frameBatch(e){let t=this._config.tierOf;if(e.length===1)return t(e[0][0])===3&&this._status!=="dirty"?[L,e[0]]:e;let r=!0,n=!1,s=!1,a=-1;for(let d of e){let u=t(d[0]);u<a&&(r=!1),u===3&&(n=!0),d[0]===R&&(s=!0),a=u}let i=e;if(!r){let d=e.map((u,l)=>({m:u,i:l,tier:t(u[0])}));d.sort((u,l)=>u.tier-l.tier||u.i-l.i),i=d.map(u=>u.m)}if(n&&!s&&this._status!=="dirty"){let d=0;for(;d<i.length&&t(i[d][0])===0;)d++;return d===0?[L,...i]:[...i.slice(0,d),L,...i.slice(d)]}return i}_emit(e){if(e.length===0)return;for(let i=0;i<e.length;i++){let d=e[i];if(d[0]===p&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let t=e;if(this._isTerminal&&!this._resubscribable){let i=e.filter(d=>d[0]===C||d[0]===I);if(i.length===0)return;t=i}t=this._frameBatch(t);let n=null;for(let i=0;i<t.length;i++){let d=t[i],u=d[0];if(u!==F&&u!==H){n?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${u===F?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let l=!0;if(this._pausable!==!1){let f=d[1];if(u===F)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(f),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(f))l=!1;else if(this._pauseLocks.delete(f),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let _=this._pauseBuffer;this._pauseBuffer=[],this._emit(_)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}l?n?.push(d):n==null&&(n=t.slice(0,i))}if(n!=null){if(n.length===0)return;t=n}if(this._hasMeta&&t.some(i=>i[0]===C))for(let i of Object.keys(this.meta))try{this.meta[i]._emit(ue)}catch{}let{finalMessages:s,equalsError:a}=this._updateState(t);if(s.length>0&&this._config.inspectorEnabled){let i=this._config.globalInspector;if(i!=null)try{i({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let i=this._config.tierOf,d=[];for(let u of s)i(u[0])===3?this._pauseBuffer.push(u):d.push(u);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(s);a!=null&&this._emit([[p,a]])}_updateState(e){let t=this._config.tierOf,r,n,s=-1,a=0;for(let l of e)t(l[0])===3&&a++;let i=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let l=e.length-1;l>=0;l--)if(e[l][0]===m){d=l;break}}for(let l=0;l<e.length;l++){let f=e[l],_=f[0];if(_===m){if(f.length>=2){let T=!1;if(i&&this._cached!==void 0)try{T=this._equals(this._cached,f[1])}catch(w){n=this._wrapFnError("equals threw",w),s=l;break}if(T){r==null&&(r=e.slice(0,l)),r.push(ie),this._status="resolved";continue}this._cached=f[1],this._versioning!=null&&(d<0||l===d)&&Ge(this._versioning,f[1],this._hashFn)}this._status="settled",r?.push(f)}else if(r?.push(f),_===R)this._status="dirty";else if(_===g)this._status="resolved";else if(_===c){this._status="completed";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===p){this._status="errored";{let T=this._config.rigorRecorder;if(T!=null)try{T.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(_===I){if(this._cached!==void 0){let w=this._config.rigorRecorder;if(w!=null)try{w.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let T=this._cleanup;if(typeof T=="function"){this._cleanup=void 0;try{T()}catch{}}else if(T!=null&&typeof T=="object"){let w=T.invalidate;if(typeof w=="function")try{w()}catch{}}}else _===C&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=s>=0?r??e.slice(0,s):r??e;return n!=null?{finalMessages:u,equalsError:n}:{finalMessages:u}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let t=[...this._sinks];for(let r of t)r(e)};_dispatchOrAccumulate(e){if(Se()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],De(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}Y(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let t=this._frameBatch(e);Y(this._deliverToSinks,t,this._config.tierOf)}},We=o=>Array.isArray(o),me=o=>typeof o=="object"&&o!=null&&!Array.isArray(o)});function b(o,e){return y((r,n,s)=>o(n,s)??void 0,{describeKind:"producer",...e})}function Be(o,e,t){return y(o,(n,s,a)=>{let i=n.map((d,u)=>d!=null&&d.length>0?d.at(-1):a.prevData[u]);s.emit(e(i,a))},{describeKind:"derived",...t})}var Te=A(()=>{"use strict";be()});function _e(o){return{describeKind:"producer",...o}}function je(o,e){return b(t=>{let r=!1;try{for(let n of o){if(r)return;t.emit(n)}r||t.down([[c]])}catch(n){r||t.down([[p,n]])}return()=>{r=!0}},_e(e))}function Nn(o){return o!=null&&typeof o.then=="function"}function xn(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=!1,a=()=>{s||(s=!0,n.down([[p,t.reason]]))};if(t?.aborted){a();return}return t?.addEventListener("abort",a,{once:!0}),Promise.resolve(o).then(i=>{s||(s=!0,t?.removeEventListener("abort",a),n.emit(i),n.down([[c]]))},i=>{s||(s=!0,t?.removeEventListener("abort",a),n.down([[p,i]]))}),()=>{s=!0,t?.removeEventListener("abort",a)}},_e(r))}function En(o,e){let{signal:t,...r}=e??{};return b(n=>{let s=new AbortController,a=()=>s.abort(t?.reason);t?.aborted?s.abort(t.reason):t?.addEventListener("abort",a,{once:!0});let i=t??s.signal,d=!1,u=o[Symbol.asyncIterator](),l=()=>{d||i.aborted||Promise.resolve(u.next()).then(f=>{if(!(d||i.aborted)){if(f.done){n.down([[c]]);return}n.emit(f.value),l()}},f=>{!d&&!i.aborted&&n.down([[p,f]])})};return l(),()=>{d=!0,t?.removeEventListener("abort",a),s.abort(),Promise.resolve(u.return?.()).catch(()=>{})}},_e(r))}function kn(o){return o!=null&&typeof o=="object"&&"cache"in o&&typeof o.subscribe=="function"}function B(o,e){if(kn(o))return o;if(Nn(o))return xn(o,e);if(o!=null){let t=o;if(typeof t[Symbol.asyncIterator]=="function")return En(o,e);if(typeof t[Symbol.iterator]=="function")return je(o,e)}return On(o)}function On(...o){return je(o,void 0)}var $e=A(()=>{"use strict";W();Te()});var mt={};an(mt,{audit:()=>Qn,buffer:()=>nt,bufferCount:()=>tt,bufferTime:()=>ot,catchError:()=>ht,combine:()=>Je,combineLatest:()=>ct,concat:()=>$n,concatMap:()=>Yn,debounce:()=>Ze,debounceTime:()=>ft,delay:()=>Xn,distinctUntilChanged:()=>Un,elementAt:()=>Gn,exhaustMap:()=>Kn,filter:()=>qe,find:()=>Ln,first:()=>In,flatMap:()=>Jn,interval:()=>at,last:()=>Fn,map:()=>Rn,merge:()=>Bn,mergeMap:()=>Xe,onFirstData:()=>Ye,pairwise:()=>Hn,pausable:()=>ut,race:()=>zn,reduce:()=>Sn,repeat:()=>dt,rescue:()=>en,sample:()=>Zn,scan:()=>Mn,skip:()=>Ke,switchMap:()=>qn,take:()=>Q,takeUntil:()=>Cn,takeWhile:()=>Dn,tap:()=>Pn,tapFirst:()=>Vn,throttle:()=>Qe,throttleTime:()=>pt,timeout:()=>et,valve:()=>lt,window:()=>it,windowCount:()=>rt,windowTime:()=>st,withLatestFrom:()=>Wn,zip:()=>jn});module.exports=un(mt);se();W();be();Te();$e();function h(o){return{describeKind:"derived",...o}}function ze(o){return{describeKind:"derived",partial:!0,...o}}function Rn(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}for(let a of s)n.emit(e(a))},h(t))}function qe(o,e,t){return y([o],(r,n)=>{let s=r[0];if(s==null||s.length===0){n.down([[g]]);return}let a=!1;for(let i of s)e(i)&&(n.emit(i),a=!0);a||n.down([[g]])},h(t))}function Mn(o,e,t,r){return y([o],(n,s,a)=>{"acc"in a.store||(a.store.acc=t);let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d),s.emit(a.store.acc)},{...h(r),initial:t,resetOnTeardown:!0})}function Sn(o,e,t,r){return y([o],(n,s,a)=>{if("acc"in a.store||(a.store.acc=t),a.terminalDeps[0]===!0){s.emit(a.store.acc),s.down([[c]]);return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)a.store.acc=e(a.store.acc,d)},{...h(r),completeWhenDepsComplete:!1})}function Q(o,e,t){return e<=0?y([o],(r,n,s)=>{s.store.completed||(s.store.completed=!0,n.down([[c]]))},{...h(t),completeWhenDepsComplete:!1}):y([o],(r,n,s)=>{if("taken"in s.store||(s.store.taken=0),s.store.done){n.down([[g]]);return}if(s.terminalDeps[0]===!0){s.store.done=!0,n.down([[c]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a)if(s.store.taken++,n.emit(i),s.store.taken>=e){s.store.done=!0,n.down([[c]]);return}},{...h(t),completeWhenDepsComplete:!1})}function Ke(o,e,t){return y([o],(r,n,s)=>{"skipped"in s.store||(s.store.skipped=0);let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.skipped++,s.store.skipped<=e||(n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Dn(o,e,t){return y([o],(r,n,s)=>{if(s.store.done){n.down([[g]]);return}let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}for(let i of a){if(!e(i)){s.store.done=!0,n.down([[c]]);return}n.emit(i)}},{...h(t),completeWhenDepsComplete:!1})}function Cn(o,e,t){let r=t?.predicate??(a=>a[0]===m),{predicate:n,...s}=t??{};return b(a=>{let i=!1,d=o.subscribe(l=>{if(!i)for(let f of l){if(i)return;f[0]===m?a.emit(f[1]):(f[0]===c||f[0]===p)&&(i=!0,a.down([f]))}}),u=e.subscribe(l=>{if(!i)for(let f of l){if(i)return;if(r(f)){i=!0,a.down([[c]]);return}}});return()=>{d(),u()}},h(s))}function In(o,e){return Q(o,1,e)}function Fn(o,e){let{defaultValue:t,...r}=e??{},n=e!=null&&Object.hasOwn(e,"defaultValue");return y([o],(s,a,i)=>{if(i.terminalDeps[0]===!0){i.store.has?a.emit(i.store.latest):n&&a.emit(t),a.down([[c]]);return}let d=s[0];if(d==null||d.length===0){a.down([[g]]);return}i.store.latest=d.at(-1),i.store.has=!0},{...h(r),completeWhenDepsComplete:!1})}function Ln(o,e,t){return Q(qe(o,e,t),1,t)}function Gn(o,e,t){return Q(Ke(o,e,t),1,t)}function Pn(o,e,t){if(typeof e=="function")return y([o],(n,s)=>{let a=n[0];if(a==null||a.length===0){s.down([[g]]);return}for(let i of a)e(i),s.emit(i)},h(t));let r=e;return y([o],(n,s,a)=>{if(a.terminalDeps[0]!==void 0){a.terminalDeps[0]===!0?(r.complete?.(),s.down([[c]])):(r.error?.(a.terminalDeps[0]),s.down([[p,a.terminalDeps[0]]]));return}let i=n[0];if(i==null||i.length===0){s.down([[g]]);return}for(let d of i)r.data?.(d),s.emit(d)},{...h(t),completeWhenDepsComplete:!1})}function Ye(o,e,t){let r=t?.where??(s=>s!=null),n=!1;return y([o],(s,a)=>{let i=s[0];if(i==null||i.length===0){a.down([[g]]);return}for(let d of i)!n&&r(d)&&(n=!0,e(d)),a.emit(d)},h(t))}var Vn=Ye;function Un(o,e=Object.is,t){return y([o],(r,n,s)=>{let a=r[0];if(a==null||a.length===0){n.down([[g]]);return}let i=!1;for(let d of a)s.store.hasPrev&&e(s.store.prev,d)||(s.store.prev=d,s.store.hasPrev=!0,n.emit(d),i=!0);i||n.down([[g]])},h(t))}function Hn(o,e){return y([o],(t,r,n)=>{let s=t[0];if(s==null||s.length===0){r.down([[g]]);return}let a=!1;for(let i of s)if(!n.store.hasPrev)n.store.prev=i,n.store.hasPrev=!0;else{let d=[n.store.prev,i];n.store.prev=i,r.emit(d),a=!0}a||r.down([[g]])},h(e))}function Je(...o){let e=[...o];return Be(e,t=>t,{...h(),equals:(t,r)=>{if(t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!Object.is(t[n],r[n]))return!1;return!0}})}function Wn(o,e,t){return y([o,e],(r,n,s)=>{let a=r[0],i=r[1],d=i!=null&&i.length>0?i.at(-1):s.prevData[1];if(a!=null&&a.length>0){if(!(i!=null&&i.length>0)&&s.prevData[1]===void 0){n.down([[g]]);return}for(let u of a)n.emit([u,d])}else n.down([[g]])},ze(t))}function Bn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):b(e=>{let t=o.length,r=0,n=[];for(let s of o){let a=s.subscribe(i=>{for(let d of i)d[0]===m?e.emit(d[1]):d[0]===c?(r+=1,r>=t&&e.down([[c]])):d[0]===p&&e.down([d])});n.push(a)}return()=>{for(let s of n)s()}},h())}function jn(...o){let e=o.length;return e===0?b(t=>{t.emit([]),t.down([[c]])},h()):b(t=>{let r=Array.from({length:e},()=>[]),n=e;function s(){for(;r.every(i=>i.length>0);){let i=r.map(d=>d.shift());t.emit(i)}}let a=[];for(let i=0;i<e;i++){let d=i,u=o[i].subscribe(l=>{for(let f of l)f[0]===m?(r[d].push(f[1]),s()):f[0]===c?(n-=1,(n===0||r[d].length===0)&&t.down([[c]])):f[0]===p&&t.down([f])});a.push(u)}return()=>{for(let i of a)i()}},h())}function $n(o,e,t){return b(r=>{let n=0,s=[],a,i;return i=e.subscribe(d=>{for(let u of d)n===0?u[0]===m?s.push(u[1]):u[0]===p&&r.down([u]):u[0]===m?r.emit(u[1]):(u[0]===c||u[0]===p)&&r.down([u])}),a=o.subscribe(d=>{for(let u of d)if(n===0)if(u[0]===m)r.emit(u[1]);else if(u[0]===c){n=1;for(let l of s)r.emit(l);s.length=0}else u[0]===p&&r.down([u])}),()=>{a?.(),i?.()}},h(t))}function zn(...o){return o.length===0?b(e=>{e.down([[c]])},h()):o.length===1?y([o[0]],(e,t)=>{let r=e[0];if(r==null||r.length===0){t.down([[g]]);return}for(let n of r)t.emit(n)},h()):b(e=>{let t=null,r=[];for(let n=0;n<o.length;n++){let s=n,a=o[n].subscribe(i=>{for(let d of i){if(t!==null&&s!==t)return;d[0]===m?(t===null&&(t=s),e.emit(d[1])):(d[0]===c||d[0]===p)&&(t===null||s===t)&&e.down([d])}});r.push(a)}return()=>{for(let n of r)n()}},h())}function ee(o,e,t){let r,n=!1,s=()=>{n||(n=!0,t())};return r=o.subscribe(a=>{let i=!1,d=!1;for(let u of a)u[0]!==D&&(u[0]===m?e.emit(u[1]):u[0]===c?i=!0:u[0]===p?(d=!0,e.down([u])):(u[0]===R||u[0]===g)&&e.down([u]));d?(r?.(),r=void 0,s()):i&&s()}),()=>{r?.(),r=void 0}}function qn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return s(),r=ee(B(e(u[u.length-1])),i,()=>{s(),n&&i.down([[c]])}),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Kn(o,e,t){let r,n=!1;function s(){r?.(),r=void 0}return y([o],(a,i,d)=>{if(d.terminalDeps[0]!=null&&d.terminalDeps[0]!==!0){s();return}if(d.terminalDeps[0]===!0){n=!0,r||i.down([[c]]);return}let u=a[0];if(!(u==null||u.length===0))return r===void 0?r=ee(B(e(u[0])),i,()=>{s(),n&&i.down([[c]])}):i.down([[g]]),{deactivate:()=>{s(),n=!1}}},{...h(t),completeWhenDepsComplete:!1})}function Yn(o,e,t){let{maxBuffer:r,...n}=t??{},s=[],a,i=!1,d;function u(){a?.(),a=void 0}function l(){if(!d||a!==void 0)return;if(s.length===0){i&&d.down([[c]]);return}let _=s.shift();a=ee(B(e(_)),d,()=>{u(),l()})}function f(_){r&&r>0&&s.length>=r&&s.shift(),s.push(_),l()}return y([o],(_,T,w)=>{if(d=T,w.terminalDeps[0]!=null&&w.terminalDeps[0]!==!0){u(),s.length=0;return}if(w.terminalDeps[0]===!0){i=!0,l();return}let k=_[0];if(!(k==null||k.length===0)){for(let v of k)f(v);return{deactivate:()=>{u(),s.length=0,i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}function Xe(o,e,t){let{concurrent:r,...n}=t??{},s=r!=null&&r>0?r:Number.POSITIVE_INFINITY,a=0,i=!1,d=new Set,u=[],l;function f(){i&&a===0&&u.length===0&&l&&l.down([[c]])}function _(v){if(!l)return;a++;let N;N=ee(B(e(v)),l,()=>{N&&d.delete(N),a--,T(),f()}),d.add(N)}function T(){for(;u.length>0&&a<s;)_(u.shift())}function w(v){a<s?_(v):u.push(v)}function k(){for(let v of d)v();d.clear(),a=0,u.length=0}return y([o],(v,N,O)=>{if(l=N,O.terminalDeps[0]!=null&&O.terminalDeps[0]!==!0){k();return}if(O.terminalDeps[0]===!0){i=!0,f();return}let x=v[0];if(!(x==null||x.length===0)){for(let M of x)w(M);return{deactivate:()=>{k(),i=!1}}}},{...h(n),completeWhenDepsComplete:!1})}var Jn=Xe;function Xn(o,e,t){return b(r=>{let n=new Set;function s(){for(let i of n)clearTimeout(i);n.clear()}let a=o.subscribe(i=>{for(let d of i)if(d[0]===m){let u=setTimeout(()=>{n.delete(u),r.emit(d[1])},e);n.add(u)}else if(d[0]===c){let u=setTimeout(()=>{n.delete(u),r.down([[c]])},e);n.add(u)}else d[0]===p&&(s(),r.down([d]))});return()=>{a(),s()}},h(t))}function Ze(o,e,t){return b(r=>{let n,s;function a(){n!==void 0&&(clearTimeout(n),n=void 0)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(a(),s=u[1],n=setTimeout(()=>{n=void 0,r.emit(s)},e)):u[0]===c?(n!==void 0&&(a(),r.emit(s)),r.down([[c]])):u[0]===p&&(a(),r.down([u]))});return()=>{i(),a()}},h(t))}function Qe(o,e,t){let{leading:r,trailing:n,...s}=t??{},a=r!==!1,i=n===!0,d=e*1e6;return b(u=>{let l,f=-1/0,_,T=!1;function w(){l!==void 0&&(clearTimeout(l),l=void 0)}let k=o.subscribe(v=>{for(let N of v)if(N[0]===m){let O=N[1],x=q();if(a&&x-f>=d)f=x,u.emit(O),w(),i&&(l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},e));else if(i&&(_=O,T=!0,l===void 0)){let M=(x-f)/1e6;l=setTimeout(()=>{l=void 0,T&&(f=q(),u.emit(_),T=!1)},Math.max(0,e-M))}}else(N[0]===c||N[0]===p)&&(w(),u.down([N]))});return()=>{k(),w()}},h(s))}function Zn(o,e,t){return b(r=>{let n,s=!1,a=!1,i=o.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n={v:l[1]}:l[0]===p?(s=!0,r.down([l])):l[0]===c&&(a=!0,n=void 0)}}),d=e.subscribe(u=>{if(!s)for(let l of u){if(s)return;l[0]===m?n!==void 0&&!a&&r.emit(n.v):l[0]===p?(s=!0,r.down([l])):l[0]===c&&(s=!0,r.down([[c]]))}});return()=>{i(),d()}},h(t))}function Qn(o,e,t){return b(r=>{let n,s,a=!1;function i(){n!==void 0&&(clearTimeout(n),n=void 0)}let d=o.subscribe(u=>{for(let l of u)l[0]===m?(s=l[1],a=!0,i(),n=setTimeout(()=>{n=void 0,a&&(a=!1,r.emit(s))},e)):(l[0]===c||l[0]===p)&&(i(),r.down([l]))});return()=>{d(),i()}},h(t))}function et(o,e,t){let{with:r,...n}=t??{},s=r??new Error("timeout");return b(a=>{let i;function d(){clearTimeout(i),i=setTimeout(()=>{i=void 0,a.down([[p,s]])},e)}d();let u=o.subscribe(l=>{for(let f of l)f[0]===m?(d(),a.emit(f[1])):(f[0]===c||f[0]===p)&&(clearTimeout(i),a.down([f]))});return()=>{u(),clearTimeout(i)}},h(n))}function nt(o,e,t){return b(r=>{let n=[],s=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&r.down([d])}),a=e.subscribe(i=>{for(let d of i)d[0]===m?n.length>0&&(r.emit([...n]),n.length=0):d[0]===c?r.down([[c]]):d[0]===p&&r.down([d])});return()=>{s(),a(),n.length=0}},h(t))}function tt(o,e,t){if(e<=0)throw new RangeError("bufferCount expects count > 0");return b(r=>{let n=[],s=o.subscribe(a=>{for(let i of a)i[0]===m?(n.push(i[1]),n.length>=e&&r.emit(n.splice(0,n.length))):i[0]===c?(n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):i[0]===p&&r.down([i])});return()=>{s(),n.length=0}},h(t))}function rt(o,e,t){if(e<=0)throw new RangeError("windowCount expects count > 0");return b(r=>{let n,s=0;function a(){let d=b(u=>(n=u.down.bind(u),()=>{n=void 0}),h());s=0,r.emit(d)}let i=o.subscribe(d=>{for(let u of d)u[0]===m?(n||a(),n?.([[m,u[1]]]),s+=1,s>=e&&(n?.([[c]]),n=void 0)):u[0]===c?(n?.([[c]]),n=void 0,r.down([[c]])):u[0]===p&&(n?.([u]),n=void 0,r.down([u]))});return()=>{i(),n?.([[c]]),n=void 0}},h(t))}function ot(o,e,t){return b(r=>{let n=[],s=setInterval(()=>{n.length>0&&(r.emit([...n]),n.length=0)},e),a=o.subscribe(i=>{for(let d of i)d[0]===m?n.push(d[1]):d[0]===c?(clearInterval(s),n.length>0&&r.emit([...n]),n.length=0,r.down([[c]])):d[0]===p&&(clearInterval(s),r.down([d]))});return()=>{a(),clearInterval(s),n.length=0}},h(t))}function st(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}a();let i=setInterval(()=>{s(),a()},e),d=o.subscribe(u=>{for(let l of u)l[0]===m?n?.([[m,l[1]]]):l[0]===c?(clearInterval(i),s(),r.down([[c]])):l[0]===p&&(clearInterval(i),n?.([l]),s(),r.down([l]))});return()=>{d(),clearInterval(i),s()}},h(t))}function it(o,e,t){return b(r=>{let n;function s(){n?.([[c]]),n=void 0}function a(){let u=b(l=>(n=l.down.bind(l),()=>{n=void 0}),h());r.emit(u)}let i=o.subscribe(u=>{for(let l of u)l[0]===m?(n||a(),n?.([[m,l[1]]])):l[0]===c?(s(),r.down([[c]])):l[0]===p&&(n?.([l]),n=void 0,r.down([l]))}),d=e.subscribe(u=>{for(let l of u)l[0]===m&&(s(),a())});return()=>{i(),d(),s()}},h(t))}function at(o,e){return b((t,r)=>{"n"in r.store||(r.store.n=0);let n=setInterval(()=>{t.emit(r.store.n),r.store.n=r.store.n+1},o);return()=>clearInterval(n)},h(e))}function dt(o,e,t){if(e<=0)throw new RangeError("repeat expects count > 0");return b(r=>{let n=e,s,a=()=>{s?.(),s=o.subscribe(i=>{let d=!1,u=[];for(let l of i)l[0]===c?d=!0:u.push(l);u.length>0&&r.down(u),d&&(s?.(),s=void 0,n-=1,n>0?a():r.down([[c]]))})};return a(),()=>{s?.()}},h(t))}function ut(o,e){return y([o],(t,r)=>{let n=t[0];if(n==null||n.length===0){r.down([[g]]);return}for(let s of n)r.emit(s)},h(e))}function en(o,e,t){return b(r=>{let n=o.subscribe(s=>{for(let a of s)if(a[0]===m)r.emit(a[1]);else if(a[0]===p)try{r.emit(e(a[1]))}catch(i){r.down([[p,i]])}else a[0]===c&&r.down([[c]])});return()=>{n()}},h(t))}function lt(o,e,t){return y([o,e],(r,n,s)=>{let a=r[1];if(!(a!=null&&a.length>0?a.at(-1):s.prevData[1])){n.down([[g]]);return}let d=r[0];if(d!=null&&d.length>0){for(let u of d)n.emit(u);return}if(a!=null&&a.length>0&&s.prevData[0]!==void 0){n.emit(s.prevData[0]);return}n.down([[g]])},ze(t))}var ct=Je,ft=Ze,pt=Qe,ht=en;0&&(module.exports={audit,buffer,bufferCount,bufferTime,catchError,combine,combineLatest,concat,concatMap,debounce,debounceTime,delay,distinctUntilChanged,elementAt,exhaustMap,filter,find,first,flatMap,interval,last,map,merge,mergeMap,onFirstData,pairwise,pausable,race,reduce,repeat,rescue,sample,scan,skip,switchMap,take,takeUntil,takeWhile,tap,tapFirst,throttle,throttleTime,timeout,valve,window,windowCount,windowTime,withLatestFrom,zip});
|
package/dist/extra/operators.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
1
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-JJTF75VS.js";import"../chunk-4VVTGLXJ.js";import"../chunk-MQZWA3DF.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{G as audit,I as buffer,J as bufferCount,L as bufferTime,W as catchError,r as combine,T as combineLatest,v as concat,z as concatMap,D as debounce,U as debounceTime,C as delay,p as distinctUntilChanged,l as elementAt,y as exhaustMap,b as filter,k as find,i as first,B as flatMap,O as interval,j as last,a as map,t as merge,A as mergeMap,n as onFirstData,q as pairwise,Q as pausable,w as race,d as reduce,P as repeat,R as rescue,F as sample,c as scan,f as skip,x as switchMap,e as take,h as takeUntil,g as takeWhile,m as tap,o as tapFirst,E as throttle,V as throttleTime,H as timeout,S as valve,N as window,K as windowCount,M as windowTime,s as withLatestFrom,u as zip};
|
package/dist/extra/reactive.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var le=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Be=(r,e)=>{for(var n in e)le(r,n,{get:e[n],enumerable:!0})},We=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Pe(e))!Ue.call(r,i)&&i!==n&&le(r,i,{get:()=>e[i],enumerable:!(t=He(e,i))||t.enumerable});return r};var $e=r=>We(le({},"__esModule",{value:!0}),r);var fn={};Be(fn,{NativeIndexBackend:()=>re,NativeListBackend:()=>ie,NativeLogBackend:()=>se,NativeMapBackend:()=>oe,reactiveIndex:()=>dn,reactiveList:()=>un,reactiveLog:()=>cn,reactiveMap:()=>hn});module.exports=$e(fn);var K=0,U=!1,S=[],V=[],z=[],B=[];function xe(){return K>0||U}function Te(){return K>0}function ke(r){K>0?B.push(r):r()}function N(r){K+=1;let e=!1;try{r()}catch(n){throw e=!0,n}finally{if(K-=1,K===0)if(e){if(!U){let n=B.splice(0);for(let t of n)try{t()}catch{}S.length=0,V.length=0,z.length=0}}else je()}}function je(){let r=!U;r&&(U=!0);let e=[],n=0;try{for(;S.length>0||V.length>0||z.length>0||r&&B.length>0;){if(r&&B.length>0){let s=B.splice(0);for(let o of s)try{o()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw S.length=0,V.length=0,z.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let i=(S.length>0?S:V.length>0?V:z).splice(0);for(let s of i)try{s()}catch(o){e.push(o)}}}finally{r&&(U=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function Z(r,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!xe()){r(e);return}(d>=5?z:d===4?V:S).push(()=>r(e));return}let t=e.length,i=t,s=t,o=t,a=0;for(;a<t&&n(e[a][0])<3;)a++;for(i=a;a<t&&n(e[a][0])===3;)a++;for(s=a;a<t&&n(e[a][0])===4;)a++;o=a;let u=xe();if(i>0){let d=e.slice(0,i);r(d)}if(s>i){let d=e.slice(i,s);u?S.push(()=>r(d)):r(d)}if(o>s){let d=e.slice(s,o);u?V.push(()=>r(d)):r(d)}if(t>o){let d=e.slice(o,t);u?z.push(()=>r(d)):r(d)}}var W=Symbol.for("graphrefly/START"),b=Symbol.for("graphrefly/DATA"),x=Symbol.for("graphrefly/DIRTY"),O=Symbol.for("graphrefly/RESOLVED"),I=Symbol.for("graphrefly/INVALIDATE"),D=Symbol.for("graphrefly/PAUSE"),$=Symbol.for("graphrefly/RESUME"),A=Symbol.for("graphrefly/TEARDOWN"),C=Symbol.for("graphrefly/COMPLETE"),T=Symbol.for("graphrefly/ERROR"),F=Object.freeze([x]),ce=Object.freeze([O]),qe=Object.freeze([I]),he=Object.freeze([W]),Ye=Object.freeze([C]),Je=Object.freeze([A]),fe=Object.freeze([F]),Me=Object.freeze([ce]),Ne=Object.freeze([qe]),Ae=Object.freeze([Ye]),pe=Object.freeze([Je]);var Xe={name:"json",version:1,contentType:"application/json",encode(r){let e=JSON.stringify(r);return new TextEncoder().encode(e)},decode(r,e){let n=new TextDecoder().decode(r);return JSON.parse(n)}};function Re(r){r.registerCodec(Xe)}var Ze={type:"system",id:""};function Q(r){if(r==null)return Ze;let{type:e,id:n,...t}=r;return{type:e??"system",id:n??"",...t}}function j(){return Math.trunc(performance.now()*1e6)}function Ee(){return Date.now()*1e6}var ee=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let t=this._messageTypes.get(n);return t!=null?t.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}};function Se(r){r.registerMessageType(W,{tier:0,wireCrossing:!1}),r.registerMessageType(x,{tier:1,wireCrossing:!1}),r.registerMessageType(I,{tier:1,wireCrossing:!1,metaPassthrough:!1}),r.registerMessageType(D,{tier:2,wireCrossing:!1}),r.registerMessageType($,{tier:2,wireCrossing:!1}),r.registerMessageType(b,{tier:3,wireCrossing:!0}),r.registerMessageType(O,{tier:3,wireCrossing:!0}),r.registerMessageType(C,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(T,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(A,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var L=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}};function _e(r){if(r===void 0)return null;if(typeof r=="number"){if(!Number.isFinite(r))throw new TypeError(`Cannot hash non-finite number: ${r}`);if(Number.isInteger(r)&&!Number.isSafeInteger(r))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${r}. Cross-language cid parity is not guaranteed for unsafe integers.`);return r}if(typeof r=="string"||typeof r=="boolean"||r===null)return r;if(Array.isArray(r))return r.map(_e);if(typeof r=="object"&&r!==null){let e={};for(let n of Object.keys(r).sort())e[n]=_e(r[n]);return e}return null}var Qe=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),en=new TextEncoder;function nn(r){let e=en.encode(r),n=e.length,t=n*8,i=n+9+63&-64,s=new Uint8Array(i);s.set(e),s[n]=128;let o=new DataView(s.buffer);o.setUint32(i-4,t>>>0,!1),o.setUint32(i-8,Math.floor(t/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,h=2773480762,y=1359893119,p=2600822924,c=528734635,l=1541459225,f=new Uint32Array(64),_=(m,v)=>m>>>v|m<<32-v;for(let m=0;m<i;m+=64){for(let w=0;w<16;w++)f[w]=o.getUint32(m+w*4,!1);for(let w=16;w<64;w++){let H=f[w-15],P=f[w-2],X=_(H,7)^_(H,18)^H>>>3,ue=_(P,17)^_(P,19)^P>>>10;f[w]=f[w-16]+X+f[w-7]+ue>>>0}let v=a,E=u,k=d,ae=h,M=y,Y=p,J=c,de=l;for(let w=0;w<64;w++){let H=_(M,6)^_(M,11)^_(M,25),P=M&Y^~M&J,X=de+H+P+Qe[w]+f[w]>>>0,ue=_(v,2)^_(v,13)^_(v,22),Le=v&E^v&k^E&k,Ge=ue+Le>>>0;de=J,J=Y,Y=M,M=ae+X>>>0,ae=k,k=E,E=v,v=X+Ge>>>0}a=a+v>>>0,u=u+E>>>0,d=d+k>>>0,h=h+ae>>>0,y=y+M>>>0,p=p+Y>>>0,c=c+J>>>0,l=l+de>>>0}let g=m=>m.toString(16).padStart(8,"0");return g(a)+g(u)+g(d)+g(h)+g(y)+g(p)+g(c)+g(l)}function ge(r){let e=_e(r??null),n=JSON.stringify(e);return nn(n).slice(0,16)}function tn(){let r=globalThis.crypto;if(r?.randomUUID)return r.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function ye(r,e,n){let t=n?.id??tn();if(r===0)return{id:t,version:0};let s=(n?.hash??ge)(e);return{id:t,version:0,cid:s,prev:null}}function Ve(r,e,n){r.version+=1,"cid"in r&&(r.prev=r.cid,r.cid=n(e))}var Oe=()=>{},Ie=100;function De(r){return{node:r,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function me(r){r.prevData=void 0,r.dirty=!1,r.involvedThisWave=!1,r.dataBatch.length=0,r.terminal=void 0}function ne(r){return r.length===0?r:typeof r[0]=="symbol"?[r]:r}var rn=(r,e,n,t)=>{n.direction==="down-in"&&r._onDepMessage(n.depIndex,e)},sn=(r,e,n,t)=>{let i=r;if(i._status==="completed"||i._status==="errored")return;let s=i._cached,o=s===void 0?[he]:[he,[b,s]];i._status==="dirty"&&o.push(F),Z(e,o,i._config.tierOf)},ve=new ee({onMessage:rn,onSubscribe:sn});Se(ve);Re(ve);var te=class r{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,t){this._config=t.config??ve,this._config.onMessage,this._optsName=t.name,this._describeKind=t.describeKind,this._equals=t.equals??Object.is,this._resubscribable=t.resubscribable??!1,this._resetOnTeardown=t.resetOnTeardown??!1,this._autoComplete=t.completeWhenDepsComplete??!0,this._autoError=t.errorWhenDepsError??!0,this._pausable=t.pausable??!0,this._guard=t.guard,this._fn=n,this._partial=t.partial??!1,this._cached=t.initial!==void 0?t.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=t.versioningHash??this._config.defaultHashFn??ge;let i=t.versioning??this._config.defaultVersioning;this._versioningLevel=i,this._versioning=i!=null?ye(i,this._cached===void 0?void 0:this._cached,{id:t.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(De);let s={};for(let[a,u]of Object.entries(t.meta??{})){let d={initial:u,name:`${t.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};t.guard!=null&&(d.guard=t.guard),s[a]=new r([],void 0,d)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let o=this;this._actions={emit(a){o._emit([[b,a]])},down(a){o._emit(ne(a))},up(a){o._emitUp(ne(a))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let t=this._versioningLevel;if(t!=null&&e<=t)return;let i=n?.hash??this._hashFn;i!==this._hashFn&&(this._hashFn=i);let s=this._cached===void 0?void 0:this._cached,o=this._versioning,a=o?.id??n?.id,u=o?.version??0,d=ye(e,s,{id:a,hash:i});d.version=u,this._versioning=d,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=Q(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let t of this._extraGuards)if(!t(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,t=e?.actor!=null;if(!n&&!t)return;let i=Q(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(i,s))throw new L({actor:i,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let o of this._extraGuards)if(!o(i,s))throw new L({actor:i,action:s,nodeName:this.name})}this._lastMutation={actor:i,timestamp_ns:Ee()}}down(e,n){let t=ne(e);t.length!==0&&(this._checkGuard(n),this._emit(t))}emit(e,n){this._checkGuard(n),this._emit([[b,e]])}up(e,n){if(this._deps.length===0)return;let t=ne(e);if(t.length===0)return;this._checkGuard(n);let i=n??{internal:!0};this._validateUpTiers(t);for(let s of this._deps)s.node.up?.(t,i)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let t of e){let i=n(t[0]);if(i===3||i===4)throw new Error(`Node "${this.name}": tier-${i} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let u=Q(n);if(!this._guard(u,"observe"))throw new L({actor:u,action:"observe",nodeName:this.name})}let i=this._isTerminal&&this._resubscribable;if(i){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let u of this._deps)me(u);if(this._partial===!1){for(let u of this._deps)if(u.prevData!==void 0||u.dataBatch.length!==0||u.terminal!==void 0||u.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let s;try{s=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:i},this._actions)}catch(u){throw this._sinkCount-=1,u}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let o=this._isTerminal;if(this._sinkCount===1&&!o)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof s=="function")try{s()}catch{}throw u}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let a=!1;return()=>{a||(a=!0,this._sinkCount-=1,this._removeSink(e),typeof s=="function"&&s(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let t=0;t<e;t++){let i=t,s=this._deps[t];s.unsub=Oe,s.unsub=s.node.subscribe(o=>{if(s.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of o)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:i},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(t){this._deps[n].unsub=null;for(let i=0;i<n;i++){let s=this._deps[i];if(s.unsub!=null){let o=s.unsub;s.unsub=null;try{o()}catch{}me(s)}}throw this._dirtyDepCount=0,t}}_addDep(e){for(let i=0;i<this._deps.length;i++)if(this._deps[i].node===e)return i;let n=this._deps.length,t=De(e);if(this._deps.push(t),this._sinks==null)return n;t.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(fe),t.unsub=Oe;try{t.unsub=e.subscribe(i=>{if(t.unsub===null)return;let s=this._config.tierOf,o=!1;for(let a of i)s(a[0])>=3&&(o=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);o&&this._maybeRunFnOnSettlement()})}catch(i){throw t.unsub=null,this._deps.pop(),this._dirtyDepCount--,i}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(t){this._emit([[T,this._wrapFnError("cleanup threw",t)]])}else if(n!=null&&typeof n=="object"){let t=n.deactivate;if(typeof t=="function")try{t()}catch(i){this._emit([[T,this._wrapFnError("cleanup.deactivate threw",i)]])}}for(let t of this._deps){if(t.unsub!=null){let i=t.unsub;t.unsub=null;try{i()}catch{}}me(t)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let t=this._deps[e],i=n[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:n};for(let o of this._inspectorHooks)o(s)}if(i!==W){if(i===x){this._depDirtied(t);return}if(i===I){if(this._depInvalidated(t),this._cached===void 0)return;this._emit(Ne);return}if(i===D||i===$){this._emit([n]);return}if(i===A){this._emit(pe);return}if(i===b)this._depSettledAsData(t,n[1]);else if(i===O)this._depSettledAsResolved(t);else if(i===C)this._depSettledAsTerminal(t,!0);else if(i===T)this._depSettledAsTerminal(t,n[1]);else{this._emit([n]);return}if(!this._fn){(i===b||i===O)&&this._emit([n]),(i===C||i===T)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(fe))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Me),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[T,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ae)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(o){this._emit([[T,this._wrapFnError("cleanup threw",o)]]);return}}else if(e!=null&&typeof e=="object"){let o=e.beforeRun;if(typeof o=="function"){e.beforeRun=void 0;try{o()}catch(a){this._emit([[T,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(o=>o.involvedThisWave?o.dataBatch.length>0?[...o.dataBatch]:[]:void 0),t=this._deps.map(o=>o.prevData);for(let o=0;o<this._deps.length;o++){let a=n[o];a!=null&&a.length>0&&(this._deps[o].prevData=a[a.length-1])}let i=this._deps.map(o=>o.terminal),s={prevData:t,terminalDeps:i,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let o={kind:"run",batchData:n,prevData:t};for(let a of this._inspectorHooks)a(o)}this._isExecutingFn=!0;try{let o=this._fn(n,this._actions,s);if(typeof o=="function")this._cleanup=o;else if(o!=null&&typeof o=="object"){let a=o;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=o)}}catch(o){this._emit([[T,this._wrapFnError("fn threw",o)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>Ie?(this._rerunDepth=0,this._emit([[T,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${Ie} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let t=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${t}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[F,e[0]]:e;let t=!0,i=!1,s=!1,o=-1;for(let u of e){let d=n(u[0]);d<o&&(t=!1),d===3&&(i=!0),u[0]===x&&(s=!0),o=d}let a=e;if(!t){let u=e.map((d,h)=>({m:d,i:h,tier:n(d[0])}));u.sort((d,h)=>d.tier-h.tier||d.i-h.i),a=u.map(d=>d.m)}if(i&&!s&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[F,...a]:[...a.slice(0,u),F,...a.slice(u)]}return a}_emit(e){if(e.length===0)return;for(let a=0;a<e.length;a++){let u=e[a];if(u[0]===T&&u[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===A||u[0]===I);if(a.length===0)return;n=a}n=this._frameBatch(n);let i=null;for(let a=0;a<n.length;a++){let u=n[a],d=u[0];if(d!==D&&d!==$){i?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===D?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let h=!0;if(this._pausable!==!1){let y=u[1];if(d===D)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(y),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(y))h=!1;else if(this._pauseLocks.delete(y),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let p=this._pauseBuffer;this._pauseBuffer=[],this._emit(p)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}h?i?.push(u):i==null&&(i=n.slice(0,a))}if(i!=null){if(i.length===0)return;n=i}if(this._hasMeta&&n.some(a=>a[0]===A))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(pe)}catch{}let{finalMessages:s,equalsError:o}=this._updateState(n);if(s.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:s})}catch{}}if(s.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of s)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(s);o!=null&&this._emit([[T,o]])}_updateState(e){let n=this._config.tierOf,t,i,s=-1,o=0;for(let h of e)n(h[0])===3&&o++;let a=o<=1,u=-1;if(this._versioning!=null&&o>1){for(let h=e.length-1;h>=0;h--)if(e[h][0]===b){u=h;break}}for(let h=0;h<e.length;h++){let y=e[h],p=y[0];if(p===b){if(y.length>=2){let c=!1;if(a&&this._cached!==void 0)try{c=this._equals(this._cached,y[1])}catch(l){i=this._wrapFnError("equals threw",l),s=h;break}if(c){t==null&&(t=e.slice(0,h)),t.push(ce),this._status="resolved";continue}this._cached=y[1],this._versioning!=null&&(u<0||h===u)&&Ve(this._versioning,y[1],this._hashFn)}this._status="settled",t?.push(y)}else if(t?.push(y),p===x)this._status="dirty";else if(p===O)this._status="resolved";else if(p===C){this._status="completed";{let c=this._config.rigorRecorder;if(c!=null)try{c.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===T){this._status="errored";{let c=this._config.rigorRecorder;if(c!=null)try{c.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(p===I){if(this._cached!==void 0){let l=this._config.rigorRecorder;if(l!=null)try{l.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let c=this._cleanup;if(typeof c=="function"){this._cleanup=void 0;try{c()}catch{}}else if(c!=null&&typeof c=="object"){let l=c.invalidate;if(typeof l=="function")try{l()}catch{}}}else p===A&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=s>=0?t??e.slice(0,s):t??e;return i!=null?{finalMessages:d,equalsError:i}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let t of n)t(e)};_dispatchOrAccumulate(e){if(Te()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ke(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}Z(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);Z(this._deliverToSinks,n,this._config.tierOf)}},Ce=r=>Array.isArray(r),be=r=>typeof r=="object"&&r!=null&&!Array.isArray(r);function we(r,e,n){let t=Ce(r)?r:[],i=typeof r=="function"?r:typeof e=="function"?e:void 0,s={};return Ce(r)?s=(be(e)?e:n)??{}:be(r)?s=r:s=(be(e)?e:n)??{},new te(t,i,s)}function R(r,e){return we([],{...e,initial:r})}function q(r,e,n){return we(r,(i,s,o)=>{let a=i.map((u,d)=>u!=null&&u.length>0?u.at(-1):o.prevData[d]);s.emit(e(a,o))},{describeKind:"derived",...n})}function Ke(r,e){if(r===e)return 0;let n=typeof r;if(n===typeof e&&(n==="number"||n==="string"||n==="boolean"||n==="bigint")){let i=r,s=e;return i<s?-1:i>s?1:0}return String(r).localeCompare(String(e))}function on(r,e){let n=Ke(r[0],e[0]);return n!==0?n:Ke(r[1],e[1])}function ze(r){return[r.secondary,r.primary]}function G(r,e){let n=ze(e),t=0,i=r.length;for(;t<i;){let s=t+i>>1;on(n,ze(r[s]))>0?t=s+1:i=s}return t}var re=class{_version=0;_buf=[];_byPrimary=new Map;get version(){return this._version}get size(){return this._buf.length}has(e){return this._byPrimary.has(e)}get(e){return this._byPrimary.get(e)?.value}upsert(e,n,t,i){let s=this._byPrimary.get(e),o={primary:e,secondary:n,value:t};if(s!==void 0&&i?.equals?.(s,o))return!1;if(s!==void 0){let u=G(this._buf,s);this._buf.splice(u,1)}let a=G(this._buf,o);return this._buf.splice(a,0,o),this._byPrimary.set(e,o),this._version+=1,s===void 0}upsertMany(e,n){let t=0;try{for(let i of e){let s=this._byPrimary.get(i.primary),o={primary:i.primary,secondary:i.secondary,value:i.value};if(s!==void 0&&n?.equals?.(s,o))continue;if(s!==void 0){let u=G(this._buf,s);this._buf.splice(u,1)}let a=G(this._buf,o);this._buf.splice(a,0,o),this._byPrimary.set(i.primary,o),t+=1}}finally{t>0&&(this._version+=1)}return t}delete(e){let n=this._byPrimary.get(e);if(n===void 0)return!1;let t=G(this._buf,n);return this._buf.splice(t,1),this._byPrimary.delete(e),this._version+=1,!0}deleteMany(e){let n=0;try{for(let t of e){let i=this._byPrimary.get(t);if(i===void 0)continue;let s=G(this._buf,i);this._buf.splice(s,1),this._byPrimary.delete(t),n+=1}}finally{n>0&&(this._version+=1)}return n}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._byPrimary.clear(),this._version+=1,e)}toArray(){return[...this._buf]}toPrimaryMap(){let e=new Map;for(let n of this._buf)e.set(n.primary,n.value);return e}};function an(r){return r.subscribe(()=>{})}function dn(r={}){let{name:e,versioning:n,equals:t,backend:i}=r,s=i??new re;function o(c){return c?.equals!==void 0||t===void 0?c:{...c,equals:t}}let a=R([],{name:e,describeKind:"state",equals:(c,l)=>c===l,...n!=null?{versioning:n}:{}}),u=q([a],([c])=>{let l=c,f=new Map;for(let _ of l)f.set(_.primary,_.value);return f},{initial:s.toPrimaryMap(),describeKind:"derived"}),d=an(u),h=!1;function y(){let c=s.toArray();N(()=>{a.down([[x]]),a.down([[b,c]])})}function p(c){let l=s.version;try{return c()}finally{s.version!==l&&y()}}return{ordered:a,byPrimary:u,has(c){return s.has(c)},get(c){return s.get(c)},get size(){return s.size},upsert(c,l,f,_){return p(()=>s.upsert(c,l,f,o(_)))},upsertMany(c,l){let f=[...c];f.length!==0&&p(()=>s.upsertMany(f,o(l)))},delete(c){p(()=>s.delete(c))},deleteMany(c){let l=[...c];l.length!==0&&p(()=>s.deleteMany(l))},clear(){p(()=>s.clear())},dispose(){h||(h=!0,d())}}}var ie=class{_version=0;_buf;constructor(e){this._buf=e?[...e]:[]}get version(){return this._version}get size(){return this._buf.length}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._buf.length+e;if(!(n<0||n>=this._buf.length))return this._buf[n]}append(e){this._buf.push(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._buf.length;this._buf.length=n+e.length;for(let t=0;t<e.length;t++)this._buf[n+t]=e[t];this._version+=1}insert(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insert: index ${e} out of range [0, ${this._buf.length}]`);this._buf.splice(e,0,n),this._version+=1}insertMany(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insertMany: index ${e} out of range [0, ${this._buf.length}]`);n.length!==0&&(this._buf.splice(e,0,...n),this._version+=1)}pop(e){if(this._buf.length===0)throw new RangeError("pop from empty list");if(!Number.isInteger(e))throw new RangeError(`pop: index ${e} must be an integer`);let n=e>=0?e:this._buf.length+e;if(n<0||n>=this._buf.length)throw new RangeError(`pop: index ${e} out of range`);let[t]=this._buf.splice(n,1);return this._version+=1,t}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._version+=1,e)}toArray(){return[...this._buf]}};function un(r,e={}){let{name:n,versioning:t,backend:i}=e,s=i??new ie(r),o=R(s.toArray(),{name:n,describeKind:"state",equals:(d,h)=>d===h,...t!=null?{versioning:t}:{}});function a(){let d=s.toArray();N(()=>{o.down([[x]]),o.down([[b,d]])})}function u(d){let h=s.version;try{return d()}finally{s.version!==h&&a()}}return{items:o,get size(){return s.size},at(d){return s.at(d)},append(d){u(()=>s.append(d))},appendMany(d){u(()=>s.appendMany(d))},insert(d,h){u(()=>s.insert(d,h))},insertMany(d,h){u(()=>s.insertMany(d,h))},pop(d=-1){return u(()=>s.pop(d))},clear(){u(()=>s.clear())},dispose(){}}}var se=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(e,n){if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=n,n!==void 0){if(this._buf=new Array(n),e&&e.length>0){let t=Math.min(e.length,n),i=e.length-t;for(let s=0;s<t;s++)this._buf[s]=e[i+s];this._size=t}}else this._buf=e?[...e]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._size+e;if(!(n<0||n>=this._size))return this._maxSize!==void 0?this._buf[(this._head+n)%this._maxSize]:this._buf[n]}append(e){this._rawAppend(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._maxSize!==void 0&&e.length>this._maxSize?e.length-this._maxSize:0;for(let t=n;t<e.length;t++)this._rawAppend(e[t]);this._version+=1}clear(){if(this._size===0)return 0;let e=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let n=0;n<e;n++)this._buf[(this._head+n)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,e}trimHead(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return 0;let n=Math.min(e,this._size);if(this._maxSize===void 0)this._buf.splice(0,n);else{for(let t=0;t<n;t++)this._buf[(this._head+t)%this._maxSize]=void 0;this._head=(this._head+n)%this._maxSize}return this._size-=n,this._version+=1,n}slice(e,n){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(n!==void 0&&(!Number.isInteger(n)||n<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${n})`);let t=n===void 0?this._size:Math.min(Math.max(n,0),this._size),i=Math.min(e,this._size);if(i>=t)return[];let s=t-i;if(this._maxSize===void 0)return this._buf.slice(i,t);let o=new Array(s);for(let a=0;a<s;a++)o[a]=this._buf[(this._head+i+a)%this._maxSize];return o}tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return[];let n=Math.min(e,this._size);return this.slice(this._size-n,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this._buf[(this._head+n)%this._maxSize];return e}_rawAppend(e){if(this._maxSize===void 0){this._buf.push(e),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=e,this._size+=1):(this._buf[this._head]=e,this._head=(this._head+1)%this._maxSize)}};function Fe(r){return r.subscribe(()=>{})}var ln=64;function cn(r,e={}){let{name:n,maxSize:t,versioning:i,backend:s}=e,o=s??new se(r,t),a=R(o.toArray(),{name:n,describeKind:"state",equals:(l,f)=>l===f,...i!=null?{versioning:i}:{}});function u(){let l=o.toArray();N(()=>{a.down([[x]]),a.down([[b,l]])})}let d=new Map,h=new Map;function y(l,f){return`${l}:${f===void 0?"END":f}`}function p(l){if(l.size<ln)return;let f=l.keys().next();if(f.done)return;let _=l.get(f.value);_!==void 0&&_.dispose(),l.delete(f.value)}function c(l){let f=o.version;try{return l()}finally{o.version!==f&&u()}}return{entries:a,get size(){return o.size},at(l){return o.at(l)},append(l){c(()=>o.append(l))},appendMany(l){l.length!==0&&c(()=>o.appendMany(l))},clear(){c(()=>o.clear())},trimHead(l){c(()=>o.trimHead(l))},tail(l){if(!Number.isInteger(l)||l<0)throw new RangeError(`tail: n must be a non-negative integer (got ${l})`);let f=d.get(l);if(f!==void 0)return d.delete(l),d.set(l,f),f.node;p(d);let _=q([a],([m])=>{let v=m;return l===0||v.length===0?[]:v.slice(Math.max(0,v.length-l))},{initial:o.tail(l),describeKind:"derived"}),g=Fe(_);return d.set(l,{node:_,dispose:g}),_},slice(l,f){if(!Number.isInteger(l)||l<0)throw new RangeError(`slice: start must be a non-negative integer (got ${l})`);if(f!==void 0&&(!Number.isInteger(f)||f<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${f})`);let _=y(l,f),g=h.get(_);if(g!==void 0)return h.delete(_),h.set(_,g),g.node;p(h);let m=q([a],([E])=>{let k=E;return f===void 0?k.slice(l):k.slice(l,f)},{initial:o.slice(l,f),describeKind:"derived"}),v=Fe(m);return h.set(_,{node:m,dispose:v}),m},disposeTail(l){let f=d.get(l);return f===void 0?!1:(f.dispose(),d.delete(l),!0)},disposeSlice(l,f){let _=y(l,f),g=h.get(_);return g===void 0?!1:(g.dispose(),h.delete(_),!0)},disposeAllViews(){for(let l of d.values())l.dispose();d.clear();for(let l of h.values())l.dispose();h.clear()},dispose(){for(let l of d.values())l.dispose();d.clear();for(let l of h.values())l.dispose();h.clear()}}}var oe=class{_version=0;_store=new Map;_maxSize;_defaultTtl;constructor(e={}){let{maxSize:n,defaultTtl:t}=e;if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(t!==void 0&&t<=0)throw new RangeError("defaultTtl must be positive");this._maxSize=n,this._defaultTtl=t}get version(){return this._version}get size(){return this._store.size}has(e){let n=this._store.get(e);return n===void 0?!1:this._isExpired(n)?(this._store.delete(e),this._version+=1,!1):(this._touchLru(e,n),!0)}get(e){let n=this._store.get(e);if(n!==void 0){if(this._isExpired(n)){this._store.delete(e),this._version+=1;return}return this._touchLru(e,n),n.value}}set(e,n,t){let i=this._resolveExpiresAt(t);this._store.has(e)&&this._store.delete(e),this._store.set(e,{value:n,expiresAt:i}),this._evictLruWhileOver(),this._version+=1}setMany(e,n){let t=this._resolveExpiresAt(n),i=0;try{for(let[s,o]of e)this._store.has(s)&&this._store.delete(s),this._store.set(s,{value:o,expiresAt:t}),i+=1}finally{i>0&&(this._evictLruWhileOver(),this._version+=1)}}delete(e){let n=this._store.delete(e);return n&&(this._version+=1),n}deleteMany(e){let n=0;try{for(let t of e)this._store.delete(t)&&(n+=1)}finally{n>0&&(this._version+=1)}return n}clear(){let e=this._store.size;return e===0?0:(this._store.clear(),this._version+=1,e)}pruneExpired(){let e=j(),n=0;for(let[t,i]of this._store)this._isExpired(i,e)&&(this._store.delete(t),n+=1);return n>0&&(this._version+=1),n}toMap(){let e=j(),n=new Map;for(let[t,i]of this._store)this._isExpired(i,e)||n.set(t,i.value);return n}_resolveExpiresAt(e){let n=e??this._defaultTtl;if(n!==void 0){if(!Number.isFinite(n)||n<=0)throw new RangeError(`MapBackend: ttl must be a positive finite number (got ${n})`);return j()+n*1e9}}_isExpired(e,n){return e.expiresAt===void 0?!1:(n??j())>=e.expiresAt}_touchLru(e,n){this._store.delete(e),this._store.set(e,n)}_evictLruWhileOver(){if(this._maxSize!==void 0)for(;this._store.size>this._maxSize;){let e=this._store.keys().next().value;if(e===void 0)break;this._store.delete(e)}}};function hn(r={}){let{name:e,maxSize:n,defaultTtl:t,versioning:i,backend:s,retention:o}=r;if(o&&n!==void 0)throw new RangeError("reactiveMap: `maxSize` (LRU) and `retention` (score-based) are mutually exclusive. Pick one eviction policy.");if(o&&o.archiveThreshold===void 0&&o.maxSize===void 0)throw new RangeError("reactiveMap: `retention` requires at least one of `archiveThreshold` or `maxSize` to trigger archival.");let a=s??new oe({maxSize:n,defaultTtl:t}),u=R(a.toMap(),{name:e,describeKind:"state",equals:(p,c)=>p===c,...i!=null?{versioning:i}:{}});function d(){let p=a.toMap();N(()=>{u.down([[x]]),u.down([[b,p]])})}function h(){if(!o)return;let p=a.toMap(),c=o.archiveThreshold,l=o.maxSize,f=[];for(let[g,m]of p)f.push({key:g,value:m,score:o.score(g,m)});f.sort((g,m)=>g.score-m.score);let _=new Set;if(c!==void 0)for(let g of f)if(g.score<c)_.add(g.key);else break;if(l!==void 0&&f.length-_.size>l)for(let g of f){if(f.length-_.size<=l)break;_.has(g.key)||_.add(g.key)}if(_.size!==0)for(let g of f)_.has(g.key)&&(o.onArchive?.(g.key,g.value,g.score),a.delete(g.key))}function y(p,c="mutation"){let l=a.version;try{return p()}finally{a.version!==l&&(c==="mutation"&&h(),d())}}return{entries:u,has(p){return y(()=>a.has(p),"read")},get(p){return y(()=>a.get(p),"read")},set(p,c,l){y(()=>a.set(p,c,l?.ttl))},setMany(p,c){y(()=>a.setMany(p,c?.ttl))},delete(p){y(()=>a.delete(p))},deleteMany(p){y(()=>a.deleteMany(p))},clear(){y(()=>a.clear())},pruneExpired(){y(()=>a.pruneExpired())},get size(){return a.size},dispose(){}}}0&&(module.exports={NativeIndexBackend,NativeListBackend,NativeLogBackend,NativeMapBackend,reactiveIndex,reactiveList,reactiveLog,reactiveMap});
|
|
1
|
+
"use strict";var ge=Object.defineProperty;var nn=Object.getOwnPropertyDescriptor;var tn=Object.getOwnPropertyNames;var rn=Object.prototype.hasOwnProperty;var O=(r,e)=>()=>(r&&(e=r(r=0)),e);var on=(r,e)=>{for(var n in e)ge(r,n,{get:e[n],enumerable:!0})},sn=(r,e,n,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of tn(e))!rn.call(r,i)&&i!==n&&ge(r,i,{get:()=>e[i],enumerable:!(t=nn(e,i))||t.enumerable});return r};var an=r=>sn(ge({},"__esModule",{value:!0}),r);function Oe(){return j>0||ee}function Ve(){return j>0}function Ce(r){j>0?ne.push(r):r()}function K(r){j+=1;let e=!1;try{r()}catch(n){throw e=!0,n}finally{if(j-=1,j===0)if(e){if(!ee){let n=ne.splice(0);for(let t of n)try{t()}catch{}P.length=0,G.length=0,q.length=0}}else dn()}}function dn(){let r=!ee;r&&(ee=!0);let e=[],n=0;try{for(;P.length>0||G.length>0||q.length>0||r&&ne.length>0;){if(r&&ne.length>0){let o=ne.splice(0);for(let a of o)try{a()}catch(s){e.push(s)}continue}if(n+=1,n>1e3)throw P.length=0,G.length=0,q.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let i=(P.length>0?P:G.length>0?G:q).splice(0);for(let o of i)try{o()}catch(a){e.push(a)}}}finally{r&&(ee=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function de(r,e,n){if(e.length===0)return;if(e.length===1){let u=n(e[0][0]);if(u<3||!Oe()){r(e);return}(u>=5?q:u===4?G:P).push(()=>r(e));return}let t=e.length,i=t,o=t,a=t,s=0;for(;s<t&&n(e[s][0])<3;)s++;for(i=s;s<t&&n(e[s][0])===3;)s++;for(o=s;s<t&&n(e[s][0])===4;)s++;a=s;let d=Oe();if(i>0){let u=e.slice(0,i);r(u)}if(o>i){let u=e.slice(i,o);d?P.push(()=>r(u)):r(u)}if(a>o){let u=e.slice(o,a);d?G.push(()=>r(u)):r(u)}if(t>a){let u=e.slice(a,t);d?q.push(()=>r(u)):r(u)}}var j,ee,P,G,q,ne,Y=O(()=>{"use strict";j=0,ee=!1,P=[],G=[],q=[],ne=[]});var te,k,R,I,H,B,re,z,D,N,J,ye,un,_e,ln,cn,ve,Ie,De,Le,Te,U=O(()=>{"use strict";te=Symbol.for("graphrefly/START"),k=Symbol.for("graphrefly/DATA"),R=Symbol.for("graphrefly/DIRTY"),I=Symbol.for("graphrefly/RESOLVED"),H=Symbol.for("graphrefly/INVALIDATE"),B=Symbol.for("graphrefly/PAUSE"),re=Symbol.for("graphrefly/RESUME"),z=Symbol.for("graphrefly/TEARDOWN"),D=Symbol.for("graphrefly/COMPLETE"),N=Symbol.for("graphrefly/ERROR"),J=Object.freeze([R]),ye=Object.freeze([I]),un=Object.freeze([H]),_e=Object.freeze([te]),ln=Object.freeze([D]),cn=Object.freeze([z]),ve=Object.freeze([J]),Ie=Object.freeze([ye]),De=Object.freeze([un]),Le=Object.freeze([ln]),Te=Object.freeze([cn])});function Ke(r){r.registerCodec(fn)}var fn,ze=O(()=>{"use strict";fn={name:"json",version:1,contentType:"application/json",encode(r){let e=JSON.stringify(r);return new TextEncoder().encode(e)},decode(r,e){let n=new TextDecoder().decode(r);return JSON.parse(n)}}});function ue(r){if(r==null)return hn;let{type:e,id:n,...t}=r;return{type:e??"system",id:n??"",...t}}var hn,Fe=O(()=>{"use strict";hn={type:"system",id:""}});function ie(){return Math.trunc(performance.now()*1e6)}function Pe(){return Date.now()*1e6}var we=O(()=>{"use strict"});function Ge(r){r.registerMessageType(te,{tier:0,wireCrossing:!1}),r.registerMessageType(R,{tier:1,wireCrossing:!1}),r.registerMessageType(H,{tier:1,wireCrossing:!1,metaPassthrough:!1}),r.registerMessageType(B,{tier:2,wireCrossing:!1}),r.registerMessageType(re,{tier:2,wireCrossing:!1}),r.registerMessageType(k,{tier:3,wireCrossing:!0}),r.registerMessageType(I,{tier:3,wireCrossing:!0}),r.registerMessageType(D,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(N,{tier:4,wireCrossing:!0,metaPassthrough:!1}),r.registerMessageType(z,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var le,He=O(()=>{"use strict";U();le=class{_messageTypes=new Map;_codecs=new Map;_onMessage;_onSubscribe;_defaultVersioning;_defaultHashFn;_inspectorEnabled=!(typeof process<"u"&&process.env?.NODE_ENV==="production");_globalInspector;_rigorRecorder;_frozen=!1;tierOf;constructor(e){this._onMessage=e.onMessage,this._onSubscribe=e.onSubscribe,this._defaultVersioning=e.defaultVersioning,this._defaultHashFn=e.defaultHashFn,this.tierOf=n=>{let t=this._messageTypes.get(n);return t!=null?t.tier:1}}get onMessage(){return this._frozen=!0,this._onMessage}get onSubscribe(){return this._frozen=!0,this._onSubscribe}set onMessage(e){this._assertUnfrozen(),this._onMessage=e}set onSubscribe(e){this._assertUnfrozen(),this._onSubscribe=e}get defaultVersioning(){return this._defaultVersioning}set defaultVersioning(e){this._assertUnfrozen(),this._defaultVersioning=e}get defaultHashFn(){return this._defaultHashFn}set defaultHashFn(e){this._assertUnfrozen(),this._defaultHashFn=e}get inspectorEnabled(){return this._inspectorEnabled}set inspectorEnabled(e){this._inspectorEnabled=e}get globalInspector(){return this._globalInspector}set globalInspector(e){this._globalInspector=e}get rigorRecorder(){return this._rigorRecorder}set rigorRecorder(e){this._rigorRecorder=e}registerMessageType(e,n){return this._assertUnfrozen(),this._messageTypes.set(e,{tier:n.tier,wireCrossing:n.wireCrossing??n.tier>=3,metaPassthrough:n.metaPassthrough??!0}),this}messageTier(e){let n=this._messageTypes.get(e);return n!=null?n.tier:1}isWireCrossing(e){let n=this._messageTypes.get(e);return n!=null?n.wireCrossing:!0}isLocalOnly(e){return!this.isWireCrossing(e)}isMetaPassthrough(e){let n=this._messageTypes.get(e);return n!=null?n.metaPassthrough:!0}isKnownMessageType(e){return this._messageTypes.has(e)}registerCodec(e){return this._assertUnfrozen(),this._codecs.set(e.name,e),this}lookupCodec(e){return this._codecs.get(e)}_isFrozen(){return this._frozen}_assertUnfrozen(){if(this._frozen)throw new Error("GraphReFlyConfig is frozen: a node has already captured this config. Register custom types and set hooks before creating any node.")}}});var X,Be=O(()=>{"use strict";X=class extends Error{actor;action;nodeName;constructor(e,n){super(n??`GuardDenied: action "${String(e.action)}" denied for actor type "${String(e.actor.type)}"`),this.name="GuardDenied",this.actor=e.actor,this.action=e.action,this.nodeName=e.nodeName}get node(){return this.nodeName}}});function xe(r){if(r===void 0)return null;if(typeof r=="number"){if(!Number.isFinite(r))throw new TypeError(`Cannot hash non-finite number: ${r}`);if(Number.isInteger(r)&&!Number.isSafeInteger(r))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${r}. Cross-language cid parity is not guaranteed for unsafe integers.`);return r}if(typeof r=="string"||typeof r=="boolean"||r===null)return r;if(Array.isArray(r))return r.map(xe);if(typeof r=="object"&&r!==null){let e={};for(let n of Object.keys(r).sort())e[n]=xe(r[n]);return e}return null}function bn(r){let e=mn.encode(r),n=e.length,t=n*8,i=n+9+63&-64,o=new Uint8Array(i);o.set(e),o[n]=128;let a=new DataView(o.buffer);a.setUint32(i-4,t>>>0,!1),a.setUint32(i-8,Math.floor(t/4294967296)>>>0,!1);let s=1779033703,d=3144134277,u=1013904242,c=2773480762,p=1359893119,h=2600822924,f=528734635,m=1541459225,y=new Uint32Array(64),w=(E,M)=>E>>>M|E<<32-M;for(let E=0;E<i;E+=64){for(let g=0;g<16;g++)y[g]=a.getUint32(E+g*4,!1);for(let g=16;g<64;g++){let x=y[g-15],A=y[g-2],S=w(x,7)^w(x,18)^x>>>3,Q=w(A,17)^w(A,19)^A>>>10;y[g]=y[g-16]+S+y[g-7]+Q>>>0}let M=s,V=d,C=u,W=c,l=p,b=h,v=f,T=m;for(let g=0;g<64;g++){let x=w(l,6)^w(l,11)^w(l,25),A=l&b^~l&v,S=T+x+A+pn[g]+y[g]>>>0,Q=w(M,2)^w(M,13)^w(M,22),F=M&V^M&C^V&C,en=Q+F>>>0;T=v,v=b,b=l,l=W+S>>>0,W=C,C=V,V=M,M=S+en>>>0}s=s+M>>>0,d=d+V>>>0,u=u+C>>>0,c=c+W>>>0,p=p+l>>>0,h=h+b>>>0,f=f+v>>>0,m=m+T>>>0}let _=E=>E.toString(16).padStart(8,"0");return _(s)+_(d)+_(u)+_(c)+_(p)+_(h)+_(f)+_(m)}function ke(r){let e=xe(r??null),n=JSON.stringify(e);return bn(n).slice(0,16)}function gn(){let r=globalThis.crypto;if(r?.randomUUID)return r.randomUUID();let e=()=>Math.floor(Math.random()*4294967296).toString(16).padStart(8,"0"),n=e()+e()+e()+e();return`${n.slice(0,8)}-${n.slice(8,12)}-4${n.slice(13,16)}-${(parseInt(n.slice(16,17),16)&3|8).toString(16)}${n.slice(17,20)}-${n.slice(20,32)}`}function Ne(r,e,n){let t=n?.id??gn();if(r===0)return{id:t,version:0};let o=(n?.hash??ke)(e);return{id:t,version:0,cid:o,prev:null}}function Ue(r,e,n){r.version+=1,"cid"in r&&(r.prev=r.cid,r.cid=n(e))}var pn,mn,$e=O(()=>{"use strict";pn=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),mn=new TextEncoder});function qe(r){return{node:r,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Me(r){r.prevData=void 0,r.dirty=!1,r.involvedThisWave=!1,r.dataBatch.length=0,r.terminal=void 0}function ce(r){return r.length===0?r:typeof r[0]=="symbol"?[r]:r}function oe(r,e,n){let t=Ye(r)?r:[],i=typeof r=="function"?r:typeof e=="function"?e:void 0,o={};return Ye(r)?o=(Ee(e)?e:n)??{}:Ee(r)?o=r:o=(Ee(e)?e:n)??{},new fe(t,i,o)}var We,je,yn,_n,Ae,fe,Ye,Ee,Re=O(()=>{"use strict";ze();Fe();Y();we();He();Be();U();$e();We=()=>{},je=100;yn=(r,e,n,t)=>{n.direction==="down-in"&&r._onDepMessage(n.depIndex,e)},_n=(r,e,n,t)=>{let i=r;if(i._status==="completed"||i._status==="errored")return;let o=i._cached,a=o===void 0?[_e]:[_e,[k,o]];i._status==="dirty"&&a.push(J),de(e,a,i._config.tierOf)},Ae=new le({onMessage:yn,onSubscribe:_n});Ge(Ae);Ke(Ae);fe=class r{_optsName;_describeKind;meta;_hasMeta;_config;_deps;_sinks=null;_sinkCount=0;_cached;_status;_cleanup;_store={};_waveHasNewData=!1;_hasNewTerminal=!1;_hasCalledFnOnce=!1;_paused=!1;_pendingWave=!1;_isExecutingFn=!1;_pendingRerun=!1;_rerunDepth=0;_dirtyDepCount=0;_batchPendingMessages=null;_pauseLocks=null;_pauseBuffer=null;_fn;_equals;_resubscribable;_resetOnTeardown;_autoComplete;_autoError;_pausable;_partial;_guard;_extraGuards;_hashFn;_versioning;_versioningLevel;_lastMutation;_inspectorHooks;_actions;constructor(e,n,t){this._config=t.config??Ae,this._config.onMessage,this._optsName=t.name,this._describeKind=t.describeKind,this._equals=t.equals??Object.is,this._resubscribable=t.resubscribable??!1,this._resetOnTeardown=t.resetOnTeardown??!1,this._autoComplete=t.completeWhenDepsComplete??!0,this._autoError=t.errorWhenDepsError??!0,this._pausable=t.pausable??!0,this._guard=t.guard,this._fn=n,this._partial=t.partial??!1,this._cached=t.initial!==void 0?t.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=t.versioningHash??this._config.defaultHashFn??ke;let i=t.versioning??this._config.defaultVersioning;this._versioningLevel=i,this._versioning=i!=null?Ne(i,this._cached===void 0?void 0:this._cached,{id:t.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(qe);let o={};for(let[s,d]of Object.entries(t.meta??{})){let u={initial:d,name:`${t.name??"node"}:meta:${s}`,describeKind:"state",config:this._config};t.guard!=null&&(u.guard=t.guard),o[s]=new r([],void 0,u)}Object.freeze(o),this.meta=o,this._hasMeta=Object.keys(o).length>0;let a=this;this._actions={emit(s){a._emit([[k,s]])},down(s){a._emit(ce(s))},up(s){a._emitUp(ce(s))}},this.down=this.down.bind(this),this.up=this.up.bind(this)}get _isTerminal(){return this._status==="completed"||this._status==="errored"}get name(){return this._optsName}get status(){return this._status}get cache(){return this._cached===void 0?void 0:this._cached}get lastMutation(){return this._lastMutation}get v(){return this._versioning}hasGuard(){return this._guard!=null}_applyVersioning(e,n){if(this._isExecutingFn)throw new Error(`Node "${this.name}": _applyVersioning cannot run mid-fn \u2014 call it outside of \`_execFn\` (typically at graph setup time before the first subscribe).`);let t=this._versioningLevel;if(t!=null&&e<=t)return;let i=n?.hash??this._hashFn;i!==this._hashFn&&(this._hashFn=i);let o=this._cached===void 0?void 0:this._cached,a=this._versioning,s=a?.id??n?.id,d=a?.version??0,u=Ne(e,o,{id:s,hash:i});u.version=d,this._versioning=u,this._versioningLevel=e}_setInspectorHook(e){return e==null?()=>{}:(this._inspectorHooks==null&&(this._inspectorHooks=new Set),this._inspectorHooks.add(e),()=>{this._inspectorHooks?.delete(e),this._inspectorHooks?.size===0&&(this._inspectorHooks=void 0)})}_pushGuard(e){return this._extraGuards==null&&(this._extraGuards=new Set),this._extraGuards.add(e),()=>{this._extraGuards?.delete(e),this._extraGuards?.size===0&&(this._extraGuards=void 0)}}allowsObserve(e){if(this._guard==null&&this._extraGuards==null)return!0;let n=ue(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let t of this._extraGuards)if(!t(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,t=e?.actor!=null;if(!n&&!t)return;let i=ue(e?.actor),o=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(i,o))throw new X({actor:i,action:o,nodeName:this.name});if(this._extraGuards!=null){for(let a of this._extraGuards)if(!a(i,o))throw new X({actor:i,action:o,nodeName:this.name})}this._lastMutation={actor:i,timestamp_ns:Pe()}}down(e,n){let t=ce(e);t.length!==0&&(this._checkGuard(n),this._emit(t))}emit(e,n){this._checkGuard(n),this._emit([[k,e]])}up(e,n){if(this._deps.length===0)return;let t=ce(e);if(t.length===0)return;this._checkGuard(n);let i=n??{internal:!0};this._validateUpTiers(t);for(let o of this._deps)o.node.up?.(t,i)}_emitUp(e){if(this._deps.length!==0&&e.length!==0){this._validateUpTiers(e);for(let n of this._deps)n.node.up?.(e,{internal:!0})}}_validateUpTiers(e){let n=this._config.tierOf;for(let t of e){let i=n(t[0]);if(i===3||i===4)throw new Error(`Node "${this.name}": tier-${i} messages cannot flow up \u2014 DATA/RESOLVED/COMPLETE/ERROR are downstream-only. Use \`down(...)\` for value delivery; \`up(...)\` is for control signals (DIRTY, INVALIDATE, PAUSE, RESUME, TEARDOWN).`)}}subscribe(e,n){if(n!=null&&this._guard!=null){let d=ue(n);if(!this._guard(d,"observe"))throw new X({actor:d,action:"observe",nodeName:this.name})}let i=this._isTerminal&&this._resubscribable;if(i){this._cached=void 0,this._status="sentinel",this._store={},this._hasCalledFnOnce=!1,this._waveHasNewData=!1,this._hasNewTerminal=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._isExecutingFn=!1,this._rerunDepth=0,this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null;for(let d of this._deps)Me(d);if(this._partial===!1){for(let d of this._deps)if(d.prevData!==void 0||d.dataBatch.length!==0||d.terminal!==void 0||d.dirty)throw new Error(`resubscribable-reset invariant: DepRecord not fully reset for node ${this._optsName??"(anonymous)"}`)}}this._sinkCount+=1;let o;try{o=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:i},this._actions)}catch(d){throw this._sinkCount-=1,d}this._sinks==null?this._sinks=e:typeof this._sinks=="function"?this._sinks=new Set([this._sinks,e]):this._sinks.add(e);let a=this._isTerminal;if(this._sinkCount===1&&!a)try{this._activate()}catch(d){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof o=="function")try{o()}catch{}throw d}this._status==="sentinel"&&this._cached===void 0&&(this._status="pending");let s=!1;return()=>{s||(s=!0,this._sinkCount-=1,this._removeSink(e),typeof o=="function"&&o(),this._sinks==null&&this._deactivate())}}_removeSink(e){if(this._sinks===e)this._sinks=null;else if(this._sinks!=null&&typeof this._sinks!="function")if(this._sinks.delete(e),this._sinks.size===1){let[n]=this._sinks;this._sinks=n}else this._sinks.size===0&&(this._sinks=null)}_activate(){if(this._deps.length===0){this._fn&&this._execFn();return}this._dirtyDepCount=0;let e=this._deps.length,n=0;try{for(let t=0;t<e;t++){let i=t,o=this._deps[t];o.unsub=We,o.unsub=o.node.subscribe(a=>{if(o.unsub===null)return;let s=this._config.tierOf,d=!1;for(let u of a)s(u[0])>=3&&(d=!0),this._config.onMessage(this,u,{direction:"down-in",depIndex:i},this._actions);d&&this._maybeRunFnOnSettlement()}),n++}}catch(t){this._deps[n].unsub=null;for(let i=0;i<n;i++){let o=this._deps[i];if(o.unsub!=null){let a=o.unsub;o.unsub=null;try{a()}catch{}Me(o)}}throw this._dirtyDepCount=0,t}}_addDep(e){for(let i=0;i<this._deps.length;i++)if(this._deps[i].node===e)return i;let n=this._deps.length,t=qe(e);if(this._deps.push(t),this._sinks==null)return n;t.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ve),t.unsub=We;try{t.unsub=e.subscribe(i=>{if(t.unsub===null)return;let o=this._config.tierOf,a=!1;for(let s of i)o(s[0])>=3&&(a=!0),this._config.onMessage(this,s,{direction:"down-in",depIndex:n},this._actions);a&&this._maybeRunFnOnSettlement()})}catch(i){throw t.unsub=null,this._deps.pop(),this._dirtyDepCount--,i}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(t){this._emit([[N,this._wrapFnError("cleanup threw",t)]])}else if(n!=null&&typeof n=="object"){let t=n.deactivate;if(typeof t=="function")try{t()}catch(i){this._emit([[N,this._wrapFnError("cleanup.deactivate threw",i)]])}}for(let t of this._deps){if(t.unsub!=null){let i=t.unsub;t.unsub=null;try{i()}catch{}}Me(t)}this._waveHasNewData=!1,this._hasNewTerminal=!1,this._hasCalledFnOnce=!1,this._paused=!1,this._pendingWave=!1,this._pendingRerun=!1,this._rerunDepth=0,this._store={},this._dirtyDepCount=0,this._pauseLocks=null,this._pauseBuffer=null,this._fn!=null&&(this._cached=void 0),e||(this._fn!=null||this._deps.length>0)&&(!this._isTerminal||this._resubscribable)&&(this._status="sentinel")}_onDepMessage(e,n){let t=this._deps[e],i=n[0];if(this._inspectorHooks!=null){let o={kind:"dep_message",depIndex:e,message:n};for(let a of this._inspectorHooks)a(o)}if(i!==te){if(i===R){this._depDirtied(t);return}if(i===H){if(this._depInvalidated(t),this._cached===void 0)return;this._emit(De);return}if(i===B||i===re){this._emit([n]);return}if(i===z){this._emit(Te);return}if(i===k)this._depSettledAsData(t,n[1]);else if(i===I)this._depSettledAsResolved(t);else if(i===D)this._depSettledAsTerminal(t,!0);else if(i===N)this._depSettledAsTerminal(t,n[1]);else{this._emit([n]);return}if(!this._fn){(i===k||i===I)&&this._emit([n]),(i===D||i===N)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(ve))}_depSettledAsData(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.involvedThisWave=!0,e.dataBatch.push(n),this._waveHasNewData=!0}_depSettledAsResolved(e){e.dirty&&(e.dirty=!1,this._dirtyDepCount--)}_depSettledAsTerminal(e,n){e.dirty&&(e.dirty=!1,this._dirtyDepCount--),e.terminal=n,e.involvedThisWave=!0,this._hasNewTerminal=!0}_depInvalidated(e){e.prevData=void 0,e.terminal=void 0,e.dataBatch.length=0,e.dirty?e.involvedThisWave=!1:(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++)}_maybeRunFnOnSettlement(){if(!(this._isTerminal&&!this._resubscribable)&&!(this._dirtyDepCount>0)){if(!this._partial&&!this._hasCalledFnOnce)for(let e=0;e<this._deps.length;e++){let n=this._deps[e];if(n.dataBatch.length===0&&n.prevData===void 0&&n.terminal===void 0){this._maybeAutoTerminalAfterWave();return}}if(this._paused){this._pendingWave=!0;return}if(!this._waveHasNewData&&!this._hasNewTerminal&&this._hasCalledFnOnce){this._clearWaveFlags(),this._emit(Ie),this._maybeAutoTerminalAfterWave();return}this._fn&&this._execFn(),this._maybeAutoTerminalAfterWave()}}_maybeAutoTerminalAfterWave(){if(this._deps.length===0||this._isTerminal)return;let e=this._deps.find(n=>n.terminal!==void 0&&n.terminal!==!0);if(e!=null){this._autoError&&this._emit([[N,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Le)}_execFn(){if(!this._fn||this._isTerminal&&!this._resubscribable)return;if(this._isExecutingFn){this._pendingRerun=!0;return}let e=this._cleanup;if(typeof e=="function"){this._cleanup=void 0;try{e()}catch(a){this._emit([[N,this._wrapFnError("cleanup threw",a)]]);return}}else if(e!=null&&typeof e=="object"){let a=e.beforeRun;if(typeof a=="function"){e.beforeRun=void 0;try{a()}catch(s){this._emit([[N,this._wrapFnError("cleanup.beforeRun threw",s)]]);return}}}let n=this._deps.map(a=>a.involvedThisWave?a.dataBatch.length>0?[...a.dataBatch]:[]:void 0),t=this._deps.map(a=>a.prevData);for(let a=0;a<this._deps.length;a++){let s=n[a];s!=null&&s.length>0&&(this._deps[a].prevData=s[s.length-1])}let i=this._deps.map(a=>a.terminal),o={prevData:t,terminalDeps:i,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let a={kind:"run",batchData:n,prevData:t};for(let s of this._inspectorHooks)s(a)}this._isExecutingFn=!0;try{let a=this._fn(n,this._actions,o);if(typeof a=="function")this._cleanup=a;else if(a!=null&&typeof a=="object"){let s=a;(typeof s.beforeRun=="function"||typeof s.deactivate=="function"||typeof s.invalidate=="function")&&(this._cleanup=a)}}catch(a){this._emit([[N,this._wrapFnError("fn threw",a)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>je?(this._rerunDepth=0,this._emit([[N,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${je} \u2014 likely a reactive cycle`)]])):this._maybeRunFnOnSettlement()):this._rerunDepth=0,this._clearWaveFlags()}}_clearWaveFlags(){this._waveHasNewData=!1,this._hasNewTerminal=!1;for(let e of this._deps)e.involvedThisWave=!1,e.dataBatch.length=0}_wrapFnError(e,n){let t=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${t}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[J,e[0]]:e;let t=!0,i=!1,o=!1,a=-1;for(let d of e){let u=n(d[0]);u<a&&(t=!1),u===3&&(i=!0),d[0]===R&&(o=!0),a=u}let s=e;if(!t){let d=e.map((u,c)=>({m:u,i:c,tier:n(u[0])}));d.sort((u,c)=>u.tier-c.tier||u.i-c.i),s=d.map(u=>u.m)}if(i&&!o&&this._status!=="dirty"){let d=0;for(;d<s.length&&n(s[d][0])===0;)d++;return d===0?[J,...s]:[...s.slice(0,d),J,...s.slice(d)]}return s}_emit(e){if(e.length===0)return;for(let s=0;s<e.length;s++){let d=e[s];if(d[0]===N&&d[1]===void 0)throw new TypeError('[ERROR, payload] requires a non-undefined payload (spec \xA71.2). Pass an Error object or domain tag instead \u2014 e.g. node.down([[ERROR, new Error("reason")]])')}let n=e;if(this._isTerminal&&!this._resubscribable){let s=e.filter(d=>d[0]===z||d[0]===H);if(s.length===0)return;n=s}n=this._frameBatch(n);let i=null;for(let s=0;s<n.length;s++){let d=n[s],u=d[0];if(u!==B&&u!==re){i?.push(d);continue}if(d.length<2)throw new Error(`Node "${this.name}": [[${u===B?"PAUSE":"RESUME"}]] must carry a lockId payload \u2014 bare PAUSE/RESUME is a protocol violation (C0 rule). Use \`[[PAUSE, lockId]]\` / \`[[RESUME, lockId]]\`.`);let c=!0;if(this._pausable!==!1){let p=d[1];if(u===B)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(p),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(p))c=!1;else if(this._pauseLocks.delete(p),this._pauseLocks.size===0){if(this._paused=!1,this._pauseBuffer!=null&&this._pauseBuffer.length>0){let h=this._pauseBuffer;this._pauseBuffer=[],this._emit(h)}this._pendingWave&&(this._pendingWave=!1,this._maybeRunFnOnSettlement())}}c?i?.push(d):i==null&&(i=n.slice(0,s))}if(i!=null){if(i.length===0)return;n=i}if(this._hasMeta&&n.some(s=>s[0]===z))for(let s of Object.keys(this.meta))try{this.meta[s]._emit(Te)}catch{}let{finalMessages:o,equalsError:a}=this._updateState(n);if(o.length>0&&this._config.inspectorEnabled){let s=this._config.globalInspector;if(s!=null)try{s({kind:"emit",node:this,messages:o})}catch{}}if(o.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let s=this._config.tierOf,d=[];for(let u of o)s(u[0])===3?this._pauseBuffer.push(u):d.push(u);d.length>0&&this._dispatchOrAccumulate(d)}else this._dispatchOrAccumulate(o);a!=null&&this._emit([[N,a]])}_updateState(e){let n=this._config.tierOf,t,i,o=-1,a=0;for(let c of e)n(c[0])===3&&a++;let s=a<=1,d=-1;if(this._versioning!=null&&a>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===k){d=c;break}}for(let c=0;c<e.length;c++){let p=e[c],h=p[0];if(h===k){if(p.length>=2){let f=!1;if(s&&this._cached!==void 0)try{f=this._equals(this._cached,p[1])}catch(m){i=this._wrapFnError("equals threw",m),o=c;break}if(f){t==null&&(t=e.slice(0,c)),t.push(ye),this._status="resolved";continue}this._cached=p[1],this._versioning!=null&&(d<0||c===d)&&Ue(this._versioning,p[1],this._hashFn)}this._status="settled",t?.push(p)}else if(t?.push(p),h===R)this._status="dirty";else if(h===I)this._status="resolved";else if(h===D){this._status="completed";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(h===N){this._status="errored";{let f=this._config.rigorRecorder;if(f!=null)try{f.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(h===H){if(this._cached!==void 0){let m=this._config.rigorRecorder;if(m!=null)try{m.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let f=this._cleanup;if(typeof f=="function"){this._cleanup=void 0;try{f()}catch{}}else if(f!=null&&typeof f=="object"){let m=f.invalidate;if(typeof m=="function")try{m()}catch{}}}else h===z&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let u=o>=0?t??e.slice(0,o):t??e;return i!=null?{finalMessages:u,equalsError:i}:{finalMessages:u}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let t of n)t(e)};_dispatchOrAccumulate(e){if(Ve()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],Ce(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}de(this._deliverToSinks,e,this._config.tierOf)}_flushBatchPending(){let e=this._batchPendingMessages;if(e===null||(this._batchPendingMessages=null,e.length===0))return;let n=this._frameBatch(e);de(this._deliverToSinks,n,this._config.tierOf)}},Ye=r=>Array.isArray(r),Ee=r=>typeof r=="object"&&r!=null&&!Array.isArray(r)});function L(r,e){return oe([],{...e,initial:r})}function $(r,e,n){return oe(r,(i,o,a)=>{let s=i.map((d,u)=>d!=null&&d.length>0?d.at(-1):a.prevData[u]);o.emit(e(s,a))},{describeKind:"derived",...n})}var se=O(()=>{"use strict";Re()});function Ze(r){return r.subscribe(()=>{})}var Qe=O(()=>{"use strict"});var An={};on(An,{NativeIndexBackend:()=>he,NativeListBackend:()=>pe,NativeLogBackend:()=>me,NativeMapBackend:()=>be,mergeReactiveLogs:()=>Mn,reactiveIndex:()=>wn,reactiveList:()=>xn,reactiveLog:()=>Nn,reactiveMap:()=>En});module.exports=an(An);Y();U();se();function Je(r,e){if(r===e)return 0;let n=typeof r;if(n===typeof e&&(n==="number"||n==="string"||n==="boolean"||n==="bigint")){let i=r,o=e;return i<o?-1:i>o?1:0}return String(r).localeCompare(String(e))}function vn(r,e){let n=Je(r[0],e[0]);return n!==0?n:Je(r[1],e[1])}function Xe(r){return[r.secondary,r.primary]}function Z(r,e){let n=Xe(e),t=0,i=r.length;for(;t<i;){let o=t+i>>1;vn(n,Xe(r[o]))>0?t=o+1:i=o}return t}var he=class{_version=0;_buf=[];_byPrimary=new Map;get version(){return this._version}get size(){return this._buf.length}has(e){return this._byPrimary.has(e)}get(e){return this._byPrimary.get(e)?.value}upsert(e,n,t,i){let o=this._byPrimary.get(e),a={primary:e,secondary:n,value:t};if(o!==void 0&&i?.equals?.(o,a))return!1;if(o!==void 0){let d=Z(this._buf,o);this._buf.splice(d,1)}let s=Z(this._buf,a);return this._buf.splice(s,0,a),this._byPrimary.set(e,a),this._version+=1,o===void 0}upsertMany(e,n){let t=0;try{for(let i of e){let o=this._byPrimary.get(i.primary),a={primary:i.primary,secondary:i.secondary,value:i.value};if(o!==void 0&&n?.equals?.(o,a))continue;if(o!==void 0){let d=Z(this._buf,o);this._buf.splice(d,1)}let s=Z(this._buf,a);this._buf.splice(s,0,a),this._byPrimary.set(i.primary,a),t+=1}}finally{t>0&&(this._version+=1)}return t}delete(e){let n=this._byPrimary.get(e);if(n===void 0)return!1;let t=Z(this._buf,n);return this._buf.splice(t,1),this._byPrimary.delete(e),this._version+=1,!0}deleteMany(e){let n=0;try{for(let t of e){let i=this._byPrimary.get(t);if(i===void 0)continue;let o=Z(this._buf,i);this._buf.splice(o,1),this._byPrimary.delete(t),n+=1}}finally{n>0&&(this._version+=1)}return n}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._byPrimary.clear(),this._version+=1,e)}toArray(){return[...this._buf]}toPrimaryMap(){let e=new Map;for(let n of this._buf)e.set(n.primary,n.value);return e}};function Tn(r){return r.subscribe(()=>{})}function wn(r={}){let{name:e,versioning:n,equals:t,backend:i}=r,o=i??new he;function a(f){return f?.equals!==void 0||t===void 0?f:{...f,equals:t}}let s=L([],{name:e,describeKind:"state",equals:(f,m)=>f===m,...n!=null?{versioning:n}:{}}),d=$([s],([f])=>{let m=f,y=new Map;for(let w of m)y.set(w.primary,w.value);return y},{initial:o.toPrimaryMap(),describeKind:"derived"}),u=Tn(d),c=!1;function p(){let f=o.toArray();K(()=>{s.down([[R]]),s.down([[k,f]])})}function h(f){let m=o.version;try{return f()}finally{o.version!==m&&p()}}return{ordered:s,byPrimary:d,has(f){return o.has(f)},get(f){return o.get(f)},get size(){return o.size},upsert(f,m,y,w){return h(()=>o.upsert(f,m,y,a(w)))},upsertMany(f,m){let y=[...f];y.length!==0&&h(()=>o.upsertMany(y,a(m)))},delete(f){h(()=>o.delete(f))},deleteMany(f){let m=[...f];m.length!==0&&h(()=>o.deleteMany(m))},clear(){h(()=>o.clear())},dispose(){c||(c=!0,u())}}}Y();U();se();var pe=class{_version=0;_buf;constructor(e){this._buf=e?[...e]:[]}get version(){return this._version}get size(){return this._buf.length}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._buf.length+e;if(!(n<0||n>=this._buf.length))return this._buf[n]}append(e){this._buf.push(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._buf.length;this._buf.length=n+e.length;for(let t=0;t<e.length;t++)this._buf[n+t]=e[t];this._version+=1}insert(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insert: index ${e} out of range [0, ${this._buf.length}]`);this._buf.splice(e,0,n),this._version+=1}insertMany(e,n){if(!Number.isInteger(e)||e<0||e>this._buf.length)throw new RangeError(`insertMany: index ${e} out of range [0, ${this._buf.length}]`);n.length!==0&&(this._buf.splice(e,0,...n),this._version+=1)}pop(e){if(this._buf.length===0)throw new RangeError("pop from empty list");if(!Number.isInteger(e))throw new RangeError(`pop: index ${e} must be an integer`);let n=e>=0?e:this._buf.length+e;if(n<0||n>=this._buf.length)throw new RangeError(`pop: index ${e} out of range`);let[t]=this._buf.splice(n,1);return this._version+=1,t}clear(){let e=this._buf.length;return e===0?0:(this._buf.length=0,this._version+=1,e)}toArray(){return[...this._buf]}};function xn(r,e={}){let{name:n,versioning:t,backend:i}=e,o=i??new pe(r),a=L(o.toArray(),{name:n,describeKind:"state",equals:(u,c)=>u===c,...t!=null?{versioning:t}:{}});function s(){let u=o.toArray();K(()=>{a.down([[R]]),a.down([[k,u]])})}function d(u){let c=o.version;try{return u()}finally{o.version!==c&&s()}}return{items:a,get size(){return o.size},at(u){return o.at(u)},append(u){d(()=>o.append(u))},appendMany(u){d(()=>o.appendMany(u))},insert(u,c){d(()=>o.insert(u,c))},insertMany(u,c){d(()=>o.insertMany(u,c))},pop(u=-1){return d(()=>o.pop(u))},clear(){d(()=>o.clear())},dispose(){}}}Y();U();Re();se();Qe();var me=class{_version=0;_maxSize;_buf;_head=0;_size=0;constructor(e,n){if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(this._maxSize=n,n!==void 0){if(this._buf=new Array(n),e&&e.length>0){let t=Math.min(e.length,n),i=e.length-t;for(let o=0;o<t;o++)this._buf[o]=e[i+o];this._size=t}}else this._buf=e?[...e]:[],this._size=this._buf.length}get version(){return this._version}get size(){return this._size}at(e){if(!Number.isInteger(e))return;let n=e>=0?e:this._size+e;if(!(n<0||n>=this._size))return this._maxSize!==void 0?this._buf[(this._head+n)%this._maxSize]:this._buf[n]}append(e){this._rawAppend(e),this._version+=1}appendMany(e){if(e.length===0)return;let n=this._maxSize!==void 0&&e.length>this._maxSize?e.length-this._maxSize:0;for(let t=n;t<e.length;t++)this._rawAppend(e[t]);this._version+=1}clear(){if(this._size===0)return 0;let e=this._size;if(this._maxSize===void 0)this._buf.length=0;else for(let n=0;n<e;n++)this._buf[(this._head+n)%this._maxSize]=void 0;return this._head=0,this._size=0,this._version+=1,e}trimHead(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`trimHead: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return 0;let n=Math.min(e,this._size);if(this._maxSize===void 0)this._buf.splice(0,n);else{for(let t=0;t<n;t++)this._buf[(this._head+t)%this._maxSize]=void 0;this._head=(this._head+n)%this._maxSize}return this._size-=n,this._version+=1,n}slice(e,n){if(!Number.isInteger(e)||e<0)throw new RangeError(`slice: start must be a non-negative integer (got ${e})`);if(n!==void 0&&(!Number.isInteger(n)||n<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${n})`);let t=n===void 0?this._size:Math.min(Math.max(n,0),this._size),i=Math.min(e,this._size);if(i>=t)return[];let o=t-i;if(this._maxSize===void 0)return this._buf.slice(i,t);let a=new Array(o);for(let s=0;s<o;s++)a[s]=this._buf[(this._head+i+s)%this._maxSize];return a}tail(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`tail: n must be a non-negative integer (got ${e})`);if(e===0||this._size===0)return[];let n=Math.min(e,this._size);return this.slice(this._size-n,this._size)}toArray(){if(this._maxSize===void 0)return[...this._buf];let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this._buf[(this._head+n)%this._maxSize];return e}snapshot(){return this.toArray()}restore(e){if(this._maxSize===void 0){this._buf.length=0;for(let n=0;n<e.length;n++)this._buf.push(e[n]);this._size=this._buf.length}else{let n=this._maxSize;for(let o=0;o<n;o++)this._buf[o]=void 0;this._head=0;let t=Math.min(e.length,n),i=e.length-t;for(let o=0;o<t;o++)this._buf[o]=e[i+o];this._size=t}this._version+=1}_rawAppend(e){if(this._maxSize===void 0){this._buf.push(e),this._size=this._buf.length;return}this._size<this._maxSize?(this._buf[(this._head+this._size)%this._maxSize]=e,this._size+=1):(this._buf[this._head]=e,this._head=(this._head+1)%this._maxSize)}};function ae(r){return r.subscribe(()=>{})}var kn=64;function Nn(r,e={}){let{name:n,maxSize:t,versioning:i,guard:o,backend:a}=e,s=a??new me(r,t),d=L(s.toArray(),{name:n,describeKind:"state",equals:(l,b)=>l===b,...i!=null?{versioning:i}:{},...o!=null?{guard:o}:{}});function u(){let l=s.toArray();K(()=>{d.down([[R]],{internal:!0}),d.down([[k,l]],{internal:!0})})}let c=new Map,p=new Map,h=new Map;function f(l,b){return`${l}:${b===void 0?"END":b}`}function m(l){if(l.size<kn)return;let b=l.keys().next();if(b.done)return;let v=l.get(b.value);v!==void 0&&v.dispose(),l.delete(b.value)}function y(l){let b=s.version;try{return l()}finally{s.version!==b&&u()}}function w(l){if(!Number.isInteger(l)||l<0)throw new RangeError(`tail: n must be a non-negative integer (got ${l})`);let b=c.get(l);if(b!==void 0)return c.delete(l),c.set(l,b),b.node;m(c);let v=$([d],([g])=>{let x=g;return l===0||x.length===0?[]:x.slice(Math.max(0,x.length-l))},{initial:s.tail(l),describeKind:"derived"}),T=ae(v);return c.set(l,{node:v,dispose:T}),v}function _(l,b){if(!Number.isInteger(l)||l<0)throw new RangeError(`slice: start must be a non-negative integer (got ${l})`);if(b!==void 0&&(!Number.isInteger(b)||b<0))throw new RangeError(`slice: stop must be a non-negative integer or undefined (got ${b})`);let v=f(l,b),T=p.get(v);if(T!==void 0)return p.delete(v),p.set(v,T),T.node;m(p);let g=$([d],([A])=>{let S=A;return b===void 0?S.slice(l):S.slice(l,b)},{initial:s.slice(l,b),describeKind:"derived"}),x=ae(g);return p.set(v,{node:g,dispose:x}),g}function E(l){let b=h.get(l);if(b!==void 0)return b.node;let v=$([d,l],([g,x])=>{let A=g,S=Math.max(0,Math.trunc(x??0));return A.slice(S)},{initial:[],describeKind:"derived"}),T=ae(v);return h.set(l,{node:v,dispose:T}),v}let M,V;function C(){M===void 0&&(M=oe([d],(l,b,v)=>{let T=l[0],x=T!=null&&T.length>0?T.at(-1):v.prevData[0];if(x==null||x.length===0){b.down([[I]]);return}b.emit(x[x.length-1])},{name:n!=null?`${n}::lastValue`:"lastValue",describeKind:"derived",initial:s.size===0?void 0:s.at(s.size-1)}),V=$([d],([l])=>l.length>0,{name:n!=null?`${n}::hasLatest`:"hasLatest",describeKind:"derived",initial:s.size>0}),ae(M),ae(V))}let W={entries:d,get size(){return s.size},at(l){return s.at(l)},append(l){y(()=>s.append(l))},appendMany(l){l.length!==0&&y(()=>s.appendMany(l))},clear(){y(()=>s.clear())},trimHead(l){y(()=>s.trimHead(l))},withLatest(){return C(),d},get lastValue(){return C(),M},get hasLatest(){return C(),V},view(l){switch(l.kind){case"tail":return w(l.n);case"slice":return _(l.start,l.stop);case"fromCursor":return E(l.cursor)}},attach(l){let b=l.subscribe(v=>{for(let T of v)T[0]===k&&W.append(T[1])});return()=>b()},attachStorage(l){if(l.length===0)return()=>{};let b=new Map;for(let T of l)b.set(T,s.size);(async()=>{for(let T of l)if(typeof T.loadEntries=="function")try{let g=await Promise.resolve(T.loadEntries());g.entries.length>0&&s.size===0&&(s.restore(g.entries),b.set(T,g.entries.length),u());break}catch{}})();let v=d.subscribe(T=>{for(let g of T){if(g[0]!==k)continue;let x=g[1];for(let A of l){let S=b.get(A)??0;if(x.length<S){try{let F=A.appendEntries(x);F instanceof Promise&&F.catch(()=>{})}catch{}b.set(A,x.length);continue}if(x.length===S)continue;let Q=x.slice(S);b.set(A,x.length);try{let F=A.appendEntries(Q);F instanceof Promise&&F.catch(()=>{})}catch{}}}});return()=>v()},disposeAllViews(){for(let l of c.values())l.dispose();c.clear();for(let l of p.values())l.dispose();p.clear();for(let l of h.values())l.dispose();h.clear()},dispose(){for(let l of c.values())l.dispose();c.clear();for(let l of p.values())l.dispose();p.clear();for(let l of h.values())l.dispose();h.clear()}};return W}var Se=new WeakMap;function Mn(r){let e=Se.get(r);if(e)return e;let n=r.map(c=>c.cache??[]),t=n.flat(),i=L(t,{name:"mergeReactiveLogs",describeKind:"state",equals:(c,p)=>c===p}),o=r.map((c,p)=>[...n[p]??[]]),a=[];for(let c=0;c<r.length;c++){let p=c,h=r[p].subscribe(f=>{for(let m of f)m[0]===k?(o[p]=[...m[1]],i.emit(o.flat())):m[0]===D?o[p]=[]:m[0]===N&&i.down([[N,m[1]]])});a.push(h)}let s=Ze(i),d=!1,u={node:i,dispose(){if(!d){d=!0;for(let c of a)c();a.length=0,s(),Se.delete(r)}}};return Se.set(r,u),u}Y();we();U();se();var be=class{_version=0;_store=new Map;_maxSize;_defaultTtl;constructor(e={}){let{maxSize:n,defaultTtl:t}=e;if(n!==void 0&&n<1)throw new RangeError("maxSize must be >= 1");if(t!==void 0&&t<=0)throw new RangeError("defaultTtl must be positive");this._maxSize=n,this._defaultTtl=t}get version(){return this._version}get size(){return this._store.size}has(e){let n=this._store.get(e);return n===void 0?!1:this._isExpired(n)?(this._store.delete(e),this._version+=1,!1):(this._touchLru(e,n),!0)}get(e){let n=this._store.get(e);if(n!==void 0){if(this._isExpired(n)){this._store.delete(e),this._version+=1;return}return this._touchLru(e,n),n.value}}set(e,n,t){let i=this._resolveExpiresAt(t);this._store.has(e)&&this._store.delete(e),this._store.set(e,{value:n,expiresAt:i}),this._evictLruWhileOver(),this._version+=1}setMany(e,n){let t=this._resolveExpiresAt(n),i=0;try{for(let[o,a]of e)this._store.has(o)&&this._store.delete(o),this._store.set(o,{value:a,expiresAt:t}),i+=1}finally{i>0&&(this._evictLruWhileOver(),this._version+=1)}}delete(e){let n=this._store.delete(e);return n&&(this._version+=1),n}deleteMany(e){let n=0;try{for(let t of e)this._store.delete(t)&&(n+=1)}finally{n>0&&(this._version+=1)}return n}clear(){let e=this._store.size;return e===0?0:(this._store.clear(),this._version+=1,e)}pruneExpired(){let e=ie(),n=0;for(let[t,i]of this._store)this._isExpired(i,e)&&(this._store.delete(t),n+=1);return n>0&&(this._version+=1),n}toMap(){let e=ie(),n=new Map;for(let[t,i]of this._store)this._isExpired(i,e)||n.set(t,i.value);return n}_resolveExpiresAt(e){let n=e??this._defaultTtl;if(n!==void 0){if(!Number.isFinite(n)||n<=0)throw new RangeError(`MapBackend: ttl must be a positive finite number (got ${n})`);return ie()+n*1e9}}_isExpired(e,n){return e.expiresAt===void 0?!1:(n??ie())>=e.expiresAt}_touchLru(e,n){this._store.delete(e),this._store.set(e,n)}_evictLruWhileOver(){if(this._maxSize!==void 0)for(;this._store.size>this._maxSize;){let e=this._store.keys().next().value;if(e===void 0)break;this._store.delete(e)}}};function En(r={}){let{name:e,maxSize:n,defaultTtl:t,versioning:i,backend:o,retention:a}=r;if(a&&n!==void 0)throw new RangeError("reactiveMap: `maxSize` (LRU) and `retention` (score-based) are mutually exclusive. Pick one eviction policy.");if(a&&a.archiveThreshold===void 0&&a.maxSize===void 0)throw new RangeError("reactiveMap: `retention` requires at least one of `archiveThreshold` or `maxSize` to trigger archival.");let s=o??new be({maxSize:n,defaultTtl:t}),d=L(s.toMap(),{name:e,describeKind:"state",equals:(h,f)=>h===f,...i!=null?{versioning:i}:{}});function u(){let h=s.toMap();K(()=>{d.down([[R]]),d.down([[k,h]])})}function c(){if(!a)return;let h=s.toMap(),f=a.archiveThreshold,m=a.maxSize,y=[];for(let[_,E]of h)y.push({key:_,value:E,score:a.score(_,E)});y.sort((_,E)=>_.score-E.score);let w=new Set;if(f!==void 0)for(let _ of y)if(_.score<f)w.add(_.key);else break;if(m!==void 0&&y.length-w.size>m)for(let _ of y){if(y.length-w.size<=m)break;w.has(_.key)||w.add(_.key)}if(w.size!==0)for(let _ of y)w.has(_.key)&&(a.onArchive?.(_.key,_.value,_.score),s.delete(_.key))}function p(h,f="mutation"){let m=s.version;try{return h()}finally{s.version!==m&&(f==="mutation"&&c(),u())}}return{entries:d,has(h){return p(()=>s.has(h),"read")},get(h){return p(()=>s.get(h),"read")},set(h,f,m){p(()=>s.set(h,f,m?.ttl))},setMany(h,f){p(()=>s.setMany(h,f?.ttl))},delete(h){p(()=>s.delete(h))},deleteMany(h){p(()=>s.deleteMany(h))},clear(){p(()=>s.clear())},pruneExpired(){p(()=>s.pruneExpired())},get size(){return s.size},dispose(){}}}0&&(module.exports={NativeIndexBackend,NativeListBackend,NativeLogBackend,NativeMapBackend,mergeReactiveLogs,reactiveIndex,reactiveList,reactiveLog,reactiveMap});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as Node, V as VersioningLevel } from '../node-
|
|
2
|
-
export { L as LogBackend, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, r as reactiveLog } from '../reactive-log-
|
|
3
|
-
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-
|
|
1
|
+
import { a as Node, V as VersioningLevel } from '../node-fSc-hCv8.cjs';
|
|
2
|
+
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-CgbNqksB.cjs';
|
|
3
|
+
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-DmgeADH8.cjs';
|
|
4
|
+
import './storage-tiers.cjs';
|
|
4
5
|
|
|
5
6
|
type IndexRow<K, V = unknown> = {
|
|
6
7
|
readonly primary: K;
|
package/dist/extra/reactive.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as Node, V as VersioningLevel } from '../node-
|
|
2
|
-
export { L as LogBackend, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, r as reactiveLog } from '../reactive-log-
|
|
3
|
-
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-
|
|
1
|
+
import { a as Node, V as VersioningLevel } from '../node-fSc-hCv8.js';
|
|
2
|
+
export { L as LogBackend, M as MergedReactiveLog, N as NativeLogBackend, R as ReactiveLogBundle, a as ReactiveLogOptions, V as ViewSpec, m as mergeReactiveLogs, r as reactiveLog } from '../reactive-log-ByBb8g6A.js';
|
|
3
|
+
export { M as MapBackend, N as NativeMapBackend, b as NativeMapBackendOptions, R as ReactiveMapBundle, a as ReactiveMapOptions, c as ReactiveMapRetention, r as reactiveMap } from '../reactive-map-CHyeCf4D.js';
|
|
4
|
+
import './storage-tiers.js';
|
|
4
5
|
|
|
5
6
|
type IndexRow<K, V = unknown> = {
|
|
6
7
|
readonly primary: K;
|
package/dist/extra/reactive.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as p,b as t}from"../chunk-NNKJUORL.js";import{a as x,b as a}from"../chunk-KGKJCHEK.js";import{a as f,b as m}from"../chunk-TZQPPQEQ.js";import{a as o,b as r,c as e}from"../chunk-RLMYS3XZ.js";import"../chunk-MQZWA3DF.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{p as NativeIndexBackend,x as NativeListBackend,o as NativeLogBackend,f as NativeMapBackend,e as mergeReactiveLogs,t as reactiveIndex,a as reactiveList,r as reactiveLog,m as reactiveMap};
|