@graphrefly/graphrefly 0.41.0 → 0.42.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-Cxs1eztH.d.cts → cascading-CH-_VwG9.d.cts} +2 -2
- package/dist/{cascading-BNfxffgc.d.ts → cascading-OgKQZjsa.d.ts} +2 -2
- package/dist/{chunk-L77I47VU.js → chunk-2K5RXLAH.js} +1 -1
- package/dist/chunk-3ERTUW2J.js +45 -0
- package/dist/chunk-3K7HA4Y6.js +1 -0
- package/dist/chunk-3ZZX7M25.js +1 -0
- package/dist/chunk-4QH6VJF4.js +1 -0
- package/dist/{chunk-M3FQSXEW.js → chunk-5QRRKBUT.js} +1 -1
- package/dist/chunk-5ST42ESJ.js +1 -0
- package/dist/{chunk-AK5RHMC5.js → chunk-6YFZMUMR.js} +1 -1
- package/dist/{chunk-SC27WTSG.js → chunk-7ARY3Y3T.js} +1 -1
- package/dist/chunk-7B7ELAT2.js +1 -0
- package/dist/{chunk-F7VUYPP6.js → chunk-7VKFXLZQ.js} +1 -1
- package/dist/chunk-ACMJ2ZPS.js +3 -0
- package/dist/{chunk-7PQLZMOG.js → chunk-AGNM6RS6.js} +1 -1
- package/dist/chunk-AS3TV2TV.js +1 -0
- package/dist/{chunk-CGNOWGV6.js → chunk-CISGGAIF.js} +1 -1
- package/dist/{chunk-ZAJ7J7TO.js → chunk-DEJTNNQC.js} +1 -1
- package/dist/{chunk-AI7QC7J6.js → chunk-FDZAZNRO.js} +1 -1
- package/dist/{chunk-OV5AA6HJ.js → chunk-FUZ6S2DY.js} +1 -1
- package/dist/{chunk-G3M3IMEV.js → chunk-G5VBJ5K6.js} +1 -1
- package/dist/{chunk-KNVCCBIU.js → chunk-HZKW2AAB.js} +1 -1
- package/dist/{chunk-CYOSWFT2.js → chunk-IZM3UEH3.js} +3 -3
- package/dist/{chunk-UISPDFJ3.js → chunk-KCACBSJH.js} +1 -1
- package/dist/{chunk-GI4Q7PNY.js → chunk-KT5DTRBP.js} +1 -1
- package/dist/{chunk-33N4TU3X.js → chunk-KY2LMAXU.js} +1 -1
- package/dist/{chunk-TT4C7DXW.js → chunk-LDQ3IUIP.js} +1 -1
- package/dist/chunk-LPRWATHB.js +61 -0
- package/dist/{chunk-X7QKTXXC.js → chunk-NWXQIOIB.js} +3 -3
- package/dist/{chunk-VV62MIG4.js → chunk-Q7QQQA3I.js} +1 -1
- package/dist/chunk-VE5SIZEM.js +1 -0
- package/dist/chunk-VRALOYRD.js +1 -0
- package/dist/{chunk-5VEZLQFN.js → chunk-WHMUB5QB.js} +1 -1
- package/dist/chunk-XLQPNNIC.js +1 -0
- package/dist/{chunk-YQRN4CIV.js → chunk-YGL7FPVQ.js} +1 -1
- package/dist/compat/index.cjs +5 -5
- package/dist/compat/index.d.cts +16 -16
- package/dist/compat/index.d.ts +16 -16
- 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 +5 -5
- package/dist/compat/nestjs/index.d.cts +8 -8
- package/dist/compat/nestjs/index.d.ts +8 -8
- 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 +3 -3
- package/dist/compat/zustand/index.d.cts +4 -4
- package/dist/compat/zustand/index.d.ts +4 -4
- package/dist/compat/zustand/index.js +1 -1
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/{decay-C25AyNAj.d.cts → decay-2ZukgQ4o.d.cts} +2 -2
- package/dist/{decay-BnrlbxSv.d.ts → decay-CdEBmDIs.d.ts} +2 -2
- package/dist/extra/browser.d.cts +1 -1
- package/dist/extra/browser.d.ts +1 -1
- package/dist/extra/index.cjs +14 -14
- package/dist/extra/index.d.cts +10 -11
- package/dist/extra/index.d.ts +10 -11
- package/dist/extra/index.js +1 -1
- package/dist/extra/node.cjs +2 -2
- package/dist/extra/node.d.cts +1 -1
- package/dist/extra/node.d.ts +1 -1
- package/dist/extra/node.js +1 -1
- 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.d.cts +3 -3
- package/dist/extra/reactive.d.ts +3 -3
- package/dist/extra/reactive.js +1 -1
- package/dist/extra/render/index.d.cts +3 -3
- package/dist/extra/render/index.d.ts +3 -3
- package/dist/extra/sources.cjs +3 -1
- package/dist/extra/sources.d.cts +1 -1
- package/dist/extra/sources.d.ts +1 -1
- package/dist/extra/sources.js +1 -1
- package/dist/extra/storage-browser.d.cts +1 -1
- package/dist/extra/storage-browser.d.ts +1 -1
- package/dist/{fallback-CMZl39L5.d.ts → fallback-CqYVLL6X.d.ts} +1 -1
- package/dist/{fallback-8JYU8tlT.d.cts → fallback-Ctlj2tMY.d.cts} +1 -1
- package/dist/graph/index.cjs +7 -7
- package/dist/graph/index.d.cts +5 -5
- package/dist/graph/index.d.ts +5 -5
- package/dist/graph/index.js +1 -1
- package/dist/{graph-BkIkog4h.d.ts → graph-7VguS7a4.d.ts} +3 -3
- package/dist/{graph-E6likq7w.d.cts → graph-C4SHb3Ly.d.cts} +3 -3
- package/dist/{index-DktLSZOc.d.cts → index-2B7u2pVn.d.cts} +4 -4
- package/dist/{index-DGD4_fj6.d.cts → index-3NmAfcH0.d.cts} +8 -5
- package/dist/{index-DfOK_oL5.d.ts → index-4Uz-e_fL.d.ts} +372 -17
- package/dist/{index-BAQrjuZF.d.ts → index-B-i4_g3k.d.ts} +2 -2
- package/dist/{index-DpiGqtrs.d.cts → index-B11anra4.d.cts} +441 -381
- package/dist/{index-WSlcjhQF.d.ts → index-B3OTH1dV.d.ts} +124 -13
- package/dist/{index-2n8Eai6M.d.ts → index-BG0BN3PB.d.ts} +1 -1
- package/dist/{index-z8WFPVI8.d.cts → index-BJX94aud.d.cts} +1 -1
- package/dist/{index-DhLyOHYZ.d.ts → index-BP8a88zx.d.ts} +11 -4
- package/dist/{index-Cnr1WrlX.d.cts → index-BTQtTb_H.d.cts} +14 -3
- package/dist/{index-BaA-xpSw.d.ts → index-BUYXac2c.d.ts} +3 -3
- package/dist/{index-DOBLxOti.d.cts → index-BVpm6noz.d.cts} +1 -1
- package/dist/{index-DhnsQfa3.d.ts → index-Bbkgpt5t.d.ts} +441 -381
- package/dist/{index-Cczxgd2D.d.ts → index-Bc41FuHp.d.cts} +3 -3
- package/dist/{index-BiHUBEKq.d.cts → index-BdGtBX-X.d.cts} +3 -3
- package/dist/index-BeT2r7sk.d.ts +760 -0
- package/dist/{index-da2V5vPy.d.ts → index-Bf7eqeSF.d.ts} +2 -2
- package/dist/{index-bXXLSvor.d.ts → index-Bn4zHYLj.d.ts} +4 -4
- package/dist/{index-DGTo1yka.d.cts → index-BoLv_OfD.d.cts} +2 -2
- package/dist/{index-B72TQQHd.d.cts → index-BsT7F2et.d.ts} +3 -3
- package/dist/{index-Bd91Nmf4.d.cts → index-BtAsBp8K.d.cts} +4 -4
- package/dist/{index-DgJc8Zgc.d.cts → index-C0-Jv1kP.d.cts} +81 -5
- package/dist/{index-C6ZUaos7.d.ts → index-C7O6r5fV.d.ts} +1 -1
- package/dist/{index-CL7oilfm.d.cts → index-C9kSENB4.d.cts} +1 -1
- package/dist/{index-yLt-aPMp.d.ts → index-CCq87F7t.d.ts} +1 -1
- package/dist/{index-DQQCOIt8.d.cts → index-CEMx8n40.d.cts} +10 -5
- package/dist/{index-BilOa6AE.d.cts → index-CJIuLu2f.d.cts} +124 -13
- package/dist/{index-B2RUoIUz.d.ts → index-CJK1JkYy.d.ts} +1 -1
- package/dist/{index-CG33HeBW.d.ts → index-CJQm0g38.d.ts} +8 -5
- package/dist/index-CPNSy-U0.d.cts +760 -0
- package/dist/{index-A3U3CSve.d.cts → index-CZjOhcBy.d.cts} +2 -2
- package/dist/{index-CAP3UGsq.d.ts → index-CZmcDtFn.d.ts} +1 -1
- package/dist/{index-DYTBbF8T.d.cts → index-ChOyVLKm.d.cts} +1 -1
- package/dist/{index-eaQuGJnv.d.ts → index-CpyNFqkB.d.ts} +3 -3
- package/dist/{index-BJSZxSFX.d.ts → index-CvrqGfNS.d.ts} +1 -1
- package/dist/{index-DuRsN9ae.d.cts → index-D-Xs74HZ.d.cts} +372 -17
- package/dist/{index-C5cQ7Gfx.d.ts → index-D6egPFAL.d.ts} +4 -4
- package/dist/{index-CD2dBMet.d.ts → index-D8l8hNXn.d.ts} +10 -5
- package/dist/{index-40ZT4MHj.d.ts → index-DBHK8O6H.d.ts} +14 -3
- package/dist/{index-DVDapw2k.d.cts → index-DBIqYS43.d.cts} +35 -21
- package/dist/{index-3k4Gg6-n.d.ts → index-DBevwHj_.d.ts} +3 -3
- package/dist/{index-Ctb7_2sG.d.ts → index-DIOoAZUX.d.ts} +1 -1
- package/dist/{index-BQ1fR4li.d.ts → index-DO9XxMzS.d.ts} +35 -21
- package/dist/{index-CQtWm7jS.d.ts → index-DQo8xBgd.d.ts} +9 -9
- package/dist/{index-DH4fm2Ck.d.ts → index-Dgs8zcj7.d.ts} +2 -2
- package/dist/{index-CtFNGe-m.d.cts → index-Dhc7a7Xo.d.cts} +2 -2
- package/dist/{index-MxYuWOrf.d.cts → index-DmAgG5CI.d.cts} +3 -3
- package/dist/{index-CoM4rzyB.d.ts → index-Dmqp7KjD.d.ts} +1 -1
- package/dist/{index-B6iTqKtJ.d.ts → index-Dn-wI9g4.d.ts} +2 -2
- package/dist/{index-C-dkXOpB.d.cts → index-Du7u1lSf.d.cts} +11 -4
- package/dist/{index-DVAlsmEU.d.cts → index-HoU88d5U.d.cts} +3 -3
- package/dist/{index-CRm0YIzC.d.cts → index-LIpQQE9f.d.cts} +9 -9
- package/dist/{index-CgnCFhr2.d.cts → index-f5IivDUX.d.cts} +1 -1
- package/dist/{index-PgwvGWa1.d.cts → index-hHcaFlJX.d.cts} +1 -1
- package/dist/{index-I1cCY3ZI.d.ts → index-pT8sCpOJ.d.ts} +81 -5
- package/dist/{index-D4uimgee.d.cts → index-sl4NyzQx.d.cts} +1 -1
- package/dist/{index-tV3AA9hI.d.cts → index-tJoTcnHh.d.cts} +2 -2
- package/dist/{index-D3ayz3hy.d.cts → index-z96luz5O.d.cts} +1 -1
- package/dist/index.cjs +48 -48
- package/dist/index.d.cts +45 -50
- package/dist/index.d.ts +45 -50
- package/dist/index.js +1 -1
- package/dist/{meta-D8OyedKp.d.ts → meta-BgVAsg9j.d.ts} +1 -1
- package/dist/{meta-Ct9nqQS5.d.cts → meta-vE8bxW1E.d.cts} +1 -1
- package/dist/{node-BYInONRr.d.cts → node-ClS5yC-B.d.cts} +1 -1
- package/dist/{node-BYInONRr.d.ts → node-ClS5yC-B.d.ts} +1 -1
- package/dist/{observable-DO8DDEzv.d.ts → observable-BsBzUrcI.d.ts} +1 -1
- package/dist/{observable-DMIlYJV1.d.cts → observable-DLGPPtb8.d.cts} +1 -1
- 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 +17 -17
- package/dist/patterns/ai/index.d.cts +17 -17
- package/dist/patterns/ai/index.d.ts +17 -17
- package/dist/patterns/ai/index.js +1 -1
- package/dist/patterns/ai/node.d.cts +4 -4
- package/dist/patterns/ai/node.d.ts +4 -4
- package/dist/patterns/ai/node.js +1 -1
- package/dist/patterns/cqrs/index.cjs +3 -3
- package/dist/patterns/cqrs/index.d.cts +6 -6
- package/dist/patterns/cqrs/index.d.ts +6 -6
- package/dist/patterns/cqrs/index.js +1 -1
- package/dist/patterns/demo-shell/index.cjs +5 -5
- package/dist/patterns/demo-shell/index.d.cts +5 -5
- package/dist/patterns/demo-shell/index.d.ts +5 -5
- package/dist/patterns/demo-shell/index.js +1 -1
- package/dist/patterns/domain-templates/index.cjs +3 -3
- package/dist/patterns/domain-templates/index.d.cts +4 -4
- package/dist/patterns/domain-templates/index.d.ts +4 -4
- package/dist/patterns/domain-templates/index.js +1 -1
- package/dist/patterns/graphspec/index.cjs +12 -12
- package/dist/patterns/graphspec/index.d.cts +5 -5
- package/dist/patterns/graphspec/index.d.ts +5 -5
- package/dist/patterns/graphspec/index.js +1 -1
- package/dist/patterns/harness/index.cjs +10 -8
- package/dist/patterns/harness/index.d.cts +11 -12
- package/dist/patterns/harness/index.d.ts +11 -12
- package/dist/patterns/harness/index.js +1 -1
- package/dist/patterns/inspect/index.cjs +3 -0
- package/dist/patterns/inspect/index.d.cts +9 -0
- package/dist/patterns/inspect/index.d.ts +9 -0
- package/dist/patterns/inspect/index.js +1 -0
- package/dist/patterns/job-queue/index.cjs +3 -3
- package/dist/patterns/job-queue/index.d.cts +6 -6
- package/dist/patterns/job-queue/index.d.ts +6 -6
- package/dist/patterns/job-queue/index.js +1 -1
- package/dist/patterns/memory/index.cjs +3 -3
- package/dist/patterns/memory/index.d.cts +6 -6
- package/dist/patterns/memory/index.d.ts +6 -6
- package/dist/patterns/memory/index.js +1 -1
- package/dist/patterns/messaging/index.cjs +3 -3
- package/dist/patterns/messaging/index.d.cts +5 -5
- package/dist/patterns/messaging/index.d.ts +5 -5
- package/dist/patterns/messaging/index.js +1 -1
- package/dist/patterns/orchestration/index.cjs +3 -3
- package/dist/patterns/orchestration/index.d.cts +7 -7
- package/dist/patterns/orchestration/index.d.ts +7 -7
- package/dist/patterns/orchestration/index.js +1 -1
- package/dist/patterns/process/index.cjs +1 -1
- package/dist/patterns/process/index.d.cts +7 -7
- package/dist/patterns/process/index.d.ts +7 -7
- package/dist/patterns/process/index.js +1 -1
- package/dist/patterns/reactive-layout/index.cjs +4 -4
- package/dist/patterns/reactive-layout/index.d.cts +5 -5
- package/dist/patterns/reactive-layout/index.d.ts +5 -5
- package/dist/patterns/reactive-layout/index.js +1 -1
- package/dist/patterns/reduction/index.cjs +3 -3
- package/dist/patterns/reduction/index.d.cts +4 -4
- package/dist/patterns/reduction/index.d.ts +4 -4
- package/dist/patterns/reduction/index.js +1 -1
- package/dist/patterns/surface/index.cjs +8 -8
- package/dist/patterns/surface/index.d.cts +6 -6
- package/dist/patterns/surface/index.d.ts +6 -6
- package/dist/patterns/surface/index.js +1 -1
- package/dist/{pipeline-graph-MWrQZXCq.d.cts → pipeline-graph-WBlobVhU.d.cts} +5 -5
- package/dist/{pipeline-graph-CB4La-UW.d.ts → pipeline-graph-v8fMvqNk.d.ts} +5 -5
- package/dist/{reactive-layout-BtZfUKuL.d.cts → reactive-layout-Dsvob4zD.d.cts} +2 -2
- package/dist/{reactive-layout-KJj4E2dT.d.ts → reactive-layout-v7KPvxoc.d.ts} +2 -2
- package/dist/{reactive-log-_zeEnB9H.d.cts → reactive-log-B00laMSQ.d.cts} +1 -1
- package/dist/{reactive-log-BlAsPLl2.d.ts → reactive-log-BezYsbA_.d.ts} +1 -1
- package/dist/{reactive-map-6P_k3AQM.d.cts → reactive-map-48mnZ-nu.d.cts} +1 -1
- package/dist/{reactive-map-CjXByDV-.d.ts → reactive-map-BVVPdvmi.d.ts} +1 -1
- package/dist/resilience-445VFFXQ.js +1 -0
- package/dist/{sugar-BhfjgetH.d.ts → sugar-CH-2ZY90.d.ts} +1 -1
- package/dist/{sugar-DzePN5-g.d.cts → sugar-DStZfUEK.d.cts} +1 -1
- package/dist/{topology-tree-mF7Emqzm.d.ts → topology-tree-BNGvuG82.d.ts} +1 -1
- package/dist/{topology-tree-3LBKFsUo.d.cts → topology-tree-BSdfSwMi.d.cts} +1 -1
- package/dist/{types-1Dhoi7HM.d.cts → types-B1jDWVsM.d.cts} +1 -1
- package/dist/{types-39jk0kaV.d.ts → types-DkzUUs0H.d.ts} +1 -1
- package/package.json +11 -51
- package/dist/budget-gate-CmmVtasH.d.ts +0 -115
- package/dist/budget-gate-DiP_nK0n.d.cts +0 -115
- package/dist/chunk-2W553JJC.js +0 -1
- package/dist/chunk-4MKL6Q3K.js +0 -1
- package/dist/chunk-5B3JDG5F.js +0 -1
- package/dist/chunk-5QSXEMXG.js +0 -1
- package/dist/chunk-5TEFC2ZX.js +0 -1
- package/dist/chunk-5TOPVRN6.js +0 -1
- package/dist/chunk-EC2WNSZ7.js +0 -1
- package/dist/chunk-ELAASRBT.js +0 -3
- package/dist/chunk-H5SCWHWP.js +0 -1
- package/dist/chunk-OLIKJUKI.js +0 -1
- package/dist/chunk-POXANAJ6.js +0 -3
- package/dist/chunk-RSMEXK53.js +0 -43
- package/dist/chunk-SGS4OJGS.js +0 -1
- package/dist/chunk-URJ2VFNC.js +0 -1
- package/dist/chunk-VXPLLA4P.js +0 -1
- package/dist/chunk-WZYB3JQS.js +0 -1
- package/dist/chunk-Z6X7B6A4.js +0 -61
- package/dist/index-8s-Qm-gz.d.ts +0 -218
- package/dist/index-BgjS2b8N.d.ts +0 -366
- package/dist/index-BmSQLAZo.d.cts +0 -244
- package/dist/index-CGhMJNHb.d.cts +0 -128
- package/dist/index-CUIkE1l9.d.cts +0 -230
- package/dist/index-Ck35nA-T.d.ts +0 -244
- package/dist/index-CuPUehFa.d.cts +0 -218
- package/dist/index-D1Gc7wV5.d.ts +0 -230
- package/dist/index-N2MAxt7_.d.ts +0 -128
- package/dist/index-t6L2qpHh.d.cts +0 -366
- package/dist/patterns/audit/index.cjs +0 -3
- package/dist/patterns/audit/index.d.cts +0 -8
- package/dist/patterns/audit/index.d.ts +0 -8
- package/dist/patterns/audit/index.js +0 -1
- package/dist/patterns/guarded-execution/index.cjs +0 -3
- package/dist/patterns/guarded-execution/index.d.cts +0 -9
- package/dist/patterns/guarded-execution/index.d.ts +0 -9
- package/dist/patterns/guarded-execution/index.js +0 -1
- package/dist/patterns/lens/index.cjs +0 -3
- package/dist/patterns/lens/index.d.cts +0 -7
- package/dist/patterns/lens/index.d.ts +0 -7
- package/dist/patterns/lens/index.js +0 -1
- package/dist/patterns/refine-loop/index.cjs +0 -5
- package/dist/patterns/refine-loop/index.d.cts +0 -9
- package/dist/patterns/refine-loop/index.d.ts +0 -9
- package/dist/patterns/refine-loop/index.js +0 -1
- package/dist/patterns/resilient-pipeline/index.cjs +0 -3
- package/dist/patterns/resilient-pipeline/index.d.cts +0 -8
- package/dist/patterns/resilient-pipeline/index.d.ts +0 -8
- package/dist/patterns/resilient-pipeline/index.js +0 -1
- package/dist/resilience-JISHQD2F.js +0 -1
package/dist/extra/sources.cjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var $t=Object.prototype.hasOwnProperty;var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var xe=(t,e)=>{for(var n in e)ve(t,n,{get:e[n],enumerable:!0})},jt=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Wt(e))!$t.call(t,r)&&r!==n&&ve(t,r,{get:()=>e[r],enumerable:!(o=Ut(e,r))||o.enumerable});return t};var qt=t=>jt(ve({},"__esModule",{value:!0}),t);function Ne(){return Math.trunc(performance.now()*1e6)}function ue(){return Date.now()*1e6}var de=v(()=>{"use strict"});var H,b,T,w,z,L,G,R,y,h,q,ke,Kt,Ee,Yt,Jt,Se,je,qe,Ke,Re,K=v(()=>{"use strict";H=Symbol.for("graphrefly/START"),b=Symbol.for("graphrefly/DATA"),T=Symbol.for("graphrefly/DIRTY"),w=Symbol.for("graphrefly/RESOLVED"),z=Symbol.for("graphrefly/INVALIDATE"),L=Symbol.for("graphrefly/PAUSE"),G=Symbol.for("graphrefly/RESUME"),R=Symbol.for("graphrefly/TEARDOWN"),y=Symbol.for("graphrefly/COMPLETE"),h=Symbol.for("graphrefly/ERROR"),q=Object.freeze([T]),ke=Object.freeze([w]),Kt=Object.freeze([z]),Ee=Object.freeze([H]),Yt=Object.freeze([y]),Jt=Object.freeze([R]),Se=Object.freeze([q]),je=Object.freeze([ke]),qe=Object.freeze([Kt]),Ke=Object.freeze([Yt]),Re=Object.freeze([Jt])});function Ye(t){t.registerCodec(Xt)}var Xt,Je=v(()=>{"use strict";Xt={name:"json",version:1,contentType:"application/json",encode(t){let e=JSON.stringify(t);return new TextEncoder().encode(e)},decode(t,e){let n=new TextDecoder().decode(t);return JSON.parse(n)}}});function ce(t){if(t==null)return Qt;let{type:e,id:n,...o}=t;return{type:e??"system",id:n??"",...o}}var Qt,Xe=v(()=>{"use strict";Qt={type:"system",id:""}});function Qe(){return Y>0||re}function Ze(){return Y>0}function et(t){Y>0?oe.push(t):t()}function Ae(t){Y+=1;let e=!1;try{t()}catch(n){throw e=!0,n}finally{if(Y-=1,Y===0)if(e){if(!re){let n=oe.splice(0);for(let o of n)try{o()}catch{}U.length=0,W.length=0,J.length=0}}else Zt()}}function Zt(){let t=!re;t&&(re=!0);let e=[],n=0;try{for(;U.length>0||W.length>0||J.length>0||t&&oe.length>0;){if(t&&oe.length>0){let i=oe.splice(0);for(let s of i)try{s()}catch(a){e.push(a)}continue}if(n+=1,n>1e3)throw U.length=0,W.length=0,J.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let r=(U.length>0?U:W.length>0?W:J).splice(0);for(let i of r)try{i()}catch(s){e.push(s)}}}finally{t&&(re=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function le(t,e,n){if(e.length===0)return;if(e.length===1){let d=n(e[0][0]);if(d<3||!Qe()){t(e);return}(d>=5?J:d===4?W:U).push(()=>t(e));return}let o=e.length,r=o,i=o,s=o,a=0;for(;a<o&&n(e[a][0])<3;)a++;for(r=a;a<o&&n(e[a][0])===3;)a++;for(i=a;a<o&&n(e[a][0])===4;)a++;s=a;let u=Qe();if(r>0){let d=e.slice(0,r);t(d)}if(i>r){let d=e.slice(r,i);u?U.push(()=>t(d)):t(d)}if(s>i){let d=e.slice(i,s);u?W.push(()=>t(d)):t(d)}if(o>s){let d=e.slice(s,o);u?J.push(()=>t(d)):t(d)}}var Y,re,U,W,J,oe,Oe=v(()=>{"use strict";Y=0,re=!1,U=[],W=[],J=[],oe=[]});function tt(t){t.registerMessageType(H,{tier:0,wireCrossing:!1}),t.registerMessageType(T,{tier:1,wireCrossing:!1}),t.registerMessageType(z,{tier:1,wireCrossing:!1,metaPassthrough:!1}),t.registerMessageType(L,{tier:2,wireCrossing:!1}),t.registerMessageType(G,{tier:2,wireCrossing:!1}),t.registerMessageType(b,{tier:3,wireCrossing:!0}),t.registerMessageType(w,{tier:3,wireCrossing:!0}),t.registerMessageType(y,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(h,{tier:4,wireCrossing:!0,metaPassthrough:!1}),t.registerMessageType(R,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var fe,nt=v(()=>{"use strict";K();fe=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 o=this._messageTypes.get(n);return o!=null?o.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,rt=v(()=>{"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 Me(t){if(t===void 0)return null;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Cannot hash non-finite number: ${t}`);if(Number.isInteger(t)&&!Number.isSafeInteger(t))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${t}. Cross-language cid parity is not guaranteed for unsafe integers.`);return t}if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(Array.isArray(t))return t.map(Me);if(typeof t=="object"&&t!==null){let e={};for(let n of Object.keys(t).sort())e[n]=Me(t[n]);return e}return null}function nn(t){let e=tn.encode(t),n=e.length,o=n*8,r=n+9+63&-64,i=new Uint8Array(r);i.set(e),i[n]=128;let s=new DataView(i.buffer);s.setUint32(r-4,o>>>0,!1),s.setUint32(r-8,Math.floor(o/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,l=1359893119,p=2600822924,f=528734635,g=1541459225,_=new Uint32Array(64),m=(S,k)=>S>>>k|S<<32-k;for(let S=0;S<r;S+=64){for(let E=0;E<16;E++)_[E]=s.getUint32(S+E*4,!1);for(let E=16;E<64;E++){let te=_[E-15],ne=_[E-2],ae=m(te,7)^m(te,18)^te>>>3,Te=m(ne,17)^m(ne,19)^ne>>>10;_[E]=_[E-16]+ae+_[E-7]+Te>>>0}let k=a,B=u,F=d,P=c,C=l,D=p,M=f,I=g;for(let E=0;E<64;E++){let te=m(C,6)^m(C,11)^m(C,25),ne=C&D^~C&M,ae=I+te+ne+en[E]+_[E]>>>0,Te=m(k,2)^m(k,13)^m(k,22),Ht=k&B^k&F^B&F,zt=Te+Ht>>>0;I=M,M=D,D=C,C=P+ae>>>0,P=F,F=B,B=k,k=ae+zt>>>0}a=a+k>>>0,u=u+B>>>0,d=d+F>>>0,c=c+P>>>0,l=l+C>>>0,p=p+D>>>0,f=f+M>>>0,g=g+I>>>0}let N=S=>S.toString(16).padStart(8,"0");return N(a)+N(u)+N(d)+N(c)+N(l)+N(p)+N(f)+N(g)}function Ce(t){let e=Me(t??null),n=JSON.stringify(e);return nn(n).slice(0,16)}function rn(){let t=globalThis.crypto;if(t?.randomUUID)return t.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 De(t,e,n){let o=n?.id??rn();if(t===0)return{id:o,version:0};let i=(n?.hash??Ce)(e);return{id:o,version:0,cid:i,prev:null}}function ot(t,e,n){t.version+=1,"cid"in t&&(t.prev=t.cid,t.cid=n(e))}var en,tn,st=v(()=>{"use strict";en=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 ut(t){return{node:t,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function Ie(t){t.prevData=void 0,t.dirty=!1,t.involvedThisWave=!1,t.dataBatch.length=0,t.terminal=void 0}function pe(t){return t.length===0?t:typeof t[0]=="symbol"?[t]:t}function O(t,e,n){let o=dt(t)?t:[],r=typeof t=="function"?t:typeof e=="function"?e:void 0,i={};return dt(t)?i=(Le(e)?e:n)??{}:Le(t)?i=t:i=(Le(e)?e:n)??{},new he(o,r,i)}var it,at,on,sn,Fe,he,dt,Le,se=v(()=>{"use strict";Je();Xe();Oe();de();nt();rt();K();st();it=()=>{},at=100;on=(t,e,n,o)=>{n.direction==="down-in"&&t._onDepMessage(n.depIndex,e)},sn=(t,e,n,o)=>{let r=t;if(r._status==="completed"||r._status==="errored")return;let i=r._cached,s=i===void 0?[Ee]:[Ee,[b,i]];r._status==="dirty"&&s.push(q),le(e,s,r._config.tierOf)},Fe=new fe({onMessage:on,onSubscribe:sn});tt(Fe);Ye(Fe);he=class t{_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,o){this._config=o.config??Fe,this._config.onMessage,this._optsName=o.name,this._describeKind=o.describeKind,this._equals=o.equals??Object.is,this._resubscribable=o.resubscribable??!1,this._resetOnTeardown=o.resetOnTeardown??!1,this._autoComplete=o.completeWhenDepsComplete??!0,this._autoError=o.errorWhenDepsError??!0,this._pausable=o.pausable??!0,this._guard=o.guard,this._fn=n,this._partial=o.partial??!1,this._cached=o.initial!==void 0?o.initial:void 0,this._status=e.length===0&&n==null&&this._cached!==void 0?"settled":"sentinel",this._hashFn=o.versioningHash??this._config.defaultHashFn??Ce;let r=o.versioning??this._config.defaultVersioning;this._versioningLevel=r,this._versioning=r!=null?De(r,this._cached===void 0?void 0:this._cached,{id:o.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(ut);let i={};for(let[a,u]of Object.entries(o.meta??{})){let d={initial:u,name:`${o.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};o.guard!=null&&(d.guard=o.guard),i[a]=new t([],void 0,d)}Object.freeze(i),this.meta=i,this._hasMeta=Object.keys(i).length>0;let s=this;this._actions={emit(a){s._emit([[b,a]])},down(a){s._emit(pe(a))},up(a){s._emitUp(pe(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 o=this._versioningLevel;if(o!=null&&e<=o)return;let r=n?.hash??this._hashFn;r!==this._hashFn&&(this._hashFn=r);let i=this._cached===void 0?void 0:this._cached,s=this._versioning,a=s?.id??n?.id,u=s?.version??0,d=De(e,i,{id:a,hash:r});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=ce(e);if(this._guard!=null&&!this._guard(n,"observe"))return!1;if(this._extraGuards!=null){for(let o of this._extraGuards)if(!o(n,"observe"))return!1}return!0}_checkGuard(e){if(e?.internal)return;let n=this._guard!=null||this._extraGuards!=null,o=e?.actor!=null;if(!n&&!o)return;let r=ce(e?.actor),i=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(r,i))throw new X({actor:r,action:i,nodeName:this.name});if(this._extraGuards!=null){for(let s of this._extraGuards)if(!s(r,i))throw new X({actor:r,action:i,nodeName:this.name})}this._lastMutation={actor:r,timestamp_ns:ue()}}down(e,n){let o=pe(e);o.length!==0&&(this._checkGuard(n),this._emit(o))}emit(e,n){this._checkGuard(n),this._emit([[b,e]])}up(e,n){if(this._deps.length===0)return;let o=pe(e);if(o.length===0)return;this._checkGuard(n);let r=n??{internal:!0};this._validateUpTiers(o);for(let i of this._deps)i.node.up?.(o,r)}_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 o of e){let r=n(o[0]);if(r===3||r===4)throw new Error(`Node "${this.name}": tier-${r} 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=ce(n);if(!this._guard(u,"observe"))throw new X({actor:u,action:"observe",nodeName:this.name})}let r=this._isTerminal&&this._resubscribable;if(r){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)Ie(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 i;try{i=this._config.onSubscribe(this,e,{sinkCount:this._sinkCount,afterTerminalReset:r},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 s=this._isTerminal;if(this._sinkCount===1&&!s)try{this._activate()}catch(u){if(this._sinkCount-=1,this._removeSink(e),this._sinkCount===0&&(this._status="sentinel"),typeof i=="function")try{i()}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 i=="function"&&i(),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 o=0;o<e;o++){let r=o,i=this._deps[o];i.unsub=it,i.unsub=i.node.subscribe(s=>{if(i.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of s)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:r},this._actions);u&&this._maybeRunFnOnSettlement()}),n++}}catch(o){this._deps[n].unsub=null;for(let r=0;r<n;r++){let i=this._deps[r];if(i.unsub!=null){let s=i.unsub;i.unsub=null;try{s()}catch{}Ie(i)}}throw this._dirtyDepCount=0,o}}_addDep(e){for(let r=0;r<this._deps.length;r++)if(this._deps[r].node===e)return r;let n=this._deps.length,o=ut(e);if(this._deps.push(o),this._sinks==null)return n;o.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se),o.unsub=it;try{o.unsub=e.subscribe(r=>{if(o.unsub===null)return;let i=this._config.tierOf,s=!1;for(let a of r)i(a[0])>=3&&(s=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:n},this._actions);s&&this._maybeRunFnOnSettlement()})}catch(r){throw o.unsub=null,this._deps.pop(),this._dirtyDepCount--,r}return n}_deactivate(e=!1){let n=this._cleanup;if(this._cleanup=void 0,typeof n=="function")try{n()}catch(o){this._emit([[h,this._wrapFnError("cleanup threw",o)]])}else if(n!=null&&typeof n=="object"){let o=n.deactivate;if(typeof o=="function")try{o()}catch(r){this._emit([[h,this._wrapFnError("cleanup.deactivate threw",r)]])}}for(let o of this._deps){if(o.unsub!=null){let r=o.unsub;o.unsub=null;try{r()}catch{}}Ie(o)}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 o=this._deps[e],r=n[0];if(this._inspectorHooks!=null){let i={kind:"dep_message",depIndex:e,message:n};for(let s of this._inspectorHooks)s(i)}if(r!==H){if(r===T){this._depDirtied(o);return}if(r===z){if(this._depInvalidated(o),this._cached===void 0)return;this._emit(qe);return}if(r===L||r===G){this._emit([n]);return}if(r===R){this._emit(Re);return}if(r===b)this._depSettledAsData(o,n[1]);else if(r===w)this._depSettledAsResolved(o);else if(r===y)this._depSettledAsTerminal(o,!0);else if(r===h)this._depSettledAsTerminal(o,n[1]);else{this._emit([n]);return}if(!this._fn){(r===b||r===w)&&this._emit([n]),(r===y||r===h)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(Se))}_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(je),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([[h,e.terminal]]);return}this._autoComplete&&this._deps.every(n=>n.terminal!==void 0)&&this._emit(Ke)}_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(s){this._emit([[h,this._wrapFnError("cleanup threw",s)]]);return}}else if(e!=null&&typeof e=="object"){let s=e.beforeRun;if(typeof s=="function"){e.beforeRun=void 0;try{s()}catch(a){this._emit([[h,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let n=this._deps.map(s=>s.involvedThisWave?s.dataBatch.length>0?[...s.dataBatch]:[]:void 0),o=this._deps.map(s=>s.prevData);for(let s=0;s<this._deps.length;s++){let a=n[s];a!=null&&a.length>0&&(this._deps[s].prevData=a[a.length-1])}let r=this._deps.map(s=>s.terminal),i={prevData:o,terminalDeps:r,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let s={kind:"run",batchData:n,prevData:o};for(let a of this._inspectorHooks)a(s)}this._isExecutingFn=!0;try{let s=this._fn(n,this._actions,i);if(typeof s=="function")this._cleanup=s;else if(s!=null&&typeof s=="object"){let a=s;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=s)}}catch(s){this._emit([[h,this._wrapFnError("fn threw",s)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>at?(this._rerunDepth=0,this._emit([[h,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${at} \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 o=n instanceof Error?n.message:String(n);return new Error(`Node "${this.name}": ${e}: ${o}`,{cause:n})}_frameBatch(e){let n=this._config.tierOf;if(e.length===1)return n(e[0][0])===3&&this._status!=="dirty"?[q,e[0]]:e;let o=!0,r=!1,i=!1,s=-1;for(let u of e){let d=n(u[0]);d<s&&(o=!1),d===3&&(r=!0),u[0]===T&&(i=!0),s=d}let a=e;if(!o){let u=e.map((d,c)=>({m:d,i:c,tier:n(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(r&&!i&&this._status!=="dirty"){let u=0;for(;u<a.length&&n(a[u][0])===0;)u++;return u===0?[q,...a]:[...a.slice(0,u),q,...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]===h&&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]===R||u[0]===z);if(a.length===0)return;n=a}n=this._frameBatch(n);let r=null;for(let a=0;a<n.length;a++){let u=n[a],d=u[0];if(d!==L&&d!==G){r?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===L?"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 l=u[1];if(d===L)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))c=!1;else if(this._pauseLocks.delete(l),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())}}c?r?.push(u):r==null&&(r=n.slice(0,a))}if(r!=null){if(r.length===0)return;n=r}if(this._hasMeta&&n.some(a=>a[0]===R))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Re)}catch{}let{finalMessages:i,equalsError:s}=this._updateState(n);if(i.length>0&&this._config.inspectorEnabled){let a=this._config.globalInspector;if(a!=null)try{a({kind:"emit",node:this,messages:i})}catch{}}if(i.length>0)if(this._paused&&this._pausable==="resumeAll"&&this._pauseBuffer!=null){let a=this._config.tierOf,u=[];for(let d of i)a(d[0])===3?this._pauseBuffer.push(d):u.push(d);u.length>0&&this._dispatchOrAccumulate(u)}else this._dispatchOrAccumulate(i);s!=null&&this._emit([[h,s]])}_updateState(e){let n=this._config.tierOf,o,r,i=-1,s=0;for(let c of e)n(c[0])===3&&s++;let a=s<=1,u=-1;if(this._versioning!=null&&s>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===b){u=c;break}}for(let c=0;c<e.length;c++){let l=e[c],p=l[0];if(p===b){if(l.length>=2){let f=!1;if(a&&this._cached!==void 0)try{f=this._equals(this._cached,l[1])}catch(g){r=this._wrapFnError("equals threw",g),i=c;break}if(f){o==null&&(o=e.slice(0,c)),o.push(ke),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||c===u)&&ot(this._versioning,l[1],this._hashFn)}this._status="settled",o?.push(l)}else if(o?.push(l),p===T)this._status="dirty";else if(p===w)this._status="resolved";else if(p===y){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(p===h){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(p===z){if(this._cached!==void 0){let g=this._config.rigorRecorder;if(g!=null)try{g.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 g=f.invalidate;if(typeof g=="function")try{g()}catch{}}}else p===R&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=i>=0?o??e.slice(0,i):o??e;return r!=null?{finalMessages:d,equalsError:r}:{finalMessages:d}}_deliverToSinks=e=>{if(this._sinks==null)return;if(typeof this._sinks=="function"){this._sinks(e);return}let n=[...this._sinks];for(let o of n)o(e)};_dispatchOrAccumulate(e){if(Ze()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],et(()=>this._flushBatchPending()));for(let n of e)this._batchPendingMessages.push(n);return}le(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);le(this._deliverToSinks,n,this._config.tierOf)}},dt=t=>Array.isArray(t),Le=t=>typeof t=="object"&&t!=null&&!Array.isArray(t)});function ct(t,e){return O([],{...e,initial:t})}function x(t,e){return O((o,r,i)=>t(r,i)??void 0,{describeKind:"producer",...e})}var Be=v(()=>{"use strict";se()});function ie(t,e,n){let o=new Set;for(let r of t.split(",")){let[i,s]=r.split("/"),a=s?Number.parseInt(s,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${r}`);let u,d;if(i==="*")u=e,d=n;else if(i.includes("-")){let[c,l]=i.split("-");u=Number.parseInt(c,10),d=Number.parseInt(l,10)}else u=Number.parseInt(i,10),d=u;if(Number.isNaN(u)||Number.isNaN(d))throw new Error(`Invalid cron field: ${t}`);if(u<e||d>n)throw new Error(`Cron field out of range: ${t} (${e}-${n})`);if(u>d)throw new Error(`Invalid cron range: ${u}-${d} in ${t}`);for(let c=u;c<=d;c+=a)o.add(c)}return o}function lt(t){let e=t.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:ie(e[0],0,59),hours:ie(e[1],0,23),daysOfMonth:ie(e[2],1,31),months:ie(e[3],1,12),daysOfWeek:ie(e[4],0,6)}}function ft(t,e){return t.minutes.has(e.getMinutes())&&t.hours.has(e.getHours())&&t.daysOfMonth.has(e.getDate())&&t.months.has(e.getMonth()+1)&&t.daysOfWeek.has(e.getDay())}var pt=v(()=>{"use strict"});function ht(t,e,n){return{[t]:!0,[`${t}_type`]:e,...n??{}}}var mt=v(()=>{"use strict"});function gt(t,e,n){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let o=e.map(f=>f.node),r=[t,...o],i=new Pe,s=!1,a=!1,u=Symbol("budget-gate"),d=new Array(e.length);function c(){return e.every((f,g)=>f.check(d[g]))}function l(f){for(;i.size>0&&c();){let g=i.shift();f.emit(g)}i.size===0&&a&&(a=!1,f.down([[w]]))}return O([],(f,g)=>{for(let m=0;m<e.length;m++)d[m]=e[m].node.cache;let _=[];for(let m=0;m<r.length;m++){let N=r[m];_.push(N.subscribe(S=>{for(let k of S)p(k,m,g)}))}return()=>{for(let m of _)m()}},{...n,describeKind:"derived",meta:ht("resilience","budget_gate",n?.meta)});function p(f,g,_){let m=f[0];if(g===0){if(m===b)return c()&&i.size===0?_.emit(f[1]):(i.push(f[1]),s||(s=!0,_.up([[L,u]]))),!0;if(m===T)return _.down([[T]]),!0;if(m===w)return i.size===0?_.down([[w]]):a=!0,!0;if(m===y||m===h){for(;i.size>0;)_.emit(i.shift());return a=!1,s&&(s=!1,_.up([[G,u]])),_.down([f]),!0}return!1}if(m===b&&(d[g-1]=f[1]),m===b||m===w){let N=c();return N&&i.size>0?(l(_),i.size===0&&s&&(s=!1,_.up([[G,u]]))):!N&&!s&&i.size>0&&(s=!0,_.up([[L,u]])),!0}return m===T?!0:m===h?(_.down([f]),!0):m===y}}var Pe,bt=v(()=>{"use strict";K();se();mt();Pe=class{buf=[];head=0;get size(){return this.buf.length-this.head}push(e){this.buf.push(e)}shift(){if(this.head>=this.buf.length)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head++,this.head>32&&this.head*2>this.buf.length&&(this.buf=this.buf.slice(this.head),this.head=0),e}clear(){this.buf=[],this.head=0}}});function V(t,e){let n={factory:t};return e!==void 0&&(n.factoryArgs=e),n}var yt=v(()=>{"use strict"});var Nt={};xe(Nt,{NS_PER_MS:()=>Q,NS_PER_SEC:()=>Z,constant:()=>_t,decorrelatedJitter:()=>xt,exponential:()=>Tt,fibonacci:()=>vt,linear:()=>wt,resolveBackoffPreset:()=>Ge,withMaxAttempts:()=>dn});function $(t){return t<0?0:t}function an(t,e){return e==="none"?t:e==="full"?Math.random()*t:t/2+Math.random()*(t/2)}function un(t,e){return t+Math.random()*(e-t)}function _t(t){let e=$(t);return()=>e}function wt(t,e){let n=$(t),o=e===void 0?n:$(e);return r=>n+o*Math.max(0,r)}function Tt(t){let e=$(t?.baseNs??1e8),n=t?.factor!==void 0&&t.factor<1?1:t?.factor??2,o=$(t?.maxDelayNs??30*1e9),r=t?.jitter??"none";return i=>{let s;if(e===0)s=0;else if(n===1)s=e;else{let a=o/e,u=1;for(let d=0;d<Math.max(0,i);d++){if(u>=a){u=a;break}u*=n}s=e*u,s>o&&(s=o)}return an(s,r)}}function vt(t=100*1e6,e=30*1e9){let n=$(t),o=$(e);function r(i){if(i<=0)return 1;let s=1,a=2;for(let u=1;u<i;u++){let d=s+a;s=a,a=d}return a}return i=>{let s=r(i)*n;return s<=o?s:o}}function xt(t=100*1e6,e=30*1e9){return(n,o,r)=>{let s=Math.min(e,(r??t)*3);return un(t,s)}}function dn(t,e){return(n,o,r)=>n>=e?null:t(n,o,r)}function Ge(t){if(t==="constant")return _t(1*1e9);if(t==="linear")return wt(1*1e9);if(t==="exponential")return Tt();if(t==="fibonacci")return vt();if(t==="decorrelatedJitter")return xt();throw new Error(`Unknown backoff preset: "${String(t)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var Q,Z,Ve=v(()=>{"use strict";Q=1e6,Z=1e9});var ee,kt=v(()=>{"use strict";ee=class{_timer;_gen=0;start(e,n){this.cancel(),this._gen+=1;let o=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,o===this._gen&&n()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var me,Et=v(()=>{"use strict";me=class{constructor(e){this.capacity=e;if(!Number.isInteger(e)||e<=0)throw new Error(`RingBuffer capacity must be a positive integer (got ${e})`);this.buf=new Array(e)}buf;head=0;_size=0;get size(){return this._size}get maxSize(){return this.capacity}push(e){let n=(this.head+this._size)%this.capacity;this.buf[n]=e,this._size<this.capacity?this._size++:this.head=(this.head+1)%this.capacity}shift(){if(this._size===0)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head=(this.head+1)%this.capacity,this._size--,e}at(e){if(this._size===0)return;let n=e<0?this._size+e:e;if(!(n<0||n>=this._size))return this.buf[(this.head+n)%this.capacity]}toArray(){let e=new Array(this._size);for(let n=0;n<this._size;n++)e[n]=this.buf[(this.head+n)%this.capacity];return e}clear(){for(let e=0;e<this._size;e++)this.buf[(this.head+e)%this.capacity]=void 0;this.head=0,this._size=0}}});function j(t){return{describeKind:"derived",...t}}function cn(t){return t<0?0:t}function He(t){return t[1]}function ln(t){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError("backoff strategy must return a finite number");return t<0?0:t}function St(t){let e=t?.count,n=t?.backoff;if(n!==void 0&&e===void 0)throw new RangeError("retry({ backoff }) requires explicit count to prevent unbounded retries; pass { count: <n>, backoff: ... }");let o=e!==void 0?e:0;if(o<0)throw new RangeError("retry count must be >= 0");let r=n===void 0?null:typeof n=="string"?Ge(n):n;return{maxRetries:o,strategy:r}}function Rt(t){let e={};return t?.count!==void 0&&(e.count=t.count),typeof t?.backoff=="string"&&(e.backoff=t.backoff),Object.keys(e).length>0?e:void 0}function At(t,e,n){let o=0,r=!1,i=null,s,a=new ee;function u(){s?.(),s=void 0}function d(l){if(r)return;if(o>=t.maxRetries){u(),n.down([[h,l]]);return}let p=t.strategy===null?0:t.strategy(o,l,i);if(p==null){u(),n.down([[h,l]]);return}let f;try{f=ln(p)}catch{u(),n.down([[h,l]]);return}i=f,o+=1,u();let g=f>0?f/1e6:1;a.start(g,()=>{r||c()})}function c(){a.cancel(),u();let l;try{l=e()}catch(p){d(p);return}s=l.subscribe(p=>{if(!r)for(let f of p){let g=f[0];if(g===T)n.down([[T]]);else if(g===b)o=0,i=null,n.emit(f[1]);else if(g===w)n.down([[w]]);else if(g===y)u(),n.down([[y]]);else if(g===h){d(He(f));return}else n.down([f])}})}return c(),()=>{r=!0,a.cancel(),u()}}function fn(t,e){return typeof t=="function"?hn(t,e):pn(t,e)}function pn(t,e){let n=St(e);return x(o=>At(n,()=>t,o),{...j(),initial:t.cache,meta:{...e?.meta??{},...V("retry",Rt(e))}})}function hn(t,e){let n=St(e);return x(o=>At(n,t,o),{...j(),initial:e?.initial,meta:{...e?.meta??{},...V("retry",Rt(e))}})}function mn(t){let e=Math.max(1,t?.failureThreshold??5),n=cn(t?.cooldownNs??30*1e9),o=t?.cooldown??null,r=Math.max(1,t?.halfOpenMax??1),i=t?.now??Ne,s="closed",a=0,u=0,d=0,c=n,l=0;function p(){if(!o)return n;let _=o(u);return _!==null?_:n}function f(){s="open",c=p(),d=i(),l=0}return{canExecute(){return s==="closed"?!0:s==="open"?i()-d>=c?(s="half-open",l=1,!0):!1:l<r?(l++,!0):!1},recordSuccess(){s==="half-open"?(s="closed",a=0,u=0):s==="closed"&&(a=0)},recordFailure(_){if(s==="half-open"){u++,f();return}s==="closed"&&(a++,a>=e&&f())},get state(){return s},get failureCount(){return a},reset(){s="closed",a=0,u=0,l=0}}}function gn(t,e){let n=e?.onOpen??"skip",o=e?.meta;return r=>{let i=O([],(s,a)=>{function u(){i.meta.breakerState.down([[b,t.state]])}let d=r.subscribe(c=>{for(let l of c){let p=l[0];p===T?a.down([[T]]):p===b?t.canExecute()?(u(),a.emit(l[1])):(u(),n==="error"?a.down([[h,new be]]):a.down([[w]])):p===w?a.down([[w]]):p===y?(t.recordSuccess(),u(),a.down([[y]])):p===h?(t.recordFailure(He(l)),u(),a.down([l])):a.down([l])}});return u(),d},{...j(),meta:{...o??{},breakerState:t.state,...V("withBreaker",{onOpen:n})},completeWhenDepsComplete:!1,initial:r.cache});return{node:i,breakerState:i.meta.breakerState}}}function Ot(t,e,n){if(t<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let o=n?.clock??Ne,r=t,i=o();function s(a){if(e>0){let u=a-i;r=Math.min(t,r+u/1e9*e)}i=a}return{available(){return s(o()),r},tryConsume(a=1){if(a<=0)return!0;let u=o();return s(u),r>=a?(r-=a,!0):!1},putBack(a=1){a<=0||(s(o()),r=Math.min(t,r+a))}}}function bn(t,e){return t.droppedCount===e.droppedCount&&t.pendingCount===e.pendingCount&&t.paused===e.paused}function yn(t,e){let{maxEvents:n,windowNs:o}=e;if(n<=0)throw new RangeError("maxEvents must be > 0");if(o<=0)throw new RangeError("windowNs must be > 0");let r=e.maxBuffer;if(r===void 0)throw new RangeError("rateLimiter requires explicit maxBuffer (use Infinity to opt in to unbounded)");let i=r===1/0;if(!i&&(!Number.isInteger(r)||r<1))throw new RangeError("maxBuffer must be a positive integer (or Infinity for unbounded)");let s=e.onOverflow??"drop-newest",a=n*1e9/o,u=x(d=>{let c=Ot(n,a),l=i?wn():_n(r),p=new ee,f=!1,g=0,_=1e9/a,m=u.meta.droppedCount,N=u.meta.rateLimitState,S=ge;function k(){m.emit(g);let D={droppedCount:g,pendingCount:l.size,paused:l.size>0};bn(S,D)||(S=D,N.emit(D))}S=ge,m.emit(0),N.emit(ge);function B(){for(;l.size>0;)if(c.tryConsume(1))d.emit(l.shift()),k();else{p.start(Math.max(1,_/1e6),B);return}}function F(){g+=1,k()}function P(){for(f=!0,p.cancel();l.size>0;)l.shift();g=0}let C=t.subscribe(D=>{for(let M of D){if(f)return;let I=M[0];if(I===T)d.down([[T]]);else if(I===b){if(!i&&l.size>=r)if(s==="drop-newest")F();else if(s==="drop-oldest")l.shift(),l.push(M[1]),F();else{F(),P(),d.down([[h,new ye(r)]]);return}else l.push(M[1]),k();B()}else if(I===w)d.down([[w]]);else if(I===y)P(),d.down([[y]]);else if(I===h)P(),d.down([M]);else if(I===R){P(),d.down([M]);return}else d.down([M])}});return()=>{f=!0,p.cancel(),C()}},{...j(),initial:t.cache,meta:{...e.meta??{},droppedCount:0,rateLimitState:ge,...V("rateLimiter",e)}});return{node:u,droppedCount:u.meta.droppedCount,rateLimitState:u.meta.rateLimitState}}function _n(t){let e=new me(t);return{push:n=>e.push(n),shift:()=>e.shift(),get size(){return e.size}}}function wn(){let t=[];return{push:e=>{t.push(e)},shift:()=>t.shift(),get size(){return t.length}}}function Tn(t,e){let n=e?.initialStatus??"pending",o=e?.meta,r=O([],(i,s)=>{let a=n;return r.meta.status.down([[b,n]]),r.meta.error.down([[b,null]]),t.subscribe(d=>{for(let c of d){let l=c[0];if(l===T)s.down([[T]]);else if(l===b)a==="errored"?Ae(()=>{r.meta.error.down([[b,null]]),r.meta.status.down([[b,"running"]])}):r.meta.status.down([[b,"running"]]),a="running",s.emit(c[1]);else if(l===w)s.down([[w]]);else if(l===y)r.meta.status.down([[b,"completed"]]),a="completed",s.down([[y]]);else if(l===h){let p=He(c);Ae(()=>{r.meta.error.down([[b,p]]),r.meta.status.down([[b,"errored"]])}),a="errored",s.down([c])}else s.down([c])}})},{...j(),meta:{...o??{},status:n,error:null,...V("withStatus",{initialStatus:n})},completeWhenDepsComplete:!1,resubscribable:!0,initial:t.cache});return{node:r,status:r.meta.status,error:r.meta.error}}function vn(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function xn(t){return t!=null&&typeof t.then=="function"}function Nn(t){return t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function"}function kn(t,e,n){let o=n?.meta;return x(r=>{let i,s;function a(){s?.(),s=void 0,vn(e)||xn(e)||Nn(e)?i=we(e).subscribe(d=>{r.down(d);for(let c of d){let l=c[0];if(l===y||l===h||l===R){i=void 0;return}}}):(r.emit(e),r.down([[y]]))}return s=t.subscribe(u=>{for(let d of u){let c=d[0];if(c===T)r.down([[T]]);else if(c===b)r.emit(d[1]);else if(c===w)r.down([[w]]);else if(c===y)r.down([[y]]);else if(c===h){a();return}else if(c===R){i?.(),r.down([d]);return}else r.down([d])}}),()=>{s?.(),i?.()}},{...j(),initial:t.cache,meta:{...o??{},...V("fallback")}})}function En(t,e,n){if(e<=0)throw new RangeError("timeoutNs must be > 0");let o=n?.meta;return x(r=>{let i=!1,s=new ee;function a(){let d=e/1e6;s.start(d,()=>{i||(i=!0,u(),r.down([[h,new _e(e)]]))})}let u=t.subscribe(d=>{for(let c of d){if(i)return;let l=c[0];if(l===T)r.down([[T]]);else if(l===b)a(),r.emit(c[1]);else if(l===w)r.down([[w]]);else if(l===y){s.cancel(),i=!0,r.down([[y]]);return}else if(l===h){s.cancel(),i=!0,r.down([c]);return}else if(l===R){s.cancel(),i=!0,r.down([c]);return}else r.down([c])}});return a(),()=>{i=!0,s.cancel(),u()}},{...j(),initial:t.cache,meta:{...o??{},...V("timeout",{timeoutNs:e})}})}var be,ye,ge,_e,Mt=v(()=>{"use strict";bt();Oe();de();K();yt();se();Be();Ve();Ct();kt();Et();be=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};ye=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};ge=Object.freeze({droppedCount:0,pendingCount:0,paused:!1});_e=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var Dt={};xe(Dt,{CircuitOpenError:()=>be,RateLimiterOverflowError:()=>ye,TimeoutError:()=>_e,budgetGate:()=>gt,circuitBreaker:()=>mn,fallback:()=>kn,rateLimiter:()=>yn,retry:()=>fn,timeout:()=>En,tokenBucket:()=>Ot,withBreaker:()=>gn,withStatus:()=>Tn});var It=v(()=>{"use strict";Mt()});function A(t){return{describeKind:"producer",...t}}function Ft(t){return/[\\^$+?.()|[\]{}]/.test(t)?`\\${t}`:t}function Sn(t){let e="^";for(let n=0;n<t.length;n+=1){let o=t[n];if(o==="*"){t[n+1]==="*"?(e+=".*",n+=1):e+="[^/]*";continue}e+=Ft(o)}return e+="$",new RegExp(e)}function Rn(t,e){for(let n of e)if(n.test(t))return!0;return!1}function An(t,e){let n=O([t],(r,i)=>{let s=r[0];if(s==null||s.length===0){i.down([[w]]);return}for(let a of s)i.emit(a)},{describeKind:"derived",initial:t.cache}),o=n.subscribe.bind(n);return n.subscribe=(r,i)=>(e(r),o(r,i)),n}function On(t,e){let{signal:n,period:o,...r}=e??{};return x(i=>{let s=!1,a=0,u,d,c=()=>{s=!0,u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),n?.removeEventListener("abort",p)},l=()=>{s||(o!=null?(i.emit(a++),d=setInterval(()=>{s||i.emit(a++)},o)):(s=!0,n?.removeEventListener("abort",p),i.emit(a++),i.down([[y]])))},p=()=>{s||(c(),i.down([[h,n.reason]]))};if(n?.aborted){p();return}return u=setTimeout(l,t),n?.addEventListener("abort",p,{once:!0}),c},A(r))}function Mn(t){let{signal:e,...n}=t??{};return x(o=>{let r=!1,i,s,a=!1,u=!1,d=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,c=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,p=()=>{i!==void 0&&c&&c(i),s!==void 0&&clearTimeout(s),i=void 0,s=void 0},f=()=>{r=!0,p(),a&&(e?.removeEventListener("abort",g),a=!1),u&&l&&(l.removeEventListener("visibilitychange",N),u=!1)},g=()=>{r||(f(),o.down([[h,e.reason]]))},_=S=>{r||(o.emit(S),m())},m=()=>{r||(d&&(!l||l.visibilityState!=="hidden")?i=d(_):s=setTimeout(()=>_(performance.now()),16))},N=()=>{r||(p(),m())};return e?.aborted?(g(),f):(e?.addEventListener("abort",g,{once:!0}),a=e!==void 0,l&&d&&(l.addEventListener("visibilitychange",N),u=!0),m(),f)},A(n))}function Cn(t,e){let n=lt(t),{tickMs:o,output:r,...i}=e??{},s=o??6e4,a=r==="date";return x(u=>{let d=-1,c=()=>{let p=new Date,f=p.getFullYear()*1e8+(p.getMonth()+1)*1e6+p.getDate()*1e4+p.getHours()*100+p.getMinutes();f!==d&&ft(n,p)&&(d=f,u.emit(a?p:ue()))};c();let l=setInterval(c,s);return()=>clearInterval(l)},{...A(i),name:i.name??`cron:${t}`})}function Dn(t,e,n){let{capture:o,passive:r,once:i,...s}=n??{};return x(a=>{let u=c=>{a.emit(c)},d={capture:o,passive:r,once:i};return t.addEventListener(e,u,d),()=>t.removeEventListener(e,u,d)},A(s))}function We(t,e){return x(n=>{let o=!1;try{for(let r of t){if(o)return;n.emit(r)}o||n.down([[y]])}catch(r){o||n.down([[h,r]])}return()=>{o=!0}},A(e))}function In(t){return t!=null&&typeof t.then=="function"}function Bt(t,e){let{signal:n,...o}=e??{};return x(r=>{let i=!1,s=()=>{i||(i=!0,r.down([[h,n.reason]]))};if(n?.aborted){s();return}return n?.addEventListener("abort",s,{once:!0}),Promise.resolve(t).then(a=>{i||(i=!0,n?.removeEventListener("abort",s),r.emit(a),r.down([[y]]))},a=>{i||(i=!0,n?.removeEventListener("abort",s),r.down([[h,a]]))}),()=>{i=!0,n?.removeEventListener("abort",s)}},A(o))}function Pt(t,e){let{signal:n,...o}=e??{};return x(r=>{let i=new AbortController,s=()=>i.abort(n?.reason);n?.aborted?i.abort(n.reason):n?.addEventListener("abort",s,{once:!0});let a=n??i.signal,u=!1,d=t[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(l=>{if(!(u||a.aborted)){if(l.done){r.down([[y]]);return}r.emit(l.value),c()}},l=>{!u&&!a.aborted&&r.down([[h,l]])})};return c(),()=>{u=!0,n?.removeEventListener("abort",s),i.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},A(o))}function Ln(t){return t!=null&&typeof t=="object"&&"cache"in t&&typeof t.subscribe=="function"}function we(t,e){if(Ln(t))return t;if(In(t))return Bt(t,e);if(t!=null){let n=t;if(typeof n[Symbol.asyncIterator]=="function")return Pt(t,e);if(typeof n[Symbol.iterator]=="function")return We(t,e)}return Gt(t)}function Gt(...t){return We(t,void 0)}function Fn(t){return x(e=>{e.down([[y]])},A(t))}function Bn(t){return x(()=>{},A(t))}function Pn(t,e){return x(n=>{n.down([[h,t]])},A(e))}function Gn(t,e){let{signal:n,...o}=e??{},r=A(o),i=r.resubscribable===void 0?{...r,resubscribable:!0}:r;return x(s=>{let a,u=!1;try{let d=t();a=we(d,e).subscribe(l=>{if(!u)for(let p of l){let f=p[0];if(f!==H)if(f===b)s.emit(p[1]);else if(f===y){u=!0,s.down([[y]]);break}else if(f===h){u=!0,s.down([[h,p[1]]]);break}else s.down([p])}})}catch(d){let c=d===void 0?new Error("defer: thunk threw undefined"):d;s.down([[h,c]])}return()=>{u=!0,a?.()}},i)}function Vn(t,e,n){return O([t],(r,i)=>{let s=r[0];if(s!=null&&s.length>0)for(let a of s)e(a)},{describeKind:"effect",...n}).subscribe(()=>{})}function Hn(t,e){return O([t],(n,o,r)=>{r.store.buf||(r.store.buf=[]);let i=r.store.buf,s=n[0];if(s!=null&&s.length>0)for(let a of s)i.push(a);if(r.terminalDeps[0]===!0){o.emit([...i]),o.down([[y]]);return}(s==null||s.length===0)&&o.down([[w]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function zn(t,e){return x(n=>t.subscribe(o=>{n.down(o)}),{...A(e),initial:t.cache})}function $e(t,e,n){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let o=[],r=x(i=>t.subscribe(s=>{for(let a of s)a[0]===b&&(o.push(a[1]),o.length>e&&o.shift());i.down(s)}),{...A(n),initial:t.cache});return An(r,i=>{for(let s of o)i([[b,s]])})}function Un(t,e){return $e(t,1,e)}function Wn(t){return new Promise((e,n)=>{let o=!1,r=!1,i;i=t.subscribe(s=>{for(let a of s){if(o)return;if(a[0]===b){o=!0,e(a[1]),i?(i(),i=void 0):r=!0;return}if(a[0]===h){o=!0,n(a[1]),i?(i(),i=void 0):r=!0;return}if(a[0]===y){o=!0,n(new Error("completed without DATA")),i?(i(),i=void 0):r=!0;return}}}),r&&(i?.(),i=void 0)})}function Ue(t,e,n){return new Promise((o,r)=>{let i=!1,s=!1,a,u=n?.skipCurrent===!0;a=t.subscribe(d=>{for(let c of d){if(i)return;if(!(u&&c[0]===b)){if(c[0]===b){let l=c[1];if(e(l)){i=!0,o(l),a?(a(),a=void 0):s=!0;return}}if(c[0]===h){i=!0,r(c[1]),a?(a(),a=void 0):s=!0;return}if(c[0]===y){i=!0,r(new Error("completed without matching value")),a?(a(),a=void 0):s=!0;return}}}}),u=!1,s&&(a?.(),a=void 0)})}async function $n(t,e){let n=e?.predicate??(i=>i!=null),o=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Ue(t,n,{skipCurrent:o});if(ze===void 0){let[i,s]=await Promise.all([Promise.resolve().then(()=>(It(),Dt)),Promise.resolve().then(()=>(Ve(),Nt))]);ze=i.timeout,Lt=s.NS_PER_MS}let r=ze(t,e.timeoutMs*Lt);return await Ue(r,n,{skipCurrent:o})}function jn(t,e){let n=new AbortController,o=e?.reason??new Error("cancelled via nodeSignal"),r,i=!1,s=()=>{r?(r(),r=void 0):i=!0};return r=t.subscribe(a=>{if(!n.signal.aborted)for(let u of a){if(u[0]===b&&u[1]===!0){n.abort(o),s();return}if(u[0]===h){n.abort(u[1]),s();return}if(u[0]===y){s();return}}}),i&&(r?.(),r=void 0),{signal:n.signal,dispose:()=>{r&&(r(),r=void 0)}}}function Kn(t){return t.subscribe(()=>{})}function Yn(t){let e=ct(0);return{node:e,increment(){let n=e.cache??0;return n>=t?!1:(e.down([[T],[b,n+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=t}}}var ze,Lt,qn,Vt=v(()=>{"use strict";de();K();se();Be();pt();qn=$e});var Jn={};xe(Jn,{awaitSettled:()=>$n,cached:()=>Un,defer:()=>Gn,empty:()=>Fn,escapeRegexChar:()=>Ft,firstValueFrom:()=>Wn,firstWhere:()=>Ue,forEach:()=>Vn,fromAny:()=>we,fromAsyncIter:()=>Pt,fromCron:()=>Cn,fromEvent:()=>Dn,fromIter:()=>We,fromPromise:()=>Bt,fromRaf:()=>Mn,fromTimer:()=>On,globToRegExp:()=>Sn,keepalive:()=>Kn,matchesAnyPattern:()=>Rn,never:()=>Bn,nodeSignal:()=>jn,of:()=>Gt,reactiveCounter:()=>Yn,replay:()=>$e,share:()=>zn,shareReplay:()=>qn,throwError:()=>Pn,toArray:()=>Hn});module.exports=qt(Jn);var Ct=v(()=>{Vt()});Ct();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
|
|
1
|
+
"use strict";var gt=Object.defineProperty;var gr=Object.getOwnPropertyDescriptor;var br=Object.getOwnPropertyNames;var yr=Object.prototype.hasOwnProperty;var G=(n,e)=>()=>(n&&(e=n(n=0)),e);var bt=(n,e)=>{for(var t in e)gt(n,t,{get:e[t],enumerable:!0})},vr=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of br(e))!yr.call(n,o)&&o!==t&>(n,o,{get:()=>e[o],enumerable:!(r=gr(e,o))||r.enumerable});return n};var wr=n=>vr(gt({},"__esModule",{value:!0}),n);function X(){return Math.trunc(performance.now()*1e6)}function ve(){return Date.now()*1e6}var we=G(()=>{"use strict"});var oe,x,M,D,te,q,ne,B,E,N,Te,yt,Tr,vt,_r,Nr,wt,rn,on,sn,Tt,ie=G(()=>{"use strict";oe=Symbol.for("graphrefly/START"),x=Symbol.for("graphrefly/DATA"),M=Symbol.for("graphrefly/DIRTY"),D=Symbol.for("graphrefly/RESOLVED"),te=Symbol.for("graphrefly/INVALIDATE"),q=Symbol.for("graphrefly/PAUSE"),ne=Symbol.for("graphrefly/RESUME"),B=Symbol.for("graphrefly/TEARDOWN"),E=Symbol.for("graphrefly/COMPLETE"),N=Symbol.for("graphrefly/ERROR"),Te=Object.freeze([M]),yt=Object.freeze([D]),Tr=Object.freeze([te]),vt=Object.freeze([oe]),_r=Object.freeze([E]),Nr=Object.freeze([B]),wt=Object.freeze([Te]),rn=Object.freeze([yt]),on=Object.freeze([Tr]),sn=Object.freeze([_r]),Tt=Object.freeze([Nr])});function un(n,e){let t=new TextEncoder().encode(n.name);if(t.length===0||t.length>255)throw new Error(`encodeEnvelope: codec name "${n.name}" encodes to ${t.length} bytes (must be 1\u2013255)`);let r=n.version;if(!Number.isInteger(r)||r<0||r>65535)throw new Error(`encodeEnvelope: codec.version ${r} out of u16 range (expected integer 0\u201365535)`);let o=2+t.length+2+e.length;if(o>4294967295)throw new Error(`encodeEnvelope: total envelope size ${o} exceeds 2^32-1 bytes (payload ${e.length} bytes)`);let s=new Uint8Array(o),i=0;return s[i++]=_t,s[i++]=t.length,s.set(t,i),i+=t.length,s[i++]=r>>>8&255,s[i++]=r&255,s.set(e,i),s}function dn(n,e){if(n.length<an)throw new Error(`decodeEnvelope: bytes too short (${n.length} < ${an})`);let t=0,r=n[t++];if(r!==_t)throw new Error(`decodeEnvelope: unsupported envelope version ${r} (expected ${_t})`);let o=n[t++];if(o===0)throw new Error("decodeEnvelope: name_len must be >= 1");if(t+o+2>n.length)throw new Error(`decodeEnvelope: envelope truncated (need ${t+o+2} bytes, have ${n.length})`);let s=new TextDecoder().decode(n.subarray(t,t+o));t+=o;let i=(n[t]<<8|n[t+1])>>>0;t+=2;let a=n.subarray(t),u=e.lookupCodec(s);if(u==null)throw new Error(`decodeEnvelope: codec "${s}" not registered (envelope codec_v=${i})`);return{codec:u,codecVersion:i,payload:a}}function cn(n){n.registerCodec(Or)}var Or,_t,an,Nt=G(()=>{"use strict";Or={name:"json",version:1,contentType:"application/json",encode(n){let e=JSON.stringify(n);return new TextEncoder().encode(e)},decode(n,e){let t=new TextDecoder().decode(n);return JSON.parse(t)}},_t=1,an=4});function ze(n){if(n==null)return _e;let{type:e,id:t,...r}=n;return{type:e??"system",id:t??"",...r}}var _e,Ot=G(()=>{"use strict";_e={type:"system",id:""}});function Ue(){return Ne>0||De}function ln(){return Ne>0}function ke(n){Ne>0?Me.push(n):n()}function Ge(n){Ne+=1;let e=!1;try{n()}catch(t){throw e=!0,t}finally{if(Ne-=1,Ne===0)if(e){if(!De){let t=Me.splice(0);for(let r of t)try{r()}catch{}ce.length=0,le.length=0,Oe.length=0}}else kr()}}function kr(){let n=!De;n&&(De=!0);let e=[],t=0;try{for(;ce.length>0||le.length>0||Oe.length>0||n&&Me.length>0;){if(n&&Me.length>0){let s=Me.splice(0);for(let i of s)try{i()}catch(a){e.push(a)}continue}if(t+=1,t>1e3)throw ce.length=0,le.length=0,Oe.length=0,new Error("batch drain exceeded 1000 iterations \u2014 likely a reactive cycle");let o=(ce.length>0?ce:le.length>0?le:Oe).splice(0);for(let s of o)try{s()}catch(i){e.push(i)}}}finally{n&&(De=!1)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"batch drain: multiple callbacks threw")}function We(n,e,t){if(e.length===0)return;if(e.length===1){let d=t(e[0][0]);if(d<3||!Ue()){n(e);return}(d>=5?Oe:d===4?le:ce).push(()=>n(e));return}let r=e.length,o=r,s=r,i=r,a=0;for(;a<r&&t(e[a][0])<3;)a++;for(o=a;a<r&&t(e[a][0])===3;)a++;for(s=a;a<r&&t(e[a][0])===4;)a++;i=a;let u=Ue();if(o>0){let d=e.slice(0,o);n(d)}if(s>o){let d=e.slice(o,s);u?ce.push(()=>n(d)):n(d)}if(i>s){let d=e.slice(s,i);u?le.push(()=>n(d)):n(d)}if(r>i){let d=e.slice(i,r);u?Oe.push(()=>n(d)):n(d)}}var Ne,De,ce,le,Oe,Me,He=G(()=>{"use strict";Ne=0,De=!1,ce=[],le=[],Oe=[],Me=[]});function fn(n){n.registerMessageType(oe,{tier:0,wireCrossing:!1}),n.registerMessageType(M,{tier:1,wireCrossing:!1}),n.registerMessageType(te,{tier:1,wireCrossing:!1,metaPassthrough:!1}),n.registerMessageType(q,{tier:2,wireCrossing:!1}),n.registerMessageType(ne,{tier:2,wireCrossing:!1}),n.registerMessageType(x,{tier:3,wireCrossing:!0}),n.registerMessageType(D,{tier:3,wireCrossing:!0}),n.registerMessageType(E,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(N,{tier:4,wireCrossing:!0,metaPassthrough:!1}),n.registerMessageType(B,{tier:5,wireCrossing:!0,metaPassthrough:!1})}var Ke,pn=G(()=>{"use strict";ie();Ke=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.")}}});function kt(n){let e=xr.filter(t=>n({type:t,id:""},"write"));return e.length===0?"restricted":e.includes("human")&&e.includes("llm")&&e.every(t=>t==="human"||t==="llm"||t==="system")?"both":e.length===1?e[0]:e.join("+")}var Q,xr,qe=G(()=>{"use strict";Q=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}},xr=["human","llm","wallet","system"]});function xt(n){if(n===void 0)return null;if(typeof n=="number"){if(!Number.isFinite(n))throw new TypeError(`Cannot hash non-finite number: ${n}`);if(Number.isInteger(n)&&!Number.isSafeInteger(n))throw new TypeError(`Cannot hash integer outside safe range (|n| > 2^53-1): ${n}. Cross-language cid parity is not guaranteed for unsafe integers.`);return n}if(typeof n=="string"||typeof n=="boolean"||n===null)return n;if(Array.isArray(n))return n.map(xt);if(typeof n=="object"&&n!==null){let e={};for(let t of Object.keys(n).sort())e[t]=xt(n[t]);return e}return null}function Sr(n){let e=Rr.encode(n),t=e.length,r=t*8,o=t+9+63&-64,s=new Uint8Array(o);s.set(e),s[t]=128;let i=new DataView(s.buffer);i.setUint32(o-4,r>>>0,!1),i.setUint32(o-8,Math.floor(r/4294967296)>>>0,!1);let a=1779033703,u=3144134277,d=1013904242,c=2773480762,l=1359893119,h=2600822924,p=528734635,f=1541459225,g=new Uint32Array(64),m=(b,y)=>b>>>y|b<<32-y;for(let b=0;b<o;b+=64){for(let k=0;k<16;k++)g[k]=i.getUint32(b+k*4,!1);for(let k=16;k<64;k++){let U=g[k-15],V=g[k-2],I=m(U,7)^m(U,18)^U>>>3,ye=m(V,17)^m(V,19)^V>>>10;g[k]=g[k-16]+I+g[k-7]+ye>>>0}let y=a,v=u,w=d,_=c,R=l,S=h,C=p,A=f;for(let k=0;k<64;k++){let U=m(R,6)^m(R,11)^m(R,25),V=R&S^~R&C,I=A+U+V+Er[k]+g[k]>>>0,ye=m(y,2)^m(y,13)^m(y,22),lt=y&v^y&w^v&w,Ve=ye+lt>>>0;A=C,C=S,S=R,R=_+I>>>0,_=w,w=v,v=y,y=I+Ve>>>0}a=a+y>>>0,u=u+v>>>0,d=d+w>>>0,c=c+_>>>0,l=l+R>>>0,h=h+S>>>0,p=p+C>>>0,f=f+A>>>0}let T=b=>b.toString(16).padStart(8,"0");return T(a)+T(u)+T(d)+T(c)+T(l)+T(h)+T(p)+T(f)}function Et(n){let e=xt(n??null),t=JSON.stringify(e);return Sr(t).slice(0,16)}function Cr(){let n=globalThis.crypto;if(n?.randomUUID)return n.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 Rt(n,e,t){let r=t?.id??Cr();if(n===0)return{id:r,version:0};let s=(t?.hash??Et)(e);return{id:r,version:0,cid:s,prev:null}}function hn(n,e,t){n.version+=1,"cid"in n&&(n.prev=n.cid,n.cid=t(e))}var Er,Rr,mn=G(()=>{"use strict";Er=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]),Rr=new TextEncoder});function yn(n){return{node:n,unsub:null,prevData:void 0,dirty:!1,involvedThisWave:!1,dataBatch:[],terminal:void 0}}function St(n){n.prevData=void 0,n.dirty=!1,n.involvedThisWave=!1,n.dataBatch.length=0,n.terminal=void 0}function Ye(n){return n.length===0?n:typeof n[0]=="symbol"?[n]:n}function W(n,e,t){let r=vn(n)?n:[],o=typeof n=="function"?n:typeof e=="function"?e:void 0,s={};return vn(n)?s=(Ct(e)?e:t)??{}:Ct(n)?s=n:s=(Ct(e)?e:t)??{},new j(r,o,s)}var gn,bn,Ar,Dr,xe,j,vn,Ct,se=G(()=>{"use strict";Nt();Ot();He();we();pn();qe();ie();mn();gn=()=>{},bn=100;Ar=(n,e,t,r)=>{t.direction==="down-in"&&n._onDepMessage(t.depIndex,e)},Dr=(n,e,t,r)=>{let o=n;if(o._status==="completed"||o._status==="errored")return;let s=o._cached,i=s===void 0?[vt]:[vt,[x,s]];o._status==="dirty"&&i.push(Te),We(e,i,o._config.tierOf)},xe=new Ke({onMessage:Ar,onSubscribe:Dr});fn(xe);cn(xe);j=class n{_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??xe,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??Et;let o=r.versioning??this._config.defaultVersioning;this._versioningLevel=o,this._versioning=o!=null?Rt(o,this._cached===void 0?void 0:this._cached,{id:r.versioningId,hash:this._hashFn}):void 0,this._deps=e.map(yn);let s={};for(let[a,u]of Object.entries(r.meta??{})){let d={initial:u,name:`${r.name??"node"}:meta:${a}`,describeKind:"state",config:this._config};r.guard!=null&&(d.guard=r.guard),s[a]=new n([],void 0,d)}Object.freeze(s),this.meta=s,this._hasMeta=Object.keys(s).length>0;let i=this;this._actions={emit(a){i._emit([[x,a]])},down(a){i._emit(Ye(a))},up(a){i._emitUp(Ye(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,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 o=t?.hash??this._hashFn;o!==this._hashFn&&(this._hashFn=o);let s=this._cached===void 0?void 0:this._cached,i=this._versioning,a=i?.id??t?.id,u=i?.version??0,d=Rt(e,s,{id:a,hash:o});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 t=ze(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 o=ze(e?.actor),s=e?.delivery==="signal"?"signal":"write";if(this._guard!=null&&!this._guard(o,s))throw new Q({actor:o,action:s,nodeName:this.name});if(this._extraGuards!=null){for(let i of this._extraGuards)if(!i(o,s))throw new Q({actor:o,action:s,nodeName:this.name})}this._lastMutation={actor:o,timestamp_ns:ve()}}down(e,t){let r=Ye(e);r.length!==0&&(this._checkGuard(t),this._emit(r))}emit(e,t){this._checkGuard(t),this._emit([[x,e]])}up(e,t){if(this._deps.length===0)return;let r=Ye(e);if(r.length===0)return;this._checkGuard(t);let o=t??{internal:!0};this._validateUpTiers(r);for(let s of this._deps)s.node.up?.(r,o)}_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 o=t(r[0]);if(o===3||o===4)throw new Error(`Node "${this.name}": tier-${o} 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 u=ze(t);if(!this._guard(u,"observe"))throw new Q({actor:u,action:"observe",nodeName:this.name})}let o=this._isTerminal&&this._resubscribable;if(o){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)St(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:o},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 i=this._isTerminal;if(this._sinkCount===1&&!i)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[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 o=r,s=this._deps[r];s.unsub=gn,s.unsub=s.node.subscribe(i=>{if(s.unsub===null)return;let a=this._config.tierOf,u=!1;for(let d of i)a(d[0])>=3&&(u=!0),this._config.onMessage(this,d,{direction:"down-in",depIndex:o},this._actions);u&&this._maybeRunFnOnSettlement()}),t++}}catch(r){this._deps[t].unsub=null;for(let o=0;o<t;o++){let s=this._deps[o];if(s.unsub!=null){let i=s.unsub;s.unsub=null;try{i()}catch{}St(s)}}throw this._dirtyDepCount=0,r}}_addDep(e){for(let o=0;o<this._deps.length;o++)if(this._deps[o].node===e)return o;let t=this._deps.length,r=yn(e);if(this._deps.push(r),this._sinks==null)return t;r.dirty=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(wt),r.unsub=gn;try{r.unsub=e.subscribe(o=>{if(r.unsub===null)return;let s=this._config.tierOf,i=!1;for(let a of o)s(a[0])>=3&&(i=!0),this._config.onMessage(this,a,{direction:"down-in",depIndex:t},this._actions);i&&this._maybeRunFnOnSettlement()})}catch(o){throw r.unsub=null,this._deps.pop(),this._dirtyDepCount--,o}return t}_deactivate(e=!1){let t=this._cleanup;if(this._cleanup=void 0,typeof t=="function")try{t()}catch(r){this._emit([[N,this._wrapFnError("cleanup threw",r)]])}else if(t!=null&&typeof t=="object"){let r=t.deactivate;if(typeof r=="function")try{r()}catch(o){this._emit([[N,this._wrapFnError("cleanup.deactivate threw",o)]])}}for(let r of this._deps){if(r.unsub!=null){let o=r.unsub;r.unsub=null;try{o()}catch{}}St(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],o=t[0];if(this._inspectorHooks!=null){let s={kind:"dep_message",depIndex:e,message:t};for(let i of this._inspectorHooks)i(s)}if(o!==oe){if(o===M){this._depDirtied(r);return}if(o===te){if(this._depInvalidated(r),this._cached===void 0)return;this._emit(on);return}if(o===q||o===ne){this._emit([t]);return}if(o===B){this._emit(Tt);return}if(o===x)this._depSettledAsData(r,t[1]);else if(o===D)this._depSettledAsResolved(r);else if(o===E)this._depSettledAsTerminal(r,!0);else if(o===N)this._depSettledAsTerminal(r,t[1]);else{this._emit([t]);return}if(!this._fn){(o===x||o===D)&&this._emit([t]),(o===E||o===N)&&this._maybeAutoTerminalAfterWave();return}}}_depDirtied(e){e.dirty||(e.dirty=!0,e.involvedThisWave=!0,this._dirtyDepCount++,this._status!=="dirty"&&this._emit(wt))}_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(rn),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([[N,e.terminal]]);return}this._autoComplete&&this._deps.every(t=>t.terminal!==void 0)&&this._emit(sn)}_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(i){this._emit([[N,this._wrapFnError("cleanup threw",i)]]);return}}else if(e!=null&&typeof e=="object"){let i=e.beforeRun;if(typeof i=="function"){e.beforeRun=void 0;try{i()}catch(a){this._emit([[N,this._wrapFnError("cleanup.beforeRun threw",a)]]);return}}}let t=this._deps.map(i=>i.involvedThisWave?i.dataBatch.length>0?[...i.dataBatch]:[]:void 0),r=this._deps.map(i=>i.prevData);for(let i=0;i<this._deps.length;i++){let a=t[i];a!=null&&a.length>0&&(this._deps[i].prevData=a[a.length-1])}let o=this._deps.map(i=>i.terminal),s={prevData:r,terminalDeps:o,store:this._store};if(this._hasCalledFnOnce=!0,this._clearWaveFlags(),this._inspectorHooks!=null){let i={kind:"run",batchData:t,prevData:r};for(let a of this._inspectorHooks)a(i)}this._isExecutingFn=!0;try{let i=this._fn(t,this._actions,s);if(typeof i=="function")this._cleanup=i;else if(i!=null&&typeof i=="object"){let a=i;(typeof a.beforeRun=="function"||typeof a.deactivate=="function"||typeof a.invalidate=="function")&&(this._cleanup=i)}}catch(i){this._emit([[N,this._wrapFnError("fn threw",i)]])}finally{this._isExecutingFn=!1,this._pendingRerun?(this._pendingRerun=!1,this._rerunDepth+=1,this._rerunDepth>bn?(this._rerunDepth=0,this._emit([[N,new Error(`Node "${this.name}": _pendingRerun depth exceeded ${bn} \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"?[Te,e[0]]:e;let r=!0,o=!1,s=!1,i=-1;for(let u of e){let d=t(u[0]);d<i&&(r=!1),d===3&&(o=!0),u[0]===M&&(s=!0),i=d}let a=e;if(!r){let u=e.map((d,c)=>({m:d,i:c,tier:t(d[0])}));u.sort((d,c)=>d.tier-c.tier||d.i-c.i),a=u.map(d=>d.m)}if(o&&!s&&this._status!=="dirty"){let u=0;for(;u<a.length&&t(a[u][0])===0;)u++;return u===0?[Te,...a]:[...a.slice(0,u),Te,...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]===N&&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 t=e;if(this._isTerminal&&!this._resubscribable){let a=e.filter(u=>u[0]===B||u[0]===te);if(a.length===0)return;t=a}t=this._frameBatch(t);let o=null;for(let a=0;a<t.length;a++){let u=t[a],d=u[0];if(d!==q&&d!==ne){o?.push(u);continue}if(u.length<2)throw new Error(`Node "${this.name}": [[${d===q?"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 l=u[1];if(d===q)this._pauseLocks==null&&(this._pauseLocks=new Set),this._pauseLocks.add(l),this._paused=!0,this._pausable==="resumeAll"&&this._pauseBuffer==null&&(this._pauseBuffer=[]);else if(this._pauseLocks==null||!this._pauseLocks.has(l))c=!1;else if(this._pauseLocks.delete(l),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?o?.push(u):o==null&&(o=t.slice(0,a))}if(o!=null){if(o.length===0)return;t=o}if(this._hasMeta&&t.some(a=>a[0]===B))for(let a of Object.keys(this.meta))try{this.meta[a]._emit(Tt)}catch{}let{finalMessages:s,equalsError:i}=this._updateState(t);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);i!=null&&this._emit([[N,i]])}_updateState(e){let t=this._config.tierOf,r,o,s=-1,i=0;for(let c of e)t(c[0])===3&&i++;let a=i<=1,u=-1;if(this._versioning!=null&&i>1){for(let c=e.length-1;c>=0;c--)if(e[c][0]===x){u=c;break}}for(let c=0;c<e.length;c++){let l=e[c],h=l[0];if(h===x){if(l.length>=2){let p=!1;if(a&&this._cached!==void 0)try{p=this._equals(this._cached,l[1])}catch(f){o=this._wrapFnError("equals threw",f),s=c;break}if(p){r==null&&(r=e.slice(0,c)),r.push(yt),this._status="resolved";continue}this._cached=l[1],this._versioning!=null&&(u<0||c===u)&&hn(this._versioning,l[1],this._hashFn)}this._status="settled",r?.push(l)}else if(r?.push(l),h===M)this._status="dirty";else if(h===D)this._status="resolved";else if(h===E){this._status="completed";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"completed",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(h===N){this._status="errored";{let p=this._config.rigorRecorder;if(p!=null)try{p.onTerminalTransition(this,"errored",this._autoComplete,this._autoError,this._deps.length>0)}catch{}}}else if(h===te){if(this._cached!==void 0){let f=this._config.rigorRecorder;if(f!=null)try{f.onNonVacuousInvalidate(this,this._cached)}catch{}}this._cached=void 0,this._status="dirty";let p=this._cleanup;if(typeof p=="function"){this._cleanup=void 0;try{p()}catch{}}else if(p!=null&&typeof p=="object"){let f=p.invalidate;if(typeof f=="function")try{f()}catch{}}}else h===B&&(this._resetOnTeardown&&(this._cached=void 0),this._deactivate(!0),this._status="sentinel")}let d=s>=0?r??e.slice(0,s):r??e;return o!=null?{finalMessages:d,equalsError:o}:{finalMessages:d}}_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(ln()){this._batchPendingMessages===null&&(this._batchPendingMessages=[],ke(()=>this._flushBatchPending()));for(let t of e)this._batchPendingMessages.push(t);return}We(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);We(this._deliverToSinks,t,this._config.tierOf)}},vn=n=>Array.isArray(n),Ct=n=>typeof n=="object"&&n!=null&&!Array.isArray(n)});function fe(n,e){return W([],{...e,initial:n})}function F(n,e){return W((r,o,s)=>n(o,s)??void 0,{describeKind:"producer",...e})}function At(n,e,t){return W(n,(o,s,i)=>{let a=o.map((u,d)=>u!=null&&u.length>0?u.at(-1):i.prevData[d]);s.emit(e(a,i))},{describeKind:"derived",...t})}var Je=G(()=>{"use strict";se()});function Pe(n,e,t){let r=new Set;for(let o of n.split(",")){let[s,i]=o.split("/"),a=i?Number.parseInt(i,10):1;if(Number.isNaN(a)||a<1)throw new Error(`Invalid cron step: ${o}`);let u,d;if(s==="*")u=e,d=t;else if(s.includes("-")){let[c,l]=s.split("-");u=Number.parseInt(c,10),d=Number.parseInt(l,10)}else u=Number.parseInt(s,10),d=u;if(Number.isNaN(u)||Number.isNaN(d))throw new Error(`Invalid cron field: ${n}`);if(u<e||d>t)throw new Error(`Cron field out of range: ${n} (${e}-${t})`);if(u>d)throw new Error(`Invalid cron range: ${u}-${d} in ${n}`);for(let c=u;c<=d;c+=a)r.add(c)}return r}function wn(n){let e=n.trim().split(/\s+/);if(e.length!==5)throw new Error(`Invalid cron: expected 5 fields, got ${e.length}`);return{minutes:Pe(e[0],0,59),hours:Pe(e[1],0,23),daysOfMonth:Pe(e[2],1,31),months:Pe(e[3],1,12),daysOfWeek:Pe(e[4],0,6)}}function Tn(n,e){return n.minutes.has(e.getMinutes())&&n.hours.has(e.getHours())&&n.daysOfMonth.has(e.getDate())&&n.months.has(e.getMonth()+1)&&n.daysOfWeek.has(e.getDay())}var _n=G(()=>{"use strict"});function H(n,e,t){return{[n]:!0,[`${n}_type`]:e,...t??{}}}var Dt=G(()=>{"use strict"});function Ie(n,e,t){if(e.length===0)throw new RangeError("budgetGate requires at least one constraint");let r=e.map(p=>p.node),o=[n,...r],s=new Mt,i=!1,a=!1,u=Symbol("budget-gate"),d=new Array(e.length);function c(){return e.every((p,f)=>p.check(d[f]))}function l(p){for(;s.size>0&&c();){let f=s.shift();p.emit(f)}s.size===0&&a&&(a=!1,p.down([[D]]))}return W([],(p,f)=>{for(let m=0;m<e.length;m++)d[m]=e[m].node.cache;let g=[];for(let m=0;m<o.length;m++){let T=o[m];g.push(T.subscribe(b=>{for(let y of b)h(y,m,f)}))}return()=>{for(let m of g)m()}},{...t,describeKind:"derived",meta:H("resilience","budget_gate",t?.meta)});function h(p,f,g){let m=p[0];if(f===0){if(m===x)return c()&&s.size===0?g.emit(p[1]):(s.push(p[1]),i||(i=!0,g.up([[q,u]]))),!0;if(m===M)return g.down([[M]]),!0;if(m===D)return s.size===0?g.down([[D]]):a=!0,!0;if(m===E||m===N){for(;s.size>0;)g.emit(s.shift());return a=!1,i&&(i=!1,g.up([[ne,u]])),g.down([p]),!0}return!1}if(m===x&&(d[f-1]=p[1]),m===x||m===D){let T=c();return T&&s.size>0?(l(g),s.size===0&&i&&(i=!1,g.up([[ne,u]]))):!T&&!i&&s.size>0&&(i=!0,g.up([[q,u]])),!0}return m===M?!0:m===N?(g.down([p]),!0):m===E}}var Mt,Nn=G(()=>{"use strict";ie();se();Dt();Mt=class{buf=[];head=0;get size(){return this.buf.length-this.head}push(e){this.buf.push(e)}shift(){if(this.head>=this.buf.length)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head++,this.head>32&&this.head*2>this.buf.length&&(this.buf=this.buf.slice(this.head),this.head=0),e}clear(){this.buf=[],this.head=0}}});function Pt(n,e){if(e!=null&&e.length>0)return new Set(e);switch(n){case"standard":return new Set(["type","status","value","deps","meta","v"]);case"full":return null;case"spec":return new Set(["type","deps","meta","value"]);default:return new Set(["type","deps"])}}function Mr(n){return n._describeKind!=null?n._describeKind:n._deps.length>0?"derived":n._fn!=null?"producer":"state"}function On(n){let e=new WeakSet,t={};for(let[r,o]of kn(n))t[r]=Gt(o,e);return t}function Gt(n,e){if(n==null)return n;let t=typeof n;if(t==="boolean"||t==="number"||t==="string")return n;if(t==="function")return"<function>";if(Array.isArray(n))return e.has(n)?"<cycle>":(e.add(n),n.map(r=>Gt(r,e)));if(t==="object"){let r=n;if(e.has(r))return"<cycle>";e.add(r);try{if(typeof r.subscribe=="function"&&"cache"in r)return"<Node>"}catch{return"<unserializable>"}let o={};for(let[s,i]of kn(r))o[s]=Gt(i,e);return o}return"<unserializable>"}function kn(n){let e=[],t;try{t=Object.keys(n)}catch{return e}for(let r of t)try{e.push([r,n[r]])}catch{e.push([r,"<unserializable>"])}return e}function re(n,e){let t={factory:n};return e!==void 0&&(t.factoryArgs=e),t}function Gr(n){let e={};for(let[t,r]of Object.entries(n.meta))try{e[t]=r.cache}catch{}return e}function It(n,e,t){let r=e==null,o=!r&&e!=null?[...e].filter(c=>c.startsWith("meta.")).map(c=>c.slice(5)):null,s=r||e.has("meta")||o!=null&&o.length>0,i="state",a=[];n instanceof j&&(i=Mr(n),a=n._deps.map(c=>c.node.name??""));let u={type:i,deps:a};(r||e.has("status"))&&(u.status=n.status);let d=n instanceof j?n._guard:void 0;if(s){let c={...Gr(n)};if(d!=null&&c.access===void 0&&(c.access=kt(d)),o!=null&&o.length>0&&!e.has("meta")){let l={};for(let h of o)h in c&&(l[h]=c[h]);u.meta=l}else u.meta=c}if(n.name!=null&&(u.name=n.name),(r||e.has("value"))&&(!t||i==="state")){n.status==="sentinel"&&(u.sentinel=!0);try{u.value=n.cache}catch{}}if((r||e.has("v"))&&n.v!=null){let c={id:n.v.id,version:n.v.version};"cid"in n.v&&(c.cid=n.v.cid,c.prev=n.v.prev),u.v=c}return(r||e.has("guard"))&&d!=null&&(u.guard=kt(d)),(r||e.has("lastMutation"))&&n.lastMutation!=null&&(u.lastMutation=n.lastMutation),u}var $e=G(()=>{"use strict";qe();se()});function xn(n){let e=new WeakSet,t=new WeakSet,r=[n],o=0;for(;r.length>0;){let s=r.pop();o+=Ir(s,e,t,r)}return o}function Ir(n,e,t,r){if(n==null)return 0;switch(typeof n){case"number":return z.number;case"boolean":return z.boolean;case"string":return z.string+n.length*2;case"bigint":return z.bigint+$r(n);case"symbol":return z.symbol;case"function":return e.has(n)?0:(e.add(n),z.function);case"undefined":return 0}let s=n;if(e.has(s))return 0;e.add(s);let i=s[Pr];if(typeof i=="function")try{let d=i.call(s);if(typeof d=="number"&&Number.isFinite(d))return d}catch{}if(s instanceof Date)return z.date;if(s instanceof RegExp)return z.regexp+s.source.length*2;if(s instanceof Error){let d=s.message?s.message.length*2:0,c=s.stack?s.stack.length*2:0;return z.error+d+c}if(typeof URL<"u"&&s instanceof URL)return z.url+s.href.length*2;if(typeof Promise<"u"&&s instanceof Promise)return z.promise;if(s instanceof WeakMap)return z.weakmap;if(s instanceof WeakSet)return z.weakset;if(s instanceof Map){let d=z.map;for(let[c,l]of s)d+=z.mapEntry,r.push(c),r.push(l);return d}if(s instanceof Set){let d=z.set;for(let c of s)d+=z.setEntry,r.push(c);return d}if(Array.isArray(s)){let d=z.array+s.length*8;for(let c of s)r.push(c);return d}if(s instanceof ArrayBuffer)return t.has(s)?0:(t.add(s),s.byteLength);if(ArrayBuffer.isView(s)){let d=s;return t.has(d.buffer)?48:(t.add(d.buffer),d.buffer.byteLength+48)}let a=z.object,u=Object.keys(s);for(let d of u){a+=z.string+d.length*2;try{r.push(s[d])}catch{}}return a}function $r(n){let e=n<0n?-n:n;if(e===0n)return 0;let t=e.toString(2).length;return Math.ceil(t/32)*8}var z,Pr,En=G(()=>{"use strict";z={object:56,array:64,string:40,number:8,boolean:4,null:0,undefined:0,symbol:40,bigint:16,function:120,map:72,set:72,mapEntry:40,setEntry:24,date:24,regexp:48,error:64,url:80,promise:48,weakmap:40,weakset:40},Pr=Symbol.for("sizeof")});function Rn(n,e,t,r={}){let o=e in n.nodes,s=t in n.nodes;if(!o)return Ze(e,t,"no-such-from");if(!s)return Ze(e,t,"no-such-to");let i=r.maxDepth;if(i!=null&&(!Number.isInteger(i)||i<0))throw new Error("explainPath: maxDepth must be an integer >= 0");if(e===t){if(r.findCycle===!0){let d=Lr(n,e,r);if(d!=null)return d}let u=Xe(e,n.nodes[e],0,r);return Qe(e,t,[u])}if(i===0)return Ze(e,t,"no-path");let a=Sn(n,e,t,i);return a.found?Qe(e,t,Cn(n,a.pathOrder,r)):Ze(e,t,a.truncated?"max-depth-exceeded":"no-path")}function Sn(n,e,t,r){let o=new Map,s=[{path:t,depth:0}],i=new Set([t]),a=0,u=!1;for(;a<s.length;){let l=s[a++];if(l.path===e)break;if(r!=null&&l.depth>=r){let g=n.nodes[l.path];g?.deps&&g.deps.length>0&&(u=!0);continue}let h=n.nodes[l.path];if(h==null)continue;let p=h.deps??[],f=new Map;for(let g=0;g<p.length;g++){let m=p[g];if(!m)continue;let T=f.get(m);T==null&&(T=[],f.set(m,T)),T.push(g)}for(let[g,m]of f)i.has(g)||(i.add(g),o.set(g,{from:l.path,depIndices:m}),s.push({path:g,depth:l.depth+1}))}if(!o.has(e))return{found:!1,pathOrder:[],truncated:u};let d=[{path:e}],c=e;for(;c!==t;){let l=o.get(c);if(l==null)return{found:!1,pathOrder:[],truncated:!1};d[d.length-1].depIndices=l.depIndices,d.push({path:l.from}),c=l.from}return{found:!0,pathOrder:d,truncated:!1}}function Lr(n,e,t){let r=n.nodes[e];if(r==null)return null;let o=r.deps??[],s=[];for(let a=0;a<o.length;a++)o[a]===e&&s.push(a);if(s.length>0){let a=Xe(e,r,0,t);a.dep_index=s[0];let u=Xe(e,r,1,t);return Qe(e,e,[a,u])}let i=null;for(let a=0;a<o.length;a++){let u=o[a];if(!u||u===e)continue;let d=Sn(n,u,e,t.maxDepth);d.found&&(i==null||d.pathOrder.length<i.pathOrder.length)&&(i=d,i={found:!0,pathOrder:[{path:e,depIndices:[a]},...d.pathOrder],truncated:!1})}return i==null?null:Qe(e,e,Cn(n,i.pathOrder,t))}function Cn(n,e,t){return e.map((r,o)=>{let s=n.nodes[r.path],i=Xe(r.path,s,o,t);return r.depIndices!=null&&r.depIndices.length>0&&(i.dep_index=r.depIndices[0],r.depIndices.length>1&&(i.dep_indices=[...r.depIndices])),i})}function Xe(n,e,t,r){let o={path:n,type:e.type,hop:t};e.status!==void 0&&(o.status=e.status),"value"in e&&(o.value=e.value),e.v!=null&&(o.v=e.v);let s=r.annotations?.get(n)??e.annotation;s!=null&&(o.annotation=s);let i=r.lastMutations?.get(n)??e.lastMutation;return i!=null&&(o.lastMutation=i),o}function Qe(n,e,t){return An(n,e,!0,"ok",t)}function Ze(n,e,t){return An(n,e,!1,t,[])}function An(n,e,t,r,o){let s=Fr(n,e,t,r,o);return{from:n,to:e,found:t,reason:r,steps:o,text:s,toJSON(){return{from:n,to:e,found:t,reason:r,steps:o}}}}function Fr(n,e,t,r,o){if(!t)switch(r){case"no-such-from":return`explainPath: no node named "${n}"`;case"no-such-to":return`explainPath: no node named "${e}"`;case"max-depth-exceeded":return`explainPath: no path from "${n}" to "${e}" within maxDepth`;default:return`explainPath: no path from "${n}" to "${e}"`}let s=[`Causal path: ${n} \u2192 ${e} (${o.length} step(s))`];for(let i of o){let u=` ${i.hop===0?"\xB7":"\u2193"} ${i.path} (${i.type}${i.status?`/${i.status}`:""})`;if(s.push(u),"value"in i&&s.push(` value: ${Br(i.value)}`),i.annotation!=null&&s.push(` annotation: ${i.annotation}`),i.lastMutation!=null){let d=i.lastMutation.actor;s.push(` actor: ${d.type}${d.id?`:${d.id}`:""}`)}}return s.join(`
|
|
2
|
+
`)}function Br(n){if(n===void 0)return"<sentinel>";if(n===null)return"null";if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean"||typeof n=="bigint")return String(n);try{let e=JSON.stringify(n);return e.length>80?`${e.slice(0,77)}...`:e}catch{return String(n)}}var Dn=G(()=>{"use strict"});function $t(n,e){if(Object.is(n,e))return!0;if(n==null||e==null||typeof n!="object"||typeof e!="object")return!1;if(Array.isArray(n)){if(!Array.isArray(e)||n.length!==e.length)return!1;for(let s=0;s<n.length;s++)if(!$t(n[s],e[s]))return!1;return!0}if(Array.isArray(e))return!1;let t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;let o=new Set(r);for(let s of t)if(!o.has(s)||!$t(n[s],e[s]))return!1;return!0}function Mn(n,e){return`${n}\0${e}`}function Lt(n,e){let t=[],r=new Set(n.subgraphs),o=new Set(e.subgraphs),s=[];for(let m of o)r.has(m)||s.push(m);s.sort();for(let m of s)t.push({type:"subgraph-mounted",path:m});let i=new Set(Object.keys(n.nodes)),a=new Set(Object.keys(e.nodes)),u=[];for(let m of a)i.has(m)||u.push(m);u.sort();for(let m of u)t.push({type:"node-added",path:m,node:{...e.nodes[m]}});let d=[];for(let m of a){if(!i.has(m))continue;let T=n.nodes[m]?.meta,b=e.nodes[m]?.meta;T==null&&b==null||$t(T??{},b??{})||d.push(m)}d.sort();for(let m of d)t.push({type:"node-meta-changed",path:m,prevMeta:n.nodes[m]?.meta??{},nextMeta:e.nodes[m]?.meta??{}});let c=new Map;for(let m of n.edges)c.set(Mn(m.from,m.to),m);let l=new Map;for(let m of e.edges)l.set(Mn(m.from,m.to),m);let h=[];for(let[m,T]of l)c.has(m)||h.push(T);h.sort((m,T)=>m.from<T.from?-1:m.from>T.from?1:m.to<T.to?-1:m.to>T.to?1:0);for(let m of h)t.push({type:"edge-added",from:m.from,to:m.to});let p=[];for(let[m,T]of c)l.has(m)||p.push(T);p.sort((m,T)=>m.from<T.from?-1:m.from>T.from?1:m.to<T.to?-1:m.to>T.to?1:0);for(let m of p)t.push({type:"edge-removed",from:m.from,to:m.to});let f=[];for(let m of i)a.has(m)||f.push(m);f.sort();for(let m of f)t.push({type:"node-removed",path:m});let g=[];for(let m of r)o.has(m)||g.push(m);g.sort();for(let m of g)t.push({type:"subgraph-unmounted",path:m});return{events:t,flushedAt_ns:X()}}var Gn=G(()=>{"use strict";we()});var ae,Ft=G(()=>{"use strict";ae=class{_timer;_gen=0;start(e,t){this.cancel(),this._gen+=1;let r=this._gen;this._timer=setTimeout(()=>{this._timer=void 0,r===this._gen&&t()},e)}cancel(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}get pending(){return this._timer!==void 0}}});var pe,Bt=G(()=>{"use strict";pe=class{constructor(e){this.capacity=e;if(!Number.isInteger(e)||e<=0)throw new Error(`RingBuffer capacity must be a positive integer (got ${e})`);this.buf=new Array(e)}buf;head=0;_size=0;get size(){return this._size}get maxSize(){return this.capacity}push(e){let t=(this.head+this._size)%this.capacity;this.buf[t]=e,this._size<this.capacity?this._size++:this.head=(this.head+1)%this.capacity}shift(){if(this._size===0)return;let e=this.buf[this.head];return this.buf[this.head]=void 0,this.head=(this.head+1)%this.capacity,this._size--,e}at(e){if(this._size===0)return;let t=e<0?this._size+e:e;if(!(t<0||t>=this._size))return this.buf[(this.head+t)%this.capacity]}toArray(){let e=new Array(this._size);for(let t=0;t<this._size;t++)e[t]=this.buf[(this.head+t)%this.capacity];return e}clear(){for(let e=0;e<this._size;e++)this.buf[(this.head+e)%this.capacity]=void 0;this.head=0,this._size=0}}});function Pn(n,e){let t=e?.topN??10,r=n.describe({detail:"standard"}),o=[],s=n._collectObserveTargets;typeof s=="function"&&s.call(n,"",o);let i=new Map;for(let[h,p]of o)i.set(h,p);let a=[];for(let[h,p]of Object.entries(r.nodes)){let f=i.get(h),g=f instanceof j?f:null,m=g?xn(g.cache):0,T=g?g._sinkCount:0,b=p.deps?.length??0,y=p.type==="effect"&&T===0,v=T===0?p.type==="effect"?"orphan-effect":p.type==="derived"?"idle-derived":p.type==="producer"?"idle-producer":null:null;a.push({path:h,type:p.type,status:p.status??"unknown",valueSizeBytes:m,subscriberCount:T,depCount:b,isOrphanEffect:y,orphanKind:v})}let u=a.reduce((h,p)=>h+p.valueSizeBytes,0),d=(h,p)=>[...a].sort(p??((f,g)=>g[h]-f[h])).slice(0,t),c=a.filter(h=>h.orphanKind!=null),l=a.filter(h=>h.isOrphanEffect);return{nodeCount:a.length,edgeCount:r.edges.length,subgraphCount:r.subgraphs.length,nodes:a,totalValueSizeBytes:u,hotspots:{byValueSize:d("valueSizeBytes"),bySubscriberCount:d("subscriberCount"),byDepCount:d("depCount")},orphans:c,orphanEffects:l}}var In=G(()=>{"use strict";se();En()});function $n(n,e){let t=Math.max(16,n.size*4),r=0;for(;n.size>0;){if(r++>=t){console.error(`[Graph "${e}".destroy] disposer drain exceeded cap (${t}); ${n.size} disposer(s) discarded`),n.clear();return}let o=n.values().next();if(o.done)return;let s=o.value;n.delete(s);try{s()}catch(i){console.error(`[Graph "${e}".destroy] disposer threw:`,i)}}}function jn(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"&&typeof n.down=="function"}function Vr(n){if(n!=null)return jn(n)?n.cache:n}function me(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"&&typeof n.down=="function"}function ue(n){return me(n)?n.cache??"":n}function Ln(n){return me(n)?n.cache??0:n}function Fn(n){return me(n)?n.cache??!1:n}function jr(n){let e=[];for(let t of Object.keys(n).sort()){let r=n[t].v;r!=null&&e.push(`${t} ${r.id} ${r.version}`)}return e.join(`
|
|
3
|
+
`)}function Bn(n){if(n.version!==he)throw new Error(`unsupported snapshot version ${String(n.version)} (expected ${he})`);for(let e of["name","nodes","edges","subgraphs"])if(!(e in n))throw new Error(`snapshot missing required key "${e}"`);if(typeof n.name!="string")throw new TypeError("snapshot 'name' must be a string");if(typeof n.nodes!="object"||n.nodes===null||Array.isArray(n.nodes))throw new TypeError("snapshot 'nodes' must be an object");if(!Array.isArray(n.edges))throw new TypeError("snapshot 'edges' must be an array");if(!Array.isArray(n.subgraphs))throw new TypeError("snapshot 'subgraphs' must be an array")}function zr(n,e){let t=new WeakMap,r=(o,s)=>{if(Object.is(o,s))return!0;if(o==null||s==null||typeof o!="object"||typeof s!="object")return!1;let i=t.get(o);if(i==null&&(i=new WeakSet,t.set(o,i)),i.has(s))return!0;i.add(s);let a=o.constructor,u=s.constructor;if(a!==u)return!1;if(o instanceof Date)return o.getTime()===s.getTime();if(o instanceof RegExp)return o.source===s.source&&o.flags===s.flags;if(Array.isArray(o)){let h=s;if(o.length!==h.length)return!1;for(let p=0;p<o.length;p++)if(!r(o[p],h[p]))return!1;return!0}if(o instanceof Map){let h=s;if(o.size!==h.size)return!1;for(let[p,f]of o)if(!h.has(p)||!r(f,h.get(p)))return!1;return!0}if(o instanceof Set){let h=s;if(o.size!==h.size)return!1;for(let p of o){let f=!1;for(let g of h)if(r(p,g)){f=!0;break}if(!f)return!1}return!0}if(ArrayBuffer.isView(o)){let h=o,p=s;if(h.length!==p.length)return!1;for(let f=0;f<h.length;f++)if(h[f]!==p[f])return!1;return!0}let d=Object.keys(o),c=Object.keys(s);if(d.length!==c.length)return!1;let l=new Set(c);for(let h of d)if(!l.has(h)||!r(o[h],s[h]))return!1;return!0};return r(n,e)}function Ur(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function et(n){let e="^";for(let t=0;t<n.length;t+=1){let r=n[t];if(r==="*"){e+=".*";continue}if(r==="?"){e+=".";continue}if(r==="["){let o=n.indexOf("]",t+1);if(o<=t+1){e+="\\[";continue}let s=n.slice(t+1,o);s.startsWith("!")&&(s=`^${s.slice(1)}`),s=s.replace(/\\/g,"\\\\"),e+=`[${s}]`,t=o;continue}e+=Ur(r)}return e+="$",new RegExp(e)}function Vt(n){if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean"||n==null)return String(n);try{return JSON.stringify(n)}catch{return"[unserializable]"}}function Kr(n){return n==="none"?Hr:n==="ansi"||n==null?Wr:{data:n.data??"",dirty:n.dirty??"",resolved:n.resolved??"",invalidate:n.invalidate??"",pause:n.pause??"",resume:n.resume??"",complete:n.complete??"",error:n.error??"",teardown:n.teardown??"",derived:n.derived??"",path:n.path??"",reset:n.reset??""}}function Vn(n){if(n==null)return{};let e=n.detail;return e==="full"?{...n,structured:n.structured??!0,timeline:n.timeline??!0,causal:n.causal??!0,derived:n.derived??!0}:e==="minimal"?{...n,structured:n.structured??!0}:n.format==="stage-log"?{...n,structured:n.structured??!0,timeline:n.timeline??!0}:n}function qr(n,e,t){for(let r=0;r<n.length;r++){let o=n.charCodeAt(r);if(o<32||o===127)throw new Error(`Graph "${e}": ${t} "${n}" must not contain control character (U+${o.toString(16).padStart(4,"0").toUpperCase()} at index ${r})`)}}function jt(n,e,t){if(n==="")throw new Error(`Graph "${e}": ${t} name must be non-empty`);if(n.includes(L))throw new Error(`Graph "${e}": ${t} "${n}" must not contain '${L}' (path separator)`);if(n===ee)throw new Error(`Graph "${e}": ${t} name "${ee}" is reserved for meta companion paths`);qr(n,e,t)}function Yr(n,e){if(n==="")throw new Error(`Graph "${e}": resolve path must be non-empty`);let t=n.split(L);for(let r of t)if(r==="")throw new Error(`Graph "${e}": resolve path has empty segment`);return t}function Jr(n,e){let t=!1;for(let o of n)if(!e.isMetaPassthrough(o[0])){t=!0;break}return t?n.filter(o=>e.isMetaPassthrough(o[0])):n}function zn(n){for(let e of n._mounts.values())zn(e);for(let e of n._nodes.values())try{e.down([[B]],{internal:!0})}catch{}}function Un(n,e){let t=Ee.diff(n,e),r={};for(let o of t.nodesAdded){let s=e.nodes[o];s!=null&&(r[o]=s)}return{...t,nodesAddedFull:r}}function zt(n,e,t,r={}){let o={paths:[],depths:new Map,truncated:!1};if(!e)return r.withDetail?o:[];if(!r.both&&t!=="upstream"&&t!=="downstream")throw new Error('reachable: direction must be "upstream" or "downstream"');let s=r.maxDepth;if(s!=null&&(!Number.isInteger(s)||s<0))throw new Error("reachable: maxDepth must be an integer >= 0");if(s===0)return r.withDetail?o:[];let i=new Map,a=new Map,u=new Map,d=new Map,c=new Set;for(let[y,v]of Object.entries(n.nodes)){if(!y)continue;c.add(y);let w=v.deps??[];i.set(y,w);for(let _ of w)_&&(c.add(_),a.has(_)||a.set(_,new Set),a.get(_).add(y))}for(let y of n.edges){if(y==null||typeof y!="object")continue;let v=typeof y.from=="string"?y.from:"",w=typeof y.to=="string"?y.to:"";!v||!w||(c.add(v),c.add(w),d.has(v)||d.set(v,new Set),d.get(v).add(w),u.has(w)||u.set(w,new Set),u.get(w).add(v))}if(!c.has(e))return r.withDetail?o:[];let l=r.both===!0,h=y=>{if(l){let R=i.get(y)??[],S=u.get(y),C=a.get(y),A=d.get(y),k=[...R];return S&&k.push(...S),C&&k.push(...C),A&&k.push(...A),k}if(t==="upstream"){let R=i.get(y)??[],S=u.get(y);return S?[...R,...S]:R}let v=a.get(y),w=d.get(y),_=v?[...v]:[];return w&&_.push(...w),_},p=new Set([e]),f=new Map,g=[{path:e,depth:0}],m=0,T=!1;for(;m<g.length;){let y=g[m++];if(s!=null&&y.depth>=s){h(y.path).length>0&&(T=!0);continue}for(let v of h(y.path))!v||p.has(v)||(p.add(v),f.set(v,y.depth+1),g.push({path:v,depth:y.depth+1}))}let b=[...f.keys()].sort((y,v)=>y<v?-1:y>v?1:0);return r.withDetail?{paths:b,depths:f,truncated:T}:b}function Zr(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],o=e[t];if(r.path!==o.path||r.type!==o.type||r.status!==o.status||r.hop!==o.hop||r.dep_index!==o.dep_index||r.annotation!==o.annotation||r.value!==o.value||r.lastMutation!==o.lastMutation)return!1;let s=r.v,i=o.v;if(s!==i&&(s==null||i==null||s.id!==i.id||s.version!==i.version))return!1}return!0}var L,ee,he,Wr,Hr,Ee,Wn=G(()=>{"use strict";Ot();He();we();qe();ie();$e();se();Je();Gn();tt();Ft();Bt();Nt();Dn();In();L="::",ee="__meta__",he=1;Wr={data:"\x1B[32m",dirty:"\x1B[33m",resolved:"\x1B[36m",invalidate:"\x1B[93m",pause:"\x1B[90m",resume:"\x1B[96m",complete:"\x1B[34m",error:"\x1B[31m",teardown:"\x1B[91m",derived:"\x1B[35m",path:"\x1B[90m",reset:"\x1B[0m"},Hr={data:"",dirty:"",resolved:"",invalidate:"",pause:"",resume:"",complete:"",error:"",teardown:"",derived:"",path:"",reset:""};Ee=class n{name;opts;config;_nodes=new Map;_nodeToName=new WeakMap;_mounts=new Map;_parent=void 0;_storageDisposers=new Set;_disposers=new Set;_destroyed=!1;_topology;_topologyEmitters=new Set;_factory;_factoryArgs;constructor(e,t){if(e==="")throw new Error("Graph name must be non-empty");if(e.includes(L))throw new Error(`Graph name must not contain '${L}' (got "${e}")`);if(e===ee)throw new Error(`Graph name "${ee}" is reserved for meta companion paths`);this.name=e,this.opts=Object.freeze({...t??{}}),this.config=t?.config??xe,this._traceRing=new pe(t?.traceCapacity??1e3),t?.versioning!=null&&this.setVersioning(t.versioning),typeof t?.factory=="string"&&(this._factory=t.factory,t.factoryArgs!==void 0&&(this._factoryArgs=t.factoryArgs))}tagFactory(e,t){return this._factory=e,this._factoryArgs=t,this}ancestors(e=!0){let t=[],r=e?this:this._parent;for(;r!=null;)t.push(r),r=r._parent;return t}get topology(){return this._topology==null&&(this._topology=F(e=>{let t=r=>{e.emit(r)};return this._topologyEmitters.add(t),()=>{this._topologyEmitters.delete(t)}},{name:`${this.name}_topology`})),this._topology}_emitTopology(e){if(!(this._topology==null||this._topologyEmitters.size===0))for(let t of this._topologyEmitters)t(e)}nameOf(e){return this._nodeToName.get(e)}add(e,t){let r=e.name,o=t?.name??r;if(o==null||o==="")throw new Error(`Graph "${this.name}": graph.add requires a non-empty name \u2014 pass via opts.name or set it on the node (e.g. state(0, { name: "x" }))`);let s=o,i=t?.annotation;if(jt(s,this.name,"add"),this._mounts.has(s))throw new Error(`Graph "${this.name}": name "${s}" is already a mount point`);if(this._nodes.has(s))throw new Error(`Graph "${this.name}": node "${s}" already exists`);let a=this._nodeToName.get(e);if(a!==void 0)throw new Error(`Graph "${this.name}": node instance already registered as "${a}"`);return this._nodes.set(s,e),this._nodeToName.set(e,s),this._emitTopology({kind:"added",name:s,nodeKind:"node"}),i!=null&&(this._annotations.set(s,i),this.config.inspectorEnabled&&this._traceRing.push({path:s,annotation:i,timestamp_ns:X()})),e}setVersioning(e){if(e!=null)for(let t of this._nodes.values())t instanceof j&&t._applyVersioning(e)}remove(e){jt(e,this.name,"remove");let t=this._mounts.get(e);if(t){let s={kind:"mount",nodes:[],mounts:[]},i=[];t._collectObserveTargets("",i);for(let[a,u]of i)a.includes(`${L}${ee}${L}`)||s.nodes.push(a);return s.nodes.sort(),s.mounts.push(e),s.mounts.push(...t._collectSubgraphs(`${e}${L}`)),this._mounts.delete(e),t._parent=void 0,zn(t),this._emitTopology({kind:"removed",name:e,nodeKind:"mount",audit:s}),s}let r=this._nodes.get(e);if(!r)throw new Error(`Graph "${this.name}": unknown node or mount "${e}"`);this._nodes.delete(e),this._nodeToName.delete(r),r.down([[B]],{internal:!0});let o={kind:"node",nodes:[e],mounts:[]};return this._emitTopology({kind:"removed",name:e,nodeKind:"node",audit:o}),o}removeAll(e){let t=typeof e=="function"?e:(()=>{let s=et(e);return i=>s.test(i)})(),r={kind:"mount",nodes:[],mounts:[]},o=[...this._nodes.keys(),...this._mounts.keys()].filter(s=>t(s));for(let s of o){let i=this.remove(s);r.nodes.push(...i.nodes),r.mounts.push(...i.mounts)}return r.nodes.sort(),r.mounts.sort(),r}[Symbol.iterator](){let e=[...this._nodes.keys()].sort(),t=this._nodes,r=0;return{[Symbol.iterator](){return this},next(){if(r>=e.length)return{value:void 0,done:!0};let o=e[r++];return{value:[o,t.get(o)],done:!1}}}}node(e){if(e==="")throw new Error(`Graph "${this.name}": node name must be non-empty`);if(e.includes(L))return this.resolve(e);let t=this._nodes.get(e);if(!t)throw new Error(`Graph "${this.name}": unknown node "${e}"`);return t}get(e){return this.node(e).cache}set(e,t,r){let o=r?.internal===!0;this.node(e).down([[x,t]],{actor:r?.actor,internal:o,delivery:"write"})}setAll(e,t){let r=Symbol.iterator in e?e:Object.entries(e);Ge(()=>{for(let[o,s]of r)this.set(o,s,t)})}invalidate(e,t){let r=t?.internal===!0;this.node(e).down([[te]],{actor:t?.actor,internal:r,delivery:"write"})}error(e,t,r){let o=r?.internal===!0;this.node(e).down([[N,t]],{actor:r?.actor,internal:o,delivery:"write"})}complete(e,t){let r=t?.internal===!0;this.node(e).down([[E]],{actor:t?.actor,internal:r,delivery:"write"})}edges(e){let t=e?.recursive===!0,r=new Map;if(!t){for(let[u,d]of this._nodes)r.set(d,u);let a=[];for(let[u,d]of this._nodes)if(d instanceof j)for(let c of d._deps){let l=r.get(c.node);l!=null&&a.push([l,u])}return a.sort((u,d)=>u[0]<d[0]?-1:u[0]>d[0]?1:u[1]<d[1]?-1:u[1]>d[1]?1:0),a}let o=[];this._collectObserveTargets("",o);let s=new Map;for(let[a,u]of o)s.set(u,a);let i=[];for(let[a,u]of o)if(u instanceof j)for(let d of u._deps){let c=s.get(d.node);c!=null&&i.push([c,a])}return i.sort((a,u)=>a[0]<u[0]?-1:a[0]>u[0]?1:a[1]<u[1]?-1:a[1]>u[1]?1:0),i}mount(e,t){if(t===void 0){let o=new n(e);return this.mount(e,o)}if(typeof t=="function"){let o=new n(e);return t(o),this.mount(e,o)}let r=t;if(jt(e,this.name,"mount"),this._nodes.has(e))throw new Error(`Graph "${this.name}": cannot mount at "${e}" \u2014 node with that name exists`);if(this._mounts.has(e))throw new Error(`Graph "${this.name}": mount "${e}" already exists`);if(r===this)throw new Error(`Graph "${this.name}": cannot mount a graph into itself`);if(r._parent!=null)throw new Error(`Graph "${this.name}": this child graph is already mounted on "${r._parent.name}"`);for(let o=this;o!=null;o=o._parent)if(o===r)throw new Error(`Graph "${this.name}": mount("${e}", \u2026) would create a mount cycle`);return this._mounts.set(e,r),r._parent=this,this._emitTopology({kind:"added",name:e,nodeKind:"mount"}),r}resolve(e){let t=Yr(e,this.name);return this._resolveFromSegments(t)}tryResolve(e){try{return this.resolve(e)}catch{return}}_resolveFromSegments(e){let t=e;if(t[0]===this.name&&(t=t.slice(1),t.length===0))throw new Error(`Graph "${this.name}": resolve path ends at graph name only`);let r=t[0],o=t.slice(1);if(o.length===0){let a=this._nodes.get(r);if(a)return a;throw this._mounts.has(r)?new Error(`Graph "${this.name}": path ends at subgraph "${r}" \u2014 not a node (GRAPHREFLY-SPEC \xA73.5)`):new Error(`Graph "${this.name}": unknown name "${r}"`)}let s=this._nodes.get(r);if(s&&o.length>0&&o[0]===ee)return this._resolveMetaChainFromNode(s,o,t.join(L));let i=this._mounts.get(r);if(!i)throw this._nodes.has(r)?new Error(`Graph "${this.name}": "${r}" is a node; trailing path "${o.join(L)}" is invalid`):new Error(`Graph "${this.name}": unknown mount or node "${r}"`);return i.resolve(o.join(L))}_resolveMetaChainFromNode(e,t,r){let o=e,s=0,i=[...t];for(;s<i.length;){if(i[s]!==ee)throw new Error(`Graph "${this.name}": expected ${ee} segment in meta path "${r}"`);if(s+1>=i.length)throw new Error(`Graph "${this.name}": meta path requires a key after ${ee} in "${r}"`);let a=i[s+1],u=o.meta[a];if(!u)throw new Error(`Graph "${this.name}": unknown meta "${a}" in path "${r}"`);o=u,s+=2}return o}signal(e,t){if(t?.internal!==!0){for(let o of e)if(this.config.messageTier(o[0])===3)throw new Error(`Graph "${this.name}": Graph.signal() rejects tier-3 messages (DATA / RESOLVED). Broadcast is for control-plane tiers (START / DIRTY / INVALIDATE / PAUSE / RESUME / COMPLETE / ERROR / TEARDOWN). For per-node value writes, use Graph.set or graph.node(name).down(...).`)}let r=[];if(this._signalDeliver(e,t??{},new Set,r),r.length>0)throw r[0]}_signalDeliver(e,t,r,o){for(let u of this._mounts.values())u._signalDeliver(e,t,r,o);let i=t.internal===!0?{internal:!0}:{actor:t.actor,delivery:"signal"},a=Jr(e,this.config);for(let u of[...this._nodes.keys()].sort()){let d=this._nodes.get(u);if(!r.has(d)){r.add(d);try{d.down(e,i)}catch(c){if(c instanceof Q)throw c;o.push(c)}a.length!==0&&this._signalMetaSubtree(d,a,r,i,o)}}}_signalMetaSubtree(e,t,r,o,s){for(let i of Object.keys(e.meta).sort()){let a=e.meta[i];if(!r.has(a)){r.add(a);try{a.down(t,o)}catch(u){if(u instanceof Q)throw u;s.push(u)}this._signalMetaSubtree(a,t,r,o,s)}}}describe(e){if(e?.reactive==="diff")return this._describeReactiveDiff(e);if(e?.reactive===!0)return this._describeReactive(e);let t=Vr(e?.actor),r=e?.filter;if(e?.detail!=null&&e?.fields!=null)throw new TypeError("Graph.describe(): pass either `detail` or `fields`, not both. `detail: 'spec'` is the canonical spec projection; use `fields` only when you need a custom subset.");let o=Pt(e?.detail,e?.fields),s=e?.detail==="spec",i=o,a=[];this._collectObserveTargets("",a);let u=new Map;for(let[v,w]of a)u.set(w,v);let d=[];{let v=a.map(([,R])=>R),w=new Set(u.values()),_=0;for(;v.length>0;){let R=v.shift();if(R instanceof j)for(let S of R._deps){let C=S.node;if(u.has(C))continue;let A=C.name??"",k=A;if(!k||w.has(k))if(A){let U=2;for(;w.has(`${A}#${U}`);)U++;k=`${A}#${U}`}else for(k=`__internal__/${_++}`;w.has(k);)k=`__internal__/${_++}`;u.set(C,k),w.add(k),d.push([k,C]),v.push(C)}}}let c=[...a,...d],l={};for(let[v,w]of c){if(t!=null&&!w.allowsObserve(t))continue;let _=It(w,i,s),R=w instanceof j?w._deps.map(k=>u.get(k.node)??k.node.name??""):[],{name:S,...C}=_,A={...C,deps:R};if(!s){let k=this._annotations.get(v);k!=null&&(A.annotation=k)}if(r!=null)if(typeof r=="function"){let k=r;if(!(k.length>=2?k(v,A):k(A)))continue}else{let k=!0;for(let[U,V]of Object.entries(r)){let I=U==="deps_includes"?"depsIncludes":U==="meta_has"?"metaHas":U;if(I==="depsIncludes"){if(!A.deps.includes(String(V))){k=!1;break}continue}if(I==="metaHas"){if(!Object.hasOwn(A.meta??{},String(V))){k=!1;break}continue}if(A[I]!==V){k=!1;break}}if(!k)continue}l[v]=A}let h=new Set(Object.keys(l)),p=[];for(let[v,w]of c)if(w instanceof j)for(let _ of w._deps){let R=u.get(_.node);R!=null&&p.push([R,v])}p.sort((v,w)=>v[0]<w[0]?-1:v[0]>w[0]?1:v[1]<w[1]?-1:v[1]>w[1]?1:0);let f=p.map(([v,w])=>({from:v,to:w}));(t!=null||r!=null)&&(f=f.filter(v=>h.has(v.from)&&h.has(v.to)));let g=this._collectSubgraphs(""),m=t!=null||r!=null?g.filter(v=>{let w=`${v}${L}`;return[...h].some(_=>_===v||_.startsWith(w))}):g,T=this,b=e;return{name:this.name,nodes:l,edges:f,subgraphs:m,...this._factory!==void 0?{factory:this._factory}:{},...this._factoryArgs!==void 0?{factoryArgs:this._factoryArgs}:{},expand(v){let w={...b};return Array.isArray(v)?(w.fields=v,w.detail=void 0):(w.detail=v,w.fields=void 0),T.describe(w)}}}_collectSubgraphs(e){let t=[];for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${r}`;t.push(o),t.push(...this._mounts.get(r)._collectSubgraphs(`${o}${L}`))}return t}resourceProfile(e){return Pn(this,e)}reachable(e,t,r={}){return r.withDetail===!0?zt(this.describe(),e,t,{...r,withDetail:!0}):zt(this.describe(),e,t,r)}explain(e,t,r){return r?.reactive===!0?this._explainReactive(e,t,r):this._explainStatic(ue(e),ue(t),{...r?.maxDepth!==void 0?{maxDepth:Ln(r.maxDepth)}:{},...r?.findCycle!==void 0?{findCycle:Fn(r.findCycle)}:{}})}_explainStatic(e,t,r){let o=this.describe({detail:"full"}),s=new Map(this._annotations),i=new Map;for(let[a,u]of Object.entries(o.nodes))u.lastMutation!=null&&i.set(a,u.lastMutation);return Rn(o,e,t,{...r?.maxDepth!=null?{maxDepth:r.maxDepth}:{},...r?.findCycle===!0?{findCycle:!0}:{},annotations:s,lastMutations:i})}_describeReactive(e){let t={...e,reactive:!1},r=e.reactiveName??"describe",o=0,s=fe(o,{name:`${r}_version`}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ke(()=>{a=!1,!u&&(o+=1,s.emit(o))}))},c=i.onEvent(b=>{let y=b.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||d()}),l=[],h=new WeakSet,p=b=>{if(h.has(b)||u)return;h.add(b);let y=b.topology.subscribe(v=>{for(let w of v){if(w[0]!==x)continue;let _=w[1];if(d(),_.kind==="added"&&_.nodeKind==="mount"){let R=b._mounts.get(_.name);R!=null&&p(R)}}});l.push(y);for(let v of b._mounts.keys()){let w=b._mounts.get(v);w!=null&&p(w)}};p(this);let f,g=e.actor;jn(g)&&(f=g.subscribe(b=>{let y=!1,v=!1;for(let w of b){let _=w[0];_===x?y=!0:(_===E||_===N||_===B)&&(v=!0)}y&&d(),v&&(f?.(),f=void 0,d())}));let m;try{m=At([s],()=>this.describe(t),{name:r,describeKind:"derived",meta:{domain:"audit",kind:"describe"},equals:(b,y)=>b===y})}catch(b){c(),f?.();for(let y of l)y();throw i.dispose(),b}let T=Le(m);return{node:m,dispose(){u=!0,c(),f?.();for(let b of l)b();l.length=0,i.dispose(),T()}}}_describeReactiveDiff(e){let t={...e,reactive:!1},r=e.reactiveName??"describe-diff",o={name:this.name,nodes:{},edges:[],subgraphs:[]},s=this.describe(t),i=Lt(o,s),a=fe(i,{name:r,meta:{domain:"audit",kind:"describe-diff"},equals:(h,p)=>h===p}),u=this._describeReactive({...e,reactiveName:void 0}),d=!1,c=u.node.subscribe(h=>{if(!d)for(let p of h){if(p[0]!==x)continue;let f=p[1],g=Lt(s,f);s=f,g.events.length!==0&&a.emit(g)}}),l=Le(a);return{node:a,dispose(){d=!0,c(),u.dispose(),a.down([[B,"describe-diff disposed"]]),l()}}}_explainReactive(e,t,r){let o=0,s=fe(o,{name:"explain_version"}),i=this.observe({timeline:!0,structured:!0}),a=!1,u=!1,d=()=>{a||u||(a=!0,ke(()=>{a=!1,!u&&(o+=1,s.emit(o))}))},c=i.onEvent(b=>{let y=b.type;y!=="data"&&y!=="error"&&y!=="complete"&&y!=="teardown"||d()}),l=[];e!=null&&me(e)&&l.push(e),t!=null&&me(t)&&l.push(t),r?.maxDepth!=null&&me(r.maxDepth)&&l.push(r.maxDepth),r?.findCycle!=null&&me(r.findCycle)&&l.push(r.findCycle);let h=()=>{for(let b of l)if(b.cache===void 0)return!1;return!0},p=()=>{let b=ue(e),y=ue(t);return{from:b,to:y,found:!1,reason:"pending",steps:[],text:"(awaiting reactive args)",toJSON:()=>({from:b,to:y,found:!1,reason:"pending",steps:[]})}},f;try{f=At([s],()=>{if(!h())return p();let b=ue(e),y=ue(t),v={...r?.maxDepth!==void 0?{maxDepth:Ln(r.maxDepth)}:{},...r?.findCycle!==void 0?{findCycle:Fn(r.findCycle)}:{}};return this._explainStatic(b,y,v)},{name:r?.name??"explain",describeKind:"derived",meta:{domain:"audit",kind:"explain_path",from:ue(e),to:ue(t)},equals:(b,y)=>b.found===y.found&&b.reason===y.reason&&b.steps.length===y.steps.length&&Zr(b.steps,y.steps)})}catch(b){throw c(),i.dispose(),b}let g=Le(f),m=[],T=b=>{let y;return y=b.subscribe(v=>{let w=!1,_=!1;for(let R of v){let S=R[0];S===x?w=!0:(S===E||S===N||S===B)&&(_=!0)}(w||_)&&d(),_&&y&&(y(),y=void 0)}),()=>{y&&(y(),y=void 0)}};for(let b of l)m.push(T(b));return{node:f,dispose(){u=!0,c();for(let b of m)b?.();m.length=0,i.dispose(),g()}}}_pathsMatching(e){let t=et(e),r=[];return this._collectObserveTargets("",r),r.map(([o])=>o).filter(o=>t.test(o))}_collectObserveTargets(e,t){for(let r of[...this._mounts.keys()].sort()){let o=e===""?r:`${e}${L}${r}`;this._mounts.get(r)._collectObserveTargets(o,t)}for(let r of[...this._nodes.keys()].sort()){let o=this._nodes.get(r),s=e===""?r:`${e}${L}${r}`;t.push([s,o]),this._appendMetaObserveTargets(s,o,t)}}_appendMetaObserveTargets(e,t,r){for(let o of Object.keys(t.meta).sort()){let s=t.meta[o],i=`${e}${L}${ee}${L}${o}`;r.push([i,s]),this._appendMetaObserveTargets(i,s,r)}}observe(e,t){let r=typeof e=="string",s=Vn(r?t:e);if(s.reactive===!0)return this._observeReactive(r?e:void 0,s);let i=s.structured===!0||s.timeline===!0||s.causal===!0||s.derived===!0||s.detail==="minimal"||s.detail==="full"||s.format!=null,a=s.actor;if(r){let c=e,l=this.resolve(c);if(a!=null&&!l.allowsObserve(a))throw new Q({actor:a,action:"observe",nodeName:c});return i?this._buildStructuredObserver([[c,l]],s,"one"):{subscribe(h){return l.subscribe(h)},up(h){try{l.up?.(h)}catch(p){if(p instanceof Q)return;throw p}}}}let u=[];this._collectObserveTargets("",u),u.sort((c,l)=>c[0]<l[0]?-1:c[0]>l[0]?1:0);let d=a==null?u:u.filter(([,c])=>c.allowsObserve(a));return i?this._buildStructuredObserver(d,s,"all"):{subscribe:c=>{let l=d.map(([h,p])=>p.subscribe(f=>{c(h,f)}));return()=>{for(let h of l)h()}},up:(c,l)=>{try{this.resolve(c).up?.(l)}catch(h){if(h instanceof Q)return;throw h}}}}_observeReactive(e,t){let r=t.tiers,o=r!=null?new Set(r):null,s=t.reactiveName??"observe";return F(i=>{let a=[],u=!1,d=!1,c=()=>{if(a.length===0||d)return;let g={events:a.slice(),flushedAt_ns:X()};a.length=0,i.emit(g)},l={...t,reactive:!1,structured:!0,timeline:!0},h=e!=null?this.observe(e,l):this.observe(l),p=g=>{d||(a.push(g),!u&&(u=!0,ke(()=>{u=!1,c()})))};for(let g of h.events)p(g);let f=h.onEvent(p);return()=>{d=!0,f(),h.dispose()}},{name:s,meta:{domain:"audit",kind:"observe-reactive"}})}_buildStructuredObserver(e,t,r){let o=r==="one"?e[0]?.[0]:void 0,s=i=>{if(r==="one"&&o!=null){let c=this.resolve(o);return this._buildStructuredObserver([[o,c]],i,"one")}let a=[];this._collectObserveTargets("",a),a.sort((c,l)=>c[0]<l[0]?-1:c[0]>l[0]?1:0);let u=i.actor,d=u==null?a:a.filter(([,c])=>c.allowsObserve(u));return this._buildStructuredObserver(d,i,"all")};return this._createObserveResult(e,t,s)}_createObserveResult(e,t,r){let o=t.timeline===!0,s=t.causal===!0,i=t.derived===!0,a=t.detail==="minimal",u=this.config.inspectorEnabled,d=(s||i)&&u,c=t.maxEvents,l=c!=null&&c>0?new pe(c):null,h=[],p=new Set,f=t.tiers!=null?new Set(t.tiers):null,g={},m=new Set,T=0,b=0,y=0,v=0,w=0,_=0,R=!1,S=!1,C=0,A=new Map,k=new Map,U=new Map,V=O=>{if(!(f!=null&&!f.has(O.type))){l?l.push(O):h.push(O);for(let $ of p)$(O)}},I=O=>f==null||f.has(O),ye=()=>o?{timestamp_ns:X(),in_batch:Ue(),batch_id:C}:{},lt=(O,$)=>{if(!(!d||!(O instanceof j)))return O._setInspectorHook(J=>{if(J.kind==="dep_message")A.set(O,J.depIndex);else if(J.kind==="run"){let Ae=J.batchData.map((P,K)=>P!=null&&P.length>0?P.at(-1):J.prevData[K]);k.set(O,Ae);let Z=J.batchData.map(P=>P!=null?[...P]:void 0);U.set(O,Z),i&&V({type:"derived",path:$,dep_values:Ae,dep_batches:Z,...ye()})}})},Ve=O=>{let $=A.get(O),J=k.get(O);if(!s||J==null)return{};let Z=($!=null&&$>=0&&O instanceof j?O._deps[$]:void 0)?.node,P=Z?.v,K=U.get(O);return{trigger_dep_index:$,trigger_dep_name:Z?.name,...P!=null?{trigger_version:{id:P.id,version:P.version}}:{},dep_values:[...J],...K!=null?{dep_batches:K}:{}}},en=[],tn=[];for(let[O,$]of e){let J=lt($,O);J&&en.push(J),tn.push($.subscribe(Ae=>{C++;for(let Z of Ae){let P=Z[0],K=ye();if(P===x){g[O]=Z[1];let mt=$ instanceof j?$.lastMutation?.actor??_e:_e;V({type:"data",path:O,data:Z[1],actor:mt,...K,...Ve($)})}else if(a)P===M?I("dirty")&&T++:P===D?I("resolved")&&b++:P===te?I("invalidate")&&y++:P===q?I("pause")&&v++:P===ne?I("resume")&&w++:P===B?I("teardown")&&_++:P===E&&!m.has(O)?I("complete")&&(R=!0):P===N&&I("error")&&(S=!0,m.add(O));else if(P===M)I("dirty")&&T++,V({type:"dirty",path:O,...K});else if(P===D)I("resolved")&&b++,V({type:"resolved",path:O,...K,...Ve($)});else if(P===te)I("invalidate")&&y++,V({type:"invalidate",path:O,...K});else if(P===q)I("pause")&&v++,V({type:"pause",path:O,lockId:Z[1],...K});else if(P===ne)I("resume")&&w++,V({type:"resume",path:O,lockId:Z[1],...K});else if(P===E)I("complete")&&!m.has(O)&&(R=!0),V({type:"complete",path:O,...K});else if(P===N){I("error")&&(S=!0,m.add(O));let mt=$ instanceof j?$.lastMutation?.actor??_e:_e;V({type:"error",path:O,data:Z[1],actor:mt,...K})}else P===B&&(I("teardown")&&_++,V({type:"teardown",path:O,...K}))}}))}let ft=!1,pt=()=>{if(!ft){ft=!0;for(let O of tn)O();for(let O of en)O();for(let O of je)O({value:void 0,done:!0});je.length=0}},ht=[],je=[];p.add(O=>{let $=je.shift();$?$({value:O,done:!1}):ht.push(O)});let nn={get values(){return g},get dirtyCount(){return T},get resolvedCount(){return b},get invalidateCount(){return y},get pauseCount(){return v},get resumeCount(){return w},get teardownCount(){return _},get events(){return l?l.toArray():[...h]},get anyCompletedCleanly(){return R},get anyErrored(){return S},get completedWithoutErrors(){return R&&!S},onEvent(O){return p.add(O),()=>p.delete(O)},dispose:pt,expand(O){pt();let $={...t};return typeof O=="string"?$.detail=O:Object.assign($,O),r(Vn($))},[Symbol.asyncIterator](){return{next(){return ht.length>0?Promise.resolve({value:ht.shift(),done:!1}):ft?Promise.resolve({value:void 0,done:!0}):new Promise(O=>je.push(O))},return(){return pt(),Promise.resolve({value:void 0,done:!0})}}}};return t.format!=null&&this._attachFormatLogger(nn,t),nn}_attachFormatLogger(e,t){let r=t.format;if(r==null)return;let o=t.logger??(f=>console.log(f)),s=t.includeTypes?new Set(t.includeTypes):null,i=t.excludeTypes?new Set(t.excludeTypes):null,a=s==null&&i==null?()=>!0:f=>(s==null||s.has(f))&&(i==null||!i.has(f)),u=Kr(t.theme),d=r==="stage-log"?X():0,c=f=>f==null?"":t.stageLabels?.[f]??f,l=(f,g)=>f.length>g?`${f.slice(0,g-1)}\u2026`:f,h=f=>f.type==="data"||f.type==="error"?l(Vt(f.data),120):"",p=f=>{if(r==="stage-log"){let R=(X()-d)/1e9,S=c(f.path).padEnd(9);if(f.type==="data"){let C=h(f);return`[${R.toFixed(3)}s] ${S} \u2190${C?` ${C}`:""}`}if(f.type==="error"){let C=h(f);return`[${R.toFixed(3)}s] ${S} \u2717${C?` ${C}`:""}`}return f.type==="complete"?`[${R.toFixed(3)}s] ${S} \u25A0 complete`:`[${R.toFixed(3)}s] ${S} ${f.type}`}if(r==="json")try{return JSON.stringify(f)}catch{return JSON.stringify({type:f.type,path:f.path,data:"[unserializable]"})}let g=u[f.type]??"",m=f.path?`${u.path}${f.path}${u.reset} `:"",T=f.type==="data"||f.type==="error",b=f.type==="pause"||f.type==="resume",y=T?` ${Vt(f.data)}`:b?` ${Vt(f.lockId)}`:"",v=f.type==="data"||f.type==="resolved"||f.type==="derived"?f:void 0,w=v?.trigger_dep_name!=null?` <- ${v.trigger_dep_name}`:v?.trigger_dep_index!=null?` <- #${v.trigger_dep_index}`:"",_=f.in_batch?" [batch]":"";return`${m}${g}${f.type.toUpperCase()}${u.reset}${y}${w}${_}`};e.onEvent(f=>{a(f.type)&&o(p(f),f)})}addDisposer(e){return this._disposers.add(e),()=>{this._disposers.delete(e)}}destroy(){$n(this._disposers,this.name),this.signal([[B]],{internal:!0}),$n(this._storageDisposers,this.name);for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}get destroyed(){return this._destroyed}_destroyClearOnly(){for(let e of[...this._mounts.values()])e._parent=void 0,e._destroyClearOnly();this._mounts.clear(),this._nodes.clear(),this._parent=void 0,this._destroyed=!0}snapshot(e){let{expand:t,...r}=this.describe({detail:"full"}),o={};for(let a of Object.keys(r.nodes).sort()){let{lastMutation:u,guard:d,...c}=r.nodes[a];o[a]=c}let s=[...r.subgraphs].sort(),i={...r,version:1,nodes:o,subgraphs:s};if(e?.format==null)return i;if(e.format==="json-string")return JSON.stringify(i);if(e.format==="bytes"){if(e.codec==null)throw new Error("snapshot({format: 'bytes'}) requires a `codec` name");let a=this.config.lookupCodec(e.codec);if(a==null)throw new Error(`snapshot: codec "${e.codec}" is not registered on this graph's config. Call config.registerCodec(...) before creating nodes.`);return un(a,a.encode(i))}throw new Error(`snapshot: unknown format "${String(e.format)}"`)}static decode(e,t){let r=t?.config??xe,{codec:o,codecVersion:s,payload:i}=dn(e,r);return o.decode(i,s)}restore(e,t){if(Bn(e),e.name!==this.name)throw new Error(`Graph "${this.name}": restore snapshot name "${e.name}" does not match this graph`);let r=t?.only==null?null:(Array.isArray(t.only)?t.only:[t.only]).map(s=>et(s)),o=t?.includeProducers===!0;for(let s of Object.keys(e.nodes).sort()){if(r!==null&&!r.some(a=>a.test(s)))continue;let i=e.nodes[s];if(i!==void 0){if(!("value"in i)||i.value===void 0){"value"in i&&i.value===void 0&&t?.onError?.(s,new Error(`restore: slice.value is undefined for "${s}" (undefined is the global SENTINEL; not valid DATA)`));continue}if(!(i.type==="derived"||i.type==="effect")&&!(i.type==="producer"&&!o)){if(i.v!=null){let u=this.tryResolve(s)?.v;if(u!=null&&u.id===i.v.id&&u.version===i.v.version)continue}try{this.set(s,i.value)}catch(a){t?.onError?.(s,a)}}}}}static fromSnapshot(e,t){Bn(e);let r=typeof t=="function"?t:t?.build,o=typeof t=="function"?void 0:t?.factories,s=new n(e.name);if(r)return r(s),s.restore(e),s;for(let p of[...e.subgraphs].sort((f,g)=>{let m=f.split(L).length,T=g.split(L).length;return m!==T?m-T:f<g?-1:f>g?1:0})){let f=p.split(L),g=s;for(let m of f)g._mounts.has(m)||g.mount(m,new n(m)),g=g._mounts.get(m)}let i=o?Object.entries(o).map(([p,f])=>({re:et(p),factory:f})):[],a=p=>{for(let f of i)if(f.re.test(p))return f.factory},u=p=>{let f=p.split(L),g=f.pop();if(g==null||g.length===0)throw new Error(`invalid snapshot path "${p}"`);let m=s;for(let T of f){let b=m._mounts.get(T);if(!b)throw new Error(`unknown mount "${T}" in path "${p}"`);m=b}return[m,g]},d=Object.entries(e.nodes).filter(([p])=>!p.includes(`${L}${ee}${L}`)).sort((p,f)=>p[0]<f[0]?-1:p[0]>f[0]?1:0),c=new Map(d),l=new Map,h=!0;for(;c.size>0&&h;){h=!1;for(let[p,f]of[...c.entries()]){let g=f?.deps??[];if(!g.every(w=>l.has(w)))continue;let[m,T]=u(p),b={...f?.meta??{}},y=a(p),v;if(f?.type==="state")v=fe(f.value,{meta:b});else{if(y==null)continue;v=y(T,{path:p,type:f.type,value:f.value,meta:b,deps:g,resolvedDeps:g.map(w=>l.get(w))})}m.add(v,{name:T}),l.set(p,v),c.delete(p),h=!0}}if(c.size>0){let p=[...c.keys()].sort().join(", ");throw new Error(`Graph.fromSnapshot could not reconstruct nodes without build callback: ${p}. Pass matching factories via fromSnapshot(data, { factories: { pattern: factoryFn } }).`)}return s.restore(e),s}toJSON(){return this.snapshot()}attachSnapshotStorage(e,t={}){let r=e.map(d=>({tier:d,debounceMs:Math.max(0,d.debounceMs??0),compactEvery:Math.max(1,d.compactEvery??10),timer:void 0,seq:0,lastSnapshot:void 0,lastFingerprint:"",disposed:!1,savePending:void 0}));t.autoRestore===!0&&this._cascadeRestore(e,t.onError);let o=(d,c)=>{if(d.disposed)return;let l=jr(c.nodes);if(d.lastSnapshot!=null&&l!==""&&l===d.lastFingerprint)return;let h=d.seq+1,p=ve(),m=d.lastSnapshot==null||h%d.compactEvery===0?{name:this.name,mode:"full",snapshot:c,seq:h,timestamp_ns:p,format_version:he}:{name:this.name,mode:"diff",diff:Un(d.lastSnapshot,c),seq:h,timestamp_ns:p,format_version:he};if(d.tier.filter&&!d.tier.filter(m))return;let T;try{T=d.tier.save(m)}catch(b){t.onError?.(b,d.tier);return}if(T&&typeof T.then=="function"){let v=(d.savePending??Promise.resolve()).then(()=>T,()=>T).then(()=>{d.disposed||(d.seq=h,d.lastSnapshot=c,d.lastFingerprint=l)},w=>{t.onError?.(w,d.tier)});d.savePending=v.finally(()=>{d.savePending===v&&(d.savePending=void 0)})}else d.seq=h,d.lastSnapshot=c,d.lastFingerprint=l},s=(d,c)=>{try{o(d,c)}catch(l){t.onError?.(l,d.tier)}},i=(d,c)=>{if(!c.some(f=>{let g=this.config.messageTier(f[0]);return g>=3&&g<5}))return;if(t.filter){let f=this.tryResolve(d);if(f==null)return;let g=It(f,Pt("standard"));if(!t.filter(d,g))return}let h,p=()=>(h==null&&(h=this.snapshot()),h);for(let f of r)f.disposed||(f.debounceMs===0?s(f,p()):(f.timer==null&&(f.timer=new ae),f.timer.start(f.debounceMs,()=>{f.disposed||s(f,this.snapshot())})))},a;if(t.paths!=null){let c=(typeof t.paths=="string"?this._pathsMatching(t.paths):t.paths).map(l=>{let h=this.tryResolve(l);return h==null?()=>{}:h.subscribe(p=>i(l,p))});a=()=>{for(let l of c)l()}}else a=this.observe().subscribe((d,c)=>i(d,c));let u=()=>{a();for(let d of r)d.disposed=!0,d.timer?.cancel();this._storageDisposers.delete(u)};return this._storageDisposers.add(u),{dispose:u}}async _cascadeRestore(e,t){for(let r of e){let o;try{o=await r.load?.()}catch(i){t?.(i,r);continue}if(o==null||typeof o!="object"||Array.isArray(o))continue;let s=o;try{if(s.mode==="full"&&s.snapshot!=null)return this.restore(s.snapshot),!0;if(s.version===he&&s.nodes!=null)return this.restore(s),!0}catch(i){t?.(i,r)}}return!1}static async fromStorage(e,t,r){for(let o of t){let s;try{s=await o.load?.()}catch(u){r?.onError?.(u,o);continue}if(s==null||typeof s!="object"||Array.isArray(s))continue;let i=s,a=i.mode==="full"&&i.snapshot!=null?i.snapshot:i.version===he&&i.nodes!=null?i:void 0;if(a!=null)try{return n.fromSnapshot(a,r)}catch(u){r?.onError?.(u,o)}}throw new Error(`Graph.fromStorage: no tier held a restorable record for "${e}" across ${t.length} tier(s)`)}_annotations=new Map;_traceRing;trace(e,t,r){if(e!=null&&t!=null){if(this.tryResolve(e)==null)return;if(this._annotations.set(e,t),this.config.inspectorEnabled){let o={path:e,annotation:t,timestamp_ns:X(),...r?.actor!=null?{actor:r.actor}:{}};this._traceRing.push(o)}return}return e!=null?this.config.inspectorEnabled?this._annotations.get(e):void 0:this.config.inspectorEnabled?this._traceRing.toArray():[]}annotation(e){return this._annotations.get(e)}clearTrace(){this._annotations.clear(),this._traceRing.clear()}pruneTrace(e){let t=this._traceRing.toArray().filter(o=>!e(o)),r=this._traceRing.size-t.length;this._traceRing.clear();for(let o of t)this._traceRing.push(o);return r}static diff(e,t){let r=new Set(Object.keys(e.nodes)),o=new Set(Object.keys(t.nodes)),s=[...o].filter(b=>!r.has(b)).sort(),i=[...r].filter(b=>!o.has(b)).sort(),a=[],u=[];for(let b of r){if(!o.has(b))continue;let y=e.nodes[b],v=t.nodes[b],w=y.v,_=v.v;w!=null&&_!=null&&w.id===_.id&&w.version!==_.version&&u.push({path:b,id:w.id,from:w.version,to:_.version});let R=w!=null&&_!=null&&w.id===_.id&&w.version===_.version;for(let S of["type","status","sentinel"]){let C=y[S],A=v[S];C!==A&&a.push({path:b,field:S,from:C,to:A})}if(!R)for(let S of["value","meta"]){let C=y[S],A=v[S];zr(C,A)||a.push({path:b,field:S,from:C,to:A})}}let d=b=>`${b.from} ${b.to}`,c=new Set(e.edges.map(d)),l=new Set(t.edges.map(d)),h=t.edges.filter(b=>!c.has(d(b))),p=e.edges.filter(b=>!l.has(d(b))),f=new Set(e.subgraphs),g=new Set(t.subgraphs),m=[...g].filter(b=>!f.has(b)).sort(),T=[...f].filter(b=>!g.has(b)).sort();return{nodesAdded:s,nodesRemoved:i,nodesChanged:a,versionChanges:u,edgesAdded:h,edgesRemoved:p,subgraphsAdded:m,subgraphsRemoved:T}}}});var Hn=G(()=>{"use strict";Wn()});var Xn={};bt(Xn,{NS_PER_MS:()=>de,NS_PER_SEC:()=>Re,constant:()=>Kn,decorrelatedJitter:()=>Zn,exponential:()=>Yn,fibonacci:()=>Jn,linear:()=>qn,resolveBackoffPreset:()=>Ut,withMaxAttempts:()=>eo});function ge(n){return n<0?0:n}function Xr(n,e){return e==="none"?n:e==="full"?Math.random()*n:n/2+Math.random()*(n/2)}function Qr(n,e){return n+Math.random()*(e-n)}function Kn(n){let e=ge(n);return()=>e}function qn(n,e){let t=ge(n),r=e===void 0?t:ge(e);return o=>t+r*Math.max(0,o)}function Yn(n){let e=ge(n?.baseNs??1e8),t=n?.factor!==void 0&&n.factor<1?1:n?.factor??2,r=ge(n?.maxDelayNs??30*1e9),o=n?.jitter??"none";return s=>{let i;if(e===0)i=0;else if(t===1)i=e;else{let a=r/e,u=1;for(let d=0;d<Math.max(0,s);d++){if(u>=a){u=a;break}u*=t}i=e*u,i>r&&(i=r)}return Xr(i,o)}}function Jn(n=100*1e6,e=30*1e9){let t=ge(n),r=ge(e);function o(s){if(s<=0)return 1;let i=1,a=2;for(let u=1;u<s;u++){let d=i+a;i=a,a=d}return a}return s=>{let i=o(s)*t;return i<=r?i:r}}function Zn(n=100*1e6,e=30*1e9){return(t,r,o)=>{let i=Math.min(e,(o??n)*3);return Qr(n,i)}}function eo(n,e){return(t,r,o)=>t>=e?null:n(t,r,o)}function Ut(n){if(n==="constant")return Kn(1*1e9);if(n==="linear")return qn(1*1e9);if(n==="exponential")return Yn();if(n==="fibonacci")return Jn();if(n==="decorrelatedJitter")return Zn();throw new Error(`Unknown backoff preset: "${String(n)}". Use one of: constant, linear, exponential, fibonacci, decorrelatedJitter`)}var de,Re,Wt=G(()=>{"use strict";de=1e6,Re=1e9});function to(n){return{describeKind:"derived",...n}}function no(n,e,t){let r,o=!1,s=()=>{o||(o=!0,t())};return r=n.subscribe(i=>{let a=!1,u=!1;for(let d of i)d[0]!==oe&&(d[0]===x?e.emit(d[1]):d[0]===E?a=!0:d[0]===N?(u=!0,e.down([d])):(d[0]===M||d[0]===D)&&e.down([d]));u?(r?.(),r=void 0,s()):a&&s()}),()=>{r?.(),r=void 0}}function Se(n,e,t){let r,o=!1;function s(){r?.(),r=void 0}return W([n],(i,a,u)=>{if(u.terminalDeps[0]!=null&&u.terminalDeps[0]!==!0){s();return}if(u.terminalDeps[0]===!0){o=!0,r||a.down([[E]]);return}let d=i[0];if(!(d==null||d.length===0))return s(),r=no(Ce(e(d[d.length-1])),a,()=>{s(),o&&a.down([[E]])}),{deactivate:()=>{s(),o=!1}}},{...to(t),completeWhenDepsComplete:!1,meta:{...re("switchMap"),...t?.meta??{}}})}var Qn=G(()=>{"use strict";ie();$e();se();tt()});var er=G(()=>{"use strict";Qn()});function Fe(n){return typeof n=="object"&&n!==null&&"subscribe"in n&&"down"in n}function tr(n){if(n<=0)throw new RangeError("timeoutMs must be > 0");if(n>9e6)throw new RangeError("timeoutMs must be <= 9_000_000 (\u22482.5h) to stay within safe ns arithmetic")}function nr(n,e={}){let t=new Be(n,e);return t.tagFactory("resilientPipeline",On(e)),t}var Be,rr=G(()=>{"use strict";$e();Hn();Dt();er();qt();Be=class extends Ee{output;status;lastError;breakerState;droppedCount;rateLimitState;constructor(e,t={}){super(t.name??"resilient_pipeline",t.graph);let r=e,o,s,i;if(t.rateLimit!=null)if(Fe(t.rateLimit)){let u=r,d=t.rateLimit;r=Se(d,c=>{let l={...c,maxBuffer:c.maxBuffer??1/0,meta:H("resilient","rate-limit")};return st(u,l).node}),this.add(r,{name:"rateLimited"})}else{let u={...t.rateLimit,maxBuffer:t.rateLimit.maxBuffer??1/0,meta:H("resilient","rate-limit")},d=st(r,u);r=d.node,o=d.droppedCount,s=d.rateLimitState,this.add(r,{name:"rateLimited"}),this.add(o,{name:"droppedCount"}),this.add(s,{name:"rateLimitState"})}if(t.budget!=null)if(Fe(t.budget)){let u=r,d=t.budget;r=Se(d,c=>c.length>0?Ie(u,c,{meta:H("resilient","budget")}):u),this.add(r,{name:"budgetGated"})}else t.budget.length>0&&(r=Ie(r,t.budget,{meta:H("resilient","budget")}),this.add(r,{name:"budgetGated"}));if(t.breaker!=null)if(Fe(t.breaker)){let u=r,d=t.breaker,c=t.breakerOnOpen??"skip";r=Se(d,l=>{let h=rt(l);return ot(h,{onOpen:c,meta:H("resilient","breaker")})(u).node}),this.add(r,{name:"breakerWrapped"})}else{let u=rt(t.breaker),d=t.breakerOnOpen??"skip",c=ot(u,{onOpen:d,meta:H("resilient","breaker")})(r);r=c.node,i=c.breakerState,this.add(r,{name:"breakerWrapped"}),this.add(i,{name:"breakerState"})}if(t.timeoutMs!=null)if(Fe(t.timeoutMs)){let u=r,d=t.timeoutMs;r=Se(d,c=>(tr(c),it(u,c*1e6,{meta:H("resilient","timeout")}))),this.add(r,{name:"timeoutWrapped"})}else tr(t.timeoutMs),r=it(r,t.timeoutMs*1e6,{meta:H("resilient","timeout")}),this.add(r,{name:"timeoutWrapped"});if(t.retry!=null)if(Fe(t.retry)){let u=r,d=t.retry;r=Se(d,c=>nt(u,{...c,meta:H("resilient","retry")})),this.add(r,{name:"retryWrapped"})}else r=nt(r,{...t.retry,meta:H("resilient","retry")}),this.add(r,{name:"retryWrapped"});t.fallback!==void 0&&(r=Kt(r,t.fallback,{meta:H("resilient","fallback")}),this.add(r,{name:"fallbackWrapped"}));let a=Ht(r,{initialStatus:t.initialStatus??"pending",meta:H("resilient","status")});this.output=a.node,this.status=a.status,this.lastError=a.error,this.breakerState=i,this.droppedCount=o,this.rateLimitState=s,this.add(this.output,{name:"output"}),this.add(this.status,{name:"status"}),this.add(this.lastError,{name:"lastError"})}}});function be(n){return{describeKind:"derived",...n}}function ro(n){return n<0?0:n}function Yt(n){return n[1]}function oo(n){if(typeof n!="number"||!Number.isFinite(n))throw new TypeError("backoff strategy must return a finite number");return n<0?0:n}function or(n){let e=n?.count,t=n?.backoff;if(t!==void 0&&e===void 0)throw new RangeError("retry({ backoff }) requires explicit count to prevent unbounded retries; pass { count: <n>, backoff: ... }");let r=e!==void 0?e:0;if(r<0)throw new RangeError("retry count must be >= 0");let o=t===void 0?null:typeof t=="string"?Ut(t):t;return{maxRetries:r,strategy:o}}function sr(n){let e={};return n?.count!==void 0&&(e.count=n.count),typeof n?.backoff=="string"&&(e.backoff=n.backoff),Object.keys(e).length>0?e:void 0}function ir(n,e,t){let r=0,o=!1,s=null,i,a=new ae;function u(){i?.(),i=void 0}function d(l){if(o)return;if(r>=n.maxRetries){u(),t.down([[N,l]]);return}let h=n.strategy===null?0:n.strategy(r,l,s);if(h==null){u(),t.down([[N,l]]);return}let p;try{p=oo(h)}catch{u(),t.down([[N,l]]);return}s=p,r+=1,u();let f=p>0?p/1e6:1;a.start(f,()=>{o||c()})}function c(){a.cancel(),u();let l;try{l=e()}catch(h){d(h);return}i=l.subscribe(h=>{if(!o)for(let p of h){let f=p[0];if(f===M)t.down([[M]]);else if(f===x)r=0,s=null,t.emit(p[1]);else if(f===D)t.down([[D]]);else if(f===E)u(),t.down([[E]]);else if(f===N){d(Yt(p));return}else t.down([p])}})}return c(),()=>{o=!0,a.cancel(),u()}}function nt(n,e){return typeof n=="function"?io(n,e):so(n,e)}function so(n,e){let t=or(e);return F(r=>ir(t,()=>n,r),{...be(),initial:n.cache,meta:{...e?.meta??{},...re("retry",sr(e))}})}function io(n,e){let t=or(e);return F(r=>ir(t,n,r),{...be(),initial:e?.initial,meta:{...e?.meta??{},...re("retry",sr(e))}})}function rt(n){let e=Math.max(1,n?.failureThreshold??5),t=ro(n?.cooldownNs??30*1e9),r=n?.cooldown??null,o=Math.max(1,n?.halfOpenMax??1),s=n?.now??X,i="closed",a=0,u=0,d=0,c=t,l=0;function h(){if(!r)return t;let g=r(u);return g!==null?g:t}function p(){i="open",c=h(),d=s(),l=0}return{canExecute(){return i==="closed"?!0:i==="open"?s()-d>=c?(i="half-open",l=1,!0):!1:l<o?(l++,!0):!1},recordSuccess(){i==="half-open"?(i="closed",a=0,u=0):i==="closed"&&(a=0)},recordFailure(g){if(i==="half-open"){u++,p();return}i==="closed"&&(a++,a>=e&&p())},get state(){return i},get failureCount(){return a},reset(){i="closed",a=0,u=0,l=0}}}function ot(n,e){let t=e?.onOpen??"skip",r=e?.meta;return o=>{let s=W([],(i,a)=>{function u(){s.meta.breakerState.down([[x,n.state]])}let d=o.subscribe(c=>{for(let l of c){let h=l[0];h===M?a.down([[M]]):h===x?n.canExecute()?(u(),a.emit(l[1])):(u(),t==="error"?a.down([[N,new ut]]):a.down([[D]])):h===D?a.down([[D]]):h===E?(n.recordSuccess(),u(),a.down([[E]])):h===N?(n.recordFailure(Yt(l)),u(),a.down([l])):a.down([l])}});return u(),d},{...be(),meta:{...r??{},breakerState:n.state,...re("withBreaker",{onOpen:t})},completeWhenDepsComplete:!1,initial:o.cache});return{node:s,breakerState:s.meta.breakerState}}}function ar(n,e,t){if(n<=0)throw new RangeError("capacity must be > 0");if(e<0)throw new RangeError("refillPerSecond must be >= 0");let r=t?.clock??X,o=n,s=r();function i(a){if(e>0){let u=a-s;o=Math.min(n,o+u/1e9*e)}s=a}return{available(){return i(r()),o},tryConsume(a=1){if(a<=0)return!0;let u=r();return i(u),o>=a?(o-=a,!0):!1},putBack(a=1){a<=0||(i(r()),o=Math.min(n,o+a))}}}function ao(n,e){return n.droppedCount===e.droppedCount&&n.pendingCount===e.pendingCount&&n.paused===e.paused}function st(n,e){let{maxEvents:t,windowNs:r}=e;if(t<=0)throw new RangeError("maxEvents must be > 0");if(r<=0)throw new RangeError("windowNs must be > 0");let o=e.maxBuffer;if(o===void 0)throw new RangeError("rateLimiter requires explicit maxBuffer (use Infinity to opt in to unbounded)");let s=o===1/0;if(!s&&(!Number.isInteger(o)||o<1))throw new RangeError("maxBuffer must be a positive integer (or Infinity for unbounded)");let i=e.onOverflow??"drop-newest",a=t*1e9/r,u=F(d=>{let c=ar(t,a),l=s?co():uo(o),h=new ae,p=!1,f=0,g=1e9/a,m=u.meta.droppedCount,T=u.meta.rateLimitState,b=at;function y(){m.emit(f);let S={droppedCount:f,pendingCount:l.size,paused:l.size>0};ao(b,S)||(b=S,T.emit(S))}b=at,m.emit(0),T.emit(at);function v(){for(;l.size>0;)if(c.tryConsume(1))d.emit(l.shift()),y();else{h.start(Math.max(1,g/1e6),v);return}}function w(){f+=1,y()}function _(){for(p=!0,h.cancel();l.size>0;)l.shift();f=0}let R=n.subscribe(S=>{for(let C of S){if(p)return;let A=C[0];if(A===M)d.down([[M]]);else if(A===x){if(!s&&l.size>=o)if(i==="drop-newest")w();else if(i==="drop-oldest")l.shift(),l.push(C[1]),w();else{w(),_(),d.down([[N,new dt(o)]]);return}else l.push(C[1]),y();v()}else if(A===D)d.down([[D]]);else if(A===E)_(),d.down([[E]]);else if(A===N)_(),d.down([C]);else if(A===B){_(),d.down([C]);return}else d.down([C])}});return()=>{p=!0,h.cancel(),R()}},{...be(),initial:n.cache,meta:{...e.meta??{},droppedCount:0,rateLimitState:at,...re("rateLimiter",e)}});return{node:u,droppedCount:u.meta.droppedCount,rateLimitState:u.meta.rateLimitState}}function uo(n){let e=new pe(n);return{push:t=>e.push(t),shift:()=>e.shift(),get size(){return e.size}}}function co(){let n=[];return{push:e=>{n.push(e)},shift:()=>n.shift(),get size(){return n.length}}}function Ht(n,e){let t=e?.initialStatus??"pending",r=e?.meta,o=W([],(s,i)=>{let a=t;return o.meta.status.down([[x,t]]),o.meta.error.down([[x,null]]),n.subscribe(d=>{for(let c of d){let l=c[0];if(l===M)i.down([[M]]);else if(l===x)a==="errored"?Ge(()=>{o.meta.error.down([[x,null]]),o.meta.status.down([[x,"running"]])}):o.meta.status.down([[x,"running"]]),a="running",i.emit(c[1]);else if(l===D)i.down([[D]]);else if(l===E)o.meta.status.down([[x,"completed"]]),a="completed",i.down([[E]]);else if(l===N){let h=Yt(c);Ge(()=>{o.meta.error.down([[x,h]]),o.meta.status.down([[x,"errored"]])}),a="errored",i.down([c])}else i.down([c])}})},{...be(),meta:{...r??{},status:t,error:null,...re("withStatus",{initialStatus:t})},completeWhenDepsComplete:!1,resubscribable:!0,initial:n.cache});return{node:o,status:o.meta.status,error:o.meta.error}}function lo(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"}function fo(n){return n!=null&&typeof n.then=="function"}function po(n){return n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function"}function Kt(n,e,t){let r=t?.meta;return F(o=>{let s,i;function a(){i?.(),i=void 0,lo(e)||fo(e)||po(e)?s=Ce(e).subscribe(d=>{o.down(d);for(let c of d){let l=c[0];if(l===E||l===N||l===B){s=void 0;return}}}):(o.emit(e),o.down([[E]]))}return i=n.subscribe(u=>{for(let d of u){let c=d[0];if(c===M)o.down([[M]]);else if(c===x)o.emit(d[1]);else if(c===D)o.down([[D]]);else if(c===E)o.down([[E]]);else if(c===N){a();return}else if(c===B){s?.(),o.down([d]);return}else o.down([d])}}),()=>{i?.(),s?.()}},{...be(),initial:n.cache,meta:{...r??{},...re("fallback")}})}function it(n,e,t){if(e<=0)throw new RangeError("timeoutNs must be > 0");let r=t?.meta;return F(o=>{let s=!1,i=new ae;function a(){let d=e/1e6;i.start(d,()=>{s||(s=!0,u(),o.down([[N,new ct(e)]]))})}let u=n.subscribe(d=>{for(let c of d){if(s)return;let l=c[0];if(l===M)o.down([[M]]);else if(l===x)a(),o.emit(c[1]);else if(l===D)o.down([[D]]);else if(l===E){i.cancel(),s=!0,o.down([[E]]);return}else if(l===N){i.cancel(),s=!0,o.down([c]);return}else if(l===B){i.cancel(),s=!0,o.down([c]);return}else o.down([c])}});return a(),()=>{s=!0,i.cancel(),u()}},{...be(),initial:n.cache,meta:{...r??{},...re("timeout",{timeoutNs:e})}})}var ut,dt,at,ct,qt=G(()=>{"use strict";Nn();rr();He();we();ie();$e();se();Je();Wt();tt();Ft();Bt();ut=class extends Error{name="CircuitOpenError";constructor(){super("Circuit breaker is open")}};dt=class extends Error{name="RateLimiterOverflowError";constructor(e){super(`rateLimiter buffer overflow (maxBuffer=${e})`)}};at=Object.freeze({droppedCount:0,pendingCount:0,paused:!1});ct=class extends Error{name="TimeoutError";constructor(e){super(`Timed out after ${e/1e6}ms`)}}});var ur={};bt(ur,{CircuitOpenError:()=>ut,RateLimiterOverflowError:()=>dt,ResilientPipelineGraph:()=>Be,TimeoutError:()=>ct,budgetGate:()=>Ie,circuitBreaker:()=>rt,fallback:()=>Kt,rateLimiter:()=>st,resilientPipeline:()=>nr,retry:()=>nt,timeout:()=>it,tokenBucket:()=>ar,withBreaker:()=>ot,withStatus:()=>Ht});var dr=G(()=>{"use strict";qt()});function Y(n){return{describeKind:"producer",...n}}function lr(n){return/[\\^$+?.()|[\]{}]/.test(n)?`\\${n}`:n}function ho(n){let e="^";for(let t=0;t<n.length;t+=1){let r=n[t];if(r==="*"){n[t+1]==="*"?(e+=".*",t+=1):e+="[^/]*";continue}e+=lr(r)}return e+="$",new RegExp(e)}function mo(n,e){for(let t of e)if(t.test(n))return!0;return!1}function go(n,e){let t=W([n],(o,s)=>{let i=o[0];if(i==null||i.length===0){s.down([[D]]);return}for(let a of i)s.emit(a)},{describeKind:"derived",initial:n.cache}),r=t.subscribe.bind(t);return t.subscribe=(o,s)=>(e(o),r(o,s)),t}function bo(n,e){let{signal:t,period:r,...o}=e??{};return F(s=>{let i=!1,a=0,u,d,c=()=>{i=!0,u!==void 0&&clearTimeout(u),d!==void 0&&clearInterval(d),t?.removeEventListener("abort",h)},l=()=>{i||(r!=null?(s.emit(a++),d=setInterval(()=>{i||s.emit(a++)},r)):(i=!0,t?.removeEventListener("abort",h),s.emit(a++),s.down([[E]])))},h=()=>{i||(c(),s.down([[N,t.reason]]))};if(t?.aborted){h();return}return u=setTimeout(l,n),t?.addEventListener("abort",h,{once:!0}),c},Y(o))}function yo(n){let{signal:e,...t}=n??{};return F(r=>{let o=!1,s,i,a=!1,u=!1,d=typeof requestAnimationFrame=="function"?requestAnimationFrame:void 0,c=typeof cancelAnimationFrame=="function"?cancelAnimationFrame:void 0,l=typeof document<"u"?document:void 0,h=()=>{s!==void 0&&c&&c(s),i!==void 0&&clearTimeout(i),s=void 0,i=void 0},p=()=>{o=!0,h(),a&&(e?.removeEventListener("abort",f),a=!1),u&&l&&(l.removeEventListener("visibilitychange",T),u=!1)},f=()=>{o||(p(),r.down([[N,e.reason]]))},g=b=>{o||(r.emit(b),m())},m=()=>{o||(d&&(!l||l.visibilityState!=="hidden")?s=d(g):i=setTimeout(()=>g(performance.now()),16))},T=()=>{o||(h(),m())};return e?.aborted?(f(),p):(e?.addEventListener("abort",f,{once:!0}),a=e!==void 0,l&&d&&(l.addEventListener("visibilitychange",T),u=!0),m(),p)},Y(t))}function vo(n,e){let t=wn(n),{tickMs:r,output:o,...s}=e??{},i=r??6e4,a=o==="date";return F(u=>{let d=-1,c=()=>{let h=new Date,p=h.getFullYear()*1e8+(h.getMonth()+1)*1e6+h.getDate()*1e4+h.getHours()*100+h.getMinutes();p!==d&&Tn(t,h)&&(d=p,u.emit(a?h:ve()))};c();let l=setInterval(c,i);return()=>clearInterval(l)},{...Y(s),name:s.name??`cron:${n}`})}function wo(n,e,t){let{capture:r,passive:o,once:s,...i}=t??{};return F(a=>{let u=c=>{a.emit(c)},d={capture:r,passive:o,once:s};return n.addEventListener(e,u,d),()=>n.removeEventListener(e,u,d)},Y(i))}function Xt(n,e){return F(t=>{let r=!1;try{for(let o of n){if(r)return;t.emit(o)}r||t.down([[E]])}catch(o){r||t.down([[N,o]])}return()=>{r=!0}},Y(e))}function To(n){return n!=null&&typeof n.then=="function"}function fr(n,e){let{signal:t,...r}=e??{};return F(o=>{let s=!1,i=()=>{s||(s=!0,o.down([[N,t.reason]]))};if(t?.aborted){i();return}return t?.addEventListener("abort",i,{once:!0}),Promise.resolve(n).then(a=>{s||(s=!0,t?.removeEventListener("abort",i),o.emit(a),o.down([[E]]))},a=>{s||(s=!0,t?.removeEventListener("abort",i),o.down([[N,a]]))}),()=>{s=!0,t?.removeEventListener("abort",i)}},Y(r))}function pr(n,e){let{signal:t,...r}=e??{};return F(o=>{let s=new AbortController,i=()=>s.abort(t?.reason);t?.aborted?s.abort(t.reason):t?.addEventListener("abort",i,{once:!0});let a=t??s.signal,u=!1,d=n[Symbol.asyncIterator](),c=()=>{u||a.aborted||Promise.resolve(d.next()).then(l=>{if(!(u||a.aborted)){if(l.done){o.down([[E]]);return}o.emit(l.value),c()}},l=>{!u&&!a.aborted&&o.down([[N,l]])})};return c(),()=>{u=!0,t?.removeEventListener("abort",i),s.abort(),Promise.resolve(d.return?.()).catch(()=>{})}},Y(r))}function _o(n){return n!=null&&typeof n=="object"&&"cache"in n&&typeof n.subscribe=="function"}function Ce(n,e){if(_o(n))return n;if(To(n))return fr(n,e);if(n!=null){let t=n;if(typeof t[Symbol.asyncIterator]=="function")return pr(n,e);if(typeof t[Symbol.iterator]=="function")return Xt(n,e)}return hr(n)}function hr(...n){return Xt(n,void 0)}function No(n){return F(e=>{e.down([[E]])},Y(n))}function Oo(n){return F(()=>{},Y(n))}function ko(n,e){return F(t=>{t.down([[N,n]])},Y(e))}function xo(n,e){let{signal:t,...r}=e??{},o=Y(r),s=o.resubscribable===void 0?{...o,resubscribable:!0}:o;return F(i=>{let a,u=!1;try{let d=n();a=Ce(d,e).subscribe(l=>{if(!u)for(let h of l){let p=h[0];if(p!==oe)if(p===x)i.emit(h[1]);else if(p===E){u=!0,i.down([[E]]);break}else if(p===N){u=!0,i.down([[N,h[1]]]);break}else i.down([h])}})}catch(d){let c=d===void 0?new Error("defer: thunk threw undefined"):d;i.down([[N,c]])}return()=>{u=!0,a?.()}},s)}function Eo(n,e,t){return W([n],(o,s)=>{let i=o[0];if(i!=null&&i.length>0)for(let a of i)e(a)},{describeKind:"effect",...t}).subscribe(()=>{})}function Ro(n,e){return W([n],(t,r,o)=>{o.store.buf||(o.store.buf=[]);let s=o.store.buf,i=t[0];if(i!=null&&i.length>0)for(let a of i)s.push(a);if(o.terminalDeps[0]===!0){r.emit([...s]),r.down([[E]]);return}(i==null||i.length===0)&&r.down([[D]])},{describeKind:"derived",completeWhenDepsComplete:!1,...e})}function So(n,e){return F(t=>n.subscribe(r=>{t.down(r)}),{...Y(e),initial:n.cache})}function Qt(n,e,t){if(e<1)throw new RangeError("replay expects bufferSize >= 1");let r=[],o=F(s=>n.subscribe(i=>{for(let a of i)a[0]===x&&(r.push(a[1]),r.length>e&&r.shift());s.down(i)}),{...Y(t),initial:n.cache});return go(o,s=>{for(let i of r)s([[x,i]])})}function Co(n,e){return Qt(n,1,e)}function Ao(n){return new Promise((e,t)=>{let r=!1,o=!1,s;s=n.subscribe(i=>{for(let a of i){if(r)return;if(a[0]===x){r=!0,e(a[1]),s?(s(),s=void 0):o=!0;return}if(a[0]===N){r=!0,t(a[1]),s?(s(),s=void 0):o=!0;return}if(a[0]===E){r=!0,t(new Error("completed without DATA")),s?(s(),s=void 0):o=!0;return}}}),o&&(s?.(),s=void 0)})}function Zt(n,e,t){return new Promise((r,o)=>{let s=!1,i=!1,a,u=t?.skipCurrent===!0;a=n.subscribe(d=>{for(let c of d){if(s)return;if(!(u&&c[0]===x)){if(c[0]===x){let l=c[1];if(e(l)){s=!0,r(l),a?(a(),a=void 0):i=!0;return}}if(c[0]===N){s=!0,o(c[1]),a?(a(),a=void 0):i=!0;return}if(c[0]===E){s=!0,o(new Error("completed without matching value")),a?(a(),a=void 0):i=!0;return}}}}),u=!1,i&&(a?.(),a=void 0)})}async function Do(n,e){let t=e?.predicate??(s=>s!=null),r=e?.skipCurrent;if(e?.timeoutMs==null||e.timeoutMs<=0)return await Zt(n,t,{skipCurrent:r});if(Jt===void 0){let[s,i]=await Promise.all([Promise.resolve().then(()=>(dr(),ur)),Promise.resolve().then(()=>(Wt(),Xn))]);Jt=s.timeout,cr=i.NS_PER_MS}let o=Jt(n,e.timeoutMs*cr);return await Zt(o,t,{skipCurrent:r})}function Mo(n,e){let t=new AbortController,r=e?.reason??new Error("cancelled via nodeSignal"),o,s=!1,i=()=>{o?(o(),o=void 0):s=!0};return o=n.subscribe(a=>{if(!t.signal.aborted)for(let u of a){if(u[0]===x&&u[1]===!0){t.abort(r),i();return}if(u[0]===N){t.abort(u[1]),i();return}if(u[0]===E){i();return}}}),s&&(o?.(),o=void 0),{signal:t.signal,dispose:()=>{o&&(o(),o=void 0)}}}function Le(n){return n.subscribe(()=>{})}function Po(n){let e=fe(0);return{node:e,increment(){let t=e.cache??0;return t>=n?!1:(e.down([[M],[x,t+1]]),!0)},get(){return e.cache??0},atCap(){return(e.cache??0)>=n}}}var Jt,cr,Go,mr=G(()=>{"use strict";we();ie();se();Je();_n();Go=Qt});var Io={};bt(Io,{awaitSettled:()=>Do,cached:()=>Co,defer:()=>xo,empty:()=>No,escapeRegexChar:()=>lr,firstValueFrom:()=>Ao,firstWhere:()=>Zt,forEach:()=>Eo,fromAny:()=>Ce,fromAsyncIter:()=>pr,fromCron:()=>vo,fromEvent:()=>wo,fromIter:()=>Xt,fromPromise:()=>fr,fromRaf:()=>yo,fromTimer:()=>bo,globToRegExp:()=>ho,keepalive:()=>Le,matchesAnyPattern:()=>mo,never:()=>Oo,nodeSignal:()=>Mo,of:()=>hr,reactiveCounter:()=>Po,replay:()=>Qt,share:()=>So,shareReplay:()=>Go,throwError:()=>ko,toArray:()=>Ro});module.exports=wr(Io);var tt=G(()=>{mr()});tt();0&&(module.exports={awaitSettled,cached,defer,empty,escapeRegexChar,firstValueFrom,firstWhere,forEach,fromAny,fromAsyncIter,fromCron,fromEvent,fromIter,fromPromise,fromRaf,fromTimer,globToRegExp,keepalive,matchesAnyPattern,never,nodeSignal,of,reactiveCounter,replay,share,shareReplay,throwError,toArray});
|
package/dist/extra/sources.d.cts
CHANGED
package/dist/extra/sources.d.ts
CHANGED
package/dist/extra/sources.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-
|
|
1
|
+
import{A as y,B as z,C as A,D as B,c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n,q as o,r as p,s as q,t as r,u as s,v as t,w as u,x as v,y as w,z as x}from"../chunk-2K5RXLAH.js";import"../chunk-LYCLF26R.js";import"../chunk-CK2E7BTU.js";import"../chunk-QYADASLV.js";export{x as awaitSettled,u as cached,p as defer,m as empty,a as escapeRegexChar,v as firstValueFrom,w as firstWhere,q as forEach,k as fromAny,j as fromAsyncIter,f as fromCron,g as fromEvent,h as fromIter,i as fromPromise,e as fromRaf,d as fromTimer,b as globToRegExp,A as keepalive,c as matchesAnyPattern,n as never,y as nodeSignal,l as of,B as reactiveCounter,t as replay,s as share,z as shareReplay,o as throwError,r as toArray};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KvStorageTier } from './extra/storage-tiers.js';
|
|
2
|
-
import { C as ChatMessage, a as LLMInvokeOptions, L as LLMAdapter, b as LLMResponse, S as StreamDelta } from './types-
|
|
2
|
+
import { C as ChatMessage, a as LLMInvokeOptions, L as LLMAdapter, b as LLMResponse, S as StreamDelta } from './types-DkzUUs0H.js';
|
|
3
3
|
import { d as canonicalJson$1 } from './content-addressed-storage-DuYMjV7o.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { KvStorageTier } from './extra/storage-tiers.cjs';
|
|
2
|
-
import { C as ChatMessage, a as LLMInvokeOptions, L as LLMAdapter, b as LLMResponse, S as StreamDelta } from './types-
|
|
2
|
+
import { C as ChatMessage, a as LLMInvokeOptions, L as LLMAdapter, b as LLMResponse, S as StreamDelta } from './types-B1jDWVsM.cjs';
|
|
3
3
|
import { d as canonicalJson$1 } from './content-addressed-storage-4-ST1tYk.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|